waku.org/assets/js/755.9a8cac84.js

2 lines
3.2 MiB

/*! For license information please see 755.9a8cac84.js.LICENSE.txt */
(self.webpackChunkwaku_docusaurus_template=self.webpackChunkwaku_docusaurus_template||[]).push([[755],{82688:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.generateCstDts=void 0;var i=r(62222),a=r(75580),s={includeVisitorInterface:!0,visitorInterfaceName:"ICstNodeVisitor"};t.generateCstDts=function(e,t){var r=n(n({},s),t),o=(0,i.buildModel)(e);return(0,a.genDts)(o,r)}},75580:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.genDts=void 0;var i=n(r(85564)),a=n(r(1469)),s=n(r(35161)),o=n(r(54061)),l=n(r(44908)),c=n(r(11700));function u(e){return"token"===e.kind?"IToken":h(e.name)}function h(e){return(0,c.default)(e)+"CstNode"}function d(e){return(0,c.default)(e)+"CstChildren"}t.genDts=function(e,t){var r,n,c=[];return c=(c=c.concat('import type { CstNode, ICstVisitor, IToken } from "chevrotain";')).concat((0,i.default)((0,s.default)(e,(function(e){return function(e){var t=function(e){var t=h(e.name),r=d(e.name);return"export interface ".concat(t,' extends CstNode {\n name: "').concat(e.name,'";\n children: ').concat(r,";\n}")}(e),r=function(e){var t=d(e.name);return"export type ".concat(t," = {\n ").concat((0,s.default)(e.properties,(function(e){return function(e){var t=function(e){if((0,a.default)(e)){var t=(0,l.default)((0,s.default)(e,(function(e){return u(e)})));return"("+(0,o.default)(t,(function(e,t){return e+" | "+t}))+")"}return u(e)}(e.type);return"".concat(e.name).concat(e.optional?"?":"",": ").concat(t,"[];")}(e)})).join("\n "),"\n};")}(e);return[t,r]}(e)})))),t.includeVisitorInterface&&(c=c.concat((r=t.visitorInterfaceName,n=e,"export interface ".concat(r,"<IN, OUT> extends ICstVisitor<IN, OUT> {\n ").concat((0,s.default)(n,(function(e){return function(e){var t=d(e.name);return"".concat(e.name,"(children: ").concat(t,", param?: IN): OUT;")}(e)})).join("\n "),"\n}")))),c.join("\n\n")+"\n"}},62222:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.buildModel=void 0;var s=r(93062),o=a(r(35161)),l=a(r(85564)),c=a(r(52628)),u=a(r(59704)),h=a(r(7739)),d=a(r(28583));t.buildModel=function(e){var t=new p,r=(0,c.default)(e);return(0,o.default)(r,(function(e){return t.visitRule(e)}))};var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.visitRule=function(e){var t=this.visitEach(e.definition),r=(0,h.default)(t,(function(e){return e.propertyName})),n=(0,o.default)(r,(function(e,t){var r=!(0,u.default)(e,(function(e){return!e.canBeNull})),n=e[0].type;return e.length>1&&(n=(0,o.default)(e,(function(e){return e.type}))),{name:t,type:n,optional:r}}));return{name:e.name,properties:n}},t.prototype.visitAlternative=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})},t.prototype.visitOption=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})},t.prototype.visitRepetition=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})},t.prototype.visitRepetitionMandatory=function(e){return this.visitEach(e.definition)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){return this.visitEach(e.definition).concat({propertyName:e.separator.name,canBeNull:!0,type:f(e.separator)})},t.prototype.visitRepetitionWithSeparator=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0}).concat({propertyName:e.separator.name,canBeNull:!0,type:f(e.separator)})},t.prototype.visitAlternation=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})},t.prototype.visitTerminal=function(e){return[{propertyName:e.label||e.terminalType.name,canBeNull:!1,type:f(e)}]},t.prototype.visitNonTerminal=function(e){return[{propertyName:e.label||e.nonTerminalName,canBeNull:!1,type:f(e)}]},t.prototype.visitEachAndOverrideWith=function(e,t){return(0,o.default)(this.visitEach(e),(function(e){return(0,d.default)({},e,t)}))},t.prototype.visitEach=function(e){var t=this;return(0,l.default)((0,o.default)(e,(function(e){return t.visit(e)})))},t}(s.GAstVisitor);function f(e){return e instanceof s.NonTerminal?{kind:"rule",name:e.referencedRule.name}:{kind:"token"}}},93062:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSequenceProd=t.isBranchingProd=t.isOptionalProd=t.getProductionDslName=t.GAstVisitor=t.serializeProduction=t.serializeGrammar=t.Alternative=t.Alternation=t.RepetitionWithSeparator=t.RepetitionMandatoryWithSeparator=t.RepetitionMandatory=t.Repetition=t.Option=t.NonTerminal=t.Terminal=t.Rule=void 0;var n=r(94490);Object.defineProperty(t,"Rule",{enumerable:!0,get:function(){return n.Rule}}),Object.defineProperty(t,"Terminal",{enumerable:!0,get:function(){return n.Terminal}}),Object.defineProperty(t,"NonTerminal",{enumerable:!0,get:function(){return n.NonTerminal}}),Object.defineProperty(t,"Option",{enumerable:!0,get:function(){return n.Option}}),Object.defineProperty(t,"Repetition",{enumerable:!0,get:function(){return n.Repetition}}),Object.defineProperty(t,"RepetitionMandatory",{enumerable:!0,get:function(){return n.RepetitionMandatory}}),Object.defineProperty(t,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return n.RepetitionMandatoryWithSeparator}}),Object.defineProperty(t,"RepetitionWithSeparator",{enumerable:!0,get:function(){return n.RepetitionWithSeparator}}),Object.defineProperty(t,"Alternation",{enumerable:!0,get:function(){return n.Alternation}}),Object.defineProperty(t,"Alternative",{enumerable:!0,get:function(){return n.Alternative}}),Object.defineProperty(t,"serializeGrammar",{enumerable:!0,get:function(){return n.serializeGrammar}}),Object.defineProperty(t,"serializeProduction",{enumerable:!0,get:function(){return n.serializeProduction}});var i=r(62156);Object.defineProperty(t,"GAstVisitor",{enumerable:!0,get:function(){return i.GAstVisitor}});var a=r(53559);Object.defineProperty(t,"getProductionDslName",{enumerable:!0,get:function(){return a.getProductionDslName}}),Object.defineProperty(t,"isOptionalProd",{enumerable:!0,get:function(){return a.isOptionalProd}}),Object.defineProperty(t,"isBranchingProd",{enumerable:!0,get:function(){return a.isBranchingProd}}),Object.defineProperty(t,"isSequenceProd",{enumerable:!0,get:function(){return a.isSequenceProd}})},53559:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getProductionDslName=t.isBranchingProd=t.isOptionalProd=t.isSequenceProd=void 0;var i=n(r(59704)),a=n(r(711)),s=n(r(64721)),o=r(94490);t.isSequenceProd=function(e){return e instanceof o.Alternative||e instanceof o.Option||e instanceof o.Repetition||e instanceof o.RepetitionMandatory||e instanceof o.RepetitionMandatoryWithSeparator||e instanceof o.RepetitionWithSeparator||e instanceof o.Terminal||e instanceof o.Rule},t.isOptionalProd=function e(t,r){return void 0===r&&(r=[]),!!(t instanceof o.Option||t instanceof o.Repetition||t instanceof o.RepetitionWithSeparator)||(t instanceof o.Alternation?(0,i.default)(t.definition,(function(t){return e(t,r)})):!(t instanceof o.NonTerminal&&(0,s.default)(r,t))&&(t instanceof o.AbstractProduction&&(t instanceof o.NonTerminal&&r.push(t),(0,a.default)(t.definition,(function(t){return e(t,r)})))))},t.isBranchingProd=function(e){return e instanceof o.Alternation},t.getProductionDslName=function(e){if(e instanceof o.NonTerminal)return"SUBRULE";if(e instanceof o.Option)return"OPTION";if(e instanceof o.Alternation)return"OR";if(e instanceof o.RepetitionMandatory)return"AT_LEAST_ONE";if(e instanceof o.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(e instanceof o.RepetitionWithSeparator)return"MANY_SEP";if(e instanceof o.Repetition)return"MANY";if(e instanceof o.Terminal)return"CONSUME";throw Error("non exhaustive match")}},94490:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.serializeProduction=t.serializeGrammar=t.Terminal=t.Alternation=t.RepetitionWithSeparator=t.Repetition=t.RepetitionMandatoryWithSeparator=t.RepetitionMandatory=t.Option=t.Alternative=t.Rule=t.NonTerminal=t.AbstractProduction=void 0;var s=a(r(35161)),o=a(r(84486)),l=a(r(47037)),c=a(r(96347)),u=a(r(35937)),h=a(r(28583));function d(e){return t=e,(0,l.default)(t.LABEL)&&""!==t.LABEL?e.LABEL:e.name;var t}var p=function(){function e(e){this._definition=e}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){e.visit(this),(0,o.default)(this.definition,(function(t){t.accept(e)}))},e}();t.AbstractProduction=p;var f=function(e){function t(t){var r=e.call(this,[])||this;return r.idx=1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),Object.defineProperty(t.prototype,"definition",{get:function(){return void 0!==this.referencedRule?this.referencedRule.definition:[]},set:function(e){},enumerable:!1,configurable:!0}),t.prototype.accept=function(e){e.visit(this)},t}(p);t.NonTerminal=f;var m=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.orgText="",(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.Rule=m;var g=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.ignoreAmbiguities=!1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.Alternative=g;var v=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.Option=v;var A=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.RepetitionMandatory=A;var y=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.RepetitionMandatoryWithSeparator=y;var x=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.Repetition=x;var b=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.RepetitionWithSeparator=b;var w=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,r.ignoreAmbiguities=!1,r.hasPredicates=!1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),Object.defineProperty(t.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),t}(p);t.Alternation=w;var E=function(){function e(e){this.idx=1,(0,h.default)(this,(0,u.default)(e,(function(e){return void 0!==e})))}return e.prototype.accept=function(e){e.visit(this)},e}();function S(e){function t(e){return(0,s.default)(e,S)}if(e instanceof f){var r={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return(0,l.default)(e.label)&&(r.label=e.label),r}if(e instanceof g)return{type:"Alternative",definition:t(e.definition)};if(e instanceof v)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof A)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof y)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:S(new E({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof b)return{type:"RepetitionWithSeparator",idx:e.idx,separator:S(new E({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof x)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof w)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof E){var n={type:"Terminal",name:e.terminalType.name,label:d(e.terminalType),idx:e.idx};(0,l.default)(e.label)&&(n.terminalLabel=e.label);var i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(n.pattern=(0,c.default)(i)?i.source:i),n}if(e instanceof m)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}t.Terminal=E,t.serializeGrammar=function(e){return(0,s.default)(e,S)},t.serializeProduction=S},62156:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GAstVisitor=void 0;var n=r(94490),i=function(){function e(){}return e.prototype.visit=function(e){var t=e;switch(t.constructor){case n.NonTerminal:return this.visitNonTerminal(t);case n.Alternative:return this.visitAlternative(t);case n.Option:return this.visitOption(t);case n.RepetitionMandatory:return this.visitRepetitionMandatory(t);case n.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case n.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case n.Repetition:return this.visitRepetition(t);case n.Alternation:return this.visitAlternation(t);case n.Terminal:return this.visitTerminal(t);case n.Rule:return this.visitRule(t);default:throw Error("non exhaustive match")}},e.prototype.visitNonTerminal=function(e){},e.prototype.visitAlternative=function(e){},e.prototype.visitOption=function(e){},e.prototype.visitRepetition=function(e){},e.prototype.visitRepetitionMandatory=function(e){},e.prototype.visitRepetitionMandatoryWithSeparator=function(e){},e.prototype.visitRepetitionWithSeparator=function(e){},e.prototype.visitAlternation=function(e){},e.prototype.visitTerminal=function(e){},e.prototype.visitRule=function(e){},e}();t.GAstVisitor=i},68877:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFastProperties=t.timer=t.PRINT_ERROR=t.PRINT_WARNING=void 0;var n=r(73017);Object.defineProperty(t,"PRINT_WARNING",{enumerable:!0,get:function(){return n.PRINT_WARNING}}),Object.defineProperty(t,"PRINT_ERROR",{enumerable:!0,get:function(){return n.PRINT_ERROR}});var i=r(99870);Object.defineProperty(t,"timer",{enumerable:!0,get:function(){return i.timer}});var a=r(55591);Object.defineProperty(t,"toFastProperties",{enumerable:!0,get:function(){return a.toFastProperties}})},73017:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PRINT_WARNING=t.PRINT_ERROR=void 0,t.PRINT_ERROR=function(e){console&&console.error&&console.error("Error: ".concat(e))},t.PRINT_WARNING=function(e){console&&console.warn&&console.warn("Warning: ".concat(e))}},99870:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timer=void 0,t.timer=function(e){var t=(new Date).getTime(),r=e();return{time:(new Date).getTime()-t,value:r}}},55591:(e,t)=>{"use strict";function r(e){function t(){}t.prototype=e;var r=new t;function n(){return typeof r.bar}return n(),n(),e}Object.defineProperty(t,"__esModule",{value:!0}),t.toFastProperties=void 0,t.toFastProperties=r},93152:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Box=void 0;const n=r(70655),i=n.__importDefault(r(86010)),a=n.__importDefault(r(67294)),s=r(9259);function o(e,t,r,n){const i="string"==typeof t||"number"==typeof t?{xs:t}:t,a=[],s=e=>"number"==typeof e&&n?`${e}${n}`:`${e}`;return["xs","sm","md","lg","xl"].forEach(((t,n)=>{const o=i[t];if(o)a.push([`${e}-${t}`,s(o)]);else{var l;const i=null==(l=a[n-1])?void 0:l[1];a.push([`${e}-${t}`,i||s(r)])}})),Object.fromEntries(a)}r(56216);t.Box=e=>{let{top:t=0,bottom:r=0,className:n,style:l={},children:c,...u}=e;return a.default.createElement("div",{className:(0,i.default)(n,"mdx-box"),style:(0,s.makeStyle)({...l},{...o("mdx-box-top",t,0,"px"),...o("mdx-box-bottom",r,0,"px")}),...u},c)}},32765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(93152),t)},40299:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallToActionButton=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(88746)),s=n.__importDefault(r(86010)),o=n.__importDefault(r(67294));r(51928);t.CallToActionButton=e=>{let{className:t,variant:r="filled",size:n="large",children:l,...c}=e;return o.default.createElement(a.default,{className:(0,s.default)("mdx-cta-button",t),...c},o.default.createElement(i.Typography,{component:"span",variant:"large"===n?"label1":"label2"},o.default.createElement(i.Button,{size:n,variant:r},l)))}},54442:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(40299),t)},40824:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallToActionSection=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(86010)),s=n.__importDefault(r(67294)),o=r(65701);r(8981);t.CallToActionSection=e=>{let{label:t,href:r,title:n,columns:l=1,description:c,list:u=[],target:h,className:d,children:p,variant:f="outlined",...m}=e;const g=!!c,v=u.length>0,A=!n||g||v?n&&c&&2===l?"full-width":n&&c&&u.length>0?"list":"simple":"title-only";return s.default.createElement("div",{className:(0,a.default)(d,"mdx-cta-section",`mdx-cta-section--${A}`),...m},s.default.createElement("div",{className:"mdx-cta-section__container"},s.default.createElement(i.Typography,{component:"h2",className:"mdx-cta-section__title"},n),s.default.createElement(i.Typography,{component:"h3",className:"mdx-cta-section__description"},c),r&&s.default.createElement(o.CallToActionButton,{target:h,href:r,className:"mdx-cta-section__link",variant:f},t)),u.length>0&&s.default.createElement("div",{className:"mdx-cta-section__list"},u.map(((e,t)=>s.default.createElement("div",{key:t},s.default.createElement(i.Typography,{variant:"subtitle1",component:"div"},e.title),s.default.createElement(i.Typography,{variant:"h3",component:"p"},e.description))))))}},78256:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(40824),t)},63906:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DocMetadata=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(88746)),s=n.__importDefault(r(86010)),o=n.__importDefault(r(67294)),l=r(38840);r(46774);const c=r(98906);t.DocMetadata=e=>{let{className:t,children:r,...n}=e;const{date:u,authors:h}=(0,c.useDocMetadata)(),{content:{authorPage:d}={}}=(0,l.useDocThemeOptions)();return o.default.createElement("div",{className:(0,s.default)(t,"mdx-doc-metadata"),...n},u&&o.default.createElement(i.Typography,{variant:"body2"},u),h&&h.length>0&&o.default.createElement(o.default.Fragment,null,o.default.createElement(i.Typography,{variant:"body2"},"by"," ",h.map(((e,t)=>o.default.createElement(o.default.Fragment,{key:e.key},d?o.default.createElement(a.default,{to:`author/${e.key}`},e.name):e.name,t<h.length-1&&", "))))))}},6796:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(63906),t)},98906:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDocMetadata=void 0;const n=r(70655),i=r(18279),a=r(38840),s=n.__importDefault(r(99486));t.useDocMetadata=()=>{const e=(0,a.useDocThemeOptions)(),{content:{authors:t=[]}={}}=e,{frontMatter:r={}}=(0,i.useDoc)(),{author:n=[],date:o}=r,l=(Array.isArray(n)?n:[n]).map((e=>t.find((t=>e===t.key)))).filter((e=>!!e));return{date:o?(0,s.default)(new Date(o),"MMM d yyyy"):"",authors:l}}},24646:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureList=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(86010)),s=n.__importDefault(r(67294));r(69774);t.FeatureList=e=>{let{title:t="Features",alignment:r="bottom",features:n=[],className:o,children:l,...c}=e;return s.default.createElement("div",{className:(0,a.default)(o,"mdx-feature-list",`mdx-feature-list--${r}-aligned`),...c},s.default.createElement(i.Typography,{variant:"h6",component:"h1",className:"mdx-feature-list__title"},t),s.default.createElement("div",{className:"mdx-feature-list__list"},n.map(((e,t)=>s.default.createElement("div",{key:t,className:(0,a.default)("mdx-feature-list__feature")},s.default.createElement("div",{className:"mdx-feature-list__feature-inner"},s.default.createElement(i.Typography,{variant:"subtitle1",component:"div",className:"mdx-feature-list__feature-index"},t+1),s.default.createElement(i.Typography,{variant:"h3",component:"h2",className:"mdx-feature-list__feature-title"},e.title),s.default.createElement(i.Typography,{variant:"h6",component:"h3",className:"mdx-feature-list__feature-description"},s.default.createElement("span",null,e.description))),s.default.createElement("div",{className:"mdx-feature-list__feature-border"}))))),l&&s.default.createElement("div",{className:"mdx-feature-list__extra"},l))}},34155:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(24646),t)},94787:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useHero=t.HeroContext=void 0;const n=r(70655).__importStar(r(67294));t.HeroContext=n.default.createContext({size:"medium"});t.useHero=()=>(0,n.useContext)(t.HeroContext)},53255:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hero=void 0;const n=r(70655),i=n.__importDefault(r(86010)),a=n.__importDefault(r(67294)),s=r(94787);r(91786);t.Hero=e=>{let{size:t="medium",className:r,children:n,...o}=e;return a.default.createElement(s.HeroContext.Provider,{value:{size:t}},a.default.createElement("div",{className:(0,i.default)(r,"mdx-hero",`mdx-hero--${t}`),...o},n))}},72295:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(53255),t)},23908:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroAction=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(88746)),s=n.__importDefault(r(86010)),o=n.__importDefault(r(67294));r(85661);t.HeroAction=e=>{let{size:t="large",variant:r="outlined",className:n,children:l,...c}=e;return o.default.createElement(a.default,{className:(0,s.default)(n,"mdx-hero-action",`mdx-hero-action--${t}`),...c},o.default.createElement(i.Button,{variant:r,size:t},o.default.createElement(i.Typography,{component:"span",variant:"label1",style:{color:"inherit"}},l)))}},48126:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(23908),t)},82897:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroActions=void 0;const n=r(70655),i=n.__importDefault(r(86010)),a=n.__importDefault(r(67294));r(57255);t.HeroActions=e=>{let{className:t,children:r,...n}=e;return a.default.createElement("div",{className:(0,i.default)(t,"mdx-hero-actions"),...n},r)}},16693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(82897),t)},28795:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroDescription=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(86010)),s=n.__importDefault(r(67294)),o=r(94787);r(30204);t.HeroDescription=e=>{let{size:t,className:r,uppercase:n=!1,children:l,...c}=e;const u=(0,o.useHero)(),h=t??(u?u.size:"medium");return s.default.createElement(i.Typography,{variant:"h5",className:(0,a.default)(r,"mdx-hero-description",`mdx-hero-description--${h}`,n?"mdx-hero-description--uppercase":""),...c},l)}},22447:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(28795),t)},78274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroInfo=void 0;const n=r(70655),i=n.__importDefault(r(86010)),a=n.__importDefault(r(67294)),s=r(94787),o=r(65701);r(6460);t.HeroInfo=e=>{let{size:t,className:r,children:n,...l}=e;const c=(0,s.useHero)(),u=t||(c?c.size:"medium");return a.default.createElement(a.default.Fragment,null,a.default.createElement("div",{className:(0,i.default)(r,"mdx-hero-info",`mdx-hero-info--${u}`),...l},n),a.default.createElement(o.ScrollToBottom,null))}},67812:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(78274),t)},84773:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsciiRenderer=void 0;const n=r(70655),i=r(44169),a=r(64232),s=n.__importStar(r(67294)),o=r(84849),l=r(24052);t.AsciiRenderer=e=>(function(e){void 0===e&&(e={});const{renderIndex:t=i.defaultAsciiConfigs.renderIndex,characters:r=i.defaultAsciiConfigs.characters,invert:n=i.defaultAsciiConfigs.invert,color:c=i.defaultAsciiConfigs.color,resolution:u=i.defaultAsciiConfigs.resolution,bgColor:h=i.defaultAsciiConfigs.bgColor,fgColor:d=i.defaultAsciiConfigs.fgColor,textShadowSize:p=i.defaultAsciiConfigs.textShadowSize,withTextShadow:f=!1}=e,{gl:m,size:g,scene:v,camera:A,viewport:y}=(0,a.useThree)(),x=(0,s.useMemo)((()=>{const e=new o.AsciiEffect(m,r,{invert:n,color:c,resolution:u});return e.domElement.style.position="absolute",e.domElement.style.top="0px",e.domElement.style.left="0px",e.domElement.style.pointerEvents="none",e}),[r,n,c,u]);(0,s.useLayoutEffect)((()=>{x.domElement.style.color=d}),[d,h]),(0,s.useEffect)((()=>{if(m.domElement.style.opacity="0",m.domElement.parentNode.appendChild(x.domElement),f){const e=document.createElement("style");e.innerHTML=`table *{text-shadow: ${(0,l.generateTextShadow)(p)};`,x.domElement.appendChild(e)}return()=>{m.domElement.style.opacity="1",m.domElement.parentNode.removeChild(x.domElement)}}),[x]),(0,s.useEffect)((()=>{x.setSize(g.width,g.height)}),[x,g]),(0,a.useFrame)((e=>{x.render(v,A)}),t)}(e),s.default.createElement(s.default.Fragment,null))},35901:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Controls=void 0;const n=r(70655),i=r(44169),a=n.__importStar(r(67294)),s=r(40213),o=r(64232),l=r(90278),c=r(24052),u=(e,t,r)=>(1-r)*e+r*t;function h(e,t,r,n){const i=Math.min(e,t)/t,a=[0,0,0];for(let s=0;s<3;s++)a[s]=u(r[s],n[s],i);return a}t.Controls=e=>{let{rotateSpeed:t=i.ROTATE_SPEED,enableZoom:r=!0,enableRotateOnScroll:n=!0,preset:u,targetPreset:d,children:p,...f}=e;const m=(0,a.useRef)(),g=(0,s.useScrollY)(),{camera:v,size:A}=(0,o.useThree)(),y=(0,a.useRef)(),[x,b]=a.default.useState(!1),[w,E]=a.default.useState(1),[S,M]=a.default.useState(0);return(0,o.useFrame)(((e,r)=>{m.current.rotation.y-=r*((0,c.isMobile)()?.6*t:t)})),(0,a.useEffect)((()=>{const e=()=>{console.log(JSON.stringify({cameraPos:v.position.toArray(),cameraRot:v.rotation.toArray().slice(0,3),controlsTarget:y.current.target.toArray()},null,2))};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}),[v]),(0,a.useEffect)((()=>{(0,c.isTouchDevice)()&&(y.current.minPolarAngle=Math.PI/2,y.current.maxPolarAngle=Math.PI/2,setTimeout((()=>{b(!0)}),1e3))}),[]),(0,a.useEffect)((()=>{(0,c.isMobile)()&&(E((0,c.mapFloat)(g,0,(0,c.calcScrollThreshold)(),1,.65)),M((0,c.mapFloat)(g,0,(0,c.calcScrollThreshold)(),0,.35)))}),[g]),(0,a.useEffect)((()=>{if(!r)return;if(!d)return;const e=h(g,400,u.cameraPos,d.cameraPos),t=h(g,400,u.cameraRot,d.cameraRot),n=h(g,400,u.controlsTarget,d.controlsTarget);v.position.set(...e),v.rotation.set(...t),y.current.target.set(...n),v.updateProjectionMatrix()}),[g,v]),a.default.createElement("group",{ref:m,...f,scale:w,"position-y":S},p,a.default.createElement(l.OrbitControls,{ref:y,enableZoom:!1,target:y.current?y.current.target:u.controlsTarget,enabled:!x}))}},44169:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OBJECTS_PRESETS=t.defaultPresets=t.defaultAsciiConfigs=t.INITIAL_ZOOM=t.RESIZE_SPEED_FACTOR=t.MIN_ZOOM=t.MAX_ROTATE_SPEED=t.MIN_ROTATE_SPEED=t.ROTATE_SPEED=void 0,t.ROTATE_SPEED=.1,t.MIN_ROTATE_SPEED=0,t.MAX_ROTATE_SPEED=1,t.MIN_ZOOM=.22,t.RESIZE_SPEED_FACTOR=.9,t.INITIAL_ZOOM=3,t.defaultAsciiConfigs={renderIndex:1,bgColor:"rgb(var(--lsd-surface-primary))",fgColor:"rgb(var(--lsd-text-primary))",characters:" l.o.g.o.s ",invert:!1,color:!1,resolution:.21,textShadowSize:15},t.defaultPresets={modelId:"default",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[-2.733342169570335,1.127956558492365,2.7690180385429666],controlsTarget:[-.2185887974027981,3.4320197290105474,-.08409377618890646]},abstract:{cameraPos:[-1.4826176635786852,4.021180061821954,-1.5929058418153597],cameraRot:[-2.9244096935808908,-.8625529112689497,-2.9755407843387185],controlsTarget:[-.3236695017538898,3.8072918272567,-.6236093222013962]}},t.OBJECTS_PRESETS=[t.defaultPresets,{modelId:"architecture01",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"architecture02",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"architecture03",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"architecture04",simple:{cameraPos:[2.263701079468784,.6448855513810133,-1.1446840846564066],cameraRot:[-2.3314571674867457,.984733935216302,2.422537357648925],controlsTarget:[.6593539926170827,-.1266335925222026,-.4104215479626598]},abstract:{cameraPos:[1.8397825927313005,.5006635210357668,-.7112749496103248],cameraRot:[-2.0637769654190388,.941591559117755,2.1572780914058356],controlsTarget:[.7525282128865571,-.19650999135957886,-.33673737792715125]},targetLook:{cameraPos:[1.2775067913826557,1.3342390202957728,-3.123518037652026],cameraRot:[-2.6905895797482686,.32826936260575107,2.9867046984290964],controlsTarget:[.27965301570358253,.05724884619536415,-.48670374558576035]}},{modelId:"architecture05",simple:{cameraPos:[2.783916402572475,.8560027544276005,2.7596737879252995],cameraRot:[-.16075199314229247,.8310730403125255,.11920589473418516],controlsTarget:[-.13283501637059433,.4299574965789378,.13221598116033606]},abstract:{cameraPos:[-.5465903796360435,.8773980794748312,.08538618930043433],cameraRot:[-.26855166005001807,-1.1713993239674987,-.24830772343977955],controlsTarget:[-.0544632211815667,.8222830795164463,-.1148867151943581]},targetLook:{cameraPos:[-.08633866196975185,1.065498410363367,3.299441795447572],cameraRot:[-.30705338387773307,-.04232616594886318,-.01341603621000156],controlsTarget:[.057360484222938594,.03995565554668334,.06512362298065871]}},{modelId:"architecture06",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"architecture07",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"atlas",simple:{cameraPos:[-.05747471409961126,1.1561369169508278,.2934743027588207],cameraRot:[.13523803197626882,-.45004875426349367,.05912213357583956],controlsTarget:[-.03052411570622545,1.1636581998026059,.23819862568800665]},abstract:{cameraPos:[-.18886266143333627,1.0759713173211645,.49472614307040697],cameraRot:[.11827338438455919,-.49355424749746096,.056236459481599846],controlsTarget:[-.03586918676122722,1.1095292429426495,.21231853618809665]},targetLook:{cameraPos:[-.6194495673706852,.6791728914823414,1.1145248759455844],cameraRot:[.08253419059538356,-.589296072042965,.045942607479927136],controlsTarget:[.09058057232790886,.7667301800204325,.05607398084523753]}},{modelId:"bust01",simple:{cameraPos:[-.6865425525854476,.9101267370893742,.6192780523604176],cameraRot:[-.39660492694232563,-.962317303218196,-.3309893133032883],controlsTarget:[.008888669206507317,.7229784900626205,.17240700391361993]},abstract:{cameraPos:[.025758408225725123,.9432728632646389,.5085343068565109],cameraRot:[-.016796160047877214,.23199352927595504,.003862085219634371],controlsTarget:[-.04849025797636223,.9379943498483801,.19429480114059927]},targetLook:{cameraPos:[-.0995637601904456,.9905193985583883,1.2844592429465957],cameraRot:[-.21489715158374015,-.011908392248228742,-.002599147273856083],controlsTarget:[-.08519853311178426,.7332893758986562,.10595091334036527]}},{modelId:"bust02",simple:{cameraPos:[-1.4566842350476759,1.3228318382357354,.3529107224325513],cameraRot:[-.7212161402570414,-1.161345100016008,-.6787189972933454],controlsTarget:[.13759890903780844,.8659810364239205,-.1666973840261623]},abstract:{cameraPos:[-.3488062269042841,1.3111379960412364,.033354968216059155],cameraRot:[-.7212161402570405,-1.1613451000160089,-.6787189972933446],controlsTarget:[.2227218365835886,1.147363414950647,-.15291722311874764]}},{modelId:"bust03",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"discobolus",simple:{cameraPos:[.9321278495515372,1.1243517299151449,1.0437243089401456],cameraRot:[-.05449607597993083,.5948614803388417,.030560026854436973],controlsTarget:[.17851738112859908,1.0636847191934362,-.06840974825492452]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"hand",simple:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"vase01",simple:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"venus",simple:{cameraPos:[-.33960257176056113,1.3731114512210183,.5843851218219973],cameraRot:[.19165735697369993,-.4160172409280952,.07825504508386714],controlsTarget:[.1766806722765915,1.595709756901872,-.5627979418735829]},abstract:{cameraPos:[-.2543046264127692,1.591894996466899,.21161310295797725],cameraRot:[.17078534527374745,-.637502107706861,.10229142114685894],controlsTarget:[.2766995177502174,1.7137410300309837,-.49488235116491014]}},{modelId:"flower",simple:{cameraPos:[-.33960257176056113,1.3731114512210183,.5843851218219973],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}}]},9354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroModel=void 0;const n=r(70655),i=r(90278),a=r(64232),s=n.__importDefault(r(86010)),o=n.__importStar(r(67294)),l=r(44169),c=r(24052),u=r(84773),h=r(35901);r(61588);const d=r(40213);function p(e){let{url:t,onMount:r=(()=>{}),...n}=e;const{scene:a}=(0,i.useGLTF)(t,"/scripts/draco-1.4.3/");return(0,o.useEffect)((()=>{r()}),[]),o.default.createElement("primitive",{object:a,...n})}t.HeroModel=e=>{const{modelId:t,preset:r,mode:n="simple",className:i,children:f,asciiConfig:m,rotateSpeed:g=l.ROTATE_SPEED,enableZoom:v,enableRotateOnScroll:A,withParallelEffect:y=!0,startY:x="bottom",...b}=e,w=((e,t,r)=>(0,o.useMemo)((()=>{if(t)return{...l.defaultPresets,[e]:t};if(!r)return l.defaultPresets;return l.OBJECTS_PRESETS.find((e=>e.modelId===r))||l.defaultPresets}),[t,r]))(n,r,t),E=(0,d.useScrollY)();return o.default.createElement("div",{className:(0,s.default)(i,"mdx-hero-model","mdx-hero-model--ascii",`mdx-hero-model--${n}`,`mdx-hero-model--${x}`),...b},o.default.createElement("div",{className:"mdx-hero-model--inner",style:{...y?{transform:"translateY(0px) scale(var(--mdx-hero-model-wrapper-scale))"}:{}}},o.default.createElement(o.Suspense,{fallback:o.default.createElement("span",null," ")},o.default.createElement(a.Canvas,{dpr:[1,2],style:{height:"100vh"},camera:{fov:50,position:w[n].cameraPos,rotation:w[n].cameraRot}},o.default.createElement("directionalLight",{position:[-10,10,0],intensity:1.5}),o.default.createElement("directionalLight",{position:[-10,10,5],intensity:.3}),o.default.createElement("directionalLight",{position:[-10,20,0],intensity:1.5}),o.default.createElement("directionalLight",{position:[100,-10,0],intensity:.25}),o.default.createElement(h.Controls,{rotateSpeed:g,preset:w[n],targetPreset:w.targetLook,enableZoom:"simple"!==n},o.default.createElement(o.Suspense,{fallback:o.default.createElement(p,{url:`/hero/${w.modelId}/lo.glb`})},o.default.createElement(p,{url:`/hero/${w.modelId}/hi.glb`}),o.default.createElement(u.AsciiRenderer,{...m})))))),o.default.createElement("div",{className:"mdx-hero-model--shade",style:{opacity:(0,c.mapFloat)(E,0,(0,c.calcScrollThreshold)()*l.RESIZE_SPEED_FACTOR,0,1)}}))}},28292:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroModel=void 0;const n=r(70655).__importDefault(r(67294)),i=r(24052),a=r(40213),s=r(9354);t.HeroModel=e=>{if("undefined"==typeof window)return null;const t=(0,a.useScrollY)();(0,i.mapFloat)(t,0,(0,i.calcScrollThreshold)(),0,.1*window.innerHeight);return n.default.createElement("div",{style:{position:"absolute",top:0,left:0}},n.default.createElement(s.HeroModel,{...e}))}},59533:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroTitle=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(86010)),s=n.__importDefault(r(67294)),o=r(94787);r(92751);t.HeroTitle=e=>{let{size:t,uppercase:r,className:n,children:l,...c}=e;const u=(0,o.useHero)(),h=t||(u?u.size:"medium"),d=void 0!==r?r:"large"===(null==u?void 0:u.size);return s.default.createElement(i.Typography,{variant:"h1",component:"h1",className:(0,a.default)(n,"mdx-hero-title",`mdx-hero-title--${h}`,d&&"mdx-hero-title--uppercase"),...c},l)}},85486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(59533),t)},37207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroVideo=void 0;const n=r(70655),i=n.__importDefault(r(86010)),a=n.__importStar(r(67294)),s=r(9259),o=r(32833),l=r(67713),c=r(94787);r(53175);t.HeroVideo=e=>{let{placeholderSrc:t,desktop:r,mobile:n,className:u,style:h={},children:d,...p}=e;(0,c.useHero)();const f=(0,l.useHydrated)(),m=(0,a.useRef)(null),[g,v]=(0,a.useState)(!0),A=async()=>{const e=m.current;if(!e)return;e.muted=!0,e.defaultMuted=!0;const[t,r]=await(0,o.settle)((()=>e.play()));r||v(!1)};return(0,a.useEffect)((()=>{const e=document.querySelector(".col > article");if(e)return e.classList.add("overflow-hidden"),()=>{e.classList.remove("overflow-hidden")}}),[]),a.default.createElement(a.default.Fragment,null,a.default.createElement("div",{className:(0,i.default)(u,"mdx-hero-video",g&&"mdx-hero-video--loading"),style:(0,s.makeStyle)({...h},{"hero-video-scale":(null==r?void 0:r.scale)??"1.70951586","hero-video-offset-y":(null==r?void 0:r.offsetY)??"-150px","hero-video-height":(null==r?void 0:r.height)??"100%","hero-video-min-height":(null==r?void 0:r.minHeight)??"min(100vh, var(--hero-max-height))","hero-video-scale-mobile":(null==n?void 0:n.scale)??"1.70951586","hero-video-offset-y-mobile":(null==n?void 0:n.offsetY)??"-50px","hero-video-height-mobile":(null==n?void 0:n.height)??"120%","hero-video-min-height-mobile":(null==n?void 0:n.minHeight)??"100vh"}),...p},a.default.createElement("div",{className:"mdx-hero-video__placeholder"},a.default.createElement("img",{src:t,alt:""})),a.default.createElement("div",{className:"mdx-hero-video__video"},f&&a.default.createElement("video",{ref:m,loop:!0,muted:!0,autoPlay:!0,playsInline:!0,onCanPlay:A,onLoadedMetadata:A},d))))}},98130:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(37207),t)},9737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PoweredBy=void 0;const n=r(70655),i=r(31665),a=r(93945),s=n.__importDefault(r(67294));r(63428);t.PoweredBy=e=>{let{items:t=[],...r}=e;const{colorMode:n}=(0,a.useColorMode)();return s.default.createElement("div",{className:"mdx-powered-by"},t.map(((e,t)=>{const r=e.logoSrc??e.logoSrcDark;return s.default.createElement("div",{key:t,className:"mdx-powered-by__card"},r&&s.default.createElement("img",{alt:"string"==typeof e.name?e.name:"",className:"mdx-powered-by__logo",src:("dark"===n?e.logoSrcDark:e.logoSrc)??r}),s.default.createElement(i.Typography,{component:"span",variant:"h5",className:"mdx-powered-by__name"},e.name),s.default.createElement(i.Typography,{variant:"subtitle1",className:"mdx-powered-by__description"},e.description),e.link&&s.default.createElement("a",{href:e.link,target:"_blank",className:"mdx-powered-by__link"},s.default.createElement(i.Button,{size:"large",variant:"outlined"},s.default.createElement(i.Typography,{variant:"label1",component:"span"},e.linkLabel??s.default.createElement(s.default.Fragment,null,"Visit ",e.name)),s.default.createElement("span",null,s.default.createElement(i.PickIcon,{color:"primary"})))))})))}},73465:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(9737),t)},47562:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Roadmap=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(86010)),s=n.__importStar(r(67294));r(74166);t.Roadmap=e=>{let{title:t,description:r,alignment:n="bottom",timeline:o=[],className:l,children:c,...u}=e;const h=(0,s.useRef)(null),d=e=>{var t,r,n;const i=h.current;if(!i)return;const a=(null==(t=i.children[0])||null==t.getBoundingClientRect||null==(r=t.getBoundingClientRect())?void 0:r.width)??236;i.scrollTo({behavior:"smooth",left:i.scrollLeft+((null==(n=i.getBoundingClientRect())?void 0:n.width)-a)*e})};return s.default.createElement("div",{className:(0,a.default)(l,"mdx-roadmap",`mdx-roadmap--${n}-aligned`),...u},s.default.createElement("div",{className:"mdx-roadmap__header"},s.default.createElement(i.Typography,{component:"h2",variant:"h6"},t),r&&s.default.createElement(i.Typography,{component:"p",variant:"h4"},r)),s.default.createElement("div",{className:"mdx-roadmap__actions"},c&&s.default.createElement("div",{className:"mdx-roadmap__cta"},c),s.default.createElement("div",{className:"mdx-roadmap__scroll"},s.default.createElement(i.IconButtonGroup,{size:"small",color:"primary"},s.default.createElement(i.IconButton,{size:"small",onClick:d.bind(null,-1)},s.default.createElement(i.NavigateBeforeIcon,null)),s.default.createElement(i.IconButton,{size:"small",onClick:d.bind(null,1)},s.default.createElement(i.NavigateNextIcon,null))))),o.length>0&&s.default.createElement("div",{ref:h,className:"mdx-roadmap__timeline hidden-scrollbar"},o.map(((e,t)=>s.default.createElement("div",{key:t,className:"mdx-roadmap__timeline-item"},s.default.createElement("div",{className:"mdx-roadmap__timeline-header"},s.default.createElement("div",{className:"mdx-roadmap__timeline-period-container"},s.default.createElement("div",{className:(0,a.default)("mdx-roadmap__timeline-border","dashed"===e.borderStyle&&"mdx-roadmap__timeline-border--dashed")}),s.default.createElement(i.Typography,{variant:"subtitle1",component:"span",className:"mdx-roadmap__timeline-period"},e.period)),s.default.createElement(i.Typography,{variant:"h3",component:"span",className:"mdx-roadmap__timeline-index"},`${t<9?"0":""}${t+1}`)),s.default.createElement(i.Typography,{variant:"h6",component:"p",className:"mdx-roadmap__timeline-description",dangerouslySetInnerHTML:{__html:e.description}}))))))}},77383:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(47562),t)},66872:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScrollToBottom=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(86010)),s=n.__importDefault(r(67294)),o=r(67713),l=r(52606),c=r(40213),u=n.__importDefault(r(49933));t.ScrollToBottom=e=>{const{children:t,className:r,...n}=e,h=(0,o.useHydrated)(),d=(0,c.useScrollY)(),p=(0,l.useIsMobile)();return s.default.createElement(i.IconButton,{onClick:()=>{var e;const t=document.querySelector(".main-wrapper article"),r=null==t||null==(e=t.children)?void 0:e[1];if(r)return window.scrollTo({left:0,top:r.getBoundingClientRect().top-(p?200:0),behavior:"smooth"});window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},size:p?"small":"large",className:(0,a.default)(u.default.scrollToBottom,r,(d>20||!h)&&u.default.hide),...n},s.default.createElement(i.ArrowDownIcon,{color:"primary"}))}},19538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(66872),t)},36835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Showcase=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(47002)),s=n.__importDefault(r(86010)),o=n.__importDefault(r(67294)),l=r(9259);r(13344);t.Showcase=e=>{let{items:t=[],columns:r=4,style:n={},className:c,children:u,...h}=e;return o.default.createElement("div",{className:(0,s.default)(c,"mdx-showcase"),style:(0,l.makeStyle)({...n},{columns:r}),...h},t.map(((e,t)=>o.default.createElement("div",{key:t,className:"mdx-showcase__item"},o.default.createElement("div",{key:t,className:"mdx-showcase__item-inner"},(null==e?void 0:e.logo)&&(null==e?void 0:e.logoDark)&&o.default.createElement(a.default,{sources:{dark:e.logoDark,light:e.logo},alt:"string"==typeof e.name?e.name:"image",className:"mdx-showcase__item-logo"}),o.default.createElement(i.Typography,{variant:"h3",component:"h2",className:"mdx-showcase__item-name"},e.name),o.default.createElement(i.Typography,{variant:"subtitle1",component:"p",className:"mdx-showcase__item-description"},e.description))))))}},78090:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(36835),t)},65701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(70655);n.__exportStar(r(32765),t),n.__exportStar(r(54442),t),n.__exportStar(r(78256),t),n.__exportStar(r(6796),t),n.__exportStar(r(34155),t),n.__exportStar(r(72295),t),n.__exportStar(r(48126),t),n.__exportStar(r(16693),t),n.__exportStar(r(22447),t),n.__exportStar(r(67812),t),n.__exportStar(r(28292),t),n.__exportStar(r(85486),t),n.__exportStar(r(73465),t),n.__exportStar(r(19538),t),n.__exportStar(r(78090),t),n.__exportStar(r(77383),t),n.__exportStar(r(98130),t)},9259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeStyle=void 0;t.makeStyle=function(e,t){return void 0===t&&(t={}),{...e,...Object.entries(t).reduce(((e,t)=>{let[r,n]=t;return{...e,[`--${r}`]:n}}),{})}}},24052:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcHeroInfoMb=t.isMobile=t.generateTextShadow=t.isTouchDevice=t.calcScrollThreshold=t.mapFloat=t.random=void 0;t.random=(e,t)=>Math.random()*(t-e)+e;t.mapFloat=(e,t,r,n,i)=>(e-t)*(i-n)/(r-t)+n;t.calcScrollThreshold=()=>.4*window.innerHeight;t.isTouchDevice=()=>"undefined"!=typeof window&&("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints>0);t.generateTextShadow=e=>{let t="";for(let r=0;r<e;r++){let n=Math.floor(r/(e-1)*255);t+=(0===r?"":", ")+`${5*-r}px ${5*-r}px 0px rgb(${n}, ${n}, ${n})`}return t};t.isMobile=()=>"undefined"!=typeof window&&window.innerWidth<997;t.calcHeroInfoMb=e=>(0,t.mapFloat)(scrollY,0,(0,t.calcScrollThreshold)(),0,100)},40213:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useScrollY=void 0;const n=r(21457),i=r(67294);t.useScrollY=()=>{const[e,t]=(0,i.useState)(0);return(0,n.useWindowEventListener)("scroll",(()=>{t(window.scrollY)})),e}},3905:(e,t,r)=>{"use strict";r.d(t,{Zo:()=>u,kt:()=>p});var n=r(67294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var l=n.createContext({}),c=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):s(s({},t),e)),r},u=function(e){var t=c(e.components);return n.createElement(l.Provider,{value:t},e.children)},h={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,u=o(e,["components","mdxType","originalType","parentName"]),d=c(r),p=i,f=d["".concat(l,".").concat(p)]||d[p]||h[p]||a;return r?n.createElement(f,s(s({ref:t},u),{},{components:r})):n.createElement(f,s({ref:t},u))}));function p(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=r.length,s=new Array(a);s[0]=d;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o.mdxType="string"==typeof e?e:i,s[1]=o;for(var c=2;c<a;c++)s[c]=r[c];return n.createElement.apply(null,s)}return n.createElement.apply(null,r)}d.displayName="MDXCreateElement"},90278:(e,t,r)=>{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}r.r(t),r.d(t,{AdaptiveDpr:()=>mh,AdaptiveEvents:()=>gh,ArcballControls:()=>vs,Backdrop:()=>cu,BakeShadows:()=>ch,Billboard:()=>yi,Bounds:()=>jc,Box:()=>bc,CameraShake:()=>Yc,Center:()=>Vc,Circle:()=>wc,Clone:()=>ns,Cloud:()=>wu,ComputedAttribute:()=>$a,Cone:()=>Ec,ContactShadows:()=>au,CubeCamera:()=>ss,CubicBezierLine:()=>_i,CurveModifier:()=>oc,CycleRaycast:()=>A,Cylinder:()=>Sc,Detailed:()=>oh,DeviceOrientationControls:()=>ls,Dodecahedron:()=>Dc,Edges:()=>Va,Effects:()=>Da,Environment:()=>$c,EnvironmentCube:()=>ru,EnvironmentMap:()=>eu,EnvironmentPortal:()=>tu,Extrude:()=>Uc,FirstPersonControls:()=>Ms,Float:()=>qc,FlyControls:()=>us,GizmoHelper:()=>Us,GizmoViewcube:()=>Ks,GizmoViewport:()=>$s,GradientTexture:()=>Ua,Html:()=>v,Icosahedron:()=>Fc,Image:()=>za,Instance:()=>Zu,Instances:()=>$u,IsObject:()=>ka,Lathe:()=>Nc,Lightformer:()=>mu,Line:()=>Ei,Loader:()=>S,MapControls:()=>ds,Merged:()=>eh,MeshDistortMaterial:()=>cc,MeshReflectorMaterial:()=>mc,MeshWobbleMaterial:()=>hc,Octahedron:()=>Lc,OrbitControls:()=>ps,OrthographicCamera:()=>is,PerspectiveCamera:()=>as,Plane:()=>_c,Point:()=>Uu,PointMaterial:()=>vc,PointMaterialImpl:()=>gc,PointerLockControls:()=>Es,Points:()=>ku,PointsBuffer:()=>Nu,Polyhedron:()=>Pc,PositionalAudio:()=>Ti,Preload:()=>lh,PresentationControls:()=>pi,QuadraticBezierLine:()=>Mi,Reflector:()=>hu,Ring:()=>Rc,RoundedBox:()=>Oc,Sampler:()=>Za,ScreenQuad:()=>zc,Scroll:()=>P,ScrollControls:()=>I,Segment:()=>sh,Segments:()=>ih,Select:()=>vi,Shadow:()=>uu,Sky:()=>Au,Sphere:()=>Mc,SpotLight:()=>fu,Stage:()=>ou,Stars:()=>bu,Stats:()=>go,Tetrahedron:()=>Bc,Text:()=>Ia,Torus:()=>Cc,TorusKnot:()=>Ic,TrackballControls:()=>ms,Trail:()=>Ka,TransformControls:()=>bs,Tube:()=>Tc,calcPosFromAngles:()=>vu,isWebGL2Available:()=>La,meshBounds:()=>fh,shaderMaterial:()=>Na,softShadows:()=>yc,useAnimations:()=>nc,useAspect:()=>yo,useBVH:()=>tc,useBounds:()=>Wc,useBoxProjectedEnv:()=>ac,useCamera:()=>_s,useContextBridge:()=>rc,useCubeTexture:()=>eo,useCursor:()=>y,useDepthBuffer:()=>Ao,useDetectGPU:()=>Ro,useFBO:()=>vo,useFBX:()=>ro,useGLTF:()=>lo,useGizmoContext:()=>Cs,useHelper:()=>Po,useIntersect:()=>ic,useKTX2:()=>ho,useMatcapTexture:()=>Eu,useNormalTexture:()=>Su,useProgress:()=>w,useScroll:()=>C,useSelect:()=>Ai,useTexture:()=>Oa,useTrail:()=>qa});var i=r(67294),a=r(73935),s=r(99477),o=r(64232);const l=new s.Vector3,c=new s.Vector3,u=new s.Vector3;function h(e,t,r){const n=l.setFromMatrixPosition(e.matrixWorld);n.project(t);const i=r.width/2,a=r.height/2;return[n.x*i+i,-n.y*a+a]}const d=e=>Math.abs(e)<1e-10?0:e;function p(e,t,r=""){let n="matrix3d(";for(let i=0;16!==i;i++)n+=d(t[i]*e.elements[i])+(15!==i?",":")");return r+n}const f=(m=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>p(e,m));var m;const g=(e,t)=>p(e,(e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1])(t),"translate(-50%,-50%)"),v=i.forwardRef((({children:e,eps:t=.001,style:r,className:p,prepend:m,center:v,fullscreen:A,portal:y,distanceFactor:x,sprite:b=!1,transform:w=!1,occlude:E,onOcclude:S,zIndexRange:M=[16777271,0],calculatePosition:_=h,as:T="div",wrapperClass:C,pointerEvents:I="auto",...B},R)=>{var P;const F=(0,o.useThree)((({gl:e})=>e)),L=(0,o.useThree)((({camera:e})=>e)),D=(0,o.useThree)((({scene:e})=>e)),U=(0,o.useThree)((({size:e})=>e)),N=(0,o.useThree)((({raycaster:e})=>e)),[k]=i.useState((()=>document.createElement(T))),O=i.useRef(null),G=i.useRef(0),z=i.useRef([0,0]),V=i.useRef(null),H=i.useRef(null),Q=null!==(P=null==y?void 0:y.current)&&void 0!==P?P:F.domElement.parentNode;i.useEffect((()=>{if(O.current){if(D.updateMatrixWorld(),w)k.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const e=_(O.current,L,U);k.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return Q&&(m?Q.prepend(k):Q.appendChild(k)),()=>{Q&&Q.removeChild(k),a.unmountComponentAtNode(k)}}}),[Q,w]),i.useLayoutEffect((()=>{C&&(k.className=C)}),[C]);const j=i.useMemo((()=>w?{position:"absolute",top:0,left:0,width:U.width,height:U.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:v?"translate3d(-50%,-50%,0)":"none",...A&&{top:-U.height/2,left:-U.width/2,width:U.width,height:U.height},...r}),[r,v,A,U,w]),W=i.useMemo((()=>({position:"absolute",pointerEvents:I})),[I]);i.useLayoutEffect((()=>{w?a.render(i.createElement("div",{ref:V,style:j},i.createElement("div",{ref:H,style:W},i.createElement("div",{ref:R,className:p,style:r,children:e}))),k):a.render(i.createElement("div",{ref:R,style:j,className:p,children:e}),k)}));const X=i.useRef(!0);return(0,o.useFrame)((()=>{if(O.current){L.updateMatrixWorld(),O.current.updateWorldMatrix(!0,!1);const e=w?z.current:_(O.current,L,U);if(w||Math.abs(G.current-L.zoom)>t||Math.abs(z.current[0]-e[0])>t||Math.abs(z.current[1]-e[1])>t){const t=function(e,t){const r=l.setFromMatrixPosition(e.matrixWorld),n=c.setFromMatrixPosition(t.matrixWorld),i=r.sub(n),a=t.getWorldDirection(u);return i.angleTo(a)>Math.PI/2}(O.current,L);let r=!1;"boolean"==typeof E?!0===E&&(r=[D]):Array.isArray(E)&&(r=E.map((e=>e.current)));const n=X.current;if(r){const e=function(e,t,r,n){const i=l.setFromMatrixPosition(e.matrixWorld),a=i.clone();a.project(t),r.setFromCamera(a,t);const s=r.intersectObjects(n,!0);if(s.length){const e=s[0].distance;return i.distanceTo(r.ray.origin)<e}return!0}(O.current,L,N,r);X.current=e&&!t}else X.current=!t;if(n!==X.current&&(S?S(!X.current):k.style.display=X.current?"block":"none"),k.style.zIndex=`${function(e,t,r){if(t instanceof s.PerspectiveCamera||t instanceof s.OrthographicCamera){const n=l.setFromMatrixPosition(e.matrixWorld),i=c.setFromMatrixPosition(t.matrixWorld),a=n.distanceTo(i),s=(r[1]-r[0])/(t.far-t.near),o=r[1]-s*t.far;return Math.round(s*a+o)}}(O.current,L,M)}`,w){const[e,t]=[U.width/2,U.height/2],r=L.projectionMatrix.elements[5]*t,{isOrthographicCamera:n,top:i,left:a,bottom:s,right:o}=L,l=f(L.matrixWorldInverse),c=n?`scale(${r})translate(${d(-(o+a)/2)}px,${d((i+s)/2)}px)`:`translateZ(${r}px)`;let u=O.current.matrixWorld;b&&(u=L.matrixWorldInverse.clone().transpose().copyPosition(u).scale(O.current.scale),u.elements[3]=u.elements[7]=u.elements[11]=0,u.elements[15]=1),k.style.width=U.width+"px",k.style.height=U.height+"px",k.style.perspective=n?"":`${r}px`,V.current&&H.current&&(V.current.style.transform=`${c}${l}translate(${e}px,${t}px)`,H.current.style.transform=g(u,1/((x||10)/400)))}else{const t=void 0===x?1:function(e,t){if(t instanceof s.OrthographicCamera)return t.zoom;if(t instanceof s.PerspectiveCamera){const r=l.setFromMatrixPosition(e.matrixWorld),n=c.setFromMatrixPosition(t.matrixWorld),i=t.fov*Math.PI/180,a=r.distanceTo(n);return 1/(2*Math.tan(i/2)*a)}return 1}(O.current,L)*x;k.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}z.current=e,G.current=L.zoom}}})),i.createElement("group",n({},B,{ref:O}))}));function A({onChanged:e,portal:t,preventDefault:r=!0,scroll:n=!0,keyCode:a=9}){const s=i.useRef(0),l=(0,o.useThree)((e=>e.raycaster)),c=(0,o.useThree)((e=>e.get)),u=(0,o.useThree)((e=>e.gl));return i.useEffect((()=>{var i;let o,h=[];const d=l.filter,p=null!==(i=null==t?void 0:t.current)&&void 0!==i?i:u.domElement.parentNode,f=()=>p&&e&&e(h,Math.round(s.current)%h.length);l.filter=(e,t)=>{let r=[...e];r.length===h.length&&h.every((e=>r.map((e=>e.object.uuid)).includes(e.object.uuid)))||(s.current=0,h=r,f()),d&&(r=d(r,t));for(let n=0;n<Math.round(s.current)%r.length;n++){const e=r.shift();r=[...r,e]}return r};const m=e=>{var t,r;s.current=e(s.current),null==(t=c().events.handlers)||t.onPointerCancel(void 0),null==(r=c().events.handlers)||r.onPointerMove(o),f()},g=e=>{(e.keyCode||e.which===a)&&(r&&e.preventDefault(),h.length>1&&m((e=>e+1)))},v=e=>{r&&e.preventDefault();let t=0;e||(e=window.event),e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),h.length>1&&m((e=>Math.abs(e-t)))},A=e=>o=e;return document.addEventListener("pointermove",A,{passive:!0}),n&&document.addEventListener("wheel",v),void 0!==a&&document.addEventListener("keydown",g),()=>{l.filter=d,void 0!==a&&document.removeEventListener("keydown",g),n&&document.removeEventListener("wheel",v),document.removeEventListener("pointermove",A)}}),[u,c,l,r,n,a]),null}function y(e,t="pointer",r="auto"){i.useEffect((()=>{if(e)return document.body.style.cursor=t,()=>{document.body.style.cursor=r}}),[e])}var x=r(14671);let b=0;const w=(0,x.Z)((e=>(s.DefaultLoadingManager.onStart=(t,r,n)=>{e({active:!0,item:t,loaded:r,total:n,progress:(r-b)/(n-b)*100})},s.DefaultLoadingManager.onLoad=()=>{e({active:!1})},s.DefaultLoadingManager.onError=t=>e((e=>({errors:[...e.errors,t]}))),s.DefaultLoadingManager.onProgress=(t,r,n)=>{r===n&&(b=n),e({active:!0,item:t,loaded:r,total:n,progress:(r-b)/(n-b)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0}))),E=e=>`Loading ${e.toFixed(2)}%`;function S({containerStyles:e,innerStyles:t,barStyles:r,dataStyles:n,dataInterpolation:a=E,initialState:s=(e=>e)}){const{active:o,progress:l}=w(),c=i.useRef(0),u=i.useRef(0),h=i.useRef(null),[d,p]=i.useState(s(o));i.useEffect((()=>{let e;return o!==d&&(e=setTimeout((()=>p(o)),300)),()=>clearTimeout(e)}),[d,o]);const f=i.useCallback((()=>{h.current&&(c.current+=(l-c.current)/2,(c.current>.95*l||100===l)&&(c.current=l),h.current.innerText=a(c.current),c.current<l&&(u.current=requestAnimationFrame(f)))}),[a,l]);return i.useEffect((()=>(f(),()=>cancelAnimationFrame(u.current))),[f]),d?i.createElement("div",{style:{...M.container,opacity:o?1:0,...e}},i.createElement("div",null,i.createElement("div",{style:{...M.inner,...t}},i.createElement("div",{style:{...M.bar,transform:`scaleX(${l/100})`,...r}}),i.createElement("span",{ref:h,style:{...M.data,...n}})))):null}const M={container:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:"#171717",display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 300ms ease",zIndex:1e3},inner:{width:100,height:3,background:"#272727",textAlign:"center"},bar:{height:3,width:"100%",background:"white",transition:"transform 200ms",transformOrigin:"left center"},data:{display:"inline-block",position:"relative",fontVariantNumeric:"tabular-nums",marginTop:"0.8em",color:"#f0f0f0",fontSize:"0.6em",fontFamily:'-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", Helvetica, Arial, Roboto, Ubuntu, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',whiteSpace:"nowrap"}};const _=function(e){return function(t){e.forEach((function(e){"function"==typeof e?e(t):null!=e&&(e.current=t)}))}},T=i.createContext(null);function C(){return i.useContext(T)}function I({eps:e=1e-5,enabled:t=!0,infinite:r,horizontal:n,pages:a=1,distance:l=1,damping:c=4,style:u={},children:h}){const{gl:d,size:p,invalidate:f,events:m,raycaster:g}=(0,o.useThree)(),[v]=i.useState((()=>document.createElement("div"))),[A]=i.useState((()=>document.createElement("div"))),[y]=i.useState((()=>document.createElement("div"))),x=d.domElement.parentNode,b=i.useRef(0),w=i.useMemo((()=>{const t={el:v,eps:e,fill:A,fixed:y,horizontal:n,damping:c,offset:0,delta:0,scroll:b,pages:a,range(e,t,r=0){const n=e-r,i=n+t+2*r;return this.offset<n?0:this.offset>i?1:(this.offset-n)/(i-n)},curve(e,t,r=0){return Math.sin(this.range(e,t,r)*Math.PI)},visible(e,t,r=0){const n=e-r,i=n+t+2*r;return this.offset>=n&&this.offset<=i}};return t}),[e,c,n,a]);i.useEffect((()=>{v.style.position="absolute",v.style.width="100%",v.style.height="100%",v.style[n?"overflowX":"overflowY"]="auto",v.style[n?"overflowY":"overflowX"]="hidden",v.style.top="0px",v.style.left="0px";for(const r in u)v.style[r]=u[r];y.style.position="sticky",y.style.top="0px",y.style.left="0px",y.style.width="100%",y.style.height="100%",y.style.overflow="hidden",v.appendChild(y),A.style.height=n?"100%":a*l*100+"%",A.style.width=n?a*l*100+"%":"100%",A.style.pointerEvents="none",v.appendChild(A),x.appendChild(v),v[n?"scrollLeft":"scrollTop"]=1;const e=m.connected||d.domElement;requestAnimationFrame((()=>null==m.connect?void 0:m.connect(v)));const t=g.computeOffsets;return g.computeOffsets=({clientX:e,clientY:t})=>({offsetX:e-x.offsetLeft,offsetY:t-x.offsetTop}),()=>{x.removeChild(v),g.computeOffsets=t,null==m.connect||m.connect(e)}}),[a,l,n,v,A,y,x]),i.useEffect((()=>{const e=p[n?"width":"height"],i=v[n?"scrollWidth":"scrollHeight"],a=i-e;let s=0,o=!0,l=!0;const c=()=>{if(t&&!l&&(f(),s=v[n?"scrollLeft":"scrollTop"],b.current=s/a,r)){if(!o)if(s>=a){const e=1-w.offset;v[n?"scrollLeft":"scrollTop"]=1,b.current=w.offset=-e,o=!0}else if(s<=0){const e=1+w.offset;v[n?"scrollLeft":"scrollTop"]=i,b.current=w.offset=e,o=!0}o&&setTimeout((()=>o=!1),40)}};v.addEventListener("scroll",c,{passive:!0}),requestAnimationFrame((()=>l=!1));const u=e=>v.scrollLeft+=e.deltaY/2;return n&&v.addEventListener("wheel",u,{passive:!0}),()=>{v.removeEventListener("scroll",c),n&&v.removeEventListener("wheel",u)}}),[v,p,r,w,f,n,t]);let E=0;return(0,o.useFrame)(((t,r)=>{w.offset=s.MathUtils.damp(E=w.offset,b.current,c,r),w.delta=s.MathUtils.damp(w.delta,Math.abs(E-w.offset),c,r),w.delta>e&&f()})),i.createElement(T.Provider,{value:w},h)}const B=i.forwardRef((({children:e},t)=>{const r=i.useRef(null),n=C(),{width:a,height:s}=(0,o.useThree)((e=>e.viewport));return(0,o.useFrame)((()=>{r.current.position.x=n.horizontal?-a*(n.pages-1)*n.offset:0,r.current.position.y=n.horizontal?0:s*(n.pages-1)*n.offset})),i.createElement("group",{ref:_([t,r])},e)})),R=i.forwardRef((({children:e,style:t,...r},s)=>{const l=C(),c=i.useRef(null),{width:u,height:h}=(0,o.useThree)((e=>e.size)),d=i.useContext(o.context);return(0,o.useFrame)((()=>{l.delta>l.eps&&(c.current.style.transform=`translate3d(${l.horizontal?-u*(l.pages-1)*l.offset:0}px,${l.horizontal?0:h*(l.pages-1)*-l.offset}px,0)`)})),a.render(i.createElement("div",n({ref:_([s,c]),style:{...t,position:"absolute",top:0,left:0,willChange:"transform"}},r),i.createElement(T.Provider,{value:l},i.createElement(o.context.Provider,{value:d},e))),l.fixed),null})),P=i.forwardRef((({html:e,...t},r)=>{const a=e?R:B;return i.createElement(a,n({ref:r},t))}));var F=q(),L=e=>j(e,F),D=q();L.write=e=>j(e,D);var U=q();L.onStart=e=>j(e,U);var N=q();L.onFrame=e=>j(e,N);var k=q();L.onFinish=e=>j(e,k);var O=[];L.setTimeout=(e,t)=>{let r=L.now()+t,n=()=>{let e=O.findIndex((e=>e.cancel==n));~e&&O.splice(e,1),H-=~e?1:0},i={time:r,handler:e,cancel:n};return O.splice(G(r),0,i),H+=1,W(),i};var G=e=>~(~O.findIndex((t=>t.time>e))||~O.length);L.cancel=e=>{U.delete(e),N.delete(e),k.delete(e),F.delete(e),D.delete(e)},L.sync=e=>{Q=!0,L.batchedUpdates(e),Q=!1},L.throttle=e=>{let t;function r(){try{e(...t)}finally{t=null}}function n(...e){t=e,L.onStart(r)}return n.handler=e,n.cancel=()=>{U.delete(r),t=null},n};var z=typeof window<"u"?window.requestAnimationFrame:()=>{};L.use=e=>z=e,L.now=typeof performance<"u"?()=>performance.now():Date.now,L.batchedUpdates=e=>e(),L.catch=console.error,L.frameLoop="always",L.advance=()=>{"demand"!==L.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Y()};var V=-1,H=0,Q=!1;function j(e,t){Q?(t.delete(e),e(0)):(t.add(e),W())}function W(){V<0&&(V=0,"demand"!==L.frameLoop&&z(X))}function X(){~V&&(z(X),L.batchedUpdates(Y))}function Y(){let e=V;V=L.now();let t=G(V);t&&(K(O.splice(0,t),(e=>e.handler())),H-=t),H?(U.flush(),F.flush(e?Math.min(64,V-e):16.667),N.flush(),D.flush(),k.flush()):V=-1}function q(){let e=new Set,t=e;return{add(r){H+=t!=e||e.has(r)?0:1,e.add(r)},delete:r=>(H-=t==e&&e.has(r)?1:0,e.delete(r)),flush(r){t.size&&(e=new Set,H-=t.size,K(t,(t=>t(r)&&e.add(t))),H+=e.size,t=e)}}}function K(e,t){e.forEach((e=>{try{t(e)}catch(Jr){L.catch(Jr)}}))}var J=Object.defineProperty,Z={};function $(){}((e,t)=>{for(var r in t)J(e,r,{get:t[r],enumerable:!0})})(Z,{assign:()=>pe,colors:()=>ue,createStringInterpolator:()=>se,skipAnimation:()=>he,to:()=>oe,willAdvance:()=>de});var ee={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function te(e,t){if(ee.arr(e)){if(!ee.arr(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return e===t}var re=(e,t)=>e.forEach(t);function ne(e,t,r){if(ee.arr(e))for(let n=0;n<e.length;n++)t.call(r,e[n],`${n}`);else for(let n in e)e.hasOwnProperty(n)&&t.call(r,e[n],n)}var ie=e=>ee.und(e)?[]:ee.arr(e)?e:[e];function ae(e,t){if(e.size){let r=Array.from(e);e.clear(),re(r,t)}}var se,oe,le=(e,...t)=>ae(e,(e=>e(...t))),ce=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),ue=null,he=!1,de=$,pe=e=>{e.to&&(oe=e.to),e.now&&(L.now=e.now),void 0!==e.colors&&(ue=e.colors),null!=e.skipAnimation&&(he=e.skipAnimation),e.createStringInterpolator&&(se=e.createStringInterpolator),e.requestAnimationFrame&&L.use(e.requestAnimationFrame),e.batchedUpdates&&(L.batchedUpdates=e.batchedUpdates),e.willAdvance&&(de=e.willAdvance),e.frameLoop&&(L.frameLoop=e.frameLoop)},fe=new Set,me=[],ge=[],ve=0,Ae={get idle(){return!fe.size&&!me.length},start(e){ve>e.priority?(fe.add(e),L.onStart(ye)):(xe(e),L(we))},advance:we,sort(e){if(ve)L.onFrame((()=>Ae.sort(e)));else{let t=me.indexOf(e);~t&&(me.splice(t,1),be(e))}},clear(){me=[],fe.clear()}};function ye(){fe.forEach(xe),fe.clear(),L(we)}function xe(e){me.includes(e)||be(e)}function be(e){me.splice(function(e,t){let r=e.findIndex(t);return r<0?e.length:r}(me,(t=>t.priority>e.priority)),0,e)}function we(e){let t=ge;for(let r=0;r<me.length;r++){let n=me[r];ve=n.priority,n.idle||(de(n),n.advance(e),n.idle||t.push(n))}return ve=0,(ge=me).length=0,(me=t).length>0}var Ee="[-+]?\\d*\\.?\\d+",Se=Ee+"%";function Me(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var _e=new RegExp("rgb"+Me(Ee,Ee,Ee)),Te=new RegExp("rgba"+Me(Ee,Ee,Ee,Ee)),Ce=new RegExp("hsl"+Me(Ee,Se,Se)),Ie=new RegExp("hsla"+Me(Ee,Se,Se,Ee)),Be=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Re=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Pe=/^#([0-9a-fA-F]{6})$/,Fe=/^#([0-9a-fA-F]{8})$/;function Le(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function De(e,t,r){let n=r<.5?r*(1+t):r+t-r*t,i=2*r-n,a=Le(i,n,e+1/3),s=Le(i,n,e),o=Le(i,n,e-1/3);return Math.round(255*a)<<24|Math.round(255*s)<<16|Math.round(255*o)<<8}function Ue(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function Ne(e){return(parseFloat(e)%360+360)%360/360}function ke(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Oe(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ge(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Pe.exec(e))?parseInt(t[1]+"ff",16)>>>0:ue&&void 0!==ue[e]?ue[e]:(t=_e.exec(e))?(Ue(t[1])<<24|Ue(t[2])<<16|Ue(t[3])<<8|255)>>>0:(t=Te.exec(e))?(Ue(t[1])<<24|Ue(t[2])<<16|Ue(t[3])<<8|ke(t[4]))>>>0:(t=Be.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Fe.exec(e))?parseInt(t[1],16)>>>0:(t=Re.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Ce.exec(e))?(255|De(Ne(t[1]),Oe(t[2]),Oe(t[3])))>>>0:(t=Ie.exec(e))?(De(Ne(t[1]),Oe(t[2]),Oe(t[3]))|ke(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}var ze=(e,t,r)=>{if(ee.fun(e))return e;if(ee.arr(e))return ze({range:e,output:t,extrapolate:r});if(ee.str(e.output[0]))return se(e);let n=e,i=n.output,a=n.range||[0,1],s=n.extrapolateLeft||n.extrapolate||"extend",o=n.extrapolateRight||n.extrapolate||"extend",l=n.easing||(e=>e);return e=>{let t=function(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}(e,a);return function(e,t,r,n,i,a,s,o,l){let c=l?l(e):e;if(c<t){if("identity"===s)return c;"clamp"===s&&(c=t)}if(c>r){if("identity"===o)return c;"clamp"===o&&(c=r)}return n===i?n:t===r?e<=t?n:i:(t===-1/0?c=-c:r===1/0?c-=t:c=(c-t)/(r-t),c=a(c),n===-1/0?c=-c:i===1/0?c+=n:c=c*(i-n)+n,c)}(e,a[t],a[t+1],i[t],i[t+1],l,s,o,n.map)}};var Ve=1.70158,He=1.525*Ve,Qe=Ve+1,je=2*Math.PI/3,We=2*Math.PI/4.5,Xe=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Ye={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>Qe*e*e*e-Ve*e*e,easeOutBack:e=>1+Qe*Math.pow(e-1,3)+Ve*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(He+1)*e-He)/2:(Math.pow(2*e-2,2)*((He+1)*(2*e-2)+He)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*je),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*je)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*We)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*We)/2+1,easeInBounce:e=>1-Xe(1-e),easeOutBounce:Xe,easeInOutBounce:e=>e<.5?(1-Xe(1-2*e))/2:(1+Xe(2*e-1))/2,steps:(e,t="end")=>r=>{let n=(r="end"===t?Math.min(r,.999):Math.max(r,.001))*e;return((e,t,r)=>Math.min(Math.max(r,e),t))(0,1,("end"===t?Math.floor(n):Math.ceil(n))/e)}},qe=Symbol.for("FluidValue.get"),Ke=Symbol.for("FluidValue.observers"),Je=e=>!(!e||!e[qe]),Ze=e=>e&&e[qe]?e[qe]():e,$e=e=>e[Ke]||null;function et(e,t){let r=e[Ke];r&&r.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var tt=class{[qe];[Ke];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");rt(this,e)}},rt=(e,t)=>st(e,qe,t);function nt(e,t){if(e[qe]){let r=e[Ke];r||st(e,Ke,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function it(e,t){let r=e[Ke];if(r&&r.has(t)){let n=r.size-1;n?r.delete(t):e[Ke]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var at,st=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),ot=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,lt=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ct=new RegExp(`(${ot.source})(%|[a-z]+)`,"i"),ut=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,ht=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,dt=e=>{let[t,r]=pt(e);if(!t||ce())return e;let n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(r)||e}return r&&ht.test(r)?dt(r):r||e},pt=e=>{let t=ht.exec(e);if(!t)return[,];let[,r,n]=t;return[r,n]},ft=(e,t,r,n,i)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${i})`,mt=e=>{at||(at=ue?new RegExp(`(${Object.keys(ue).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>Ze(e).replace(ht,dt).replace(lt,Ge).replace(at,Ge))),r=t.map((e=>e.match(ot).map(Number))),n=r[0].map(((e,t)=>r.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>ze({...e,output:t})));return e=>{let r=!ct.test(t[0])&&t.find((e=>ct.test(e)))?.replace(ot,""),i=0;return t[0].replace(ot,(()=>`${n[i++](e)}${r||""}`)).replace(ut,ft)}},gt="react-spring: ",vt=e=>{let t=e,r=!1;if("function"!=typeof t)throw new TypeError(`${gt}once requires a function parameter`);return(...e)=>{r||(t(...e),r=!0)}},At=vt(console.warn);var yt=vt(console.warn);function xt(e){return ee.str(e)&&("#"==e[0]||/\d/.test(e)||!ce()&&ht.test(e)||e in(ue||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var bt=ce()?i.useEffect:i.useLayoutEffect;function wt(){let e=(0,i.useState)()[1],t=(()=>{let e=(0,i.useRef)(!1);return bt((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}var Et=e=>(0,i.useEffect)(e,St),St=[];function Mt(e){let t=(0,i.useRef)();return(0,i.useEffect)((()=>{t.current=e})),t.current}var _t=Symbol.for("Animated:node"),Tt=e=>e&&e[_t],Ct=(e,t)=>((e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}))(e,_t,t),It=e=>e&&e[_t]&&e[_t].getPayload(),Bt=class{payload;constructor(){Ct(this,this)}getPayload(){return this.payload||[]}},Rt=class extends Bt{constructor(e){super(),this._value=e,ee.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new Rt(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return ee.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,ee.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Pt=class extends Rt{_string=null;_toString;constructor(e){super(0),this._toString=ze({output:[e,e]})}static create(e){return new Pt(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(ee.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=ze({output:[this.getValue(),e]})),this._value=0,super.reset()}},Ft={dependencies:null},Lt=class extends Bt{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return ne(this.source,((r,n)=>{(e=>!!e&&e[_t]===e)(r)?t[n]=r.getValue(e):Je(r)?t[n]=Ze(r):e||(t[n]=r)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&re(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return ne(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Ft.dependencies&&Je(e)&&Ft.dependencies.add(e);let t=It(e);t&&re(t,(e=>this.add(e)))}},Dt=class extends Lt{constructor(e){super(e)}static create(e){return new Dt(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,r)=>t.setValue(e[r]))).some(Boolean):(super.setValue(e.map(Ut)),!0)}};function Ut(e){return(xt(e)?Pt:Rt).create(e)}function Nt(e){let t=Tt(e);return t?t.constructor:ee.arr(e)?Dt:xt(e)?Pt:Rt}var kt=(e,t)=>{let r=!ee.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,i.forwardRef)(((n,a)=>{let s=(0,i.useRef)(null),o=r&&(0,i.useCallback)((e=>{s.current=function(e,t){return e&&(ee.fun(e)?e(t):e.current=t),t}(a,e)}),[a]),[l,c]=function(e,t){let r=new Set;return Ft.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Lt(e),Ft.dependencies=null,[e,r]}(n,t),u=wt(),h=()=>{let e=s.current;r&&!e||!1===(!!e&&t.applyAnimatedValues(e,l.getValue(!0)))&&u()},d=new Ot(h,c),p=(0,i.useRef)();bt((()=>(p.current=d,re(c,(e=>nt(e,d))),()=>{p.current&&(re(p.current.deps,(e=>it(e,p.current))),L.cancel(p.current.update))}))),(0,i.useEffect)(h,[]),Et((()=>()=>{let e=p.current;re(e.deps,(t=>it(t,e)))}));let f=t.getComponentProps(l.getValue());return i.createElement(e,{...f,ref:o})}))},Ot=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&L.write(this.update)}};var Gt=Symbol.for("AnimatedComponent"),zt=e=>ee.str(e)?e:e&&ee.str(e.displayName)?e.displayName:ee.fun(e)&&e.name||null;function Vt(e,...t){return ee.fun(e)?e(...t):e}var Ht=(e,t)=>!0===e||!!(t&&e&&(ee.fun(e)?e(t):ie(e).includes(t))),Qt=(e,t)=>ee.obj(e)?t&&e[t]:e,jt=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Wt=e=>e,Xt=(e,t=Wt)=>{let r=Yt;e.default&&!0!==e.default&&(e=e.default,r=Object.keys(e));let n={};for(let i of r){let r=t(e[i],i);ee.und(r)||(n[i]=r)}return n},Yt=["config","onProps","onStart","onChange","onPause","onResume","onRest"],qt={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Kt(e){let t=function(e){let t={},r=0;if(ne(e,((e,n)=>{qt[n]||(t[n]=e,r++)})),r)return t}(e);if(t){let r={to:t};return ne(e,((e,n)=>n in t||(r[n]=e))),r}return{...e}}function Jt(e){return e=Ze(e),ee.arr(e)?e.map(Jt):xt(e)?Z.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Zt(e){for(let t in e)return!0;return!1}function $t(e){return ee.fun(e)||ee.arr(e)&&ee.obj(e[0])}function er(e,t){e.ref?.delete(e),t?.delete(e)}function tr(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var rr={tension:170,friction:26,mass:1,damping:1,easing:Ye.linear,clamp:!1};function nr(e,t){if(ee.und(t.decay)){let r=!ee.und(t.tension)||!ee.und(t.friction);(r||!ee.und(t.frequency)||!ee.und(t.damping)||!ee.und(t.mass))&&(e.duration=void 0,e.decay=void 0),r&&(e.frequency=void 0)}else e.duration=void 0}var ir=[];function ar(e,{key:t,props:r,defaultProps:n,state:i,actions:a}){return new Promise(((s,o)=>{let l,c,u=Ht(r.cancel??n?.cancel,t);if(u)p();else{ee.und(r.pause)||(i.paused=Ht(r.pause,t));let e=n?.pause;!0!==e&&(e=i.paused||Ht(e,t)),l=Vt(r.delay||0,t),e?(i.resumeQueue.add(d),a.pause()):(a.resume(),d())}function h(){i.resumeQueue.add(d),i.timeouts.delete(c),c.cancel(),l=c.time-L.now()}function d(){l>0&&!Z.skipAnimation?(i.delayed=!0,c=L.setTimeout(p,l),i.pauseQueue.add(h),i.timeouts.add(c)):p()}function p(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(h),i.timeouts.delete(c),e<=(i.cancelId||0)&&(u=!0);try{a.start({...r,callId:e,cancel:u},s)}catch(j){o(j)}}}))}var sr=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?cr(e.get()):t.every((e=>e.noop))?or(e.get()):lr(e.get(),t.every((e=>e.finished))),or=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),lr=(e,t,r=!1)=>({value:e,finished:t,cancelled:r}),cr=e=>({value:e,cancelled:!0,finished:!1});function ur(e,t,r,n){let{callId:i,parentId:a,onRest:s}=t,{asyncTo:o,promise:l}=r;return a||e!==o||t.reset?r.promise=(async()=>{r.asyncId=i,r.asyncTo=e;let c,u,h,d=Xt(t,((e,t)=>"onRest"===t?void 0:e)),p=new Promise(((e,t)=>(c=e,u=t))),f=e=>{let t=i<=(r.cancelId||0)&&cr(n)||i!==r.asyncId&&lr(n,!1);if(t)throw e.result=t,u(e),e},m=(e,t)=>{let a=new dr,s=new pr;return(async()=>{if(Z.skipAnimation)throw hr(r),s.result=lr(n,!1),u(s),s;f(a);let o=ee.obj(e)?{...e}:{...t,to:e};o.parentId=i,ne(d,((e,t)=>{ee.und(o[t])&&(o[t]=e)}));let l=await n.start(o);return f(a),r.paused&&await new Promise((e=>{r.resumeQueue.add(e)})),l})()};if(Z.skipAnimation)return hr(r),lr(n,!1);try{let t;t=ee.arr(e)?(async e=>{for(let t of e)await m(t)})(e):Promise.resolve(e(m,n.stop.bind(n))),await Promise.all([t.then(c),p]),h=lr(n.get(),!0,!1)}catch(V){if(V instanceof dr)h=V.result;else{if(!(V instanceof pr))throw V;h=V.result}}finally{i==r.asyncId&&(r.asyncId=a,r.asyncTo=a?o:void 0,r.promise=a?l:void 0)}return ee.fun(s)&&L.batchedUpdates((()=>{s(h,n,n.item)})),h})():l}function hr(e,t){ae(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var dr=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},pr=class extends Error{result;constructor(){super("SkipAnimationSignal")}},fr=e=>e instanceof gr,mr=1,gr=class extends tt{id=mr++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=Tt(this);return e&&e.getValue()}to(...e){return Z.to(this,e)}interpolate(...e){return At(`${gt}The "interpolate" function is deprecated in v9 (use "to" instead)`),Z.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){et(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Ae.sort(this),et(this,{type:"priority",parent:this,priority:e})}},vr=Symbol.for("SpringPhase"),Ar=e=>(1&e[vr])>0,yr=e=>(2&e[vr])>0,xr=e=>(4&e[vr])>0,br=(e,t)=>t?e[vr]|=3:e[vr]&=-3,wr=(e,t)=>t?e[vr]|=4:e[vr]&=-5,Er=class extends gr{key;animation=new class{changed=!1;values=ir;toValues=null;fromValues=ir;to;from;config=new class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,rr)}};immediate=!1};queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!ee.und(e)||!ee.und(t)){let r=ee.obj(e)?{...e}:{...t,from:e};ee.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(yr(this)||this._state.asyncTo)||xr(this)}get goal(){return Ze(this.animation.to)}get velocity(){let e=Tt(this);return e instanceof Rt?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Ar(this)}get isAnimating(){return yr(this)}get isPaused(){return xr(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,r=!1,n=this.animation,{toValues:i}=n,{config:a}=n,s=It(n.to);!s&&Je(n.to)&&(i=ie(Ze(n.to))),n.values.forEach(((o,l)=>{if(o.done)return;let c=o.constructor==Pt?1:s?s[l].lastPosition:i[l],u=n.immediate,h=c;if(!u){if(h=o.lastPosition,a.tension<=0)return void(o.done=!0);let t,r=o.elapsedTime+=e,i=n.fromValues[l],s=null!=o.v0?o.v0:o.v0=ee.arr(a.velocity)?a.velocity[l]:a.velocity,d=a.precision||(i==c?.005:Math.min(1,.001*Math.abs(c-i)));if(ee.und(a.duration))if(a.decay){let e=!0===a.decay?.998:a.decay,n=Math.exp(-(1-e)*r);h=i+s/(1-e)*(1-n),u=Math.abs(o.lastPosition-h)<=d,t=s*n}else{t=null==o.lastVelocity?s:o.lastVelocity;let r,n=a.restVelocity||d/10,l=a.clamp?0:a.bounce,p=!ee.und(l),f=i==c?o.v0>0:i<c,m=!1,g=1,v=Math.ceil(e/g);for(let e=0;e<v&&(r=Math.abs(t)>n,r||(u=Math.abs(c-h)<=d,!u));++e){p&&(m=h==c||h>c==f,m&&(t=-t*l,h=c)),t+=(1e-6*-a.tension*(h-c)+.001*-a.friction*t)/a.mass*g,h+=t*g}}else{let n=1;a.duration>0&&(this._memoizedDuration!==a.duration&&(this._memoizedDuration=a.duration,o.durationProgress>0&&(o.elapsedTime=a.duration*o.durationProgress,r=o.elapsedTime+=e)),n=(a.progress||0)+r/this._memoizedDuration,n=n>1?1:n<0?0:n,o.durationProgress=n),h=i+a.easing(n)*(c-i),t=(h-o.lastPosition)/e,u=1==n}o.lastVelocity=t,Number.isNaN(h)&&(console.warn("Got NaN while animating:",this),u=!0)}s&&!s[l].done&&(u=!1),u?o.done=!0:t=!1,o.setValue(h,a.round)&&(r=!0)}));let o=Tt(this),l=o.getValue();if(t){let e=Ze(n.to);l===e&&!r||a.decay?r&&a.decay&&this._onChange(l):(o.setValue(e),this._onChange(e)),this._stop()}else r&&this._onChange(l)}set(e){return L.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(yr(this)){let{to:e,config:t}=this.animation;L.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let r;return ee.und(e)?(r=this.queue||[],this.queue=[]):r=[ee.obj(e)?e:{...t,to:e}],Promise.all(r.map((e=>this._update(e)))).then((e=>sr(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),hr(this._state,e&&this._lastCallId),L.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:r,from:n}=e;r=ee.obj(r)?r[t]:r,(null==r||$t(r))&&(r=void 0),n=ee.obj(n)?n[t]:n,null==n&&(n=void 0);let i={to:r,from:n};return Ar(this)||(e.reverse&&([r,n]=[n,r]),n=Ze(n),ee.und(n)?Tt(this)||this._set(r):this._set(n)),i}_update({...e},t){let{key:r,defaultProps:n}=this;e.default&&Object.assign(n,Xt(e,((e,t)=>/^on/.test(t)?Qt(e,r):e))),Br(this,e,"onProps"),Rr(this,"onProps",e,this);let i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return ar(++this._lastCallId,{key:r,props:e,defaultProps:n,state:a,actions:{pause:()=>{xr(this)||(wr(this,!0),le(a.pauseQueue),Rr(this,"onPause",lr(this,Sr(this,this.animation.to)),this))},resume:()=>{xr(this)&&(wr(this,!1),yr(this)&&this._resume(),le(a.resumeQueue),Rr(this,"onResume",lr(this,Sr(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then((r=>{if(e.loop&&r.finished&&(!t||!r.noop)){let t=Mr(e);if(t)return this._update(t,!0)}return r}))}_merge(e,t,r){if(t.cancel)return this.stop(!0),r(cr(this));let n=!ee.und(e.to),i=!ee.und(e.from);if(n||i){if(!(t.callId>this._lastToId))return r(cr(this));this._lastToId=t.callId}let{key:a,defaultProps:s,animation:o}=this,{to:l,from:c}=o,{to:u=l,from:h=c}=e;i&&!n&&(!t.default||ee.und(u))&&(u=h),t.reverse&&([u,h]=[h,u]);let d=!te(h,c);d&&(o.from=h),h=Ze(h);let p=!te(u,l);p&&this._focus(u);let f=$t(t.to),{config:m}=o,{decay:g,velocity:v}=m;(n||i)&&(m.velocity=0),t.config&&!f&&function(e,t,r){r&&(nr(r={...r},t),t={...r,...t}),nr(e,t),Object.assign(e,t);for(let s in rr)null==e[s]&&(e[s]=rr[s]);let{frequency:n,damping:i}=e,{mass:a}=e;ee.und(n)||(n<.01&&(n=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/n,2)*a,e.friction=4*Math.PI*i*a/n)}(m,Vt(t.config,a),t.config!==s.config?Vt(s.config,a):void 0);let A=Tt(this);if(!A||ee.und(u))return r(lr(this,!0));let y=ee.und(t.reset)?i&&!t.default:!ee.und(h)&&Ht(t.reset,a),x=y?h:this.get(),b=Jt(u),w=ee.num(b)||ee.arr(b)||xt(b),E=!f&&(!w||Ht(s.immediate||t.immediate,a));if(p){let e=Nt(u);if(e!==A.constructor){if(!E)throw Error(`Cannot animate between ${A.constructor.name} and ${e.name}, as the "to" prop suggests`);A=this._set(b)}}let S=A.constructor,M=Je(u),_=!1;if(!M){let e=y||!Ar(this)&&d;(p||e)&&(_=te(Jt(x),b),M=!_),(!te(o.immediate,E)&&!E||!te(m.decay,g)||!te(m.velocity,v))&&(M=!0)}if(_&&yr(this)&&(o.changed&&!y?M=!0:M||this._stop(l)),!f&&((M||Je(l))&&(o.values=A.getPayload(),o.toValues=Je(u)?null:S==Pt?[1]:ie(b)),o.immediate!=E&&(o.immediate=E,!E&&!y&&this._set(l)),M)){let{onRest:e}=o;re(Ir,(e=>Br(this,t,e)));let n=lr(this,Sr(this,l));le(this._pendingCalls,n),this._pendingCalls.add(r),o.changed&&L.batchedUpdates((()=>{o.changed=!y,e?.(n,this),y?Vt(s.onRest,n):o.onStart?.(n,this)}))}y&&this._set(x),f?r(ur(t.to,t,this._state,this)):M?this._start():yr(this)&&!p?this._pendingCalls.add(r):r(or(x))}_focus(e){let t=this.animation;e!==t.to&&($e(this)&&this._detach(),t.to=e,$e(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;Je(t)&&(nt(t,this),fr(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Je(e)&&it(e,this)}_set(e,t=!0){let r=Ze(e);if(!ee.und(r)){let e=Tt(this);if(!e||!te(r,e.getValue())){let n=Nt(r);e&&e.constructor==n?e.setValue(r):Ct(this,n.create(r)),e&&L.batchedUpdates((()=>{this._onChange(r,t)}))}}return Tt(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,Rr(this,"onStart",lr(this,Sr(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Vt(this.animation.onChange,e,this)),Vt(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;Tt(this).reset(Ze(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),yr(this)||(br(this,!0),xr(this)||this._resume())}_resume(){Z.skipAnimation?this.finish():Ae.start(this)}_stop(e,t){if(yr(this)){br(this,!1);let r=this.animation;re(r.values,(e=>{e.done=!0})),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),et(this,{type:"idle",parent:this});let n=t?cr(this.get()):lr(this.get(),Sr(this,e??r.to));le(this._pendingCalls,n),r.changed&&(r.changed=!1,Rr(this,"onRest",n,this))}}};function Sr(e,t){let r=Jt(t);return te(Jt(e.get()),r)}function Mr(e,t=e.loop,r=e.to){let n=Vt(t);if(n){let i=!0!==n&&Kt(n),a=(i||e).reverse,s=!i||i.reset;return _r({...e,loop:t,default:!1,pause:void 0,to:!a||$t(r)?r:void 0,from:s?e.from:void 0,reset:s,...i})}}function _r(e){let{to:t,from:r}=e=Kt(e),n=new Set;return ee.obj(t)&&Cr(t,n),ee.obj(r)&&Cr(r,n),e.keys=n.size?Array.from(n):null,e}function Tr(e){let t=_r(e);return ee.und(t.default)&&(t.default=Xt(t)),t}function Cr(e,t){ne(e,((e,r)=>null!=e&&t.add(r)))}var Ir=["onStart","onRest","onChange","onPause","onResume"];function Br(e,t,r){e.animation[r]=t[r]!==jt(t,r)?Qt(t[r],e.key):void 0}function Rr(e,t,...r){e.animation[t]?.(...r),e.defaultProps[t]?.(...r)}var Pr=["onStart","onChange","onRest"],Fr=1,Lr=class{id=Fr++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each(((t,r)=>e[r]=t.get())),e}set(e){for(let t in e){let r=e[t];ee.und(r)||this.springs[t].set(r)}}update(e){return e&&this.queue.push(_r(e)),this}start(e){let{queue:t}=this;return e?t=ie(e).map(_r):this.queue=[],this._flush?this._flush(this,t):(zr(this,t),Dr(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let r=this.springs;re(ie(t),(t=>r[t].stop(!!e)))}else hr(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(ee.und(e))this.start({pause:!0});else{let t=this.springs;re(ie(e),(e=>t[e].pause()))}return this}resume(e){if(ee.und(e))this.start({pause:!1});else{let t=this.springs;re(ie(e),(e=>t[e].resume()))}return this}each(e){ne(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:r}=this._events,n=this._active.size>0,i=this._changed.size>0;(n&&!this._started||i&&!this._started)&&(this._started=!0,ae(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let a=!n&&this._started,s=i||a&&r.size?this.get():null;i&&t.size&&ae(t,(([e,t])=>{t.value=s,e(t,this,this._item)})),a&&(this._started=!1,ae(r,(([e,t])=>{t.value=s,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}L.onFrame(this._onFrame)}};function Dr(e,t){return Promise.all(t.map((t=>Ur(e,t)))).then((t=>sr(e,t)))}async function Ur(e,t,r){let{keys:n,to:i,from:a,loop:s,onRest:o,onResolve:l}=t,c=ee.obj(t.default)&&t.default;s&&(t.loop=!1),!1===i&&(t.to=null),!1===a&&(t.from=null);let u=ee.arr(i)||ee.fun(i)?i:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):re(Pr,(r=>{let n=t[r];if(ee.fun(n)){let i=e._events[r];t[r]=({finished:e,cancelled:t})=>{let r=i.get(n);r?(e||(r.finished=!1),t&&(r.cancelled=!0)):i.set(n,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[r]=t[r])}}));let h=e._state;t.pause===!h.paused?(h.paused=t.pause,le(t.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(t.pause=!0);let d=(n||Object.keys(e.springs)).map((r=>e.springs[r].start(t))),p=!0===t.cancel||!0===jt(t,"cancel");(u||p&&h.asyncId)&&d.push(ar(++e._lastAsyncId,{props:t,state:h,actions:{pause:$,resume:$,start(t,r){p?(hr(h,e._lastAsyncId),r(cr(e))):(t.onRest=o,r(ur(u,t,h,e)))}}})),h.paused&&await new Promise((e=>{h.resumeQueue.add(e)}));let f=sr(e,await Promise.all(d));if(s&&f.finished&&(!r||!f.noop)){let r=Mr(t,s,i);if(r)return zr(e,[r]),Ur(e,r,!0)}return l&&L.batchedUpdates((()=>l(f,e,e.item))),f}function Nr(e,t){let r={...e.springs};return t&&re(ie(t),(e=>{ee.und(e.keys)&&(e=_r(e)),ee.obj(e.to)||(e={...e,to:void 0}),Gr(r,e,(e=>Or(e)))})),kr(e,r),r}function kr(e,t){ne(t,((t,r)=>{e.springs[r]||(e.springs[r]=t,nt(t,e))}))}function Or(e,t){let r=new Er;return r.key=e,t&&nt(r,t),r}function Gr(e,t,r){t.keys&&re(t.keys,(n=>{(e[n]||(e[n]=r(n)))._prepareNode(t)}))}function zr(e,t){re(t,(t=>{Gr(e.springs,t,(t=>Or(t,e)))}))}var Vr=({children:e,...t})=>{let r=(0,i.useContext)(Hr),n=t.pause||!!r.pause,a=t.immediate||!!r.immediate;t=function(e,t){let[r]=(0,i.useState)((()=>({inputs:t,result:e()}))),n=(0,i.useRef)(),a=n.current,s=a;return s?t&&s.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(t,s.inputs)||(s={inputs:t,result:e()}):s=r,(0,i.useEffect)((()=>{n.current=s,a==r&&(r.inputs=r.result=void 0)}),[s]),s.result}((()=>({pause:n,immediate:a})),[n,a]);let{Provider:s}=Hr;return i.createElement(s,{value:t},e)},Hr=function(e,t){return Object.assign(e,i.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(Vr,{});Vr.Provider=Hr.Provider,Vr.Consumer=Hr.Consumer;var Qr=()=>{let e=[],t=function(t){yt(`${gt}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);let n=[];return re(e,((e,i)=>{if(ee.und(t))n.push(e.start());else{let a=r(t,e,i);a&&n.push(e.start(a))}})),n};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let r=e.indexOf(t);~r&&e.splice(r,1)},t.pause=function(){return re(e,(e=>e.pause(...arguments))),this},t.resume=function(){return re(e,(e=>e.resume(...arguments))),this},t.set=function(t){re(e,((e,r)=>{let n=ee.fun(t)?t(r,e):t;n&&e.set(n)}))},t.start=function(t){let r=[];return re(e,((e,n)=>{if(ee.und(t))r.push(e.start());else{let i=this._getProps(t,e,n);i&&r.push(e.start(i))}})),r},t.stop=function(){return re(e,(e=>e.stop(...arguments))),this},t.update=function(t){return re(e,((e,r)=>e.update(this._getProps(t,e,r)))),this};let r=function(e,t,r){return ee.fun(e)?e(r,t):e};return t._getProps=r,t};function jr(e,t,r){let n=ee.fun(t)&&t;n&&!r&&(r=[]);let a=(0,i.useMemo)((()=>n||3==arguments.length?Qr():void 0),[]),s=(0,i.useRef)(0),o=wt(),l=(0,i.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){let r=Nr(e,t);return s.current>0&&!l.queue.length&&!Object.keys(r).some((t=>!e.springs[t]))?Dr(e,t):new Promise((n=>{kr(e,r),l.queue.push((()=>{n(Dr(e,t))})),o()}))}})),[]),c=(0,i.useRef)([...l.ctrls]),u=[],h=Mt(e)||0;function d(e,r){for(let i=e;i<r;i++){let e=c.current[i]||(c.current[i]=new Lr(null,l.flush)),r=n?n(i,e):t[i];r&&(u[i]=Tr(r))}}(0,i.useMemo)((()=>{re(c.current.slice(e,h),(e=>{er(e,a),e.stop(!0)})),c.current.length=e,d(h,e)}),[e]),(0,i.useMemo)((()=>{d(0,Math.min(h,e))}),r);let p=c.current.map(((e,t)=>Nr(e,u[t]))),f=(0,i.useContext)(Vr),m=Mt(f),g=f!==m&&Zt(f);bt((()=>{s.current++,l.ctrls=c.current;let{queue:e}=l;e.length&&(l.queue=[],re(e,(e=>e()))),re(c.current,((e,t)=>{a?.add(e),g&&e.start({default:f});let r=u[t];r&&(tr(e,r.ref),e.ref?e.queue.push(r):e.start(r))}))})),Et((()=>()=>{re(l.ctrls,(e=>e.stop(!0)))}));let v=p.map((e=>({...e})));return a?[v,a]:v}function Wr(e,t){let r=ee.fun(e),[[n],i]=jr(1,r?e:[e],r?t||[]:t);return r||2==arguments.length?[n,i]:n}var Xr=class extends gr{constructor(e,t){super(),this.source=e,this.calc=ze(...t);let r=this._get(),n=Nt(r);Ct(this,n.create(r))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();te(t,this.get())||(Tt(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&qr(this._active)&&Kr(this)}_get(){let e=ee.arr(this.source)?this.source.map(Ze):ie(Ze(this.source));return this.calc(...e)}_start(){this.idle&&!qr(this._active)&&(this.idle=!1,re(It(this),(e=>{e.done=!1})),Z.skipAnimation?(L.batchedUpdates((()=>this.advance())),Kr(this)):Ae.start(this))}_attach(){let e=1;re(ie(this.source),(t=>{Je(t)&&nt(t,this),fr(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){re(ie(this.source),(e=>{Je(e)&&it(e,this)})),this._active.clear(),Kr(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=ie(this.source).reduce(((e,t)=>Math.max(e,(fr(t)?t.priority:0)+1)),0))}};function Yr(e){return!1!==e.idle}function qr(e){return!e.size||Array.from(e).every(Yr)}function Kr(e){e.idle||(e.idle=!0,re(It(e),(e=>{e.done=!0})),et(e,{type:"idle",parent:e}))}Z.assign({createStringInterpolator:mt,to:(e,t)=>new Xr(e,t)});Ae.advance;var Jr=["primitive"].concat(Object.keys(s).filter((e=>/^[A-Z]/.test(e))).map((e=>e[0].toLowerCase()+e.slice(1))));Z.assign({createStringInterpolator:mt,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},frameLoop:"demand"}),(0,o.addEffect)((()=>{L.advance()}));var Zr=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:r=(e=>new Lt(e)),getComponentProps:n=(e=>e)}={})=>{let i={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n},a=e=>{let t=zt(e)||"Anonymous";return(e=ee.str(e)?a[e]||(a[e]=kt(e,i)):e[Gt]||(e[Gt]=kt(e,i))).displayName=`Animated(${t})`,e};return ne(e,((t,r)=>{ee.arr(e)&&(r=zt(t)),a[r]=a(t)})),{animated:a}})(Jr,{applyAnimatedValues:o.applyProps}),$r=Zr.animated;const en={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function tn(e,t,r){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*r):e*t*r/(t+r*e)}function rn(e,t,r,n=.15){return 0===n?function(e,t,r){return Math.max(t,Math.min(e,r))}(e,t,r):e<t?-tn(t-e,r-t,n)+t:e>r?+tn(e-r,r-t,n)+r:e}function nn(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function an(e,t,r){return(t=nn(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function on(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sn(Object(r),!0).forEach((function(t){an(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ln={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function cn(e){return e?e[0].toUpperCase()+e.slice(1):""}const un=["enter","leave"];function hn(e,t="",r=!1){const n=ln[e],i=n&&n[t]||t;return"on"+cn(e)+cn(i)+(function(e=!1,t){return e&&!un.includes(t)}(r,i)?"Capture":"")}const dn=["gotpointercapture","lostpointercapture"];function pn(e){let t=e.substring(2).toLowerCase();const r=!!~t.indexOf("passive");r&&(t=t.replace("passive",""));const n=dn.includes(t)?"capturecapture":"capture",i=!!~t.indexOf(n);return i&&(t=t.replace("capture","")),{device:t,capture:i,passive:r}}function fn(e){return"touches"in e}function mn(e){return fn(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function gn(e){return fn(e)?function(e){return"touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches}(e)[0]:e}function vn(e,t){try{const r=t.clientX-e.clientX,n=t.clientY-e.clientY,i=(t.clientX+e.clientX)/2,a=(t.clientY+e.clientY)/2,s=Math.hypot(r,n),o=-180*Math.atan2(r,n)/Math.PI;return{angle:o,distance:s,origin:[i,a]}}catch(r){}return null}function An(e){return function(e){return Array.from(e.touches).filter((t=>{var r,n;return t.target===e.currentTarget||(null===(r=e.currentTarget)||void 0===r||null===(n=r.contains)||void 0===n?void 0:n.call(r,t.target))}))}(e).map((e=>e.identifier))}function yn(e,t){const[r,n]=Array.from(e.touches).filter((e=>t.includes(e.identifier)));return vn(r,n)}function xn(e){const t=gn(e);return fn(e)?t.identifier:t.pointerId}function bn(e){const t=gn(e);return[t.clientX,t.clientY]}function wn(e){let{deltaX:t,deltaY:r,deltaMode:n}=e;return 1===n?(t*=40,r*=40):2===n&&(t*=800,r*=800),[t,r]}function En(e,...t){return"function"==typeof e?e(...t):e}function Sn(){}function Mn(...e){return 0===e.length?Sn:1===e.length?e[0]:function(){let t;for(const r of e)t=r.apply(this,arguments)||t;return t}}function _n(e,t){return Object.assign({},t,e||{})}class Tn{constructor(e,t,r){this.ctrl=e,this.args=t,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:r,args:n}=this;t[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=n,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,r=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=r.from?En(r.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:r,shared:n}=this;t.args=this.args;let i=0;if(e&&(t.event=e,r.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,n.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,n.locked=!!document.pointerLockElement,Object.assign(n,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:r,altKey:n,metaKey:i,ctrlKey:a}=e;Object.assign(t,{shiftKey:r,altKey:n,metaKey:i,ctrlKey:a})}return t}(e)),n.down=n.pressed=n.buttons%2==1||n.touches>0,i=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);en.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[a,s]=t._movement,[o,l]=r.threshold,{_step:c,values:u}=t;if(r.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(a)>=o&&u[0]),!1===c[1]&&(c[1]=Math.abs(s)>=l&&u[1])):(!1===c[0]&&(c[0]=Math.abs(a)>=o&&Math.sign(a)*o),!1===c[1]&&(c[1]=Math.abs(s)>=l&&Math.sign(s)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const h=[0,0];if(r.hasCustomTransform){const[e,t]=u;h[0]=!1!==c[0]?e-c[0]:0,h[1]=!1!==c[1]?t-c[1]:0}else h[0]=!1!==c[0]?a-c[0]:0,h[1]=!1!==c[1]?s-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(h);const d=t.offset,p=t._active&&!t._blocked||t.active;p&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=n[this.ingKey]=t._active,e&&(t.first&&("bounds"in r&&(t._bounds=En(r.bounds,t)),this.setup&&this.setup()),t.movement=h,this.computeOffset()));const[f,m]=t.offset,[[g,v],[A,y]]=t._bounds;t.overflow=[f<g?-1:f>v?1:0,m<A?-1:m>y?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const x=t._active&&r.rubberband||[0,0];if(t.offset=function(e,[t,r],[n,i]){const[[a,s],[o,l]]=e;return[rn(t,a,s,n),rn(r,o,l,i)]}(t._bounds,t.offset,x),t.delta=en.sub(t.offset,d),this.computeMovement(),p&&(!t.last||i>32)){t.delta=en.sub(t.offset,d);const e=t.delta.map(Math.abs);en.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&i>0&&(t.velocity=[e[0]/i,e[1]/i],t.timeDelta=i)}}emit(){const e=this.state,t=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const n=this.handler(on(on(on({},t),e),{},{[this.aliasKey]:e.values}));void 0!==n&&(e.memo=n)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class Cn extends Tn{constructor(...e){super(...e),an(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=en.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=en.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,r=this.config;if(!t.axis&&e){const n="object"==typeof r.axisThreshold?r.axisThreshold[mn(e)]:r.axisThreshold;t.axis=function([e,t],r){const n=Math.abs(e),i=Math.abs(t);return n>i&&n>r?"x":i>n&&i>r?"y":void 0}(t._movement,n)}t._blocked=(r.lockDirection||!!r.axis)&&!t.axis||!!r.axis&&r.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const In=e=>e,Bn={enabled:(e=!0)=>e,eventOptions:(e,t,r)=>on(on({},r.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return en.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?en.toVector(e):void 0,transform(e,t,r){const n=e||r.shared.transform;return this.hasCustomTransform=!!n,n||In},threshold:e=>en.toVector(e,0)};const Rn=on(on({},Bn),{},{axis(e,t,{axis:r}){if(this.lockDirection="lock"===r,!this.lockDirection)return r},axisThreshold:(e=0)=>e,bounds(e={}){if("function"==typeof e)return t=>Rn.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:r=1/0,top:n=-1/0,bottom:i=1/0}=e;return[[t,r],[n,i]]}}),Pn={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};const Fn="undefined"!=typeof window&&window.document&&window.document.createElement;function Ln(){return Fn&&"ontouchstart"in window||Fn&&window.navigator.maxTouchPoints>1}const Dn={isBrowser:Fn,gesture:function(){try{return"constructor"in GestureEvent}catch(Ha){return!1}}(),touch:Ln(),touchscreen:Ln(),pointer:Fn&&"onpointerdown"in window,pointerLock:Fn&&"exitPointerLock"in window.document},Un={mouse:0,touch:0,pen:8},Nn=on(on({},Rn),{},{device(e,t,{pointer:{touch:r=!1,lock:n=!1,mouse:i=!1}={}}){return this.pointerLock=n&&Dn.pointerLock,Dn.touch&&r?"touch":this.pointerLock?"mouse":Dn.pointer&&!i?"pointer":Dn.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:r}){if(this.preventScrollDelay="number"==typeof r?r:r||void 0===r&&e?250:void 0,Dn.touchscreen&&!1!==r)return e||(void 0!==r?"y":void 0)},pointerCapture(e,t,{pointer:{capture:r=!0,buttons:n=1,keys:i=!0}={}}){return this.pointerButtons=n,this.keys=i,!this.pointerLock&&"pointer"===this.device&&r},threshold(e,t,{filterTaps:r=!1,tapsThreshold:n=3,axis:i}){const a=en.toVector(e,r?n:i?1:0);return this.filterTaps=r,this.tapsThreshold=n,a},swipe({velocity:e=.5,distance:t=50,duration:r=250}={}){return{velocity:this.transform(en.toVector(e)),distance:this.transform(en.toVector(t)),duration:r}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?on(on({},Un),e):Un,keyboardDisplacement:(e=10)=>e});function kn(e){const[t,r]=e.overflow,[n,i]=e._delta,[a,s]=e._direction;(t<0&&n>0&&a<0||t>0&&n<0&&a>0)&&(e._movement[0]=e._movementBound[0]),(r<0&&i>0&&s<0||r>0&&i<0&&s>0)&&(e._movement[1]=e._movementBound[1])}const On=on(on({},Bn),{},{device(e,t,{shared:r,pointer:{touch:n=!1}={}}){if(r.target&&!Dn.touch&&Dn.gesture)return"gesture";if(Dn.touch&&n)return"touch";if(Dn.touchscreen){if(Dn.pointer)return"pointer";if(Dn.touch)return"touch"}},bounds(e,t,{scaleBounds:r={},angleBounds:n={}}){const i=e=>{const t=_n(En(r,e),{min:-1/0,max:1/0});return[t.min,t.max]},a=e=>{const t=_n(En(n,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof r&&"function"!=typeof n?[i(),a()]:e=>[i(e),a(e)]},threshold(e,t,r){this.lockDirection="lock"===r.axis;return en.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e});const Gn=on(on({},Rn),{},{mouseOnly:(e=!0)=>e});const zn=Rn;const Vn=Rn;const Hn=on(on({},Rn),{},{mouseOnly:(e=!0)=>e}),Qn=new Map,jn=new Map;function Wn(e){Qn.set(e.key,e.engine),jn.set(e.key,e.resolver)}const Xn={key:"drag",engine:class extends Cn{constructor(...e){super(...e),an(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),n={left:t.left-r.left+e.offset[0],right:t.right-r.right+e.offset[0],top:t.top-r.top+e.offset[1],bottom:t.bottom-r.bottom+e.offset[1]};e._bounds=Rn.bounds(n)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout((()=>{this.compute(),this.emit()}),0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,r=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const n=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),n&&n.size>1&&r._pointerActive||(this.start(e),this.setupPointer(e),r._pointerId=xn(e),r._pointerActive=!0,this.computeValues(bn(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==mn(e)?(r._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,r=this.config;if(!t._pointerActive)return;const n=xn(e);if(void 0!==t._pointerId&&n!==t._pointerId)return;const i=bn(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=en.sub(i,t._values),this.computeValues(i)),en.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):r.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===r.preventScrollAxis||"xy"===r.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(s){0}const t=this.state,r=this.config;if(!t._active||!t._pointerActive)return;const n=xn(e);if(void 0!==t._pointerId&&n!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[i,a]=t._distance;if(t.tap=i<=r.tapsThreshold&&a<=r.tapsThreshold,t.tap&&r.filterTaps)t._force=!0;else{const[e,n]=t._delta,[i,a]=t._movement,[s,o]=r.swipe.velocity,[l,c]=r.swipe.distance,u=r.swipe.duration;if(t.elapsedTime<u){const r=Math.abs(e/t.timeDelta),u=Math.abs(n/t.timeDelta);r>s&&Math.abs(i)>l&&(t.swipe[0]=Math.sign(e)),u>o&&Math.abs(a)>c&&(t.swipe[1]=Math.sign(n))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,r=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",(()=>{this.state._step=[0,0],this.startPointerDrag(e)}),this.config.delay)}keyDown(e){const t=Pn[e.key];if(t){const r=this.state,n=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=t(this.config.keyboardDisplacement,n),r._keyboardActive=!0,en.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in Pn&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:Nn},Yn={key:"hover",engine:class extends Cn{constructor(...e){super(...e),an(this,"ingKey","hovering")}enter(e){this.config.mouseOnly&&"mouse"!==e.pointerType||(this.start(e),this.computeValues(bn(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&"mouse"!==e.pointerType)return;const t=this.state;if(!t._active)return;t._active=!1;const r=bn(e);t._movement=t._delta=en.sub(r,t._values),this.computeValues(r),this.compute(e),t.delta=t.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}},resolver:Hn},qn={key:"move",engine:class extends Cn{constructor(...e){super(...e),an(this,"ingKey","moving")}move(e){this.config.mouseOnly&&"mouse"!==e.pointerType||(this.state._active?this.moveChange(e):this.moveStart(e),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(e){this.start(e),this.computeValues(bn(e)),this.compute(e),this.computeInitial(),this.emit()}moveChange(e){if(!this.state._active)return;const t=bn(e),r=this.state;r._delta=en.sub(t,r._values),en.addTo(r._movement,r._delta),this.computeValues(t),this.compute(e),this.emit()}moveEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}bind(e){e("pointer","change",this.move.bind(this)),e("pointer","leave",this.moveEnd.bind(this))}},resolver:Gn},Kn={key:"pinch",engine:class extends Tn{constructor(...e){super(...e),an(this,"ingKey","pinching"),an(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:t,lastOffset:r}=this.state;this.state.offset="wheel"===e?en.add(t,r):[(1+t[0])*r[0],t[1]+r[1]]}computeMovement(){const{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){const e=this.state,[t,r]=e._movement;if(!e.axis){const n=30*Math.abs(t)-Math.abs(r);n<0?e.axis="angle":n>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&("scale"===this.state.axis?e[1]=0:"angle"===this.state.axis&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout((()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()}),0)}touchStart(e){this.ctrl.setEventIds(e);const t=this.state,r=this.ctrl.touchIds;if(t._active&&t._touchIds.every((e=>r.has(e))))return;if(r.size<2)return;this.start(e),t._touchIds=Array.from(r).slice(0,2);const n=yn(e,t._touchIds);n&&this.pinchStart(e,n)}pointerStart(e){if(null!=e.buttons&&e.buttons%2!=1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const t=this.state,r=t._pointerEvents,n=this.ctrl.pointerIds;if(t._active&&Array.from(r.keys()).every((e=>n.has(e))))return;if(r.size<2&&r.set(e.pointerId,e),t._pointerEvents.size<2)return;this.start(e);const i=vn(...Array.from(r.values()));i&&this.pinchStart(e,i)}pinchStart(e,t){this.state.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const t=yn(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){const t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;const r=vn(...Array.from(t.values()));r&&this.pinchMove(e,r)}pinchMove(e,t){const r=this.state,n=r._values[1],i=t.angle-n;let a=0;Math.abs(i)>270&&(a+=Math.sign(i)),this.computeValues([t.distance,t.angle-360*a]),r.origin=t.origin,r.turns=a,r._movement=[r._values[0]/r._initial[0]-1,r._values[1]-r._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some((e=>!this.ctrl.touchIds.has(e)))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch(r){}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];const r=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=en.sub(t._movement,r),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const t=this.config.modifierKey;t&&!e[t]||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const t=this.state;t._delta=[-wn(e)[1]/100*t.offset[0],0],en.addTo(t._movement,t._delta),kn(t),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this)),e("lostPointerCapture","",this[t+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}},resolver:On},Jn={key:"scroll",engine:class extends Cn{constructor(...e){super(...e),an(this,"ingKey","scrolling")}scroll(e){this.state._active||this.start(e),this.scrollChange(e),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(e){e.cancelable&&e.preventDefault();const t=this.state,r=function(e){var t,r;const{scrollX:n,scrollY:i,scrollLeft:a,scrollTop:s}=e.currentTarget;return[null!==(t=null!=n?n:a)&&void 0!==t?t:0,null!==(r=null!=i?i:s)&&void 0!==r?r:0]}(e);t._delta=en.sub(r,t._values),en.addTo(t._movement,t._delta),this.computeValues(r),this.compute(e),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("scroll","",this.scroll.bind(this))}},resolver:zn},Zn={key:"wheel",engine:class extends Cn{constructor(...e){super(...e),an(this,"ingKey","wheeling")}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){const t=this.state;t._delta=wn(e),en.addTo(t._movement,t._delta),kn(t),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}},resolver:Vn};function $n(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const ei={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=(Dn.isBrowser?window:void 0))=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},ti=["target","eventOptions","window","enabled","transform"];function ri(e={},t){const r={};for(const[n,i]of Object.entries(t))switch(typeof i){case"function":r[n]=i.call(r,e[n],n,e);break;case"object":r[n]=ri(e[n],i);break;case"boolean":i&&(r[n]=e[n])}return r}class ni{constructor(e,t){an(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,r,n,i){const a=this._listeners,s=function(e,t=""){const r=ln[e];return e+(r&&r[t]||t)}(t,r),o=on(on({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),i);e.addEventListener(s,n,o);const l=()=>{e.removeEventListener(s,n,o),a.delete(l)};return a.add(l),l}clean(){this._listeners.forEach((e=>e())),this._listeners.clear()}}class ii{constructor(){an(this,"_timeouts",new Map)}add(e,t,r=140,...n){this.remove(e),this._timeouts.set(e,window.setTimeout(t,r,...n))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach((e=>{window.clearTimeout(e)})),this._timeouts.clear()}}class ai{constructor(e){an(this,"gestures",new Set),an(this,"_targetEventStore",new ni(this)),an(this,"gestureEventStores",{}),an(this,"gestureTimeoutStores",{}),an(this,"handlers",{}),an(this,"config",{}),an(this,"pointerIds",new Set),an(this,"touchIds",new Set),an(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&si(e,"drag");t.wheel&&si(e,"wheel");t.scroll&&si(e,"scroll");t.move&&si(e,"move");t.pinch&&si(e,"pinch");t.hover&&si(e,"hover")}(this,e)}setEventIds(e){return fn(e)?(this.touchIds=new Set(An(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,r={}){const n=e,{target:i,eventOptions:a,window:s,enabled:o,transform:l}=n,c=$n(n,ti);if(r.shared=ri({target:i,eventOptions:a,window:s,enabled:o,transform:l},ei),t){const e=jn.get(t);r[t]=ri(on({shared:r.shared},c),e)}else for(const u in c){const e=jn.get(u);e&&(r[u]=ri(on({shared:r.shared},c[u]),e))}return r}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,r={};let n;if(!t.target||(n=t.target(),n)){if(t.enabled){for(const t of this.gestures){const i=this.config[t],a=oi(r,i.eventOptions,!!n);if(i.enabled){new(Qn.get(t))(this,e,t).bind(a)}}const i=oi(r,t.eventOptions,!!n);for(const t in this.nativeHandlers)i(t,"",(r=>this.nativeHandlers[t](on(on({},this.state.shared),{},{event:r,args:e}))),void 0,!0)}for(const e in r)r[e]=Mn(...r[e]);if(!n)return r;for(const e in r){const{device:t,capture:i,passive:a}=pn(e);this._targetEventStore.add(n,t,"",r[e],{capture:i,passive:a})}}}}function si(e,t){e.gestures.add(t),e.gestureEventStores[t]=new ni(e,t),e.gestureTimeoutStores[t]=new ii}const oi=(e,t,r)=>(n,i,a,s={},o=!1)=>{var l,c;const u=null!==(l=s.capture)&&void 0!==l?l:t.capture,h=null!==(c=s.passive)&&void 0!==c?c:t.passive;let d=o?n:hn(n,i,u);r&&h&&(d+="Passive"),e[d]=e[d]||[],e[d].push(a)},li=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function ci(e,t,r,n,i,a){if(!e.has(r))return;if(!Qn.has(n))return void 0;const s=r+"Start",o=r+"End";i[n]=e=>{let n;return e.first&&s in t&&t[s](e),r in t&&(n=t[r](e)),e.last&&o in t&&t[o](e),n},a[n]=a[n]||{}}function ui(e,t){const[r,n,i]=function(e){const t={},r={},n=new Set;for(let i in e)li.test(i)?(n.add(RegExp.lastMatch),r[i]=e[i]):t[i]=e[i];return[r,t,n]}(e),a={};return ci(i,r,"onDrag","drag",a,t),ci(i,r,"onWheel","wheel",a,t),ci(i,r,"onScroll","scroll",a,t),ci(i,r,"onPinch","pinch",a,t),ci(i,r,"onMove","move",a,t),ci(i,r,"onHover","hover",a,t),{handlers:a,config:t,nativeHandlers:n}}function hi(e,t={},r,n){const a=i.useMemo((()=>new ai(e)),[]);if(a.applyHandlers(e,n),a.applyConfig(t,r),i.useEffect(a.effect.bind(a)),i.useEffect((()=>a.clean.bind(a)),[]),void 0===t.target)return a.bind.bind(a)}function di(e,t){const r=([Xn,Kn,Jn,Zn,qn,Yn].forEach(Wn),function(e,t){const{handlers:r,nativeHandlers:n,config:i}=ui(e,t||{});return hi(r,i,void 0,n)});return r(e,t||{})}function pi({snap:e,global:t,cursor:r=!0,children:a,speed:l=1,rotation:c=[0,0,0],zoom:u=1,polar:h=[0,Math.PI/2],azimuth:d=[-1/0,1/0],config:p={mass:1,tension:170,friction:26}}){const{size:f,gl:m}=(0,o.useThree)(),g=i.useMemo((()=>[c[0]+h[0],c[0]+h[1]]),[c[0],h[0],h[1]]),v=i.useMemo((()=>[c[1]+d[0],c[1]+d[1]]),[c[1],d[0],d[1]]),A=i.useMemo((()=>[s.MathUtils.clamp(c[0],...g),s.MathUtils.clamp(c[1],...v),c[2]]),[c[0],c[1],c[2],g,v]),[y,x]=Wr((()=>({scale:1,rotation:A,config:p})));i.useEffect((()=>{x.start({scale:1,rotation:A,config:p})}),[A]),i.useEffect((()=>{t&&r&&(m.domElement.style.cursor="grab")}),[t,r,m.domElement]);const b=di({onHover:({last:e})=>{r&&!t&&(m.domElement.style.cursor=e?"auto":"grab")},onDrag:({down:t,delta:[n,i],memo:[a,o]=y.rotation.animation.to||A})=>{r&&(m.domElement.style.cursor=t?"grabbing":"grab"),n=s.MathUtils.clamp(o+n/f.width*Math.PI*l,...v),i=s.MathUtils.clamp(a+i/f.height*Math.PI*l,...g);const c=e&&!t&&"boolean"!=typeof e?e:p;return x.start({scale:t&&i>g[1]/2?u:1,rotation:e&&!t?A:[i,n,0],config:e=>"scale"===e?{...c,friction:3*c.friction}:c}),[i,n]}},{target:t?m.domElement:void 0});return i.createElement($r.group,n({},null==b?void 0:b(),y),a)}var fi=r(31480),mi=r(60374);const gi=i.createContext([]);function vi({box:e,multiple:t,children:r,onChange:a,border:l="1px solid #55aaff",backgroundColor:c="rgba(75, 160, 255, 0.1)",filter:u=(e=>e),...h}){const{camera:d,raycaster:p,gl:f,controls:m,size:g,get:v}=(0,o.useThree)(),[A,y]=i.useState(!1),[x,b]=i.useReducer(((e,{object:t,shift:r})=>void 0===t?[]:Array.isArray(t)?t:r?e.includes(t)?e.filter((e=>e!==t)):[t,...e]:e[0]===t?[]:[t]),[]);i.useEffect((()=>{null==a||a(x)}),[x]);const w=i.useCallback((e=>{e.stopPropagation(),b({object:u([e.object])[0],shift:t&&e.shiftKey})}),[]),E=i.useCallback((e=>!A&&b({})),[A]),S=i.useRef(null);return i.useEffect((()=>{if(!e||!t)return;const r=new fi.M(d,S.current),n=document.createElement("div");n.style.pointerEvents="none",n.style.border=l,n.style.backgroundColor=c,n.style.position="fixed";const i=new s.Vector2,a=new s.Vector2,o=new s.Vector2,h=p.enabled,A=null==m?void 0:m.enabled;let y=!1;function x(e,t){var r;const{offsetX:n,offsetY:i}=null!==(r=null==p.computeOffsets?void 0:p.computeOffsets(e,v()))&&void 0!==r?r:e,{width:a,height:s}=g;t.set(n/a*2-1,-i/s*2+1)}function w(e){e.shiftKey&&(!function(e){var t;m&&(m.enabled=!1),p.enabled=!1,y=!0,null==(t=f.domElement.parentElement)||t.appendChild(n),n.style.left=`${e.clientX}px`,n.style.top=`${e.clientY}px`,n.style.width="0px",n.style.height="0px",i.x=e.clientX,i.y=e.clientY}(e),x(e,r.startPoint))}let E=[];function M(e){if(y){!function(e){o.x=Math.max(i.x,e.clientX),o.y=Math.max(i.y,e.clientY),a.x=Math.min(i.x,e.clientX),a.y=Math.min(i.y,e.clientY),n.style.left=`${a.x}px`,n.style.top=`${a.y}px`,n.style.width=o.x-a.x+"px",n.style.height=o.y-a.y+"px"}(e),x(e,r.endPoint);const t=r.select().sort((e=>e.uuid)).filter((e=>e.isMesh));(0,mi.Z)(t,E)||(E=t,b({object:u(t)}))}}function _(e){var t;y&&y&&(m&&(m.enabled=A),p.enabled=h,y=!1,null==(t=n.parentElement)||t.removeChild(n))}return document.addEventListener("pointerdown",w,{passive:!0}),document.addEventListener("pointermove",M,{passive:!0,capture:!0}),document.addEventListener("pointerup",_,{passive:!0}),()=>{document.removeEventListener("pointerdown",w),document.removeEventListener("pointermove",M),document.removeEventListener("pointerup",_)}}),[g,p,d,m,f]),i.createElement("group",n({ref:S,onClick:w,onPointerOver:()=>y(!0),onPointerOut:()=>y(!1),onPointerMissed:E},h),i.createElement(gi.Provider,{value:x},r))}function Ai(){return i.useContext(gi)}const yi=i.forwardRef((function({follow:e=!0,lockX:t=!1,lockY:r=!1,lockZ:a=!1,...s},l){const c=i.useRef();return(0,o.useFrame)((({camera:n})=>{if(!e||!c.current)return;const i=c.current.rotation.clone();c.current.quaternion.copy(n.quaternion),t&&(c.current.rotation.x=i.x),r&&(c.current.rotation.y=i.y),a&&(c.current.rotation.z=i.z)})),i.createElement("group",n({ref:_([c,l])},s))}));var xi=r(43075),bi=r(10977),wi=r(51815);const Ei=i.forwardRef((function({points:e,color:t="black",vertexColors:r,lineWidth:a,dashed:o,...l},c){const[u]=i.useState((()=>new xi.w)),[h]=i.useState((()=>new bi.Y)),[d]=i.useState((()=>new s.Vector2(512,512))),p=i.useMemo((()=>{const t=new wi.L,n=e.map((e=>e instanceof s.Vector3?e.toArray():e));if(t.setPositions(n.flat()),r){const e=r.map((e=>e instanceof s.Color?e.toArray():e));t.setColors(e.flat())}return t}),[e,r]);return i.useLayoutEffect((()=>{u.computeLineDistances()}),[e,u]),i.useLayoutEffect((()=>{o?h.defines.USE_DASH="":delete h.defines.USE_DASH,h.needsUpdate=!0}),[o,h]),i.useEffect((()=>()=>p.dispose()),[p]),i.createElement("primitive",n({object:u,ref:c},l),i.createElement("primitive",{object:p,attach:"geometry"}),i.createElement("primitive",n({object:h,attach:"material",color:t,vertexColors:Boolean(r),resolution:d,linewidth:a,dashed:o},l)))})),Si=new s.Vector3,Mi=i.forwardRef((function({start:e=[0,0,0],end:t=[0,0,0],mid:r,segments:a=20,...o},l){const c=i.useRef(null),[u]=i.useState((()=>new s.QuadraticBezierCurve3(void 0,void 0,void 0))),h=i.useCallback(((e,t,r,n=20)=>(e instanceof s.Vector3?u.v0.copy(e):u.v0.set(...e),t instanceof s.Vector3?u.v2.copy(t):u.v2.set(...t),r instanceof s.Vector3?u.v1.copy(r):u.v1.copy(u.v0.clone().add(u.v2.clone().sub(u.v0)).add(Si.set(0,u.v0.y-u.v2.y,0))),u.getPoints(n))),[]);i.useLayoutEffect((()=>{c.current.setPoints=(e,t,r)=>{const n=h(e,t,r);c.current.geometry&&c.current.geometry.setPositions(n.map((e=>e.toArray())).flat())}}),[]);const d=i.useMemo((()=>h(e,t,r,a)),[e,t,r,a]);return i.createElement(Ei,n({ref:_([c,l]),points:d},o))})),_i=i.forwardRef((function({start:e,end:t,midA:r,midB:a,segments:o=20,...l},c){const u=i.useMemo((()=>{const n=e instanceof s.Vector3?e:new s.Vector3(...e),i=t instanceof s.Vector3?t:new s.Vector3(...t),l=r instanceof s.Vector3?r:new s.Vector3(...r),c=a instanceof s.Vector3?a:new s.Vector3(...a);return new s.CubicBezierCurve3(n,l,c,i).getPoints(o)}),[e,t,r,a,o]);return i.createElement(Ei,n({ref:c,points:u},l))})),Ti=i.forwardRef((({url:e,distance:t=1,loop:r=!0,autoplay:a,...l},c)=>{const u=i.useRef(),h=(0,o.useThree)((({camera:e})=>e)),[d]=i.useState((()=>new s.AudioListener)),p=(0,o.useLoader)(s.AudioLoader,e);return i.useEffect((()=>{const e=u.current;e&&(e.setBuffer(p),e.setRefDistance(t),e.setLoop(r),a&&!e.isPlaying&&e.play())}),[p,h,t,r]),i.useEffect((()=>{const e=u.current;return h.add(d),()=>{h.remove(d),e&&(e.isPlaying&&e.stop(),e.source&&e.source._connected&&e.disconnect())}}),[]),i.createElement("positionalAudio",n({ref:_([u,c]),args:[d]},l))}));function Ci(){var e,t=0,r=[],n=0,i=0;var a=d((function(e){i||o(1,e)})),s=d((function(e){i||o(-1,e)}));function o(r,n){i++;var a=0;try{n===m&&p();var s=r>0&&h(n);s?s.call(n,d((function(e){a++,o(1,e)})),d((function(e){a++,o(-1,e)}))):(t=r,e=n,l())}catch(Ha){t||a||o(-1,Ha)}}function l(){n||(setTimeout(c,0),n=1)}function c(){var e=r;n=0,r=[],e.forEach(u)}function u(e){e()}function h(e){var t=e&&(f(e)||"object"==typeof e)&&e.then;return f(t)&&t}function d(e){var t=0;return function(){for(var r=[],n=arguments.length;n--;)r[n]=arguments[n];t++||e.apply(this,r)}}function p(){throw new TypeError("Chaining cycle detected")}var f=function(e){return"function"==typeof e},m={then:function(n,i){var a=Ci();return r.push((function(){var r=t>0?n:i;if(f(r))try{var s=r(e);s===a&&p();var o=h(s);o?o.call(s,a.resolve,a.reject):a.resolve(s)}catch(l){a.reject(l)}else a[t>0?"resolve":"reject"](e)})),t&&l(),a},resolve:a,reject:s};return m}function Ii(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return{then:r.then.bind(r),resolve:e,reject:t}}Ci.all=Ii.all=function(e){var t=0,r=[],n=Bi();return 0===e.length?n.resolve([]):e.forEach((function(i,a){var s=Bi();s.resolve(i),s.then((function(i){t++,r[a]=i,t===e.length&&n.resolve(r)}),n.reject)})),n};var Bi="function"==typeof Promise?Ii:Ci;function Ri(){var e=Object.create(null);function t(n,i){var a=n.id,s=n.name,o=n.dependencies;void 0===o&&(o=[]);var l=n.init;void 0===l&&(l=function(){});var c=n.getTransferables;if(void 0===c&&(c=null),!e[a])try{o=o.map((function(r){return r&&r.isWorkerModule&&(t(r,(function(e){if(e instanceof Error)throw e})),r=e[r.id].value),r})),l=r("<"+s+">.init",l),c&&(c=r("<"+s+">.getTransferables",c));var u=null;"function"==typeof l?u=l.apply(void 0,o):console.error("worker module init function failed to rehydrate"),e[a]={id:a,value:u,getTransferables:c},i(u)}catch(h){h&&h.noLog||console.error(h),i(h)}}function r(e,t){var r=void 0;self.troikaDefine=function(e){return r=e};var n=URL.createObjectURL(new Blob(["/** "+e.replace(/\*/g,"")+" **/\n\ntroikaDefine(\n"+t+"\n)"],{type:"application/javascript"}));try{importScripts(n)}catch(i){console.error(i)}return URL.revokeObjectURL(n),delete self.troikaDefine,r}self.addEventListener("message",(function(r){var n=r.data,i=n.messageId,a=n.action,s=n.data;try{"registerModule"===a&&t(s,(function(e){e instanceof Error?postMessage({messageId:i,success:!1,error:e.message}):postMessage({messageId:i,success:!0,result:{isCallable:"function"==typeof e}})})),"callModule"===a&&function(t,r){var n,i=t.id,a=t.args;e[i]&&"function"==typeof e[i].value||r(new Error("Worker module "+i+": not found or its 'init' did not return a function"));try{var s=(n=e[i]).value.apply(n,a);s&&"function"==typeof s.then?s.then(o,(function(e){return r(e instanceof Error?e:new Error(""+e))})):o(s)}catch(l){r(l)}function o(t){try{var n=e[i].getTransferables&&e[i].getTransferables(t);n&&Array.isArray(n)&&n.length||(n=void 0),r(t,n)}catch(l){console.error(l),r(l)}}}(s,(function(e,t){e instanceof Error?postMessage({messageId:i,success:!1,error:e.message}):postMessage({messageId:i,success:!0,result:e},t||void 0)}))}catch(o){postMessage({messageId:i,success:!1,error:o.stack})}}))}var Pi=function(){var e=!1;if("undefined"!=typeof window&&void 0!==window.document)try{new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"}))).terminate(),e=!0}catch(t){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+t.message+"]")}return Pi=function(){return e},e},Fi=0,Li=0,Di=!1,Ui=Object.create(null),Ni=Object.create(null),ki=Object.create(null);function Oi(e){if(!(e&&"function"==typeof e.init||Di))throw new Error("requires `options.init` function");var t=e.dependencies,r=e.init,n=e.getTransferables,i=e.workerId;if(!Pi())return function(e){var t=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return t._getInitResult().then((function(t){if("function"==typeof t)return t.apply(void 0,e);throw new Error("Worker module function was called but `init` did not return a callable function")}))};return t._getInitResult=function(){var r=e.dependencies,n=e.init;r=Array.isArray(r)?r.map((function(e){return e&&e._getInitResult?e._getInitResult():e})):[];var i=Bi.all(r).then((function(e){return n.apply(null,e)}));return t._getInitResult=function(){return i},i},t}(e);null==i&&(i="#default");var a="workerModule"+ ++Fi,s=e.name||a,o=null;function l(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(!o){o=zi(i,"registerModule",l.workerModuleData);var r=function(){o=null,Ni[i].delete(r)};(Ni[i]||(Ni[i]=new Set)).add(r)}return o.then((function(t){if(t.isCallable)return zi(i,"callModule",{id:a,args:e});throw new Error("Worker module function was called but `init` did not return a callable function")}))}return t=t&&t.map((function(e){return"function"!=typeof e||e.workerModuleData||(Di=!0,e=Oi({workerId:i,name:"<"+s+"> function dependency: "+e.name,init:"function(){return (\n"+Gi(e)+"\n)}"}),Di=!1),e&&e.workerModuleData&&(e=e.workerModuleData),e})),l.workerModuleData={isWorkerModule:!0,id:a,name:s,dependencies:t,init:Gi(r),getTransferables:n&&Gi(n)},l}function Gi(e){var t=e.toString();return!/^function/.test(t)&&/^\w+\s*\(/.test(t)&&(t="function "+t),t}function zi(e,t,r){var n=Bi(),i=++Li;return ki[i]=function(e){e.success?n.resolve(e.result):n.reject(new Error("Error in worker "+t+" call: "+e.error))},function(e){var t=Ui[e];if(!t){var r=Gi(Ri);(t=Ui[e]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+e.replace(/\*/g,"")+" **/\n\n;("+r+")()"],{type:"application/javascript"})))).onmessage=function(e){var t=e.data,r=t.messageId,n=ki[r];if(!n)throw new Error("WorkerModule response with empty or unknown messageId");delete ki[r],n(t)}}return t}(e).postMessage({messageId:i,action:t,data:r}),n}var Vi=Oi({name:"Thenable",dependencies:[Bi],init:function(e){return e}});function Hi(){var e=function(e){function t(e,t,r,n,i,a,s,o){var l=1-s;o.x=l*l*e+2*l*s*r+s*s*i,o.y=l*l*t+2*l*s*n+s*s*a}function r(e,t,r,n,i,a,s,o,l,c){var u=1-l;c.x=u*u*u*e+3*u*u*l*r+3*u*l*l*i+l*l*l*s,c.y=u*u*u*t+3*u*u*l*n+3*u*l*l*a+l*l*l*o}function n(e,t){for(var r,n,i,a,s,o=/([MLQCZ])([^MLQCZ]*)/g;r=o.exec(e);){var l=r[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map((function(e){return parseFloat(e)}));switch(r[1]){case"M":a=n=l[0],s=i=l[1];break;case"L":l[0]===a&&l[1]===s||t("L",a,s,a=l[0],s=l[1]);break;case"Q":t("Q",a,s,a=l[2],s=l[3],l[0],l[1]);break;case"C":t("C",a,s,a=l[4],s=l[5],l[0],l[1],l[2],l[3]);break;case"Z":a===n&&s===i||t("L",a,s,n,i)}}}function i(e,i,a){void 0===a&&(a=16);var s={x:0,y:0};n(e,(function(e,n,o,l,c,u,h,d,p){switch(e){case"L":i(n,o,l,c);break;case"Q":for(var f=n,m=o,g=1;g<a;g++)t(n,o,u,h,l,c,g/(a-1),s),i(f,m,s.x,s.y),f=s.x,m=s.y;break;case"C":for(var v=n,A=o,y=1;y<a;y++)r(n,o,u,h,d,p,l,c,y/(a-1),s),i(v,A,s.x,s.y),v=s.x,A=s.y}}))}var a="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",s=new WeakMap,o={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function l(e,t){var r=e.getContext?e.getContext("webgl",o):e,n=s.get(r);if(!n){var i="undefined"!=typeof WebGL2RenderingContext&&r instanceof WebGL2RenderingContext,a={},l={},c={},u=-1,h=[];function d(e){var t=a[e];if(!t&&!(t=a[e]=r.getExtension(e)))throw new Error(e+" not supported");return t}function p(e,t){var n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),n}function f(e,t,n,a){if(!l[e]){var s={},o={},c=r.createProgram();r.attachShader(c,p(t,r.VERTEX_SHADER)),r.attachShader(c,p(n,r.FRAGMENT_SHADER)),r.linkProgram(c),l[e]={program:c,transaction:function(e){r.useProgram(c),e({setUniform:function(e,t){for(var n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];var a=o[t]||(o[t]=r.getUniformLocation(c,t));r["uniform"+e].apply(r,[a].concat(n))},setAttribute:function(e,t,n,a,o){var l=s[e];l||(l=s[e]={buf:r.createBuffer(),loc:r.getAttribLocation(c,e),data:null}),r.bindBuffer(r.ARRAY_BUFFER,l.buf),r.vertexAttribPointer(l.loc,t,r.FLOAT,!1,0,0),r.enableVertexAttribArray(l.loc),i?r.vertexAttribDivisor(l.loc,a):d("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(l.loc,a),o!==l.data&&(r.bufferData(r.ARRAY_BUFFER,o,n),l.data=o)}})}}}l[e].transaction(a)}function m(e,t){u++;try{r.activeTexture(r.TEXTURE0+u);var n=c[e];n||(n=c[e]=r.createTexture(),r.bindTexture(r.TEXTURE_2D,n),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST)),r.bindTexture(r.TEXTURE_2D,n),t(n,u)}finally{u--}}function g(e,t,n){var i=r.createFramebuffer();h.push(i),r.bindFramebuffer(r.FRAMEBUFFER,i),r.activeTexture(r.TEXTURE0+t),r.bindTexture(r.TEXTURE_2D,e),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0);try{n(i)}finally{r.deleteFramebuffer(i),r.bindFramebuffer(r.FRAMEBUFFER,h[--h.length-1]||null)}}function v(){a={},l={},c={},u=-1,h.length=0}r.canvas.addEventListener("webglcontextlost",(function(e){v(),e.preventDefault()}),!1),s.set(r,n={gl:r,isWebGL2:i,getExtension:d,withProgram:f,withTexture:m,withTextureFramebuffer:g,handleContextLoss:v})}t(n)}function c(e,t,r,n,i,s,o,c){void 0===o&&(o=15),void 0===c&&(c=null),l(e,(function(e){var l=e.gl,u=e.withProgram;(0,e.withTexture)("copy",(function(e,h){l.texImage2D(l.TEXTURE_2D,0,l.RGBA,i,s,0,l.RGBA,l.UNSIGNED_BYTE,t),u("copy",a,"precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",(function(e){var t=e.setUniform;(0,e.setAttribute)("aUV",2,l.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),t("1i","image",h),l.bindFramebuffer(l.FRAMEBUFFER,c||null),l.disable(l.BLEND),l.colorMask(8&o,4&o,2&o,1&o),l.viewport(r,n,i,s),l.scissor(r,n,i,s),l.drawArrays(l.TRIANGLES,0,3)}))}))}))}var u=Object.freeze({__proto__:null,withWebGLContext:l,renderImageData:c,resizeWebGLCanvasWithoutClearing:function(e,t,r){var n=e.width,i=e.height;l(e,(function(a){var s=a.gl,o=new Uint8Array(n*i*4);s.readPixels(0,0,n,i,s.RGBA,s.UNSIGNED_BYTE,o),e.width=t,e.height=r,c(s,o,0,0,n,i)}))}});function h(e,t,r,n,a,s){void 0===s&&(s=1);var o=new Uint8Array(e*t),l=n[2]-n[0],c=n[3]-n[1],u=[];i(r,(function(e,t,r,n){u.push({x1:e,y1:t,x2:r,y2:n,minX:Math.min(e,r),minY:Math.min(t,n),maxX:Math.max(e,r),maxY:Math.max(t,n)})})),u.sort((function(e,t){return e.maxX-t.maxX}));for(var h=0;h<e;h++)for(var d=0;d<t;d++){var p=g(n[0]+l*(h+.5)/e,n[1]+c*(d+.5)/t),m=Math.pow(1-Math.abs(p)/a,s)/2;p<0&&(m=1-m),m=Math.max(0,Math.min(255,Math.round(255*m))),o[d*e+h]=m}return o;function g(e,t){for(var r=1/0,n=1/0,i=u.length;i--;){var a=u[i];if(a.maxX+n<=e)break;if(e+n>a.minX&&t-n<a.maxY&&t+n>a.minY){var s=f(e,t,a.x1,a.y1,a.x2,a.y2);s<r&&(r=s,n=Math.sqrt(r))}}return function(e,t){for(var r=0,n=u.length;n--;){var i=u[n];if(i.maxX<=e)break;i.y1>t!=i.y2>t&&e<(i.x2-i.x1)*(t-i.y1)/(i.y2-i.y1)+i.x1&&(r+=i.y1<i.y2?1:-1)}return 0!==r}(e,t)&&(n=-n),n}}function d(e,t,r,n,i,a,s,o,l,c){void 0===a&&(a=1),void 0===o&&(o=0),void 0===l&&(l=0),void 0===c&&(c=0),p(e,t,r,n,i,a,s,null,o,l,c)}function p(e,t,r,n,i,a,s,o,l,u,d){void 0===a&&(a=1),void 0===l&&(l=0),void 0===u&&(u=0),void 0===d&&(d=0);for(var p=h(e,t,r,n,i,a),f=new Uint8Array(4*p.length),m=0;m<p.length;m++)f[4*m+d]=p[m];c(s,f,l,u,e,t,1<<3-d,o)}function f(e,t,r,n,i,a){var s=i-r,o=a-n,l=s*s+o*o,c=l?Math.max(0,Math.min(1,((e-r)*s+(t-n)*o)/l)):0,u=e-(r+c*s),h=t-(n+c*o);return u*u+h*h}var m=Object.freeze({__proto__:null,generate:h,generateIntoCanvas:d,generateIntoFramebuffer:p}),g=new Float32Array([0,0,2,0,0,2]),v=null,A=!1,y={},x=new WeakMap;function b(e){if(!A&&!M(e))throw new Error("WebGL generation not supported")}function w(e,t,r,n,i,a,s){if(void 0===a&&(a=1),void 0===s&&(s=null),!s&&!(s=v)){var o="function"==typeof OffscreenCanvas?new OffscreenCanvas(1,1):"undefined"!=typeof document?document.createElement("canvas"):null;if(!o)throw new Error("OffscreenCanvas or DOM canvas not supported");s=v=o.getContext("webgl",{depth:!1})}b(s);var c=new Uint8Array(e*t*4);l(s,(function(s){var o=s.gl,l=s.withTexture,u=s.withTextureFramebuffer;l("readable",(function(s,l){o.texImage2D(o.TEXTURE_2D,0,o.RGBA,e,t,0,o.RGBA,o.UNSIGNED_BYTE,null),u(s,l,(function(s){S(e,t,r,n,i,a,o,s,0,0,0),o.readPixels(0,0,e,t,o.RGBA,o.UNSIGNED_BYTE,c)}))}))}));for(var u=new Uint8Array(e*t),h=0,d=0;h<c.length;h+=4)u[d++]=c[h];return u}function E(e,t,r,n,i,a,s,o,l,c){void 0===a&&(a=1),void 0===o&&(o=0),void 0===l&&(l=0),void 0===c&&(c=0),S(e,t,r,n,i,a,s,null,o,l,c)}function S(e,t,r,n,s,o,c,u,h,d,p){void 0===o&&(o=1),void 0===h&&(h=0),void 0===d&&(d=0),void 0===p&&(p=0),b(c);var f=[];i(r,(function(e,t,r,n){f.push(e,t,r,n)})),f=new Float32Array(f),l(c,(function(r){var i=r.gl,l=r.isWebGL2,c=r.getExtension,m=r.withProgram,v=r.withTexture,A=r.withTextureFramebuffer,y=r.handleContextLoss;if(v("rawDistances",(function(r,v){e===r._lastWidth&&t===r._lastHeight||i.texImage2D(i.TEXTURE_2D,0,i.RGBA,r._lastWidth=e,r._lastHeight=t,0,i.RGBA,i.UNSIGNED_BYTE,null),m("main","precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}","precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",(function(a){var u=a.setAttribute,h=a.setUniform,d=!l&&c("ANGLE_instanced_arrays"),p=!l&&c("EXT_blend_minmax");u("aUV",2,i.STATIC_DRAW,0,g),u("aLineSegment",4,i.DYNAMIC_DRAW,1,f),h.apply(void 0,["4f","uGlyphBounds"].concat(n)),h("1f","uMaxDistance",s),h("1f","uExponent",o),A(r,v,(function(r){i.enable(i.BLEND),i.colorMask(!0,!0,!0,!0),i.viewport(0,0,e,t),i.scissor(0,0,e,t),i.blendFunc(i.ONE,i.ONE),i.blendEquationSeparate(i.FUNC_ADD,l?i.MAX:p.MAX_EXT),i.clear(i.COLOR_BUFFER_BIT),l?i.drawArraysInstanced(i.TRIANGLES,0,3,f.length/4):d.drawArraysInstancedANGLE(i.TRIANGLES,0,3,f.length/4)}))})),m("post",a,"precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",(function(r){r.setAttribute("aUV",2,i.STATIC_DRAW,0,g),r.setUniform("1i","tex",v),i.bindFramebuffer(i.FRAMEBUFFER,u),i.disable(i.BLEND),i.colorMask(0===p,1===p,2===p,3===p),i.viewport(h,d,e,t),i.scissor(h,d,e,t),i.drawArrays(i.TRIANGLES,0,3)}))})),i.isContextLost())throw y(),new Error("webgl context lost")}))}function M(e){var t=e&&e!==v?e.canvas||e:y,r=x.get(t);if(void 0===r){A=!0;var n=null;try{var i=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],a=w(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,e);r=a&&i.length===a.length&&a.every((function(e,t){return e===i[t]})),r||(n="bad trial run results",console.info(i,a))}catch(s){r=!1,n=s.message}n&&console.warn("WebGL SDF generation not supported:",n),A=!1,x.set(t,r)}return r}var _=Object.freeze({__proto__:null,generate:w,generateIntoCanvas:E,generateIntoFramebuffer:S,isSupported:M});return e.forEachPathCommand=n,e.generate=function(e,t,r,n,i,a){void 0===i&&(i=Math.max(n[2]-n[0],n[3]-n[1])/2),void 0===a&&(a=1);try{return w.apply(_,arguments)}catch(Ha){return console.info("WebGL SDF generation failed, falling back to JS",Ha),h.apply(m,arguments)}},e.generateIntoCanvas=function(e,t,r,n,i,a,s,o,l,c){void 0===i&&(i=Math.max(n[2]-n[0],n[3]-n[1])/2),void 0===a&&(a=1),void 0===o&&(o=0),void 0===l&&(l=0),void 0===c&&(c=0);try{return E.apply(_,arguments)}catch(Ha){return console.info("WebGL SDF generation failed, falling back to JS",Ha),d.apply(m,arguments)}},e.javascript=m,e.pathToLineSegments=i,e.webgl=_,e.webglUtils=u,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return e}const Qi=function(){var e=function(e){var t={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},r={},n={};r.L=1,n[1]="L",Object.keys(t).forEach((function(e,t){r[e]=1<<t+1,n[r[e]]=e})),Object.freeze(r);var i=r.LRI|r.RLI|r.FSI,a=r.L|r.R|r.AL,s=r.B|r.S|r.WS|r.ON|r.FSI|r.LRI|r.RLI|r.PDI,o=r.BN|r.RLE|r.LRE|r.RLO|r.LRO|r.PDF,l=r.S|r.WS|r.B|i|r.PDI|o,c=null;function u(e){return function(){if(!c){c=new Map;var e=function(e){if(t.hasOwnProperty(e)){var n=0;t[e].split(",").forEach((function(t){var i=t.split("+"),a=i[0],s=i[1];a=parseInt(a,36),s=s?parseInt(s,36):0,c.set(n+=a,r[e]);for(var o=0;o<s;o++)c.set(++n,r[e])}))}};for(var n in t)e(n)}}(),c.get(e.codePointAt(0))||r.L}var h,d,p,f="14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",m="6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye";function g(e,t){var r,n=0,i=new Map,a=t&&new Map;return e.split(",").forEach((function e(s){if(-1!==s.indexOf("+"))for(var o=+s;o--;)e(r);else{r=s;var l=s.split(">"),c=l[0],u=l[1];c=String.fromCodePoint(n+=parseInt(c,36)),u=String.fromCodePoint(n+=parseInt(u,36)),i.set(c,u),t&&a.set(u,c)}})),{map:i,reverseMap:a}}function v(){if(!h){var e=g(f,!0),t=e.map,r=e.reverseMap;h=t,d=r,p=g(m,!1).map}}function A(e){return v(),h.get(e)||null}function y(e){return v(),d.get(e)||null}function x(e){return v(),p.get(e)||null}var b=r.L,w=r.R,E=r.EN,S=r.ES,M=r.ET,_=r.AN,T=r.CS,C=r.B,I=r.S,B=r.ON,R=r.BN,P=r.NSM,F=r.AL,L=r.LRO,D=r.RLO,U=r.LRE,N=r.RLE,k=r.PDF,O=r.LRI,G=r.RLI,z=r.FSI,V=r.PDI;var H;function Q(e){return function(){if(!H){var e=g("14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",!0),t=e.map;e.reverseMap.forEach((function(e,r){t.set(r,e)})),H=t}}(),H.get(e)||null}function j(e,t,r,n){var i=e.length;r=Math.max(0,null==r?0:+r),n=Math.min(i-1,null==n?i-1:+n);var a=[];return t.paragraphs.forEach((function(i){var s=Math.max(r,i.start),o=Math.min(n,i.end);if(s<o){for(var c=t.levels.slice(s,o+1),h=o;h>=s&&u(e[h])&l;h--)c[h]=i.level;for(var d=i.level,p=1/0,f=0;f<c.length;f++){var m=c[f];m>d&&(d=m),m<p&&(p=1|m)}for(var g=d;g>=p;g--)for(var v=0;v<c.length;v++)if(c[v]>=g){for(var A=v;v+1<c.length&&c[v+1]>=g;)v++;v>A&&a.push([A+r,v+r])}}})),a}function W(e,t,r,n){for(var i=j(e,t,r,n),a=[],s=0;s<e.length;s++)a[s]=s;return i.forEach((function(e){for(var t=e[0],r=e[1],n=a.slice(t,r+1),i=n.length;i--;)a[r-i]=n[i]})),a}return e.closingToOpeningBracket=y,e.getBidiCharType=u,e.getBidiCharTypeName=function(e){return n[u(e)]},e.getCanonicalBracket=x,e.getEmbeddingLevels=function(e,t){for(var r=new Uint32Array(e.length),n=0;n<e.length;n++)r[n]=u(e[n]);var c=new Map;function h(e,t){var n=r[e];r[e]=t,c.set(n,c.get(n)-1),n&s&&c.set(s,c.get(s)-1),c.set(t,(c.get(t)||0)+1),t&s&&c.set(s,(c.get(s)||0)+1)}for(var d=new Uint8Array(e.length),p=new Map,f=[],m=null,g=0;g<e.length;g++)m||f.push(m={start:g,end:e.length-1,level:"rtl"===t?1:"ltr"===t?0:zt(g,!1)}),r[g]&C&&(m.end=g,m=null);for(var v=N|U|D|L|i|V|k|C,H=function(e){return e+(1&e?1:2)},Q=function(e){return e+(1&e?2:1)},j=0;j<f.length;j++){var W=[{_level:(m=f[j]).level,_override:0,_isolate:0}],X=void 0,Y=0,q=0,K=0;c.clear();for(var J=m.start;J<=m.end;J++){var Z=r[J];if(X=W[W.length-1],c.set(Z,(c.get(Z)||0)+1),Z&s&&c.set(s,(c.get(s)||0)+1),Z&v)if(Z&(N|U)){d[J]=X._level;var $=(Z===N?Q:H)(X._level);$<=125&&!Y&&!q?W.push({_level:$,_override:0,_isolate:0}):Y||q++}else if(Z&(D|L)){d[J]=X._level;var ee=(Z===D?Q:H)(X._level);ee<=125&&!Y&&!q?W.push({_level:ee,_override:Z&D?w:b,_isolate:0}):Y||q++}else if(Z&i){Z&z&&(Z=1===zt(J+1,!0)?G:O),d[J]=X._level,X._override&&h(J,X._override);var te=(Z===G?Q:H)(X._level);te<=125&&0===Y&&0===q?(K++,W.push({_level:te,_override:0,_isolate:1,_isolInitIndex:J})):Y++}else if(Z&V){if(Y>0)Y--;else if(K>0){for(q=0;!W[W.length-1]._isolate;)W.pop();var re=W[W.length-1]._isolInitIndex;null!=re&&(p.set(re,J),p.set(J,re)),W.pop(),K--}X=W[W.length-1],d[J]=X._level,X._override&&h(J,X._override)}else Z&k?(0===Y&&(q>0?q--:!X._isolate&&W.length>1&&(W.pop(),X=W[W.length-1])),d[J]=X._level):Z&C&&(d[J]=m.level);else d[J]=X._level,X._override&&Z!==R&&h(J,X._override)}for(var ne=[],ie=null,ae=m.start;ae<=m.end;ae++){var se=r[ae];if(!(se&o)){var oe=d[ae],le=se&i,ce=se===V;ie&&oe===ie._level?(ie._end=ae,ie._endsWithIsolInit=le):ne.push(ie={_start:ae,_end:ae,_level:oe,_startsWithPDI:ce,_endsWithIsolInit:le})}}for(var ue=[],he=0;he<ne.length;he++){var de=ne[he];if(!de._startsWithPDI||de._startsWithPDI&&!p.has(de._start)){for(var pe=[ie=de],fe=void 0;ie&&ie._endsWithIsolInit&&null!=(fe=p.get(ie._end));)for(var me=he+1;me<ne.length;me++)if(ne[me]._start===fe){pe.push(ie=ne[me]);break}for(var ge=[],ve=0;ve<pe.length;ve++)for(var Ae=pe[ve],ye=Ae._start;ye<=Ae._end;ye++)ge.push(ye);for(var xe=d[ge[0]],be=m.level,we=ge[0]-1;we>=0;we--)if(!(r[we]&o)){be=d[we];break}var Ee=ge[ge.length-1],Se=d[Ee],Me=m.level;if(!(r[Ee]&i))for(var _e=Ee+1;_e<=m.end;_e++)if(!(r[_e]&o)){Me=d[_e];break}ue.push({_seqIndices:ge,_sosType:Math.max(be,xe)%2?w:b,_eosType:Math.max(Me,Se)%2?w:b})}}for(var Te=0;Te<ue.length;Te++){var Ce=ue[Te],Ie=Ce._seqIndices,Be=Ce._sosType,Re=Ce._eosType;if(c.get(P))for(var Pe=0;Pe<Ie.length;Pe++){var Fe=Ie[Pe];if(r[Fe]&P){for(var Le=Be,De=Pe-1;De>=0;De--)if(!(r[Ie[De]]&o)){Le=r[Ie[De]];break}h(Fe,Le&(i|V)?B:Le)}}if(c.get(E))for(var Ue=0;Ue<Ie.length;Ue++){var Ne=Ie[Ue];if(r[Ne]&E)for(var ke=Ue-1;ke>=-1;ke--){var Oe=-1===ke?Be:r[Ie[ke]];if(Oe&a){Oe===F&&h(Ne,_);break}}}if(c.get(F))for(var Ge=0;Ge<Ie.length;Ge++){var ze=Ie[Ge];r[ze]&F&&h(ze,w)}if(c.get(S)||c.get(T))for(var Ve=1;Ve<Ie.length-1;Ve++){var He=Ie[Ve];if(r[He]&(S|T)){for(var Qe=0,je=0,We=Ve-1;We>=0&&(Qe=r[Ie[We]])&o;We--);for(var Xe=Ve+1;Xe<Ie.length&&(je=r[Ie[Xe]])&o;Xe++);Qe===je&&(r[He]===S?Qe===E:Qe&(E|_))&&h(He,Qe)}}if(c.get(E))for(var Ye=0;Ye<Ie.length;Ye++){var qe=Ie[Ye];if(r[qe]&E){for(var Ke=Ye-1;Ke>=0&&r[Ie[Ke]]&(M|o);Ke--)h(Ie[Ke],E);for(var Je=Ye+1;Je<Ie.length&&r[Ie[Je]]&(M|o);Je++)h(Ie[Je],E)}}if(c.get(M)||c.get(S)||c.get(T))for(var Ze=0;Ze<Ie.length;Ze++){var $e=Ie[Ze];if(r[$e]&(M|S|T)){h($e,B);for(var et=Ze-1;et>=0&&r[Ie[et]]&o;et--)h(Ie[et],B);for(var tt=Ze+1;tt<Ie.length&&r[Ie[tt]]&o;tt++)h(Ie[tt],B)}}if(c.get(E))for(var rt=0,nt=Be;rt<Ie.length;rt++){var it=Ie[rt],at=r[it];at&E?nt===b&&h(it,b):at&a&&(nt=at)}if(c.get(s)){for(var st=w|E|_,ot=st|b,lt=[],ct=[],ut=0;ut<Ie.length;ut++)if(r[Ie[ut]]&s){var ht=e[Ie[ut]],dt=void 0;if(null!==A(ht)){if(!(ct.length<63))break;ct.push({char:ht,seqIndex:ut})}else if(null!==(dt=y(ht)))for(var pt=ct.length-1;pt>=0;pt--){var ft=ct[pt].char;if(ft===dt||ft===y(x(ht))||A(x(ft))===ht){lt.push([ct[pt].seqIndex,ut]),ct.length=pt;break}}}lt.sort((function(e,t){return e[0]-t[0]}));for(var mt=0;mt<lt.length;mt++){for(var gt=lt[mt],vt=gt[0],At=gt[1],yt=!1,xt=0,bt=vt+1;bt<At;bt++){var wt=Ie[bt];if(r[wt]&ot){yt=!0;var Et=r[wt]&st?w:b;if(Et===Ht(wt)){xt=Et;break}}}if(yt&&!xt){xt=Be;for(var St=vt-1;St>=0;St--){var Mt=Ie[St];if(r[Mt]&ot){var _t=r[Mt]&st?w:b;xt=_t!==Ht(Mt)?_t:Ht(Mt);break}}}if(xt){if(r[Ie[vt]]=r[Ie[At]]=xt,xt!==Ht(Ie[vt]))for(var Tt=vt+1;Tt<Ie.length;Tt++)if(!(r[Ie[Tt]]&o)){u(e[Ie[Tt]])&P&&(r[Ie[Tt]]=xt);break}if(xt!==Ht(Ie[At]))for(var Ct=At+1;Ct<Ie.length;Ct++)if(!(r[Ie[Ct]]&o)){u(e[Ie[Ct]])&P&&(r[Ie[Ct]]=xt);break}}}for(var It=0;It<Ie.length;It++)if(r[Ie[It]]&s){for(var Bt=It,Rt=It,Pt=Be,Ft=It-1;Ft>=0;Ft--){if(!(r[Ie[Ft]]&o)){Pt=r[Ie[Ft]]&st?w:b;break}Bt=Ft}for(var Lt=Re,Dt=It+1;Dt<Ie.length;Dt++){if(!(r[Ie[Dt]]&(s|o))){Lt=r[Ie[Dt]]&st?w:b;break}Rt=Dt}for(var Ut=Bt;Ut<=Rt;Ut++)r[Ie[Ut]]=Pt===Lt?Pt:Ht(Ie[Ut]);It=Rt}}}for(var Nt=m.start;Nt<=m.end;Nt++){var kt=d[Nt],Ot=r[Nt];if(1&kt?Ot&(b|E|_)&&d[Nt]++:Ot&w?d[Nt]++:Ot&(_|E)&&(d[Nt]+=2),Ot&o&&(d[Nt]=0===Nt?m.level:d[Nt-1]),Nt===m.end||u(e[Nt])&(I|C))for(var Gt=Nt;Gt>=0&&u(e[Gt])&l;Gt--)d[Gt]=m.level}}return{levels:d,paragraphs:f};function zt(t,n){for(var a=t;a<e.length;a++){var s=r[a];if(s&(w|F))return 1;if(s&(C|b)||n&&s===V)return 0;if(s&i){var o=Vt(a);a=-1===o?e.length:o}}return 0}function Vt(t){for(var n=1,a=t+1;a<e.length;a++){var s=r[a];if(s&C)break;if(s&V){if(0==--n)return a}else s&i&&n++}return-1}function Ht(e){return 1&d[e]?w:b}},e.getMirroredCharacter=Q,e.getMirroredCharactersMap=function(e,t,r,n){var i=e.length;r=Math.max(0,null==r?0:+r),n=Math.min(i-1,null==n?i-1:+n);for(var a=new Map,s=r;s<=n;s++)if(1&t[s]){var o=Q(e[s]);null!==o&&a.set(s,o)}return a},e.getReorderSegments=j,e.getReorderedIndices=W,e.getReorderedString=function(e,t,r,n){var i=W(e,t,r,n),a=[].concat(e);return i.forEach((function(r,n){a[n]=(1&t.levels[r]?Q(e[r]):null)||e[r]})),a.join("")},e.openingToClosingBracket=A,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return e},ji=/\bvoid\s+main\s*\(\s*\)\s*{/g;function Wi(e){return e.replace(/^[ \t]*#include +<([\w\d./]+)>/gm,(function(e,t){let r=s.ShaderChunk[t];return r?Wi(r):e}))}const Xi=[];for(let vh=0;vh<256;vh++)Xi[vh]=(vh<16?"0":"")+vh.toString(16);const Yi=Object.assign||function(){let e=arguments[0];for(let t=1,r=arguments.length;t<r;t++){let r=arguments[t];if(r)for(let t in r)r.hasOwnProperty(t)&&(e[t]=r[t])}return e},qi=Date.now(),Ki=new WeakMap,Ji=new Map;let Zi=1e10;function $i(e,t){const r=function(e){const t=JSON.stringify(e,ta);let r=na.get(t);null==r&&na.set(t,r=++ra);return r}(t);let n=Ki.get(e);if(n||Ki.set(e,n=Object.create(null)),n[r])return new n[r];const i=`_onBeforeCompile${r}`,a=function(n){e.onBeforeCompile.call(this,n);const a=this.customProgramCacheKey()+"|"+n.vertexShader+"|"+n.fragmentShader;let s=Ji[a];if(!s){const e=function({vertexShader:e,fragmentShader:t},r,n){let{vertexDefs:i,vertexMainIntro:a,vertexMainOutro:s,vertexTransform:o,fragmentDefs:l,fragmentMainIntro:c,fragmentMainOutro:u,fragmentColorTransform:h,customRewriter:d,timeUniform:p}=r;i=i||"",a=a||"",s=s||"",l=l||"",c=c||"",u=u||"",(o||d)&&(e=Wi(e));(h||d)&&(t=Wi(t=t.replace(/^[ \t]*#include <((?:tonemapping|encodings|fog|premultiplied_alpha|dithering)_fragment)>/gm,"\n//!BEGIN_POST_CHUNK $1\n$&\n//!END_POST_CHUNK\n")));if(d){let r=d({vertexShader:e,fragmentShader:t});e=r.vertexShader,t=r.fragmentShader}if(h){let e=[];t=t.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,(t=>(e.push(t),""))),u=`${h}\n${e.join("\n")}\n${u}`}if(p){const e=`\nuniform float ${p};\n`;i=e+i,l=e+l}o&&(i=`${i}\nvoid troikaVertexTransform${n}(inout vec3 position, inout vec3 normal, inout vec2 uv) {\n ${o}\n}\n`,a=`\ntroika_position_${n} = vec3(position);\ntroika_normal_${n} = vec3(normal);\ntroika_uv_${n} = vec2(uv);\ntroikaVertexTransform${n}(troika_position_${n}, troika_normal_${n}, troika_uv_${n});\n${a}\n`,e=(e=`vec3 troika_position_${n};\nvec3 troika_normal_${n};\nvec2 troika_uv_${n};\n${e}\n`).replace(/\b(position|normal|uv)\b/g,((e,t,r,i)=>/\battribute\s+vec[23]\s+$/.test(i.substr(0,r))?t:`troika_${t}_${n}`)));return e=ea(e,n,i,a,s),t=ea(t,n,l,c,u),{vertexShader:e,fragmentShader:t}}(n,t,r);s=Ji[a]=e}n.vertexShader=s.vertexShader,n.fragmentShader=s.fragmentShader,Yi(n.uniforms,this.uniforms),t.timeUniform&&(n.uniforms[t.timeUniform]={get value(){return Date.now()-qi}}),this[i]&&this[i](n)},o=function(){return l(t.chained?e:e.clone())},l=function(n){const i=Object.create(n,c);return Object.defineProperty(i,"baseMaterial",{value:e}),Object.defineProperty(i,"id",{value:Zi++}),i.uuid=function(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,r=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(Xi[255&e]+Xi[e>>8&255]+Xi[e>>16&255]+Xi[e>>24&255]+"-"+Xi[255&t]+Xi[t>>8&255]+"-"+Xi[t>>16&15|64]+Xi[t>>24&255]+"-"+Xi[63&r|128]+Xi[r>>8&255]+"-"+Xi[r>>16&255]+Xi[r>>24&255]+Xi[255&n]+Xi[n>>8&255]+Xi[n>>16&255]+Xi[n>>24&255]).toUpperCase()}(),i.uniforms=Yi({},n.uniforms,t.uniforms),i.defines=Yi({},n.defines,t.defines),i.defines[`TROIKA_DERIVED_MATERIAL_${r}`]="",i.extensions=Yi({},n.extensions,t.extensions),i._listeners=void 0,i},c={constructor:{value:o},isDerivedMaterial:{value:!0},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return e.customProgramCacheKey()+"|"+r}},onBeforeCompile:{get:()=>a,set(e){this[i]=e}},copy:{writable:!0,configurable:!0,value:function(t){return e.copy.call(this,t),e.isShaderMaterial||e.isDerivedMaterial||(Yi(this.extensions,t.extensions),Yi(this.defines,t.defines),Yi(this.uniforms,s.UniformsUtils.clone(t.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){const t=new e.constructor;return l(t).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let r=this._depthMaterial;return r||(r=this._depthMaterial=$i(e.isDerivedMaterial?e.getDepthMaterial():new s.MeshDepthMaterial({depthPacking:s.RGBADepthPacking}),t),r.defines.IS_DEPTH_MATERIAL="",r.uniforms=this.uniforms),r}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let r=this._distanceMaterial;return r||(r=this._distanceMaterial=$i(e.isDerivedMaterial?e.getDistanceMaterial():new s.MeshDistanceMaterial,t),r.defines.IS_DISTANCE_MATERIAL="",r.uniforms=this.uniforms),r}},dispose:{writable:!0,configurable:!0,value(){const{_depthMaterial:t,_distanceMaterial:r}=this;t&&t.dispose(),r&&r.dispose(),e.dispose.call(this)}}};return n[r]=o,new o}function ea(e,t,r,n,i){return(n||i||r)&&(e=e.replace(ji,`\n${r}\nvoid troikaOrigMain${t}() {`),e+=`\nvoid main() {\n ${n}\n troikaOrigMain${t}();\n ${i}\n}`),e}function ta(e,t){return"uniforms"===e?void 0:"function"==typeof t?t.toString():t}let ra=0;const na=new Map;s.DoubleSide;const ia=()=>(self.performance||Date).now(),aa=Hi();let sa;const oa=function(){const e=[];let t=0;function r(){const n=ia();for(;e.length&&ia()-n<5;)e.shift()();t=e.length?setTimeout(r,0):0}return(...n)=>{const i=Bi();return e.push((()=>{const e=ia();try{aa.webgl.generateIntoCanvas(...n),i.resolve({timing:ia()-e})}catch(t){i.reject(t)}})),t||(t=setTimeout(r,0)),i}}(),la=function(){const e={};let t=0;return function(r,n,i,a,s,o,l,c,u,h){const d="TroikaTextSDFGenerator_JS_"+t++%4;let p=e[d];return p||(p=e[d]={workerModule:Oi({name:d,workerId:d,dependencies:[Hi,ia],init(e,t){const r=e().javascript.generate;return function(...e){const n=t();return{textureData:r(...e),timing:t()-n}}},getTransferables:e=>[e.textureData.buffer]}),requests:0,idleTimer:null}),p.requests++,clearTimeout(p.idleTimer),p.workerModule(r,n,i,a,s,o).then((({textureData:e,timing:t})=>{const i=ia(),a=new Uint8Array(4*e.length);for(let r=0;r<e.length;r++)a[4*r+h]=e[r];return aa.webglUtils.renderImageData(l,a,c,u,r,n,1<<3-h),t+=ia()-i,0==--p.requests&&(p.idleTimer=setTimeout((()=>{!function(e){Ni[e]&&Ni[e].forEach((function(e){e()})),Ui[e]&&(Ui[e].terminate(),delete Ui[e])}(d)}),2e3)),{timing:t}}))}}();const ca=aa.webglUtils.resizeWebGLCanvasWithoutClearing;const ua=Oi({name:"Typr Font Parser",dependencies:[function(){return"undefined"==typeof window&&(self.window=self),function(e){var t={parse:function(e){var r=t._bin,n=new Uint8Array(e);if("ttcf"==r.readASCII(n,0,4)){var i=4;r.readUshort(n,i),i+=2,r.readUshort(n,i),i+=2;var a=r.readUint(n,i);i+=4;for(var s=[],o=0;o<a;o++){var l=r.readUint(n,i);i+=4,s.push(t._readFont(n,l))}return s}return[t._readFont(n,0)]},_readFont:function(e,r){var n=t._bin,i=r;n.readFixed(e,r),r+=4;var a=n.readUshort(e,r);r+=2,n.readUshort(e,r),r+=2,n.readUshort(e,r),r+=2,n.readUshort(e,r),r+=2;for(var s=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GPOS","GSUB","SVG "],o={_data:e,_offset:i},l={},c=0;c<a;c++){var u=n.readASCII(e,r,4);r+=4,n.readUint(e,r),r+=4;var h=n.readUint(e,r);r+=4;var d=n.readUint(e,r);r+=4,l[u]={offset:h,length:d}}for(c=0;c<s.length;c++){var p=s[c];l[p]&&(o[p.trim()]=t[p.trim()].parse(e,l[p].offset,l[p].length,o))}return o},_tabOffset:function(e,r,n){for(var i=t._bin,a=i.readUshort(e,n+4),s=n+12,o=0;o<a;o++){var l=i.readASCII(e,s,4);s+=4,i.readUint(e,s),s+=4;var c=i.readUint(e,s);if(s+=4,i.readUint(e,s),s+=4,l==r)return c}return 0}};t._bin={readFixed:function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<8|e[t+3])/65540},readF2dot14:function(e,r){return t._bin.readShort(e,r)/16384},readInt:function(e,r){return t._bin._view(e).getInt32(r)},readInt8:function(e,r){return t._bin._view(e).getInt8(r)},readShort:function(e,r){return t._bin._view(e).getInt16(r)},readUshort:function(e,r){return t._bin._view(e).getUint16(r)},readUshorts:function(e,r,n){for(var i=[],a=0;a<n;a++)i.push(t._bin.readUshort(e,r+2*a));return i},readUint:function(e,r){return t._bin._view(e).getUint32(r)},readUint64:function(e,r){return 4294967296*t._bin.readUint(e,r)+t._bin.readUint(e,r+4)},readASCII:function(e,t,r){for(var n="",i=0;i<r;i++)n+=String.fromCharCode(e[t+i]);return n},readUnicode:function(e,t,r){for(var n="",i=0;i<r;i++){var a=e[t++]<<8|e[t++];n+=String.fromCharCode(a)}return n},_tdec:"undefined"!=typeof window&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(e,r,n){var i=t._bin._tdec;return i&&0==r&&n==e.length?i.decode(e):t._bin.readASCII(e,r,n)},readBytes:function(e,t,r){for(var n=[],i=0;i<r;i++)n.push(e[t+i]);return n},readASCIIArray:function(e,t,r){for(var n=[],i=0;i<r;i++)n.push(String.fromCharCode(e[t+i]));return n},_view:function(e){return e._dataView||(e._dataView=e.buffer?new DataView(e.buffer,e.byteOffset,e.byteLength):new DataView(new Uint8Array(e).buffer))}},t._lctf={},t._lctf.parse=function(e,r,n,i,a){var s=t._bin,o={},l=r;s.readFixed(e,r),r+=4;var c=s.readUshort(e,r);r+=2;var u=s.readUshort(e,r);r+=2;var h=s.readUshort(e,r);return r+=2,o.scriptList=t._lctf.readScriptList(e,l+c),o.featureList=t._lctf.readFeatureList(e,l+u),o.lookupList=t._lctf.readLookupList(e,l+h,a),o},t._lctf.readLookupList=function(e,r,n){var i=t._bin,a=r,s=[],o=i.readUshort(e,r);r+=2;for(var l=0;l<o;l++){var c=i.readUshort(e,r);r+=2;var u=t._lctf.readLookupTable(e,a+c,n);s.push(u)}return s},t._lctf.readLookupTable=function(e,r,n){var i=t._bin,a=r,s={tabs:[]};s.ltype=i.readUshort(e,r),r+=2,s.flag=i.readUshort(e,r),r+=2;var o=i.readUshort(e,r);r+=2;for(var l=s.ltype,c=0;c<o;c++){var u=i.readUshort(e,r);r+=2;var h=n(e,l,a+u,s);s.tabs.push(h)}return s},t._lctf.numOfOnes=function(e){for(var t=0,r=0;r<32;r++)0!=(e>>>r&1)&&t++;return t},t._lctf.readClassDef=function(e,r){var n=t._bin,i=[],a=n.readUshort(e,r);if(r+=2,1==a){var s=n.readUshort(e,r);r+=2;var o=n.readUshort(e,r);r+=2;for(var l=0;l<o;l++)i.push(s+l),i.push(s+l),i.push(n.readUshort(e,r)),r+=2}if(2==a){var c=n.readUshort(e,r);for(r+=2,l=0;l<c;l++)i.push(n.readUshort(e,r)),r+=2,i.push(n.readUshort(e,r)),r+=2,i.push(n.readUshort(e,r)),r+=2}return i},t._lctf.getInterval=function(e,t){for(var r=0;r<e.length;r+=3){var n=e[r],i=e[r+1];if(e[r+2],n<=t&&t<=i)return r}return-1},t._lctf.readCoverage=function(e,r){var n=t._bin,i={};i.fmt=n.readUshort(e,r),r+=2;var a=n.readUshort(e,r);return r+=2,1==i.fmt&&(i.tab=n.readUshorts(e,r,a)),2==i.fmt&&(i.tab=n.readUshorts(e,r,3*a)),i},t._lctf.coverageIndex=function(e,r){var n=e.tab;if(1==e.fmt)return n.indexOf(r);if(2==e.fmt){var i=t._lctf.getInterval(n,r);if(-1!=i)return n[i+2]+(r-n[i])}return-1},t._lctf.readFeatureList=function(e,r){var n=t._bin,i=r,a=[],s=n.readUshort(e,r);r+=2;for(var o=0;o<s;o++){var l=n.readASCII(e,r,4);r+=4;var c=n.readUshort(e,r);r+=2;var u=t._lctf.readFeatureTable(e,i+c);u.tag=l.trim(),a.push(u)}return a},t._lctf.readFeatureTable=function(e,r){var n=t._bin,i=r,a={},s=n.readUshort(e,r);r+=2,s>0&&(a.featureParams=i+s);var o=n.readUshort(e,r);r+=2,a.tab=[];for(var l=0;l<o;l++)a.tab.push(n.readUshort(e,r+2*l));return a},t._lctf.readScriptList=function(e,r){var n=t._bin,i=r,a={},s=n.readUshort(e,r);r+=2;for(var o=0;o<s;o++){var l=n.readASCII(e,r,4);r+=4;var c=n.readUshort(e,r);r+=2,a[l.trim()]=t._lctf.readScriptTable(e,i+c)}return a},t._lctf.readScriptTable=function(e,r){var n=t._bin,i=r,a={},s=n.readUshort(e,r);r+=2,a.default=t._lctf.readLangSysTable(e,i+s);var o=n.readUshort(e,r);r+=2;for(var l=0;l<o;l++){var c=n.readASCII(e,r,4);r+=4;var u=n.readUshort(e,r);r+=2,a[c.trim()]=t._lctf.readLangSysTable(e,i+u)}return a},t._lctf.readLangSysTable=function(e,r){var n=t._bin,i={};n.readUshort(e,r),r+=2,i.reqFeature=n.readUshort(e,r),r+=2;var a=n.readUshort(e,r);return r+=2,i.features=n.readUshorts(e,r,a),i},t.CFF={},t.CFF.parse=function(e,r,n){var i=t._bin;(e=new Uint8Array(e.buffer,r,n))[r=0],e[++r],e[++r],e[++r],r++;var a=[];r=t.CFF.readIndex(e,r,a);for(var s=[],o=0;o<a.length-1;o++)s.push(i.readASCII(e,r+a[o],a[o+1]-a[o]));r+=a[a.length-1];var l=[];r=t.CFF.readIndex(e,r,l);var c=[];for(o=0;o<l.length-1;o++)c.push(t.CFF.readDict(e,r+l[o],r+l[o+1]));r+=l[l.length-1];var u=c[0],h=[];r=t.CFF.readIndex(e,r,h);var d=[];for(o=0;o<h.length-1;o++)d.push(i.readASCII(e,r+h[o],h[o+1]-h[o]));if(r+=h[h.length-1],t.CFF.readSubrs(e,r,u),u.CharStrings){r=u.CharStrings,h=[],r=t.CFF.readIndex(e,r,h);var p=[];for(o=0;o<h.length-1;o++)p.push(i.readBytes(e,r+h[o],h[o+1]-h[o]));u.CharStrings=p}if(u.ROS){r=u.FDArray;var f=[];for(r=t.CFF.readIndex(e,r,f),u.FDArray=[],o=0;o<f.length-1;o++){var m=t.CFF.readDict(e,r+f[o],r+f[o+1]);t.CFF._readFDict(e,m,d),u.FDArray.push(m)}r+=f[f.length-1],r=u.FDSelect,u.FDSelect=[];var g=e[r];if(r++,3!=g)throw g;var v=i.readUshort(e,r);for(r+=2,o=0;o<v+1;o++)u.FDSelect.push(i.readUshort(e,r),e[r+2]),r+=3}return u.Encoding&&(u.Encoding=t.CFF.readEncoding(e,u.Encoding,u.CharStrings.length)),u.charset&&(u.charset=t.CFF.readCharset(e,u.charset,u.CharStrings.length)),t.CFF._readFDict(e,u,d),u},t.CFF._readFDict=function(e,r,n){var i;for(var a in r.Private&&(i=r.Private[1],r.Private=t.CFF.readDict(e,i,i+r.Private[0]),r.Private.Subrs&&t.CFF.readSubrs(e,i+r.Private.Subrs,r.Private)),r)-1!=["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(a)&&(r[a]=n[r[a]-426+35])},t.CFF.readSubrs=function(e,r,n){var i=t._bin,a=[];r=t.CFF.readIndex(e,r,a);var s,o=a.length;s=o<1240?107:o<33900?1131:32768,n.Bias=s,n.Subrs=[];for(var l=0;l<a.length-1;l++)n.Subrs.push(i.readBytes(e,r+a[l],a[l+1]-a[l]))},t.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],t.CFF.glyphByUnicode=function(e,t){for(var r=0;r<e.charset.length;r++)if(e.charset[r]==t)return r;return-1},t.CFF.glyphBySE=function(e,r){return r<0||r>255?-1:t.CFF.glyphByUnicode(e,t.CFF.tableSE[r])},t.CFF.readEncoding=function(e,r,n){t._bin;var i=[".notdef"],a=e[r];if(r++,0!=a)throw"error: unknown encoding format: "+a;var s=e[r];r++;for(var o=0;o<s;o++)i.push(e[r+o]);return i},t.CFF.readCharset=function(e,r,n){var i=t._bin,a=[".notdef"],s=e[r];if(r++,0==s)for(var o=0;o<n;o++){var l=i.readUshort(e,r);r+=2,a.push(l)}else{if(1!=s&&2!=s)throw"error: format: "+s;for(;a.length<n;){l=i.readUshort(e,r),r+=2;var c=0;for(1==s?(c=e[r],r++):(c=i.readUshort(e,r),r+=2),o=0;o<=c;o++)a.push(l),l++}}return a},t.CFF.readIndex=function(e,r,n){var i=t._bin,a=i.readUshort(e,r)+1,s=e[r+=2];if(r++,1==s)for(var o=0;o<a;o++)n.push(e[r+o]);else if(2==s)for(o=0;o<a;o++)n.push(i.readUshort(e,r+2*o));else if(3==s)for(o=0;o<a;o++)n.push(16777215&i.readUint(e,r+3*o-1));else if(1!=a)throw"unsupported offset size: "+s+", count: "+a;return(r+=a*s)-1},t.CFF.getCharString=function(e,r,n){var i=t._bin,a=e[r],s=e[r+1];e[r+2],e[r+3],e[r+4];var o=1,l=null,c=null;a<=20&&(l=a,o=1),12==a&&(l=100*a+s,o=2),21<=a&&a<=27&&(l=a,o=1),28==a&&(c=i.readShort(e,r+1),o=3),29<=a&&a<=31&&(l=a,o=1),32<=a&&a<=246&&(c=a-139,o=1),247<=a&&a<=250&&(c=256*(a-247)+s+108,o=2),251<=a&&a<=254&&(c=256*-(a-251)-s-108,o=2),255==a&&(c=i.readInt(e,r+1)/65535,o=5),n.val=null!=c?c:"o"+l,n.size=o},t.CFF.readCharString=function(e,r,n){for(var i=r+n,a=t._bin,s=[];r<i;){var o=e[r],l=e[r+1];e[r+2],e[r+3],e[r+4];var c=1,u=null,h=null;o<=20&&(u=o,c=1),12==o&&(u=100*o+l,c=2),19!=o&&20!=o||(u=o,c=2),21<=o&&o<=27&&(u=o,c=1),28==o&&(h=a.readShort(e,r+1),c=3),29<=o&&o<=31&&(u=o,c=1),32<=o&&o<=246&&(h=o-139,c=1),247<=o&&o<=250&&(h=256*(o-247)+l+108,c=2),251<=o&&o<=254&&(h=256*-(o-251)-l-108,c=2),255==o&&(h=a.readInt(e,r+1)/65535,c=5),s.push(null!=h?h:"o"+u),r+=c}return s},t.CFF.readDict=function(e,r,n){for(var i=t._bin,a={},s=[];r<n;){var o=e[r],l=e[r+1];e[r+2],e[r+3],e[r+4];var c=1,u=null,h=null;if(28==o&&(h=i.readShort(e,r+1),c=3),29==o&&(h=i.readInt(e,r+1),c=5),32<=o&&o<=246&&(h=o-139,c=1),247<=o&&o<=250&&(h=256*(o-247)+l+108,c=2),251<=o&&o<=254&&(h=256*-(o-251)-l-108,c=2),255==o)throw h=i.readInt(e,r+1)/65535,c=5,"unknown number";if(30==o){var d=[];for(c=1;;){var p=e[r+c];c++;var f=p>>4,m=15&p;if(15!=f&&d.push(f),15!=m&&d.push(m),15==m)break}for(var g="",v=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],A=0;A<d.length;A++)g+=v[d[A]];h=parseFloat(g)}o<=21&&(u=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][o],c=1,12==o&&(u=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][l],c=2)),null!=u?(a[u]=1==s.length?s[0]:s,s=[]):s.push(h),r+=c}return a},t.cmap={},t.cmap.parse=function(e,r,n){e=new Uint8Array(e.buffer,r,n),r=0;var i=t._bin,a={};i.readUshort(e,r),r+=2;var s=i.readUshort(e,r);r+=2;var o=[];a.tables=[];for(var l=0;l<s;l++){var c=i.readUshort(e,r);r+=2;var u=i.readUshort(e,r);r+=2;var h=i.readUint(e,r);r+=4;var d="p"+c+"e"+u,p=o.indexOf(h);if(-1==p){var f;p=a.tables.length,o.push(h);var m=i.readUshort(e,h);0==m?f=t.cmap.parse0(e,h):4==m?f=t.cmap.parse4(e,h):6==m?f=t.cmap.parse6(e,h):12==m?f=t.cmap.parse12(e,h):console.debug("unknown format: "+m,c,u,h),a.tables.push(f)}if(null!=a[d])throw"multiple tables for one platform+encoding";a[d]=p}return a},t.cmap.parse0=function(e,r){var n=t._bin,i={};i.format=n.readUshort(e,r),r+=2;var a=n.readUshort(e,r);r+=2,n.readUshort(e,r),r+=2,i.map=[];for(var s=0;s<a-6;s++)i.map.push(e[r+s]);return i},t.cmap.parse4=function(e,r){var n=t._bin,i=r,a={};a.format=n.readUshort(e,r),r+=2;var s=n.readUshort(e,r);r+=2,n.readUshort(e,r),r+=2;var o=n.readUshort(e,r);r+=2;var l=o/2;a.searchRange=n.readUshort(e,r),r+=2,a.entrySelector=n.readUshort(e,r),r+=2,a.rangeShift=n.readUshort(e,r),r+=2,a.endCount=n.readUshorts(e,r,l),r+=2*l,r+=2,a.startCount=n.readUshorts(e,r,l),r+=2*l,a.idDelta=[];for(var c=0;c<l;c++)a.idDelta.push(n.readShort(e,r)),r+=2;for(a.idRangeOffset=n.readUshorts(e,r,l),r+=2*l,a.glyphIdArray=[];r<i+s;)a.glyphIdArray.push(n.readUshort(e,r)),r+=2;return a},t.cmap.parse6=function(e,r){var n=t._bin,i={};i.format=n.readUshort(e,r),r+=2,n.readUshort(e,r),r+=2,n.readUshort(e,r),r+=2,i.firstCode=n.readUshort(e,r),r+=2;var a=n.readUshort(e,r);r+=2,i.glyphIdArray=[];for(var s=0;s<a;s++)i.glyphIdArray.push(n.readUshort(e,r)),r+=2;return i},t.cmap.parse12=function(e,r){var n=t._bin,i={};i.format=n.readUshort(e,r),r+=2,r+=2,n.readUint(e,r),r+=4,n.readUint(e,r),r+=4;var a=n.readUint(e,r);r+=4,i.groups=[];for(var s=0;s<a;s++){var o=r+12*s,l=n.readUint(e,o+0),c=n.readUint(e,o+4),u=n.readUint(e,o+8);i.groups.push([l,c,u])}return i},t.glyf={},t.glyf.parse=function(e,t,r,n){for(var i=[],a=0;a<n.maxp.numGlyphs;a++)i.push(null);return i},t.glyf._parseGlyf=function(e,r){var n=t._bin,i=e._data,a=t._tabOffset(i,"glyf",e._offset)+e.loca[r];if(e.loca[r]==e.loca[r+1])return null;var s={};if(s.noc=n.readShort(i,a),a+=2,s.xMin=n.readShort(i,a),a+=2,s.yMin=n.readShort(i,a),a+=2,s.xMax=n.readShort(i,a),a+=2,s.yMax=n.readShort(i,a),a+=2,s.xMin>=s.xMax||s.yMin>=s.yMax)return null;if(s.noc>0){s.endPts=[];for(var o=0;o<s.noc;o++)s.endPts.push(n.readUshort(i,a)),a+=2;var l=n.readUshort(i,a);if(a+=2,i.length-a<l)return null;s.instructions=n.readBytes(i,a,l),a+=l;var c=s.endPts[s.noc-1]+1;for(s.flags=[],o=0;o<c;o++){var u=i[a];if(a++,s.flags.push(u),0!=(8&u)){var h=i[a];a++;for(var d=0;d<h;d++)s.flags.push(u),o++}}for(s.xs=[],o=0;o<c;o++){var p=0!=(2&s.flags[o]),f=0!=(16&s.flags[o]);p?(s.xs.push(f?i[a]:-i[a]),a++):f?s.xs.push(0):(s.xs.push(n.readShort(i,a)),a+=2)}for(s.ys=[],o=0;o<c;o++)p=0!=(4&s.flags[o]),f=0!=(32&s.flags[o]),p?(s.ys.push(f?i[a]:-i[a]),a++):f?s.ys.push(0):(s.ys.push(n.readShort(i,a)),a+=2);var m=0,g=0;for(o=0;o<c;o++)m+=s.xs[o],g+=s.ys[o],s.xs[o]=m,s.ys[o]=g}else{var v;s.parts=[];do{v=n.readUshort(i,a),a+=2;var A={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(s.parts.push(A),A.glyphIndex=n.readUshort(i,a),a+=2,1&v){var y=n.readShort(i,a);a+=2;var x=n.readShort(i,a);a+=2}else y=n.readInt8(i,a),a++,x=n.readInt8(i,a),a++;2&v?(A.m.tx=y,A.m.ty=x):(A.p1=y,A.p2=x),8&v?(A.m.a=A.m.d=n.readF2dot14(i,a),a+=2):64&v?(A.m.a=n.readF2dot14(i,a),a+=2,A.m.d=n.readF2dot14(i,a),a+=2):128&v&&(A.m.a=n.readF2dot14(i,a),a+=2,A.m.b=n.readF2dot14(i,a),a+=2,A.m.c=n.readF2dot14(i,a),a+=2,A.m.d=n.readF2dot14(i,a),a+=2)}while(32&v);if(256&v){var b=n.readUshort(i,a);for(a+=2,s.instr=[],o=0;o<b;o++)s.instr.push(i[a]),a++}}return s},t.GPOS={},t.GPOS.parse=function(e,r,n,i){return t._lctf.parse(e,r,n,i,t.GPOS.subt)},t.GPOS.subt=function(e,r,n,i){var a=t._bin,s=n,o={};if(o.fmt=a.readUshort(e,n),n+=2,1==r||2==r||3==r||7==r||8==r&&o.fmt<=2){var l=a.readUshort(e,n);n+=2,o.coverage=t._lctf.readCoverage(e,l+s)}if(1==r&&1==o.fmt){var c=a.readUshort(e,n);n+=2;var u=t._lctf.numOfOnes(c);0!=c&&(o.pos=t.GPOS.readValueRecord(e,n,c))}else if(2==r&&o.fmt>=1&&o.fmt<=2){c=a.readUshort(e,n),n+=2;var h=a.readUshort(e,n);n+=2,u=t._lctf.numOfOnes(c);var d=t._lctf.numOfOnes(h);if(1==o.fmt){o.pairsets=[];var p=a.readUshort(e,n);n+=2;for(var f=0;f<p;f++){var m=s+a.readUshort(e,n);n+=2;var g=a.readUshort(e,m);m+=2;for(var v=[],A=0;A<g;A++){var y=a.readUshort(e,m);m+=2,0!=c&&(M=t.GPOS.readValueRecord(e,m,c),m+=2*u),0!=h&&(_=t.GPOS.readValueRecord(e,m,h),m+=2*d),v.push({gid2:y,val1:M,val2:_})}o.pairsets.push(v)}}if(2==o.fmt){var x=a.readUshort(e,n);n+=2;var b=a.readUshort(e,n);n+=2;var w=a.readUshort(e,n);n+=2;var E=a.readUshort(e,n);for(n+=2,o.classDef1=t._lctf.readClassDef(e,s+x),o.classDef2=t._lctf.readClassDef(e,s+b),o.matrix=[],f=0;f<w;f++){var S=[];for(A=0;A<E;A++){var M=null,_=null;0!=c&&(M=t.GPOS.readValueRecord(e,n,c),n+=2*u),0!=h&&(_=t.GPOS.readValueRecord(e,n,h),n+=2*d),S.push({val1:M,val2:_})}o.matrix.push(S)}}}else{if(9==r&&1==o.fmt){var T=a.readUshort(e,n);n+=2;var C=a.readUint(e,n);if(n+=4,9==i.ltype)i.ltype=T;else if(i.ltype!=T)throw"invalid extension substitution";return t.GPOS.subt(e,i.ltype,s+C)}console.debug("unsupported GPOS table LookupType",r,"format",o.fmt)}return o},t.GPOS.readValueRecord=function(e,r,n){var i=t._bin,a=[];return a.push(1&n?i.readShort(e,r):0),r+=1&n?2:0,a.push(2&n?i.readShort(e,r):0),r+=2&n?2:0,a.push(4&n?i.readShort(e,r):0),r+=4&n?2:0,a.push(8&n?i.readShort(e,r):0),r+=8&n?2:0,a},t.GSUB={},t.GSUB.parse=function(e,r,n,i){return t._lctf.parse(e,r,n,i,t.GSUB.subt)},t.GSUB.subt=function(e,r,n,i){var a=t._bin,s=n,o={};if(o.fmt=a.readUshort(e,n),n+=2,1!=r&&4!=r&&5!=r&&6!=r)return null;if(1==r||4==r||5==r&&o.fmt<=2||6==r&&o.fmt<=2){var l=a.readUshort(e,n);n+=2,o.coverage=t._lctf.readCoverage(e,s+l)}if(1==r&&o.fmt>=1&&o.fmt<=2){if(1==o.fmt)o.delta=a.readShort(e,n),n+=2;else if(2==o.fmt){var c=a.readUshort(e,n);n+=2,o.newg=a.readUshorts(e,n,c),n+=2*o.newg.length}}else if(4==r){o.vals=[],c=a.readUshort(e,n),n+=2;for(var u=0;u<c;u++){var h=a.readUshort(e,n);n+=2,o.vals.push(t.GSUB.readLigatureSet(e,s+h))}}else if(5==r&&2==o.fmt){if(2==o.fmt){var d=a.readUshort(e,n);n+=2,o.cDef=t._lctf.readClassDef(e,s+d),o.scset=[];var p=a.readUshort(e,n);for(n+=2,u=0;u<p;u++){var f=a.readUshort(e,n);n+=2,o.scset.push(0==f?null:t.GSUB.readSubClassSet(e,s+f))}}}else if(6==r&&3==o.fmt){if(3==o.fmt){for(u=0;u<3;u++){c=a.readUshort(e,n),n+=2;for(var m=[],g=0;g<c;g++)m.push(t._lctf.readCoverage(e,s+a.readUshort(e,n+2*g)));n+=2*c,0==u&&(o.backCvg=m),1==u&&(o.inptCvg=m),2==u&&(o.ahedCvg=m)}c=a.readUshort(e,n),n+=2,o.lookupRec=t.GSUB.readSubstLookupRecords(e,n,c)}}else{if(7==r&&1==o.fmt){var v=a.readUshort(e,n);n+=2;var A=a.readUint(e,n);if(n+=4,9==i.ltype)i.ltype=v;else if(i.ltype!=v)throw"invalid extension substitution";return t.GSUB.subt(e,i.ltype,s+A)}console.debug("unsupported GSUB table LookupType",r,"format",o.fmt)}return o},t.GSUB.readSubClassSet=function(e,r){var n=t._bin.readUshort,i=r,a=[],s=n(e,r);r+=2;for(var o=0;o<s;o++){var l=n(e,r);r+=2,a.push(t.GSUB.readSubClassRule(e,i+l))}return a},t.GSUB.readSubClassRule=function(e,r){var n=t._bin.readUshort,i={},a=n(e,r),s=n(e,r+=2);r+=2,i.input=[];for(var o=0;o<a-1;o++)i.input.push(n(e,r)),r+=2;return i.substLookupRecords=t.GSUB.readSubstLookupRecords(e,r,s),i},t.GSUB.readSubstLookupRecords=function(e,r,n){for(var i=t._bin.readUshort,a=[],s=0;s<n;s++)a.push(i(e,r),i(e,r+2)),r+=4;return a},t.GSUB.readChainSubClassSet=function(e,r){var n=t._bin,i=r,a=[],s=n.readUshort(e,r);r+=2;for(var o=0;o<s;o++){var l=n.readUshort(e,r);r+=2,a.push(t.GSUB.readChainSubClassRule(e,i+l))}return a},t.GSUB.readChainSubClassRule=function(e,r){for(var n=t._bin,i={},a=["backtrack","input","lookahead"],s=0;s<a.length;s++){var o=n.readUshort(e,r);r+=2,1==s&&o--,i[a[s]]=n.readUshorts(e,r,o),r+=2*i[a[s]].length}return o=n.readUshort(e,r),r+=2,i.subst=n.readUshorts(e,r,2*o),r+=2*i.subst.length,i},t.GSUB.readLigatureSet=function(e,r){var n=t._bin,i=r,a=[],s=n.readUshort(e,r);r+=2;for(var o=0;o<s;o++){var l=n.readUshort(e,r);r+=2,a.push(t.GSUB.readLigature(e,i+l))}return a},t.GSUB.readLigature=function(e,r){var n=t._bin,i={chain:[]};i.nglyph=n.readUshort(e,r),r+=2;var a=n.readUshort(e,r);r+=2;for(var s=0;s<a-1;s++)i.chain.push(n.readUshort(e,r)),r+=2;return i},t.head={},t.head.parse=function(e,r,n){var i=t._bin,a={};return i.readFixed(e,r),r+=4,a.fontRevision=i.readFixed(e,r),r+=4,i.readUint(e,r),r+=4,i.readUint(e,r),r+=4,a.flags=i.readUshort(e,r),r+=2,a.unitsPerEm=i.readUshort(e,r),r+=2,a.created=i.readUint64(e,r),r+=8,a.modified=i.readUint64(e,r),r+=8,a.xMin=i.readShort(e,r),r+=2,a.yMin=i.readShort(e,r),r+=2,a.xMax=i.readShort(e,r),r+=2,a.yMax=i.readShort(e,r),r+=2,a.macStyle=i.readUshort(e,r),r+=2,a.lowestRecPPEM=i.readUshort(e,r),r+=2,a.fontDirectionHint=i.readShort(e,r),r+=2,a.indexToLocFormat=i.readShort(e,r),r+=2,a.glyphDataFormat=i.readShort(e,r),r+=2,a},t.hhea={},t.hhea.parse=function(e,r,n){var i=t._bin,a={};return i.readFixed(e,r),r+=4,a.ascender=i.readShort(e,r),r+=2,a.descender=i.readShort(e,r),r+=2,a.lineGap=i.readShort(e,r),r+=2,a.advanceWidthMax=i.readUshort(e,r),r+=2,a.minLeftSideBearing=i.readShort(e,r),r+=2,a.minRightSideBearing=i.readShort(e,r),r+=2,a.xMaxExtent=i.readShort(e,r),r+=2,a.caretSlopeRise=i.readShort(e,r),r+=2,a.caretSlopeRun=i.readShort(e,r),r+=2,a.caretOffset=i.readShort(e,r),r+=2,r+=8,a.metricDataFormat=i.readShort(e,r),r+=2,a.numberOfHMetrics=i.readUshort(e,r),r+=2,a},t.hmtx={},t.hmtx.parse=function(e,r,n,i){for(var a=t._bin,s={aWidth:[],lsBearing:[]},o=0,l=0,c=0;c<i.maxp.numGlyphs;c++)c<i.hhea.numberOfHMetrics&&(o=a.readUshort(e,r),r+=2,l=a.readShort(e,r),r+=2),s.aWidth.push(o),s.lsBearing.push(l);return s},t.kern={},t.kern.parse=function(e,r,n,i){var a=t._bin,s=a.readUshort(e,r);if(r+=2,1==s)return t.kern.parseV1(e,r-2,n,i);var o=a.readUshort(e,r);r+=2;for(var l={glyph1:[],rval:[]},c=0;c<o;c++){r+=2,n=a.readUshort(e,r),r+=2;var u=a.readUshort(e,r);r+=2;var h=u>>>8;if(0!=(h&=15))throw"unknown kern table format: "+h;r=t.kern.readFormat0(e,r,l)}return l},t.kern.parseV1=function(e,r,n,i){var a=t._bin;a.readFixed(e,r),r+=4;var s=a.readUint(e,r);r+=4;for(var o={glyph1:[],rval:[]},l=0;l<s;l++){a.readUint(e,r),r+=4;var c=a.readUshort(e,r);r+=2,a.readUshort(e,r),r+=2;var u=c>>>8;if(0!=(u&=15))throw"unknown kern table format: "+u;r=t.kern.readFormat0(e,r,o)}return o},t.kern.readFormat0=function(e,r,n){var i=t._bin,a=-1,s=i.readUshort(e,r);r+=2,i.readUshort(e,r),r+=2,i.readUshort(e,r),r+=2,i.readUshort(e,r),r+=2;for(var o=0;o<s;o++){var l=i.readUshort(e,r);r+=2;var c=i.readUshort(e,r);r+=2;var u=i.readShort(e,r);r+=2,l!=a&&(n.glyph1.push(l),n.rval.push({glyph2:[],vals:[]}));var h=n.rval[n.rval.length-1];h.glyph2.push(c),h.vals.push(u),a=l}return r},t.loca={},t.loca.parse=function(e,r,n,i){var a=t._bin,s=[],o=i.head.indexToLocFormat,l=i.maxp.numGlyphs+1;if(0==o)for(var c=0;c<l;c++)s.push(a.readUshort(e,r+(c<<1))<<1);if(1==o)for(c=0;c<l;c++)s.push(a.readUint(e,r+(c<<2)));return s},t.maxp={},t.maxp.parse=function(e,r,n){var i=t._bin,a={},s=i.readUint(e,r);return r+=4,a.numGlyphs=i.readUshort(e,r),r+=2,65536==s&&(a.maxPoints=i.readUshort(e,r),r+=2,a.maxContours=i.readUshort(e,r),r+=2,a.maxCompositePoints=i.readUshort(e,r),r+=2,a.maxCompositeContours=i.readUshort(e,r),r+=2,a.maxZones=i.readUshort(e,r),r+=2,a.maxTwilightPoints=i.readUshort(e,r),r+=2,a.maxStorage=i.readUshort(e,r),r+=2,a.maxFunctionDefs=i.readUshort(e,r),r+=2,a.maxInstructionDefs=i.readUshort(e,r),r+=2,a.maxStackElements=i.readUshort(e,r),r+=2,a.maxSizeOfInstructions=i.readUshort(e,r),r+=2,a.maxComponentElements=i.readUshort(e,r),r+=2,a.maxComponentDepth=i.readUshort(e,r),r+=2),a},t.name={},t.name.parse=function(e,r,n){var i=t._bin,a={};i.readUshort(e,r),r+=2;var s=i.readUshort(e,r);r+=2,i.readUshort(e,r);for(var o,l=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],c=r+=2,u=0;u<s;u++){var h=i.readUshort(e,r);r+=2;var d=i.readUshort(e,r);r+=2;var p=i.readUshort(e,r);r+=2;var f=i.readUshort(e,r);r+=2;var m=i.readUshort(e,r);r+=2;var g=i.readUshort(e,r);r+=2;var v,A=l[f],y=c+12*s+g;if(0==h)v=i.readUnicode(e,y,m/2);else if(3==h&&0==d)v=i.readUnicode(e,y,m/2);else if(0==d)v=i.readASCII(e,y,m);else if(1==d)v=i.readUnicode(e,y,m/2);else if(3==d)v=i.readUnicode(e,y,m/2);else{if(1!=h)throw"unknown encoding "+d+", platformID: "+h;v=i.readASCII(e,y,m),console.debug("reading unknown MAC encoding "+d+" as ASCII")}var x="p"+h+","+p.toString(16);null==a[x]&&(a[x]={}),a[x][void 0!==A?A:f]=v,a[x]._lang=p}for(var b in a)if(null!=a[b].postScriptName&&1033==a[b]._lang)return a[b];for(var b in a)if(null!=a[b].postScriptName&&0==a[b]._lang)return a[b];for(var b in a)if(null!=a[b].postScriptName&&3084==a[b]._lang)return a[b];for(var b in a)if(null!=a[b].postScriptName)return a[b];for(var b in a){o=b;break}return console.debug("returning name table with languageID "+a[o]._lang),a[o]},t["OS/2"]={},t["OS/2"].parse=function(e,r,n){var i=t._bin.readUshort(e,r);r+=2;var a={};if(0==i)t["OS/2"].version0(e,r,a);else if(1==i)t["OS/2"].version1(e,r,a);else if(2==i||3==i||4==i)t["OS/2"].version2(e,r,a);else{if(5!=i)throw"unknown OS/2 table version: "+i;t["OS/2"].version5(e,r,a)}return a},t["OS/2"].version0=function(e,r,n){var i=t._bin;return n.xAvgCharWidth=i.readShort(e,r),r+=2,n.usWeightClass=i.readUshort(e,r),r+=2,n.usWidthClass=i.readUshort(e,r),r+=2,n.fsType=i.readUshort(e,r),r+=2,n.ySubscriptXSize=i.readShort(e,r),r+=2,n.ySubscriptYSize=i.readShort(e,r),r+=2,n.ySubscriptXOffset=i.readShort(e,r),r+=2,n.ySubscriptYOffset=i.readShort(e,r),r+=2,n.ySuperscriptXSize=i.readShort(e,r),r+=2,n.ySuperscriptYSize=i.readShort(e,r),r+=2,n.ySuperscriptXOffset=i.readShort(e,r),r+=2,n.ySuperscriptYOffset=i.readShort(e,r),r+=2,n.yStrikeoutSize=i.readShort(e,r),r+=2,n.yStrikeoutPosition=i.readShort(e,r),r+=2,n.sFamilyClass=i.readShort(e,r),r+=2,n.panose=i.readBytes(e,r,10),r+=10,n.ulUnicodeRange1=i.readUint(e,r),r+=4,n.ulUnicodeRange2=i.readUint(e,r),r+=4,n.ulUnicodeRange3=i.readUint(e,r),r+=4,n.ulUnicodeRange4=i.readUint(e,r),r+=4,n.achVendID=[i.readInt8(e,r),i.readInt8(e,r+1),i.readInt8(e,r+2),i.readInt8(e,r+3)],r+=4,n.fsSelection=i.readUshort(e,r),r+=2,n.usFirstCharIndex=i.readUshort(e,r),r+=2,n.usLastCharIndex=i.readUshort(e,r),r+=2,n.sTypoAscender=i.readShort(e,r),r+=2,n.sTypoDescender=i.readShort(e,r),r+=2,n.sTypoLineGap=i.readShort(e,r),r+=2,n.usWinAscent=i.readUshort(e,r),r+=2,n.usWinDescent=i.readUshort(e,r),r+2},t["OS/2"].version1=function(e,r,n){var i=t._bin;return r=t["OS/2"].version0(e,r,n),n.ulCodePageRange1=i.readUint(e,r),r+=4,n.ulCodePageRange2=i.readUint(e,r),r+4},t["OS/2"].version2=function(e,r,n){var i=t._bin;return r=t["OS/2"].version1(e,r,n),n.sxHeight=i.readShort(e,r),r+=2,n.sCapHeight=i.readShort(e,r),r+=2,n.usDefault=i.readUshort(e,r),r+=2,n.usBreak=i.readUshort(e,r),r+=2,n.usMaxContext=i.readUshort(e,r),r+2},t["OS/2"].version5=function(e,r,n){var i=t._bin;return r=t["OS/2"].version2(e,r,n),n.usLowerOpticalPointSize=i.readUshort(e,r),r+=2,n.usUpperOpticalPointSize=i.readUshort(e,r),r+2},t.post={},t.post.parse=function(e,r,n){var i=t._bin,a={};return a.version=i.readFixed(e,r),r+=4,a.italicAngle=i.readFixed(e,r),r+=4,a.underlinePosition=i.readShort(e,r),r+=2,a.underlineThickness=i.readShort(e,r),r+=2,a},null==t&&(t={}),null==t.U&&(t.U={}),t.U.codeToGlyph=function(e,t){var r=e.cmap,n=-1;if(null!=r.p0e4?n=r.p0e4:null!=r.p3e1?n=r.p3e1:null!=r.p1e0?n=r.p1e0:null!=r.p0e3&&(n=r.p0e3),-1==n)throw"no familiar platform and encoding!";var i=r.tables[n];if(0==i.format)return t>=i.map.length?0:i.map[t];if(4==i.format){for(var a=-1,s=0;s<i.endCount.length;s++)if(t<=i.endCount[s]){a=s;break}return-1==a||i.startCount[a]>t?0:65535&(0!=i.idRangeOffset[a]?i.glyphIdArray[t-i.startCount[a]+(i.idRangeOffset[a]>>1)-(i.idRangeOffset.length-a)]:t+i.idDelta[a])}if(12==i.format){if(t>i.groups[i.groups.length-1][1])return 0;for(s=0;s<i.groups.length;s++){var o=i.groups[s];if(o[0]<=t&&t<=o[1])return o[2]+(t-o[0])}return 0}throw"unknown cmap table format "+i.format},t.U.glyphToPath=function(e,r){var n={cmds:[],crds:[]};if(e.SVG&&e.SVG.entries[r]){var i=e.SVG.entries[r];return null==i?n:("string"==typeof i&&(i=t.SVG.toPath(i),e.SVG.entries[r]=i),i)}if(e.CFF){var a={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:e.CFF.Private?e.CFF.Private.defaultWidthX:0,open:!1},s=e.CFF,o=e.CFF.Private;if(s.ROS){for(var l=0;s.FDSelect[l+2]<=r;)l+=2;o=s.FDArray[s.FDSelect[l+1]].Private}t.U._drawCFF(e.CFF.CharStrings[r],a,s,o,n)}else e.glyf&&t.U._drawGlyf(r,e,n);return n},t.U._drawGlyf=function(e,r,n){var i=r.glyf[e];null==i&&(i=r.glyf[e]=t.glyf._parseGlyf(r,e)),null!=i&&(i.noc>-1?t.U._simpleGlyph(i,n):t.U._compoGlyph(i,r,n))},t.U._simpleGlyph=function(e,r){for(var n=0;n<e.noc;n++){for(var i=0==n?0:e.endPts[n-1]+1,a=e.endPts[n],s=i;s<=a;s++){var o=s==i?a:s-1,l=s==a?i:s+1,c=1&e.flags[s],u=1&e.flags[o],h=1&e.flags[l],d=e.xs[s],p=e.ys[s];if(s==i)if(c){if(!u){t.U.P.moveTo(r,d,p);continue}t.U.P.moveTo(r,e.xs[o],e.ys[o])}else u?t.U.P.moveTo(r,e.xs[o],e.ys[o]):t.U.P.moveTo(r,(e.xs[o]+d)/2,(e.ys[o]+p)/2);c?u&&t.U.P.lineTo(r,d,p):h?t.U.P.qcurveTo(r,d,p,e.xs[l],e.ys[l]):t.U.P.qcurveTo(r,d,p,(d+e.xs[l])/2,(p+e.ys[l])/2)}t.U.P.closePath(r)}},t.U._compoGlyph=function(e,r,n){for(var i=0;i<e.parts.length;i++){var a={cmds:[],crds:[]},s=e.parts[i];t.U._drawGlyf(s.glyphIndex,r,a);for(var o=s.m,l=0;l<a.crds.length;l+=2){var c=a.crds[l],u=a.crds[l+1];n.crds.push(c*o.a+u*o.b+o.tx),n.crds.push(c*o.c+u*o.d+o.ty)}for(l=0;l<a.cmds.length;l++)n.cmds.push(a.cmds[l])}},t.U._getGlyphClass=function(e,r){var n=t._lctf.getInterval(r,e);return-1==n?0:r[n+2]},t.U.getPairAdjustment=function(e,r,n){var i=0,a=!1;if(e.GPOS)for(var s=e.GPOS,o=s.lookupList,l=s.featureList,c=[],u=0;u<l.length;u++){var h=l[u];if("kern"==h.tag){a=!0;for(var d=0;d<h.tab.length;d++)if(!c[h.tab[d]]){c[h.tab[d]]=!0;for(var p=o[h.tab[d]],f=0;f<p.tabs.length;f++)if(null!=p.tabs[f]){var m,g=p.tabs[f];if(!g.coverage||-1!=(m=t._lctf.coverageIndex(g.coverage,r)))if(1==p.ltype);else if(2==p.ltype){var v;if(1==g.fmt){var A=g.pairsets[m];for(u=0;u<A.length;u++)A[u].gid2==n&&(v=A[u])}else if(2==g.fmt){var y=t.U._getGlyphClass(r,g.classDef1),x=t.U._getGlyphClass(n,g.classDef2);v=g.matrix[y][x]}v&&v.val1&&v.val1[2]&&(i+=v.val1[2]),v&&v.val2&&v.val2[0]&&(i+=v.val2[0])}}}}}if(e.kern&&!a){var b=e.kern.glyph1.indexOf(r);if(-1!=b){var w=e.kern.rval[b].glyph2.indexOf(n);-1!=w&&(i+=e.kern.rval[b].vals[w])}}return i},t.U._applySubs=function(e,r,n,i){for(var a=e.length-r-1,s=0;s<n.tabs.length;s++)if(null!=n.tabs[s]){var o,l=n.tabs[s];if(!l.coverage||-1!=(o=t._lctf.coverageIndex(l.coverage,e[r])))if(1==n.ltype)e[r],1==l.fmt?e[r]=e[r]+l.delta:e[r]=l.newg[o];else if(4==n.ltype)for(var c=l.vals[o],u=0;u<c.length;u++){var h=c[u],d=h.chain.length;if(!(d>a)){for(var p=!0,f=0,m=0;m<d;m++){for(;-1==e[r+f+(1+m)];)f++;h.chain[m]!=e[r+f+(1+m)]&&(p=!1)}if(p){for(e[r]=h.nglyph,m=0;m<d+f;m++)e[r+m+1]=-1;break}}}else if(5==n.ltype&&2==l.fmt)for(var g=t._lctf.getInterval(l.cDef,e[r]),v=l.cDef[g+2],A=l.scset[v],y=0;y<A.length;y++){var x=A[y],b=x.input;if(!(b.length>a)){for(p=!0,m=0;m<b.length;m++){var w=t._lctf.getInterval(l.cDef,e[r+1+m]);if(-1==g&&l.cDef[w+2]!=b[m]){p=!1;break}}if(p){var E=x.substLookupRecords;for(u=0;u<E.length;u+=2)E[u],E[u+1]}}}else if(6==n.ltype&&3==l.fmt){if(!t.U._glsCovered(e,l.backCvg,r-l.backCvg.length))continue;if(!t.U._glsCovered(e,l.inptCvg,r))continue;if(!t.U._glsCovered(e,l.ahedCvg,r+l.inptCvg.length))continue;var S=l.lookupRec;for(y=0;y<S.length;y+=2){g=S[y];var M=i[S[y+1]];t.U._applySubs(e,r+g,M,i)}}}},t.U._glsCovered=function(e,r,n){for(var i=0;i<r.length;i++)if(-1==t._lctf.coverageIndex(r[i],e[n+i]))return!1;return!0},t.U.glyphsToPath=function(e,r,n){for(var i={cmds:[],crds:[]},a=0,s=0;s<r.length;s++){var o=r[s];if(-1!=o){for(var l=s<r.length-1&&-1!=r[s+1]?r[s+1]:0,c=t.U.glyphToPath(e,o),u=0;u<c.crds.length;u+=2)i.crds.push(c.crds[u]+a),i.crds.push(c.crds[u+1]);for(n&&i.cmds.push(n),u=0;u<c.cmds.length;u++)i.cmds.push(c.cmds[u]);n&&i.cmds.push("X"),a+=e.hmtx.aWidth[o],s<r.length-1&&(a+=t.U.getPairAdjustment(e,o,l))}}return i},t.U.P={},t.U.P.moveTo=function(e,t,r){e.cmds.push("M"),e.crds.push(t,r)},t.U.P.lineTo=function(e,t,r){e.cmds.push("L"),e.crds.push(t,r)},t.U.P.curveTo=function(e,t,r,n,i,a,s){e.cmds.push("C"),e.crds.push(t,r,n,i,a,s)},t.U.P.qcurveTo=function(e,t,r,n,i){e.cmds.push("Q"),e.crds.push(t,r,n,i)},t.U.P.closePath=function(e){e.cmds.push("Z")},t.U._drawCFF=function(e,r,n,i,a){for(var s=r.stack,o=r.nStems,l=r.haveWidth,c=r.width,u=r.open,h=0,d=r.x,p=r.y,f=0,m=0,g=0,v=0,A=0,y=0,x=0,b=0,w=0,E=0,S={val:0,size:0};h<e.length;){t.CFF.getCharString(e,h,S);var M=S.val;if(h+=S.size,"o1"==M||"o18"==M)s.length%2!=0&&!l&&(c=s.shift()+i.nominalWidthX),o+=s.length>>1,s.length=0,l=!0;else if("o3"==M||"o23"==M)s.length%2!=0&&!l&&(c=s.shift()+i.nominalWidthX),o+=s.length>>1,s.length=0,l=!0;else if("o4"==M)s.length>1&&!l&&(c=s.shift()+i.nominalWidthX,l=!0),u&&t.U.P.closePath(a),p+=s.pop(),t.U.P.moveTo(a,d,p),u=!0;else if("o5"==M)for(;s.length>0;)d+=s.shift(),p+=s.shift(),t.U.P.lineTo(a,d,p);else if("o6"==M||"o7"==M)for(var _=s.length,T="o6"==M,C=0;C<_;C++){var I=s.shift();T?d+=I:p+=I,T=!T,t.U.P.lineTo(a,d,p)}else if("o8"==M||"o24"==M){_=s.length;for(var B=0;B+6<=_;)f=d+s.shift(),m=p+s.shift(),g=f+s.shift(),v=m+s.shift(),d=g+s.shift(),p=v+s.shift(),t.U.P.curveTo(a,f,m,g,v,d,p),B+=6;"o24"==M&&(d+=s.shift(),p+=s.shift(),t.U.P.lineTo(a,d,p))}else{if("o11"==M)break;if("o1234"==M||"o1235"==M||"o1236"==M||"o1237"==M)"o1234"==M&&(m=p,g=(f=d+s.shift())+s.shift(),E=v=m+s.shift(),y=v,b=p,d=(x=(A=(w=g+s.shift())+s.shift())+s.shift())+s.shift(),t.U.P.curveTo(a,f,m,g,v,w,E),t.U.P.curveTo(a,A,y,x,b,d,p)),"o1235"==M&&(f=d+s.shift(),m=p+s.shift(),g=f+s.shift(),v=m+s.shift(),w=g+s.shift(),E=v+s.shift(),A=w+s.shift(),y=E+s.shift(),x=A+s.shift(),b=y+s.shift(),d=x+s.shift(),p=b+s.shift(),s.shift(),t.U.P.curveTo(a,f,m,g,v,w,E),t.U.P.curveTo(a,A,y,x,b,d,p)),"o1236"==M&&(f=d+s.shift(),m=p+s.shift(),g=f+s.shift(),E=v=m+s.shift(),y=v,x=(A=(w=g+s.shift())+s.shift())+s.shift(),b=y+s.shift(),d=x+s.shift(),t.U.P.curveTo(a,f,m,g,v,w,E),t.U.P.curveTo(a,A,y,x,b,d,p)),"o1237"==M&&(f=d+s.shift(),m=p+s.shift(),g=f+s.shift(),v=m+s.shift(),w=g+s.shift(),E=v+s.shift(),A=w+s.shift(),y=E+s.shift(),x=A+s.shift(),b=y+s.shift(),Math.abs(x-d)>Math.abs(b-p)?d=x+s.shift():p=b+s.shift(),t.U.P.curveTo(a,f,m,g,v,w,E),t.U.P.curveTo(a,A,y,x,b,d,p));else if("o14"==M){if(s.length>0&&!l&&(c=s.shift()+n.nominalWidthX,l=!0),4==s.length){var R=s.shift(),P=s.shift(),F=s.shift(),L=s.shift(),D=t.CFF.glyphBySE(n,F),U=t.CFF.glyphBySE(n,L);t.U._drawCFF(n.CharStrings[D],r,n,i,a),r.x=R,r.y=P,t.U._drawCFF(n.CharStrings[U],r,n,i,a)}u&&(t.U.P.closePath(a),u=!1)}else if("o19"==M||"o20"==M)s.length%2!=0&&!l&&(c=s.shift()+i.nominalWidthX),o+=s.length>>1,s.length=0,l=!0,h+=o+7>>3;else if("o21"==M)s.length>2&&!l&&(c=s.shift()+i.nominalWidthX,l=!0),p+=s.pop(),d+=s.pop(),u&&t.U.P.closePath(a),t.U.P.moveTo(a,d,p),u=!0;else if("o22"==M)s.length>1&&!l&&(c=s.shift()+i.nominalWidthX,l=!0),d+=s.pop(),u&&t.U.P.closePath(a),t.U.P.moveTo(a,d,p),u=!0;else if("o25"==M){for(;s.length>6;)d+=s.shift(),p+=s.shift(),t.U.P.lineTo(a,d,p);f=d+s.shift(),m=p+s.shift(),g=f+s.shift(),v=m+s.shift(),d=g+s.shift(),p=v+s.shift(),t.U.P.curveTo(a,f,m,g,v,d,p)}else if("o26"==M)for(s.length%2&&(d+=s.shift());s.length>0;)f=d,m=p+s.shift(),d=g=f+s.shift(),p=(v=m+s.shift())+s.shift(),t.U.P.curveTo(a,f,m,g,v,d,p);else if("o27"==M)for(s.length%2&&(p+=s.shift());s.length>0;)m=p,g=(f=d+s.shift())+s.shift(),v=m+s.shift(),d=g+s.shift(),p=v,t.U.P.curveTo(a,f,m,g,v,d,p);else if("o10"==M||"o29"==M){var N="o10"==M?i:n;if(0==s.length)console.debug("error: empty stack");else{var k=s.pop(),O=N.Subrs[k+N.Bias];r.x=d,r.y=p,r.nStems=o,r.haveWidth=l,r.width=c,r.open=u,t.U._drawCFF(O,r,n,i,a),d=r.x,p=r.y,o=r.nStems,l=r.haveWidth,c=r.width,u=r.open}}else if("o30"==M||"o31"==M){var G=s.length,z=(B=0,"o31"==M);for(B+=G-(_=-3&G);B<_;)z?(m=p,g=(f=d+s.shift())+s.shift(),p=(v=m+s.shift())+s.shift(),_-B==5?(d=g+s.shift(),B++):d=g,z=!1):(f=d,m=p+s.shift(),g=f+s.shift(),v=m+s.shift(),d=g+s.shift(),_-B==5?(p=v+s.shift(),B++):p=v,z=!0),t.U.P.curveTo(a,f,m,g,v,d,p),B+=4}else{if("o"==(M+"").charAt(0))throw console.debug("Unknown operation: "+M,e),M;s.push(M)}}}r.x=d,r.y=p,r.nStems=o,r.haveWidth=l,r.width=c,r.open=u};var r=t,n={Typr:r};return e.Typr=r,e.default=n,Object.defineProperty(e,"__esModule",{value:!0}),e}({}).Typr},function(){return function(e){var t=Uint8Array,r=Uint16Array,n=Uint32Array,i=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(e,t){for(var i=new r(31),a=0;a<31;++a)i[a]=t+=1<<e[a-1];var s=new n(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return[i,s]},l=o(i,2),c=l[0],u=l[1];c[28]=258,u[258]=28;for(var h=o(a,0)[0],d=new r(32768),p=0;p<32768;++p){var f=(43690&p)>>>1|(21845&p)<<1;f=(61680&(f=(52428&f)>>>2|(13107&f)<<2))>>>4|(3855&f)<<4,d[p]=((65280&f)>>>8|(255&f)<<8)>>>1}var m=function(e,t,n){for(var i=e.length,a=0,s=new r(t);a<i;++a)++s[e[a]-1];var o,l=new r(t);for(a=0;a<t;++a)l[a]=l[a-1]+s[a-1]<<1;if(n){o=new r(1<<t);var c=15-t;for(a=0;a<i;++a)if(e[a])for(var u=a<<4|e[a],h=t-e[a],p=l[e[a]-1]++<<h,f=p|(1<<h)-1;p<=f;++p)o[d[p]>>>c]=u}else for(o=new r(i),a=0;a<i;++a)e[a]&&(o[a]=d[l[e[a]-1]++]>>>15-e[a]);return o},g=new t(288);for(p=0;p<144;++p)g[p]=8;for(p=144;p<256;++p)g[p]=9;for(p=256;p<280;++p)g[p]=7;for(p=280;p<288;++p)g[p]=8;var v=new t(32);for(p=0;p<32;++p)v[p]=5;var A=m(g,9,1),y=m(v,5,1),x=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},b=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&r},w=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},E=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],S=function(e,t,r){var n=new Error(t||E[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,S),!r)throw n;return n},M=function(e,o,l){var u=e.length;if(!u||l&&!l.l&&u<5)return o||new t(0);var d=!o||l,p=!l||l.i;l||(l={}),o||(o=new t(3*u));var f,g=function(e){var r=o.length;if(e>r){var n=new t(Math.max(2*r,e));n.set(o),o=n}},v=l.f||0,E=l.p||0,M=l.b||0,_=l.l,T=l.d,C=l.m,I=l.n,B=8*u;do{if(!_){l.f=v=b(e,E,1);var R=b(e,E+1,3);if(E+=3,!R){var P=e[(H=((f=E)/8|0)+(7&f&&1)+4)-4]|e[H-3]<<8,F=H+P;if(F>u){p&&S(0);break}d&&g(M+P),o.set(e.subarray(H,F),M),l.b=M+=P,l.p=E=8*F;continue}if(1==R)_=A,T=y,C=9,I=5;else if(2==R){var L=b(e,E,31)+257,D=b(e,E+10,15)+4,U=L+b(e,E+5,31)+1;E+=14;for(var N=new t(U),k=new t(19),O=0;O<D;++O)k[s[O]]=b(e,E+3*O,7);E+=3*D;var G=x(k),z=(1<<G)-1,V=m(k,G,1);for(O=0;O<U;){var H,Q=V[b(e,E,z)];if(E+=15&Q,(H=Q>>>4)<16)N[O++]=H;else{var j=0,W=0;for(16==H?(W=3+b(e,E,3),E+=2,j=N[O-1]):17==H?(W=3+b(e,E,7),E+=3):18==H&&(W=11+b(e,E,127),E+=7);W--;)N[O++]=j}}var X=N.subarray(0,L),Y=N.subarray(L);C=x(X),I=x(Y),_=m(X,C,1),T=m(Y,I,1)}else S(1);if(E>B){p&&S(0);break}}d&&g(M+131072);for(var q=(1<<C)-1,K=(1<<I)-1,J=E;;J=E){var Z=(j=_[w(e,E)&q])>>>4;if((E+=15&j)>B){p&&S(0);break}if(j||S(2),Z<256)o[M++]=Z;else{if(256==Z){J=E,_=null;break}var $=Z-254;if(Z>264){var ee=i[O=Z-257];$=b(e,E,(1<<ee)-1)+c[O],E+=ee}var te=T[w(e,E)&K],re=te>>>4;if(te||S(3),E+=15&te,Y=h[re],re>3&&(ee=a[re],Y+=w(e,E)&(1<<ee)-1,E+=ee),E>B){p&&S(0);break}d&&g(M+131072);for(var ne=M+$;M<ne;M+=4)o[M]=o[M-Y],o[M+1]=o[M+1-Y],o[M+2]=o[M+2-Y],o[M+3]=o[M+3-Y];M=ne}}l.l=_,l.p=J,l.b=M,_&&(v=1,l.m=C,l.d=T,l.n=I)}while(!v);return M==o.length?o:function(e,i,a){(null==i||i<0)&&(i=0),(null==a||a>e.length)&&(a=e.length);var s=new(e instanceof r?r:e instanceof n?n:t)(a-i);return s.set(e.subarray(i,a)),s}(o,0,M)},_=new t(0),T="undefined"!=typeof TextDecoder&&new TextDecoder;try{T.decode(_,{stream:!0})}catch(e){}return e.convert_streams=function(e){var t=new DataView(e),r=0;function n(){var e=t.getUint16(r);return r+=2,e}function i(){var e=t.getUint32(r);return r+=4,e}function a(e){v.setUint16(A,e),A+=2}function s(e){v.setUint32(A,e),A+=4}for(var o={signature:i(),flavor:i(),length:i(),numTables:n(),reserved:n(),totalSfntSize:i(),majorVersion:n(),minorVersion:n(),metaOffset:i(),metaLength:i(),metaOrigLength:i(),privOffset:i(),privLength:i()},l=0;Math.pow(2,l)<=o.numTables;)l++;l--;for(var c=16*Math.pow(2,l),u=16*o.numTables-c,h=12,d=[],p=0;p<o.numTables;p++)d.push({tag:i(),offset:i(),compLength:i(),origLength:i(),origChecksum:i()}),h+=16;var f,m=new Uint8Array(12+16*d.length+d.reduce((function(e,t){return e+t.origLength+4}),0)),g=m.buffer,v=new DataView(g),A=0;return s(o.flavor),a(o.numTables),a(c),a(l),a(u),d.forEach((function(e){s(e.tag),s(e.origChecksum),s(h),s(e.origLength),e.outOffset=h,(h+=e.origLength)%4!=0&&(h+=4-h%4)})),d.forEach((function(t){var r,n=e.slice(t.offset,t.offset+t.compLength);if(t.compLength!=t.origLength){var i=new Uint8Array(t.origLength);r=new Uint8Array(n,2),M(r,i)}else i=new Uint8Array(n);m.set(i,t.outOffset);var a=0;(h=t.outOffset+t.origLength)%4!=0&&(a=4-h%4),m.set(new Uint8Array(a).buffer,t.outOffset+t.origLength),f=h+a})),g.slice(0,f)},Object.defineProperty(e,"__esModule",{value:!0}),e}({}).convert_streams},function(e,t){const r={M:2,L:2,Q:4,C:6,Z:0},n={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"};let i;function a(e){if(!i){const e={R:2,L:1,D:4,C:16,U:32,T:8};i=new Map;for(let t in n){let r=0;n[t].split(",").forEach((n=>{let[a,s]=n.split("+");a=parseInt(a,36),s=s?parseInt(s,36):0,i.set(r+=a,e[t]);for(let o=s;o--;)i.set(++r,e[t])}))}}return i.get(e)||32}const s=[null,"isol","init","fina","medi"];function o(e){const t=new Uint8Array(e.length);let r=32,n=1,i=-1;for(let s=0;s<e.length;s++){const o=e.codePointAt(s);let l=0|a(o),c=1;8&l||(21&r?22&l?(c=3,1!==n&&3!==n||t[i]++):33&l&&(2!==n&&4!==n||t[i]--):34&r&&(2!==n&&4!==n||t[i]--),n=t[s]=c,r=l,i=s,o>65535&&s++)}return t}function l(t){const n=Object.create(null),i={unitsPerEm:t.head.unitsPerEm,ascender:t.hhea.ascender,descender:t.hhea.descender,forEachGlyph(a,l,c,u){let h=0;const d=1/i.unitsPerEm*l,p=function(t,r){const n=[];for(let a=0;a<r.length;a++){const i=r.codePointAt(a);i>65535&&a++,n.push(e.U.codeToGlyph(t,i))}const i=t.GSUB;if(i){const{lookupList:t,featureList:a}=i;let l;const c=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,u=[];a.forEach((i=>{if(c.test(i.tag))for(let a=0;a<i.tab.length;a++){if(u[i.tab[a]])continue;u[i.tab[a]]=!0;const c=t[i.tab[a]],h=/^(isol|init|fina|medi)$/.test(i.tag);h&&!l&&(l=o(r));for(let r=0;r<n.length;r++)l&&h&&s[l[r]]!==i.tag||e.U._applySubs(n,r,c,t)}}))}return n}(t,a);let f=0,m=-1;return p.forEach(((i,s)=>{if(-1!==i){let a=n[i];if(!a){const{cmds:s,crds:o}=e.U.glyphToPath(t,i);let l,c,u,h,d="",p=0;for(let e=0,t=s.length;e<t;e++){const t=r[s[e]];d+=s[e];for(let e=1;e<=t;e++)d+=(e>1?",":"")+o[p++]}if(o.length){l=c=1/0,u=h=-1/0;for(let e=0,t=o.length;e<t;e+=2){let t=o[e],r=o[e+1];t<l&&(l=t),r<c&&(c=r),t>u&&(u=t),r>h&&(h=r)}}else l=u=c=h=0;a=n[i]={index:i,advanceWidth:t.hmtx.aWidth[i],xMin:l,yMin:c,xMax:u,yMax:h,path:d,pathCommandCount:s.length}}-1!==m&&(h+=e.U.getPairAdjustment(t,m,i)*d),u.call(null,a,h,f),a.advanceWidth&&(h+=a.advanceWidth*d),c&&(h+=c*l),m=i}f+=a.codePointAt(f)>65535?2:1})),h}};return i}return function(r){const n=new Uint8Array(r,0,4),i=e._bin.readASCII(n,0,4);if("wOFF"===i)r=t(r);else if("wOF2"===i)throw new Error("woff2 fonts not supported");return l(e.parse(r)[0])}}],init:(e,t,r)=>r(e(),t())}),ha={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},da=new s.Color;let pa=!1;function fa(){return(self.performance||Date).now()}const ma=Object.create(null);function ga(e,t){pa=!0,e=Aa({},e);const r=fa();if(e.font=function(e){ya||(ya="undefined"==typeof document?{}:document.createElement("a"));return ya.href=e,ya.href}(e.font||ha.defaultFontURL),e.text=""+e.text,e.sdfGlyphSize=e.sdfGlyphSize||ha.sdfGlyphSize,null!=e.colorRanges){let t={};for(let r in e.colorRanges)if(e.colorRanges.hasOwnProperty(r)){let n=e.colorRanges[r];"number"!=typeof n&&(n=da.set(n).getHex()),t[r]=n}e.colorRanges=t}Object.freeze(e);const{textureWidth:n,sdfExponent:i}=ha,{sdfGlyphSize:a}=e,o=n/a*4;let l=ma[a];if(!l){const e=document.createElement("canvas");e.width=n,e.height=256*a/o,l=ma[a]={glyphCount:0,sdfGlyphSize:a,sdfCanvas:e,sdfTexture:new s.Texture(e,void 0,void 0,void 0,s.LinearFilter,s.LinearFilter),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,function(e){const t=e.sdfCanvas;t.addEventListener("webglcontextlost",(t=>{console.log("Context Lost",t),t.preventDefault(),e.contextLost=!0})),t.addEventListener("webglcontextrestored",(t=>{console.log("Context Restored",t),e.contextLost=!1;const r=[];e.glyphsByFont.forEach((t=>{t.forEach((t=>{r.push(va(t,e,!0))}))})),Bi.all(r).then((()=>{xa(e),e.sdfTexture.needsUpdate=!0}))}))}(l)}const{sdfTexture:c,sdfCanvas:u}=l;let h=l.glyphsByFont.get(e.font);h||l.glyphsByFont.set(e.font,h=new Map),wa(e).then((s=>{const{glyphIds:d,glyphPositions:p,fontSize:f,unitsPerEm:m,timings:g}=s,v=[],A=new Float32Array(4*d.length),y=f/m;let x=0,b=0;const w=fa();d.forEach(((e,t)=>{let r=h.get(e);if(!r){const{path:t,pathBounds:n}=s.glyphData[e],i=Math.max(n[2]-n[0],n[3]-n[1])/a*(ha.sdfMargin*a+.5),o=l.glyphCount++,c=[n[0]-i,n[1]-i,n[2]+i,n[3]+i];h.set(e,r={path:t,atlasIndex:o,sdfViewBox:c}),v.push(r)}const{sdfViewBox:n}=r,i=p[b++],o=p[b++];A[x++]=i+n[0]*y,A[x++]=o+n[1]*y,A[x++]=i+n[2]*y,A[x++]=o+n[3]*y,d[t]=r.atlasIndex})),g.quads=(g.quads||0)+(fa()-w);const E=fa();g.sdf={};const S=u.height,M=Math.ceil(l.glyphCount/o),_=Math.pow(2,Math.ceil(Math.log2(M*a)));_>S&&(console.info(`Increasing SDF texture size ${S}->${_}`),ca(u,n,_),c.dispose()),Bi.all(v.map((t=>va(t,l,e.gpuAccelerateSDF).then((({timing:e})=>{g.sdf[t.atlasIndex]=e}))))).then((()=>{v.length&&!l.contextLost&&(xa(l),c.needsUpdate=!0),g.sdfTotal=fa()-E,g.total=fa()-r,t(Object.freeze({parameters:e,sdfTexture:c,sdfGlyphSize:a,sdfExponent:i,glyphBounds:A,glyphAtlasIndices:d,glyphColors:s.glyphColors,caretPositions:s.caretPositions,caretHeight:s.caretHeight,chunkedBounds:s.chunkedBounds,ascender:s.ascender,descender:s.descender,lineHeight:s.lineHeight,topBaseline:s.topBaseline,blockBounds:s.blockBounds,visibleBounds:s.visibleBounds,timings:s.timings,get totalBounds(){return console.log("totalBounds deprecated, use blockBounds instead"),s.blockBounds},get totalBlockSize(){console.log("totalBlockSize deprecated, use blockBounds instead");const[e,t,r,n]=s.blockBounds;return[r-e,n-t]}}))}))})),Bi.all([]).then((()=>{var e;l.contextLost||(e=u)._warm||(aa.webgl.isSupported(e),e._warm=!0)}))}function va({path:e,atlasIndex:t,sdfViewBox:r},{sdfGlyphSize:n,sdfCanvas:i,contextLost:a},s){if(a)return Promise.resolve({timing:-1});const{textureWidth:o,sdfExponent:l}=ha,c=Math.max(r[2]-r[0],r[3]-r[1]),u=Math.floor(t/4);return function(e,t,r,n,i,a,s,o,l,c,u=!0){return u?oa(e,t,r,n,i,a,s,o,l,c).then(null,(u=>(sa||(console.warn("WebGL SDF generation failed, falling back to JS",u),sa=!0),la(e,t,r,n,i,a,s,o,l,c)))):la(e,t,r,n,i,a,s,o,l,c)}(n,n,e,r,c,l,i,u%(o/n)*n,Math.floor(u/(o/n))*n,t%4,s)}function Aa(e,t){for(let r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}let ya;function xa(e){if("function"!=typeof createImageBitmap){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:t,sdfTexture:r}=e,{width:n,height:i}=t,a=e.sdfCanvas.getContext("webgl");let s=r.image.data;s&&s.length===n*i*4||(s=new Uint8Array(n*i*4),r.image={width:n,height:i,data:s},r.flipY=!1,r.isDataTexture=!0),a.readPixels(0,0,n,i,a.RGBA,a.UNSIGNED_BYTE,s)}}const ba=Oi({name:"Typesetter",dependencies:[ha,ua,function(e,t,r){const{defaultFontURL:n}=r,i=Object.create(null),a=1/0,s=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,o=/[\s\-\u007C\u00AD\u2010\u2012-\u2014\u2027\u2056\u2E17\u2E40]/;function l(t,r){t||(t=n);let a=i[t];a?a.pending?a.pending.push(r):r(a):(i[t]={pending:[r]},function(t,r){!function i(){const a=e=>{console.error(`Failure loading font ${t}${t===n?"":"; trying fallback"}`,e),t!==n&&(t=n,i())};try{const n=new XMLHttpRequest;n.open("get",t,!0),n.responseType="arraybuffer",n.onload=function(){if(n.status>=400)a(new Error(n.statusText));else if(n.status>0)try{const t=e(n.response);r(t)}catch(Ha){a(Ha)}},n.onerror=a,n.send()}catch(s){a(s)}}()}(t,(e=>{let r=i[t].pending;i[t]=e,r.forEach((t=>t(e)))})))}function c({text:e="",font:r=n,sdfGlyphSize:i=64,fontSize:c=1,letterSpacing:f=0,lineHeight:m="normal",maxWidth:g=a,direction:v,textAlign:A="left",textIndent:y=0,whiteSpace:x="normal",overflowWrap:b="normal",anchorX:w=0,anchorY:E=0,includeCaretPositions:S=!1,chunkedBoundsSize:M=8192,colorRanges:_=null},T,C=!1){const I=d(),B={fontLoad:0,typesetting:0};e.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),c=+c,f=+f,g=+g,m=m||"normal",y=+y,l(r,(r=>{const n=isFinite(g);let i=null,l=null,R=null,P=null,F=null,L=null,D=null,U=0,N=0,k="nowrap"!==x;const{ascender:O,descender:G,unitsPerEm:z}=r;B.fontLoad=d()-I;const V=d(),H=c/z;"normal"===m&&(m=(O-G)/z);const Q=((m*=c)-(O-G)*H)/2,j=-(O*H+Q),W=Math.min(m,(O-G)*H),X=(O+G)/2*H-W/2;let Y=y,q=new p;const K=[q];r.forEachGlyph(e,c,f,((t,r,i)=>{const a=e.charAt(i),l=t.advanceWidth*H,u=q.count;let h;if("isEmpty"in t||(t.isWhitespace=!!a&&/\s/.test(a),t.canBreakAfter=!!a&&o.test(a),t.isEmpty=t.xMin===t.xMax||t.yMin===t.yMax||s.test(a)),t.isWhitespace||t.isEmpty||N++,k&&n&&!t.isWhitespace&&r+l+Y>g&&u){if(q.glyphAt(u-1).glyphObj.canBreakAfter)h=new p,Y=-r;else for(let e=u;e--;){if(0===e&&"break-word"===b){h=new p,Y=-r;break}if(q.glyphAt(e).glyphObj.canBreakAfter){h=q.splitAt(e+1);const t=h.glyphAt(0).x;Y-=t;for(let e=h.count;e--;)h.glyphAt(e).x-=t;break}}h&&(q.isSoftWrapped=!0,q=h,K.push(q),U=g)}let d=q.glyphAt(q.count);d.glyphObj=t,d.x=r+Y,d.width=l,d.charIndex=i,"\n"===a&&(q=new p,K.push(q),Y=-(r+l+f*c)+y)})),K.forEach((e=>{for(let t=e.count;t--;){let{glyphObj:r,x:n,width:i}=e.glyphAt(t);if(!r.isWhitespace)return e.width=n+i,void(e.width>U&&(U=e.width))}}));let J=0,Z=0;if(w&&("number"==typeof w?J=-w:"string"==typeof w&&(J=-U*("left"===w?0:"center"===w?.5:"right"===w?1:u(w)))),E)if("number"==typeof E)Z=-E;else if("string"==typeof E){let e=K.length*m;Z="top"===E?0:"top-baseline"===E?-j:"middle"===E?e/2:"bottom"===E?e:"bottom-baseline"===E?e-Q+G*H:u(E)*e}if(!C){const n=t.getEmbeddingLevels(e,v);i=new Uint16Array(N),l=new Float32Array(2*N),R={},L=[a,a,-1/0,-1/0],D=[];let s=j;S&&(F=new Float32Array(3*e.length)),_&&(P=new Uint8Array(3*N));let o,c,u=0,d=-1,p=-1;if(K.forEach(((f,g)=>{let{count:v,width:y}=f;if(v>0){let m=0;for(let e=v;e--&&f.glyphAt(e).glyphObj.isWhitespace;)m++;let g=0,x=0;if("center"===A)g=(U-y)/2;else if("right"===A)g=U-y;else if("justify"===A&&f.isSoftWrapped){let e=0;for(let t=v-m;t--;)f.glyphAt(t).glyphObj.isWhitespace&&e++;x=(U-y)/e}if(x||g){let e=0;for(let t=0;t<v;t++){let r=f.glyphAt(t);const n=r.glyphObj;r.x+=g+e,0!==x&&n.isWhitespace&&t<v-m&&(e+=x,r.width+=x)}}const b=t.getReorderSegments(e,n,f.glyphAt(0).charIndex,f.glyphAt(f.count-1).charIndex);for(let e=0;e<b.length;e++){const[t,r]=b[e];let n=1/0,i=-1/0;for(let e=0;e<v;e++)if(f.glyphAt(e).charIndex>=t){let t=e,a=e;for(;a<v;a++){let e=f.glyphAt(a);if(e.charIndex>r)break;a<v-m&&(n=Math.min(n,e.x),i=Math.max(i,e.x+e.width))}for(let e=t;e<a;e++){const t=f.glyphAt(e);t.x=i-(t.x+t.width-n)}break}}let w;const E=e=>w=e;for(let A=0;A<v;A++){let m=f.glyphAt(A);w=m.glyphObj;const g=w.index,v=1&n.levels[m.charIndex];if(v){const n=t.getMirroredCharacter(e[m.charIndex]);n&&r.forEachGlyph(n,0,0,E)}if(S){const{charIndex:e}=m,t=m.x+J,r=m.x+m.width+J;F[3*e]=v?r:t,F[3*e+1]=v?t:r,F[3*e+2]=s+X+Z;const n=e-d;n>1&&h(F,d,n),d=e}if(_){const{charIndex:e}=m;for(;e>p;)p++,_.hasOwnProperty(p)&&(c=_[p])}if(!w.isWhitespace&&!w.isEmpty){const e=u++;R[g]||(R[g]={path:w.path,pathBounds:[w.xMin,w.yMin,w.xMax,w.yMax]});const t=m.x+J,r=s+Z;l[2*e]=t,l[2*e+1]=r;const n=t+w.xMin*H,h=r+w.yMin*H,d=t+w.xMax*H,p=r+w.yMax*H;n<L[0]&&(L[0]=n),h<L[1]&&(L[1]=h),d>L[2]&&(L[2]=d),p>L[3]&&(L[3]=p),e%M==0&&(o={start:e,end:e,rect:[a,a,-1/0,-1/0]},D.push(o)),o.end++;const f=o.rect;if(n<f[0]&&(f[0]=n),h<f[1]&&(f[1]=h),d>f[2]&&(f[2]=d),p>f[3]&&(f[3]=p),i[e]=g,_){const t=3*e;P[t]=c>>16&255,P[t+1]=c>>8&255,P[t+2]=255&c}}}}s-=m})),F){const t=e.length-d;t>1&&h(F,d,t)}}B.typesetting=d()-V,T({glyphIds:i,glyphPositions:l,glyphData:R,caretPositions:F,caretHeight:W,glyphColors:P,chunkedBounds:D,fontSize:c,unitsPerEm:z,ascender:O*H,descender:G*H,lineHeight:m,topBaseline:j,blockBounds:[J,Z-K.length*m,J+U,Z],visibleBounds:L,timings:B})}))}function u(e){let t=e.match(/^([\d.]+)%$/),r=t?parseFloat(t[1]):NaN;return isNaN(r)?0:r/100}function h(e,t,r){const n=e[3*t],i=e[3*t+1],a=e[3*t+2],s=(i-n)/r;for(let o=0;o<r;o++){const r=3*(t+o);e[r]=n+s*o,e[r+1]=n+s*(o+1),e[r+2]=a}}function d(){return(self.performance||Date).now()}function p(){this.data=[]}const f=["glyphObj","x","width","charIndex"];return p.prototype={width:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/f.length)},glyphAt(e){let t=p.flyweight;return t.data=this.data,t.index=e,t},splitAt(e){let t=new p;return t.data=this.data.splice(e*f.length),t}},p.flyweight=f.reduce(((e,t,r,n)=>(Object.defineProperty(e,t,{get(){return this.data[this.index*f.length+r]},set(e){this.data[this.index*f.length+r]=e}}),e)),{data:null,index:0}),{typeset:c,measure:function(e,t){c(e,(e=>{const[r,n,i,a]=e.blockBounds;t({width:i-r,height:a-n})}),{metricsOnly:!0})},loadFont:l}},Qi],init(e,t,r,n){const{defaultFontURL:i}=e;return r(t,n(),{defaultFontURL:i})}}),wa=Oi({name:"Typesetter",dependencies:[ba,Vi],init:(e,t)=>function(r){const n=new t;return e.typeset(r,n.resolve),n},getTransferables(e){const t=[e.glyphPositions.buffer,e.glyphIds.buffer];return e.caretPositions&&t.push(e.caretPositions.buffer),e.glyphColors&&t.push(e.glyphColors.buffer),t}});const Ea=(()=>{const e={};const t="aTroikaGlyphIndex";class r extends s.InstancedBufferGeometry{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new s.Sphere,this.boundingBox=new s.Box3}computeBoundingSphere(){}computeBoundingBox(){}setSide(e){const t=this.getIndex().count;this.setDrawRange(e===s.BackSide?t/2:0,e===s.DoubleSide?t:t/2)}set detail(t){if(t!==this._detail){this._detail=t,("number"!=typeof t||t<1)&&(t=1);let r=function(t){let r=e[t];if(!r){const n=new s.PlaneBufferGeometry(1,1,t,t),i=n.clone(),a=n.attributes,o=i.attributes,l=new s.BufferGeometry,c=a.uv.count;for(let e=0;e<c;e++)o.position.array[3*e]*=-1,o.normal.array[3*e+2]*=-1;["position","normal","uv"].forEach((e=>{l.setAttribute(e,new s.Float32BufferAttribute([...a[e].array,...o[e].array],a[e].itemSize))})),l.setIndex([...n.index.array,...i.index.array.map((e=>e+c))]),l.translate(.5,.5,0),r=e[t]=l}return r}(t);["position","normal","uv"].forEach((e=>{this.attributes[e]=r.attributes[e].clone()})),this.setIndex(r.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,r,a,s,o){n(this,"aTroikaGlyphBounds",e,4),n(this,t,r,1),n(this,"aTroikaGlyphColor",o,3),this._blockBounds=a,this._chunkedBounds=s,i(this,r.length),this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:t,boundingBox:r}=this;if(t){const{PI:n,floor:i,min:a,max:s,sin:o,cos:l}=Math,c=n/2,u=2*n,h=Math.abs(t),d=e[0]/h,p=e[2]/h,f=i((d+c)/u)!==i((p+c)/u)?-h:a(o(d)*h,o(p)*h),m=i((d-c)/u)!==i((p-c)/u)?h:s(o(d)*h,o(p)*h),g=i((d+n)/u)!==i((p+n)/u)?2*h:s(h-l(d)*h,h-l(p)*h);r.min.set(f,e[1],t<0?-g:0),r.max.set(m,e[3],t<0?0:g)}else r.min.set(e[0],e[1],0),r.max.set(e[2],e[3],0);r.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let r=this.getAttribute(t).count,n=this._chunkedBounds;if(n)for(let t=n.length;t--;){r=n[t].end;let i=n[t].rect;if(i[1]<e.w&&i[3]>e.y&&i[0]<e.z&&i[2]>e.x)break}i(this,r)}}function n(e,t,r,n){const i=e.getAttribute(t);r?i&&i.array.length===r.length?(i.array.set(r),i.needsUpdate=!0):(e.setAttribute(t,new s.InstancedBufferAttribute(r,n)),delete e._maxInstanceCount,e.dispose()):i&&e.deleteAttribute(t)}function i(e,t){e[e.hasOwnProperty("instanceCount")?"instanceCount":"maxInstancedCount"]=t}return r.prototype.setAttribute||(r.prototype.setAttribute=function(e,t){return this.attributes[e]=t,this}),r})();const Sa=(()=>{const e=new s.MeshBasicMaterial({color:16777215,side:s.DoubleSide,transparent:!0}),t=8421504,r=new s.Matrix4,n=new s.Vector3,i=new s.Vector3,a=[],o=new s.Vector3,l="+x+y";function c(e){return Array.isArray(e)?e[0]:e}let u=()=>{const t=new s.Mesh(new s.PlaneBufferGeometry(1,1),e);return u=()=>t,t},h=()=>{const t=new s.Mesh(new s.PlaneBufferGeometry(1,1,32,1),e);return h=()=>t,t};const d={type:"syncstart"},p={type:"synccomplete"},f=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],m=f.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class g extends s.Mesh{constructor(){super(new Ea,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.fontSize=.1,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=t,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=l,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(d),ga({text:this.text,font:this.font,fontSize:this.fontSize||.1,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF},(t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);const r=this._queuedSyncs;r&&(this._queuedSyncs=null,this._needsSync=!0,this.sync((()=>{r.forEach((e=>e&&e()))}))),this.dispatchEvent(p),e&&e()}))))}onBeforeRender(e,t,r,n,i,a){this.sync(),i.isTroikaTextMaterial&&this._prepareForRender(i),i._hadOwnSide=i.hasOwnProperty("side"),this.geometry.setSide(i._actualSide=i.side),i.side=s.FrontSide}onAfterRender(e,t,r,n,i,a){i._hadOwnSide?i.side=i._actualSide:delete i.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let t=this._derivedMaterial;const r=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=e.clone());if(t&&t.baseMaterial===r||(t=this._derivedMaterial=function(e){const t=$i(e,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new s.Vector2},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new s.Vector4(0,0,0,0)},uTroikaClipRect:{value:new s.Vector4(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new s.Vector2},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new s.Color},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new s.Matrix3},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:"\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nuniform float uTroikaDistanceOffset;\nuniform float uTroikaBlurRadius;\nuniform vec2 uTroikaPositionOffset;\nuniform float uTroikaCurveRadius;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec3 vTroikaGlyphColor;\nvarying vec2 vTroikaGlyphDimensions;\n",vertexTransform:"\nvec4 bounds = aTroikaGlyphBounds;\nbounds.xz += uTroikaPositionOffset.x;\nbounds.yw -= uTroikaPositionOffset.y;\n\nvec4 outlineBounds = vec4(\n bounds.xy - uTroikaDistanceOffset - uTroikaBlurRadius,\n bounds.zw + uTroikaDistanceOffset + uTroikaBlurRadius\n);\nvec4 clippedBounds = vec4(\n clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\n\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);\n\nfloat rad = uTroikaCurveRadius;\nif (rad != 0.0) {\n float angle = position.x / rad;\n position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);\n normal.xz = vec2(sin(angle), cos(angle));\n}\n \nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n\nvTroikaGlyphUV = clippedXY.xy;\nvTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);\n\n\nfloat txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\nvec2 txStartUV = txUvPerSquare * vec2(\n mod(floor(aTroikaGlyphIndex / 4.0), txCols),\n floor(floor(aTroikaGlyphIndex / 4.0) / txCols)\n);\nvTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);\nvTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);\n",fragmentDefs:"\nuniform sampler2D uTroikaSDFTexture;\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform float uTroikaSDFExponent;\nuniform float uTroikaDistanceOffset;\nuniform float uTroikaFillOpacity;\nuniform float uTroikaOutlineOpacity;\nuniform float uTroikaBlurRadius;\nuniform vec3 uTroikaStrokeColor;\nuniform float uTroikaStrokeWidth;\nuniform float uTroikaStrokeOpacity;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec2 vTroikaGlyphDimensions;\n\nfloat troikaSdfValueToSignedDistance(float alpha) {\n // Inverse of exponential encoding in webgl-sdf-generator\n \n float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);\n float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;\n float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);\n return signedDist;\n}\n\nfloat troikaGlyphUvToSdfValue(vec2 glyphUV) {\n vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);\n vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);\n float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1\n return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;\n}\n\nfloat troikaGlyphUvToDistance(vec2 uv) {\n return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));\n}\n\nfloat troikaGetAADist() {\n \n #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;\n #else\n return vTroikaGlyphDimensions.x / 64.0;\n #endif\n}\n\nfloat troikaGetFragDistValue() {\n vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);\n float distance = troikaGlyphUvToDistance(clampedGlyphUV);\n \n // Extrapolate distance when outside bounds:\n distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : \n length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);\n\n \n\n return distance;\n}\n\nfloat troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {\n #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n float alpha = step(-distanceOffset, -distance);\n #else\n\n float alpha = smoothstep(\n distanceOffset + aaDist,\n distanceOffset - aaDist,\n distance\n );\n #endif\n\n return alpha;\n}\n",fragmentColorTransform:"\nfloat aaDist = troikaGetAADist();\nfloat fragDistance = troikaGetFragDistValue();\nfloat edgeAlpha = uTroikaSDFDebug ?\n troikaGlyphUvToSdfValue(vTroikaGlyphUV) :\n troikaGetEdgeAlpha(fragDistance, uTroikaDistanceOffset, max(aaDist, uTroikaBlurRadius));\n\n#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)\nvec4 fillRGBA = gl_FragColor;\nfillRGBA.a *= uTroikaFillOpacity;\nvec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);\nif (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;\ngl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(\n -uTroikaStrokeWidth - aaDist,\n -uTroikaStrokeWidth + aaDist,\n fragDistance\n));\ngl_FragColor.a *= edgeAlpha;\n#endif\n\nif (edgeAlpha == 0.0) {\n discard;\n}\n",customRewriter({vertexShader:e,fragmentShader:t}){let r=/\buniform\s+vec3\s+diffuse\b/;return r.test(t)&&(t=t.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),r.test(e)||(e=e.replace(ji,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:e,fragmentShader:t}}});return t.transparent=!0,Object.defineProperties(t,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),t}(r),r.addEventListener("dispose",(function e(){r.removeEventListener("dispose",e),t.dispose()}))),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let e=t._outlineMtl;return e||(e=t._outlineMtl=Object.create(t,{id:{value:t.id+.1}}),e.isTextOutlineMaterial=!0,e.depthWrite=!1,e.map=null,t.addEventListener("dispose",(function r(){t.removeEventListener("dispose",r),e.dispose()}))),[e,t]}return t}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return c(this.material).getDepthMaterial()}get customDistanceMaterial(){return c(this.material).getDistanceMaterial()}_prepareForRender(e){const a=e.isTextOutlineMaterial,c=e.uniforms,u=this.textRenderInfo;if(u){const{sdfTexture:e,blockBounds:r}=u;c.uTroikaSDFTexture.value=e,c.uTroikaSDFTextureSize.value.set(e.image.width,e.image.height),c.uTroikaSDFGlyphSize.value=u.sdfGlyphSize,c.uTroikaSDFExponent.value=u.sdfExponent,c.uTroikaTotalBounds.value.fromArray(r),c.uTroikaUseGlyphColors.value=!a&&!!u.glyphColors;let n,i,s,o=0,l=0,h=0,d=0,p=0;if(a){let{outlineWidth:e,outlineOffsetX:t,outlineOffsetY:r,outlineBlur:i,outlineOpacity:a}=this;o=this._parsePercent(e)||0,l=Math.max(0,this._parsePercent(i)||0),n=a,d=this._parsePercent(t)||0,p=this._parsePercent(r)||0}else h=Math.max(0,this._parsePercent(this.strokeWidth)||0),h&&(s=this.strokeColor,c.uTroikaStrokeColor.value.set(null==s?t:s),i=this.strokeOpacity,null==i&&(i=1)),n=this.fillOpacity;c.uTroikaDistanceOffset.value=o,c.uTroikaPositionOffset.value.set(d,p),c.uTroikaBlurRadius.value=l,c.uTroikaStrokeWidth.value=h,c.uTroikaStrokeOpacity.value=i,c.uTroikaFillOpacity.value=null==n?1:n,c.uTroikaCurveRadius.value=this.curveRadius||0;let f=this.clipRect;if(f&&Array.isArray(f)&&4===f.length)c.uTroikaClipRect.value.fromArray(f);else{const e=100*(this.fontSize||.1);c.uTroikaClipRect.value.set(r[0]-e,r[1]-e,r[2]+e,r[3]+e)}this.geometry.applyClipRect(c.uTroikaClipRect.value)}c.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const h=a?this.outlineColor||0:this.color;if(null==h)delete e.color;else{const t=e.hasOwnProperty("color")?e.color:e.color=new s.Color;h===t._input&&"object"!=typeof h||t.set(t._input=h)}let d=this.orientation||l;if(d!==e._orientation){let t=c.uTroikaOrient.value;d=d.replace(/[^-+xyz]/g,"");let a=d!==l&&d.match(/^([-+])([xyz])([-+])([xyz])$/);if(a){let[,e,s,l,c]=a;n.set(0,0,0)[s]="-"===e?1:-1,i.set(0,0,0)[c]="-"===l?-1:1,r.lookAt(o,n.cross(i),i),t.setFromMatrix4(r)}else t.identity();e._orientation=d}}_parsePercent(e){if("string"==typeof e){let t=e.match(/^(-?[\d.]+)%$/),r=t?parseFloat(t[1]):NaN;e=(isNaN(r)?0:r/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new s.Vector2){t.copy(e);const r=this.curveRadius;return r&&(t.x=Math.atan2(e.x,Math.abs(r)-Math.abs(e.z))*Math.abs(r)),t}worldPositionToTextCoords(e,t=new s.Vector2){return n.copy(e),this.localPositionToTextCoords(this.worldToLocal(n),t)}raycast(e,t){const{textRenderInfo:r,curveRadius:n}=this;if(r){const i=r.blockBounds,s=n?h():u(),o=s.geometry,{position:l,uv:c}=o.attributes;for(let e=0;e<c.count;e++){let t=i[0]+c.getX(e)*(i[2]-i[0]);const r=i[1]+c.getY(e)*(i[3]-i[1]);let a=0;n&&(a=n-Math.cos(t/n)*n,t=Math.sin(t/n)*n),l.setXYZ(e,t,r,a)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,s.matrixWorld=this.matrixWorld,s.material.side=this.material.side,a.length=0,s.raycast(e,a);for(let e=0;e<a.length;e++)a[e].object=this,t.push(a[e])}}copy(e){const t=this.geometry;return super.copy(e),this.geometry=t,m.forEach((t=>{this[t]=e[t]})),this}clone(){return(new this.constructor).copy(this)}}f.forEach((e=>{const t="_private_"+e;Object.defineProperty(g.prototype,e,{get(){return this[t]},set(e){e!==this[t]&&(this[t]=e,this._needsSync=!0)}})}));let v=!1;return Object.defineProperty(g.prototype,"anchor",{get(){return this._deprecated_anchor},set(e){this._deprecated_anchor=e,v||(console.warn("TextMesh: `anchor` has been deprecated; use `anchorX` and `anchorY` instead."),v=!0),Array.isArray(e)?(this.anchorX=100*(+e[0]||0)+"%",this.anchorY=100*(+e[1]||0)+"%"):this.anchorX=this.anchorY=0}}),g})();new WeakMap;new WeakMap;function Ma(e,t,r=((e,t)=>e===t)){if(e===t)return!0;if(!e||!t)return!1;const n=e.length;if(t.length!==n)return!1;for(let i=0;i<n;i++)if(!r(e[i],t[i]))return!1;return!0}const _a=[];function Ta(e,t,r=!1,n={}){for(const a of _a)if(Ma(t,a.keys,a.equal)){if(r)return;if(Object.prototype.hasOwnProperty.call(a,"error"))throw a.error;if(Object.prototype.hasOwnProperty.call(a,"response"))return a.response;if(!r)throw a.promise}const i={keys:t,equal:n.equal,promise:e(...t).then((e=>i.response=e)).then((()=>{n.lifespan&&n.lifespan>0&&setTimeout((()=>{const e=_a.indexOf(i);-1!==e&&_a.splice(e,1)}),n.lifespan)})).catch((e=>i.error=e))};if(_a.push(i),!r)throw i.promise}const Ca=(e,t,r)=>Ta(e,t,!1,r),Ia=i.forwardRef((({anchorX:e="center",anchorY:t="middle",font:r,children:a,characters:s,onSync:l,...c},u)=>{const h=(0,o.useThree)((({invalidate:e})=>e)),[d]=i.useState((()=>new Sa)),[p,f]=i.useMemo((()=>{const e=[];let t="";return i.Children.forEach(a,(r=>{"string"==typeof r||"number"==typeof r?t+=r:e.push(r)})),[e,t]}),[a]);return Ca((()=>new Promise((e=>function({font:e,characters:t,sdfGlyphSize:r},n){ga({font:e,sdfGlyphSize:r,text:Array.isArray(t)?t.join("\n"):""+t},n)}({font:r,characters:s},e)))),["troika-text",r,s]),i.useLayoutEffect((()=>{d.sync((()=>{h(),l&&l(d)}))})),i.useEffect((()=>()=>d.dispose()),[d]),i.createElement("primitive",n({object:d,ref:u,font:r,text:f,anchorX:e,anchorY:t},c),p)}));var Ba=r(8064),Ra=r(48197),Pa=r(6073),Fa=r(60809);(0,o.extend)({EffectComposer:Ba.x,RenderPass:Ra.C,ShaderPass:Pa.T});const La=()=>{try{var e=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!e.getContext("webgl2"))}catch(Ha){return!1}},Da=i.forwardRef((({children:e,multisamping:t=8,renderIndex:r=1,disableGamma:a=!1,disableRenderPass:l=!1,...c},u)=>{const h=i.useRef(),d=(0,o.useThree)((({scene:e})=>e)),p=(0,o.useThree)((({camera:e})=>e)),f=(0,o.useThree)((({gl:e})=>e)),m=(0,o.useThree)((({size:e})=>e)),[g]=i.useState((()=>{if(La()&&t>0){const e=new s.WebGLRenderTarget(m.width,m.height,{format:s.RGBAFormat,encoding:s.sRGBEncoding});return e.samples=8,e}}));return i.useEffect((()=>{var e,t;null==(e=h.current)||e.setSize(m.width,m.height),null==(t=h.current)||t.setPixelRatio(f.getPixelRatio())}),[f,m]),(0,o.useFrame)((()=>{var e;return null==(e=h.current)?void 0:e.render()}),r),i.createElement("effectComposer",n({ref:_([u,h]),args:[f,g]},c),!l&&i.createElement("renderPass",{attachArray:"passes",args:[d,p]}),!a&&i.createElement("shaderPass",{attachArray:"passes",args:[Fa.Y]}),e)}));function Ua({stops:e,colors:t,size:r=1024,...a}){const l=(0,o.useThree)((e=>e.gl)),c=i.useMemo((()=>{const n=document.createElement("canvas"),i=n.getContext("2d");n.width=16,n.height=r;const a=i.createLinearGradient(0,0,0,r);let o=e.length;for(;o--;)a.addColorStop(e[o],t[o]);i.fillStyle=a,i.fillRect(0,0,16,r);const l=new s.Texture(n);return l.needsUpdate=!0,l}),[e]);return i.useEffect((()=>()=>{c.dispose()}),[c]),i.createElement("primitive",n({object:c,attach:"map",encoding:l.outputEncoding},a))}function Na(e,t,r,n){return class extends s.ShaderMaterial{constructor(){const i=Object.entries(e);super({uniforms:i.reduce(((e,[t,r])=>({...e,...s.UniformsUtils.clone({[t]:{value:r}})})),{}),vertexShader:t,fragmentShader:r}),i.forEach((([e])=>Object.defineProperty(this,e,{get:()=>this.uniforms[e].value,set:t=>this.uniforms[e].value=t}))),n&&n(this)}}}const ka=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function Oa(e){const t=(0,o.useThree)((e=>e.gl)),r=(0,o.useLoader)(s.TextureLoader,ka(e)?Object.values(e):e);if((0,i.useEffect)((()=>{(Array.isArray(r)?r:[r]).forEach(t.initTexture)}),[t,r]),ka(e)){const t=Object.keys(e),n={};return t.forEach((e=>Object.assign(n,{[e]:r[t.indexOf(e)]}))),n}return r}Oa.preload=e=>o.useLoader.preload(s.TextureLoader,e),Oa.clear=e=>o.useLoader.clear(s.TextureLoader,e);const Ga=Na({color:new s.Color("white"),scale:[1,1],imageBounds:[1,1],map:null,zoom:1,grayscale:0},"\n varying vec2 vUv;\n void main() {\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.);\n vUv = uv;\n }\n","\n // mostly from https://gist.github.com/statico/df64c5d167362ecf7b34fca0b1459a44\n varying vec2 vUv;\n uniform vec2 scale;\n uniform vec2 imageBounds;\n uniform vec3 color;\n uniform sampler2D map;\n uniform float zoom;\n uniform float grayscale;\n const vec3 luma = vec3(.299, 0.587, 0.114);\n vec4 toGrayscale(vec4 color, float intensity) {\n return vec4(mix(color.rgb, vec3(dot(color.rgb, luma)), intensity), color.a);\n }\n vec2 aspect(vec2 size) {\n return size / min(size.x, size.y);\n }\n void main() {\n vec2 s = aspect(scale);\n vec2 i = aspect(imageBounds);\n float rs = s.x / s.y;\n float ri = i.x / i.y;\n vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x);\n vec2 offset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new;\n vec2 uv = vUv * s / new + offset;\n vec2 zUv = (uv - vec2(0.5, 0.5)) / zoom + vec2(0.5, 0.5);\n gl_FragColor = toGrayscale(texture2D(map, zUv) * vec4(color, 1.0), grayscale);\n \n #include <tonemapping_fragment>\n #include <encodings_fragment>\n }\n"),za=i.forwardRef((({children:e,color:t,segments:r=1,scale:a=1,zoom:s=1,grayscale:l=0,url:c,toneMapped:u,...h},d)=>{(0,o.extend)({ImageMaterial:Ga});const p=Oa(c),f=Array.isArray(a)?[a[0],a[1]]:[a,a],m=[p.image.width,p.image.height];return i.createElement("mesh",n({ref:d,scale:a},h),i.createElement("planeGeometry",{args:[1,1,r,r]}),i.createElement("imageMaterial",{color:t,map:p,zoom:s,grayscale:l,scale:f,imageBounds:m,toneMapped:u}),e)}));function Va({userData:e,children:t,geometry:r,threshold:a=15,color:o="black",...l}){const c=i.useRef(null);return i.useLayoutEffect((()=>{const e=c.current.parent;if(e){const t=r||e.geometry;t===c.current.userData.currentGeom&&a===c.current.userData.currentThreshold||(c.current.userData.currentGeom=t,c.current.userData.currentThreshold=a,c.current.geometry=new s.EdgesGeometry(t,a))}})),i.createElement("lineSegments",n({ref:c,raycast:()=>null},l),t||i.createElement("lineBasicMaterial",{color:o}))}function Ha(e,t){const r=new s.Matrix4,n=new s.Ray,i=new s.Sphere,a=new s.Vector3,o=this.geometry;if(i.copy(o.boundingSphere),i.applyMatrix4(this.matrixWorld),!1===e.ray.intersectSphere(i,a))return;r.copy(this.matrixWorld).invert(),n.copy(e.ray).applyMatrix4(r);const l=new s.Vector3,c=new s.Vector3,u=new s.Vector3,h=this instanceof s.LineSegments?2:1,d=o.index,p=o.attributes;if(null!==d){const r=d.array,i=p.position.array,s=p.width.array;for(let o=0,d=r.length-1;o<d;o+=h){const h=r[o],p=r[o+1];l.fromArray(i,3*h),c.fromArray(i,3*p);const f=null!=s[Math.floor(o/3)]?s[Math.floor(o/3)]:1,m=e.params.Line.threshold+this.material.lineWidth*f/2,g=m*m;if(n.distanceSqToSegment(l,c,a,u)>g)continue;a.applyMatrix4(this.matrixWorld);const v=e.ray.origin.distanceTo(a);v<e.near||v>e.far||(t.push({distance:v,point:u.clone().applyMatrix4(this.matrixWorld),index:o,face:null,faceIndex:null,object:this}),o=d)}}}function Qa(e,t,r,n,i){let a;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=t?e.subarray?e.subarray(t,i&&t+i):e.slice(t,i&&t+i):e,r.set)r.set(e,n);else for(a=0;a<e.length;a++)r[a+n]=e[a];return r}class ja extends s.BufferGeometry{constructor(){super(),this.type="MeshLine",this.isMeshLine=!0,this.positions=[],this.raycast=Ha,this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new s.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get(){return this}},geom:{enumerable:!0,get(){return this._geom},set(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get(){return this._points},set(e){this.setPoints(e,this.widthCallback)}}})}setMatrixWorld(e){this.matrixWorld=e}setGeometry(e,t){this._geometry=e,e instanceof s.BufferGeometry?this.setPoints(e.getAttribute("position").array,t):this.setPoints(e,t)}setPoints(e,t){if(e instanceof Float32Array||e instanceof Array){if(this._points=e,this.widthCallback=t,this.positions=[],this.counters=[],e.length&&e[0]instanceof s.Vector3)for(var r=0;r<e.length;r++){const t=e[r];var n=r/e.length;this.positions.push(t.x,t.y,t.z),this.positions.push(t.x,t.y,t.z),this.counters.push(n),this.counters.push(n)}else for(r=0;r<e.length;r+=3)n=r/e.length,this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(n),this.counters.push(n);this.process()}else console.error("ERROR: The BufferArray of points is not instancied correctly.")}compareV3(e,t){const r=6*e,n=6*t;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]}copyV3(e){const t=6*e;return[this.positions[t],this.positions[t+1],this.positions[t+2]]}process(){const e=this.positions.length/6;let t,r;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],r=this.compareV3(0,e-1)?this.copyV3(e-2):this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(let n=0;n<e;n++){if(this.side.push(1),this.side.push(-1),t=this.widthCallback?this.widthCallback(n/(e-1)):1,this.width.push(t),this.width.push(t),this.uvs.push(n/(e-1),0),this.uvs.push(n/(e-1),1),n<e-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);const e=2*n;this.indices_array.push(e,e+1,e+2),this.indices_array.push(e+2,e+1,e+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}r=this.compareV3(e-1,0)?this.copyV3(1):this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),this._attributes&&this._attributes.position.count===this.positions.length?(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0):this._attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)},this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()}advance({x:e,y:t,z:r}){const n=this._attributes.position.array,i=this._attributes.previous.array,a=this._attributes.next.array,s=n.length;Qa(n,0,i,0,s),Qa(n,6,n,0,s-6),n[s-6]=e,n[s-5]=t,n[s-4]=r,n[s-3]=e,n[s-2]=t,n[s-1]=r,Qa(n,6,a,0,s-6),a[s-6]=e,a[s-5]=t,a[s-4]=r,a[s-3]=e,a[s-2]=t,a[s-1]=r,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0}}s.ShaderChunk.meshline_vert=["","#include <common>","",s.ShaderChunk.logdepthbuf_pars_vertex,s.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;","\t vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",s.ShaderChunk.logdepthbuf_vertex,s.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",s.ShaderChunk.fog_vertex,"}"].join("\n"),s.ShaderChunk.meshline_frag=["",s.ShaderChunk.fog_pars_fragment,s.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",s.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",s.ShaderChunk.fog_fragment,"}"].join("\n");class Wa extends s.ShaderMaterial{constructor(e){super({uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new s.Vector2(1,1)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get(){return this.uniforms.lineWidth.value},set(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get(){return this.uniforms.map.value},set(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get(){return this.uniforms.useMap.value},set(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get(){return this.uniforms.alphaMap.value},set(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get(){return this.uniforms.useAlphaMap.value},set(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get(){return this.uniforms.color.value},set(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get(){return this.uniforms.opacity.value},set(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get(){return this.uniforms.resolution.value},set(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get(){return this.uniforms.sizeAttenuation.value},set(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get(){return this.uniforms.dashArray.value},set(e){this.uniforms.dashArray.value=e,this.useDash=0!==e?1:0}},dashOffset:{enumerable:!0,get(){return this.uniforms.dashOffset.value},set(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get(){return this.uniforms.dashRatio.value},set(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get(){return this.uniforms.useDash.value},set(e){this.uniforms.useDash.value=e}},visibility:{enumerable:!0,get(){return this.uniforms.visibility.value},set(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get(){return this.uniforms.alphaTest.value},set(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get(){return this.uniforms.repeat.value},set(e){this.uniforms.repeat.value.copy(e)}}}),this.setValues(e)}copy(e){return super.copy(e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this}}const Xa={width:.2,length:1,decay:1,local:!1,stride:0,interval:1},Ya=(e,t=1)=>(e.set(e.subarray(t)),e.fill(-1/0,-t),e);function qa(e,t){const{length:r,local:n,decay:a,interval:l,stride:c}={...Xa,...t},u=i.useRef(),[h]=i.useState((()=>new s.Vector3));i.useLayoutEffect((()=>{e&&(u.current=Float32Array.from({length:10*r*3},((t,r)=>e.position.getComponent(r%3))))}),[r,e]);const d=i.useRef(new s.Vector3),p=i.useRef(0);return(0,o.useFrame)((()=>{if(e&&u.current){if(0===p.current){let t;n?t=e.position:(e.getWorldPosition(h),t=h);const r=1*a;for(let e=0;e<r;e++)t.distanceTo(d.current)<c||(Ya(u.current,3),u.current.set(t.toArray(),u.current.length-3));d.current.copy(t)}p.current++,p.current=p.current%l}})),u}const Ka=i.forwardRef(((e,t)=>{const{children:r}=e,{width:n,length:a,decay:l,local:c,stride:u,interval:h}={...Xa,...e},{color:d="hotpink",attenuation:p,target:f}=e,m=(0,o.useThree)((e=>e.size)),g=i.useRef(null),[v,A]=i.useState(null),y=qa(v,{length:a,decay:l,local:c,stride:u,interval:h});i.useEffect((()=>{const e=(null==f?void 0:f.current)||g.current.children.find((e=>e instanceof s.Object3D));e&&A(e)}),[y,f]);const x=i.useMemo((()=>new ja),[]),b=i.useMemo((()=>{var e;const t=new Wa({lineWidth:.1*n,color:d,sizeAttenuation:1,resolution:new s.Vector2(m.width,m.height)});let i;if(r)if(Array.isArray(r))i=r.find((e=>{const t=e;return"string"==typeof t.type&&"meshLineMaterial"===t.type}));else{const e=r;"string"==typeof e.type&&"meshLineMaterial"===e.type&&(i=e)}return"object"==typeof(null==(e=i)?void 0:e.props)&&t.setValues(i.props),t}),[n,d,m,r]);return i.useEffect((()=>{b.uniforms.resolution.value.set(m.width,m.height)}),[m]),(0,o.useFrame)((()=>{y.current&&x.setPoints(y.current,p)})),i.createElement("group",null,i.createElement("mesh",{ref:t,geometry:x,material:b}),i.createElement("group",{ref:g},r))}));var Ja=r(96272);const Za=({children:e,weight:t,transform:r,instances:a,mesh:o,...l})=>{const c=i.useRef(null),u=i.useRef(null),h=i.useRef(null);return i.useEffect((()=>{var e,t;u.current=null!==(e=null==a?void 0:a.current)&&void 0!==e?e:c.current.children.find((e=>e.hasOwnProperty("instanceMatrix"))),h.current=null!==(t=null==o?void 0:o.current)&&void 0!==t?t:c.current.children.find((e=>"Mesh"===e.type))}),[e,null==o?void 0:o.current,null==a?void 0:a.current]),i.useEffect((()=>{if(void 0===h.current)return;if(void 0===u.current)return;const e=new Ja.a(h.current);t&&e.setWeightAttribute(t),e.build();const n=new s.Vector3,i=new s.Vector3,a=new s.Color,o=new s.Object3D;h.current.updateMatrixWorld(!0);for(let t=0;t<u.current.count;t++)e.sample(n,i,a),"function"==typeof r?r({dummy:o,sampledMesh:h.current,position:n,normal:i,color:a},t):o.position.copy(n),o.updateMatrix(),u.current.setMatrixAt(t,o.matrix);u.current.instanceMatrix.needsUpdate=!0}),[e,null==o?void 0:o.current,null==a?void 0:a.current]),i.createElement("group",n({ref:c},l),e)},$a=({compute:e,name:t,...r})=>{const[a]=i.useState((()=>new s.BufferAttribute(new Float32Array(0),1))),o=i.useRef(null);return i.useLayoutEffect((()=>{if(o.current){var t;const r=null!==(t=o.current.parent)&&void 0!==t?t:o.current.__r3f.parent,n=e(r);o.current.copy(n)}}),[e]),i.createElement("primitive",n({ref:o,object:a,attachObject:["attributes",t]},r))};var es=r(25030),ts=r.n(es);function rs(e,{keys:t=["near","far","color","distance","decay","penumbra","angle","intensity","skeleton","visible","castShadow","receiveShadow","morphTargetDictionary","morphTargetInfluences","name","geometry","material","position","rotation","scale","up","userData"],deep:r,inject:n,castShadow:a,receiveShadow:s}){let o=ts()(e,t);return r&&(o.geometry&&"materialsOnly"!==r&&(o.geometry=o.geometry.clone()),o.material&&"geometriesOnly"!==r&&(o.material=o.material.clone())),n&&(o="function"==typeof n?{...o,children:n(e)}:i.isValidElement(n)?{...o,children:n}:{...o,...n}),"Mesh"===e.type&&(a&&(o.castShadow=!0),s&&(o.receiveShadow=!0)),o}const ns=i.forwardRef((({object:e,children:t,deep:r,castShadow:a,receiveShadow:s,inject:o,keys:l,...c},u)=>{const h={keys:l,deep:r,inject:o,castShadow:a,receiveShadow:s};if(Array.isArray(e))return i.createElement("group",n({},c,{ref:u}),e.map((e=>i.createElement(ns,n({key:e.uuid,object:e},h)))),t);const{children:d,...p}=rs(e,h),f=e.type[0].toLowerCase()+e.type.slice(1);return i.createElement(f,n({},p,c,{ref:u}),(null==e?void 0:e.children).map((e=>{let t={},r=e.type[0].toLowerCase()+e.type.slice(1);return"group"===r||"object3D"===r?(r=ns,t={object:e,...h}):t=rs(e,h),i.createElement(r,n({key:e.uuid},t))})),t,d)})),is=i.forwardRef((({makeDefault:e,...t},r)=>{const a=(0,o.useThree)((({set:e})=>e)),s=(0,o.useThree)((({camera:e})=>e)),l=(0,o.useThree)((({size:e})=>e)),c=i.useRef();return i.useLayoutEffect((()=>{c.current&&!t.manual&&c.current.updateProjectionMatrix()}),[l,t]),i.useLayoutEffect((()=>{if(e&&c.current){const e=s;return a((()=>({camera:c.current}))),()=>a((()=>({camera:e})))}}),[s,c,e,a]),i.createElement("orthographicCamera",n({left:l.width/-2,right:l.width/2,top:l.height/2,bottom:l.height/-2,ref:_([c,r])},t))})),as=i.forwardRef((({makeDefault:e,...t},r)=>{const a=(0,o.useThree)((({set:e})=>e)),s=(0,o.useThree)((({camera:e})=>e)),l=(0,o.useThree)((({size:e})=>e)),c=i.useRef();return i.useLayoutEffect((()=>{const{current:e}=c;e&&!t.manual&&(e.aspect=l.width/l.height,e.updateProjectionMatrix())}),[l,t]),i.useLayoutEffect((()=>{if(e&&c.current){const e=s;return a((()=>({camera:c.current}))),()=>a((()=>({camera:e})))}}),[s,c,e,a]),i.createElement("perspectiveCamera",n({ref:_([c,r])},t))}));function ss({children:e,fog:t,frames:r=1/0,resolution:n=256,near:a=1,far:l=1e3,...c}){const u=i.useRef(),[h,d]=i.useState(),p=(0,o.useThree)((({scene:e})=>e)),f=(0,o.useThree)((({gl:e})=>e)),m=i.useMemo((()=>{const e=new s.WebGLCubeRenderTarget(n);return e.texture.type=s.HalfFloatType,e}),[n]);let g=0;return(0,o.useFrame)((()=>{if(h&&u.current&&(r===1/0||g<r)){u.current.traverse((e=>e.visible=!1));const e=p.fog;p.fog=t||e,h.update(f,p),p.fog=e,u.current.traverse((e=>e.visible=!0)),g++}})),i.createElement("group",c,i.createElement("cubeCamera",{ref:d,args:[a,l,m]}),i.createElement("group",{ref:u},e(m.texture)))}var os=r(41743);const ls=i.forwardRef(((e,t)=>{const{camera:r,onChange:a,...s}=e,l=(0,o.useThree)((e=>e.camera)),c=(0,o.useThree)((e=>e.invalidate)),u=r||l,[h]=i.useState((()=>new os.W(u)));return i.useEffect((()=>{const e=e=>{c(),a&&a(e)};return null==h||null==h.addEventListener||h.addEventListener("change",e),()=>null==h||null==h.removeEventListener?void 0:h.removeEventListener("change",e)}),[a,h,c]),(0,o.useFrame)((()=>null==h?void 0:h.update())),i.useEffect((()=>{const e=h;return null==e||e.connect(),()=>null==e?void 0:e.dispose()}),[h]),h?i.createElement("primitive",n({ref:t,dispose:void 0,object:h},s)):null}));var cs=r(32044);const us=i.forwardRef(((e,t)=>{const{onChange:r,...a}=e,s=(0,o.useThree)((({invalidate:e})=>e)),l=(0,o.useThree)((({camera:e})=>e)),c=(0,o.useThree)((({gl:e})=>e)),[u]=i.useState((()=>new cs.m(l,c.domElement)));return i.useEffect((()=>{const e=e=>{s(),r&&r(e)};return null==u||null==u.addEventListener||u.addEventListener("change",e),()=>null==u||null==u.removeEventListener?void 0:u.removeEventListener("change",e)}),[r,u,s]),(0,o.useFrame)(((e,t)=>null==u?void 0:u.update(t))),u?i.createElement("primitive",n({ref:t,dispose:void 0,object:u},a)):null}));var hs=r(22227);const ds=i.forwardRef(((e={enableDamping:!0},t)=>{const{camera:r,onChange:a,onStart:s,onEnd:l,...c}=e,u=(0,o.useThree)((({invalidate:e})=>e)),h=(0,o.useThree)((({camera:e})=>e)),d=(0,o.useThree)((({gl:e})=>e.domElement)),p=r||h,f=i.useMemo((()=>new hs.o(p)),[p]);return i.useEffect((()=>{f.connect(d);const e=e=>{u(),a&&a(e)};return f.addEventListener("change",e),s&&f.addEventListener("start",s),l&&f.addEventListener("end",l),()=>{f.dispose(),f.removeEventListener("change",e),s&&f.removeEventListener("start",s),l&&f.removeEventListener("end",l)}}),[a,s,l,f,u,d]),(0,o.useFrame)((()=>f.update())),i.createElement("primitive",n({ref:t,dispose:void 0,object:f,enableDamping:!0},c))})),ps=i.forwardRef((({makeDefault:e,camera:t,regress:r,domElement:a,enableDamping:s=!0,onChange:l,onStart:c,onEnd:u,...h},d)=>{const p=(0,o.useThree)((e=>e.invalidate)),f=(0,o.useThree)((e=>e.camera)),m=(0,o.useThree)((e=>e.gl)),g=(0,o.useThree)((e=>e.events)),v=(0,o.useThree)((e=>e.set)),A=(0,o.useThree)((e=>e.get)),y=(0,o.useThree)((e=>e.performance)),x=t||f,b=a||g.connected||m.domElement,w=i.useMemo((()=>new hs.z(x)),[x]);return(0,o.useFrame)((()=>{w.enabled&&w.update()})),i.useEffect((()=>(w.connect(b),()=>{w.dispose()})),[b,r,w,p]),i.useEffect((()=>{const e=e=>{p(),r&&y.regress(),l&&l(e)};return w.addEventListener("change",e),c&&w.addEventListener("start",c),u&&w.addEventListener("end",u),()=>{c&&w.removeEventListener("start",c),u&&w.removeEventListener("end",u),w.removeEventListener("change",e)}}),[l,c,u]),i.useEffect((()=>{if(e){const e=A().controls;return v({controls:w}),()=>v({controls:e})}}),[e,w]),i.createElement("primitive",n({ref:d,object:w,enableDamping:s},h))}));var fs=r(7703);const ms=i.forwardRef((({makeDefault:e,camera:t,domElement:r,regress:a,onChange:s,onStart:l,onEnd:c,...u},h)=>{const{invalidate:d,camera:p,gl:f,events:m,set:g,get:v,performance:A,viewport:y}=(0,o.useThree)(),x=t||p,b=r||m.connected||f.domElement,w=i.useMemo((()=>new fs.$(x)),[x]);return(0,o.useFrame)((()=>{w.enabled&&w.update()})),i.useEffect((()=>(w.connect(b),()=>{w.dispose()})),[b,a,w,d]),i.useEffect((()=>{const e=e=>{d(),a&&A.regress(),s&&s(e)};return w.addEventListener("change",e),l&&w.addEventListener("start",l),c&&w.addEventListener("end",c),()=>{l&&w.removeEventListener("start",l),c&&w.removeEventListener("end",c),w.removeEventListener("change",e)}}),[s,l,c]),i.useEffect((()=>{w.handleResize()}),[y]),i.useEffect((()=>{if(e){const e=v().controls;return g({controls:w}),()=>g({controls:e})}}),[e,w]),i.createElement("primitive",n({ref:h,object:w},u))}));var gs=r(1687);const vs=(0,i.forwardRef)((({camera:e,makeDefault:t,regress:r,domElement:a,onChange:s,onStart:l,onEnd:c,...u},h)=>{const d=(0,o.useThree)((e=>e.invalidate)),p=(0,o.useThree)((e=>e.camera)),f=(0,o.useThree)((e=>e.gl)),m=(0,o.useThree)((e=>e.events)),g=(0,o.useThree)((e=>e.set)),v=(0,o.useThree)((e=>e.get)),A=(0,o.useThree)((e=>e.performance)),y=e||p,x=a||m.connected||f.domElement,b=(0,i.useMemo)((()=>new gs.A(y)),[y]);return(0,o.useFrame)((()=>{b.enabled&&b.update()})),(0,i.useEffect)((()=>(b.connect(x),()=>{b.dispose()})),[x,r,b,d]),(0,i.useEffect)((()=>{const e=e=>{d(),r&&A.regress(),s&&s(e)};return b.addEventListener("change",e),l&&b.addEventListener("start",l),c&&b.addEventListener("end",c),()=>{b.removeEventListener("change",e),l&&b.removeEventListener("start",l),c&&b.removeEventListener("end",c)}}),[s,l,c]),(0,i.useEffect)((()=>{if(t){const e=v().controls;return g({controls:b}),()=>g({controls:e})}}),[t,b]),i.createElement("primitive",n({ref:h,object:b},u))}));var As=r(76427),ys=r.n(As),xs=r(35041);const bs=i.forwardRef((({children:e,domElement:t,onChange:r,onMouseDown:a,onMouseUp:l,onObjectChange:c,object:u,...h},d)=>{const p=["enabled","axis","mode","translationSnap","rotationSnap","scaleSnap","space","size","showX","showY","showZ"],{camera:f,...m}=h,g=ts()(m,p),v=ys()(m,p),A=(0,o.useThree)((e=>e.controls)),y=(0,o.useThree)((e=>e.gl)),x=(0,o.useThree)((e=>e.events)),b=(0,o.useThree)((e=>e.camera)),w=(0,o.useThree)((e=>e.invalidate)),E=f||b,S=t||x.connected||y.domElement,M=i.useMemo((()=>new xs.Ys(E,S)),[E,S]),_=i.useRef();return i.useLayoutEffect((()=>(u?M.attach(u instanceof s.Object3D?u:u.current):_.current instanceof s.Object3D&&M.attach(_.current),()=>{M.detach()})),[u,e,M]),i.useEffect((()=>{if(A){const e=e=>A.enabled=!e.value;return M.addEventListener("dragging-changed",e),()=>M.removeEventListener("dragging-changed",e)}}),[M,A]),i.useEffect((()=>{const e=e=>{w(),r&&r(e)};return null==M||null==M.addEventListener||M.addEventListener("change",e),a&&(null==M||null==M.addEventListener||M.addEventListener("mouseDown",a)),l&&(null==M||null==M.addEventListener||M.addEventListener("mouseUp",l)),c&&(null==M||null==M.addEventListener||M.addEventListener("objectChange",c)),()=>{null==M||null==M.removeEventListener||M.removeEventListener("change",e),a&&(null==M||null==M.removeEventListener||M.removeEventListener("mouseDown",a)),l&&(null==M||null==M.removeEventListener||M.removeEventListener("mouseUp",l)),c&&(null==M||null==M.removeEventListener||M.removeEventListener("objectChange",c))}}),[r,a,l,c,M,w]),M?i.createElement(i.Fragment,null,i.createElement("primitive",n({ref:d,dispose:void 0,object:M},g)),i.createElement("group",n({ref:_},v),e)):null}));var ws=r(2679);const Es=i.forwardRef((({domElement:e,selector:t,onChange:r,onLock:a,onUnlock:s,enabled:l=!0,...c},u)=>{const{camera:h,...d}=c,p=(0,o.useThree)((({gl:e})=>e)),f=(0,o.useThree)((e=>e.camera)),m=(0,o.useThree)((e=>e.invalidate)),g=(0,o.useThree)((e=>e.raycaster)),v=(0,o.useThree)((e=>e.events)),A=h||f,y=e||v.connected||p.domElement,[x]=i.useState((()=>new ws.q(A)));return i.useEffect((()=>{if(l){x.connect(y);const e=g.computeOffsets;return g.computeOffsets=e=>({offsetX:e.target.width/2,offsetY:e.target.height/2}),()=>{x.disconnect(),g.computeOffsets=e}}}),[l,x]),i.useEffect((()=>{const e=e=>{m(),r&&r(e)};x.addEventListener("change",e),a&&x.addEventListener("lock",a),s&&x.addEventListener("unlock",s);const n=()=>x.lock(),i=t?Array.from(document.querySelectorAll(t)):[document];return i.forEach((e=>e&&e.addEventListener("click",n))),()=>{x.removeEventListener("change",e),a&&x.addEventListener("lock",a),s&&x.addEventListener("unlock",s),i.forEach((e=>e?e.removeEventListener("click",n):void 0))}}),[r,a,s,t]),i.createElement("primitive",n({ref:u,object:x},d))}));var Ss=r(55259);const Ms=i.forwardRef(((e,t)=>{const r=(0,o.useThree)((e=>e.camera)),a=(0,o.useThree)((e=>e.gl)),[s]=i.useState((()=>new Ss.o(r,a.domElement)));return(0,o.useFrame)(((e,t)=>{s.update(t)})),s?i.createElement("primitive",n({ref:t,object:s},e)):null}));function _s(e,t){const r=(0,o.useThree)((e=>e.mouse)),[n]=i.useState((()=>{const n=new s.Raycaster;return t&&(0,o.applyProps)(n,t,{}),function(t,i){n.setFromCamera(r,e instanceof s.Camera?e:e.current);const a=this.constructor.prototype.raycast.bind(this);a&&a(n,i)}}));return n}const Ts=i.createContext({}),Cs=()=>i.useContext(Ts),Is=2*Math.PI,Bs=new s.Object3D,Rs=new s.Matrix4,[Ps,Fs]=[new s.Quaternion,new s.Quaternion],Ls=new s.Vector3,Ds=new s.Vector3,Us=({alignment:e="bottom-right",margin:t=[80,80],renderPriority:r=0,autoClear:n=!0,onUpdate:a,onTarget:l,children:c})=>{const u=(0,o.useThree)((({size:e})=>e)),h=(0,o.useThree)((({camera:e})=>e)),d=(0,o.useThree)((({controls:e})=>e)),p=(0,o.useThree)((({gl:e})=>e)),f=(0,o.useThree)((({scene:e})=>e)),m=(0,o.useThree)((({invalidate:e})=>e)),g=i.useRef(),v=i.useRef(),A=i.useRef(null),[y]=i.useState((()=>new s.Scene)),x=i.useRef(!1),b=i.useRef(0),w=i.useRef(new s.Vector3(0,0,0)),E=i.useCallback((e=>{x.current=!0,(d||l)&&(w.current=(null==d?void 0:d.target)||(null==l?void 0:l())),b.current=h.position.distanceTo(Ls),Ps.copy(h.quaternion),Ds.copy(e).multiplyScalar(b.current).add(Ls),Bs.lookAt(Ds),Fs.copy(Bs.quaternion),m()}),[d,h,l,m]);i.useEffect((()=>(f.background&&(g.current=f.background,f.background=null,y.background=g.current),()=>{g.current&&(f.background=g.current)})),[]),(0,o.useFrame)(((e,t)=>{if(A.current&&v.current){var r;if(x.current)if(Ps.angleTo(Fs)<.01)x.current=!1;else{const e=t*Is;Ps.rotateTowards(Fs,e),h.position.set(0,0,1).applyQuaternion(Ps).multiplyScalar(b.current).add(w.current),h.up.set(0,1,0).applyQuaternion(Ps).normalize(),h.quaternion.copy(Ps),a?a():d&&d.update(),m()}Rs.copy(h.matrix).invert(),null==(r=v.current)||r.quaternion.setFromRotationMatrix(Rs),n&&(p.autoClear=!1),p.clearDepth(),p.render(y,A.current)}}),r);const S=_s(A),M=i.useMemo((()=>({tweenCamera:E,raycast:S})),[E]),[_,T]=t,C=e.endsWith("-left")?-u.width/2+_:u.width/2-_,I=e.startsWith("top-")?u.height/2-T:-u.height/2+T;return(0,o.createPortal)(i.createElement(Ts.Provider,{value:M},i.createElement(is,{ref:A,position:[0,0,200]}),i.createElement("group",{ref:v,position:[C,I,0]},c)),y)},Ns="#f0f0f0",ks="#999",Os="black",Gs="black",zs=["Right","Left","Top","Bottom","Front","Back"],Vs=e=>new s.Vector3(...e).multiplyScalar(.38),Hs=[[1,1,1],[1,1,-1],[1,-1,1],[1,-1,-1],[-1,1,1],[-1,1,-1],[-1,-1,1],[-1,-1,-1]].map(Vs),Qs=[.25,.25,.25],js=[[1,1,0],[1,0,1],[1,0,-1],[1,-1,0],[0,1,1],[0,1,-1],[0,-1,1],[0,-1,-1],[-1,1,0],[-1,0,1],[-1,0,-1],[-1,-1,0]].map(Vs),Ws=js.map((e=>e.toArray().map((e=>0==e?.5:.25)))),Xs=({hover:e,index:t,font:r="20px Inter var, Arial, sans-serif",faces:n=zs,color:a=Ns,hoverColor:l=ks,textColor:c=Os,strokeColor:u=Gs,opacity:h=1})=>{const d=(0,o.useThree)((e=>e.gl)),p=i.useMemo((()=>{const e=document.createElement("canvas");e.width=128,e.height=128;const i=e.getContext("2d");return i.fillStyle=a,i.fillRect(0,0,e.width,e.height),i.strokeStyle=u,i.strokeRect(0,0,e.width,e.height),i.font=r,i.textAlign="center",i.fillStyle=c,i.fillText(n[t].toUpperCase(),64,76),new s.CanvasTexture(e)}),[t,n,r,a,c,u]);return i.createElement("meshLambertMaterial",{map:p,"map-anisotropy":d.capabilities.getMaxAnisotropy()||1,attachArray:"material",color:e?l:"white",transparent:!0,opacity:h})},Ys=e=>{const{tweenCamera:t,raycast:r}=Cs(),[a,s]=i.useState(null);return i.createElement("mesh",{raycast:r,onPointerOut:e=>{e.stopPropagation(),s(null)},onPointerMove:e=>{e.stopPropagation(),s(Math.floor(e.faceIndex/2))},onClick:e.onClick||(e=>{e.stopPropagation(),t(e.face.normal)})},[...Array(6)].map(((t,r)=>i.createElement(Xs,n({key:r,index:r,hover:a===r},e)))),i.createElement("boxGeometry",null))},qs=({onClick:e,dimensions:t,position:r,hoverColor:n=ks})=>{const{tweenCamera:a,raycast:s}=Cs(),[o,l]=i.useState(!1);return i.createElement("mesh",{scale:1.01,position:r,raycast:s,onPointerOver:e=>{e.stopPropagation(),l(!0)},onPointerOut:e=>{e.stopPropagation(),l(!1)},onClick:e||(e=>{e.stopPropagation(),a(r)})},i.createElement("meshBasicMaterial",{color:o?n:"white",transparent:!0,opacity:.6,visible:o}),i.createElement("boxGeometry",{args:t}))},Ks=e=>i.createElement("group",{scale:[60,60,60]},i.createElement(Ys,e),js.map(((t,r)=>i.createElement(qs,n({key:r,position:t,dimensions:Ws[r]},e)))),Hs.map(((t,r)=>i.createElement(qs,n({key:r,position:t,dimensions:Qs},e)))),i.createElement("ambientLight",{intensity:.5}),i.createElement("pointLight",{position:[10,10,10],intensity:.5}));function Js({scale:e=[.8,.05,.05],color:t,rotation:r}){return i.createElement("group",{rotation:r},i.createElement("mesh",{position:[.4,0,0]},i.createElement("boxGeometry",{args:e}),i.createElement("meshBasicMaterial",{color:t,toneMapped:!1})))}function Zs({onClick:e,font:t,disabled:r,arcStyle:a,label:l,labelColor:c,axisHeadScale:u=1,...h}){const d=(0,o.useThree)((e=>e.gl)),p=i.useMemo((()=>{const e=document.createElement("canvas");e.width=64,e.height=64;const r=e.getContext("2d");return r.beginPath(),r.arc(32,32,16,0,2*Math.PI),r.closePath(),r.fillStyle=a,r.fill(),l&&(r.font=t,r.textAlign="center",r.fillStyle=c,r.fillText(l,32,41)),new s.CanvasTexture(e)}),[a,l,c,t]),[f,m]=i.useState(!1),g=(l?1:.75)*(f?1.2:1)*u;return i.createElement("sprite",n({scale:g,onPointerOver:r?void 0:e=>{e.stopPropagation(),m(!0)},onPointerOut:r?void 0:e||(e=>{e.stopPropagation(),m(!1)})},h),i.createElement("spriteMaterial",{map:p,"map-anisotropy":d.capabilities.getMaxAnisotropy()||1,alphaTest:.3,opacity:l?1:.75,toneMapped:!1}))}const $s=({hideNegativeAxes:e,hideAxisHeads:t,disabled:r,font:a="18px Inter var, Arial, sans-serif",axisColors:s=["#ff3653","#0adb50","#2c8fdf"],axisHeadScale:o=1,axisScale:l,labels:c=["X","Y","Z"],labelColor:u="#000",onClick:h,...d})=>{const[p,f,m]=s,{tweenCamera:g,raycast:v}=Cs(),A={font:a,disabled:r,labelColor:u,raycast:v,onClick:h,axisHeadScale:o,onPointerDown:r?void 0:e=>{g(e.object.position),e.stopPropagation()}};return i.createElement("group",n({scale:40},d),i.createElement(Js,{color:p,rotation:[0,0,0],scale:l}),i.createElement(Js,{color:f,rotation:[0,0,Math.PI/2],scale:l}),i.createElement(Js,{color:m,rotation:[0,-Math.PI/2,0],scale:l}),!t&&i.createElement(i.Fragment,null,i.createElement(Zs,n({arcStyle:p,position:[1,0,0],label:c[0]},A)),i.createElement(Zs,n({arcStyle:f,position:[0,1,0],label:c[1]},A)),i.createElement(Zs,n({arcStyle:m,position:[0,0,1],label:c[2]},A)),!e&&i.createElement(i.Fragment,null,i.createElement(Zs,n({arcStyle:p,position:[-1,0,0]},A)),i.createElement(Zs,n({arcStyle:f,position:[0,-1,0]},A)),i.createElement(Zs,n({arcStyle:m,position:[0,0,-1]},A)))),i.createElement("ambientLight",{intensity:.5}),i.createElement("pointLight",{position:[10,10,10],intensity:.5}))};function eo(e,{path:t}){const[r]=(0,o.useLoader)(s.CubeTextureLoader,[e],(e=>e.setPath(t)));return r}eo.preload=(e,{path:t})=>o.useLoader.preload(s.CubeTextureLoader,[e],(e=>e.setPath(t)));var to=r(43953);function ro(e){return(0,o.useLoader)(to.y,e)}ro.preload=e=>o.useLoader.preload(to.y,e),ro.clear=e=>o.useLoader.clear(to.y,e);var no=r(44976),io=r(46295),ao=r(17607);let so=null;function oo(e,t,r){return n=>{r&&r(n),e&&(so||(so=new no._),so.setDecoderPath("string"==typeof e?e:"https://www.gstatic.com/draco/versioned/decoders/1.4.3/"),n.setDRACOLoader(so)),t&&n.setMeshoptDecoder("function"==typeof io.z?(0,io.z)():io.z)}}function lo(e,t=!0,r=!0,n){return(0,o.useLoader)(ao.E,e,oo(t,r,n))}lo.preload=(e,t=!0,r=!0,n)=>o.useLoader.preload(ao.E,e,oo(t,r,n)),lo.clear=e=>o.useLoader.clear(ao.E,e);var co=r(28934);const uo="https://cdn.jsdelivr.net/gh/pmndrs/drei-assets@master";function ho(e,t=`${uo}/basis/`){const r=(0,o.useThree)((e=>e.gl)),n=(0,o.useLoader)(co.a,ka(e)?Object.values(e):e,(e=>{e.detectSupport(r),e.setTranscoderPath(t)}));if((0,i.useEffect)((()=>{(Array.isArray(n)?n:[n]).forEach(r.initTexture)}),[r,n]),ka(e)){const t=Object.keys(e),r={};return t.forEach((e=>Object.assign(r,{[e]:n[t.indexOf(e)]}))),r}return n}ho.preload=(e,t=`${uo}/basis/`)=>o.useLoader.preload(co.a,e,(e=>{e.setTranscoderPath(t)})),ho.clear=e=>o.useLoader.clear(co.a,e);var po=r(73466),fo=r.n(po);function mo(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function go({showPanel:e=0,className:t,parent:r}){const n=function(e,t=[],r){const[n,a]=i.useState();return i.useLayoutEffect((()=>{const t=e();return a(t),mo(r,t),()=>mo(r,null)}),t),n}((()=>new(fo())),[]);return i.useEffect((()=>{if(n){const i=r&&r.current||document.body;n.showPanel(e),null==i||i.appendChild(n.dom),t&&n.dom.classList.add(...t.split(" ").filter((e=>e)));const a=(0,o.addEffect)((()=>n.begin())),s=(0,o.addAfterEffect)((()=>n.end()));return()=>{null==i||i.removeChild(n.dom),a(),s()}}}),[r,n,t,e]),null}function vo(e,t,r){const{gl:n,size:a}=(0,o.useThree)(),l=i.useMemo((()=>n.getPixelRatio()),[n]),c="number"==typeof e?e:a.width*l,u="number"==typeof t?t:a.height*l,h=("number"==typeof e?r:e)||{},{samples:d,...p}=h,f=i.useMemo((()=>{let e;return e=new s.WebGLRenderTarget(c,u,{minFilter:s.LinearFilter,magFilter:s.LinearFilter,encoding:n.outputEncoding,type:s.HalfFloatType,...p}),e.samples=d,e}),[]);return i.useLayoutEffect((()=>{f.setSize(c,u),d&&(f.samples=d)}),[d,f,c,u]),i.useEffect((()=>()=>f.dispose()),[]),f}function Ao({size:e=256,frames:t=1/0}={}){const r=(0,o.useThree)((e=>e.viewport.dpr)),{width:n,height:a}=(0,o.useThree)((e=>e.size)),l=e||n*r,c=e||a*r,u=i.useMemo((()=>{const e=new s.DepthTexture(l,c);return e.format=s.DepthFormat,e.type=s.UnsignedShortType,{depthTexture:e}}),[l,c]);let h=0;const d=vo(l,c,u);return(0,o.useFrame)((e=>{(t===1/0||h<t)&&(e.gl.setRenderTarget(d),e.gl.render(e.scene,e.camera),e.gl.setRenderTarget(null),h++)})),d.depthTexture}function yo(e,t,r=1){const n=(0,o.useThree)((e=>e.viewport)),i=t*(n.aspect>e/t?n.width/e:n.height/t);return[e*(n.aspect>e/t?n.width/e:n.height/t)*r,i*r,1]}function xo(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}l((n=n.apply(e,t||[])).next())}))}const bo=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function wo(e){return e.toLowerCase().replace(/^angle ?\((.+)\)*$/,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}const Eo="undefined"==typeof window,So=(()=>{if(Eo)return;const{userAgent:e,platform:t,maxTouchPoints:r}=window.navigator,n=/(iphone|ipod|ipad)/i.test(e),i="iPad"===t||"MacIntel"===t&&r>0&&!window.MSStream;return{isIpad:i,isMobile:/android/i.test(e)||n||i,isSafari12:/Version\/12.+Safari/.test(e)}})();const Mo=[],_o=[];function To(e,t){if(e===t)return 0;const r=e;e.length>t.length&&(e=t,t=r);let n=e.length,i=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-i);)n--,i--;let a,s=0;for(;s<n&&e.charCodeAt(s)===t.charCodeAt(s);)s++;if(n-=s,i-=s,0===n)return i;let o,l,c=0,u=0,h=0;for(;u<n;)_o[u]=e.charCodeAt(s+u),Mo[u]=++u;for(;h<i;)for(a=t.charCodeAt(s+h),o=h++,c=h,u=0;u<n;u++)l=a===_o[u]?o:o+1,o=Mo[u],c=Mo[u]=o>c?l>c?c+1:l:l>o?o+1:l;return c}function Co(e){return null!=e}class Io extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}const Bo=({mobileTiers:e=[0,15,30,60],desktopTiers:t=[0,15,30,60],override:r={},glContext:n,failIfMajorPerformanceCaveat:i=!1,benchmarksURL:a="https://unpkg.com/detect-gpu@4.0.50/dist/benchmarks"}={})=>xo(void 0,void 0,void 0,(function*(){const s={};if(Eo)return{tier:0,type:"SSR"};const{isIpad:o=!!(null==So?void 0:So.isIpad),isMobile:l=!!(null==So?void 0:So.isMobile),screenSize:c=window.screen,loadBenchmarks:u=(e=>xo(void 0,void 0,void 0,(function*(){const t=yield fetch(`${a}/${e}`).then((e=>e.json()));if(parseInt(t.shift().split(".")[0],10)<4)throw new Io("Detect GPU benchmark data is out of date. Please update to version 4x");return t})))}=r;let{renderer:h}=r;const d=(e,t,r,n,i)=>({device:i,fps:n,gpu:r,isMobile:l,tier:e,type:t});let p,f="";if(h)h=wo(h),p=[h];else{const e=n||function(e,t=!1){const r={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:t,powerPreference:"high-performance",stencil:!1};e&&delete r.powerPreference;const n=window.document.createElement("canvas"),i=n.getContext("webgl",r)||n.getContext("experimental-webgl",r);return null!=i?i:void 0}(null==So?void 0:So.isSafari12,i);if(!e)return d(0,"WEBGL_UNSUPPORTED");const t=e.getExtension("WEBGL_debug_renderer_info");if(t&&(h=e.getParameter(t.UNMASKED_RENDERER_WEBGL)),!h)return d(1,"FALLBACK");f=h,h=wo(h),p=function(e,t,r){return"apple gpu"===t?function(e,t,r){if(!r)return[t];const n=function(e){const t=e.createShader(35633),r=e.createShader(35632),n=e.createProgram();if(!(r&&t&&n))return;e.shaderSource(t,"\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n "),e.shaderSource(r,"\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n "),e.compileShader(t),e.compileShader(r),e.attachShader(n,t),e.attachShader(n,r),e.linkProgram(n),e.detachShader(n,t),e.detachShader(n,r),e.deleteShader(t),e.deleteShader(r),e.useProgram(n);const i=e.createBuffer();e.bindBuffer(34962,i),e.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const a=e.getAttribLocation(n,"aPosition");e.vertexAttribPointer(a,3,5126,!1,0,0),e.enableVertexAttribArray(a),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);const s=new Uint8Array(4);return e.readPixels(0,0,1,1,6408,5121,s),e.deleteProgram(n),e.deleteBuffer(i),s.join("")}(e),i="801621810",a="8016218135",s="80162181161",o=(null==So?void 0:So.isIpad)?[["a7",s,12],["a8",a,15],["a8x",a,15],["a9",a,15],["a9x",a,15],["a10",a,15],["a10x",a,15],["a12",i,15],["a12x",i,15],["a12z",i,15],["a14",i,15],["m1",i,15]]:[["a7",s,12],["a8",a,12],["a9",a,15],["a10",a,15],["a11",i,15],["a12",i,15],["a13",i,15],["a14",i,15]];let l;return"80162181255"===n?l=o.filter((([,,e])=>e>=14)):(l=o.filter((([,e])=>e===n)),l.length||(l=o)),l.map((([e])=>`apple ${e} gpu`))}(e,t,r):[t]}(e,h,l)}const m=(yield Promise.all(p.map((function(e){var t;return xo(this,void 0,void 0,(function*(){const r=(e=>{const t=l?["adreno","apple","mali-t","mali","nvidia","powervr"]:["intel","apple","amd","radeon","nvidia","geforce"];for(const r of t)if(e.includes(r))return r})(e);if(!r)return;const n=`${l?"m":"d"}-${r}${o?"-ipad":""}.json`,i=s[n]=null!==(t=s[n])&&void 0!==t?t:u(n);let a;try{a=yield i}catch(r){if(r instanceof Io)throw r;return}const h=function(e){var t;const r=(e=e.replace(/\([^)]+\)/,"")).match(/\d+/)||e.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(t=null==r?void 0:r.join("").replace(/\W|amd/g,""))&&void 0!==t?t:""}(e);let d=a.filter((([,e])=>e===h));d.length||(d=a.filter((([t])=>t.includes(e))));const p=d.length;if(0===p)return;let f,[m,,,g]=p>1?d.map((t=>[t,To(e,t[0])])).sort((([,e],[,t])=>e-t))[0][0]:d[0],v=Number.MAX_VALUE;const{devicePixelRatio:A}=window,y=c.width*A*c.height*A;for(const e of g){const[t,r]=e,n=t*r,i=Math.abs(y-n);i<v&&(v=i,f=e)}if(!f)return;const[,,x,b]=f;return[v,x,m,b]}))})))).filter(Co).sort((([e=Number.MAX_VALUE,t],[r=Number.MAX_VALUE,n])=>e===r?t-n:e-r));if(!m.length){const e=bo.find((e=>h.includes(e)));return e?d(0,"BLOCKLISTED",e):d(1,"FALLBACK",`${h} (${f})`)}const[,g,v,A]=m[0];if(-1===g)return d(0,"BLOCKLISTED",v,g,A);const y=l?e:t;let x=0;for(let e=0;e<y.length;e++)g>=y[e]&&(x=e);return d(x,"BENCHMARK",v,g,A)})),Ro=e=>Ca((()=>Bo(e)),["useDetectGPU"]);function Po(e,t,...r){const n=i.useRef(),a=(0,o.useThree)((e=>e.scene));return i.useEffect((()=>(e&&t&&null!=e&&e.current&&(n.current=new t(e.current,...r),n.current&&a.add(n.current)),!e&&n.current&&a.remove(n.current),()=>{n.current&&a.remove(n.current)})),[a,t,e,r]),(0,o.useFrame)((()=>{var e;null!=(e=n.current)&&e.update&&n.current.update()})),n}const Fo=new s.Vector3,Lo=new s.Vector3,Do=new s.Vector3,Uo=new s.Vector2,No=new s.Vector2,ko=new s.Vector2,Oo=new s.Vector3;function Go(e,t,r,n,i,a,o){Fo.fromBufferAttribute(t,n),Lo.fromBufferAttribute(t,i),Do.fromBufferAttribute(t,a);const l=function(e,t,r,n,i,a){let o;return o=a===s.BackSide?e.intersectTriangle(n,r,t,!0,i):e.intersectTriangle(t,r,n,a!==s.DoubleSide,i),null===o?null:{distance:e.origin.distanceTo(i),point:i.clone()}}(e,Fo,Lo,Do,Oo,o);if(l){r&&(Uo.fromBufferAttribute(r,n),No.fromBufferAttribute(r,i),ko.fromBufferAttribute(r,a),l.uv=s.Triangle.getUV(Oo,Fo,Lo,Do,Uo,No,ko,new s.Vector2));const e={a:n,b:i,c:a,normal:new s.Vector3,materialIndex:0};s.Triangle.getNormal(Fo,Lo,Do,e.normal),l.face=e,l.faceIndex=n}return l}function zo(e,t,r,n,i){const a=3*n,s=e.index.getX(a),o=e.index.getX(a+1),l=e.index.getX(a+2),c=Go(r,e.attributes.position,e.attributes.uv,s,o,l,t);return c?(c.faceIndex=n,i&&i.push(c),c):null}function Vo(e,t,r){return null===e?null:(e.point.applyMatrix4(t.matrixWorld),e.distance=e.point.distanceTo(r.ray.origin),e.object=t,e.distance<r.near||e.distance>r.far?null:e)}const Ho=1.25,Qo=65535,jo=Math.pow(2,-24);class Wo{constructor(){}}function Xo(e,t,r){return r.min.x=t[e],r.min.y=t[e+1],r.min.z=t[e+2],r.max.x=t[e+3],r.max.y=t[e+4],r.max.z=t[e+5],r}function Yo(e){let t=-1,r=-1/0;for(let n=0;n<3;n++){const i=e[n+3]-e[n];i>r&&(r=i,t=n)}return t}function qo(e,t){t.set(e)}function Ko(e,t,r){let n,i;for(let a=0;a<3;a++){const s=a+3;n=e[a],i=t[a],r[a]=n<i?n:i,n=e[s],i=t[s],r[s]=n>i?n:i}}function Jo(e,t,r){for(let n=0;n<3;n++){const i=t[e+2*n],a=t[e+2*n+1],s=i-a,o=i+a;s<r[n]&&(r[n]=s),o>r[n+3]&&(r[n+3]=o)}}function Zo(e){const t=e[3]-e[0],r=e[4]-e[1],n=e[5]-e[2];return 2*(t*r+r*n+n*t)}function $o(e,t,r,n,i=null){let a=1/0,s=1/0,o=1/0,l=-1/0,c=-1/0,u=-1/0,h=1/0,d=1/0,p=1/0,f=-1/0,m=-1/0,g=-1/0;const v=null!==i;for(let A=6*t,y=6*(t+r);A<y;A+=6){const t=e[A+0],r=e[A+1],n=t-r,i=t+r;n<a&&(a=n),i>l&&(l=i),v&&t<h&&(h=t),v&&t>f&&(f=t);const y=e[A+2],x=e[A+3],b=y-x,w=y+x;b<s&&(s=b),w>c&&(c=w),v&&y<d&&(d=y),v&&y>m&&(m=y);const E=e[A+4],S=e[A+5],M=E-S,_=E+S;M<o&&(o=M),_>u&&(u=_),v&&E<p&&(p=E),v&&E>g&&(g=E)}n[0]=a,n[1]=s,n[2]=o,n[3]=l,n[4]=c,n[5]=u,v&&(i[0]=h,i[1]=d,i[2]=p,i[3]=f,i[4]=m,i[5]=g)}const el=32,tl=(e,t)=>e.candidate-t.candidate,rl=new Array(el).fill().map((()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0}))),nl=new Float32Array(6);function il(e,t){function r(e){p&&p(e/f)}function n(t,i,s,p=null,f=0){if(!m&&f>=c&&(m=!0,u&&(console.warn(`MeshBVH: Max depth of ${c} reached when generating BVH. Consider increasing maxDepth.`),console.warn(e))),s<=h||f>=c)return r(i+s),t.offset=i,t.count=s,t;const g=function(e,t,r,n,i,a){let s=-1,o=0;if(0===a)s=Yo(t),-1!==s&&(o=(t[s]+t[s+3])/2);else if(1===a)s=Yo(e),-1!==s&&(o=function(e,t,r,n){let i=0;for(let a=t,s=t+r;a<s;a++)i+=e[6*a+2*n];return i/r}(r,n,i,s));else if(2===a){const a=Zo(e);let l=Ho*i;const c=6*n,u=6*(n+i);for(let e=0;e<3;e++){const n=t[e],h=(t[e+3]-n)/el;if(i<8){const t=[...rl];t.length=i;let n=0;for(let i=c;i<u;i+=6,n++){const a=t[n];a.candidate=r[i+2*e],a.count=0;const{bounds:s,leftCacheBounds:o,rightCacheBounds:l}=a;for(let e=0;e<3;e++)l[e]=1/0,l[e+3]=-1/0,o[e]=1/0,o[e+3]=-1/0,s[e]=1/0,s[e+3]=-1/0;Jo(i,r,s)}t.sort(tl);let h=i;for(let e=0;e<h;e++){const r=t[e];for(;e+1<h&&t[e+1].candidate===r.candidate;)t.splice(e+1,1),h--}for(let i=c;i<u;i+=6){const n=r[i+2*e];for(let e=0;e<h;e++){const a=t[e];n>=a.candidate?Jo(i,r,a.rightCacheBounds):(Jo(i,r,a.leftCacheBounds),a.count++)}}for(let r=0;r<h;r++){const n=t[r],c=n.count,u=i-n.count,h=n.leftCacheBounds,d=n.rightCacheBounds;let p=0;0!==c&&(p=Zo(h)/a);let f=0;0!==u&&(f=Zo(d)/a);const m=1+Ho*(p*c+f*u);m<l&&(s=e,l=m,o=n.candidate)}}else{for(let e=0;e<el;e++){const t=rl[e];t.count=0,t.candidate=n+h+e*h;const r=t.bounds;for(let e=0;e<3;e++)r[e]=1/0,r[e+3]=-1/0}for(let i=c;i<u;i+=6){let t=~~((r[i+2*e]-n)/h);t>=el&&(t=31);const a=rl[t];a.count++,Jo(i,r,a.bounds)}const t=rl[31];qo(t.bounds,t.rightCacheBounds);for(let e=30;e>=0;e--){const t=rl[e],r=rl[e+1];Ko(t.bounds,r.rightCacheBounds,t.rightCacheBounds)}let d=0;for(let r=0;r<31;r++){const t=rl[r],n=t.count,c=t.bounds,u=rl[r+1].rightCacheBounds;0!==n&&(0===d?qo(c,nl):Ko(c,nl,nl)),d+=n;let h=0,p=0;0!==d&&(h=Zo(nl)/a);const f=i-d;0!==f&&(p=Zo(u)/a);const m=1+Ho*(h*d+p*f);m<l&&(s=e,l=m,o=t.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${a} used.`);return{axis:s,pos:o}}(t.boundingData,p,o,i,s,d);if(-1===g.axis)return r(i+s),t.offset=i,t.count=s,t;const v=function(e,t,r,n,i){let a=r,s=r+n-1;const o=i.pos,l=2*i.axis;for(;;){for(;a<=s&&t[6*a+l]<o;)a++;for(;a<=s&&t[6*s+l]>=o;)s--;if(!(a<s))return a;for(let r=0;r<3;r++){let n=e[3*a+r];e[3*a+r]=e[3*s+r],e[3*s+r]=n;let i=t[6*a+2*r+0];t[6*a+2*r+0]=t[6*s+2*r+0],t[6*s+2*r+0]=i;let o=t[6*a+2*r+1];t[6*a+2*r+1]=t[6*s+2*r+1],t[6*s+2*r+1]=o}a++,s--}}(l,o,i,s,g);if(v===i||v===i+s)r(i+s),t.offset=i,t.count=s;else{t.splitAxis=g.axis;const e=new Wo,r=i,l=v-i;t.left=e,e.boundingData=new Float32Array(6),$o(o,r,l,e.boundingData,a),n(e,r,l,a,f+1);const c=new Wo,u=v,h=s-l;t.right=c,c.boundingData=new Float32Array(6),$o(o,u,h,c.boundingData,a),n(c,u,h,a,f+1)}return t}!function(e,t){if(!e.index){const r=e.attributes.position.count,n=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;let i;i=r>65535?new Uint32Array(new n(4*r)):new Uint16Array(new n(2*r)),e.setIndex(new s.BufferAttribute(i,1));for(let e=0;e<r;e++)i[e]=e}}(e,t);const i=new Float32Array(6),a=new Float32Array(6),o=function(e,t){const r=e.attributes.position,n=e.index.array,i=n.length/3,a=new Float32Array(6*i),s=r.normalized,o=r.array,l=r.offset||0;let c=3;r.isInterleavedBufferAttribute&&(c=r.data.stride);const u=["getX","getY","getZ"];for(let h=0;h<i;h++){const e=3*h,i=6*h;let d,p,f;s?(d=n[e+0],p=n[e+1],f=n[e+2]):(d=n[e+0]*c+l,p=n[e+1]*c+l,f=n[e+2]*c+l);for(let n=0;n<3;n++){let e,l,c;s?(e=r[u[n]](d),l=r[u[n]](p),c=r[u[n]](f)):(e=o[d+n],l=o[p+n],c=o[f+n]);let h=e;l<h&&(h=l),c<h&&(h=c);let m=e;l>m&&(m=l),c>m&&(m=c);const g=(m-h)/2,v=2*n;a[i+v+0]=h+g,a[i+v+1]=g+(Math.abs(h)+g)*jo,h<t[n]&&(t[n]=h),m>t[n+3]&&(t[n+3]=m)}}return a}(e,i),l=e.index.array,c=t.maxDepth,u=t.verbose,h=t.maxLeafTris,d=t.strategy,p=t.onProgress,f=e.index.count/3;let m=!1;const g=[],v=function(e){if(!e.groups||!e.groups.length)return[{offset:0,count:e.index.count/3}];const t=[],r=new Set;for(const i of e.groups)r.add(i.start),r.add(i.start+i.count);const n=Array.from(r.values()).sort(((e,t)=>e-t));for(let i=0;i<n.length-1;i++){const e=n[i],r=n[i+1];t.push({offset:e/3,count:(r-e)/3})}return t}(e);if(1===v.length){const e=v[0],t=new Wo;t.boundingData=i,function(e,t,r,n){let i=1/0,a=1/0,s=1/0,o=-1/0,l=-1/0,c=-1/0;for(let u=6*t,h=6*(t+r);u<h;u+=6){const t=e[u+0];t<i&&(i=t),t>o&&(o=t);const r=e[u+2];r<a&&(a=r),r>l&&(l=r);const n=e[u+4];n<s&&(s=n),n>c&&(c=n)}n[0]=i,n[1]=a,n[2]=s,n[3]=o,n[4]=l,n[5]=c}(o,e.offset,e.count,a),n(t,e.offset,e.count,a),g.push(t)}else for(let s of v){const e=new Wo;e.boundingData=new Float32Array(6),$o(o,s.offset,s.count,e.boundingData,a),n(e,s.offset,s.count,a),g.push(e)}return g}class al{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let r=1/0,n=-1/0;for(let i=0,a=e.length;i<a;i++){const a=e[i][t];r=a<r?a:r,n=a>n?a:n}this.min=r,this.max=n}setFromPoints(e,t){let r=1/0,n=-1/0;for(let i=0,a=t.length;i<a;i++){const a=t[i],s=e.dot(a);r=s<r?s:r,n=s>n?s:n}this.min=r,this.max=n}isSeparated(e){return this.min>e.max||e.min>this.max}}al.prototype.setFromBox=function(){const e=new s.Vector3;return function(t,r){const n=r.min,i=r.max;let a=1/0,s=-1/0;for(let o=0;o<=1;o++)for(let r=0;r<=1;r++)for(let l=0;l<=1;l++){e.x=n.x*o+i.x*(1-o),e.y=n.y*r+i.y*(1-r),e.z=n.z*l+i.z*(1-l);const c=t.dot(e);a=Math.min(c,a),s=Math.max(c,s)}this.min=a,this.max=s}}();!function(){const e=new al}();const sl=function(){const e=new s.Vector3,t=new s.Vector3,r=new s.Vector3;return function(n,i,a){const s=n.start,o=e,l=i.start,c=t;r.subVectors(s,l),e.subVectors(n.end,n.start),t.subVectors(i.end,i.start);const u=r.dot(c),h=c.dot(o),d=c.dot(c),p=r.dot(o),f=o.dot(o)*d-h*h;let m,g;m=0!==f?(u*h-p*d)/f:0,g=(u+m*h)/d,a.x=m,a.y=g}}(),ol=function(){const e=new s.Vector2,t=new s.Vector3,r=new s.Vector3;return function(n,i,a,s){sl(n,i,e);let o=e.x,l=e.y;if(o>=0&&o<=1&&l>=0&&l<=1)return n.at(o,a),void i.at(l,s);if(o>=0&&o<=1)return l<0?i.at(0,s):i.at(1,s),void n.closestPointToPoint(s,!0,a);if(l>=0&&l<=1)return o<0?n.at(0,a):n.at(1,a),void i.closestPointToPoint(a,!0,s);{let e,c;e=o<0?n.start:n.end,c=l<0?i.start:i.end;const u=t,h=r;return n.closestPointToPoint(c,!0,t),i.closestPointToPoint(e,!0,r),u.distanceToSquared(c)<=h.distanceToSquared(e)?(a.copy(u),void s.copy(c)):(a.copy(e),void s.copy(h))}}}(),ll=function(){const e=new s.Vector3,t=new s.Vector3,r=new s.Plane,n=new s.Line3;return function(i,a){const{radius:s,center:o}=i,{a:l,b:c,c:u}=a;n.start=l,n.end=c;if(n.closestPointToPoint(o,!0,e).distanceTo(o)<=s)return!0;n.start=l,n.end=u;if(n.closestPointToPoint(o,!0,e).distanceTo(o)<=s)return!0;n.start=c,n.end=u;if(n.closestPointToPoint(o,!0,e).distanceTo(o)<=s)return!0;const h=a.getPlane(r);if(Math.abs(h.distanceToPoint(o))<=s){const e=h.projectPoint(o,t);if(a.containsPoint(e))return!0}return!1}}();function cl(e){return Math.abs(e)<1e-15}class ul extends s.Triangle{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map((()=>new s.Vector3)),this.satBounds=new Array(4).fill().map((()=>new al)),this.points=[this.a,this.b,this.c],this.sphere=new s.Sphere,this.plane=new s.Plane,this.needsUpdate=!0}intersectsSphere(e){return ll(e,this)}update(){const e=this.a,t=this.b,r=this.c,n=this.points,i=this.satAxes,a=this.satBounds,s=i[0],o=a[0];this.getNormal(s),o.setFromPoints(s,n);const l=i[1],c=a[1];l.subVectors(e,t),c.setFromPoints(l,n);const u=i[2],h=a[2];u.subVectors(t,r),h.setFromPoints(u,n);const d=i[3],p=a[3];d.subVectors(r,e),p.setFromPoints(d,n),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(s,e),this.needsUpdate=!1}}ul.prototype.closestPointToSegment=function(){const e=new s.Vector3,t=new s.Vector3,r=new s.Line3;return function(n,i=null,a=null){const{start:s,end:o}=n,l=this.points;let c,u=1/0;for(let h=0;h<3;h++){const s=(h+1)%3;r.start.copy(l[h]),r.end.copy(l[s]),ol(r,n,e,t),c=e.distanceToSquared(t),c<u&&(u=c,i&&i.copy(e),a&&a.copy(t))}return this.closestPointToPoint(s,e),c=s.distanceToSquared(e),c<u&&(u=c,i&&i.copy(e),a&&a.copy(s)),this.closestPointToPoint(o,e),c=o.distanceToSquared(e),c<u&&(u=c,i&&i.copy(e),a&&a.copy(o)),Math.sqrt(u)}}(),ul.prototype.intersectsTriangle=function(){const e=new ul,t=new Array(3),r=new Array(3),n=new al,i=new al,a=new s.Vector3,o=new s.Vector3,l=new s.Vector3,c=new s.Vector3,u=new s.Line3,h=new s.Line3,d=new s.Line3;return function(s,p=null,f=!1){this.needsUpdate&&this.update(),s.isExtendedTriangle?s.needsUpdate&&s.update():(e.copy(s),e.update(),s=e);const m=this.plane,g=s.plane;if(Math.abs(m.normal.dot(g.normal))>1-1e-10){const e=this.satBounds,o=this.satAxes;r[0]=s.a,r[1]=s.b,r[2]=s.c;for(let t=0;t<4;t++){const i=e[t],a=o[t];if(n.setFromPoints(a,r),i.isSeparated(n))return!1}const l=s.satBounds,c=s.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let r=0;r<4;r++){const e=l[r],i=c[r];if(n.setFromPoints(i,t),e.isSeparated(n))return!1}for(let s=0;s<4;s++){const e=o[s];for(let s=0;s<4;s++){const o=c[s];if(a.crossVectors(e,o),n.setFromPoints(a,t),i.setFromPoints(a,r),n.isSeparated(i))return!1}}return p&&(f||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),p.start.set(0,0,0),p.end.set(0,0,0)),!0}{const e=this.points;let t=!1,r=0;for(let s=0;s<3;s++){const n=e[s],i=e[(s+1)%3];u.start.copy(n),u.end.copy(i),u.delta(o);const a=t?h.start:h.end,l=cl(g.distanceToPoint(n));if(cl(g.normal.dot(o))&&l){h.copy(u),r=2;break}if((g.intersectLine(u,a)||l)&&!cl(a.distanceTo(i))){if(r++,t)break;t=!0}}if(1===r&&s.containsPoint(h.end))return p&&(p.start.copy(h.end),p.end.copy(h.end)),!0;if(2!==r)return!1;const n=s.points;let i=!1,a=0;for(let s=0;s<3;s++){const e=n[s],t=n[(s+1)%3];u.start.copy(e),u.end.copy(t),u.delta(l);const r=i?d.start:d.end,o=cl(m.distanceToPoint(e));if(cl(m.normal.dot(l))&&o){d.copy(u),a=2;break}if((m.intersectLine(u,r)||o)&&!cl(r.distanceTo(t))){if(a++,i)break;i=!0}}if(1===a&&this.containsPoint(d.end))return p&&(p.start.copy(d.end),p.end.copy(d.end)),!0;if(2!==a)return!1;if(h.delta(o),d.delta(l),o.dot(l)<0){let e=d.start;d.start=d.end,d.end=e}const f=h.start.dot(o),v=h.end.dot(o),A=d.start.dot(o),y=d.end.dot(o),x=v<A,b=f<y;return(f===y||A===v||x!==b)&&(p&&(c.subVectors(h.start,d.start),c.dot(o)>0?p.start.copy(h.start):p.start.copy(d.start),c.subVectors(h.end,d.end),c.dot(o)<0?p.end.copy(h.end):p.end.copy(d.end)),!0)}}}(),ul.prototype.distanceToPoint=function(){const e=new s.Vector3;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),ul.prototype.distanceToTriangle=function(){const e=new s.Vector3,t=new s.Vector3,r=["a","b","c"],n=new s.Line3,i=new s.Line3;return function(a,s=null,o=null){const l=s||o?n:null;if(this.intersectsTriangle(a,l))return(s||o)&&(s&&l.getCenter(s),o&&l.getCenter(o)),0;let c=1/0;for(let t=0;t<3;t++){let n;const i=r[t],l=a[i];this.closestPointToPoint(l,e),n=l.distanceToSquared(e),n<c&&(c=n,s&&s.copy(e),o&&o.copy(l));const u=this[i];a.closestPointToPoint(u,e),n=u.distanceToSquared(e),n<c&&(c=n,s&&s.copy(u),o&&o.copy(e))}for(let u=0;u<3;u++){const l=r[u],h=r[(u+1)%3];n.set(this[l],this[h]);for(let u=0;u<3;u++){const l=r[u],h=r[(u+1)%3];i.set(a[l],a[h]),ol(n,i,e,t);const d=e.distanceToSquared(t);d<c&&(c=d,s&&s.copy(e),o&&o.copy(t))}}return Math.sqrt(c)}}();class hl{constructor(e,t,r){this.isOrientedBox=!0,this.min=new s.Vector3,this.max=new s.Vector3,this.matrix=new s.Matrix4,this.invMatrix=new s.Matrix4,this.points=new Array(8).fill().map((()=>new s.Vector3)),this.satAxes=new Array(3).fill().map((()=>new s.Vector3)),this.satBounds=new Array(3).fill().map((()=>new al)),this.alignedSatBounds=new Array(3).fill().map((()=>new al)),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),r&&this.matrix.copy(r)}set(e,t,r){this.min.copy(e),this.max.copy(t),this.matrix.copy(r),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}function dl(e,t,r,n){const i=e.a,a=e.b,s=e.c;let o=t,l=t+1,c=t+2;r&&(o=r.getX(t),l=r.getX(t+1),c=r.getX(t+2)),i.x=n.getX(o),i.y=n.getY(o),i.z=n.getZ(o),a.x=n.getX(l),a.y=n.getY(l),a.z=n.getZ(l),s.x=n.getX(c),s.y=n.getY(c),s.z=n.getZ(c)}function pl(e,t,r,n,i,a,s){const o=r.index,l=r.attributes.position;for(let c=e,u=t+e;c<u;c++)if(dl(s,3*c,o,l),s.needsUpdate=!0,n(s,c,i,a))return!0;return!1}hl.prototype.update=function(){const e=this.matrix,t=this.min,r=this.max,n=this.points;for(let l=0;l<=1;l++)for(let i=0;i<=1;i++)for(let a=0;a<=1;a++){const s=n[1*l|2*i|4*a];s.x=l?r.x:t.x,s.y=i?r.y:t.y,s.z=a?r.z:t.z,s.applyMatrix4(e)}const i=this.satBounds,a=this.satAxes,s=n[0];for(let l=0;l<3;l++){const e=a[l],t=i[l],r=n[1<<l];e.subVectors(s,r),t.setFromPoints(e,n)}const o=this.alignedSatBounds;o[0].setFromPointsField(n,"x"),o[1].setFromPointsField(n,"y"),o[2].setFromPointsField(n,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1},hl.prototype.intersectsBox=function(){const e=new al;return function(t){this.needsUpdate&&this.update();const r=t.min,n=t.max,i=this.satBounds,a=this.satAxes,s=this.alignedSatBounds;if(e.min=r.x,e.max=n.x,s[0].isSeparated(e))return!1;if(e.min=r.y,e.max=n.y,s[1].isSeparated(e))return!1;if(e.min=r.z,e.max=n.z,s[2].isSeparated(e))return!1;for(let o=0;o<3;o++){const r=a[o],n=i[o];if(e.setFromBox(r,t),n.isSeparated(e))return!1}return!0}}(),hl.prototype.intersectsTriangle=function(){const e=new ul,t=new Array(3),r=new al,n=new al,i=new s.Vector3;return function(a){this.needsUpdate&&this.update(),a.isExtendedTriangle?a.needsUpdate&&a.update():(e.copy(a),e.update(),a=e);const s=this.satBounds,o=this.satAxes;t[0]=a.a,t[1]=a.b,t[2]=a.c;for(let e=0;e<3;e++){const n=s[e],i=o[e];if(r.setFromPoints(i,t),n.isSeparated(r))return!1}const l=a.satBounds,c=a.satAxes,u=this.points;for(let e=0;e<3;e++){const t=l[e],n=c[e];if(r.setFromPoints(n,u),t.isSeparated(r))return!1}for(let e=0;e<3;e++){const a=o[e];for(let e=0;e<4;e++){const s=c[e];if(i.crossVectors(a,s),r.setFromPoints(i,t),n.setFromPoints(i,u),r.isSeparated(n))return!1}}return!0}}(),hl.prototype.closestPointToPoint=function(e,t){return this.needsUpdate&&this.update(),t.copy(e).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),t},hl.prototype.distanceToPoint=function(){const e=new s.Vector3;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),hl.prototype.distanceToBox=function(){const e=["x","y","z"],t=new Array(12).fill().map((()=>new s.Line3)),r=new Array(12).fill().map((()=>new s.Line3)),n=new s.Vector3,i=new s.Vector3;return function(a,s=0,o=null,l=null){if(this.needsUpdate&&this.update(),this.intersectsBox(a))return(o||l)&&(a.getCenter(i),this.closestPointToPoint(i,n),a.closestPointToPoint(n,i),o&&o.copy(n),l&&l.copy(i)),0;const c=s*s,u=a.min,h=a.max,d=this.points;let p=1/0;for(let e=0;e<8;e++){const t=d[e];i.copy(t).clamp(u,h);const r=t.distanceToSquared(i);if(r<p&&(p=r,o&&o.copy(t),l&&l.copy(i),r<c))return Math.sqrt(r)}let f=0;for(let n=0;n<3;n++)for(let i=0;i<=1;i++)for(let a=0;a<=1;a++){const s=(n+1)%3,o=(n+2)%3,l=1<<n|i<<s|a<<o,c=d[i<<s|a<<o],p=d[l];t[f].set(c,p);const m=e[n],g=e[s],v=e[o],A=r[f],y=A.start,x=A.end;y[m]=u[m],y[g]=i?u[g]:h[g],y[v]=a?u[v]:h[g],x[m]=h[m],x[g]=i?u[g]:h[g],x[v]=a?u[v]:h[g],f++}for(let e=0;e<=1;e++)for(let t=0;t<=1;t++)for(let r=0;r<=1;r++){i.x=e?h.x:u.x,i.y=t?h.y:u.y,i.z=r?h.z:u.z,this.closestPointToPoint(i,n);const a=i.distanceToSquared(n);if(a<p&&(p=a,o&&o.copy(n),l&&l.copy(i),a<c))return Math.sqrt(a)}for(let e=0;e<12;e++){const a=t[e];for(let e=0;e<12;e++){const t=r[e];ol(a,t,n,i);const s=n.distanceToSquared(i);if(s<p&&(p=s,o&&o.copy(n),l&&l.copy(i),s<c))return Math.sqrt(s)}}return Math.sqrt(p)}}();class fl{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){const e=this._primitives;return 0===e.length?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}}function ml(e,t){return 65535===t[e+15]}function gl(e,t){return t[e+6]}function vl(e,t){return t[e+14]}function Al(e){return e+8}function yl(e,t){return t[e+6]}const xl=new s.Box3,bl=new s.Vector3,wl=["x","y","z"];function El(e,t,r,n,i){let a=2*e,s=Bl,o=Rl,l=Pl;if(ml(a,o)){!function(e,t,r,n,i,a){for(let s=n,o=n+i;s<o;s++)zo(e,t,r,s,a)}(t,r,n,gl(e,l),vl(a,o),i)}else{const a=Al(e);Tl(a,s,n,bl)&&El(a,t,r,n,i);const o=yl(e,l);Tl(o,s,n,bl)&&El(o,t,r,n,i)}}function Sl(e,t,r,n){let i=2*e,a=Bl,s=Rl,o=Pl;if(ml(i,s)){return function(e,t,r,n,i){let a=1/0,s=null;for(let o=n,l=n+i;o<l;o++){const n=zo(e,t,r,o);n&&n.distance<a&&(s=n,a=n.distance)}return s}(t,r,n,gl(e,o),vl(i,s))}{const i=function(e,t){return t[e+7]}(e,o),s=wl[i],l=n.direction[s]>=0;let c,u;l?(c=Al(e),u=yl(e,o)):(c=yl(e,o),u=Al(e));const h=Tl(c,a,n,bl)?Sl(c,t,r,n):null;if(h){const e=h.point[s];if(l?e<=a[u+i]:e>=a[u+i+3])return h}const d=Tl(u,a,n,bl)?Sl(u,t,r,n):null;return h&&d?h.distance<=d.distance?h:d:h||d||null}}const Ml=function(){let e,t;const r=[],n=new fl((()=>new s.Box3));return function(...a){e=n.getPrimitive(),t=n.getPrimitive(),r.push(e,t);const s=i(...a);n.releasePrimitive(e),n.releasePrimitive(t),r.pop(),r.pop();const o=r.length;return o>0&&(t=r[o-1],e=r[o-2]),s};function i(r,n,a,s,o=null,l=0,c=0){function u(e){let t=2*e,r=Rl,n=Pl;for(;!ml(t,r);)t=2*(e=Al(e));return gl(e,n)}function h(e){let t=2*e,r=Rl,n=Pl;for(;!ml(t,r);)t=2*(e=yl(e,n));return gl(e,n)+vl(t,r)}let d=2*r,p=Bl,f=Rl,m=Pl;if(ml(d,f)){const t=gl(r,m),n=vl(d,f);return Xo(r,p,e),s(t,n,!1,c,l+r,e)}{const d=Al(r),g=yl(r,m);let v,A,y,x,b=d,w=g;if(o&&(y=e,x=t,Xo(b,p,y),Xo(w,p,x),v=o(y),A=o(x),A<v)){b=g,w=d;const e=v;v=A,A=e,y=x}y||(y=e,Xo(b,p,y));const E=a(y,ml(2*b,f),v,c+1,l+b);let S;if(2===E){const e=u(b);S=s(e,h(b)-e,!0,c+1,l+b,y)}else S=E&&i(b,n,a,s,o,l,c+1);if(S)return!0;x=t,Xo(w,p,x);const M=a(x,ml(2*w,f),A,c+1,l+w);let _;if(2===M){const e=u(w);_=s(e,h(w)-e,!0,c+1,l+w,x)}else _=M&&i(w,n,a,s,o,l,c+1);return!!_}}}(),_l=function(){const e=new ul,t=new ul,r=new s.Matrix4,n=new hl,i=new hl;return function a(s,o,l,c,u=null){let h=2*s,d=Bl,p=Rl,f=Pl;null===u&&(l.boundingBox||l.computeBoundingBox(),n.set(l.boundingBox.min,l.boundingBox.max,c),u=n);if(!ml(h,p)){const e=s+8,t=f[s+6];Xo(e,d,xl);if(u.intersectsBox(xl)&&a(e,o,l,c,u))return!0;Xo(t,d,xl);return!!(u.intersectsBox(xl)&&a(t,o,l,c,u))}{const n=o,a=n.index,u=n.attributes.position,m=l.index,g=l.attributes.position,v=gl(s,f),A=vl(h,p);if(r.copy(c).invert(),l.boundsTree){Xo(s,d,i),i.matrix.copy(r),i.needsUpdate=!0;const e=l.boundsTree.shapecast({intersectsBounds:e=>i.intersectsBox(e),intersectsTriangle:e=>{e.a.applyMatrix4(c),e.b.applyMatrix4(c),e.c.applyMatrix4(c),e.needsUpdate=!0;for(let r=3*v,n=3*(A+v);r<n;r+=3)if(dl(t,r,a,u),t.needsUpdate=!0,e.intersectsTriangle(t))return!0;return!1}});return e}for(let i=3*v,s=A+3*v;i<s;i+=3){dl(e,i,a,u),e.a.applyMatrix4(r),e.b.applyMatrix4(r),e.c.applyMatrix4(r),e.needsUpdate=!0;for(let r=0,n=m.count;r<n;r+=3)if(dl(t,r,m,g),t.needsUpdate=!0,e.intersectsTriangle(t))return!0}}}}();function Tl(e,t,r,n){return Xo(e,t,xl),r.intersectBox(xl,n)}const Cl=[];let Il,Bl,Rl,Pl;function Fl(e){Il&&Cl.push(Il),Il=e,Bl=new Float32Array(e),Rl=new Uint16Array(e),Pl=new Uint32Array(e)}function Ll(){Il=null,Bl=null,Rl=null,Pl=null,Cl.length&&Fl(Cl.pop())}const Dl=Symbol("skip tree generation"),Ul=new s.Box3,Nl=new s.Box3,kl=new s.Matrix4,Ol=new hl,Gl=new hl,zl=new s.Vector3,Vl=new s.Vector3,Hl=new s.Vector3,Ql=new s.Vector3,jl=new s.Vector3,Wl=new s.Box3,Xl=new fl((()=>new ul));class Yl{static serialize(e,t={}){if(t.isBufferGeometry)return console.warn("MeshBVH.serialize: The arguments for the function have changed. See documentation for new signature."),Yl.serialize(arguments[0],{cloneBuffers:void 0===arguments[2]||arguments[2]});t={cloneBuffers:!0,...t};const r=e.geometry,n=e._roots,i=r.getIndex();let a;return a=t.cloneBuffers?{roots:n.map((e=>e.slice())),index:i.array.slice()}:{roots:n,index:i.array},a}static deserialize(e,t,r={}){if("boolean"==typeof r)return console.warn("MeshBVH.deserialize: The arguments for the function have changed. See documentation for new signature."),Yl.deserialize(arguments[0],arguments[1],{setIndex:void 0===arguments[2]||arguments[2]});r={setIndex:!0,...r};const{index:n,roots:i}=e,a=new Yl(t,{...r,[Dl]:!0});if(a._roots=i,r.setIndex){const r=t.getIndex();if(null===r){const r=new s.BufferAttribute(e.index,1,!1);t.setIndex(r)}else r.array!==n&&(r.array.set(n),r.needsUpdate=!0)}return a}constructor(e,t={}){if(!e.isBufferGeometry)throw new Error("MeshBVH: Only BufferGeometries are supported.");if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.");if((t=Object.assign({strategy:0,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,[Dl]:!1},t)).useSharedArrayBuffer&&"undefined"==typeof SharedArrayBuffer)throw new Error("MeshBVH: SharedArrayBuffer is not available.");this._roots=null,t[Dl]||(this._roots=function(e,t){const r=il(e,t);let n,i,a;const s=[],o=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let u=0;u<r.length;u++){const e=r[u],t=new o(32*l(e));n=new Float32Array(t),i=new Uint32Array(t),a=new Uint16Array(t),c(0,e),s.push(t)}return s;function l(e){return e.count?1:1+l(e.left)+l(e.right)}function c(e,t){const r=e/4,s=e/2,o=!!t.count,l=t.boundingData;for(let i=0;i<6;i++)n[r+i]=l[i];if(o){const n=t.offset,o=t.count;return i[r+6]=n,a[s+14]=o,a[s+15]=Qo,e+32}{const n=t.left,a=t.right,s=t.splitAxis;let o;if(o=c(e+32,n),o/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return i[r+6]=o/4,o=c(o,a),i[r+7]=s,o}}}(e,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new s.Box3))),this.geometry=e}refit(e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=this.geometry,r=t.index.array,n=t.attributes.position;let i,a,s,o,l=0;const c=this._roots;for(let h=0,d=c.length;h<d;h++)i=c[h],a=new Uint32Array(i),s=new Uint16Array(i),o=new Float32Array(i),u(0,l),l+=i.byteLength;function u(t,i,l=!1){const c=2*t;if(s[c+15]===Qo){const e=a[t+6];let i=1/0,l=1/0,u=1/0,h=-1/0,d=-1/0,p=-1/0;for(let t=3*e,a=3*(e+s[c+14]);t<a;t++){const e=r[t],a=n.getX(e),s=n.getY(e),o=n.getZ(e);a<i&&(i=a),a>h&&(h=a),s<l&&(l=s),s>d&&(d=s),o<u&&(u=o),o>p&&(p=o)}return(o[t+0]!==i||o[t+1]!==l||o[t+2]!==u||o[t+3]!==h||o[t+4]!==d||o[t+5]!==p)&&(o[t+0]=i,o[t+1]=l,o[t+2]=u,o[t+3]=h,o[t+4]=d,o[t+5]=p,!0)}{const r=t+8,n=a[t+6],s=r+i,c=n+i;let h=l,d=!1,p=!1;e?h||(d=e.has(s),p=e.has(c),h=!d&&!p):(d=!0,p=!0);const f=h||p;let m=!1;(h||d)&&(m=u(r,i,h));let g=!1;f&&(g=u(n,i,h));const v=m||g;if(v)for(let e=0;e<3;e++){const i=r+e,a=n+e,s=o[i],l=o[i+3],c=o[a],u=o[a+3];o[t+e]=s<c?s:c,o[t+e+3]=l>u?l:u}return v}}}traverse(e,t=0){const r=this._roots[t],n=new Uint32Array(r),i=new Uint16Array(r);!function t(a,s=0){const o=2*a,l=i[o+15]===Qo;if(l){const t=n[a+6],c=i[o+14];e(s,l,new Float32Array(r,4*a,6),t,c)}else{const i=a+8,o=n[a+6],c=n[a+7];e(s,l,new Float32Array(r,4*a,6),c)||(t(i,s+1),t(o,s+1))}}(0)}raycast(e,t=s.FrontSide){const r=this._roots,n=this.geometry,i=[],a=t.isMaterial,o=Array.isArray(t),l=n.groups,c=a?t.side:t;for(let s=0,u=r.length;s<u;s++){const a=o?t[l[s].materialIndex].side:c,u=i.length;if(Fl(r[s]),El(0,n,a,e,i),Ll(),o){const e=l[s].materialIndex;for(let t=u,r=i.length;t<r;t++)i[t].face.materialIndex=e}}return i}raycastFirst(e,t=s.FrontSide){const r=this._roots,n=this.geometry,i=t.isMaterial,a=Array.isArray(t);let o=null;const l=n.groups,c=i?t.side:t;for(let s=0,u=r.length;s<u;s++){const i=a?t[l[s].materialIndex].side:c;Fl(r[s]);const u=Sl(0,n,i,e);Ll(),null!=u&&(null==o||u.distance<o.distance)&&(o=u,a&&(u.face.materialIndex=l[s].materialIndex))}return o}intersectsGeometry(e,t){const r=this.geometry;let n=!1;for(const i of this._roots)if(Fl(i),n=_l(0,r,e,t),Ll(),n)break;return n}shapecast(e,t,r){const n=this.geometry;if(e instanceof Function){if(t){const e=t;t=(t,r,n,i)=>{const a=3*r;return e(t,a,a+1,a+2,n,i)}}e={boundsTraverseOrder:r,intersectsBounds:e,intersectsTriangle:t,intersectsRange:null},console.warn("MeshBVH: Shapecast function signature has changed and now takes an object of callbacks as a second argument. See docs for new signature.")}const i=Xl.getPrimitive();let{boundsTraverseOrder:a,intersectsBounds:s,intersectsRange:o,intersectsTriangle:l}=e;if(o&&l){const e=o;o=(t,r,a,s,o)=>!!e(t,r,a,s,o)||pl(t,r,n,l,a,s,i)}else o||(o=l?(e,t,r,a)=>pl(e,t,n,l,r,a,i):(e,t,r)=>r);let c=!1,u=0;for(const h of this._roots){if(Fl(h),c=Ml(0,n,s,o,a,u),Ll(),c)break;u+=h.byteLength}return Xl.releasePrimitive(i),c}bvhcast(e,t,r){let{intersectsRanges:n,intersectsTriangles:i}=r;const a=this.geometry.index,s=this.geometry.attributes.position,o=e.geometry.index,l=e.geometry.attributes.position;kl.copy(t).invert();const c=Xl.getPrimitive(),u=Xl.getPrimitive();if(i){function d(e,r,n,h,d,p,f,m){for(let g=n,v=n+h;g<v;g++){dl(u,3*g,o,l),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let t=e,n=e+r;t<n;t++)if(dl(c,3*t,a,s),c.needsUpdate=!0,i(c,u,t,g,d,p,f,m))return!0}return!1}if(n){const p=n;n=function(e,t,r,n,i,a,s,o){return!!p(e,t,r,n,i,a,s,o)||d(e,t,r,n,i,a,s,o)}}else n=d}e.getBoundingBox(Nl),Nl.applyMatrix4(t);const h=this.shapecast({intersectsBounds:e=>Nl.intersectsBox(e),intersectsRange:(t,r,i,a,s,o)=>(Ul.copy(o),Ul.applyMatrix4(kl),e.shapecast({intersectsBounds:e=>Ul.intersectsBox(e),intersectsRange:(e,i,o,l,c)=>n(t,r,e,i,a,s,l,c)}))});return Xl.releasePrimitive(c),Xl.releasePrimitive(u),h}intersectsBox(e,t){return Ol.set(e.min,e.max,t),Ol.needsUpdate=!0,this.shapecast({intersectsBounds:e=>Ol.intersectsBox(e),intersectsTriangle:e=>Ol.intersectsTriangle(e)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,r={},n={},i=0,a=1/0){e.boundingBox||e.computeBoundingBox(),Ol.set(e.boundingBox.min,e.boundingBox.max,t),Ol.needsUpdate=!0;const s=this.geometry,o=s.attributes.position,l=s.index,c=e.attributes.position,u=e.index,h=Xl.getPrimitive(),d=Xl.getPrimitive();let p=Vl,f=Hl,m=null,g=null;n&&(m=Ql,g=jl);let v=1/0,A=null,y=null;return kl.copy(t).invert(),Gl.matrix.copy(kl),this.shapecast({boundsTraverseOrder:e=>Ol.distanceToBox(e),intersectsBounds:(e,t,r)=>r<v&&r<a&&(t&&(Gl.min.copy(e.min),Gl.max.copy(e.max),Gl.needsUpdate=!0),!0),intersectsRange:(r,n)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:e=>Gl.distanceToBox(e),intersectsBounds:(e,t,r)=>r<v&&r<a,intersectsRange:(e,a)=>{for(let s=3*e,x=3*(e+a);s<x;s+=3){dl(d,s,u,c),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let e=3*r,t=3*(r+n);e<t;e+=3){dl(h,e,l,o),h.needsUpdate=!0;const t=h.distanceToTriangle(d,p,m);if(t<v&&(f.copy(p),g&&g.copy(m),v=t,A=e/3,y=s/3),t<i)return!0}}}});for(let e=0,a=u?u.count:c.count;e<a;e+=3){dl(d,e,u,c),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let t=3*r,a=3*(r+n);t<a;t+=3){dl(h,t,l,o),h.needsUpdate=!0;const r=h.distanceToTriangle(d,p,m);if(r<v&&(f.copy(p),g&&g.copy(m),v=r,A=t/3,y=e/3),r<i)return!0}}}}),Xl.releasePrimitive(h),Xl.releasePrimitive(d),v===1/0?null:(r.point?r.point.copy(f):r.point=f.clone(),r.distance=v,r.faceIndex=A,n&&(n.point?n.point.copy(g):n.point=g.clone(),n.point.applyMatrix4(kl),f.applyMatrix4(kl),n.distance=f.sub(n.point).length(),n.faceIndex=y),r)}closestPointToPoint(e,t={},r=0,n=1/0){const i=r*r,a=n*n;let s=1/0,o=null;if(this.shapecast({boundsTraverseOrder:t=>(zl.copy(e).clamp(t.min,t.max),zl.distanceToSquared(e)),intersectsBounds:(e,t,r)=>r<s&&r<a,intersectsTriangle:(t,r)=>{t.closestPointToPoint(e,zl);const n=e.distanceToSquared(zl);return n<s&&(Vl.copy(zl),s=n,o=r),n<i}}),s===1/0)return null;const l=Math.sqrt(s);return t.point?t.point.copy(Vl):t.point=Vl.clone(),t.distance=l,t.faceIndex=o,t}getBoundingBox(e){e.makeEmpty();return this._roots.forEach((t=>{Xo(0,new Float32Array(t),Wl),e.union(Wl)})),e}}const ql=new s.Ray,Kl=new s.Matrix4,Jl=s.Mesh.prototype.raycast;function Zl(e,t){if(this.geometry.boundsTree){if(void 0===this.material)return;Kl.copy(this.matrixWorld).invert(),ql.copy(e.ray).applyMatrix4(Kl);const r=this.geometry.boundsTree;if(!0===e.firstHitOnly){const n=Vo(r.raycastFirst(ql,this.material),this,e);n&&t.push(n)}else{const n=r.raycast(ql,this.material);for(let r=0,i=n.length;r<i;r++){const i=Vo(n[r],this,e);i&&t.push(i)}}}else Jl.call(this,e,t)}function $l(e){return this.boundsTree=new Yl(this,e),this.boundsTree}function ec(){this.boundsTree=null}function tc(e,t){i.useEffect((()=>{if(e.current){e.current.raycast=Zl;const r=e.current.geometry;return r.computeBoundsTree=$l,r.disposeBoundsTree=ec,r.computeBoundsTree(t),()=>{r.boundsTree&&r.disposeBoundsTree()}}}),[e,t])}function rc(...e){const t=i.useRef([]);return t.current=e.map((e=>i.useContext(e))),i.useMemo((()=>({children:r})=>e.reduceRight(((e,r,n)=>i.createElement(r.Provider,{value:t.current[n],children:e})),r)),[])}function nc(e,t){const r=i.useRef(),[n]=i.useState((()=>t?t instanceof s.Object3D?{current:t}:t:r)),[a]=i.useState((()=>new s.AnimationMixer(void 0))),l=i.useRef({}),[c]=i.useState((()=>{const t={};return e.forEach((e=>Object.defineProperty(t,e.name,{enumerable:!0,get(){if(n.current)return l.current[e.name]||(l.current[e.name]=a.clipAction(e,n.current))}}))),{ref:n,clips:e,actions:t,names:e.map((e=>e.name)),mixer:a}}));return(0,o.useFrame)(((e,t)=>a.update(t))),i.useEffect((()=>{const e=n.current;return()=>{l.current={},Object.values(c.actions).forEach((t=>{e&&a.uncacheAction(t,e)}))}}),[e]),c}function ic(e){const t=i.useRef(null),r=i.useRef(!1),n=i.useRef(!1);return i.useEffect((()=>{const i=t.current;if(i){const t=(0,o.addEffect)((()=>(r.current=!1,!0))),a=i.onBeforeRender;i.onBeforeRender=()=>r.current=!0;const s=(0,o.addAfterEffect)((()=>(r.current!==n.current&&e(n.current=r.current),!0)));return()=>{i.onBeforeRender=a,t(),s()}}}),[]),t}function ac(e=new s.Vector3,t=new s.Vector3){const[r]=i.useState((()=>({position:new s.Vector3,size:new s.Vector3})));(0,o.applyProps)(r,{position:e,size:t});const n=i.useRef(null),a=i.useMemo((()=>({ref:n,onBeforeCompile:e=>function(e,t,r){e.defines.BOX_PROJECTED_ENV_MAP=!0,e.uniforms.envMapPosition={value:t},e.uniforms.envMapSize={value:r},e.vertexShader=`\n varying vec3 vWorldPosition;\n ${e.vertexShader.replace("#include <worldpos_vertex>","\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n #ifdef BOX_PROJECTED_ENV_MAP\n vWorldPosition = worldPosition.xyz;\n #endif\n#endif\n")}`,e.fragmentShader=`\n \n#ifdef BOX_PROJECTED_ENV_MAP\n uniform vec3 envMapSize;\n uniform vec3 envMapPosition;\n varying vec3 vWorldPosition;\n \n vec3 parallaxCorrectNormal( vec3 v, vec3 cubeSize, vec3 cubePos ) {\n vec3 nDir = normalize( v );\n vec3 rbmax = ( .5 * cubeSize + cubePos - vWorldPosition ) / nDir;\n vec3 rbmin = ( -.5 * cubeSize + cubePos - vWorldPosition ) / nDir;\n vec3 rbminmax;\n rbminmax.x = ( nDir.x > 0. ) ? rbmax.x : rbmin.x;\n rbminmax.y = ( nDir.y > 0. ) ? rbmax.y : rbmin.y;\n rbminmax.z = ( nDir.z > 0. ) ? rbmax.z : rbmin.z;\n float correction = min( min( rbminmax.x, rbminmax.y ), rbminmax.z );\n vec3 boxIntersection = vWorldPosition + nDir * correction; \n return boxIntersection - cubePos;\n }\n#endif\n\n ${e.fragmentShader.replace("#include <envmap_physical_pars_fragment>",s.ShaderChunk.envmap_physical_pars_fragment).replace("vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );","vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n \n#ifdef BOX_PROJECTED_ENV_MAP\n worldNormal = parallaxCorrectNormal( worldNormal, envMapSize, envMapPosition );\n#endif\n\n ").replace("reflectVec = inverseTransformDirection( reflectVec, viewMatrix );","reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n \n#ifdef BOX_PROJECTED_ENV_MAP\n reflectVec = parallaxCorrectNormal( reflectVec, envMapSize, envMapPosition );\n#endif\n\n ")}`}(e,r.position,r.size),customProgramCacheKey:()=>JSON.stringify(r.position.toArray())+JSON.stringify(r.size.toArray())})),[...r.position.toArray(),...r.size.toArray()]);return i.useLayoutEffect((()=>{n.current.needsUpdate=!0}),[r]),a}var sc=r(53615);const oc=i.forwardRef((({children:e,curve:t},r)=>{const[n]=i.useState((()=>new s.Scene)),[a,l]=i.useState(),c=i.useRef();return i.useEffect((()=>{c.current=new sc.Zw(n.children[0]),l(c.current.object3D)}),[e]),i.useEffect((()=>{var e;t&&(null==(e=c.current)||e.updateCurve(0,t))}),[t]),i.useImperativeHandle(r,(()=>({moveAlongCurve:e=>{var t;null==(t=c.current)||t.moveAlongCurve(e)}}))),i.createElement(i.Fragment,null,(0,o.createPortal)(e,n),a&&i.createElement("primitive",{object:a}))}));class lc extends s.MeshPhysicalMaterial{constructor(e={}){super(e),this.setValues(e),this._time={value:0},this._distort={value:.4},this._radius={value:1}}onBeforeCompile(e){e.uniforms.time=this._time,e.uniforms.radius=this._radius,e.uniforms.distort=this._distort,e.vertexShader=`\n uniform float time;\n uniform float radius;\n uniform float distort;\n #define GLSLIFY 1\nvec3 mod289(vec3 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 mod289(vec4 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 permute(vec4 x){return mod289(((x*34.0)+1.0)*x);}vec4 taylorInvSqrt(vec4 r){return 1.79284291400159-0.85373472095314*r;}float snoise(vec3 v){const vec2 C=vec2(1.0/6.0,1.0/3.0);const vec4 D=vec4(0.0,0.5,1.0,2.0);vec3 i=floor(v+dot(v,C.yyy));vec3 x0=v-i+dot(i,C.xxx);vec3 g=step(x0.yzx,x0.xyz);vec3 l=1.0-g;vec3 i1=min(g.xyz,l.zxy);vec3 i2=max(g.xyz,l.zxy);vec3 x1=x0-i1+C.xxx;vec3 x2=x0-i2+C.yyy;vec3 x3=x0-D.yyy;i=mod289(i);vec4 p=permute(permute(permute(i.z+vec4(0.0,i1.z,i2.z,1.0))+i.y+vec4(0.0,i1.y,i2.y,1.0))+i.x+vec4(0.0,i1.x,i2.x,1.0));float n_=0.142857142857;vec3 ns=n_*D.wyz-D.xzx;vec4 j=p-49.0*floor(p*ns.z*ns.z);vec4 x_=floor(j*ns.z);vec4 y_=floor(j-7.0*x_);vec4 x=x_*ns.x+ns.yyyy;vec4 y=y_*ns.x+ns.yyyy;vec4 h=1.0-abs(x)-abs(y);vec4 b0=vec4(x.xy,y.xy);vec4 b1=vec4(x.zw,y.zw);vec4 s0=floor(b0)*2.0+1.0;vec4 s1=floor(b1)*2.0+1.0;vec4 sh=-step(h,vec4(0.0));vec4 a0=b0.xzyw+s0.xzyw*sh.xxyy;vec4 a1=b1.xzyw+s1.xzyw*sh.zzww;vec3 p0=vec3(a0.xy,h.x);vec3 p1=vec3(a0.zw,h.y);vec3 p2=vec3(a1.xy,h.z);vec3 p3=vec3(a1.zw,h.w);vec4 norm=taylorInvSqrt(vec4(dot(p0,p0),dot(p1,p1),dot(p2,p2),dot(p3,p3)));p0*=norm.x;p1*=norm.y;p2*=norm.z;p3*=norm.w;vec4 m=max(0.6-vec4(dot(x0,x0),dot(x1,x1),dot(x2,x2),dot(x3,x3)),0.0);m=m*m;return 42.0*dot(m*m,vec4(dot(p0,x0),dot(p1,x1),dot(p2,x2),dot(p3,x3)));}\n ${e.vertexShader}\n `,e.vertexShader=e.vertexShader.replace("#include <begin_vertex>","\n float updateTime = time / 50.0;\n float noise = snoise(vec3(position / 2.0 + updateTime * 5.0));\n vec3 transformed = vec3(position * (noise * pow(distort, 2.0) + radius));\n ")}get time(){return this._time.value}set time(e){this._time.value=e}get distort(){return this._distort.value}set distort(e){this._distort.value=e}get radius(){return this._radius.value}set radius(e){this._radius.value=e}}const cc=i.forwardRef((({speed:e=1,...t},r)=>{const[a]=i.useState((()=>new lc));return(0,o.useFrame)((t=>a&&(a.time=t.clock.getElapsedTime()*e))),i.createElement("primitive",n({dispose:void 0,object:a,ref:r,attach:"material"},t))}));class uc extends s.MeshStandardMaterial{constructor(e={}){super(e),this.setValues(e),this._time={value:0},this._factor={value:1}}onBeforeCompile(e){e.uniforms.time=this._time,e.uniforms.factor=this._factor,e.vertexShader=`\n uniform float time;\n uniform float factor;\n ${e.vertexShader}\n `,e.vertexShader=e.vertexShader.replace("#include <begin_vertex>","float theta = sin( time + position.y ) / 2.0 * factor;\n float c = cos( theta );\n float s = sin( theta );\n mat3 m = mat3( c, 0, s, 0, 1, 0, -s, 0, c );\n vec3 transformed = vec3( position ) * m;\n vNormal = vNormal * m;")}get time(){return this._time.value}set time(e){this._time.value=e}get factor(){return this._factor.value}set factor(e){this._factor.value=e}}const hc=i.forwardRef((({speed:e=1,...t},r)=>{const[a]=i.useState((()=>new uc));return(0,o.useFrame)((t=>a&&(a.time=t.clock.getElapsedTime()*e))),i.createElement("primitive",n({dispose:void 0,object:a,ref:r,attach:"material"},t))}));class dc extends s.ShaderMaterial{constructor(e=new s.Vector2){super({uniforms:{inputBuffer:new s.Uniform(null),depthBuffer:new s.Uniform(null),resolution:new s.Uniform(new s.Vector2),texelSize:new s.Uniform(new s.Vector2),halfTexelSize:new s.Uniform(new s.Vector2),kernel:new s.Uniform(0),scale:new s.Uniform(1),cameraNear:new s.Uniform(0),cameraFar:new s.Uniform(1),minDepthThreshold:new s.Uniform(0),maxDepthThreshold:new s.Uniform(1),depthScale:new s.Uniform(0),depthToBlurRatioBias:new s.Uniform(.25)},fragmentShader:"#include <common>\n #include <dithering_pars_fragment> \n uniform sampler2D inputBuffer;\n uniform sampler2D depthBuffer;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform float minDepthThreshold;\n uniform float maxDepthThreshold;\n uniform float depthScale;\n uniform float depthToBlurRatioBias;\n varying vec2 vUv;\n varying vec2 vUv0;\n varying vec2 vUv1;\n varying vec2 vUv2;\n varying vec2 vUv3;\n\n void main() {\n float depthFactor = 0.0;\n \n #ifdef USE_DEPTH\n vec4 depth = texture2D(depthBuffer, vUv);\n depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));\n depthFactor *= depthScale;\n depthFactor = max(0.0, min(1.0, depthFactor + 0.25));\n #endif\n \n vec4 sum = texture2D(inputBuffer, mix(vUv0, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv1, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv2, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv3, vUv, depthFactor));\n gl_FragColor = sum * 0.25 ;\n\n #include <dithering_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n }",vertexShader:"uniform vec2 texelSize;\n uniform vec2 halfTexelSize;\n uniform float kernel;\n uniform float scale;\n varying vec2 vUv;\n varying vec2 vUv0;\n varying vec2 vUv1;\n varying vec2 vUv2;\n varying vec2 vUv3;\n\n void main() {\n vec2 uv = position.xy * 0.5 + 0.5;\n vUv = uv;\n\n vec2 dUv = (texelSize * vec2(kernel) + halfTexelSize) * scale;\n vUv0 = vec2(uv.x - dUv.x, uv.y + dUv.y);\n vUv1 = vec2(uv.x + dUv.x, uv.y + dUv.y);\n vUv2 = vec2(uv.x + dUv.x, uv.y - dUv.y);\n vUv3 = vec2(uv.x - dUv.x, uv.y - dUv.y);\n\n gl_Position = vec4(position.xy, 1.0, 1.0);\n }",blending:s.NoBlending,depthWrite:!1,depthTest:!1}),this.toneMapped=!1,this.setTexelSize(e.x,e.y),this.kernel=new Float32Array([0,1,2,2,3])}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t),this.uniforms.halfTexelSize.value.set(e,t).multiplyScalar(.5)}setResolution(e){this.uniforms.resolution.value.copy(e)}}class pc{constructor({gl:e,resolution:t,width:r=500,height:n=500,minDepthThreshold:i=0,maxDepthThreshold:a=1,depthScale:o=0,depthToBlurRatioBias:l=.25}){this.renderToScreen=!1,this.renderTargetA=new s.WebGLRenderTarget(t,t,{minFilter:s.LinearFilter,magFilter:s.LinearFilter,stencilBuffer:!1,depthBuffer:!1,encoding:e.outputEncoding}),this.renderTargetB=this.renderTargetA.clone(),this.convolutionMaterial=new dc,this.convolutionMaterial.setTexelSize(1/r,1/n),this.convolutionMaterial.setResolution(new s.Vector2(r,n)),this.scene=new s.Scene,this.camera=new s.Camera,this.convolutionMaterial.uniforms.minDepthThreshold.value=i,this.convolutionMaterial.uniforms.maxDepthThreshold.value=a,this.convolutionMaterial.uniforms.depthScale.value=o,this.convolutionMaterial.uniforms.depthToBlurRatioBias.value=l,this.convolutionMaterial.defines.USE_DEPTH=o>0;const c=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),u=new Float32Array([0,0,2,0,0,2]),h=new s.BufferGeometry;h.setAttribute("position",new s.BufferAttribute(c,3)),h.setAttribute("uv",new s.BufferAttribute(u,2)),this.screen=new s.Mesh(h,this.convolutionMaterial),this.screen.frustumCulled=!1,this.scene.add(this.screen)}render(e,t,r){const n=this.scene,i=this.camera,a=this.renderTargetA,s=this.renderTargetB;let o=this.convolutionMaterial,l=o.uniforms;l.depthBuffer.value=t.depthTexture;const c=o.kernel;let u,h,d,p=t;for(h=0,d=c.length-1;h<d;++h)u=0==(1&h)?a:s,l.kernel.value=c[h],l.inputBuffer.value=p.texture,e.setRenderTarget(u),e.render(n,i),p=u;l.kernel.value=c[h],l.inputBuffer.value=p.texture,e.setRenderTarget(this.renderToScreen?null:r),e.render(n,i)}}class fc extends s.MeshStandardMaterial{constructor(e={}){super(e),this._tDepth={value:null},this._distortionMap={value:null},this._tDiffuse={value:null},this._tDiffuseBlur={value:null},this._textureMatrix={value:null},this._hasBlur={value:!1},this._mirror={value:0},this._mixBlur={value:0},this._blurStrength={value:.5},this._minDepthThreshold={value:.9},this._maxDepthThreshold={value:1},this._depthScale={value:0},this._depthToBlurRatioBias={value:.25},this._distortion={value:1},this._mixContrast={value:1},this.setValues(e)}onBeforeCompile(e){var t;null!=(t=e.defines)&&t.USE_UV||(e.defines.USE_UV=""),e.uniforms.hasBlur=this._hasBlur,e.uniforms.tDiffuse=this._tDiffuse,e.uniforms.tDepth=this._tDepth,e.uniforms.distortionMap=this._distortionMap,e.uniforms.tDiffuseBlur=this._tDiffuseBlur,e.uniforms.textureMatrix=this._textureMatrix,e.uniforms.mirror=this._mirror,e.uniforms.mixBlur=this._mixBlur,e.uniforms.mixStrength=this._blurStrength,e.uniforms.minDepthThreshold=this._minDepthThreshold,e.uniforms.maxDepthThreshold=this._maxDepthThreshold,e.uniforms.depthScale=this._depthScale,e.uniforms.depthToBlurRatioBias=this._depthToBlurRatioBias,e.uniforms.distortion=this._distortion,e.uniforms.mixContrast=this._mixContrast,e.vertexShader=`\n uniform mat4 textureMatrix;\n varying vec4 my_vUv; \n ${e.vertexShader}`,e.vertexShader=e.vertexShader.replace("#include <project_vertex>","#include <project_vertex>\n my_vUv = textureMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );"),e.fragmentShader=`\n uniform sampler2D tDiffuse;\n uniform sampler2D tDiffuseBlur;\n uniform sampler2D tDepth;\n uniform sampler2D distortionMap;\n uniform float distortion;\n uniform float cameraNear;\n\t\t\t uniform float cameraFar;\n uniform bool hasBlur;\n uniform float mixBlur;\n uniform float mirror;\n uniform float mixStrength;\n uniform float minDepthThreshold;\n uniform float maxDepthThreshold;\n uniform float mixContrast;\n uniform float depthScale;\n uniform float depthToBlurRatioBias;\n varying vec4 my_vUv; \n ${e.fragmentShader}`,e.fragmentShader=e.fragmentShader.replace("#include <emissivemap_fragment>","#include <emissivemap_fragment>\n \n float distortionFactor = 0.0;\n #ifdef USE_DISTORTION\n distortionFactor = texture2D(distortionMap, vUv).r * distortion;\n #endif\n\n vec4 new_vUv = my_vUv;\n new_vUv.x += distortionFactor;\n new_vUv.y += distortionFactor;\n\n vec4 base = texture2DProj(tDiffuse, new_vUv);\n vec4 blur = texture2DProj(tDiffuseBlur, new_vUv);\n \n vec4 merge = base;\n \n #ifdef USE_NORMALMAP\n vec2 normal_uv = vec2(0.0);\n vec4 normalColor = texture2D(normalMap, vUv * normalScale);\n vec3 my_normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) );\n vec3 coord = new_vUv.xyz / new_vUv.w;\n normal_uv = coord.xy + coord.z * my_normal.xz * 0.05;\n vec4 base_normal = texture2D(tDiffuse, normal_uv);\n vec4 blur_normal = texture2D(tDiffuseBlur, normal_uv);\n merge = base_normal;\n blur = blur_normal;\n #endif\n\n float depthFactor = 0.0001;\n float blurFactor = 0.0;\n\n #ifdef USE_DEPTH\n vec4 depth = texture2DProj(tDepth, new_vUv);\n depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));\n depthFactor *= depthScale;\n depthFactor = max(0.0001, min(1.0, depthFactor));\n\n #ifdef USE_BLUR\n blur = blur * min(1.0, depthFactor + depthToBlurRatioBias);\n merge = merge * min(1.0, depthFactor + 0.5);\n #else\n merge = merge * depthFactor;\n #endif\n \n #endif\n\n float reflectorRoughnessFactor = roughness;\n #ifdef USE_ROUGHNESSMAP\n vec4 reflectorTexelRoughness = texture2D( roughnessMap, vUv );\n reflectorRoughnessFactor *= reflectorTexelRoughness.g;\n #endif\n \n #ifdef USE_BLUR\n blurFactor = min(1.0, mixBlur * reflectorRoughnessFactor);\n merge = mix(merge, blur, blurFactor);\n #endif\n\n vec4 newMerge = vec4(0.0, 0.0, 0.0, 1.0);\n newMerge.r = (merge.r - 0.5) * mixContrast + 0.5;\n newMerge.g = (merge.g - 0.5) * mixContrast + 0.5;\n newMerge.b = (merge.b - 0.5) * mixContrast + 0.5;\n\n diffuseColor.rgb = diffuseColor.rgb * ((1.0 - min(1.0, mirror)) + newMerge.rgb * mixStrength);\n ")}get tDiffuse(){return this._tDiffuse.value}set tDiffuse(e){this._tDiffuse.value=e}get tDepth(){return this._tDepth.value}set tDepth(e){this._tDepth.value=e}get distortionMap(){return this._distortionMap.value}set distortionMap(e){this._distortionMap.value=e}get tDiffuseBlur(){return this._tDiffuseBlur.value}set tDiffuseBlur(e){this._tDiffuseBlur.value=e}get textureMatrix(){return this._textureMatrix.value}set textureMatrix(e){this._textureMatrix.value=e}get hasBlur(){return this._hasBlur.value}set hasBlur(e){this._hasBlur.value=e}get mirror(){return this._mirror.value}set mirror(e){this._mirror.value=e}get mixBlur(){return this._mixBlur.value}set mixBlur(e){this._mixBlur.value=e}get mixStrength(){return this._blurStrength.value}set mixStrength(e){this._blurStrength.value=e}get minDepthThreshold(){return this._minDepthThreshold.value}set minDepthThreshold(e){this._minDepthThreshold.value=e}get maxDepthThreshold(){return this._maxDepthThreshold.value}set maxDepthThreshold(e){this._maxDepthThreshold.value=e}get depthScale(){return this._depthScale.value}set depthScale(e){this._depthScale.value=e}get depthToBlurRatioBias(){return this._depthToBlurRatioBias.value}set depthToBlurRatioBias(e){this._depthToBlurRatioBias.value=e}get distortion(){return this._distortion.value}set distortion(e){this._distortion.value=e}get mixContrast(){return this._mixContrast.value}set mixContrast(e){this._mixContrast.value=e}}(0,o.extend)({MeshReflectorMaterialImpl:fc});const mc=i.forwardRef((({mixBlur:e=0,mixStrength:t=1,resolution:r=256,blur:a=[0,0],minDepthThreshold:l=.9,maxDepthThreshold:c=1,depthScale:u=0,depthToBlurRatioBias:h=.25,mirror:d=0,distortion:p=1,mixContrast:f=1,distortionMap:m,reflectorOffset:g=0,...v},A)=>{const y=(0,o.useThree)((({gl:e})=>e)),x=(0,o.useThree)((({camera:e})=>e)),b=(0,o.useThree)((({scene:e})=>e)),w=(a=Array.isArray(a)?a:[a,a])[0]+a[1]>0,E=i.useRef(null),[S]=i.useState((()=>new s.Plane)),[M]=i.useState((()=>new s.Vector3)),[T]=i.useState((()=>new s.Vector3)),[C]=i.useState((()=>new s.Vector3)),[I]=i.useState((()=>new s.Matrix4)),[B]=i.useState((()=>new s.Vector3(0,0,-1))),[R]=i.useState((()=>new s.Vector4)),[P]=i.useState((()=>new s.Vector3)),[F]=i.useState((()=>new s.Vector3)),[L]=i.useState((()=>new s.Vector4)),[D]=i.useState((()=>new s.Matrix4)),[U]=i.useState((()=>new s.PerspectiveCamera)),N=i.useCallback((()=>{var e;const t=E.current.parent||(null==(e=E.current)?void 0:e.__r3f.parent);if(!t)return;if(T.setFromMatrixPosition(t.matrixWorld),C.setFromMatrixPosition(x.matrixWorld),I.extractRotation(t.matrixWorld),M.set(0,0,1),M.applyMatrix4(I),T.addScaledVector(M,g),P.subVectors(T,C),P.dot(M)>0)return;P.reflect(M).negate(),P.add(T),I.extractRotation(x.matrixWorld),B.set(0,0,-1),B.applyMatrix4(I),B.add(C),F.subVectors(T,B),F.reflect(M).negate(),F.add(T),U.position.copy(P),U.up.set(0,1,0),U.up.applyMatrix4(I),U.up.reflect(M),U.lookAt(F),U.far=x.far,U.updateMatrixWorld(),U.projectionMatrix.copy(x.projectionMatrix),D.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),D.multiply(U.projectionMatrix),D.multiply(U.matrixWorldInverse),D.multiply(t.matrixWorld),S.setFromNormalAndCoplanarPoint(M,T),S.applyMatrix4(U.matrixWorldInverse),R.set(S.normal.x,S.normal.y,S.normal.z,S.constant);const r=U.projectionMatrix;L.x=(Math.sign(R.x)+r.elements[8])/r.elements[0],L.y=(Math.sign(R.y)+r.elements[9])/r.elements[5],L.z=-1,L.w=(1+r.elements[10])/r.elements[14],R.multiplyScalar(2/R.dot(L)),r.elements[2]=R.x,r.elements[6]=R.y,r.elements[10]=R.z+1,r.elements[14]=R.w}),[x,g]),[k,O,G,z]=i.useMemo((()=>{const n={minFilter:s.LinearFilter,magFilter:s.LinearFilter,encoding:y.outputEncoding,type:s.HalfFloatType},i=new s.WebGLRenderTarget(r,r,n);i.depthBuffer=!0,i.depthTexture=new s.DepthTexture(r,r),i.depthTexture.format=s.DepthFormat,i.depthTexture.type=s.UnsignedShortType;const o=new s.WebGLRenderTarget(r,r,n);return[i,o,new pc({gl:y,resolution:r,width:a[0],height:a[1],minDepthThreshold:l,maxDepthThreshold:c,depthScale:u,depthToBlurRatioBias:h}),{mirror:d,textureMatrix:D,mixBlur:e,tDiffuse:i.texture,tDepth:i.depthTexture,tDiffuseBlur:o.texture,hasBlur:w,mixStrength:t,minDepthThreshold:l,maxDepthThreshold:c,depthScale:u,depthToBlurRatioBias:h,transparent:!0,distortion:p,distortionMap:m,mixContrast:f,"defines-USE_BLUR":w?"":void 0,"defines-USE_DEPTH":u>0?"":void 0,"defines-USE_DISTORTION":m?"":void 0}]}),[y,a,D,r,d,w,e,t,l,c,u,h,p,m,f]);return(0,o.useFrame)((()=>{var e;const t=E.current.parent||(null==(e=E.current)?void 0:e.__r3f.parent);if(!t)return;t.visible=!1;const r=y.xr.enabled,n=y.shadowMap.autoUpdate;N(),y.xr.enabled=!1,y.shadowMap.autoUpdate=!1,y.setRenderTarget(k),y.state.buffers.depth.setMask(!0),y.autoClear||y.clear(),y.render(b,U),w&&G.render(y,k,O),y.xr.enabled=r,y.shadowMap.autoUpdate=n,t.visible=!0,y.setRenderTarget(null)})),i.createElement("meshReflectorMaterialImpl",n({attach:"material",key:"key"+z["defines-USE_BLUR"]+z["defines-USE_DEPTH"]+z["defines-USE_DISTORTION"],ref:_([E,A])},z,v))}));class gc extends s.PointsMaterial{constructor(e){super(e),this.onBeforeCompile=e=>{e.fragmentShader=e.fragmentShader.replace("#include <output_fragment>","\n #include <output_fragment>\n vec2 cxy = 2.0 * gl_PointCoord - 1.0;\n float r = dot(cxy, cxy);\n float delta = fwidth(r); \n float mask = 1.0 - smoothstep(1.0 - delta, 1.0 + delta, r);\n gl_FragColor = vec4(gl_FragColor.rgb, mask * gl_FragColor.a );\n ")}}}const vc=i.forwardRef(((e,t)=>{const[r]=i.useState((()=>new gc(null)));return i.createElement("primitive",n({},e,{object:r,ref:t,attach:"material"}))}));let Ac=!1;const yc=e=>{if(!Ac){Ac=!0;let t=s.ShaderChunk.shadowmap_pars_fragment;t=t.replace("#ifdef USE_SHADOWMAP","#ifdef USE_SHADOWMAP\n"+(({frustum:e=3.75,size:t=.005,near:r=9.5,samples:n=17,rings:i=11}={})=>`#define LIGHT_WORLD_SIZE ${t}\n#define LIGHT_FRUSTUM_WIDTH ${e}\n#define LIGHT_SIZE_UV (LIGHT_WORLD_SIZE / LIGHT_FRUSTUM_WIDTH)\n#define NEAR_PLANE ${r}\n\n#define NUM_SAMPLES ${n}\n#define NUM_RINGS ${i}\n#define BLOCKER_SEARCH_NUM_SAMPLES NUM_SAMPLES\n#define PCF_NUM_SAMPLES NUM_SAMPLES\n\nvec2 poissonDisk[NUM_SAMPLES];\n\nvoid initPoissonSamples(const in vec2 randomSeed) {\n float ANGLE_STEP = PI2 * float(NUM_RINGS) / float(NUM_SAMPLES);\n float INV_NUM_SAMPLES = 1.0 / float(NUM_SAMPLES);\n float angle = rand(randomSeed) * PI2;\n float radius = INV_NUM_SAMPLES;\n float radiusStep = radius;\n for (int i = 0; i < NUM_SAMPLES; i++) {\n poissonDisk[i] = vec2(cos(angle), sin(angle)) * pow(radius, 0.75);\n radius += radiusStep;\n angle += ANGLE_STEP;\n }\n}\n\nfloat penumbraSize(const in float zReceiver, const in float zBlocker) { // Parallel plane estimation\n return (zReceiver - zBlocker) / zBlocker;\n}\n\nfloat findBlocker(sampler2D shadowMap, const in vec2 uv, const in float zReceiver) {\n float searchRadius = LIGHT_SIZE_UV * (zReceiver - NEAR_PLANE) / zReceiver;\n float blockerDepthSum = 0.0;\n int numBlockers = 0;\n for (int i = 0; i < BLOCKER_SEARCH_NUM_SAMPLES; i++) {\n float shadowMapDepth = unpackRGBAToDepth(texture2D(shadowMap, uv + poissonDisk[i] * searchRadius));\n if (shadowMapDepth < zReceiver) {\n blockerDepthSum += shadowMapDepth;\n numBlockers++;\n }\n }\n if (numBlockers == 0) return -1.0;\n return blockerDepthSum / float(numBlockers);\n}\n\nfloat PCF_Filter(sampler2D shadowMap, vec2 uv, float zReceiver, float filterRadius) {\n float sum = 0.0;\n for (int i = 0; i < PCF_NUM_SAMPLES; i++) {\n float depth = unpackRGBAToDepth(texture2D(shadowMap, uv + poissonDisk[ i ] * filterRadius));\n if (zReceiver <= depth) sum += 1.0;\n }\n for (int i = 0; i < PCF_NUM_SAMPLES; i++) {\n float depth = unpackRGBAToDepth(texture2D(shadowMap, uv + -poissonDisk[ i ].yx * filterRadius));\n if (zReceiver <= depth) sum += 1.0;\n }\n return sum / (2.0 * float(PCF_NUM_SAMPLES));\n}\n\nfloat PCSS(sampler2D shadowMap, vec4 coords) {\n vec2 uv = coords.xy;\n float zReceiver = coords.z; // Assumed to be eye-space z in this code\n initPoissonSamples(uv);\n float avgBlockerDepth = findBlocker(shadowMap, uv, zReceiver);\n if (avgBlockerDepth == -1.0) return 1.0;\n float penumbraRatio = penumbraSize(zReceiver, avgBlockerDepth);\n float filterRadius = penumbraRatio * LIGHT_SIZE_UV * NEAR_PLANE / zReceiver;\n return PCF_Filter(shadowMap, uv, zReceiver, filterRadius);\n}`)({...e})),t=t.replace("#if defined( SHADOWMAP_TYPE_PCF )","\nreturn PCSS(shadowMap, shadowCoord);\n#if defined( SHADOWMAP_TYPE_PCF )"),s.ShaderChunk.shadowmap_pars_fragment=t}};function xc(e){const t=e+"BufferGeometry";return i.forwardRef((({args:e,children:r,...a},s)=>i.createElement("mesh",n({ref:s},a),i.createElement(t,{attach:"geometry",args:e}),r)))}const bc=xc("box"),wc=xc("circle"),Ec=xc("cone"),Sc=xc("cylinder"),Mc=xc("sphere"),_c=xc("plane"),Tc=xc("tube"),Cc=xc("torus"),Ic=xc("torusKnot"),Bc=xc("tetrahedron"),Rc=xc("ring"),Pc=xc("polyhedron"),Fc=xc("icosahedron"),Lc=xc("octahedron"),Dc=xc("dodecahedron"),Uc=xc("extrude"),Nc=xc("lathe"),kc=1e-5;const Oc=i.forwardRef((function({args:[e=1,t=1,r=1]=[],radius:a=.05,steps:o=1,smoothness:l=4,children:c,...u},h){const d=i.useMemo((()=>function(e,t,r){const n=new s.Shape,i=r-kc;return n.absarc(kc,kc,kc,-Math.PI/2,-Math.PI,!0),n.absarc(kc,t-2*i,kc,Math.PI,Math.PI/2,!0),n.absarc(e-2*i,t-2*i,kc,Math.PI/2,0,!0),n.absarc(e-2*i,kc,kc,0,-Math.PI/2,!0),n}(e,t,a)),[e,t,a]),p=i.useMemo((()=>({depth:r-2*a,bevelEnabled:!0,bevelSegments:2*l,steps:o,bevelSize:a-kc,bevelThickness:a,curveSegments:l})),[r,a,l]),f=i.useRef();return i.useLayoutEffect((()=>{f.current&&f.current.center()}),[d,p]),i.createElement("mesh",n({ref:h},u),i.createElement("extrudeBufferGeometry",{attach:"geometry",ref:f,args:[d,p]}),c)}));function Gc(){const e=new s.BufferGeometry,t=new Float32Array([-1,-1,3,-1,-1,3]);return e.setAttribute("position",new s.BufferAttribute(t,2)),e}const zc=i.forwardRef((function({children:e,...t},r){const a=i.useMemo(Gc,[]);return i.createElement("mesh",n({ref:r,geometry:a,frustumCulled:!1},t),e)})),Vc=i.forwardRef((function({children:e,alignTop:t,...r},a){const o=i.useRef(null),l=i.useRef(null);return i.useLayoutEffect((()=>{o.current.position.set(0,0,0),o.current.updateWorldMatrix(!0,!0);const e=(new s.Box3).setFromObject(l.current),r=new s.Vector3,n=new s.Sphere,i=e.max.y-e.min.y;e.getCenter(r),e.getBoundingSphere(n),o.current.position.set(-r.x,-r.y+(t?i/2:0),-r.z)}),[e]),i.createElement("group",n({ref:a},r),i.createElement("group",{ref:o},i.createElement("group",{ref:l},e)))})),Hc=e=>e&&e.isOrthographicCamera,Qc=i.createContext(null);function jc({children:e,damping:t=6,fit:r,clip:n,observe:a,margin:l=1.2,eps:c=.01,onFit:u}){const h=i.useRef(null),{camera:d,invalidate:p,size:f,controls:m}=(0,o.useThree)(),g=i.useRef(u);function v(e,t){return Math.abs(e.x-t.x)<c&&Math.abs(e.y-t.y)<c&&Math.abs(e.z-t.z)<c}function A(e,t,r,n){e.x=s.MathUtils.damp(e.x,t.x,r,n),e.y=s.MathUtils.damp(e.y,t.y,r,n),e.z=s.MathUtils.damp(e.z,t.z,r,n)}g.current=u;const[y]=i.useState((()=>({animating:!1,focus:new s.Vector3,camera:new s.Vector3,zoom:1}))),[x]=i.useState((()=>({focus:new s.Vector3,camera:new s.Vector3,zoom:1}))),[b]=i.useState((()=>new s.Box3)),w=i.useMemo((()=>{function e(){const e=b.getSize(new s.Vector3),t=b.getCenter(new s.Vector3),r=Math.max(e.x,e.y,e.z),n=Hc(d)?4*r:r/(2*Math.atan(Math.PI*d.fov/360)),i=Hc(d)?4*r:n/d.aspect,a=l*Math.max(n,i);return{box:b,size:e,center:t,distance:a}}return{getSize:e,refresh(t){if((r=t)&&r.isBox3)b.copy(t);else{const e=t||h.current;e.updateWorldMatrix(!0,!0),b.setFromObject(e)}var r;if(b.isEmpty()){const e=d.position.length()||10;b.setFromCenterAndSize(new s.Vector3,new s.Vector3(e,e,e))}if("OrthographicTrackballControls"===(null==m?void 0:m.constructor.name)){const{distance:t}=e(),r=d.position.clone().sub(m.target).normalize().multiplyScalar(t),n=m.target.clone().add(r);d.position.copy(n)}return this},clip(){const{distance:t}=e();return m&&(m.maxDistance=10*t),d.near=t/100,d.far=100*t,d.updateProjectionMatrix(),m&&m.update(),p(),this},fit(){y.camera.copy(d.position),m&&y.focus.copy(m.target);const{center:r,distance:n}=e(),i=r.clone().sub(d.position).normalize().multiplyScalar(n);if(x.camera.copy(r).sub(i),x.focus.copy(r),Hc(d)){y.zoom=d.zoom;let e=0,n=0;const i=[new s.Vector3(b.min.x,b.min.y,b.min.z),new s.Vector3(b.min.x,b.max.y,b.min.z),new s.Vector3(b.min.x,b.min.y,b.max.z),new s.Vector3(b.min.x,b.max.y,b.max.z),new s.Vector3(b.max.x,b.max.y,b.max.z),new s.Vector3(b.max.x,b.max.y,b.min.z),new s.Vector3(b.max.x,b.min.y,b.max.z),new s.Vector3(b.max.x,b.min.y,b.min.z)];r.applyMatrix4(d.matrixWorldInverse);for(const t of i)t.applyMatrix4(d.matrixWorldInverse),e=Math.max(e,Math.abs(t.y-r.y)),n=Math.max(n,Math.abs(t.x-r.x));e*=2,n*=2;const a=(d.top-d.bottom)/e,o=(d.right-d.left)/n;x.zoom=Math.min(a,o)/l,t||(d.zoom=x.zoom,d.updateProjectionMatrix())}return t?y.animating=!0:(d.position.copy(x.camera),d.lookAt(x.focus),m&&(m.target.copy(x.focus),m.update())),g.current&&g.current(this.getSize()),p(),this}}}),[b,d,m,l,t,p]);i.useLayoutEffect((()=>{if(m){const e=()=>y.animating=!1;return m.addEventListener("start",e),()=>m.removeEventListener("start",e)}}),[m]);const E=i.useRef(0);return i.useLayoutEffect((()=>{(a||0==E.current++)&&(w.refresh(),r&&w.fit(),n&&w.clip())}),[f,n,r,a]),(0,o.useFrame)(((e,r)=>{if(y.animating){if(A(y.focus,x.focus,t,r),A(y.camera,x.camera,t,r),y.zoom=s.MathUtils.damp(y.zoom,x.zoom,t,r),d.position.copy(y.camera),Hc(d)&&(d.zoom=y.zoom,d.updateProjectionMatrix()),m?(m.target.copy(y.focus),m.update()):d.lookAt(y.focus),p(),Hc(d)&&!(Math.abs(y.zoom-x.zoom)<c))return;if(!Hc(d)&&!v(y.camera,x.camera))return;if(m&&!v(y.focus,x.focus))return;y.animating=!1}})),i.createElement("group",{ref:h},i.createElement(Qc.Provider,{value:w},e))}function Wc(){return i.useContext(Qc)}var Xc=r(13945);const Yc=i.forwardRef((({intensity:e=1,decay:t,decayRate:r=.65,maxYaw:n=.1,maxPitch:a=.1,maxRoll:s=.1,yawFrequency:l=.1,pitchFrequency:c=.1,rollFrequency:u=.1,controls:h},d)=>{const p=(0,o.useThree)((e=>e.camera)),f=(0,o.useThree)((e=>e.controls)),m=i.useRef(e),g=i.useRef(p.rotation.clone()),[v]=i.useState((()=>new Xc.L)),[A]=i.useState((()=>new Xc.L)),[y]=i.useState((()=>new Xc.L)),x=()=>{(m.current<0||m.current>1)&&(m.current=m.current<0?0:1)};return i.useImperativeHandle(d,(()=>({getIntensity:()=>m.current,setIntensity:e=>{m.current=e,x()}})),[]),i.useEffect((()=>{const e=f||(null==h?void 0:h.current),t=()=>{g.current=p.rotation.clone()};return null==e||e.addEventListener("change",t),()=>{null==e||e.removeEventListener("change",t)}}),[h,f]),(0,o.useFrame)((({clock:e},i)=>{const o=Math.pow(m.current,2),h=n*o*v.noise(e.elapsedTime*l,1),d=a*o*A.noise(e.elapsedTime*c,1),f=s*o*y.noise(e.elapsedTime*u,1);p.rotation.set(g.current.x+d,g.current.y+h,g.current.z+f),t&&m.current>0&&(m.current-=r*i,x())})),null})),qc=i.forwardRef((({children:e,speed:t=1,rotationIntensity:r=1,floatIntensity:n=1,...a},s)=>{const l=i.useRef(null),c=i.useRef(1e4*Math.random());return(0,o.useFrame)((e=>{const i=c.current+e.clock.getElapsedTime();l.current.rotation.x=Math.cos(i/4*t)/8*r,l.current.rotation.y=Math.sin(i/4*t)/8*r,l.current.rotation.z=Math.sin(i/4*t)/20*r,l.current.position.y=Math.sin(i/4*t)/10*n})),i.createElement("group",a,i.createElement("group",{ref:_([l,s])},e))}));var Kc=r(8197);const Jc={sunset:"venice/venice_sunset_1k.hdr",dawn:"kiara/kiara_1_dawn_1k.hdr",night:"dikhololo/dikhololo_night_1k.hdr",warehouse:"empty-wharehouse/empty_warehouse_01_1k.hdr",forest:"forrest-slope/forest_slope_1k.hdr",apartment:"lebombo/lebombo_1k.hdr",studio:"studio-small-3/studio_small_03_1k.hdr",city:"potsdamer-platz/potsdamer_platz_1k.hdr",park:"rooitou/rooitou_park_1k.hdr",lobby:"st-fagans/st_fagans_interior_1k.hdr"},Zc=e=>{return(t=e).current&&t.current.isScene?e.current:e;var t};function $c(e){return e.map?i.createElement(eu,e):e.children?i.createElement(tu,e):i.createElement(ru,e)}function eu({scene:e,background:t=!1,map:r}){const n=(0,o.useThree)((e=>e.scene));return i.useLayoutEffect((()=>{if(r){const i=Zc(e||n),a=i.background,s=i.environment;return"only"!==t&&(i.environment=r),t&&(i.background=r),()=>{"only"!==t&&(i.environment=s),t&&(i.background=a)}}}),[e,r]),null}function tu({children:e,near:t=1,far:r=1e3,resolution:n=256,frames:a=1,background:l=!1,scene:c,files:u,path:h,preset:d,extensions:p}){const f=(0,o.useThree)((e=>e.gl)),m=(0,o.useThree)((e=>e.scene)),g=i.useRef(null),[v]=i.useState((()=>new s.Scene)),A=i.useMemo((()=>{const e=new s.WebGLCubeRenderTarget(n);return e.texture.type=s.HalfFloatType,e}),[n]);i.useLayoutEffect((()=>{1===a&&g.current.update(f,v);const e=Zc(c||m),t=e.background,r=e.environment;return"only"!==l&&(e.environment=A.texture),l&&(e.background=A.texture),()=>{"only"!==l&&(e.environment=r),l&&(e.background=t)}}),[e,c]);let y=1;return(0,o.useFrame)((()=>{(a===1/0||y<a)&&(g.current.update(f,v),y++)})),i.createElement(i.Fragment,null,(0,o.createPortal)(i.createElement(i.Fragment,null,e,i.createElement("cubeCamera",{ref:g,args:[t,r,A]}),(u||d)&&i.createElement(eu,{background:!0,files:u,preset:d,path:h,extensions:p,scene:v})),v))}function ru({background:e=!1,files:t=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"],path:r="",preset:n,scene:a,extensions:l}){if(n){if(!(n in Jc))throw new Error("Preset must be one of: "+Object.keys(Jc).join(", "));t=Jc[n],r="https://market-assets.fra1.cdn.digitaloceanspaces.com/market-assets/hdris/"}const c=(0,o.useThree)((e=>e.scene)),u=Array.isArray(t),h=u?s.CubeTextureLoader:Kc.x,d=(0,o.useLoader)(h,u?[t]:t,(e=>{e.setPath(r),null==e.setDataType||e.setDataType(s.FloatType),l&&l(e)})),p=u?d[0]:d;return p.mapping=u?s.CubeReflectionMapping:s.EquirectangularReflectionMapping,i.useLayoutEffect((()=>{const t=Zc(a||c),r=t.background,n=t.environment;return"only"!==e&&(t.environment=p),e&&(t.background=p),()=>{"only"!==e&&(t.environment=n),e&&(t.background=r)}}),[p,e,a]),null}var nu=r(78466),iu=r(37312);const au=i.forwardRef((({scale:e,frames:t=1/0,opacity:r=1,width:a=1,height:l=1,blur:c=1,far:u=10,resolution:h=256,smooth:d=!0,color:p="#000000",...f},m)=>{const g=(0,o.useThree)((({scene:e})=>e)),v=(0,o.useThree)((({gl:e})=>e)),A=i.useRef(null);a*=Array.isArray(e)?e[0]:e||1,l*=Array.isArray(e)?e[1]:e||1;const[y,x,b,w,E,S,M]=i.useMemo((()=>{const e=new s.WebGLRenderTarget(h,h),t=new s.WebGLRenderTarget(h,h);t.texture.generateMipmaps=e.texture.generateMipmaps=!1;const r=new s.PlaneBufferGeometry(a,l).rotateX(Math.PI/2),n=new s.Mesh(r),i=new s.MeshDepthMaterial;i.depthTest=i.depthWrite=!1,i.onBeforeCompile=e=>{e.uniforms={...e.uniforms,ucolor:{value:new s.Color(p).convertSRGBToLinear()}},e.fragmentShader=e.fragmentShader.replace("void main() {","uniform vec3 ucolor;\n void main() {\n "),e.fragmentShader=e.fragmentShader.replace("vec4( vec3( 1.0 - fragCoordZ ), opacity );","vec4( ucolor, ( 1.0 - fragCoordZ ) * 1.0 );")};const o=new s.ShaderMaterial(nu.P),c=new s.ShaderMaterial(iu.Z);return c.depthTest=o.depthTest=!1,[e,r,i,n,o,c,t]}),[h,a,l,e]),_=i.useCallback((e=>{w.visible=!0,w.material=E,E.uniforms.tDiffuse.value=y.texture,E.uniforms.h.value=1*e/256,v.setRenderTarget(M),v.render(w,A.current),w.material=S,S.uniforms.tDiffuse.value=M.texture,S.uniforms.v.value=1*e/256,v.setRenderTarget(y),v.render(w,A.current),w.visible=!1}),[]);let T=0;return(0,o.useFrame)((()=>{if(A.current&&(t===1/0||T<t)){const e=g.background;g.background=null;const t=g.overrideMaterial;g.overrideMaterial=b,v.setRenderTarget(y),v.render(g,A.current),g.overrideMaterial=t,_(c),d&&_(.4*c),v.setRenderTarget(null),g.background=e,T++}})),i.createElement("group",n({"rotation-x":Math.PI/2},f,{ref:m}),i.createElement("mesh",{geometry:x,scale:[1,-1,1],rotation:[-Math.PI/2,0,0]},i.createElement("meshBasicMaterial",{map:y.texture,transparent:!0,opacity:r})),i.createElement("orthographicCamera",{ref:A,args:[-a/2,a/2,l/2,-l/2,0,u]}))})),su={rembrandt:{main:[1,2,1],fill:[-2,-.5,-2]},portrait:{main:[-1,2,.5],fill:[-1,.5,-1.5]},upfront:{main:[0,2,1],fill:[-1,.5,-1.5]},soft:{main:[-2,4,4],fill:[-1,.5,-1.5]}};function ou({children:e,controls:t,shadows:r=!0,adjustCamera:a=!0,environment:l="city",intensity:c=1,preset:u="rembrandt",shadowBias:h=0,contactShadow:d={blur:2,opacity:.5,position:[0,0,0]},...p}){const f=su[u],m=(0,o.useThree)((e=>e.camera)),g=(0,o.useThree)((e=>e.controls)),v=i.useRef(null),A=i.useRef(null),[{radius:y,width:x,height:b},w]=i.useState({radius:0,width:0,height:0});return i.useLayoutEffect((()=>{v.current.position.set(0,0,0),v.current.updateWorldMatrix(!0,!0);const e=(new s.Box3).setFromObject(A.current),t=new s.Vector3,r=new s.Sphere,n=e.max.y-e.min.y,i=e.max.x-e.min.x;e.getCenter(t),e.getBoundingSphere(r),w({radius:r.radius,width:i,height:n}),v.current.position.set(-t.x,-t.y+n/2,-t.z)}),[e]),i.useLayoutEffect((()=>{if(a){const e=y/(b>x?1.5:2.5);m.position.set(0,.5*y,2.5*y),m.near=.1,m.far=Math.max(5e3,4*y),m.lookAt(0,e,0);const r=g||(null==t?void 0:t.current);r&&(r.target.set(0,e,0),r.update())}}),[g,y,b,x,a]),i.createElement("group",p,i.createElement("group",{ref:v},i.createElement("group",{ref:A},e)),d&&i.createElement(au,n({scale:2*y,far:y/2},d)),l&&i.createElement($c,{preset:l}),i.createElement("ambientLight",{intensity:c/3}),i.createElement("spotLight",{penumbra:1,position:[f.main[0]*y,f.main[1]*y,f.main[2]*y],intensity:2*c,castShadow:r,"shadow-bias":h}),i.createElement("pointLight",{position:[f.fill[0]*y,f.fill[1]*y,f.fill[2]*y],intensity:c}))}const lu=e=>0===e?0:Math.pow(2,10*e-10);function cu({children:e,floor:t=.25,segments:r=20,receiveShadow:n,...a}){const s=i.useRef(null);return i.useLayoutEffect((()=>{let e=0;const n=r/r/2,i=s.current.attributes.position;for(let a=0;a<r+1;a++)for(let s=0;s<r+1;s++)i.setXYZ(e++,a/r-n+(0===a?-t:0),s/r-n,lu(a/r));i.needsUpdate=!0,s.current.computeVertexNormals()}),[r,t]),i.createElement("group",a,i.createElement("mesh",{receiveShadow:n,rotation:[-Math.PI/2,0,Math.PI/2]},i.createElement("planeGeometry",{ref:s,args:[1,1,r,r]}),e))}const uu=i.forwardRef((({fog:e=!1,colorStop:t=0,color:r="black",opacity:a=.5,...o},l)=>{const c=i.useMemo((()=>{const e=document.createElement("canvas");e.width=128,e.height=128;const n=e.getContext("2d"),i=n.createRadialGradient(e.width/2,e.height/2,0,e.width/2,e.height/2,e.width/2);return i.addColorStop(t,new s.Color(r).getStyle()),i.addColorStop(1,"rgba(0,0,0,0)"),n.fillStyle=i,n.fillRect(0,0,e.width,e.height),e}),[r,t]);return i.createElement("mesh",n({ref:l},o),i.createElement("planeBufferGeometry",{attach:"geometry",args:[1,1]}),i.createElement("meshBasicMaterial",{attach:"material",transparent:!0,opacity:a,fog:e},i.createElement("canvasTexture",{attach:"map",args:[c]})))}));(0,o.extend)({MeshReflectorMaterial:fc});const hu=i.forwardRef((({mixBlur:e=0,mixStrength:t=.5,resolution:r=256,blur:a=[0,0],args:l=[1,1],minDepthThreshold:c=.9,maxDepthThreshold:u=1,depthScale:h=0,depthToBlurRatioBias:d=.25,mirror:p=0,children:f,debug:m=0,distortion:g=1,mixContrast:v=1,distortionMap:A,...y},x)=>{i.useEffect((()=>{console.warn("Reflector has been deprecated and will be removed next major. Replace it with <MeshReflectorMaterial />!")}),[]);const b=(0,o.useThree)((({gl:e})=>e)),w=(0,o.useThree)((({camera:e})=>e)),E=(0,o.useThree)((({scene:e})=>e)),S=(a=Array.isArray(a)?a:[a,a])[0]+a[1]>0,M=i.useRef(null),[T]=i.useState((()=>new s.Plane)),[C]=i.useState((()=>new s.Vector3)),[I]=i.useState((()=>new s.Vector3)),[B]=i.useState((()=>new s.Vector3)),[R]=i.useState((()=>new s.Matrix4)),[P]=i.useState((()=>new s.Vector3(0,0,-1))),[F]=i.useState((()=>new s.Vector4)),[L]=i.useState((()=>new s.Vector3)),[D]=i.useState((()=>new s.Vector3)),[U]=i.useState((()=>new s.Vector4)),[N]=i.useState((()=>new s.Matrix4)),[k]=i.useState((()=>new s.PerspectiveCamera)),O=i.useCallback((()=>{if(I.setFromMatrixPosition(M.current.matrixWorld),B.setFromMatrixPosition(w.matrixWorld),R.extractRotation(M.current.matrixWorld),C.set(0,0,1),C.applyMatrix4(R),L.subVectors(I,B),L.dot(C)>0)return;L.reflect(C).negate(),L.add(I),R.extractRotation(w.matrixWorld),P.set(0,0,-1),P.applyMatrix4(R),P.add(B),D.subVectors(I,P),D.reflect(C).negate(),D.add(I),k.position.copy(L),k.up.set(0,1,0),k.up.applyMatrix4(R),k.up.reflect(C),k.lookAt(D),k.far=w.far,k.updateMatrixWorld(),k.projectionMatrix.copy(w.projectionMatrix),N.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),N.multiply(k.projectionMatrix),N.multiply(k.matrixWorldInverse),N.multiply(M.current.matrixWorld),T.setFromNormalAndCoplanarPoint(C,I),T.applyMatrix4(k.matrixWorldInverse),F.set(T.normal.x,T.normal.y,T.normal.z,T.constant);const e=k.projectionMatrix;U.x=(Math.sign(F.x)+e.elements[8])/e.elements[0],U.y=(Math.sign(F.y)+e.elements[9])/e.elements[5],U.z=-1,U.w=(1+e.elements[10])/e.elements[14],F.multiplyScalar(2/F.dot(U)),e.elements[2]=F.x,e.elements[6]=F.y,e.elements[10]=F.z+1,e.elements[14]=F.w}),[]),[G,z,V,H]=i.useMemo((()=>{const n={minFilter:s.LinearFilter,magFilter:s.LinearFilter,encoding:b.outputEncoding},i=new s.WebGLRenderTarget(r,r,n);i.depthBuffer=!0,i.depthTexture=new s.DepthTexture(r,r),i.depthTexture.format=s.DepthFormat,i.depthTexture.type=s.UnsignedShortType;const o=new s.WebGLRenderTarget(r,r,n);return[i,o,new pc({gl:b,resolution:r,width:a[0],height:a[1],minDepthThreshold:c,maxDepthThreshold:u,depthScale:h,depthToBlurRatioBias:d}),{mirror:p,textureMatrix:N,mixBlur:e,tDiffuse:i.texture,tDepth:i.depthTexture,tDiffuseBlur:o.texture,hasBlur:S,mixStrength:t,minDepthThreshold:c,maxDepthThreshold:u,depthScale:h,depthToBlurRatioBias:d,transparent:!0,debug:m,distortion:g,distortionMap:A,mixContrast:v,"defines-USE_BLUR":S?"":void 0,"defines-USE_DEPTH":h>0?"":void 0,"defines-USE_DISTORTION":A?"":void 0}]}),[b,a,N,r,p,S,e,t,c,u,h,d,m,g,A,v]);return(0,o.useFrame)((()=>{if(null==M||!M.current)return;M.current.visible=!1;const e=b.xr.enabled,t=b.shadowMap.autoUpdate;O(),b.xr.enabled=!1,b.shadowMap.autoUpdate=!1,b.setRenderTarget(G),b.state.buffers.depth.setMask(!0),b.autoClear||b.clear(),b.render(E,k),S&&V.render(b,G,z),b.xr.enabled=e,b.shadowMap.autoUpdate=t,M.current.visible=!0,b.setRenderTarget(null)})),i.createElement("mesh",n({ref:_([M,x])},y),i.createElement("planeBufferGeometry",{args:l}),f?f("meshReflectorMaterial",H):i.createElement("meshReflectorMaterial",H))}));class du extends s.ShaderMaterial{constructor(){super({uniforms:{depth:{value:null},opacity:{value:1},attenuation:{value:2.5},anglePower:{value:12},spotPosition:{value:new s.Vector3(0,0,0)},lightColor:{value:new s.Color("white")},cameraNear:{value:0},cameraFar:{value:1},resolution:{value:new s.Vector2(0,0)}},transparent:!0,depthWrite:!1,vertexShader:"\n varying vec3 vNormal;\n varying vec3 vWorldPosition;\n varying float vViewZ;\n varying float vIntensity;\n uniform vec3 spotPosition;\n uniform float attenuation; \n\n void main() {\n // compute intensity\n vNormal = normalize( normalMatrix * normal );\n vec4 worldPosition\t= modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n vec4 viewPosition = viewMatrix * worldPosition;\n vViewZ = viewPosition.z;\n float intensity\t= distance(worldPosition.xyz, spotPosition) / attenuation;\n intensity\t= 1.0 - clamp(intensity, 0.0, 1.0);\n vIntensity = intensity; \n // set gl_Position\n gl_Position\t= projectionMatrix * viewPosition;\n\n }",fragmentShader:"\n #include <packing>\n\n varying vec3 vNormal;\n varying vec3 vWorldPosition;\n uniform vec3 lightColor;\n uniform vec3 spotPosition;\n uniform float attenuation;\n uniform float anglePower;\n uniform sampler2D depth;\n uniform vec2 resolution;\n uniform float cameraNear;\n uniform float cameraFar;\n varying float vViewZ;\n varying float vIntensity;\n uniform float opacity;\n\n float readDepth( sampler2D depthSampler, vec2 coord ) {\n float fragCoordZ = texture2D( depthSampler, coord ).x;\n float viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\n return viewZ;\n }\n\n void main() {\n float d = 1.0;\n bool isSoft = resolution[0] > 0.0 && resolution[1] > 0.0;\n if (isSoft) {\n vec2 sUv = gl_FragCoord.xy / resolution;\n d = readDepth(depth, sUv);\n }\n float intensity = vIntensity;\n vec3 normal\t= vec3(vNormal.x, vNormal.y, abs(vNormal.z));\n float angleIntensity\t= pow( dot(normal, vec3(0.0, 0.0, 1.0)), anglePower );\n intensity\t*= angleIntensity;\n // fades when z is close to sampled depth, meaning the cone is intersecting existing geometry\n if (isSoft) {\n intensity\t*= smoothstep(0., 1., vViewZ - d);\n }\n gl_FragColor = vec4(lightColor, intensity * opacity);\n\n #include <tonemapping_fragment>\n\t #include <encodings_fragment>\n }"})}}const pu=new s.Vector3,fu=i.forwardRef((({opacity:e=1,radiusTop:t,radiusBottom:r,depthBuffer:a,color:l="white",distance:c=5,angle:u=.15,attenuation:h=5,anglePower:d=5,...p},f)=>{const m=i.useRef(null),g=(0,o.useThree)((e=>e.size)),v=(0,o.useThree)((e=>e.camera)),A=(0,o.useThree)((e=>e.viewport.dpr)),[y]=i.useState((()=>new du));t=void 0===t?.1:t,r=void 0===r?7*u:r,(0,o.useFrame)((()=>{y.uniforms.spotPosition.value.copy(m.current.getWorldPosition(pu)),m.current.lookAt(m.current.parent.target.getWorldPosition(pu))}));const x=i.useMemo((()=>{const e=new s.CylinderGeometry(t,r,c,128,64,!0);return e.applyMatrix4((new s.Matrix4).makeTranslation(0,-c/2,0)),e.applyMatrix4((new s.Matrix4).makeRotationX(-Math.PI/2)),e}),[u,c,t,r]);return i.createElement("spotLight",n({ref:f,angle:u,color:l,distance:c},p),i.createElement("mesh",{ref:m,geometry:x,raycast:()=>null},i.createElement("primitive",{object:y,attach:"material","uniforms-opacity-value":e,"uniforms-lightColor-value":l,"uniforms-attenuation-value":h,"uniforms-anglePower-value":d,"uniforms-depth-value":a,"uniforms-cameraNear-value":v.near,"uniforms-cameraFar-value":v.far,"uniforms-resolution-value":a?[g.width*A,g.height*A]:[0,0]})))})),mu=i.forwardRef((({args:e,map:t,toneMapped:r=!1,color:a="white",form:l="rect",intensity:c=1,scale:u=1,target:h,children:d,...p},f)=>{const m=i.useRef(null);return i.useLayoutEffect((()=>{d||p.material||((0,o.applyProps)(m.current.material,{color:a}),m.current.material.color.multiplyScalar(c))}),[a,c,d,p.material]),i.useLayoutEffect((()=>{h&&m.current.lookAt(Array.isArray(h)?new s.Vector3(...h):h)}),[h]),u=Array.isArray(u)&&2===u.length?[u[0],u[1],1]:u,i.createElement("mesh",n({ref:_([m,f]),scale:u},p),"circle"===l?i.createElement("ringGeometry",{args:[0,1,64]}):"ring"===l?i.createElement("ringGeometry",{args:[.5,1,64]}):"rect"===l?i.createElement("planeGeometry",null):i.createElement(l,{args:e}),d||(p.material?null:i.createElement("meshBasicMaterial",{toneMapped:r,map:t,side:s.DoubleSide})))}));var gu=r(48756);function vu(e,t,r=new s.Vector3){const n=Math.PI*(e-.5),i=2*Math.PI*(t-.5);return r.x=Math.cos(i),r.y=Math.sin(n),r.z=Math.sin(i),r}const Au=i.forwardRef((({inclination:e=.6,azimuth:t=.1,distance:r=1e3,mieCoefficient:a=.005,mieDirectionalG:o=.8,rayleigh:l=.5,turbidity:c=10,sunPosition:u=vu(e,t),...h},d)=>{const p=i.useMemo((()=>(new s.Vector3).setScalar(r)),[r]),[f]=i.useState((()=>new gu.q));return i.createElement("primitive",n({dispose:void 0,object:f,ref:d,"material-uniforms-mieCoefficient-value":a,"material-uniforms-mieDirectionalG-value":o,"material-uniforms-rayleigh-value":l,"material-uniforms-sunPosition-value":u,"material-uniforms-turbidity-value":c,scale:p},h))}));class yu extends s.ShaderMaterial{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:"\n uniform float time;\n attribute float size;\n varying vec3 vColor;\n void main() {\n vColor = color;\n vec4 mvPosition = modelViewMatrix * vec4(position, 0.5);\n gl_PointSize = size * (30.0 / -mvPosition.z) * (3.0 + sin(mvPosition.x + 2.0 * time + 100.0));\n gl_Position = projectionMatrix * mvPosition;\n }",fragmentShader:"\n uniform sampler2D pointTexture;\n uniform float fade;\n varying vec3 vColor;\n void main() {\n float opacity = 1.0;\n if (fade == 1.0) {\n float d = distance(gl_PointCoord, vec2(0.5, 0.5));\n opacity = 1.0 / (1.0 + exp(16.0 * (d - 0.25)));\n }\n gl_FragColor = vec4(vColor, opacity);\n\n #include <tonemapping_fragment>\n\t #include <encodings_fragment>\n }"})}}const xu=e=>(new s.Vector3).setFromSpherical(new s.Spherical(e,Math.acos(1-2*Math.random()),2*Math.random()*Math.PI)),bu=i.forwardRef((({radius:e=100,depth:t=50,count:r=5e3,saturation:n=0,factor:a=4,fade:l=!1},c)=>{const u=i.useRef(),[h,d,p]=i.useMemo((()=>{const i=[],o=[],l=Array.from({length:r},(()=>(.5+.5*Math.random())*a)),c=new s.Color;let u=e+t;const h=t/r;for(let e=0;e<r;e++)u-=h*Math.random(),i.push(...xu(u).toArray()),c.setHSL(e/r,n,.9),o.push(c.r,c.g,c.b);return[new Float32Array(i),new Float32Array(o),new Float32Array(l)]}),[r,t,a,e,n]);(0,o.useFrame)((e=>u.current&&(u.current.uniforms.time.value=e.clock.getElapsedTime())));const[f]=i.useState((()=>new yu));return i.createElement("points",{ref:c},i.createElement("bufferGeometry",{attach:"geometry"},i.createElement("bufferAttribute",{attachObject:["attributes","position"],args:[h,3]}),i.createElement("bufferAttribute",{attachObject:["attributes","color"],args:[d,3]}),i.createElement("bufferAttribute",{attachObject:["attributes","size"],args:[p,1]})),i.createElement("primitive",{dispose:void 0,ref:u,object:f,attach:"material",blending:s.AdditiveBlending,"uniforms-fade-value":l,transparent:!0,vertexColors:!0}))}));function wu({opacity:e=.5,speed:t=.4,width:r=10,depth:n=1.5,segments:a=20,texture:s="https://rawcdn.githack.com/pmndrs/drei-assets/9225a9f1fbd449d9411125c2f419b843d0308c9f/cloud.png",color:l="#ffffff",depthTest:c=!0,...u}){const h=i.useRef(),d=Oa(s),p=i.useMemo((()=>[...new Array(a)].map(((e,n)=>({x:r/2-Math.random()*r,y:r/2-Math.random()*r,scale:.4+Math.sin((n+1)/a*Math.PI)*(10*(.2+Math.random())),density:Math.max(.2,Math.random()),rotation:Math.max(.002,.005*Math.random())*t})))),[r,a,t]);return(0,o.useFrame)((e=>{var t;return null==(t=h.current)?void 0:t.children.forEach(((t,r)=>{t.children[0].rotation.z+=p[r].rotation,t.children[0].scale.setScalar(p[r].scale+(1+Math.sin(e.clock.getElapsedTime()/10))/2*r/10)}))})),i.createElement("group",u,i.createElement("group",{position:[0,0,a/2*n],ref:h},p.map((({x:t,y:r,scale:a,density:s},o)=>i.createElement(yi,{key:o,position:[t,r,-o*n]},i.createElement(_c,{scale:a,rotation:[0,0,0]},i.createElement("meshStandardMaterial",{map:d,transparent:!0,opacity:a/6*s*e,depthTest:c,color:l})))))))}function Eu(e=0,t=1024){const r=Ca((()=>fetch("https://cdn.jsdelivr.net/gh/pmndrs/drei-assets@master/matcaps.json").then((e=>e.json()))),["matcapList"]),n=r[0],a=i.useMemo((()=>Object.keys(r).length),[]),s=`${i.useMemo((()=>"string"==typeof e?e:"number"==typeof e?r[e]:null),[e])||n}${function(e){switch(e){case 64:return"-64px";case 128:return"-128px";case 256:return"-256px";case 512:return"-512px";default:return""}}(t)}.png`,o=`https://rawcdn.githack.com/emmelleppi/matcaps/9b36ccaaf0a24881a39062d05566c9e92be4aa0d/${t}/${s}`;return[Oa(o),o,a]}function Su(e=0,t={}){const{repeat:r=[1,1],anisotropy:n=1,offset:a=[0,0]}=t,o=Ca((()=>fetch("https://cdn.jsdelivr.net/gh/pmndrs/drei-assets@master/normals/normals.json").then((e=>e.json()))),["normalsList"]),l=i.useMemo((()=>Object.keys(o).length),[]),c=o[0],u=`https://rawcdn.githack.com/pmndrs/drei-assets/7a3104997e1576f83472829815b00880d88b32fb/normals/${o[e]||c}`,h=Oa(u);return i.useLayoutEffect((()=>{h&&(h.wrapS=h.wrapT=s.RepeatWrapping,h.repeat=new s.Vector2(r[0],r[1]),h.offset=new s.Vector2(a[0],a[1]),h.anisotropy=n)}),[h,n,r,a]),[h,u,l]}const Mu=new s.Matrix4,_u=new s.Matrix4,Tu=[],Cu=new s.Mesh;class Iu extends s.Group{constructor(){super(),this.color=new s.Color("white"),this.instance={current:void 0},this.instanceKey={current:void 0}}get geometry(){var e;return null==(e=this.instance.current)?void 0:e.geometry}raycast(e,t){const r=this.instance.current;if(!r)return;if(!r.geometry||!r.material)return;Cu.geometry=r.geometry;const n=r.matrixWorld;let i=r.userData.instances.indexOf(this.instanceKey);if(!(-1===i||i>r.count)){r.getMatrixAt(i,Mu),_u.multiplyMatrices(n,Mu),Cu.matrixWorld=_u,Cu.raycast(e,Tu);for(let e=0,r=Tu.length;e<r;e++){const r=Tu[e];r.instanceId=i,r.object=this,t.push(r)}Tu.length=0}}}let Bu,Ru;const Pu=i.createContext(null),Fu=new s.Matrix4,Lu=new s.Vector3;new s.Color;const Du=i.forwardRef((({children:e,range:t,limit:r=1e3,...a},l)=>{const c=i.useRef(null),[u,h]=i.useState([]),[[d,p,f]]=i.useState((()=>[new Float32Array(3*r),Float32Array.from({length:3*r},(()=>1)),Float32Array.from({length:r},(()=>1))]));i.useLayoutEffect((()=>{c.current.geometry.drawRange.count=Math.min(r,void 0!==t?t:r,u.length)}),[u,t]),i.useEffect((()=>{c.current.geometry.attributes.position.needsUpdate=!0})),(0,o.useFrame)((()=>{for(c.current.updateMatrix(),c.current.updateMatrixWorld(),Fu.copy(c.current.matrixWorld).invert(),Bu=0;Bu<u.length;Bu++)Ru=u[Bu].current,Lu.toArray(d,3*Bu),c.current.geometry.attributes.position.needsUpdate=!0,Ru.matrixWorldNeedsUpdate=!0,Ru.color.toArray(p,3*Bu),c.current.geometry.attributes.color.needsUpdate=!0,f.set([Ru.size],Bu),c.current.geometry.attributes.size.needsUpdate=!0}));const m=i.useMemo((()=>{const e={};for(Bu=0;Bu<u.length;Bu++){var t;Object.assign(e,null==(t=u[Bu].current)?void 0:t.__r3f.handlers)}return Object.keys(e).reduce(((e,t)=>({...e,[t]:e=>{var r,n,i;const a=null==(r=u[e.index])?void 0:r.current;return null==a||null==(n=a.__r3f)||null==(i=n.handlers)?void 0:i[t]({...e,object:a})}})),{})}),[e,u]),g=i.useMemo((()=>({subscribe:e=>(h((t=>[...t,e])),()=>h((t=>t.filter((t=>t.current!==e.current)))))})),[]);return i.createElement("points",n({matrixAutoUpdate:!1,ref:_([l,c])},m,a),i.createElement("bufferGeometry",null,i.createElement("bufferAttribute",{attachObject:["attributes","position"],count:d.length/3,array:d,itemSize:3,usage:s.DynamicDrawUsage}),i.createElement("bufferAttribute",{attachObject:["attributes","color"],count:p.length/3,array:p,itemSize:3,usage:s.DynamicDrawUsage}),i.createElement("bufferAttribute",{attachObject:["attributes","size"],count:f.length,array:f,itemSize:1,usage:s.DynamicDrawUsage})),i.createElement(Pu.Provider,{value:g},e))})),Uu=i.forwardRef((({children:e,...t},r)=>{i.useMemo((()=>(0,o.extend)({Position:Iu})),[]);const a=i.useRef(),{subscribe:s}=i.useContext(Pu);return i.useLayoutEffect((()=>s(a)),[]),i.createElement("position",n({ref:_([r,a])},t),e)})),Nu=i.forwardRef((({children:e,positions:t,colors:r,sizes:a,stride:l=3,...c},u)=>{const h=i.useRef(null);return(0,o.useFrame)((()=>{const e=h.current.geometry.attributes;e.position.needsUpdate=!0,r&&(e.color.needsUpdate=!0),a&&(e.size.needsUpdate=!0)})),i.createElement("points",n({ref:_([u,h])},c),i.createElement("bufferGeometry",null,i.createElement("bufferAttribute",{attachObject:["attributes","position"],count:t.length/l,array:t,itemSize:l,usage:s.DynamicDrawUsage}),r&&i.createElement("bufferAttribute",{attachObject:["attributes","color"],count:r.length/l,array:r,itemSize:3,usage:s.DynamicDrawUsage}),a&&i.createElement("bufferAttribute",{attachObject:["attributes","size"],count:a.length/l,array:a,itemSize:1,usage:s.DynamicDrawUsage})),e)})),ku=i.forwardRef(((e,t)=>e.positions instanceof Float32Array?i.createElement(Nu,n({},e,{ref:t})):i.createElement(Du,n({},e,{ref:t}))));var Ou=r(45697),Gu=r.n(Ou);function zu(e){return Vu(e.children,e.components)}function Vu(e,t,r){if(r=r||[],!t[0])return e(r);function n(n){return Vu(e,t.slice(1),r.concat([n]))}return"function"==typeof t[0]?t[0]({results:r,render:n}):(0,i.cloneElement)(t[0],{children:n})}let Hu,Qu;zu.propTypes={children:Gu().func.isRequired,components:Gu().arrayOf(Gu().oneOfType([Gu().element,Gu().func])).isRequired};const ju=i.createContext(null),Wu=new s.Matrix4,Xu=new s.Matrix4,Yu=new s.Matrix4;new s.Color;const qu=new s.Vector3,Ku=new s.Quaternion,Ju=new s.Vector3,Zu=i.forwardRef((({context:e,children:t,...r},a)=>{i.useMemo((()=>(0,o.extend)({Position:Iu})),[]);const s=i.useRef(),{subscribe:l,getParent:c}=i.useContext(e||ju);return i.useLayoutEffect((()=>l(s)),[]),i.createElement("position",n({instance:c(),instanceKey:s,ref:_([a,s])},r),t)})),$u=i.forwardRef((({children:e,range:t,limit:r=1e3,frames:a=1/0,...l},c)=>{const[{context:u,instance:h}]=i.useState((()=>{const e=i.createContext(null);return{context:e,instance:i.forwardRef(((t,r)=>i.createElement(Zu,n({context:e},t,{ref:r}))))}})),d=i.useRef(null),[p,f]=i.useState([]),[[m,g]]=i.useState((()=>{const e=new Float32Array(16*r);for(Hu=0;Hu<r;Hu++)Yu.identity().toArray(e,16*Hu);return[e,new Float32Array([...new Array(3*r)].map((()=>1)))]}));i.useLayoutEffect((()=>{d.current.count=d.current.instanceMatrix.updateRange.count=d.current.instanceColor.updateRange.count=Math.min(r,void 0!==t?t:r,p.length)}),[p,t]),i.useEffect((()=>{d.current.instanceMatrix.needsUpdate=!0}));let v=0;(0,o.useFrame)((()=>{if(a===1/0||v<a){for(d.current.updateMatrix(),d.current.updateMatrixWorld(),Wu.copy(d.current.matrixWorld).invert(),Hu=0;Hu<p.length;Hu++)Qu=p[Hu].current,Qu.matrixWorld.decompose(qu,Ku,Ju),Xu.compose(qu,Ku,Ju).premultiply(Wu),Xu.toArray(m,16*Hu),d.current.instanceMatrix.needsUpdate=!0,Qu.color.toArray(g,3*Hu),d.current.instanceColor.needsUpdate=!0;v++}}));const A=i.useMemo((()=>({getParent:()=>d,subscribe:e=>(f((t=>[...t,e])),()=>f((t=>t.filter((t=>t.current!==e.current)))))})),[]);return i.createElement("instancedMesh",n({userData:{instances:p},matrixAutoUpdate:!1,ref:_([c,d]),args:[null,null,0],raycast:()=>null},l),i.createElement("instancedBufferAttribute",{attach:"instanceMatrix",count:m.length/16,array:m,itemSize:16,usage:s.DynamicDrawUsage}),i.createElement("instancedBufferAttribute",{attach:"instanceColor",count:g.length/3,array:g,itemSize:3,usage:s.DynamicDrawUsage}),"function"==typeof e?i.createElement(u.Provider,{value:A},e(h)):i.createElement(ju.Provider,{value:A},e))}));function eh({meshes:e,children:t,...r}){const a=Array.isArray(e);if(!a)for(const n of Object.keys(e))e[n].isMesh||delete e[n];return i.createElement(zu,{components:(a?e:Object.values(e)).map((({geometry:e,material:t})=>i.createElement($u,n({key:e.uuid,geometry:e,material:t},r))))},(r=>a?t(...r):t(Object.keys(e).filter((t=>e[t].isMesh)).reduce(((e,t,n)=>({...e,[t]:r[n]})),{}))))}var th=r(3415);const rh=i.createContext(null),nh=e=>e instanceof s.Vector3?e.toArray():e,ih=i.forwardRef(((e,t)=>{const{limit:r=1e3,lineWidth:a=1,children:l,...c}=e,[u,h]=i.useState([]),[d]=i.useState((()=>new xi.w)),[p]=i.useState((()=>new bi.Y)),[f]=i.useState((()=>new th.z)),[m]=i.useState((()=>new s.Vector2(512,512))),[g]=i.useState((()=>Array(6*r).fill(0))),[v]=i.useState((()=>Array(6*r).fill(0))),A=i.useMemo((()=>({subscribe:e=>(h((t=>[...t,e])),()=>h((t=>t.filter((t=>t.current!==e.current)))))})),[]);return(0,o.useFrame)((()=>{for(let i=0;i<r;i++){var e;const r=null==(e=u[i])?void 0:e.current,a=r?nh(r.start):[0,0,0],o=r?nh(r.end):[0,0,0],l=r?(n=r.color)instanceof s.Color?n.toArray():n:[1,1,1];for(var t=0;t<3;t++)g[6*i+t]=a[t],g[6*i+t+3]=o[t],v[6*i+t]=l[t],v[6*i+t+3]=l[t]}var n;f.setColors(v),f.setPositions(g),d.computeLineDistances()})),i.createElement("primitive",{object:d,ref:t},i.createElement("primitive",{object:f,attach:"geometry"}),i.createElement("primitive",n({object:p,attach:"material",vertexColors:!0,resolution:m,linewidth:a},c)),i.createElement(rh.Provider,{value:A},l))}));class ah{constructor(){this.color=new s.Color("white"),this.start=new s.Vector3(0,0,0),this.end=new s.Vector3(0,0,0)}}const sh=i.forwardRef(((e,t)=>{const r=i.useContext(rh);if(!r)throw"Segment must used inside Segments component.";const a=i.useRef();return i.useMemo((()=>(0,o.extend)({SegmentObject:ah})),[]),i.useLayoutEffect((()=>r.subscribe(a)),[]),i.createElement("segmentObject",n({ref:_([a,t])},e))})),oh=i.forwardRef((({children:e,distances:t,...r},a)=>{const s=i.useRef(null);return i.useLayoutEffect((()=>{const{current:e}=s;e.levels.length=0,e.children.forEach(((r,n)=>e.levels.push({object:r,distance:t[n]})))})),(0,o.useFrame)((e=>{var t;return null==(t=s.current)?void 0:t.update(e.camera)})),i.createElement("lOD",n({ref:_([s,a])},r),e)}));function lh({all:e,scene:t,camera:r}){const n=(0,o.useThree)((({gl:e})=>e)),a=(0,o.useThree)((({camera:e})=>e)),l=(0,o.useThree)((({scene:e})=>e));return i.useLayoutEffect((()=>{const i=[];e&&(t||l).traverse((e=>{!1===e.visible&&(i.push(e),e.visible=!0)})),n.compile(t||l,r||a);const o=new s.WebGLCubeRenderTarget(128);new s.CubeCamera(.01,1e5,o).update(n,t||l),o.dispose(),i.forEach((e=>e.visible=!1))}),[]),null}function ch(){const e=(0,o.useThree)((e=>e.gl));return(0,i.useEffect)((()=>(e.shadowMap.autoUpdate=!1,e.shadowMap.needsUpdate=!0,()=>{e.shadowMap.autoUpdate=e.shadowMap.needsUpdate=!0})),[e.shadowMap]),null}const uh=new s.Matrix4,hh=new s.Ray,dh=new s.Sphere,ph=new s.Vector3;function fh(e,t){const r=this.geometry,n=this.material,i=this.matrixWorld;void 0!==n&&(null===r.boundingSphere&&r.computeBoundingSphere(),dh.copy(r.boundingSphere),dh.applyMatrix4(i),!1!==e.ray.intersectsSphere(dh)&&(uh.copy(i).invert(),hh.copy(e.ray).applyMatrix4(uh),null!==r.boundingBox&&null===hh.intersectBox(r.boundingBox,ph)||t.push({distance:ph.distanceTo(e.ray.origin),point:ph.clone(),object:this})))}function mh({pixelated:e}){const t=(0,o.useThree)((e=>e.gl)),r=(0,o.useThree)((e=>e.internal.active)),n=(0,o.useThree)((e=>e.performance.current)),a=(0,o.useThree)((e=>e.viewport.initialDpr)),s=(0,o.useThree)((e=>e.setDpr));return i.useEffect((()=>{const n=t.domElement;return()=>{r&&s(a),e&&n&&(n.style.imageRendering="auto")}}),[]),i.useEffect((()=>{s(n*a),e&&t.domElement&&(t.domElement.style.imageRendering=1===n?"auto":"pixelated")}),[n]),null}function gh(){const e=(0,o.useThree)((e=>e.get)),t=(0,o.useThree)((e=>e.performance.current));return i.useEffect((()=>{const t=e().raycaster.enabled;return()=>{e().raycaster.enabled=t}}),[]),i.useEffect((()=>{e().raycaster.enabled=1===t}),[t]),null}},64232:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Canvas:()=>K,ReactThreeFiber:()=>w,_roots:()=>ne,act:()=>pe,addAfterEffect:()=>V,addEffect:()=>z,addTail:()=>H,advance:()=>se,applyProps:()=>le,context:()=>D,createPortal:()=>me,dispose:()=>de,events:()=>W,extend:()=>P,invalidate:()=>ae,reconciler:()=>oe,render:()=>ce,unmountComponentAtNode:()=>he,useFrame:()=>Z,useGraph:()=>ee,useLoader:()=>re,useThree:()=>J});var n=r(99477),i=r(67294),a=r(14671),s=r(60374),o=r(76525),l=r.n(o),c=r(63840),u=r(64063),h=r.n(u);const d=[];function p(e,t,r,n=0,i=!1){for(const s of t)if(h()(r,s.args)){if(i)return;if(s.error)throw s.error;if(s.response)return s.response;throw s.promise}const a={args:r,promise:e(...r).then((e=>a.response=null==e||e)).catch((e=>a.error=null!=e?e:"unknown error")).then((()=>{n>0&&setTimeout((()=>{const e=t.indexOf(a);-1!==e&&t.splice(e,1)}),n)}))};if(t.push(a),!i)throw a.promise}function f(e,...t){if(void 0===t||0===t.length)e.splice(0,e.length);else{const r=e.find((e=>h()(t,e.args)));if(r){const t=e.indexOf(r);-1!==t&&e.splice(t,1)}}}function m(e,...t){return p(e,d,t,m.lifespan)}m.lifespan=0,m.clear=(...e)=>f(d,...e),m.preload=(e,...t)=>{p(e,d,t,m.lifespan,!0)},m.peek=(...e)=>{var t;return null==(t=d.find((t=>h()(e,t.args))))?void 0:t.response};var g=r(20296),v=r.n(g);function A(e){let{debounce:t,scroll:r,polyfill:n,offsetSize:a}=void 0===e?{debounce:0,scroll:!1,offsetSize:!1}:e;const s=n||("undefined"==typeof window?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,l]=(0,i.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=(0,i.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),u=t?"number"==typeof t?t:t.scroll:null,h=t?"number"==typeof t?t:t.resize:null,d=(0,i.useRef)(!1);(0,i.useEffect)((()=>(d.current=!0,()=>{d.current=!1})));const[p,f,m]=(0,i.useMemo)((()=>{const e=()=>{if(!c.current.element)return;const{left:e,top:t,width:r,height:n,bottom:i,right:s,x:o,y:u}=c.current.element.getBoundingClientRect(),h={left:e,top:t,width:r,height:n,bottom:i,right:s,x:o,y:u};c.current.element instanceof HTMLElement&&a&&(h.height=c.current.element.offsetHeight,h.width=c.current.element.offsetWidth),Object.freeze(h),d.current&&!b(c.current.lastBounds,h)&&l(c.current.lastBounds=h)};return[e,h?v()(e,h):e,u?v()(e,u):e]}),[l,a,u,h]);function g(){c.current.scrollContainers&&(c.current.scrollContainers.forEach((e=>e.removeEventListener("scroll",m,!0))),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null)}function A(){c.current.element&&(c.current.resizeObserver=new s(m),c.current.resizeObserver.observe(c.current.element),r&&c.current.scrollContainers&&c.current.scrollContainers.forEach((e=>e.addEventListener("scroll",m,{capture:!0,passive:!0}))))}var x,w,E;return x=m,w=Boolean(r),(0,i.useEffect)((()=>{if(w){const e=x;return window.addEventListener("scroll",e,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",e,!0)}}}),[x,w]),E=f,(0,i.useEffect)((()=>{const e=E;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[E]),(0,i.useEffect)((()=>{g(),A()}),[r,m,f]),(0,i.useEffect)((()=>g),[]),[e=>{e&&e!==c.current.element&&(g(),c.current.element=e,c.current.scrollContainers=y(e),A())},o,p]}function y(e){const t=[];if(!e||e===document.body)return t;const{overflow:r,overflowX:n,overflowY:i}=window.getComputedStyle(e);return[r,n,i].some((e=>"auto"===e||"scroll"===e))&&t.push(e),[...t,...y(e.parentElement)]}const x=["x","y","top","bottom","left","right","width","height"],b=(e,t)=>x.every((r=>e[r]===t[r]));var w=Object.freeze({__proto__:null});const E={obj:e=>e===Object(e)&&!E.arr(e)&&"function"!=typeof e,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e,arr:e=>Array.isArray(e),equ(e,t){if(typeof e!=typeof t||!!e!=!!t)return!1;if(E.str(e)||E.num(e)||E.obj(e))return e===t;if(E.arr(e)&&e==t)return!0;let r;for(r in e)if(!(r in t))return!1;for(r in t)if(e[r]!==t[r])return!1;return!E.und(r)||e===t}};function S(e){return(e.eventObject||e.object).uuid+"/"+e.index}function M(e){const t=new n.Vector3;function r(t){const{internal:r}=e.getState(),n=t.offsetX-r.initialClick[0],i=t.offsetY-r.initialClick[1];return Math.round(Math.sqrt(n*n+i*i))}function i(e){return e.filter((e=>["Move","Over","Enter","Out","Leave"].some((t=>{var r;return null==(r=e.__r3f.handlers)?void 0:r["onPointer"+t]}))))}function a(t){const{internal:r}=e.getState();Array.from(r.hovered.values()).forEach((e=>{if(!t.length||!t.find((t=>t.object===e.object&&t.index===e.index))){const n=e.eventObject.__r3f.handlers;if(r.hovered.delete(S(e)),n){const r={...e,intersections:t||[]};null==n.onPointerOut||n.onPointerOut(r),null==n.onPointerLeave||n.onPointerLeave(r)}}}))}function s(e,t){t.forEach((t=>{var r;return null==(r=t.__r3f.handlers)||null==r.onPointerMissed?void 0:r.onPointerMissed(e)}))}return{handlePointer:n=>{switch(n){case"onPointerLeave":case"onPointerCancel":return()=>a([]);case"onLostPointerCapture":return t=>{"pointerId"in t&&e.getState().internal.capturedMap.delete(t.pointerId),a([])}}return o=>{const{onPointerMissed:l,internal:c}=e.getState();!function(t){var r;const n=e.getState(),{raycaster:i,mouse:a,camera:s,size:o}=n,{offsetX:l,offsetY:c}=null!=(r=null==i.computeOffsets?void 0:i.computeOffsets(t,n))?r:t,{width:u,height:h}=o;a.set(l/u*2-1,-c/h*2+1),i.setFromCamera(a,s)}(o);const u="onPointerMove"===n,h=function(t,r){const{internal:n}=e.getState();return"pointerId"in r&&n.capturedMap.has(r.pointerId)&&t.push(...n.capturedMap.get(r.pointerId).values()),t}(function(t){const r=e.getState(),{raycaster:n,internal:i}=r;if(!n.enabled)return[];const a=new Set,s=[],o=t?t(i.interaction):i.interaction;let l=n.intersectObjects(o,!0).filter((e=>{const t=S(e);return!a.has(t)&&(a.add(t),!0)}));n.filter&&(l=n.filter(l,r));for(const e of l){let t=e.object;for(;t;){var c;(null==(c=t.__r3f)?void 0:c.handlers)&&s.push({...e,eventObject:t}),t=t.parent}}return s}(u?i:void 0),o);u&&a(h),function(n,i,s){const{raycaster:o,mouse:l,camera:c,internal:u}=e.getState();if(n.length){const e=t.set(l.x,l.y,0).unproject(c),h="click"===i.type?r(i):0,d=e=>i.target.releasePointerCapture(e),p={stopped:!1};for(const t of n){const r=e=>{var r,n;return null!=(r=null==(n=u.capturedMap.get(e))?void 0:n.has(t.eventObject))&&r},f=e=>{u.capturedMap.has(e)?u.capturedMap.get(e).set(t.eventObject,t):u.capturedMap.set(e,new Map([[t.eventObject,t]])),i.target.setPointerCapture(e)};let m={};for(let e in Object.getPrototypeOf(i)){let t=i[e];"function"!=typeof t&&(m[e]=t)}let g={...t,...m,spaceX:l.x,spaceY:l.y,intersections:n,stopped:p.stopped,delta:h,unprojectedPoint:e,ray:o.ray,camera:c,stopPropagation:()=>{const e="pointerId"in i&&u.capturedMap.get(i.pointerId);(!e||e.has(t.eventObject))&&(g.stopped=p.stopped=!0,u.hovered.size&&Array.from(u.hovered.values()).find((e=>e.eventObject===t.eventObject)))&&a([...n.slice(0,n.indexOf(t)),t])},target:{hasPointerCapture:r,setPointerCapture:f,releasePointerCapture:d},currentTarget:{hasPointerCapture:r,setPointerCapture:f,releasePointerCapture:d},sourceEvent:i,nativeEvent:i};if(s(g),!0===p.stopped)break}}}(h,o,(e=>{const t=e.eventObject,r=t.__r3f.handlers;if(r)if(u){if(r.onPointerOver||r.onPointerEnter||r.onPointerOut||r.onPointerLeave){const t=S(e),n=c.hovered.get(t);n?n.stopped&&e.stopPropagation():(c.hovered.set(t,e),null==r.onPointerOver||r.onPointerOver(e),null==r.onPointerEnter||r.onPointerEnter(e))}null==r.onPointerMove||r.onPointerMove(e)}else{const i=null==r?void 0:r[n];i&&("onClick"!==n&&"onContextMenu"!==n&&"onDoubleClick"!==n||c.initialHits.includes(t))&&(i(e),s(o,c.interaction.filter((e=>e!==t))))}})),"onPointerDown"===n&&(c.initialClick=[o.offsetX,o.offsetY],c.initialHits=h.map((e=>e.eventObject))),"onClick"!==n&&"onContextMenu"!==n&&"onDoubleClick"!==n||h.length||r(o)<=2&&(s(o,c.interaction),l&&l(o))}}}}const _=e=>e&&!!e.getState,T=(e,t)=>{var r,n;return{root:_(e)?e:null!=(r=null==(n=e.__r3f)?void 0:n.root)?r:t.__r3f.root,container:_(e)?e.getState().scene:e}},C="__default",I={},B=["children","key","ref"];let R={},P=e=>{R={...R,...e}};function F(e,t){const r=e;return(null!=t&&t.instance||!r.__r3f)&&(r.__r3f={root:null,memoizedProps:{},objects:[],...t}),e}const L=e=>e&&e.isOrthographicCamera,D=i.createContext(null);function U(e,t){const r=t.length;return t.push(e),()=>{t.splice(r,1)}}let N,k=[],O=[],G=[];const z=e=>U(e,k),V=e=>U(e,O),H=e=>U(e,G);function Q(e,t){for(N=0;N<e.length;N++)e[N](t)}function j(e,t){let r=t.clock.getDelta();for("never"===t.frameloop&&"number"==typeof e&&(r=e-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=e),N=0;N<t.internal.subscribers.length;N++)t.internal.subscribers[N].ref.current(t,r);return!t.internal.priority&&t.gl.render&&t.gl.render(t.scene,t.camera),t.internal.frames=Math.max(0,t.internal.frames-1),"always"===t.frameloop?1:t.internal.frames}function W(e){const{handlePointer:t}=M(e),r={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};return{connected:!1,handlers:Object.keys(r).reduce(((e,r)=>({...e,[r]:t(r)})),{}),connect:t=>{var n;const{set:i,events:a}=e.getState();null==a.disconnect||a.disconnect(),i((e=>({events:{...e.events,connected:t}}))),Object.entries(null!=(n=null==a?void 0:a.handlers)?n:[]).forEach((([e,n])=>{const[i,a]=r[e];t.addEventListener(i,n,{passive:a})}))},disconnect:()=>{const{set:t,events:n}=e.getState();var i;n.connected&&(Object.entries(null!=(i=n.handlers)?i:[]).forEach((([e,t])=>{if(n&&n.connected instanceof HTMLElement){const[i]=r[e];n.connected.removeEventListener(i,t)}})),t((e=>({events:{...e.events,connected:!1}}))))}}}const X="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function Y({set:e}){return X((()=>(e(new Promise((()=>null))),()=>e(!1))),[]),null}class q extends i.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}function K({children:e,fallback:t,tabIndex:r,resize:n,id:a,style:s,className:o,events:l,...c}){const[u,h]=A({scroll:!0,debounce:{scroll:50,resize:0},...n}),d=i.useRef(null),[p,f]=i.useState(!1),[m,g]=i.useState(!1);if(p)throw p;if(m)throw m;return X((()=>{h.width>0&&h.height>0&&ce(i.createElement(q,{set:g},i.createElement(i.Suspense,{fallback:i.createElement(Y,{set:f})},e)),d.current,{...c,size:h,events:l||W})}),[h,e]),X((()=>{const e=d.current;return()=>he(e)}),[]),i.createElement("div",{ref:u,id:a,className:o,tabIndex:r,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",...s}},i.createElement("canvas",{ref:d,style:{display:"block"}},t))}function J(e=(e=>e),t){const r=i.useContext(D);if(!r)throw"R3F hooks can only be used within the Canvas component!";return r(e,t)}function Z(e,t=0){const{subscribe:r}=i.useContext(D).getState().internal,n=i.useRef(e);return i.useLayoutEffect((()=>{n.current=e}),[e]),i.useLayoutEffect((()=>{const e=r(n,t);return()=>e()}),[t,r]),null}function $(e){const t={nodes:{},materials:{}};return e&&e.traverse((e=>{e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material)})),t}function ee(e){return i.useMemo((()=>$(e)),[e])}function te(e,t){return function(r,...n){const i=new r;return e&&e(i),Promise.all(n.map((e=>new Promise(((r,n)=>i.load(e,(e=>{e.scene&&Object.assign(e,$(e.scene)),r(e)}),t,(t=>n(`Could not load ${e}: ${t.message}`))))))))}}function re(e,t,r,n){const i=Array.isArray(t)?t:[t],a=m(te(r,n),e,...i);return Array.isArray(t)?a:a[0]}q.getDerivedStateFromError=()=>({error:!0}),re.preload=function(e,t,r){const n=Array.isArray(t)?t:[t];return m.preload(te(r),e,...n)};const ne=new Map,ie=["legacy","blocking","concurrent"],{invalidate:ae,advance:se}=function(e){let t,r=!1;function n(i){if(r=!0,t=0,Q(k,i),e.forEach((e=>{const r=e.store.getState();r.internal.active&&("always"===r.frameloop||r.internal.frames>0)&&(t+=j(i,r))})),Q(O,i),t>0)return requestAnimationFrame(n);Q(G,i),r=!1}return{loop:n,invalidate:function t(i){if(!i)return e.forEach((e=>t(e.store.getState())));!i.vr&&i.internal.active&&"never"!==i.frameloop&&(i.internal.frames=Math.min(60,i.internal.frames+1),r||(r=!0,requestAnimationFrame(n)))},advance:function(t,r=!0,n){r&&Q(k,t),n?j(t,n):e.forEach((e=>j(t,e.store.getState()))),r&&Q(O,t)}}}(ne),{reconciler:oe,applyProps:le}=function(e){function t(e,t,a={},s=!1){var o,l,c;const u=null!=(o=null==e?void 0:e.__r3f)?o:{},h=u.root,d=null!=(l=null==h||null==h.getState?void 0:h.getState())?l:{},p=[],f=[],m={};let g=0;Object.entries(t).forEach((([e,t])=>{-1===B.indexOf(e)&&(m[e]=t)})),u.memoizedProps&&u.memoizedProps.args&&(m.args=u.memoizedProps.args),u.memoizedProps&&u.memoizedProps.attach&&(m.attach=u.memoizedProps.attach),e.__r3f&&(e.__r3f.memoizedProps=m);let v=Object.keys(t);for(g=0;g<v.length;g++)E.equ(t[v[g]],a[v[g]])&&p.push(v[g]),E.fun(t[v[g]])&&/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(v[g])&&f.push(v[g]);const A=[];if(s)for(v=Object.keys(a),g=0;g<v.length;g++)t.hasOwnProperty(v[g])||A.push(v[g]);const y=[...p,...B];null!=(c=e.__r3f)&&c.instance&&y.push("object");const x={...t};for(v=Object.keys(x),g=0;g<v.length;g++)y.indexOf(v[g])>-1&&delete x[v[g]];const b=Object.entries(x);for(g=0;g<A.length;g++)"children"!==A[g]&&b.unshift([A[g],C+"remove"]);if(b.length>0){if(b.forEach((([t,i])=>{if(!f.includes(t)){let a=e,s=a[t];if(t.includes("-")){const r=t.split("-");if(s=r.reduce(((e,t)=>e[t]),e),!s||!s.set){const[n,...i]=r.reverse();a=i.reverse().reduce(((e,t)=>e[t]),e),t=n}}if(i===C+"remove")if(s&&s.constructor)i=new s.constructor(m.args);else if(a.constructor){const e=new a.constructor(a.__r3f.memoizedProps.args);i=e[s],e.dispose&&e.dispose()}else i=0;if(s&&s.set&&(s.copy||s instanceof n.Layers)){if(Array.isArray(i))s.fromArray?s.fromArray(i):s.set(...i);else if(s.copy&&i&&i.constructor&&s.constructor.name===i.constructor.name)s.copy(i);else if(void 0!==i){const e=s instanceof n.Color;!e&&s.setScalar?s.setScalar(i):s instanceof n.Layers&&i instanceof n.Layers?s.mask=i.mask:s.set(i),!d.linear&&e&&s.convertSRGBToLinear()}}else a[t]=i,!d.linear&&a[t]instanceof n.Texture&&(a[t].encoding=n.sRGBEncoding);r(e)}})),s&&h&&e.raycast&&u.handlers){u.handlers=void 0;const t=d.internal.interaction.indexOf(e);t>-1&&d.internal.interaction.splice(t,1)}f.length&&(s&&h&&e.raycast&&d.internal.interaction.push(e),u.handlers=f.reduce(((e,r)=>({...e,[r]:t[r]})),{})),e.parent&&i(e)}}function r(e){var t,r;const n=null==(t=e.__r3f)||null==(r=t.root)||null==r.getState?void 0:r.getState();n&&0===n.internal.frames&&n.invalidate()}function i(e){null==e.onUpdate||e.onUpdate(e)}function a(e,{args:r=[],...i},a,s,o){let l,c=`${e[0].toUpperCase()}${e.slice(1)}`;if(!_(a)&&o){const e=t=>t.return?e(t.return):t.stateNode&&t.stateNode.containerInfo;a=e(o)}if(!a||!_(a))throw`No valid root for ${c}!`;if("primitive"===e){if(void 0===i.object)throw"Primitives without 'object' are invalid!";l=F(i.object,{root:a,instance:!0})}else{const e=R[c]||n[c];if(!e)throw`${c} is not part of the THREE namespace! Did you forget to extend? See: https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#using-3rd-party-objects-declaratively`;const t=E.arr(r);l=F(t?new e(...r):new e(r),{root:a,memoizedProps:{args:t&&0===r.length?null:r}})}return c.endsWith("Geometry")?i={attach:"geometry",...i}:c.endsWith("Material")&&(i={attach:"material",...i}),t(l,i,{}),l}function s(e,t){let n=!1;t&&(t.attachArray?(E.arr(e[t.attachArray])||(e[t.attachArray]=[]),e[t.attachArray].push(t)):t.attachObject?(E.obj(e[t.attachObject[0]])||(e[t.attachObject[0]]={}),e[t.attachObject[0]][t.attachObject[1]]=t):t.attach&&!E.fun(t.attach)?e[t.attach]=t:t.isObject3D&&(e.add(t),n=!0),n||(e.__r3f.objects.push(t),t.parent=e),i(t),r(t))}function o(e,t,n){let a=!1;if(t){if(t.attachArray){const r=e[t.attachArray];E.arr(r)||(e[t.attachArray]=[]),r.splice(r.indexOf(n),0,t)}else{if(t.attachObject||t.attach&&!E.fun(t.attach))return a=!0,s(e,t);if(t.isObject3D){t.parent=e,t.dispatchEvent({type:"added"});const r=e.children.filter((e=>e!==t)),i=r.indexOf(n);e.children=[...r.slice(0,i),t,...r.slice(i)],a=!0}}a||(e.__r3f.objects.push(t),t.parent=e),i(t),r(t)}}function u(e,t,r=!1){e&&[...e].forEach((e=>h(t,e,r)))}function h(e,t,n){if(t){var i;if(e.__r3f.objects){const r=e.__r3f.objects.length;e.__r3f.objects=e.__r3f.objects.filter((e=>e!==t));e.__r3f.objects.length<r&&(t.parent=null)}if(t.attachArray)e[t.attachArray]=e[t.attachArray].filter((e=>e!==t));else if(t.attachObject)delete e[t.attachObject[0]][t.attachObject[1]];else if(t.attach&&!E.fun(t.attach))e[t.attach]=null;else if(t.isObject3D){var a;e.remove(t),null!=(a=t.__r3f)&&a.root&&function(e,t){const{internal:r}=e.getState();r.interaction=r.interaction.filter((e=>e!==t)),r.initialHits=r.initialHits.filter((e=>e!==t)),r.hovered.forEach(((e,n)=>{e.eventObject!==t&&e.object!==t||r.hovered.delete(n)}))}(t.__r3f.root,t)}const o=null==(i=t.__r3f)?void 0:i.instance,l=void 0===n?null!==t.dispose&&!o:n;var s;if(!o)u(null==(s=t.__r3f)?void 0:s.objects,t,l),u(t.children,t,l);t.__r3f&&(delete t.__r3f.root,delete t.__r3f.objects,delete t.__r3f.handlers,delete t.__r3f.memoizedProps,o||delete t.__r3f),l&&t.dispose&&"Scene"!==t.type&&(0,c.unstable_runWithPriority)(c.unstable_IdlePriority,(()=>t.dispose())),r(e)}}function d(e,t,r,n){const i=e.parent;if(!i)return;const o=a(t,r,e.__r3f.root);e.children&&(e.children.forEach((e=>s(o,e))),e.children=[]),e.__r3f.objects.forEach((e=>s(o,e))),e.__r3f.objects=[],h(i,e),s(i,o),[n,n.alternate].forEach((e=>{null!==e&&(e.stateNode=o,e.ref&&("function"==typeof e.ref?e.ref(o):e.ref.current=o))}))}return{reconciler:l()({now:c.unstable_now,createInstance:a,removeChild:h,appendChild:s,appendInitialChild:s,insertBefore:o,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,scheduleTimeout:E.fun(setTimeout)?setTimeout:void 0,cancelTimeout:E.fun(clearTimeout)?clearTimeout:void 0,setTimeout:E.fun(setTimeout)?setTimeout:void 0,clearTimeout:E.fun(clearTimeout)?clearTimeout:void 0,noTimeout:-1,appendChildToContainer:(e,t)=>{const{container:r,root:n}=T(e,t);r.__r3f.root=n,s(r,t)},removeChildFromContainer:(e,t)=>{const{container:r}=T(e,t);h(r,t)},insertInContainerBefore:(e,t,r)=>{const{container:n}=T(e,t);o(n,t,r)},commitUpdate(e,r,n,i,a,s){if(e.__r3f.instance&&a.object&&a.object!==e)d(e,n,a,s);else{const{args:r=[],...o}=a,{args:l=[],...c}=i;r.some(((e,t)=>E.obj(e)?Object.entries(e).some((([e,r])=>r!==l[t][e])):e!==l[t]))?d(e,n,a,s):t(e,o,c,!0)}},hideInstance(e){e.isObject3D&&(e.visible=!1,r(e))},unhideInstance(e,t){(e.isObject3D&&null==t.visible||t.visible)&&(e.visible=!0,r(e))},hideTextInstance(){throw new Error("Text is not allowed in the R3F tree.")},getPublicInstance:e=>e,getRootHostContext:e=>I,getChildHostContext:e=>I,createTextInstance(){},finalizeInitialChildren:e=>!!e.__r3f.handlers,commitMount(e){e.raycast&&e.__r3f.handlers&&e.__r3f.root.getState().internal.interaction.push(e)},prepareUpdate:()=>I,shouldDeprioritizeSubtree:()=>!1,prepareForCommit:()=>null,preparePortalMount(...e){},resetAfterCommit(){},shouldSetTextContent:()=>!1,clearContainer:()=>!1}),applyProps:t}}();function ce(e,t,{gl:r,size:o,mode:l=ie[1],events:c,onCreated:u,...h}={}){var d,p,f,m,g;o||(o={width:null!=(p=null==(f=t.parentElement)?void 0:f.clientWidth)?p:0,height:null!=(m=null==(g=t.parentElement)?void 0:g.clientHeight)?m:0});let v=ne.get(t),A=null==v?void 0:v.fiber,y=null==v?void 0:v.store,x=null==(d=y)?void 0:d.getState();if(A&&x){const e=x.internal.lastProps;void 0===h.dpr||E.equ(e.dpr,h.dpr)||x.setDpr(h.dpr),void 0===o||E.equ(e.size,o)||x.setSize(o.width,o.height);h.linear!==e.linear&&(he(t),A=void 0)}if(!A){const e=((e,t)=>{return(r=e)&&r.render?e:new n.WebGLRenderer({powerPreference:"high-performance",canvas:t,antialias:!0,alpha:!0,...e});var r})(r,t);h.vr&&(e.xr.enabled=!0,e.setAnimationLoop((e=>se(e,!0)))),y=((e,t,r,i)=>{const{gl:o,size:l,shadows:c=!1,linear:u=!1,flat:h=!1,vr:d=!1,orthographic:p=!1,frameloop:f="always",dpr:m=1,performance:g,clock:v=new n.Clock,raycaster:A,camera:y,onPointerMissed:x}=i;c&&(o.shadowMap.enabled=!0,"object"==typeof c?Object.assign(o.shadowMap,c):o.shadowMap.type=n.PCFSoftShadowMap),u||(h||(o.toneMapping=n.ACESFilmicToneMapping),o.outputEncoding=n.sRGBEncoding),"never"===f&&(v.stop(),v.elapsedTime=0);const b=(0,a.Z)(((a,s)=>{const l=new n.Raycaster,{params:c,...b}=A||{};e(l,{enabled:!0,...b,params:{...l.params,...c}},{});const w=y instanceof n.Camera,E=w?y:p?new n.OrthographicCamera(0,0,0,0,.1,1e3):new n.PerspectiveCamera(75,0,.1,1e3);function S(e){return Array.isArray(e)?Math.min(Math.max(e[0],window.devicePixelRatio),e[1]):e}w||(E.position.z=5,y&&e(E,y,{}),E.lookAt(0,0,0));const M=S(m),_=new n.Vector3,T=new n.Vector3;function C(e=s().camera,t=T,r=s().size){const{width:n,height:i}=r,a=n/i,o=e.getWorldPosition(_).distanceTo(t);if(L(e))return{width:n/e.zoom,height:i/e.zoom,factor:1,distance:o,aspect:a};{const t=e.fov*Math.PI/180,r=2*Math.tan(t/2)*o,s=r*(n/i);return{width:s,height:r,factor:n/s,distance:o,aspect:a}}}let I;const B=e=>a((t=>({performance:{...t.performance,current:e}})));return{gl:o,set:a,get:s,invalidate:()=>t(s()),advance:(e,t)=>r(e,t,s()),linear:u,flat:h,scene:F(new n.Scene),camera:E,raycaster:l,clock:v,mouse:new n.Vector2,vr:d,frameloop:f,onPointerMissed:x,performance:{current:1,min:.5,max:1,debounce:200,...g,regress:()=>{const e=s();I&&clearTimeout(I),e.performance.current!==e.performance.min&&B(e.performance.min),I=setTimeout((()=>B(s().performance.max)),e.performance.debounce)}},size:{width:0,height:0},viewport:{initialDpr:M,dpr:M,width:0,height:0,aspect:0,distance:0,factor:0,getCurrentViewport:C},setSize:(e,t)=>{const r={width:e,height:t};a((e=>({size:r,viewport:{...e.viewport,...C(E,T,r)}})))},setDpr:e=>a((t=>({viewport:{...t.viewport,dpr:S(e)}}))),events:{connected:!1},internal:{active:!1,priority:0,frames:0,lastProps:i,interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(e,t=0)=>(a((({internal:r})=>({internal:{...r,priority:r.priority+(t?1:0),subscribers:[...r.subscribers,{ref:e,priority:t}].sort(((e,t)=>e.priority-t.priority))}}))),()=>{a((({internal:r})=>({internal:{...r,priority:r.priority-(t?1:0),subscribers:r.subscribers.filter((t=>t.ref!==e))}})))})}}}));b.subscribe((()=>{const{camera:e,size:t,viewport:r,internal:i}=b.getState();i.lastProps.camera instanceof n.Camera||(L(e)?(e.left=t.width/-2,e.right=t.width/2,e.top=t.height/2,e.bottom=t.height/-2):e.aspect=t.width/t.height,e.updateProjectionMatrix(),e.updateMatrixWorld()),o.setPixelRatio(r.dpr),o.setSize(t.width,t.height)}),(e=>[e.viewport.dpr,e.size]),s.Z);const w=b.getState();return l&&w.setSize(l.width,l.height),b.subscribe((e=>t(e))),b})(le,ae,se,{gl:e,size:o,...h});const i=y.getState();i.get,A=oe.createContainer(y,ie.indexOf(l),!1,null),ne.set(t,{fiber:A,store:y}),c&&i.set({events:c(y)})}if(y&&A)return oe.updateContainer(i.createElement(ue,{store:y,element:e,onCreated:u,target:t}),A,null,(()=>{})),y;throw"Error creating root!"}function ue({store:e,element:t,onCreated:r,target:n}){return i.useEffect((()=>{const t=e.getState();t.set((e=>({internal:{...e.internal,active:!0}}))),null==t.events.connect||t.events.connect(n),r&&r(t)}),[]),i.createElement(D.Provider,{value:e},t)}function he(e,t){const r=ne.get(e),n=null==r?void 0:r.fiber;if(n){const i=null==r?void 0:r.store.getState();i&&(i.internal.active=!1),oe.updateContainer(null,n,null,(()=>{i&&setTimeout((()=>{var r,n,a;null==i.events.disconnect||i.events.disconnect(),null==(r=i.gl)||null==(n=r.renderLists)||null==n.dispose||n.dispose(),null==(a=i.gl)||null==a.forceContextLoss||a.forceContextLoss(),de(i),ne.delete(e),t&&t(e)}),500)}))}}function de(e){e.dispose&&"Scene"!==e.type&&e.dispose();for(const n in e){var t,r;null==(t=(r=n).dispose)||t.call(r),delete e[n]}}const pe=oe.act,fe=E.fun(Symbol)&&Symbol.for?Symbol.for("react.portal"):60106;function me(e,t,r,n=null){return{$$typeof:fe,key:null==n?null:""+n,children:e,containerInfo:F(t),implementation:r}}oe.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:"17.0.2"})},40417:(e,t,r)=>{"use strict";t._b=t.H7=t.LK=t.Kv=t.Mf=t.SE=t.N$=t.oI=t.$9=t.pT=t.fK=t.ej=t.hI=t.Wx=t.Sj=t.r3=t.ue=t.ZW=t.z5=t.Oq=t.P7=t.bS=t.N7=t.Hs=t.dV=t.oC=t.vA=t.ol=t.l$=t.sd=t.dK=t.V3=t.Bw=t.hW=t._o=t.b4=t.nu=t.wd=t.q4=void 0;var n=r(97657);Object.defineProperty(t,"q4",{enumerable:!0,get:function(){return n.VERSION}});var i=r(81183);Object.defineProperty(t,"wd",{enumerable:!0,get:function(){return i.CstParser}}),Object.defineProperty(t,"nu",{enumerable:!0,get:function(){return i.EmbeddedActionsParser}}),Object.defineProperty(t,"b4",{enumerable:!0,get:function(){return i.ParserDefinitionErrorType}}),Object.defineProperty(t,"_o",{enumerable:!0,get:function(){return i.EMPTY_ALT}});var a=r(88200);Object.defineProperty(t,"hW",{enumerable:!0,get:function(){return a.Lexer}}),Object.defineProperty(t,"Bw",{enumerable:!0,get:function(){return a.LexerDefinitionErrorType}});var s=r(58980);Object.defineProperty(t,"V3",{enumerable:!0,get:function(){return s.createToken}}),Object.defineProperty(t,"dK",{enumerable:!0,get:function(){return s.createTokenInstance}}),Object.defineProperty(t,"sd",{enumerable:!0,get:function(){return s.EOF}}),Object.defineProperty(t,"l$",{enumerable:!0,get:function(){return s.tokenLabel}}),Object.defineProperty(t,"ol",{enumerable:!0,get:function(){return s.tokenMatcher}}),Object.defineProperty(t,"vA",{enumerable:!0,get:function(){return s.tokenName}});var o=r(63670);Object.defineProperty(t,"oC",{enumerable:!0,get:function(){return o.getLookaheadPaths}});var l=r(3449);Object.defineProperty(t,"dV",{enumerable:!0,get:function(){return l.LLkLookaheadStrategy}});var c=r(27621);Object.defineProperty(t,"Hs",{enumerable:!0,get:function(){return c.defaultParserErrorProvider}});var u=r(34400);Object.defineProperty(t,"N7",{enumerable:!0,get:function(){return u.EarlyExitException}}),Object.defineProperty(t,"bS",{enumerable:!0,get:function(){return u.isRecognitionException}}),Object.defineProperty(t,"P7",{enumerable:!0,get:function(){return u.MismatchedTokenException}}),Object.defineProperty(t,"Oq",{enumerable:!0,get:function(){return u.NotAllInputParsedException}}),Object.defineProperty(t,"z5",{enumerable:!0,get:function(){return u.NoViableAltException}});var h=r(58232);Object.defineProperty(t,"ZW",{enumerable:!0,get:function(){return h.defaultLexerErrorProvider}});var d=r(93062);Object.defineProperty(t,"ue",{enumerable:!0,get:function(){return d.Alternation}}),Object.defineProperty(t,"r3",{enumerable:!0,get:function(){return d.Alternative}}),Object.defineProperty(t,"Sj",{enumerable:!0,get:function(){return d.NonTerminal}}),Object.defineProperty(t,"Wx",{enumerable:!0,get:function(){return d.Option}}),Object.defineProperty(t,"hI",{enumerable:!0,get:function(){return d.Repetition}}),Object.defineProperty(t,"ej",{enumerable:!0,get:function(){return d.RepetitionMandatory}}),Object.defineProperty(t,"fK",{enumerable:!0,get:function(){return d.RepetitionMandatoryWithSeparator}}),Object.defineProperty(t,"pT",{enumerable:!0,get:function(){return d.RepetitionWithSeparator}}),Object.defineProperty(t,"$9",{enumerable:!0,get:function(){return d.Rule}}),Object.defineProperty(t,"oI",{enumerable:!0,get:function(){return d.Terminal}});var p=r(93062);Object.defineProperty(t,"N$",{enumerable:!0,get:function(){return p.serializeGrammar}}),Object.defineProperty(t,"SE",{enumerable:!0,get:function(){return p.serializeProduction}}),Object.defineProperty(t,"Mf",{enumerable:!0,get:function(){return p.GAstVisitor}});var f=r(82688);Object.defineProperty(t,"Kv",{enumerable:!0,get:function(){return f.generateCstDts}}),t.LK=function(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n\t It performs no action other than printing this message.\n\t Please avoid using it as it will be completely removed in the future")};var m=r(77141);Object.defineProperty(t,"H7",{enumerable:!0,get:function(){return m.createSyntaxDiagramsCode}});var g=function(){throw new Error("The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.\t\nSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0")};t._b=g},77141:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSyntaxDiagramsCode=void 0;var n=r(97657);t.createSyntaxDiagramsCode=function(e,t){var r=void 0===t?{}:t,i=r.resourceBase,a=void 0===i?"https://unpkg.com/chevrotain@".concat(n.VERSION,"/diagrams/"):i,s=r.css,o=void 0===s?"https://unpkg.com/chevrotain@".concat(n.VERSION,"/diagrams/diagrams.css"):s;return'\n\x3c!-- This is a generated file --\x3e\n<!DOCTYPE html>\n<meta charset="utf-8">\n<style>\n body {\n background-color: hsl(30, 20%, 95%)\n }\n</style>\n\n'+"\n<link rel='stylesheet' href='".concat(o,"'>\n")+"\n<script src='".concat(a,"vendor/railroad-diagrams.js'><\/script>\n<script src='").concat(a,"src/diagrams_builder.js'><\/script>\n<script src='").concat(a,"src/diagrams_behavior.js'><\/script>\n<script src='").concat(a,"src/main.js'><\/script>\n")+'\n<div id="diagrams" align="center"></div> \n'+"\n<script>\n window.serializedGrammar = ".concat(JSON.stringify(e,null," "),";\n<\/script>\n")+'\n<script>\n var diagramsDiv = document.getElementById("diagrams");\n main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);\n<\/script>\n'}},94688:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defineNameProp=void 0;t.defineNameProp=function(e,t){Object.defineProperty(e,"name",{enumerable:!1,configurable:!0,writable:!1,value:t})}},24997:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IN=void 0,t.IN="_~IN~_"},23059:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addNoneTerminalToCst=t.addTerminalToCst=t.setNodeLocationFull=t.setNodeLocationOnlyOffset=void 0,t.setNodeLocationOnlyOffset=function(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset==!0&&(e.endOffset=t.endOffset)},t.setNodeLocationFull=function(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset==!0&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)},t.addTerminalToCst=function(e,t,r){void 0===e.children[r]?e.children[r]=[t]:e.children[r].push(t)},t.addNoneTerminalToCst=function(e,t,r){void 0===e.children[t]?e.children[t]=[r]:e.children[t].push(r)}},85480:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.validateMissingCstMethods=t.validateVisitor=t.CstVisitorDefinitionError=t.createBaseVisitorConstructorWithDefaults=t.createBaseSemanticVisitorConstructor=t.defaultVisit=void 0;var i,a=n(r(41609)),s=n(r(39693)),o=n(r(1469)),l=n(r(35161)),c=n(r(84486)),u=n(r(63105)),h=n(r(3674)),d=n(r(23560)),p=n(r(52353)),f=r(94688);function m(e,t){for(var r=(0,h.default)(e),n=r.length,i=0;i<n;i++)for(var a=e[r[i]],s=a.length,o=0;o<s;o++){var l=a[o];void 0===l.tokenTypeIdx&&this[l.name](l.children,t)}}function g(e,t){return v(e,t)}function v(e,t){var r=(0,u.default)(t,(function(t){return!1===(0,d.default)(e[t])})),n=(0,l.default)(r,(function(t){return{msg:"Missing visitor method: <".concat(t,"> on ").concat(e.constructor.name," CST Visitor."),type:i.MISSING_METHOD,methodName:t}}));return(0,s.default)(n)}t.defaultVisit=m,t.createBaseSemanticVisitorConstructor=function(e,t){var r=function(){};return(0,f.defineNameProp)(r,e+"BaseSemantics"),(r.prototype={visit:function(e,t){if((0,o.default)(e)&&(e=e[0]),!(0,p.default)(e))return this[e.name](e.children,t)},validateVisitor:function(){var e=g(this,t);if(!(0,a.default)(e)){var r=(0,l.default)(e,(function(e){return e.msg}));throw Error("Errors Detected in CST Visitor <".concat(this.constructor.name,">:\n\t")+"".concat(r.join("\n\n").replace(/\n/g,"\n\t")))}}}).constructor=r,r._RULE_NAMES=t,r},t.createBaseVisitorConstructorWithDefaults=function(e,t,r){var n=function(){};(0,f.defineNameProp)(n,e+"BaseSemanticsWithDefaults");var i=Object.create(r.prototype);return(0,c.default)(t,(function(e){i[e]=m})),(n.prototype=i).constructor=n,n},function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(i=t.CstVisitorDefinitionError||(t.CstVisitorDefinitionError={})),t.validateVisitor=g,t.validateMissingCstMethods=v},27621:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultGrammarValidatorErrorProvider=t.defaultGrammarResolverErrorProvider=t.defaultParserErrorProvider=void 0;var i=r(58980),a=n(r(8804)),s=n(r(35161)),o=n(r(54061)),l=r(93062),c=r(93062);t.defaultParserErrorProvider={buildMismatchTokenMessage:function(e){var t=e.expected,r=e.actual,n=(e.previous,e.ruleName,(0,i.hasTokenLabel)(t)?"--\x3e ".concat((0,i.tokenLabel)(t)," <--"):"token of type --\x3e ".concat(t.name," <--"));return"Expecting ".concat(n," but found --\x3e '").concat(r.image,"' <--")},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant;e.ruleName;return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage:function(e){var t=e.expectedPathsPerAlt,r=e.actual,n=(e.previous,e.customUserDescription),l=(e.ruleName,"Expecting: "),c="\nbut found: '"+(0,a.default)(r).image+"'";if(n)return l+n+c;var u=(0,o.default)(t,(function(e,t){return e.concat(t)}),[]),h=(0,s.default)(u,(function(e){return"[".concat((0,s.default)(e,(function(e){return(0,i.tokenLabel)(e)})).join(", "),"]")})),d=(0,s.default)(h,(function(e,t){return" ".concat(t+1,". ").concat(e)}));return l+"one of these possible Token sequences:\n".concat(d.join("\n"))+c},buildEarlyExitMessage:function(e){var t=e.expectedIterationPaths,r=e.actual,n=e.customUserDescription,o=(e.ruleName,"Expecting: "),l="\nbut found: '"+(0,a.default)(r).image+"'";if(n)return o+n+l;var c=(0,s.default)(t,(function(e){return"[".concat((0,s.default)(e,(function(e){return(0,i.tokenLabel)(e)})).join(","),"]")}));return o+("expecting at least one iteration which starts with one of these possible Token sequences::\n "+"<".concat(c.join(" ,"),">"))+l}},Object.freeze(t.defaultParserErrorProvider),t.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"}},t.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(e,t){var r,n=e.name,i=(0,a.default)(t),s=i.idx,o=(0,c.getProductionDslName)(i),u=(r=i)instanceof l.Terminal?r.terminalType.name:r instanceof l.NonTerminal?r.nonTerminalName:"",h=s>0,d="->".concat(o).concat(h?s:"","<- ").concat(u?"with argument: ->".concat(u,"<-"):"","\n appears more than once (").concat(t.length," times) in the top level rule: ->").concat(n,"<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n ");return d=(d=d.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildNamespaceConflictError:function(e){return"Namespace conflict found in grammar.\n"+"The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <".concat(e.name,">.\n")+"To resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter."},buildAlternationPrefixAmbiguityError:function(e){var t=(0,s.default)(e.prefixPath,(function(e){return(0,i.tokenLabel)(e)})).join(", "),r=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous alternatives: <".concat(e.ambiguityIndices.join(" ,"),"> due to common lookahead prefix\n")+"in <OR".concat(r,"> inside <").concat(e.topLevelRule.name,"> Rule,\n")+"<".concat(t,"> may appears as a prefix path in all these alternatives.\n")+"See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details."},buildAlternationAmbiguityError:function(e){var t=(0,s.default)(e.prefixPath,(function(e){return(0,i.tokenLabel)(e)})).join(", "),r=0===e.alternation.idx?"":e.alternation.idx,n="Ambiguous Alternatives Detected: <".concat(e.ambiguityIndices.join(" ,"),"> in <OR").concat(r,">")+" inside <".concat(e.topLevelRule.name,"> Rule,\n")+"<".concat(t,"> may appears as a prefix path in all these alternatives.\n");return n+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(e){var t=(0,c.getProductionDslName)(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),"The repetition <".concat(t,"> within Rule <").concat(e.topLevelRule.name,"> can never consume any tokens.\n")+"This could lead to an infinite loop."},buildTokenNameError:function(e){return"deprecated"},buildEmptyAlternationError:function(e){return"Ambiguous empty alternative: <".concat(e.emptyChoiceIdx+1,">")+" in <OR".concat(e.alternation.idx,"> inside <").concat(e.topLevelRule.name,"> Rule.\n")+"Only the last alternative may be an empty alternative."},buildTooManyAlternativesError:function(e){return"An Alternation cannot have more than 256 alternatives:\n"+"<OR".concat(e.alternation.idx,"> inside <").concat(e.topLevelRule.name,"> Rule.\n has ").concat(e.alternation.definition.length+1," alternatives.")},buildLeftRecursionError:function(e){var t=e.topLevelRule.name,r=(0,s.default)(e.leftRecursionPath,(function(e){return e.name})),n="".concat(t," --\x3e ").concat(r.concat([t]).join(" --\x3e "));return"Left Recursion found in grammar.\n"+"rule: <".concat(t,"> can be invoked from itself (directly or indirectly)\n")+"without consuming any Tokens. The grammar path that causes this is: \n ".concat(n,"\n")+" To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring."},buildInvalidRuleNameError:function(e){return"deprecated"},buildDuplicateRuleNameError:function(e){var t;return t=e.topLevelRule instanceof l.Rule?e.topLevelRule.name:e.topLevelRule,"Duplicate definition, rule: ->".concat(t,"<- is already defined in the grammar: ->").concat(e.grammarName,"<-")}}},34400:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EarlyExitException=t.NotAllInputParsedException=t.NoViableAltException=t.MismatchedTokenException=t.isRecognitionException=void 0;var s=a(r(64721)),o="MismatchedTokenException",l="NoViableAltException",c="EarlyExitException",u="NotAllInputParsedException",h=[o,l,c,u];Object.freeze(h),t.isRecognitionException=function(e){return(0,s.default)(h,e.name)};var d=function(e){function t(t,r){var n=this.constructor,i=e.call(this,t)||this;return i.token=r,i.resyncedTokens=[],Object.setPrototypeOf(i,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,i.constructor),i}return i(t,e),t}(Error),p=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.previousToken=n,i.name=o,i}return i(t,e),t}(d);t.MismatchedTokenException=p;var f=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.previousToken=n,i.name=l,i}return i(t,e),t}(d);t.NoViableAltException=f;var m=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.name=u,n}return i(t,e),t}(d);t.NotAllInputParsedException=m;var g=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.previousToken=n,i.name=c,i}return i(t,e),t}(d);t.EarlyExitException=g},4046:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.checkPrefixAlternativesAmbiguities=t.validateSomeNonEmptyLookaheadPath=t.validateTooManyAlts=t.RepetitionCollector=t.validateAmbiguousAlternationAlternatives=t.validateEmptyOrAlternative=t.getFirstNoneTerminal=t.validateNoLeftRecursion=t.validateRuleIsOverridden=t.validateRuleDoesNotAlreadyExist=t.OccurrenceValidationCollector=t.identifyProductionForDuplicates=t.validateGrammar=t.validateLookahead=void 0;var o=s(r(8804)),l=s(r(41609)),c=s(r(30731)),u=s(r(85564)),h=s(r(63105)),d=s(r(43063)),p=s(r(91966)),f=s(r(35161)),m=s(r(84486)),g=s(r(7739)),v=s(r(54061)),A=s(r(35937)),y=s(r(52628)),x=s(r(64721)),b=s(r(94654)),w=s(r(66678)),E=r(81183),S=r(93062),M=r(63670),_=r(6331),T=r(93062),C=r(93062),I=s(r(43624)),B=s(r(39693)),R=r(22963);function P(e){return"".concat((0,S.getProductionDslName)(e),"_#_").concat(e.idx,"_#_").concat(F(e))}function F(e){return e instanceof T.Terminal?e.terminalType.name:e instanceof T.NonTerminal?e.nonTerminalName:""}t.validateLookahead=function(e){var t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return(0,f.default)(t,(function(e){return a({type:E.ParserDefinitionErrorType.CUSTOM_LOOKAHEAD_VALIDATION},e)}))},t.validateGrammar=function(e,t,r,n){var i=(0,b.default)(e,(function(e){return function(e,t){var r=new L;e.accept(r);var n=r.allProductions,i=(0,g.default)(n,P),a=(0,A.default)(i,(function(e){return e.length>1}));return(0,f.default)((0,y.default)(a),(function(r){var n=(0,o.default)(r),i=t.buildDuplicateFoundError(e,r),a=(0,S.getProductionDslName)(n),s={message:i,type:E.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:n.idx},l=F(n);return l&&(s.parameter=l),s}))}(e,r)})),a=function(e,t,r){var n=[],i=(0,f.default)(t,(function(e){return e.name}));return(0,m.default)(e,(function(e){var t=e.name;if((0,x.default)(i,t)){var a=r.buildNamespaceConflictError(e);n.push({message:a,type:E.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}})),n}(e,t,r),s=(0,b.default)(e,(function(e){return O(e,r)})),l=(0,b.default)(e,(function(t){return D(t,e,n,r)}));return i.concat(a,s,l)},t.identifyProductionForDuplicates=P;var L=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return i(t,e),t.prototype.visitNonTerminal=function(e){this.allProductions.push(e)},t.prototype.visitOption=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t.prototype.visitAlternation=function(e){this.allProductions.push(e)},t.prototype.visitTerminal=function(e){this.allProductions.push(e)},t}(C.GAstVisitor);function D(e,t,r,n){var i=[];if((0,v.default)(t,(function(t,r){return r.name===e.name?t+1:t}),0)>1){var a=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});i.push({message:a,type:E.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function U(e){var t=[];if((0,l.default)(e))return t;var r=(0,o.default)(e);if(r instanceof T.NonTerminal)t.push(r.referencedRule);else if(r instanceof T.Alternative||r instanceof T.Option||r instanceof T.RepetitionMandatory||r instanceof T.RepetitionMandatoryWithSeparator||r instanceof T.RepetitionWithSeparator||r instanceof T.Repetition)t=t.concat(U(r.definition));else if(r instanceof T.Alternation)t=(0,u.default)((0,f.default)(r.definition,(function(e){return U(e.definition)})));else if(!(r instanceof T.Terminal))throw Error("non exhaustive match");var n=(0,S.isOptionalProd)(r),i=e.length>1;if(n&&i){var a=(0,c.default)(e);return t.concat(U(a))}return t}t.OccurrenceValidationCollector=L,t.validateRuleDoesNotAlreadyExist=D,t.validateRuleIsOverridden=function(e,t,r){var n,i=[];return(0,x.default)(t,e)||(n="Invalid rule override, rule: ->".concat(e,"<- cannot be overridden in the grammar: ->").concat(r,"<-")+"as it is not defined in any of the super grammars ",i.push({message:n,type:E.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:e})),i},t.validateNoLeftRecursion=function e(t,r,n,i){void 0===i&&(i=[]);var a=[],s=U(r.definition);if((0,l.default)(s))return[];var o=t.name;(0,x.default)(s,t)&&a.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:i}),type:E.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:o});var c=(0,p.default)(s,i.concat([t])),u=(0,b.default)(c,(function(r){var a=(0,w.default)(i);return a.push(r),e(t,r,n,a)}));return a.concat(u)},t.getFirstNoneTerminal=U;var N=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.alternations=[],t}return i(t,e),t.prototype.visitAlternation=function(e){this.alternations.push(e)},t}(C.GAstVisitor);t.validateEmptyOrAlternative=function(e,t){var r=new N;e.accept(r);var n=r.alternations;return(0,b.default)(n,(function(r){var n=(0,I.default)(r.definition);return(0,b.default)(n,(function(n,i){var a=(0,_.nextPossibleTokensAfter)([n],[],R.tokenStructuredMatcher,1);return(0,l.default)(a)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:r,emptyChoiceIdx:i}),type:E.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:r.idx,alternative:i+1}]:[]}))}))},t.validateAmbiguousAlternationAlternatives=function(e,t,r){var n=new N;e.accept(n);var i=n.alternations;i=(0,d.default)(i,(function(e){return!0===e.ignoreAmbiguities}));var a=(0,b.default)(i,(function(n){var i=n.idx,a=n.maxLookahead||t,s=(0,M.getLookaheadPathsForOr)(i,e,a,n),o=function(e,t,r,n){var i=[],a=(0,v.default)(e,(function(r,n,a){return!0===t.definition[a].ignoreAmbiguities||(0,m.default)(n,(function(n){var s=[a];(0,m.default)(e,(function(e,r){a!==r&&(0,M.containsPath)(e,n)&&!0!==t.definition[r].ignoreAmbiguities&&s.push(r)})),s.length>1&&!(0,M.containsPath)(i,n)&&(i.push(n),r.push({alts:s,path:n}))})),r}),[]);return(0,f.default)(a,(function(e){var i=(0,f.default)(e.alts,(function(e){return e+1}));return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:E.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:e.alts}}))}(s,n,e,r),l=G(s,n,e,r);return o.concat(l)}));return a};var k=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return i(t,e),t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t}(C.GAstVisitor);function O(e,t){var r=new N;e.accept(r);var n=r.alternations;return(0,b.default)(n,(function(r){return r.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:r}),type:E.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:e.name,occurrence:r.idx}]:[]}))}function G(e,t,r,n){var i=(0,v.default)(e,(function(e,t,r){var n=(0,f.default)(t,(function(e){return{idx:r,path:e}}));return e.concat(n)}),[]);return(0,B.default)((0,b.default)(i,(function(e){if(!0===t.definition[e.idx].ignoreAmbiguities)return[];var a=e.idx,s=e.path,o=(0,h.default)(i,(function(e){return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx<a&&(0,M.isStrictPrefixOfPath)(e.path,s)}));return(0,f.default)(o,(function(e){var i=[e.idx+1,a+1],s=0===t.idx?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:E.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:s,alternatives:i}}))})))}t.RepetitionCollector=k,t.validateTooManyAlts=O,t.validateSomeNonEmptyLookaheadPath=function(e,t,r){var n=[];return(0,m.default)(e,(function(e){var i=new k;e.accept(i);var a=i.allProductions;(0,m.default)(a,(function(i){var a=(0,M.getProdType)(i),s=i.maxLookahead||t,o=i.idx,c=(0,M.getLookaheadPathsForOptionalProd)(o,e,a,s)[0];if((0,l.default)((0,u.default)(c))){var h=r.buildEmptyRepetitionError({topLevelRule:e,repetition:i});n.push({message:h,type:E.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}}))})),n},t.checkPrefixAlternativesAmbiguities=G},90825:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.firstForTerminal=t.firstForBranching=t.firstForSequence=t.first=void 0;var i=n(r(85564)),a=n(r(44908)),s=n(r(35161)),o=r(93062),l=r(93062);function c(e){if(e instanceof o.NonTerminal)return c(e.referencedRule);if(e instanceof o.Terminal)return d(e);if((0,l.isSequenceProd)(e))return u(e);if((0,l.isBranchingProd)(e))return h(e);throw Error("non exhaustive match")}function u(e){for(var t,r=[],n=e.definition,i=0,s=n.length>i,o=!0;s&&o;)t=n[i],o=(0,l.isOptionalProd)(t),r=r.concat(c(t)),i+=1,s=n.length>i;return(0,a.default)(r)}function h(e){var t=(0,s.default)(e.definition,(function(e){return c(e)}));return(0,a.default)((0,i.default)(t))}function d(e){return[e.terminalType]}t.first=c,t.firstForSequence=u,t.firstForBranching=h,t.firstForTerminal=d},89476:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.buildInProdFollowPrefix=t.buildBetweenProdsFollowPrefix=t.computeAllProdsFollows=t.ResyncFollowsWalker=void 0;var s=r(20318),o=r(90825),l=a(r(84486)),c=a(r(28583)),u=r(24997),h=r(93062),d=function(e){function t(t){var r=e.call(this)||this;return r.topProd=t,r.follows={},r}return i(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},t.prototype.walkTerminal=function(e,t,r){},t.prototype.walkProdRef=function(e,t,r){var n=p(e.referencedRule,e.idx)+this.topProd.name,i=t.concat(r),a=new h.Alternative({definition:i}),s=(0,o.first)(a);this.follows[n]=s},t}(s.RestWalker);function p(e,t){return e.name+t+u.IN}t.ResyncFollowsWalker=d,t.computeAllProdsFollows=function(e){var t={};return(0,l.default)(e,(function(e){var r=new d(e).startWalking();(0,c.default)(t,r)})),t},t.buildBetweenProdsFollowPrefix=p,t.buildInProdFollowPrefix=function(e){return e.terminalType.name+e.idx+u.IN}},65143:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.validateGrammar=t.resolveGrammar=void 0;var i=n(r(84486)),a=n(r(91747)),s=r(36671),o=r(4046),l=r(27621);t.resolveGrammar=function(e){var t=(0,a.default)(e,{errMsgProvider:l.defaultGrammarResolverErrorProvider}),r={};return(0,i.default)(e.rules,(function(e){r[e.name]=e})),(0,s.resolveGrammar)(r,t.errMsgProvider)},t.validateGrammar=function(e){return e=(0,a.default)(e,{errMsgProvider:l.defaultGrammarValidatorErrorProvider}),(0,o.validateGrammar)(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}},6331:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.nextPossibleTokensAfter=t.possiblePathsFrom=t.NextTerminalAfterAtLeastOneSepWalker=t.NextTerminalAfterAtLeastOneWalker=t.NextTerminalAfterManySepWalker=t.NextTerminalAfterManyWalker=t.AbstractNextTerminalAfterProductionWalker=t.NextAfterTokenWalker=t.AbstractNextPossibleTokensWalker=void 0;var s=r(20318),o=a(r(8804)),l=a(r(41609)),c=a(r(43624)),u=a(r(30731)),h=a(r(10928)),d=a(r(84486)),p=a(r(66678)),f=r(90825),m=r(93062),g=function(e){function t(t,r){var n=e.call(this)||this;return n.topProd=t,n.path=r,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return i(t,e),t.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,p.default)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,p.default)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},t.prototype.walk=function(t,r){void 0===r&&(r=[]),this.found||e.prototype.walk.call(this,t,r)},t.prototype.walkProdRef=function(e,t,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){var n=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,n)}},t.prototype.updateExpectedNext=function(){(0,l.default)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},t}(s.RestWalker);t.AbstractNextPossibleTokensWalker=g;var v=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.path=r,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return i(t,e),t.prototype.walkTerminal=function(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var n=t.concat(r),i=new m.Alternative({definition:n});this.possibleTokTypes=(0,f.first)(i),this.found=!0}},t}(g);t.NextAfterTokenWalker=v;var A=function(e){function t(t,r){var n=e.call(this)||this;return n.topRule=t,n.occurrence=r,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return i(t,e),t.prototype.startWalking=function(){return this.walk(this.topRule),this.result},t}(s.RestWalker);t.AbstractNextTerminalAfterProductionWalker=A;var y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.walkMany=function(t,r,n){if(t.idx===this.occurrence){var i=(0,o.default)(r.concat(n));this.result.isEndOfRule=void 0===i,i instanceof m.Terminal&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else e.prototype.walkMany.call(this,t,r,n)},t}(A);t.NextTerminalAfterManyWalker=y;var x=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.walkManySep=function(t,r,n){if(t.idx===this.occurrence){var i=(0,o.default)(r.concat(n));this.result.isEndOfRule=void 0===i,i instanceof m.Terminal&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else e.prototype.walkManySep.call(this,t,r,n)},t}(A);t.NextTerminalAfterManySepWalker=x;var b=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.walkAtLeastOne=function(t,r,n){if(t.idx===this.occurrence){var i=(0,o.default)(r.concat(n));this.result.isEndOfRule=void 0===i,i instanceof m.Terminal&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else e.prototype.walkAtLeastOne.call(this,t,r,n)},t}(A);t.NextTerminalAfterAtLeastOneWalker=b;var w=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.walkAtLeastOneSep=function(t,r,n){if(t.idx===this.occurrence){var i=(0,o.default)(r.concat(n));this.result.isEndOfRule=void 0===i,i instanceof m.Terminal&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else e.prototype.walkAtLeastOneSep.call(this,t,r,n)},t}(A);function E(e,t,r,n){var i=(0,p.default)(r);i.push(e.name);var a=(0,p.default)(n);return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}t.NextTerminalAfterAtLeastOneSepWalker=w,t.possiblePathsFrom=function e(t,r,n){void 0===n&&(n=[]),n=(0,p.default)(n);var i=[],a=0;function s(s){var o=e(s.concat((0,u.default)(t,a+1)),r,n);return i.concat(o)}for(;n.length<r&&a<t.length;){var o=t[a];if(o instanceof m.Alternative)return s(o.definition);if(o instanceof m.NonTerminal)return s(o.definition);if(o instanceof m.Option)i=s(o.definition);else{if(o instanceof m.RepetitionMandatory)return s(c=o.definition.concat([new m.Repetition({definition:o.definition})]));if(o instanceof m.RepetitionMandatoryWithSeparator)return s(c=[new m.Alternative({definition:o.definition}),new m.Repetition({definition:[new m.Terminal({terminalType:o.separator})].concat(o.definition)})]);if(o instanceof m.RepetitionWithSeparator){var c=o.definition.concat([new m.Repetition({definition:[new m.Terminal({terminalType:o.separator})].concat(o.definition)})]);i=s(c)}else if(o instanceof m.Repetition){c=o.definition.concat([new m.Repetition({definition:o.definition})]);i=s(c)}else{if(o instanceof m.Alternation)return(0,d.default)(o.definition,(function(e){!1===(0,l.default)(e.definition)&&(i=s(e.definition))})),i;if(!(o instanceof m.Terminal))throw Error("non exhaustive match");n.push(o.terminalType)}}a++}return i.push({partialPath:n,suffixDef:(0,u.default)(t,a)}),i},t.nextPossibleTokensAfter=function(e,t,r,n){var i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE",o=!1,d=t.length,f=d-n-1,g=[],v=[];for(v.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!(0,l.default)(v);){var A=v.pop();if(A!==s){var y=A.def,x=A.idx,b=A.ruleStack,w=A.occurrenceStack;if(!(0,l.default)(y)){var S=y[0];if(S===i){var M={idx:x,def:(0,u.default)(y),ruleStack:(0,c.default)(b),occurrenceStack:(0,c.default)(w)};v.push(M)}else if(S instanceof m.Terminal)if(x<d-1){var _=x+1;if(r(t[_],S.terminalType)){M={idx:_,def:(0,u.default)(y),ruleStack:b,occurrenceStack:w};v.push(M)}}else{if(x!==d-1)throw Error("non exhaustive match");g.push({nextTokenType:S.terminalType,nextTokenOccurrence:S.idx,ruleStack:b,occurrenceStack:w}),o=!0}else if(S instanceof m.NonTerminal){var T=(0,p.default)(b);T.push(S.nonTerminalName);var C=(0,p.default)(w);C.push(S.idx);M={idx:x,def:S.definition.concat(a,(0,u.default)(y)),ruleStack:T,occurrenceStack:C};v.push(M)}else if(S instanceof m.Option){var I={idx:x,def:(0,u.default)(y),ruleStack:b,occurrenceStack:w};v.push(I),v.push(s);var B={idx:x,def:S.definition.concat((0,u.default)(y)),ruleStack:b,occurrenceStack:w};v.push(B)}else if(S instanceof m.RepetitionMandatory){var R=new m.Repetition({definition:S.definition,idx:S.idx});M={idx:x,def:S.definition.concat([R],(0,u.default)(y)),ruleStack:b,occurrenceStack:w};v.push(M)}else if(S instanceof m.RepetitionMandatoryWithSeparator){var P=new m.Terminal({terminalType:S.separator});R=new m.Repetition({definition:[P].concat(S.definition),idx:S.idx}),M={idx:x,def:S.definition.concat([R],(0,u.default)(y)),ruleStack:b,occurrenceStack:w};v.push(M)}else if(S instanceof m.RepetitionWithSeparator){I={idx:x,def:(0,u.default)(y),ruleStack:b,occurrenceStack:w};v.push(I),v.push(s);P=new m.Terminal({terminalType:S.separator});var F=new m.Repetition({definition:[P].concat(S.definition),idx:S.idx});B={idx:x,def:S.definition.concat([F],(0,u.default)(y)),ruleStack:b,occurrenceStack:w};v.push(B)}else if(S instanceof m.Repetition){I={idx:x,def:(0,u.default)(y),ruleStack:b,occurrenceStack:w};v.push(I),v.push(s);F=new m.Repetition({definition:S.definition,idx:S.idx}),B={idx:x,def:S.definition.concat([F],(0,u.default)(y)),ruleStack:b,occurrenceStack:w};v.push(B)}else if(S instanceof m.Alternation)for(var L=S.definition.length-1;L>=0;L--){var D={idx:x,def:S.definition[L].definition.concat((0,u.default)(y)),ruleStack:b,occurrenceStack:w};v.push(D),v.push(s)}else if(S instanceof m.Alternative)v.push({idx:x,def:S.definition.concat((0,u.default)(y)),ruleStack:b,occurrenceStack:w});else{if(!(S instanceof m.Rule))throw Error("non exhaustive match");v.push(E(S,x,b,w))}}}else o&&(0,h.default)(v).idx<=f&&v.pop()}return g}},38567:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getKeyForAutomaticLookahead=t.AT_LEAST_ONE_SEP_IDX=t.MANY_SEP_IDX=t.AT_LEAST_ONE_IDX=t.MANY_IDX=t.OPTION_IDX=t.OR_IDX=t.BITS_FOR_ALT_IDX=t.BITS_FOR_RULE_IDX=t.BITS_FOR_OCCURRENCE_IDX=t.BITS_FOR_METHOD_TYPE=void 0,t.BITS_FOR_METHOD_TYPE=4,t.BITS_FOR_OCCURRENCE_IDX=8,t.BITS_FOR_RULE_IDX=12,t.BITS_FOR_ALT_IDX=8,t.OR_IDX=1<<t.BITS_FOR_OCCURRENCE_IDX,t.OPTION_IDX=2<<t.BITS_FOR_OCCURRENCE_IDX,t.MANY_IDX=3<<t.BITS_FOR_OCCURRENCE_IDX,t.AT_LEAST_ONE_IDX=4<<t.BITS_FOR_OCCURRENCE_IDX,t.MANY_SEP_IDX=5<<t.BITS_FOR_OCCURRENCE_IDX,t.AT_LEAST_ONE_SEP_IDX=6<<t.BITS_FOR_OCCURRENCE_IDX,t.getKeyForAutomaticLookahead=function(e,t,r){return r|t|e};t.BITS_FOR_ALT_IDX},3449:function(e,t,r){"use strict";var n=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LLkLookaheadStrategy=void 0;var a=i(r(94654)),s=i(r(41609)),o=r(27621),l=r(81183),c=r(4046),u=r(63670),h=function(){function e(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:l.DEFAULT_PARSER_CONFIG.maxLookahead}return e.prototype.validate=function(e){var t=this.validateNoLeftRecursion(e.rules);if((0,s.default)(t)){var r=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),a=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return n(n(n(n([],t,!0),r,!0),i,!0),a,!0)}return t},e.prototype.validateNoLeftRecursion=function(e){return(0,a.default)(e,(function(e){return(0,c.validateNoLeftRecursion)(e,e,o.defaultGrammarValidatorErrorProvider)}))},e.prototype.validateEmptyOrAlternatives=function(e){return(0,a.default)(e,(function(e){return(0,c.validateEmptyOrAlternative)(e,o.defaultGrammarValidatorErrorProvider)}))},e.prototype.validateAmbiguousAlternationAlternatives=function(e,t){return(0,a.default)(e,(function(e){return(0,c.validateAmbiguousAlternationAlternatives)(e,t,o.defaultGrammarValidatorErrorProvider)}))},e.prototype.validateSomeNonEmptyLookaheadPath=function(e,t){return(0,c.validateSomeNonEmptyLookaheadPath)(e,t,o.defaultGrammarValidatorErrorProvider)},e.prototype.buildLookaheadForAlternation=function(e){return(0,u.buildLookaheadFuncForOr)(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,u.buildAlternativesLookAheadFunc)},e.prototype.buildLookaheadForOptional=function(e){return(0,u.buildLookaheadFuncForOptionalProd)(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,(0,u.getProdType)(e.prodType),u.buildSingleAlternativeLookaheadFunction)},e}();t.LLkLookaheadStrategy=h},63670:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.areTokenCategoriesNotUsed=t.isStrictPrefixOfPath=t.containsPath=t.getLookaheadPathsForOptionalProd=t.getLookaheadPathsForOr=t.lookAheadSequenceFromAlternatives=t.buildSingleAlternativeLookaheadFunction=t.buildAlternativesLookAheadFunc=t.buildLookaheadFuncForOptionalProd=t.buildLookaheadFuncForOr=t.getLookaheadPaths=t.getProdType=t.PROD_TYPE=void 0;var s,o=a(r(41609)),l=a(r(85564)),c=a(r(711)),u=a(r(35161)),h=a(r(84486)),d=a(r(18721)),p=a(r(54061)),f=r(6331),m=r(20318),g=r(22963),v=r(93062),A=r(93062);function y(e){if(e instanceof v.Option||"Option"===e)return s.OPTION;if(e instanceof v.Repetition||"Repetition"===e)return s.REPETITION;if(e instanceof v.RepetitionMandatory||"RepetitionMandatory"===e)return s.REPETITION_MANDATORY;if(e instanceof v.RepetitionMandatoryWithSeparator||"RepetitionMandatoryWithSeparator"===e)return s.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof v.RepetitionWithSeparator||"RepetitionWithSeparator"===e)return s.REPETITION_WITH_SEPARATOR;if(e instanceof v.Alternation||"Alternation"===e)return s.ALTERNATION;throw Error("non exhaustive match")}!function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"}(s=t.PROD_TYPE||(t.PROD_TYPE={})),t.getProdType=y,t.getLookaheadPaths=function(e){var t=e.occurrence,r=e.rule,n=e.prodType,i=e.maxLookahead,a=y(n);return a===s.ALTERNATION?_(t,r,i):T(t,r,a,i)},t.buildLookaheadFuncForOr=function(e,t,r,n,i,a){var s=_(e,t,r);return a(s,n,I(s)?g.tokenStructuredMatcherNoCategories:g.tokenStructuredMatcher,i)},t.buildLookaheadFuncForOptionalProd=function(e,t,r,n,i,a){var s=T(e,t,i,r),o=I(s)?g.tokenStructuredMatcherNoCategories:g.tokenStructuredMatcher;return a(s[0],o,n)},t.buildAlternativesLookAheadFunc=function(e,t,r,n){var i=e.length,a=(0,c.default)(e,(function(e){return(0,c.default)(e,(function(e){return 1===e.length}))}));if(t)return function(t){for(var n=(0,u.default)(t,(function(e){return e.GATE})),a=0;a<i;a++){var s=e[a],o=s.length,l=n[a];if(void 0===l||!1!==l.call(this))e:for(var c=0;c<o;c++){for(var h=s[c],d=h.length,p=0;p<d;p++){var f=this.LA(p+1);if(!1===r(f,h[p]))continue e}return a}}};if(a&&!n){var s=(0,u.default)(e,(function(e){return(0,l.default)(e)})),o=(0,p.default)(s,(function(e,t,r){return(0,h.default)(t,(function(t){(0,d.default)(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=r),(0,h.default)(t.categoryMatches,(function(t){(0,d.default)(e,t)||(e[t]=r)}))})),e}),{});return function(){var e=this.LA(1);return o[e.tokenTypeIdx]}}return function(){for(var t=0;t<i;t++){var n=e[t],a=n.length;e:for(var s=0;s<a;s++){for(var o=n[s],l=o.length,c=0;c<l;c++){var u=this.LA(c+1);if(!1===r(u,o[c]))continue e}return t}}}},t.buildSingleAlternativeLookaheadFunction=function(e,t,r){var n=(0,c.default)(e,(function(e){return 1===e.length})),i=e.length;if(n&&!r){var a=(0,l.default)(e);if(1===a.length&&(0,o.default)(a[0].categoryMatches)){var s=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}var u=(0,p.default)(a,(function(e,t,r){return e[t.tokenTypeIdx]=!0,(0,h.default)(t.categoryMatches,(function(t){e[t]=!0})),e}),[]);return function(){var e=this.LA(1);return!0===u[e.tokenTypeIdx]}}return function(){e:for(var r=0;r<i;r++){for(var n=e[r],a=n.length,s=0;s<a;s++){var o=this.LA(s+1);if(!1===t(o,n[s]))continue e}return!0}return!1}};var x=function(e){function t(t,r,n){var i=e.call(this)||this;return i.topProd=t,i.targetOccurrence=r,i.targetProdType=n,i}return i(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},t.prototype.checkIsTarget=function(e,t,r,n){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=r.concat(n),!0)},t.prototype.walkOption=function(t,r,n){this.checkIsTarget(t,s.OPTION,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkAtLeastOne=function(t,r,n){this.checkIsTarget(t,s.REPETITION_MANDATORY,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkAtLeastOneSep=function(t,r,n){this.checkIsTarget(t,s.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkMany=function(t,r,n){this.checkIsTarget(t,s.REPETITION,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkManySep=function(t,r,n){this.checkIsTarget(t,s.REPETITION_WITH_SEPARATOR,r,n)||e.prototype.walkOption.call(this,t,r,n)},t}(m.RestWalker),b=function(e){function t(t,r,n){var i=e.call(this)||this;return i.targetOccurrence=t,i.targetProdType=r,i.targetRef=n,i.result=[],i}return i(t,e),t.prototype.checkIsTarget=function(e,t){e.idx!==this.targetOccurrence||this.targetProdType!==t||void 0!==this.targetRef&&e!==this.targetRef||(this.result=e.definition)},t.prototype.visitOption=function(e){this.checkIsTarget(e,s.OPTION)},t.prototype.visitRepetition=function(e){this.checkIsTarget(e,s.REPETITION)},t.prototype.visitRepetitionMandatory=function(e){this.checkIsTarget(e,s.REPETITION_MANDATORY)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.checkIsTarget(e,s.REPETITION_MANDATORY_WITH_SEPARATOR)},t.prototype.visitRepetitionWithSeparator=function(e){this.checkIsTarget(e,s.REPETITION_WITH_SEPARATOR)},t.prototype.visitAlternation=function(e){this.checkIsTarget(e,s.ALTERNATION)},t}(A.GAstVisitor);function w(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=[];return t}function E(e){for(var t=[""],r=0;r<e.length;r++){for(var n=e[r],i=[],a=0;a<t.length;a++){var s=t[a];i.push(s+"_"+n.tokenTypeIdx);for(var o=0;o<n.categoryMatches.length;o++){var l="_"+n.categoryMatches[o];i.push(s+l)}}t=i}return t}function S(e,t,r){for(var n=0;n<e.length;n++)if(n!==r)for(var i=e[n],a=0;a<t.length;a++){if(!0===i[t[a]])return!1}return!0}function M(e,t){for(var r=(0,u.default)(e,(function(e){return(0,f.possiblePathsFrom)([e],1)})),n=w(r.length),i=(0,u.default)(r,(function(e){var t={};return(0,h.default)(e,(function(e){var r=E(e.partialPath);(0,h.default)(r,(function(e){t[e]=!0}))})),t})),a=r,s=1;s<=t;s++){var l=a;a=w(l.length);for(var c=function(e){for(var r=l[e],c=0;c<r.length;c++){var u=r[c].partialPath,d=r[c].suffixDef,p=E(u);if(S(i,p,e)||(0,o.default)(d)||u.length===t){var m=n[e];if(!1===C(m,u)){m.push(u);for(var g=0;g<p.length;g++){var v=p[g];i[e][v]=!0}}}else{var A=(0,f.possiblePathsFrom)(d,s+1,u);a[e]=a[e].concat(A),(0,h.default)(A,(function(t){var r=E(t.partialPath);(0,h.default)(r,(function(t){i[e][t]=!0}))}))}}},d=0;d<l.length;d++)c(d)}return n}function _(e,t,r,n){var i=new b(e,s.ALTERNATION,n);return t.accept(i),M(i.result,r)}function T(e,t,r,n){var i=new b(e,r);t.accept(i);var a=i.result,s=new x(t,e,r).startWalking();return M([new v.Alternative({definition:a}),new v.Alternative({definition:s})],n)}function C(e,t){e:for(var r=0;r<e.length;r++){var n=e[r];if(n.length===t.length){for(var i=0;i<n.length;i++){var a=t[i],s=n[i];if(!1===(a===s||void 0!==s.categoryMatchesMap[a.tokenTypeIdx]))continue e}return!0}}return!1}function I(e){return(0,c.default)(e,(function(e){return(0,c.default)(e,(function(e){return(0,c.default)(e,(function(e){return(0,o.default)(e.categoryMatches)}))}))}))}t.lookAheadSequenceFromAlternatives=M,t.getLookaheadPathsForOr=_,t.getLookaheadPathsForOptionalProd=T,t.containsPath=C,t.isStrictPrefixOfPath=function(e,t){return e.length<t.length&&(0,c.default)(e,(function(e,r){var n=t[r];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}))},t.areTokenCategoriesNotUsed=I},36671:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GastRefResolverVisitor=t.resolveGrammar=void 0;var s=r(81183),o=a(r(84486)),l=a(r(52628)),c=r(93062);t.resolveGrammar=function(e,t){var r=new u(e,t);return r.resolveRefs(),r.errors};var u=function(e){function t(t,r){var n=e.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=r,n.errors=[],n}return i(t,e),t.prototype.resolveRefs=function(){var e=this;(0,o.default)((0,l.default)(this.nameToTopRule),(function(t){e.currTopLevel=t,t.accept(e)}))},t.prototype.visitNonTerminal=function(e){var t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{var r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:s.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},t}(c.GAstVisitor);t.GastRefResolverVisitor=u},20318:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RestWalker=void 0;var i=n(r(30731)),a=n(r(84486)),s=r(93062),o=function(){function e(){}return e.prototype.walk=function(e,t){var r=this;void 0===t&&(t=[]),(0,a.default)(e.definition,(function(n,a){var o=(0,i.default)(e.definition,a+1);if(n instanceof s.NonTerminal)r.walkProdRef(n,o,t);else if(n instanceof s.Terminal)r.walkTerminal(n,o,t);else if(n instanceof s.Alternative)r.walkFlat(n,o,t);else if(n instanceof s.Option)r.walkOption(n,o,t);else if(n instanceof s.RepetitionMandatory)r.walkAtLeastOne(n,o,t);else if(n instanceof s.RepetitionMandatoryWithSeparator)r.walkAtLeastOneSep(n,o,t);else if(n instanceof s.RepetitionWithSeparator)r.walkManySep(n,o,t);else if(n instanceof s.Repetition)r.walkMany(n,o,t);else{if(!(n instanceof s.Alternation))throw Error("non exhaustive match");r.walkOr(n,o,t)}}))},e.prototype.walkTerminal=function(e,t,r){},e.prototype.walkProdRef=function(e,t,r){},e.prototype.walkFlat=function(e,t,r){var n=t.concat(r);this.walk(e,n)},e.prototype.walkOption=function(e,t,r){var n=t.concat(r);this.walk(e,n)},e.prototype.walkAtLeastOne=function(e,t,r){var n=[new s.Option({definition:e.definition})].concat(t,r);this.walk(e,n)},e.prototype.walkAtLeastOneSep=function(e,t,r){var n=l(e,t,r);this.walk(e,n)},e.prototype.walkMany=function(e,t,r){var n=[new s.Option({definition:e.definition})].concat(t,r);this.walk(e,n)},e.prototype.walkManySep=function(e,t,r){var n=l(e,t,r);this.walk(e,n)},e.prototype.walkOr=function(e,t,r){var n=this,i=t.concat(r);(0,a.default)(e.definition,(function(e){var t=new s.Alternative({definition:[e]});n.walk(t,i)}))},e}();function l(e,t,r){return[new s.Option({definition:[new s.Terminal({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}t.RestWalker=o},81183:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EmbeddedActionsParser=t.CstParser=t.Parser=t.EMPTY_ALT=t.ParserDefinitionErrorType=t.DEFAULT_RULE_CONFIG=t.DEFAULT_PARSER_CONFIG=t.END_OF_FILE=void 0;var s=a(r(41609)),o=a(r(35161)),l=a(r(84486)),c=a(r(52628)),u=a(r(18721)),h=a(r(66678)),d=r(68877),p=r(89476),f=r(58980),m=r(27621),g=r(65143),v=r(35786),A=r(44421),y=r(50943),x=r(81540),b=r(70951),w=r(42691),E=r(8205),S=r(13701),M=r(93398),_=r(46427),T=r(14989),C=r(4046);t.END_OF_FILE=(0,f.createTokenInstance)(f.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(t.END_OF_FILE),t.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:m.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),t.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0}),function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(t.ParserDefinitionErrorType||(t.ParserDefinitionErrorType={})),t.EMPTY_ALT=function(e){return void 0===e&&(e=void 0),function(){return e}};var I=function(){function e(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;var n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),(0,u.default)(r,"ignoredIssues"))throw new Error("The <ignoredIssues> IParserConfig property has been deprecated.\n\tPlease use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=(0,u.default)(r,"skipValidations")?r.skipValidations:t.DEFAULT_PARSER_CONFIG.skipValidations}return e.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")},e.prototype.performSelfAnalysis=function(){var t=this;this.TRACE_INIT("performSelfAnalysis",(function(){var r;t.selfAnalysisDone=!0;var n=t.className;t.TRACE_INIT("toFastProps",(function(){(0,d.toFastProperties)(t)})),t.TRACE_INIT("Grammar Recording",(function(){try{t.enableRecording(),(0,l.default)(t.definedRulesNames,(function(e){var r,n=t[e].originalGrammarAction;t.TRACE_INIT("".concat(e," Rule"),(function(){r=t.topLevelRuleRecord(e,n)})),t.gastProductionsCache[e]=r}))}finally{t.disableRecording()}}));var i=[];if(t.TRACE_INIT("Grammar Resolving",(function(){i=(0,g.resolveGrammar)({rules:(0,c.default)(t.gastProductionsCache)}),t.definitionErrors=t.definitionErrors.concat(i)})),t.TRACE_INIT("Grammar Validations",(function(){if((0,s.default)(i)&&!1===t.skipValidations){var e=(0,g.validateGrammar)({rules:(0,c.default)(t.gastProductionsCache),tokenTypes:(0,c.default)(t.tokensMap),errMsgProvider:m.defaultGrammarValidatorErrorProvider,grammarName:n}),r=(0,C.validateLookahead)({lookaheadStrategy:t.lookaheadStrategy,rules:(0,c.default)(t.gastProductionsCache),tokenTypes:(0,c.default)(t.tokensMap),grammarName:n});t.definitionErrors=t.definitionErrors.concat(e,r)}})),(0,s.default)(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",(function(){var e=(0,p.computeAllProdsFollows)((0,c.default)(t.gastProductionsCache));t.resyncFollows=e})),t.TRACE_INIT("ComputeLookaheadFunctions",(function(){var e,r;null===(r=(e=t.lookaheadStrategy).initialize)||void 0===r||r.call(e,{rules:(0,c.default)(t.gastProductionsCache)}),t.preComputeLookaheadFunctions((0,c.default)(t.gastProductionsCache))}))),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,s.default)(t.definitionErrors))throw r=(0,o.default)(t.definitionErrors,(function(e){return e.message})),new Error("Parser Definition Errors detected:\n ".concat(r.join("\n-------------------------------\n")))}))},e.DEFER_DEFINITION_ERRORS_HANDLING=!1,e}();t.Parser=I,(0,T.applyMixins)(I,[v.Recoverable,A.LooksAhead,y.TreeBuilder,x.LexerAdapter,w.RecognizerEngine,b.RecognizerApi,E.ErrorHandler,S.ContentAssist,M.GastRecorder,_.PerformanceTracer]);var B=function(e){function r(r,n){void 0===n&&(n=t.DEFAULT_PARSER_CONFIG);var i=(0,h.default)(n);return i.outputCst=!0,e.call(this,r,i)||this}return i(r,e),r}(I);t.CstParser=B;var R=function(e){function r(r,n){void 0===n&&(n=t.DEFAULT_PARSER_CONFIG);var i=(0,h.default)(n);return i.outputCst=!1,e.call(this,r,i)||this}return i(r,e),r}(I);t.EmbeddedActionsParser=R},13701:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContentAssist=void 0;var i=r(6331),a=n(r(8804)),s=n(r(52353)),o=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(e,t){var r=this.gastProductionsCache[e];if((0,s.default)(r))throw Error("Rule ->".concat(e,"<- does not exist in this grammar."));return(0,i.nextPossibleTokensAfter)([r],t,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(e){var t=(0,a.default)(e.ruleStack),r=this.getGAstProductions()[t];return new i.NextAfterTokenWalker(r,e).startWalking()},e}();t.ContentAssist=o},8205:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorHandler=void 0;var i=r(34400),a=n(r(18721)),s=n(r(66678)),o=r(63670),l=r(81183),c=function(){function e(){}return e.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,a.default)(e,"errorMessageProvider")?e.errorMessageProvider:l.DEFAULT_PARSER_CONFIG.errorMessageProvider},e.prototype.SAVE_ERROR=function(e){if((0,i.isRecognitionException)(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,s.default)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(e.prototype,"errors",{get:function(){return(0,s.default)(this._errors)},set:function(e){this._errors=e},enumerable:!1,configurable:!0}),e.prototype.raiseEarlyExitException=function(e,t,r){for(var n=this.getCurrRuleFullName(),a=this.getGAstProductions()[n],s=(0,o.getLookaheadPathsForOptionalProd)(e,a,t,this.maxLookahead)[0],l=[],c=1;c<=this.maxLookahead;c++)l.push(this.LA(c));var u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:l,previous:this.LA(0),customUserDescription:r,ruleName:n});throw this.SAVE_ERROR(new i.EarlyExitException(u,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(e,t){for(var r=this.getCurrRuleFullName(),n=this.getGAstProductions()[r],a=(0,o.getLookaheadPathsForOr)(e,n,this.maxLookahead),s=[],l=1;l<=this.maxLookahead;l++)s.push(this.LA(l));var c=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:c,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new i.NoViableAltException(u,this.LA(1),c))},e}();t.ErrorHandler=c},93398:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GastRecorder=void 0;var i=n(r(10928)),a=n(r(1469)),s=n(r(59704)),o=n(r(84486)),l=n(r(23560)),c=n(r(18721)),u=r(93062),h=r(88200),d=r(22963),p=r(58980),f=r(81183),m=r(38567),g={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(g);var v=Math.pow(2,m.BITS_FOR_OCCURRENCE_IDX)-1,A=(0,p.createToken)({name:"RECORDING_PHASE_TOKEN",pattern:h.Lexer.NA});(0,d.augmentTokenTypes)([A]);var y=(0,p.createTokenInstance)(A,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(y);var x={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}},b=function(){function e(){}return e.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},e.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(function(){for(var t=function(t){var r=t>0?t:"";e["CONSUME".concat(r)]=function(e,r){return this.consumeInternalRecord(e,t,r)},e["SUBRULE".concat(r)]=function(e,r){return this.subruleInternalRecord(e,t,r)},e["OPTION".concat(r)]=function(e){return this.optionInternalRecord(e,t)},e["OR".concat(r)]=function(e){return this.orInternalRecord(e,t)},e["MANY".concat(r)]=function(e){this.manyInternalRecord(t,e)},e["MANY_SEP".concat(r)]=function(e){this.manySepFirstInternalRecord(t,e)},e["AT_LEAST_ONE".concat(r)]=function(e){this.atLeastOneInternalRecord(t,e)},e["AT_LEAST_ONE_SEP".concat(r)]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}},r=0;r<10;r++)t(r);e.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},e.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},e.option=function(e,t){return this.optionInternalRecord(t,e)},e.or=function(e,t){return this.orInternalRecord(t,e)},e.many=function(e,t){this.manyInternalRecord(e,t)},e.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD}))},e.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",(function(){for(var t=e,r=0;r<10;r++){var n=r>0?r:"";delete t["CONSUME".concat(n)],delete t["SUBRULE".concat(n)],delete t["OPTION".concat(n)],delete t["OR".concat(n)],delete t["MANY".concat(n)],delete t["MANY_SEP".concat(n)],delete t["AT_LEAST_ONE".concat(n)],delete t["AT_LEAST_ONE_SEP".concat(n)]}delete t.consume,delete t.subrule,delete t.option,delete t.or,delete t.many,delete t.atLeastOne,delete t.ACTION,delete t.BACKTRACK,delete t.LA}))},e.prototype.ACTION_RECORD=function(e){},e.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},e.prototype.LA_RECORD=function(e){return f.END_OF_FILE},e.prototype.topLevelRuleRecord=function(e,t){try{var r=new u.Rule({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(n){if(!0!==n.KNOWN_RECORDER_ERROR)try{n.message=n.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(i){throw n}throw n}},e.prototype.optionInternalRecord=function(e,t){return w.call(this,u.Option,e,t)},e.prototype.atLeastOneInternalRecord=function(e,t){w.call(this,u.RepetitionMandatory,t,e)},e.prototype.atLeastOneSepFirstInternalRecord=function(e,t){w.call(this,u.RepetitionMandatoryWithSeparator,t,e,true)},e.prototype.manyInternalRecord=function(e,t){w.call(this,u.Repetition,t,e)},e.prototype.manySepFirstInternalRecord=function(e,t){w.call(this,u.RepetitionWithSeparator,t,e,true)},e.prototype.orInternalRecord=function(e,t){return E.call(this,e,t)},e.prototype.subruleInternalRecord=function(e,t,r){if(M(t),!e||!1===(0,c.default)(e,"ruleName")){var n=new Error("<SUBRULE".concat(S(t),"> argument is invalid")+" expecting a Parser method reference but got: <".concat(JSON.stringify(e),">")+"\n inside top level rule: <".concat(this.recordingProdStack[0].name,">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var a=(0,i.default)(this.recordingProdStack),s=e.ruleName,o=new u.NonTerminal({idx:t,nonTerminalName:s,label:null==r?void 0:r.LABEL,referencedRule:void 0});return a.definition.push(o),this.outputCst?x:g},e.prototype.consumeInternalRecord=function(e,t,r){if(M(t),!(0,d.hasShortKeyProperty)(e)){var n=new Error("<CONSUME".concat(S(t),"> argument is invalid")+" expecting a TokenType reference but got: <".concat(JSON.stringify(e),">")+"\n inside top level rule: <".concat(this.recordingProdStack[0].name,">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var a=(0,i.default)(this.recordingProdStack),s=new u.Terminal({idx:t,terminalType:e,label:null==r?void 0:r.LABEL});return a.definition.push(s),y},e}();function w(e,t,r,n){void 0===n&&(n=!1),M(r);var a=(0,i.default)(this.recordingProdStack),s=(0,l.default)(t)?t:t.DEF,o=new e({definition:[],idx:r});return n&&(o.separator=t.SEP),(0,c.default)(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),a.definition.push(o),this.recordingProdStack.pop(),g}function E(e,t){var r=this;M(t);var n=(0,i.default)(this.recordingProdStack),h=!1===(0,a.default)(e),d=!1===h?e:e.DEF,p=new u.Alternation({definition:[],idx:t,ignoreAmbiguities:h&&!0===e.IGNORE_AMBIGUITIES});(0,c.default)(e,"MAX_LOOKAHEAD")&&(p.maxLookahead=e.MAX_LOOKAHEAD);var f=(0,s.default)(d,(function(e){return(0,l.default)(e.GATE)}));return p.hasPredicates=f,n.definition.push(p),(0,o.default)(d,(function(e){var t=new u.Alternative({definition:[]});p.definition.push(t),(0,c.default)(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:(0,c.default)(e,"GATE")&&(t.ignoreAmbiguities=!0),r.recordingProdStack.push(t),e.ALT.call(r),r.recordingProdStack.pop()})),g}function S(e){return 0===e?"":"".concat(e)}function M(e){if(e<0||e>v){var t=new Error("Invalid DSL Method idx value: <".concat(e,">\n\t")+"Idx value must be a none negative value smaller than ".concat(v+1));throw t.KNOWN_RECORDER_ERROR=!0,t}}t.GastRecorder=b},81540:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LexerAdapter=void 0;var n=r(81183),i=function(){function e(){}return e.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(e.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!1,configurable:!0}),e.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):n.END_OF_FILE},e.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?n.END_OF_FILE:this.tokVector[t]},e.prototype.consumeToken=function(){this.currIdx++},e.prototype.exportLexerState=function(){return this.currIdx},e.prototype.importLexerState=function(e){this.currIdx=e},e.prototype.resetLexerState=function(){this.currIdx=-1},e.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},e.prototype.getLexerPosition=function(){return this.exportLexerState()},e}();t.LexerAdapter=i},44421:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.collectMethods=t.LooksAhead=void 0;var s=a(r(84486)),o=a(r(18721)),l=r(81183),c=r(38567),u=r(93062),h=r(93062),d=r(3449),p=function(){function e(){}return e.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,o.default)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:l.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,o.default)(e,"maxLookahead")?e.maxLookahead:l.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookaheadStrategy=(0,o.default)(e,"lookaheadStrategy")?e.lookaheadStrategy:new d.LLkLookaheadStrategy({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map},e.prototype.preComputeLookaheadFunctions=function(e){var t=this;(0,s.default)(e,(function(e){t.TRACE_INIT("".concat(e.name," Rule Lookahead"),(function(){var r=g(e),n=r.alternation,i=r.repetition,a=r.option,o=r.repetitionMandatory,l=r.repetitionMandatoryWithSeparator,u=r.repetitionWithSeparator;(0,s.default)(n,(function(r){var n=0===r.idx?"":r.idx;t.TRACE_INIT("".concat((0,h.getProductionDslName)(r)).concat(n),(function(){var n=t.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:r.idx,rule:e,maxLookahead:r.maxLookahead||t.maxLookahead,hasPredicates:r.hasPredicates,dynamicTokensEnabled:t.dynamicTokensEnabled}),i=(0,c.getKeyForAutomaticLookahead)(t.fullRuleNameToShort[e.name],c.OR_IDX,r.idx);t.setLaFuncCache(i,n)}))})),(0,s.default)(i,(function(r){t.computeLookaheadFunc(e,r.idx,c.MANY_IDX,"Repetition",r.maxLookahead,(0,h.getProductionDslName)(r))})),(0,s.default)(a,(function(r){t.computeLookaheadFunc(e,r.idx,c.OPTION_IDX,"Option",r.maxLookahead,(0,h.getProductionDslName)(r))})),(0,s.default)(o,(function(r){t.computeLookaheadFunc(e,r.idx,c.AT_LEAST_ONE_IDX,"RepetitionMandatory",r.maxLookahead,(0,h.getProductionDslName)(r))})),(0,s.default)(l,(function(r){t.computeLookaheadFunc(e,r.idx,c.AT_LEAST_ONE_SEP_IDX,"RepetitionMandatoryWithSeparator",r.maxLookahead,(0,h.getProductionDslName)(r))})),(0,s.default)(u,(function(r){t.computeLookaheadFunc(e,r.idx,c.MANY_SEP_IDX,"RepetitionWithSeparator",r.maxLookahead,(0,h.getProductionDslName)(r))}))}))}))},e.prototype.computeLookaheadFunc=function(e,t,r,n,i,a){var s=this;this.TRACE_INIT("".concat(a).concat(0===t?"":t),(function(){var a=s.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||s.maxLookahead,dynamicTokensEnabled:s.dynamicTokensEnabled,prodType:n}),o=(0,c.getKeyForAutomaticLookahead)(s.fullRuleNameToShort[e.name],r,t);s.setLaFuncCache(o,a)}))},e.prototype.getKeyForAutomaticLookahead=function(e,t){var r=this.getLastExplicitRuleShortName();return(0,c.getKeyForAutomaticLookahead)(r,e,t)},e.prototype.getLaFuncFromCache=function(e){return this.lookAheadFuncsCache.get(e)},e.prototype.setLaFuncCache=function(e,t){this.lookAheadFuncsCache.set(e,t)},e}();t.LooksAhead=p;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return i(t,e),t.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},t.prototype.visitOption=function(e){this.dslMethods.option.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.dslMethods.repetitionWithSeparator.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.dslMethods.repetitionMandatory.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)},t.prototype.visitRepetition=function(e){this.dslMethods.repetition.push(e)},t.prototype.visitAlternation=function(e){this.dslMethods.alternation.push(e)},t}(u.GAstVisitor),m=new f;function g(e){m.reset(),e.accept(m);var t=m.dslMethods;return m.reset(),t}t.collectMethods=g},46427:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PerformanceTracer=void 0;var i=n(r(18721)),a=r(68877),s=r(81183),o=function(){function e(){}return e.prototype.initPerformanceTracer=function(e){if((0,i.default)(e,"traceInitPerf")){var t=e.traceInitPerf,r="number"==typeof t;this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=s.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;var r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log("".concat(r,"--\x3e <").concat(e,">"));var n=(0,a.timer)(t),i=n.time,s=n.value,o=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&o("".concat(r,"<-- <").concat(e,"> time: ").concat(i,"ms")),this.traceInitIndent--,s}return t()},e}();t.PerformanceTracer=o},70951:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RecognizerApi=void 0;var i=n(r(52628)),a=n(r(64721)),s=r(34400),o=r(81183),l=r(27621),c=r(4046),u=r(93062),h=function(){function e(){}return e.prototype.ACTION=function(e){return e.call(this)},e.prototype.consume=function(e,t,r){return this.consumeInternal(t,e,r)},e.prototype.subrule=function(e,t,r){return this.subruleInternal(t,e,r)},e.prototype.option=function(e,t){return this.optionInternal(t,e)},e.prototype.or=function(e,t){return this.orInternal(t,e)},e.prototype.many=function(e,t){return this.manyInternal(e,t)},e.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},e.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},e.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},e.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},e.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},e.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},e.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},e.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},e.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},e.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},e.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},e.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},e.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},e.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},e.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},e.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},e.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},e.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},e.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},e.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},e.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},e.prototype.OPTION=function(e){return this.optionInternal(e,0)},e.prototype.OPTION1=function(e){return this.optionInternal(e,1)},e.prototype.OPTION2=function(e){return this.optionInternal(e,2)},e.prototype.OPTION3=function(e){return this.optionInternal(e,3)},e.prototype.OPTION4=function(e){return this.optionInternal(e,4)},e.prototype.OPTION5=function(e){return this.optionInternal(e,5)},e.prototype.OPTION6=function(e){return this.optionInternal(e,6)},e.prototype.OPTION7=function(e){return this.optionInternal(e,7)},e.prototype.OPTION8=function(e){return this.optionInternal(e,8)},e.prototype.OPTION9=function(e){return this.optionInternal(e,9)},e.prototype.OR=function(e){return this.orInternal(e,0)},e.prototype.OR1=function(e){return this.orInternal(e,1)},e.prototype.OR2=function(e){return this.orInternal(e,2)},e.prototype.OR3=function(e){return this.orInternal(e,3)},e.prototype.OR4=function(e){return this.orInternal(e,4)},e.prototype.OR5=function(e){return this.orInternal(e,5)},e.prototype.OR6=function(e){return this.orInternal(e,6)},e.prototype.OR7=function(e){return this.orInternal(e,7)},e.prototype.OR8=function(e){return this.orInternal(e,8)},e.prototype.OR9=function(e){return this.orInternal(e,9)},e.prototype.MANY=function(e){this.manyInternal(0,e)},e.prototype.MANY1=function(e){this.manyInternal(1,e)},e.prototype.MANY2=function(e){this.manyInternal(2,e)},e.prototype.MANY3=function(e){this.manyInternal(3,e)},e.prototype.MANY4=function(e){this.manyInternal(4,e)},e.prototype.MANY5=function(e){this.manyInternal(5,e)},e.prototype.MANY6=function(e){this.manyInternal(6,e)},e.prototype.MANY7=function(e){this.manyInternal(7,e)},e.prototype.MANY8=function(e){this.manyInternal(8,e)},e.prototype.MANY9=function(e){this.manyInternal(9,e)},e.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},e.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},e.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},e.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},e.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},e.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},e.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},e.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},e.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},e.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},e.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},e.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},e.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},e.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},e.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},e.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},e.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},e.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},e.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},e.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},e.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},e.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},e.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},e.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},e.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},e.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},e.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},e.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},e.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},e.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},e.prototype.RULE=function(e,t,r){if(void 0===r&&(r=o.DEFAULT_RULE_CONFIG),(0,a.default)(this.definedRulesNames,e)){var n={message:l.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:o.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(n)}this.definedRulesNames.push(e);var i=this.defineRule(e,t,r);return this[e]=i,i},e.prototype.OVERRIDE_RULE=function(e,t,r){void 0===r&&(r=o.DEFAULT_RULE_CONFIG);var n=(0,c.validateRuleIsOverridden)(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(n);var i=this.defineRule(e,t,r);return this[e]=i,i},e.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var r=this.saveRecogState();try{return e.apply(this,t),!0}catch(n){if((0,s.isRecognitionException)(n))return!1;throw n}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return(0,u.serializeGrammar)((0,i.default)(this.gastProductionsCache))},e}();t.RecognizerApi=h},42691:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RecognizerEngine=void 0;var i=n(r(41609)),a=n(r(1469)),s=n(r(85564)),o=n(r(711)),l=n(r(44908)),c=n(r(13218)),u=n(r(18721)),h=n(r(52628)),d=n(r(54061)),p=n(r(66678)),f=r(38567),m=r(34400),g=r(63670),v=r(6331),A=r(81183),y=r(35786),x=r(58980),b=r(22963),w=function(){function e(){}return e.prototype.initRecognizerEngine=function(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=b.tokenStructuredMatcherNoCategories,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,u.default)(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if((0,a.default)(e)){if((0,i.default)(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if((0,a.default)(e))this.tokensMap=(0,d.default)(e,(function(e,t){return e[t.name]=t,e}),{});else if((0,u.default)(e,"modes")&&(0,o.default)((0,s.default)((0,h.default)(e.modes)),b.isTokenType)){var r=(0,s.default)((0,h.default)(e.modes)),n=(0,l.default)(r);this.tokensMap=(0,d.default)(n,(function(e,t){return e[t.name]=t,e}),{})}else{if(!(0,c.default)(e))throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=(0,p.default)(e)}this.tokensMap.EOF=x.EOF;var f=(0,u.default)(e,"modes")?(0,s.default)((0,h.default)(e.modes)):(0,h.default)(e),m=(0,o.default)(f,(function(e){return(0,i.default)(e.categoryMatches)}));this.tokenMatcher=m?b.tokenStructuredMatcherNoCategories:b.tokenStructuredMatcher,(0,b.augmentTokenTypes)((0,h.default)(this.tokensMap))},e.prototype.defineRule=function(e,t,r){if(this.selfAnalysisDone)throw Error("Grammar rule <".concat(e,"> may not be defined after the 'performSelfAnalysis' method has been called'\n")+"Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var n,i=(0,u.default)(r,"resyncEnabled")?r.resyncEnabled:A.DEFAULT_RULE_CONFIG.resyncEnabled,a=(0,u.default)(r,"recoveryValueFunc")?r.recoveryValueFunc:A.DEFAULT_RULE_CONFIG.recoveryValueFunc,s=this.ruleShortNameIdx<<f.BITS_FOR_METHOD_TYPE+f.BITS_FOR_OCCURRENCE_IDX;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,n=!0===this.outputCst?function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,r);var o=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(o),o}catch(l){return this.invokeRuleCatch(l,i,a)}finally{this.ruleFinallyStateUpdate()}}:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,r)}catch(o){return this.invokeRuleCatch(o,i,a)}finally{this.ruleFinallyStateUpdate()}},Object.assign(n,{ruleName:e,originalGrammarAction:t})},e.prototype.invokeRuleCatch=function(e,t,r){var n=1===this.RULE_STACK.length,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if((0,m.isRecognitionException)(e)){var a=e;if(i){var s,o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))return a.resyncedTokens=this.reSyncTo(o),this.outputCst?((s=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,s):r(e);throw this.outputCst&&((s=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,a.partialCstResult=s),a}if(n)return this.moveToTerminatedState(),r(e);throw a}throw e},e.prototype.optionInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(f.OPTION_IDX,t);return this.optionInternalLogic(e,t,r)},e.prototype.optionInternalLogic=function(e,t,r){var n,i=this,a=this.getLaFuncFromCache(r);if("function"!=typeof e){n=e.DEF;var s=e.GATE;if(void 0!==s){var o=a;a=function(){return s.call(i)&&o.call(i)}}}else n=e;if(!0===a.call(this))return n.call(this)},e.prototype.atLeastOneInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(f.AT_LEAST_ONE_IDX,e);return this.atLeastOneInternalLogic(e,t,r)},e.prototype.atLeastOneInternalLogic=function(e,t,r){var n,i=this,a=this.getLaFuncFromCache(r);if("function"!=typeof t){n=t.DEF;var s=t.GATE;if(void 0!==s){var o=a;a=function(){return s.call(i)&&o.call(i)}}}else n=t;if(!0!==a.call(this))throw this.raiseEarlyExitException(e,g.PROD_TYPE.REPETITION_MANDATORY,t.ERR_MSG);for(var l=this.doSingleRepetition(n);!0===a.call(this)&&!0===l;)l=this.doSingleRepetition(n);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],a,f.AT_LEAST_ONE_IDX,e,v.NextTerminalAfterAtLeastOneWalker)},e.prototype.atLeastOneSepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(f.AT_LEAST_ONE_SEP_IDX,e);this.atLeastOneSepFirstInternalLogic(e,t,r)},e.prototype.atLeastOneSepFirstInternalLogic=function(e,t,r){var n=this,i=t.DEF,a=t.SEP;if(!0!==this.getLaFuncFromCache(r).call(this))throw this.raiseEarlyExitException(e,g.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);i.call(this);for(var s=function(){return n.tokenMatcher(n.LA(1),a)};!0===this.tokenMatcher(this.LA(1),a);)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,s,i,v.NextTerminalAfterAtLeastOneSepWalker],s,f.AT_LEAST_ONE_SEP_IDX,e,v.NextTerminalAfterAtLeastOneSepWalker)},e.prototype.manyInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(f.MANY_IDX,e);return this.manyInternalLogic(e,t,r)},e.prototype.manyInternalLogic=function(e,t,r){var n,i=this,a=this.getLaFuncFromCache(r);if("function"!=typeof t){n=t.DEF;var s=t.GATE;if(void 0!==s){var o=a;a=function(){return s.call(i)&&o.call(i)}}}else n=t;for(var l=!0;!0===a.call(this)&&!0===l;)l=this.doSingleRepetition(n);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],a,f.MANY_IDX,e,v.NextTerminalAfterManyWalker,l)},e.prototype.manySepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(f.MANY_SEP_IDX,e);this.manySepFirstInternalLogic(e,t,r)},e.prototype.manySepFirstInternalLogic=function(e,t,r){var n=this,i=t.DEF,a=t.SEP;if(!0===this.getLaFuncFromCache(r).call(this)){i.call(this);for(var s=function(){return n.tokenMatcher(n.LA(1),a)};!0===this.tokenMatcher(this.LA(1),a);)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,s,i,v.NextTerminalAfterManySepWalker],s,f.MANY_SEP_IDX,e,v.NextTerminalAfterManySepWalker)}},e.prototype.repetitionSepSecondInternal=function(e,t,r,n,i){for(;r();)this.CONSUME(t),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,n,i],r,f.AT_LEAST_ONE_SEP_IDX,e,i)},e.prototype.doSingleRepetition=function(e){var t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t},e.prototype.orInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(f.OR_IDX,t),n=(0,a.default)(e)?e:e.DEF,i=this.getLaFuncFromCache(r).call(this,n);if(void 0!==i)return n[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)},e.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new m.NotAllInputParsedException(t,e))}},e.prototype.subruleInternal=function(e,t,r){var n;try{var i=void 0!==r?r.ARGS:void 0;return this.subruleIdx=t,n=e.apply(this,i),this.cstPostNonTerminal(n,void 0!==r&&void 0!==r.LABEL?r.LABEL:e.ruleName),n}catch(a){throw this.subruleInternalError(a,r,e.ruleName)}},e.prototype.subruleInternalError=function(e,t,r){throw(0,m.isRecognitionException)(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:r),delete e.partialCstResult),e},e.prototype.consumeInternal=function(e,t,r){var n;try{var i=this.LA(1);!0===this.tokenMatcher(i,e)?(this.consumeToken(),n=i):this.consumeInternalError(e,i,r)}catch(a){n=this.consumeInternalRecovery(e,t,a)}return this.cstPostTerminal(void 0!==r&&void 0!==r.LABEL?r.LABEL:e.name,n),n},e.prototype.consumeInternalError=function(e,t,r){var n,i=this.LA(0);throw n=void 0!==r&&r.ERR_MSG?r.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new m.MismatchedTokenException(n,t,i))},e.prototype.consumeInternalRecovery=function(e,t,r){if(!this.recoveryEnabled||"MismatchedTokenException"!==r.name||this.isBackTracking())throw r;var n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(i){throw i.name===y.IN_RULE_RECOVERY_EXCEPTION?r:i}},e.prototype.saveRecogState=function(){var e=this.errors,t=(0,p.default)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}},e.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},e.prototype.ruleInvocationStateUpdate=function(e,t,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)},e.prototype.isBackTracking=function(){return 0!==this.isBackTrackingStack.length},e.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},e.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},e.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),x.EOF)},e.prototype.reset=function(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},e}();t.RecognizerEngine=w},35786:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.attemptInRepetitionRecovery=t.Recoverable=t.InRuleRecoveryException=t.IN_RULE_RECOVERY_EXCEPTION=t.EOF_FOLLOW_KEY=void 0;var s=r(58980),o=a(r(41609)),l=a(r(43624)),c=a(r(85564)),u=a(r(35161)),h=a(r(13311)),d=a(r(18721)),p=a(r(64721)),f=a(r(66678)),m=r(34400),g=r(24997),v=r(81183);t.EOF_FOLLOW_KEY={},t.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";var A=function(e){function r(r){var n=e.call(this,r)||this;return n.name=t.IN_RULE_RECOVERY_EXCEPTION,n}return i(r,e),r}(Error);t.InRuleRecoveryException=A;var y=function(){function e(){}return e.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,d.default)(e,"recoveryEnabled")?e.recoveryEnabled:v.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=x)},e.prototype.getTokenToInsert=function(e){var t=(0,s.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},e.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},e.prototype.canTokenTypeBeDeletedInRecovery=function(e){return!0},e.prototype.tryInRepetitionRecovery=function(e,t,r,n){for(var i=this,a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[],c=!1,u=this.LA(1),h=this.LA(1),d=function(){var e=i.LA(0),t=i.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:e,ruleName:i.getCurrRuleFullName()}),r=new m.MismatchedTokenException(t,u,i.LA(0));r.resyncedTokens=(0,l.default)(o),i.SAVE_ERROR(r)};!c;){if(this.tokenMatcher(h,n))return void d();if(r.call(this))return d(),void e.apply(this,t);this.tokenMatcher(h,a)?c=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o))}this.importLexerState(s)},e.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,r){return!1!==r&&(!this.tokenMatcher(this.LA(1),e)&&(!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))))},e.prototype.getFollowsForInRuleRecovery=function(e,t){var r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)},e.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){var r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new A("sad sad panda")},e.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},e.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var r=this;if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if((0,o.default)(t))return!1;var n=this.LA(1);return void 0!==(0,h.default)(t,(function(e){return r.tokenMatcher(n,e)}))},e.prototype.canRecoverWithSingleTokenDeletion=function(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)},e.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return(0,p.default)(r,e)},e.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),r=2;;){var n=(0,h.default)(e,(function(e){return(0,s.tokenMatcher)(t,e)}));if(void 0!==n)return n;t=this.LA(r),r++}},e.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return t.EOF_FOLLOW_KEY;var e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}},e.prototype.buildFullFollowKeyStack=function(){var e=this,r=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return(0,u.default)(r,(function(i,a){return 0===a?t.EOF_FOLLOW_KEY:{ruleName:e.shortRuleNameToFullName(i),idxInCallingRule:n[a],inRule:e.shortRuleNameToFullName(r[a-1])}}))},e.prototype.flattenFollowSet=function(){var e=this,t=(0,u.default)(this.buildFullFollowKeyStack(),(function(t){return e.getFollowSetFromFollowKey(t)}));return(0,c.default)(t)},e.prototype.getFollowSetFromFollowKey=function(e){if(e===t.EOF_FOLLOW_KEY)return[s.EOF];var r=e.ruleName+e.idxInCallingRule+g.IN+e.inRule;return this.resyncFollows[r]},e.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,s.EOF)||t.push(e),t},e.prototype.reSyncTo=function(e){for(var t=[],r=this.LA(1);!1===this.tokenMatcher(r,e);)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return(0,l.default)(t)},e.prototype.attemptInRepetitionRecovery=function(e,t,r,n,i,a,s){},e.prototype.getCurrentGrammarPath=function(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:(0,f.default)(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}},e.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,u.default)(this.RULE_STACK,(function(t){return e.shortRuleNameToFullName(t)}))},e}();function x(e,t,r,n,i,a,o){var l=this.getKeyForAutomaticLookahead(n,i),c=this.firstAfterRepMap[l];if(void 0===c){var u=this.getCurrRuleFullName();c=new a(this.getGAstProductions()[u],i).startWalking(),this.firstAfterRepMap[l]=c}var h=c.token,d=c.occurrence,p=c.isEndOfRule;1===this.RULE_STACK.length&&p&&void 0===h&&(h=s.EOF,d=1),void 0!==h&&void 0!==d&&this.shouldInRepetitionRecoveryBeTried(h,d,o)&&this.tryInRepetitionRecovery(e,t,r,h)}t.Recoverable=y,t.attemptInRepetitionRecovery=x},50943:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TreeBuilder=void 0;var i=r(23059),a=n(r(50308)),s=n(r(18721)),o=n(r(3674)),l=n(r(52353)),c=r(85480),u=r(81183),h=function(){function e(){}return e.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,s.default)(e,"nodeLocationTracking")?e.nodeLocationTracking:u.DEFAULT_PARSER_CONFIG.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=i.setNodeLocationFull,this.setNodeLocationFromNode=i.setNodeLocationFull,this.cstPostRule=a.default,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=a.default,this.setNodeLocationFromNode=a.default,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=i.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=i.setNodeLocationOnlyOffset,this.cstPostRule=a.default,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=a.default,this.setNodeLocationFromNode=a.default,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error('Invalid <nodeLocationTracking> config option: "'.concat(e.nodeLocationTracking,'"'));this.setNodeLocationFromToken=a.default,this.setNodeLocationFromNode=a.default,this.cstPostRule=a.default,this.setInitialNodeLocation=a.default}else this.cstInvocationStateUpdate=a.default,this.cstFinallyStateUpdate=a.default,this.cstPostTerminal=a.default,this.cstPostNonTerminal=a.default,this.cstPostRule=a.default},e.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},e.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},e.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.cstInvocationStateUpdate=function(e){var t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)},e.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},e.prototype.cstPostRuleFull=function(e){var t=this.LA(0),r=e.location;r.startOffset<=t.startOffset==!0?(r.endOffset=t.endOffset,r.endLine=t.endLine,r.endColumn=t.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)},e.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),r=e.location;r.startOffset<=t.startOffset==!0?r.endOffset=t.endOffset:r.startOffset=NaN},e.prototype.cstPostTerminal=function(e,t){var r=this.CST_STACK[this.CST_STACK.length-1];(0,i.addTerminalToCst)(r,t,e),this.setNodeLocationFromToken(r.location,t)},e.prototype.cstPostNonTerminal=function(e,t){var r=this.CST_STACK[this.CST_STACK.length-1];(0,i.addNoneTerminalToCst)(r,t,e),this.setNodeLocationFromNode(r.location,e.location)},e.prototype.getBaseCstVisitorConstructor=function(){if((0,l.default)(this.baseCstVisitorConstructor)){var e=(0,c.createBaseSemanticVisitorConstructor)(this.className,(0,o.default)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,l.default)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,c.createBaseVisitorConstructorWithDefaults)(this.className,(0,o.default)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},e.prototype.getLastExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-1]},e.prototype.getPreviousExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-2]},e.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},e}();t.TreeBuilder=h},14989:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyMixins=void 0,t.applyMixins=function(e,t){t.forEach((function(t){var r=t.prototype;Object.getOwnPropertyNames(r).forEach((function(n){if("constructor"!==n){var i=Object.getOwnPropertyDescriptor(r,n);i&&(i.get||i.set)?Object.defineProperty(e.prototype,n,i):e.prototype[n]=t.prototype[n]}}))}))}},74879:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.charCodeToOptimizedIndex=t.minOptimizationVal=t.buildLineBreakIssueMessage=t.LineTerminatorOptimizedTester=t.isShortPattern=t.isCustomPattern=t.cloneEmptyGroups=t.performWarningRuntimeChecks=t.performRuntimeChecks=t.addStickyFlag=t.addStartOfInput=t.findUnreachablePatterns=t.findModesThatDoNotExist=t.findInvalidGroupType=t.findDuplicatePatterns=t.findUnsupportedFlags=t.findStartOfInputAnchor=t.findEmptyMatchRegExps=t.findEndOfInputAnchor=t.findInvalidPatterns=t.findMissingPatterns=t.validatePatterns=t.analyzeTokenTypes=t.enableSticky=t.disableSticky=t.SUPPORT_STICKY=t.MODES=t.DEFAULT_MODE=void 0;var s=r(94556),o=r(88200),l=a(r(8804)),c=a(r(41609)),u=a(r(39693)),h=a(r(1469)),d=a(r(52628)),p=a(r(85564)),f=a(r(43063)),m=a(r(91966)),g=a(r(3651)),v=a(r(35161)),A=a(r(84486)),y=a(r(47037)),x=a(r(23560)),b=a(r(52353)),w=a(r(13311)),E=a(r(18721)),S=a(r(3674)),M=a(r(96347)),_=a(r(63105)),T=a(r(91747)),C=a(r(54061)),I=a(r(64721)),B=r(68877),R=r(98759),P=r(34811),F="PATTERN";function L(e){var t=(0,_.default)(e,(function(e){return!(0,E.default)(e,F)}));return{errors:(0,v.default)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:o.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[e]}})),valid:(0,m.default)(e,t)}}function D(e){var t=(0,_.default)(e,(function(e){var t=e.PATTERN;return!((0,M.default)(t)||(0,x.default)(t)||(0,E.default)(t,"exec")||(0,y.default)(t))}));return{errors:(0,v.default)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:o.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[e]}})),valid:(0,m.default)(e,t)}}t.DEFAULT_MODE="defaultMode",t.MODES="modes",t.SUPPORT_STICKY="boolean"==typeof new RegExp("(?:)").sticky,t.disableSticky=function(){t.SUPPORT_STICKY=!1},t.enableSticky=function(){t.SUPPORT_STICKY=!0},t.analyzeTokenTypes=function(e,r){var n,i=(r=(0,T.default)(r,{useSticky:t.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(e,t){return t()}})).tracer;i("initCharCodeToOptimizedIndexMap",(function(){!function(){if((0,c.default)(ee)){ee=new Array(65536);for(var e=0;e<65536;e++)ee[e]=e>255?255+~~(e/255):e}}()})),i("Reject Lexer.NA",(function(){n=(0,f.default)(e,(function(e){return e.PATTERN===o.Lexer.NA}))}));var a,s,l,u,d,p,m,w,S,_,P,F=!1;i("Transform Patterns",(function(){F=!1,a=(0,v.default)(n,(function(e){var t=e.PATTERN;if((0,M.default)(t)){var n=t.source;return 1!==n.length||"^"===n||"$"===n||"."===n||t.ignoreCase?2!==n.length||"\\"!==n[0]||(0,I.default)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],n[1])?r.useSticky?X(t):W(t):n[1]:n}if((0,x.default)(t))return F=!0,{exec:t};if("object"==typeof t)return F=!0,t;if("string"==typeof t){if(1===t.length)return t;var i=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),a=new RegExp(i);return r.useSticky?X(a):W(a)}throw Error("non exhaustive match")}))})),i("misc mapping",(function(){s=(0,v.default)(n,(function(e){return e.tokenTypeIdx})),l=(0,v.default)(n,(function(e){var t=e.GROUP;if(t!==o.Lexer.SKIPPED){if((0,y.default)(t))return t;if((0,b.default)(t))return!1;throw Error("non exhaustive match")}})),u=(0,v.default)(n,(function(e){var t=e.LONGER_ALT;if(t)return(0,h.default)(t)?(0,v.default)(t,(function(e){return(0,g.default)(n,e)})):[(0,g.default)(n,t)]})),d=(0,v.default)(n,(function(e){return e.PUSH_MODE})),p=(0,v.default)(n,(function(e){return(0,E.default)(e,"POP_MODE")}))})),i("Line Terminator Handling",(function(){var e=Z(r.lineTerminatorCharacters);m=(0,v.default)(n,(function(e){return!1})),"onlyOffset"!==r.positionTracking&&(m=(0,v.default)(n,(function(t){return(0,E.default)(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===K(t,e)&&(0,R.canMatchCharCode)(e,t.PATTERN)})))})),i("Misc Mapping #2",(function(){w=(0,v.default)(n,Y),S=(0,v.default)(a,q),_=(0,C.default)(n,(function(e,t){var r=t.GROUP;return(0,y.default)(r)&&r!==o.Lexer.SKIPPED&&(e[r]=[]),e}),{}),P=(0,v.default)(a,(function(e,t){return{pattern:a[t],longerAlt:u[t],canLineTerminator:m[t],isCustom:w[t],short:S[t],group:l[t],push:d[t],pop:p[t],tokenTypeIdx:s[t],tokenType:n[t]}}))}));var L=!0,D=[];return r.safeMode||i("First Char Optimization",(function(){D=(0,C.default)(n,(function(e,t,n){if("string"==typeof t.PATTERN){var i=te(t.PATTERN.charCodeAt(0));$(e,i,P[n])}else if((0,h.default)(t.START_CHARS_HINT)){var a;(0,A.default)(t.START_CHARS_HINT,(function(t){var r=te("string"==typeof t?t.charCodeAt(0):t);a!==r&&(a=r,$(e,r,P[n]))}))}else if((0,M.default)(t.PATTERN))if(t.PATTERN.unicode)L=!1,r.ensureOptimizations&&(0,B.PRINT_ERROR)("".concat(R.failedOptimizationPrefixMsg)+"\tUnable to analyze < ".concat(t.PATTERN.toString()," > pattern.\n")+"\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var s=(0,R.getOptimizedStartCodesIndices)(t.PATTERN,r.ensureOptimizations);(0,c.default)(s)&&(L=!1),(0,A.default)(s,(function(t){$(e,t,P[n])}))}else r.ensureOptimizations&&(0,B.PRINT_ERROR)("".concat(R.failedOptimizationPrefixMsg)+"\tTokenType: <".concat(t.name,"> is using a custom token pattern without providing <start_chars_hint> parameter.\n")+"\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),L=!1;return e}),[])})),{emptyGroups:_,patternIdxToConfig:P,charCodeToPatternIdxToConfig:D,hasCustom:F,canBeOptimized:L}},t.validatePatterns=function(e,t){var r=[],n=L(e);r=r.concat(n.errors);var i=D(n.valid),a=i.valid;return r=(r=r.concat(i.errors)).concat(function(e){var t=[],r=(0,_.default)(e,(function(e){return(0,M.default)(e.PATTERN)}));return t=(t=(t=(t=(t=t.concat(N(r))).concat(G(r))).concat(z(r))).concat(V(r))).concat(k(r))}(a)),r=(r=(r=r.concat(H(a))).concat(Q(a,t))).concat(j(a))},t.findMissingPatterns=L,t.findInvalidPatterns=D;var U=/[^\\][$]/;function N(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return i(t,e),t.prototype.visitEndAnchor=function(e){this.found=!0},t}(s.BaseRegExpVisitor),r=(0,_.default)(e,(function(e){var r=e.PATTERN;try{var n=(0,P.getRegExpAst)(r),i=new t;return i.visit(n),i.found}catch(a){return U.test(r.source)}}));return(0,v.default)(r,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:o.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[e]}}))}function k(e){var t=(0,_.default)(e,(function(e){return e.PATTERN.test("")}));return(0,v.default)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:o.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[e]}}))}t.findEndOfInputAnchor=N,t.findEmptyMatchRegExps=k;var O=/[^\\[][\^]|^\^/;function G(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return i(t,e),t.prototype.visitStartAnchor=function(e){this.found=!0},t}(s.BaseRegExpVisitor),r=(0,_.default)(e,(function(e){var r=e.PATTERN;try{var n=(0,P.getRegExpAst)(r),i=new t;return i.visit(n),i.found}catch(a){return O.test(r.source)}}));return(0,v.default)(r,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:o.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[e]}}))}function z(e){var t=(0,_.default)(e,(function(e){var t=e.PATTERN;return t instanceof RegExp&&(t.multiline||t.global)}));return(0,v.default)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:o.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}}))}function V(e){var t=[],r=(0,v.default)(e,(function(r){return(0,C.default)(e,(function(e,n){return r.PATTERN.source!==n.PATTERN.source||(0,I.default)(t,n)||n.PATTERN===o.Lexer.NA||(t.push(n),e.push(n)),e}),[])}));r=(0,u.default)(r);var n=(0,_.default)(r,(function(e){return e.length>1}));return(0,v.default)(n,(function(e){var t=(0,v.default)(e,(function(e){return e.name})),r=(0,l.default)(e).PATTERN;return{message:"The same RegExp pattern ->".concat(r,"<-")+"has been used in all of the following Token Types: ".concat(t.join(", ")," <-"),type:o.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}))}function H(e){var t=(0,_.default)(e,(function(e){if(!(0,E.default)(e,"GROUP"))return!1;var t=e.GROUP;return t!==o.Lexer.SKIPPED&&t!==o.Lexer.NA&&!(0,y.default)(t)}));return(0,v.default)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:o.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}}))}function Q(e,t){var r=(0,_.default)(e,(function(e){return void 0!==e.PUSH_MODE&&!(0,I.default)(t,e.PUSH_MODE)}));return(0,v.default)(r,(function(e){return{message:"Token Type: ->".concat(e.name,"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->").concat(e.PUSH_MODE,"<-")+"which does not exist",type:o.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}}))}function j(e){var t=[],r=(0,C.default)(e,(function(e,t,r){var n,i,a=t.PATTERN;return a===o.Lexer.NA||((0,y.default)(a)?e.push({str:a,idx:r,tokenType:t}):(0,M.default)(a)&&(n=a,i=[".","\\","[","]","|","^","$","(",")","?","*","+","{"],void 0===(0,w.default)(i,(function(e){return-1!==n.source.indexOf(e)})))&&e.push({str:a.source,idx:r,tokenType:t})),e}),[]);return(0,A.default)(e,(function(e,n){(0,A.default)(r,(function(r){var i=r.str,a=r.idx,s=r.tokenType;if(n<a&&function(e,t){if((0,M.default)(t)){var r=t.exec(e);return null!==r&&0===r.index}if((0,x.default)(t))return t(e,0,[],{});if((0,E.default)(t,"exec"))return t.exec(e,0,[],{});if("string"==typeof t)return t===e;throw Error("non exhaustive match")}(i,e.PATTERN)){var l="Token: ->".concat(s.name,"<- can never be matched.\n")+"Because it appears AFTER the Token Type ->".concat(e.name,"<-")+"in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE";t.push({message:l,type:o.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}}))})),t}function W(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:".concat(e.source,")"),t)}function X(e){var t=e.ignoreCase?"iy":"y";return new RegExp("".concat(e.source),t)}function Y(e){var t=e.PATTERN;if((0,M.default)(t))return!1;if((0,x.default)(t))return!0;if((0,E.default)(t,"exec"))return!0;if((0,y.default)(t))return!1;throw Error("non exhaustive match")}function q(e){return!(!(0,y.default)(e)||1!==e.length)&&e.charCodeAt(0)}function K(e,t){if((0,E.default)(e,"LINE_BREAKS"))return!1;if((0,M.default)(e.PATTERN)){try{(0,R.canMatchCharCode)(t,e.PATTERN)}catch(r){return{issue:o.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}if((0,y.default)(e.PATTERN))return!1;if(Y(e))return{issue:o.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function J(e,t){if(t.issue===o.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n"+"\tThe problem is in the <".concat(e.name,"> Token Type\n")+"\t Root cause: ".concat(t.errMsg,".\n")+"\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===o.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the <line_breaks> option.\n"+"\tThe problem is in the <".concat(e.name,"> Token Type\n")+"\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}function Z(e){return(0,v.default)(e,(function(e){return(0,y.default)(e)?e.charCodeAt(0):e}))}function $(e,t,r){void 0===e[t]?e[t]=[r]:e[t].push(r)}t.findStartOfInputAnchor=G,t.findUnsupportedFlags=z,t.findDuplicatePatterns=V,t.findInvalidGroupType=H,t.findModesThatDoNotExist=Q,t.findUnreachablePatterns=j,t.addStartOfInput=W,t.addStickyFlag=X,t.performRuntimeChecks=function(e,r,n){var i=[];return(0,E.default)(e,t.DEFAULT_MODE)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+t.DEFAULT_MODE+"> property in its definition\n",type:o.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,E.default)(e,t.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+t.MODES+"> property in its definition\n",type:o.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,E.default)(e,t.MODES)&&(0,E.default)(e,t.DEFAULT_MODE)&&!(0,E.default)(e.modes,e.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a ".concat(t.DEFAULT_MODE,": <").concat(e.defaultMode,">")+"which does not exist\n",type:o.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,E.default)(e,t.MODES)&&(0,A.default)(e.modes,(function(e,t){(0,A.default)(e,(function(r,n){if((0,b.default)(r))i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+"<".concat(t,"> at index: <").concat(n,">\n"),type:o.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if((0,E.default)(r,"LONGER_ALT")){var a=(0,h.default)(r.LONGER_ALT)?r.LONGER_ALT:[r.LONGER_ALT];(0,A.default)(a,(function(n){(0,b.default)(n)||(0,I.default)(e,n)||i.push({message:"A MultiMode Lexer cannot be initialized with a longer_alt <".concat(n.name,"> on token <").concat(r.name,"> outside of mode <").concat(t,">\n"),type:o.LexerDefinitionErrorType.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})}))}}))})),i},t.performWarningRuntimeChecks=function(e,t,r){var n=[],i=!1,a=(0,u.default)((0,p.default)((0,d.default)(e.modes))),s=(0,f.default)(a,(function(e){return e.PATTERN===o.Lexer.NA})),l=Z(r);return t&&(0,A.default)(s,(function(e){var t=K(e,l);if(!1!==t){var r={message:J(e,t),type:t.issue,tokenType:e};n.push(r)}else(0,E.default)(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):(0,R.canMatchCharCode)(l,e.PATTERN)&&(i=!0)})),t&&!i&&n.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:o.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),n},t.cloneEmptyGroups=function(e){var t={},r=(0,S.default)(e);return(0,A.default)(r,(function(r){var n=e[r];if(!(0,h.default)(n))throw Error("non exhaustive match");t[r]=[]})),t},t.isCustomPattern=Y,t.isShortPattern=q,t.LineTerminatorOptimizedTester={test:function(e){for(var t=e.length,r=this.lastIndex;r<t;r++){var n=e.charCodeAt(r);if(10===n)return this.lastIndex=r+1,!0;if(13===n)return 10===e.charCodeAt(r+1)?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0},t.buildLineBreakIssueMessage=J,t.minOptimizationVal=256;var ee=[];function te(e){return e<t.minOptimizationVal?e:ee[e]}t.charCodeToOptimizedIndex=te},58232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultLexerErrorProvider=void 0,t.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->".concat(e.image,"<- The Mode Stack is empty")},buildUnexpectedCharactersMessage:function(e,t,r,n,i){return"unexpected character: ->".concat(e.charAt(t),"<- at offset: ").concat(t,",")+" skipped ".concat(r," characters.")}}},88200:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Lexer=t.LexerDefinitionErrorType=void 0;var i=r(74879),a=n(r(50308)),s=n(r(41609)),o=n(r(1469)),l=n(r(10928)),c=n(r(43063)),u=n(r(35161)),h=n(r(84486)),d=n(r(3674)),p=n(r(52353)),f=n(r(6557)),m=n(r(28583)),g=n(r(54061)),v=n(r(66678)),A=r(68877),y=r(22963),x=r(58232),b=r(34811);!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(t.LexerDefinitionErrorType||(t.LexerDefinitionErrorType={}));var w={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:x.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(w);var E=function(){function e(e,t){void 0===t&&(t=w);var r=this;if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=function(e,t){if(!0===r.traceInitPerf){r.traceInitIndent++;var n=new Array(r.traceInitIndent+1).join("\t");r.traceInitIndent<r.traceInitMaxIdent&&console.log("".concat(n,"--\x3e <").concat(e,">"));var i=(0,A.timer)(t),a=i.time,s=i.value,o=a>10?console.warn:console.log;return r.traceInitIndent<r.traceInitMaxIdent&&o("".concat(n,"<-- <").concat(e,"> time: ").concat(a,"ms")),r.traceInitIndent--,s}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=(0,m.default)({},w,t);var n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(function(){var n,l=!0;r.TRACE_INIT("Lexer Config handling",(function(){if(r.config.lineTerminatorsPattern===w.lineTerminatorsPattern)r.config.lineTerminatorsPattern=i.LineTerminatorOptimizedTester;else if(r.config.lineTerminatorCharacters===w.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');r.trackStartLines=/full|onlyStart/i.test(r.config.positionTracking),r.trackEndLines=/full/i.test(r.config.positionTracking),(0,o.default)(e)?n={modes:{defaultMode:(0,v.default)(e)},defaultMode:i.DEFAULT_MODE}:(l=!1,n=(0,v.default)(e))})),!1===r.config.skipValidations&&(r.TRACE_INIT("performRuntimeChecks",(function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat((0,i.performRuntimeChecks)(n,r.trackStartLines,r.config.lineTerminatorCharacters))})),r.TRACE_INIT("performWarningRuntimeChecks",(function(){r.lexerDefinitionWarning=r.lexerDefinitionWarning.concat((0,i.performWarningRuntimeChecks)(n,r.trackStartLines,r.config.lineTerminatorCharacters))}))),n.modes=n.modes?n.modes:{},(0,h.default)(n.modes,(function(e,t){n.modes[t]=(0,c.default)(e,(function(e){return(0,p.default)(e)}))}));var x=(0,d.default)(n.modes);if((0,h.default)(n.modes,(function(e,n){r.TRACE_INIT("Mode: <".concat(n,"> processing"),(function(){var a;(r.modes.push(n),!1===r.config.skipValidations&&r.TRACE_INIT("validatePatterns",(function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat((0,i.validatePatterns)(e,x))})),(0,s.default)(r.lexerDefinitionErrors))&&((0,y.augmentTokenTypes)(e),r.TRACE_INIT("analyzeTokenTypes",(function(){a=(0,i.analyzeTokenTypes)(e,{lineTerminatorCharacters:r.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:r.TRACE_INIT})})),r.patternIdxToConfig[n]=a.patternIdxToConfig,r.charCodeToPatternIdxToConfig[n]=a.charCodeToPatternIdxToConfig,r.emptyGroups=(0,m.default)({},r.emptyGroups,a.emptyGroups),r.hasCustom=a.hasCustom||r.hasCustom,r.canModeBeOptimized[n]=a.canBeOptimized)}))})),r.defaultMode=n.defaultMode,!(0,s.default)(r.lexerDefinitionErrors)&&!r.config.deferDefinitionErrorsHandling){var E=(0,u.default)(r.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+E)}(0,h.default)(r.lexerDefinitionWarning,(function(e){(0,A.PRINT_WARNING)(e.message)})),r.TRACE_INIT("Choosing sub-methods implementations",(function(){if(i.SUPPORT_STICKY?(r.chopInput=f.default,r.match=r.matchWithTest):(r.updateLastIndex=a.default,r.match=r.matchWithExec),l&&(r.handleModes=a.default),!1===r.trackStartLines&&(r.computeNewColumn=f.default),!1===r.trackEndLines&&(r.updateTokenEndLineColumnLocation=a.default),/full/i.test(r.config.positionTracking))r.createTokenInstance=r.createFullToken;else if(/onlyStart/i.test(r.config.positionTracking))r.createTokenInstance=r.createStartOnlyToken;else{if(!/onlyOffset/i.test(r.config.positionTracking))throw Error('Invalid <positionTracking> config option: "'.concat(r.config.positionTracking,'"'));r.createTokenInstance=r.createOffsetOnlyToken}r.hasCustom?(r.addToken=r.addTokenUsingPush,r.handlePayload=r.handlePayloadWithCustom):(r.addToken=r.addTokenUsingMemberAccess,r.handlePayload=r.handlePayloadNoCustom)})),r.TRACE_INIT("Failed Optimization Warnings",(function(){var e=(0,g.default)(r.canModeBeOptimized,(function(e,t,r){return!1===t&&e.push(r),e}),[]);if(t.ensureOptimizations&&!(0,s.default)(e))throw Error("Lexer Modes: < ".concat(e.join(", ")," > cannot be optimized.\n")+'\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.')})),r.TRACE_INIT("clearRegExpParserCache",(function(){(0,b.clearRegExpParserCache)()})),r.TRACE_INIT("toFastProperties",(function(){(0,A.toFastProperties)(r)}))}))}return e.prototype.tokenize=function(e,t){if(void 0===t&&(t=this.defaultMode),!(0,s.default)(this.lexerDefinitionErrors)){var r=(0,u.default)(this.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+r)}return this.tokenizeInternal(e,t)},e.prototype.tokenizeInternal=function(e,t){var r,n,a,s,o,c,u,h,d,p,f,m,g,v,A,y,x=this,b=e,w=b.length,E=0,S=0,M=this.hasCustom?0:Math.floor(e.length/10),_=new Array(M),T=[],C=this.trackStartLines?1:void 0,I=this.trackStartLines?1:void 0,B=(0,i.cloneEmptyGroups)(this.emptyGroups),R=this.trackStartLines,P=this.config.lineTerminatorsPattern,F=0,L=[],D=[],U=[],N=[];function k(){return L}function O(e){var t=(0,i.charCodeToOptimizedIndex)(e),r=D[t];return void 0===r?N:r}Object.freeze(N);var G,z=function(e){if(1===U.length&&void 0===e.tokenType.PUSH_MODE){var t=x.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);T.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{U.pop();var r=(0,l.default)(U);L=x.patternIdxToConfig[r],D=x.charCodeToPatternIdxToConfig[r],F=L.length;var n=x.canModeBeOptimized[r]&&!1===x.config.safeMode;y=D&&n?O:k}};function V(e){U.push(e),D=this.charCodeToPatternIdxToConfig[e],L=this.patternIdxToConfig[e],F=L.length,F=L.length;var t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;y=D&&t?O:k}V.call(this,t);for(var H=this.config.recoveryEnabled;E<w;){c=null;var Q=b.charCodeAt(E),j=y(Q),W=j.length;for(r=0;r<W;r++){var X=(G=j[r]).pattern;if(u=null,!1!==(ie=G.short)?Q===ie&&(c=X):!0===G.isCustom?null!==(A=X.exec(b,E,_,B))?(c=A[0],void 0!==A.payload&&(u=A.payload)):c=null:(this.updateLastIndex(X,E),c=this.match(X,e,E)),null!==c){if(void 0!==(o=G.longerAlt)){var Y=o.length;for(a=0;a<Y;a++){var q=L[o[a]],K=q.pattern;if(h=null,!0===q.isCustom?null!==(A=K.exec(b,E,_,B))?(s=A[0],void 0!==A.payload&&(h=A.payload)):s=null:(this.updateLastIndex(K,E),s=this.match(K,e,E)),s&&s.length>c.length){c=s,u=h,G=q;break}}}break}}if(null!==c){if(d=c.length,void 0!==(p=G.group)&&(f=G.tokenTypeIdx,m=this.createTokenInstance(c,E,f,G.tokenType,C,I,d),this.handlePayload(m,u),!1===p?S=this.addToken(_,S,m):B[p].push(m)),e=this.chopInput(e,d),E+=d,I=this.computeNewColumn(I,d),!0===R&&!0===G.canLineTerminator){var J=0,Z=void 0,$=void 0;P.lastIndex=0;do{!0===(Z=P.test(c))&&($=P.lastIndex-1,J++)}while(!0===Z);0!==J&&(C+=J,I=d-$,this.updateTokenEndLineColumnLocation(m,p,$,J,C,I,d))}this.handleModes(G,z,V,m)}else{for(var ee=E,te=C,re=I,ne=!1===H;!1===ne&&E<w;)for(e=this.chopInput(e,1),E++,n=0;n<F;n++){var ie,ae=L[n];X=ae.pattern;if(!1!==(ie=ae.short)?b.charCodeAt(E)===ie&&(ne=!0):!0===ae.isCustom?ne=null!==X.exec(b,E,_,B):(this.updateLastIndex(X,E),ne=null!==X.exec(e)),!0===ne)break}if(g=E-ee,v=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(b,ee,g,te,re),T.push({offset:ee,line:te,column:re,length:g,message:v}),!1===H)break}}return this.hasCustom||(_.length=S),{tokens:_,groups:B,errors:T}},e.prototype.handleModes=function(e,t,r,n){if(!0===e.pop){var i=e.push;t(n),void 0!==i&&r.call(this,i)}else void 0!==e.push&&r.call(this,e.push)},e.prototype.chopInput=function(e,t){return e.substring(t)},e.prototype.updateLastIndex=function(e,t){e.lastIndex=t},e.prototype.updateTokenEndLineColumnLocation=function(e,t,r,n,i,a,s){var o,l;void 0!==t&&(l=(o=r===s-1)?-1:0,1===n&&!0===o||(e.endLine=i+l,e.endColumn=a-1-l))},e.prototype.computeNewColumn=function(e,t){return e+t},e.prototype.createOffsetOnlyToken=function(e,t,r,n){return{image:e,startOffset:t,tokenTypeIdx:r,tokenType:n}},e.prototype.createStartOnlyToken=function(e,t,r,n,i,a){return{image:e,startOffset:t,startLine:i,startColumn:a,tokenTypeIdx:r,tokenType:n}},e.prototype.createFullToken=function(e,t,r,n,i,a,s){return{image:e,startOffset:t,endOffset:t+s-1,startLine:i,endLine:i,startColumn:a,endColumn:a+s-1,tokenTypeIdx:r,tokenType:n}},e.prototype.addTokenUsingPush=function(e,t,r){return e.push(r),t},e.prototype.addTokenUsingMemberAccess=function(e,t,r){return e[t]=r,++t},e.prototype.handlePayloadNoCustom=function(e,t){},e.prototype.handlePayloadWithCustom=function(e,t){null!==t&&(e.payload=t)},e.prototype.matchWithTest=function(e,t,r){return!0===e.test(t)?t.substring(r,e.lastIndex):null},e.prototype.matchWithExec=function(e,t){var r=e.exec(t);return null!==r?r[0]:null},e.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",e.NA=/NOT_APPLICABLE/,e}();t.Lexer=E},98759:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.canMatchCharCode=t.firstCharOptimizedIndices=t.getOptimizedStartCodesIndices=t.failedOptimizationPrefixMsg=void 0;var s=r(94556),o=a(r(1469)),l=a(r(711)),c=a(r(84486)),u=a(r(13311)),h=a(r(52628)),d=a(r(64721)),p=r(68877),f=r(34811),m=r(74879),g="Complement Sets are not supported for first char optimization";function v(e,t,r){switch(e.type){case"Disjunction":for(var n=0;n<e.value.length;n++)v(e.value[n],t,r);break;case"Alternative":var i=e.value;for(n=0;n<i.length;n++){var a=i[n];switch(a.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var s=a;switch(s.type){case"Character":A(s.value,t,r);break;case"Set":if(!0===s.complement)throw Error(g);(0,c.default)(s.value,(function(e){if("number"==typeof e)A(e,t,r);else{var n=e;if(!0===r)for(var i=n.from;i<=n.to;i++)A(i,t,r);else{for(i=n.from;i<=n.to&&i<m.minOptimizationVal;i++)A(i,t,r);if(n.to>=m.minOptimizationVal)for(var a=n.from>=m.minOptimizationVal?n.from:m.minOptimizationVal,s=n.to,o=(0,m.charCodeToOptimizedIndex)(a),l=(0,m.charCodeToOptimizedIndex)(s),c=o;c<=l;c++)t[c]=c}}}));break;case"Group":v(s.value,t,r);break;default:throw Error("Non Exhaustive Match")}var o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===x(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return(0,h.default)(t)}function A(e,t,r){var n=(0,m.charCodeToOptimizedIndex)(e);t[n]=n,!0===r&&function(e,t){var r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){t[i=(0,m.charCodeToOptimizedIndex)(n.charCodeAt(0))]=i}else{var i,a=r.toLowerCase();if(a!==r)t[i=(0,m.charCodeToOptimizedIndex)(a.charCodeAt(0))]=i}}(e,t)}function y(e,t){return(0,u.default)(e.value,(function(e){if("number"==typeof e)return(0,d.default)(t,e);var r=e;return void 0!==(0,u.default)(t,(function(e){return r.from<=e&&e<=r.to}))}))}function x(e){var t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&((0,o.default)(e.value)?(0,l.default)(e.value,x):x(e.value))}t.failedOptimizationPrefixMsg='Unable to use "first char" lexer optimizations:\n',t.getOptimizedStartCodesIndices=function(e,r){void 0===r&&(r=!1);try{var n=(0,f.getRegExpAst)(e);return v(n.value,{},n.flags.ignoreCase)}catch(a){if(a.message===g)r&&(0,p.PRINT_WARNING)("".concat(t.failedOptimizationPrefixMsg)+"\tUnable to optimize: < ".concat(e.toString()," >\n")+"\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var i="";r&&(i="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),(0,p.PRINT_ERROR)("".concat(t.failedOptimizationPrefixMsg,"\n")+"\tFailed parsing: < ".concat(e.toString()," >\n")+"\tUsing the regexp-to-ast library version: ".concat(s.VERSION,"\n")+"\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]},t.firstCharOptimizedIndices=v;var b=function(e){function t(t){var r=e.call(this)||this;return r.targetCharCodes=t,r.found=!1,r}return i(t,e),t.prototype.visitChildren=function(t){if(!0!==this.found){switch(t.type){case"Lookahead":return void this.visitLookahead(t);case"NegativeLookahead":return void this.visitNegativeLookahead(t)}e.prototype.visitChildren.call(this,t)}},t.prototype.visitCharacter=function(e){(0,d.default)(this.targetCharCodes,e.value)&&(this.found=!0)},t.prototype.visitSet=function(e){e.complement?void 0===y(e,this.targetCharCodes)&&(this.found=!0):void 0!==y(e,this.targetCharCodes)&&(this.found=!0)},t}(s.BaseRegExpVisitor);t.canMatchCharCode=function(e,t){if(t instanceof RegExp){var r=(0,f.getRegExpAst)(t),n=new b(e);return n.visit(r),n.found}return void 0!==(0,u.default)(t,(function(t){return(0,d.default)(e,t.charCodeAt(0))}))}},34811:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearRegExpParserCache=t.getRegExpAst=void 0;var n=r(94556),i={},a=new n.RegExpParser;t.getRegExpAst=function(e){var t=e.toString();if(i.hasOwnProperty(t))return i[t];var r=a.pattern(t);return i[t]=r,r},t.clearRegExpParserCache=function(){i={}}},22963:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isTokenType=t.hasExtendingTokensTypesMapProperty=t.hasExtendingTokensTypesProperty=t.hasCategoriesProperty=t.hasShortKeyProperty=t.singleAssignCategoriesToksMap=t.assignCategoriesMapProp=t.assignCategoriesTokensProp=t.assignTokenDefaultProps=t.expandCategories=t.augmentTokenTypes=t.tokenIdxToClass=t.tokenShortNameIdx=t.tokenStructuredMatcherNoCategories=t.tokenStructuredMatcher=void 0;var i=n(r(41609)),a=n(r(39693)),s=n(r(1469)),o=n(r(85564)),l=n(r(91966)),c=n(r(35161)),u=n(r(84486)),h=n(r(18721)),d=n(r(64721)),p=n(r(66678));function f(e){for(var t=(0,p.default)(e),r=e,n=!0;n;){r=(0,a.default)((0,o.default)((0,c.default)(r,(function(e){return e.CATEGORIES}))));var s=(0,l.default)(r,t);t=t.concat(s),(0,i.default)(s)?n=!1:r=s}return t}function m(e){(0,u.default)(e,(function(e){y(e)||(t.tokenIdxToClass[t.tokenShortNameIdx]=e,e.tokenTypeIdx=t.tokenShortNameIdx++),x(e)&&!(0,s.default)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),x(e)||(e.CATEGORIES=[]),b(e)||(e.categoryMatches=[]),w(e)||(e.categoryMatchesMap={})}))}function g(e){(0,u.default)(e,(function(e){e.categoryMatches=[],(0,u.default)(e.categoryMatchesMap,(function(r,n){e.categoryMatches.push(t.tokenIdxToClass[n].tokenTypeIdx)}))}))}function v(e){(0,u.default)(e,(function(e){A([],e)}))}function A(e,t){(0,u.default)(e,(function(e){t.categoryMatchesMap[e.tokenTypeIdx]=!0})),(0,u.default)(t.CATEGORIES,(function(r){var n=e.concat(t);(0,d.default)(n,r)||A(n,r)}))}function y(e){return(0,h.default)(e,"tokenTypeIdx")}function x(e){return(0,h.default)(e,"CATEGORIES")}function b(e){return(0,h.default)(e,"categoryMatches")}function w(e){return(0,h.default)(e,"categoryMatchesMap")}t.tokenStructuredMatcher=function(e,t){var r=e.tokenTypeIdx;return r===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[r]},t.tokenStructuredMatcherNoCategories=function(e,t){return e.tokenTypeIdx===t.tokenTypeIdx},t.tokenShortNameIdx=1,t.tokenIdxToClass={},t.augmentTokenTypes=function(e){var t=f(e);m(t),v(t),g(t),(0,u.default)(t,(function(e){e.isParent=e.categoryMatches.length>0}))},t.expandCategories=f,t.assignTokenDefaultProps=m,t.assignCategoriesTokensProp=g,t.assignCategoriesMapProp=v,t.singleAssignCategoriesToksMap=A,t.hasShortKeyProperty=y,t.hasCategoriesProperty=x,t.hasExtendingTokensTypesProperty=b,t.hasExtendingTokensTypesMapProperty=w,t.isTokenType=function(e){return(0,h.default)(e,"tokenTypeIdx")}},58980:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.tokenMatcher=t.createTokenInstance=t.EOF=t.createToken=t.hasTokenLabel=t.tokenName=t.tokenLabel=void 0;var i=n(r(47037)),a=n(r(18721)),s=n(r(52353)),o=r(88200),l=r(22963);function c(e){return(0,i.default)(e.LABEL)&&""!==e.LABEL}t.tokenLabel=function(e){return c(e)?e.LABEL:e.name},t.tokenName=function(e){return e.name},t.hasTokenLabel=c;var u="parent",h="categories",d="label",p="group",f="push_mode",m="pop_mode",g="longer_alt",v="line_breaks",A="start_chars_hint";function y(e){return function(e){var t=e.pattern,r={};r.name=e.name,(0,s.default)(t)||(r.PATTERN=t);if((0,a.default)(e,u))throw"The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";(0,a.default)(e,h)&&(r.CATEGORIES=e.categories);(0,l.augmentTokenTypes)([r]),(0,a.default)(e,d)&&(r.LABEL=e.label);(0,a.default)(e,p)&&(r.GROUP=e.group);(0,a.default)(e,m)&&(r.POP_MODE=e.pop_mode);(0,a.default)(e,f)&&(r.PUSH_MODE=e.push_mode);(0,a.default)(e,g)&&(r.LONGER_ALT=e.longer_alt);(0,a.default)(e,v)&&(r.LINE_BREAKS=e.line_breaks);(0,a.default)(e,A)&&(r.START_CHARS_HINT=e.start_chars_hint);return r}(e)}t.createToken=y,t.EOF=y({name:"EOF",pattern:o.Lexer.NA}),(0,l.augmentTokenTypes)([t.EOF]),t.createTokenInstance=function(e,t,r,n,i,a,s,o){return{image:t,startOffset:r,endOffset:n,startLine:i,endLine:a,startColumn:s,endColumn:o,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}},t.tokenMatcher=function(e,t){return(0,l.tokenStructuredMatcher)(e,t)}},97657:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="10.5.0"},99486:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function a(e){return i(1,arguments),e instanceof Date||"object"===n(e)&&"[object Date]"===Object.prototype.toString.call(e)}function s(e){i(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===n(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function o(e){if(i(1,arguments),!a(e)&&"number"!=typeof e)return!1;var t=s(e);return!isNaN(Number(t))}function l(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function c(e,t){i(2,arguments);var r=s(e).getTime(),n=l(t);return new Date(r+n)}function u(e,t){i(2,arguments);var r=l(t);return c(e,-r)}r.r(t),r.d(t,{default:()=>oe});var h=864e5;function d(e){i(1,arguments);var t=1,r=s(e),n=r.getUTCDay(),a=(n<t?7:0)+n-t;return r.setUTCDate(r.getUTCDate()-a),r.setUTCHours(0,0,0,0),r}function p(e){i(1,arguments);var t=s(e),r=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(r+1,0,4),n.setUTCHours(0,0,0,0);var a=d(n),o=new Date(0);o.setUTCFullYear(r,0,4),o.setUTCHours(0,0,0,0);var l=d(o);return t.getTime()>=a.getTime()?r+1:t.getTime()>=l.getTime()?r:r-1}function f(e){i(1,arguments);var t=p(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=d(r);return n}var m=6048e5;var g={};function v(){return g}function A(e,t){var r,n,a,o,c,u,h,d;i(1,arguments);var p=v(),f=l(null!==(r=null!==(n=null!==(a=null!==(o=null==t?void 0:t.weekStartsOn)&&void 0!==o?o:null==t||null===(c=t.locale)||void 0===c||null===(u=c.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==a?a:p.weekStartsOn)&&void 0!==n?n:null===(h=p.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.weekStartsOn)&&void 0!==r?r:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=s(e),g=m.getUTCDay(),A=(g<f?7:0)+g-f;return m.setUTCDate(m.getUTCDate()-A),m.setUTCHours(0,0,0,0),m}function y(e,t){var r,n,a,o,c,u,h,d;i(1,arguments);var p=s(e),f=p.getUTCFullYear(),m=v(),g=l(null!==(r=null!==(n=null!==(a=null!==(o=null==t?void 0:t.firstWeekContainsDate)&&void 0!==o?o:null==t||null===(c=t.locale)||void 0===c||null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==a?a:m.firstWeekContainsDate)&&void 0!==n?n:null===(h=m.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==r?r:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(f+1,0,g),y.setUTCHours(0,0,0,0);var x=A(y,t),b=new Date(0);b.setUTCFullYear(f,0,g),b.setUTCHours(0,0,0,0);var w=A(b,t);return p.getTime()>=x.getTime()?f+1:p.getTime()>=w.getTime()?f:f-1}function x(e,t){var r,n,a,s,o,c,u,h;i(1,arguments);var d=v(),p=l(null!==(r=null!==(n=null!==(a=null!==(s=null==t?void 0:t.firstWeekContainsDate)&&void 0!==s?s:null==t||null===(o=t.locale)||void 0===o||null===(c=o.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==a?a:d.firstWeekContainsDate)&&void 0!==n?n:null===(u=d.locale)||void 0===u||null===(h=u.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==r?r:1),f=y(e,t),m=new Date(0);m.setUTCFullYear(f,0,p),m.setUTCHours(0,0,0,0);var g=A(m,t);return g}var b=6048e5;function w(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return r+n}const E={y:function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return w("yy"===t?n%100:n,t.length)},M:function(e,t){var r=e.getUTCMonth();return"M"===t?String(r+1):w(r+1,2)},d:function(e,t){return w(e.getUTCDate(),t.length)},a:function(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:function(e,t){return w(e.getUTCHours()%12||12,t.length)},H:function(e,t){return w(e.getUTCHours(),t.length)},m:function(e,t){return w(e.getUTCMinutes(),t.length)},s:function(e,t){return w(e.getUTCSeconds(),t.length)},S:function(e,t){var r=t.length,n=e.getUTCMilliseconds();return w(Math.floor(n*Math.pow(10,r-3)),t.length)}};var S="midnight",M="noon",_="morning",T="afternoon",C="evening",I="night",B={G:function(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){var n=e.getUTCFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return E.y(e,t)},Y:function(e,t,r,n){var i=y(e,n),a=i>0?i:1-i;return"YY"===t?w(a%100,2):"Yo"===t?r.ordinalNumber(a,{unit:"year"}):w(a,t.length)},R:function(e,t){return w(p(e),t.length)},u:function(e,t){return w(e.getUTCFullYear(),t.length)},Q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return w(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return w(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return E.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return w(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var a=function(e,t){i(1,arguments);var r=s(e),n=A(r,t).getTime()-x(r,t).getTime();return Math.round(n/b)+1}(e,n);return"wo"===t?r.ordinalNumber(a,{unit:"week"}):w(a,t.length)},I:function(e,t,r){var n=function(e){i(1,arguments);var t=s(e),r=d(t).getTime()-f(t).getTime();return Math.round(r/m)+1}(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):w(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):E.d(e,t)},D:function(e,t,r){var n=function(e){i(1,arguments);var t=s(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),a=r-n;return Math.floor(a/h)+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):w(n,t.length)},E:function(e,t,r){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var i=e.getUTCDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return w(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var i=e.getUTCDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return w(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),i=0===n?7:n;switch(t){case"i":return String(i);case"ii":return w(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n,i=e.getUTCHours();switch(n=12===i?M:0===i?S:i/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n,i=e.getUTCHours();switch(n=i>=17?C:i>=12?T:i>=4?_:I,t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return E.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):E.H(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):w(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):w(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):E.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):E.s(e,t)},S:function(e,t){return E.S(e,t)},X:function(e,t,r,n){var i=(n._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return P(i);case"XXXX":case"XX":return F(i);default:return F(i,":")}},x:function(e,t,r,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return P(i);case"xxxx":case"xx":return F(i);default:return F(i,":")}},O:function(e,t,r,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+R(i,":");default:return"GMT"+F(i,":")}},z:function(e,t,r,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+R(i,":");default:return"GMT"+F(i,":")}},t:function(e,t,r,n){var i=n._originalDate||e;return w(Math.floor(i.getTime()/1e3),t.length)},T:function(e,t,r,n){return w((n._originalDate||e).getTime(),t.length)}};function R(e,t){var r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(0===a)return r+String(i);var s=t||"";return r+String(i)+s+w(a,2)}function P(e,t){return e%60==0?(e>0?"-":"+")+w(Math.abs(e)/60,2):F(e,t)}function F(e,t){var r=t||"",n=e>0?"-":"+",i=Math.abs(e);return n+w(Math.floor(i/60),2)+r+w(i%60,2)}const L=B;var D=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},U=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},N={p:U,P:function(e,t){var r,n=e.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return D(e,t);switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",D(i,t)).replace("{{time}}",U(a,t))}};const k=N;function O(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var G=["D","DD"],z=["YY","YYYY"];function V(e){return-1!==G.indexOf(e)}function H(e){return-1!==z.indexOf(e)}function Q(e,t,r){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var j={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};const W=function(e,t,r){var n,i=j[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=r&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function X(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth,n=e.formats[r]||e.formats[e.defaultWidth];return n}}var Y={date:X({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:X({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:X({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})};var q={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function K(e){return function(t,r){var n;if("formatting"===(null!=r&&r.context?String(r.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=null!=r&&r.width?String(r.width):i;n=e.formattingValues[a]||e.formattingValues[i]}else{var s=e.defaultWidth,o=null!=r&&r.width?String(r.width):e.defaultWidth;n=e.values[o]||e.values[s]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function J(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;var s,o=a[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?$(l,(function(e){return e.test(o)})):Z(l,(function(e){return e.test(o)}));s=e.valueCallback?e.valueCallback(c):c,s=r.valueCallback?r.valueCallback(s):s;var u=t.slice(o.length);return{value:s,rest:u}}}function Z(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}function $(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r}var ee;const te={code:"en-US",formatDistance:W,formatLong:Y,formatRelative:function(e,t,r,n){return q[e]},localize:{ordinalNumber:function(e,t){var r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:K({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:K({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:K({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:K({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:K({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ee={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.match(ee.matchPattern);if(!r)return null;var n=r[0],i=e.match(ee.parsePattern);if(!i)return null;var a=ee.valueCallback?ee.valueCallback(i[0]):i[0];a=t.valueCallback?t.valueCallback(a):a;var s=e.slice(n.length);return{value:a,rest:s}}),era:J({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:J({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:J({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:J({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var re=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ne=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ie=/^'([^]*?)'?$/,ae=/''/g,se=/[a-zA-Z]/;function oe(e,t,r){var n,a,c,h,d,p,f,m,g,A,y,x,b,w,E,S,M,_;i(2,arguments);var T=String(t),C=v(),I=null!==(n=null!==(a=null==r?void 0:r.locale)&&void 0!==a?a:C.locale)&&void 0!==n?n:te,B=l(null!==(c=null!==(h=null!==(d=null!==(p=null==r?void 0:r.firstWeekContainsDate)&&void 0!==p?p:null==r||null===(f=r.locale)||void 0===f||null===(m=f.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==d?d:C.firstWeekContainsDate)&&void 0!==h?h:null===(g=C.locale)||void 0===g||null===(A=g.options)||void 0===A?void 0:A.firstWeekContainsDate)&&void 0!==c?c:1);if(!(B>=1&&B<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var R=l(null!==(y=null!==(x=null!==(b=null!==(w=null==r?void 0:r.weekStartsOn)&&void 0!==w?w:null==r||null===(E=r.locale)||void 0===E||null===(S=E.options)||void 0===S?void 0:S.weekStartsOn)&&void 0!==b?b:C.weekStartsOn)&&void 0!==x?x:null===(M=C.locale)||void 0===M||null===(_=M.options)||void 0===_?void 0:_.weekStartsOn)&&void 0!==y?y:0);if(!(R>=0&&R<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!I.localize)throw new RangeError("locale must contain localize property");if(!I.formatLong)throw new RangeError("locale must contain formatLong property");var P=s(e);if(!o(P))throw new RangeError("Invalid time value");var F=O(P),D=u(P,F),U={firstWeekContainsDate:B,weekStartsOn:R,locale:I,_originalDate:P},N=T.match(ne).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,k[t])(e,I.formatLong):e})).join("").match(re).map((function(n){if("''"===n)return"'";var i=n[0];if("'"===i)return le(n);var a=L[i];if(a)return null!=r&&r.useAdditionalWeekYearTokens||!H(n)||Q(n,t,String(e)),null!=r&&r.useAdditionalDayOfYearTokens||!V(n)||Q(n,t,String(e)),a(D,n,I.localize,U);if(i.match(se))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return n})).join("");return N}function le(e){var t=e.match(ie);return t?t[1].replace(ae,"'"):e}},20296:e=>{function t(e,t,r){var n,i,a,s,o;function l(){var c=Date.now()-s;c<t&&c>=0?n=setTimeout(l,t-c):(n=null,r||(o=e.apply(a,i),a=i=null))}null==t&&(t=100);var c=function(){a=this,i=arguments,s=Date.now();var c=r&&!n;return n||(n=setTimeout(l,t)),c&&(o=e.apply(a,i),a=i=null),o};return c.clear=function(){n&&(clearTimeout(n),n=null)},c.flush=function(){n&&(o=e.apply(a,i),a=i=null,clearTimeout(n),n=null)},c}t.debounce=t,e.exports=t},64063:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,a[i]))return!1;for(i=n;0!=i--;){var s=a[i];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},93778:(e,t,r)=>{"use strict";r.d(t,{GZ:()=>ve,HT:()=>ne,T8:()=>ce,TD:()=>le,Xo:()=>ge,_Z:()=>re});var n=Uint8Array,i=Uint16Array,a=Uint32Array,s=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),o=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),l=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=function(e,t){for(var r=new i(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var s=new a(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)s[o]=o-r[n]<<5|n;return[r,s]},u=c(s,2),h=u[0],d=u[1];h[28]=258,d[258]=28;for(var p=c(o,0),f=p[0],m=p[1],g=new i(32768),v=0;v<32768;++v){var A=(43690&v)>>>1|(21845&v)<<1;A=(61680&(A=(52428&A)>>>2|(13107&A)<<2))>>>4|(3855&A)<<4,g[v]=((65280&A)>>>8|(255&A)<<8)>>>1}var y=function(e,t,r){for(var n=e.length,a=0,s=new i(t);a<n;++a)++s[e[a]-1];var o,l=new i(t);for(a=0;a<t;++a)l[a]=l[a-1]+s[a-1]<<1;if(r){o=new i(1<<t);var c=15-t;for(a=0;a<n;++a)if(e[a])for(var u=a<<4|e[a],h=t-e[a],d=l[e[a]-1]++<<h,p=d|(1<<h)-1;d<=p;++d)o[g[d]>>>c]=u}else for(o=new i(n),a=0;a<n;++a)e[a]&&(o[a]=g[l[e[a]-1]++]>>>15-e[a]);return o},x=new n(288);for(v=0;v<144;++v)x[v]=8;for(v=144;v<256;++v)x[v]=9;for(v=256;v<280;++v)x[v]=7;for(v=280;v<288;++v)x[v]=8;var b=new n(32);for(v=0;v<32;++v)b[v]=5;var w=y(x,9,0),E=y(x,9,1),S=y(b,5,0),M=y(b,5,1),_=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},T=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&r},C=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},I=function(e){return(e/8|0)+(7&e&&1)},B=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var s=new(e instanceof i?i:e instanceof a?a:n)(r-t);return s.set(e.subarray(t,r)),s},R=function(e,t,r){var i=e.length;if(!i||r&&!r.l&&i<5)return t||new n(0);var a=!t||r,c=!r||r.i;r||(r={}),t||(t=new n(3*i));var u=function(e){var r=t.length;if(e>r){var i=new n(Math.max(2*r,e));i.set(t),t=i}},d=r.f||0,p=r.p||0,m=r.b||0,g=r.l,v=r.d,A=r.m,x=r.n,b=8*i;do{if(!g){r.f=d=T(e,p,1);var w=T(e,p+1,3);if(p+=3,!w){var S=e[(z=I(p)+4)-4]|e[z-3]<<8,R=z+S;if(R>i){if(c)throw"unexpected EOF";break}a&&u(m+S),t.set(e.subarray(z,R),m),r.b=m+=S,r.p=p=8*R;continue}if(1==w)g=E,v=M,A=9,x=5;else{if(2!=w)throw"invalid block type";var P=T(e,p,31)+257,F=T(e,p+10,15)+4,L=P+T(e,p+5,31)+1;p+=14;for(var D=new n(L),U=new n(19),N=0;N<F;++N)U[l[N]]=T(e,p+3*N,7);p+=3*F;var k=_(U),O=(1<<k)-1,G=y(U,k,1);for(N=0;N<L;){var z,V=G[T(e,p,O)];if(p+=15&V,(z=V>>>4)<16)D[N++]=z;else{var H=0,Q=0;for(16==z?(Q=3+T(e,p,3),p+=2,H=D[N-1]):17==z?(Q=3+T(e,p,7),p+=3):18==z&&(Q=11+T(e,p,127),p+=7);Q--;)D[N++]=H}}var j=D.subarray(0,P),W=D.subarray(P);A=_(j),x=_(W),g=y(j,A,1),v=y(W,x,1)}if(p>b){if(c)throw"unexpected EOF";break}}a&&u(m+131072);for(var X=(1<<A)-1,Y=(1<<x)-1,q=p;;q=p){var K=(H=g[C(e,p)&X])>>>4;if((p+=15&H)>b){if(c)throw"unexpected EOF";break}if(!H)throw"invalid length/literal";if(K<256)t[m++]=K;else{if(256==K){q=p,g=null;break}var J=K-254;if(K>264){var Z=s[N=K-257];J=T(e,p,(1<<Z)-1)+h[N],p+=Z}var $=v[C(e,p)&Y],ee=$>>>4;if(!$)throw"invalid distance";p+=15&$;W=f[ee];if(ee>3){Z=o[ee];W+=C(e,p)&(1<<Z)-1,p+=Z}if(p>b){if(c)throw"unexpected EOF";break}a&&u(m+131072);for(var te=m+J;m<te;m+=4)t[m]=t[m-W],t[m+1]=t[m+1-W],t[m+2]=t[m+2-W],t[m+3]=t[m+3-W];m=te}}r.l=g,r.p=q,r.b=m,g&&(d=1,r.m=A,r.d=v,r.n=x)}while(!d);return m==t.length?t:B(t,0,m)},P=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},F=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},L=function(e,t){for(var r=[],a=0;a<e.length;++a)e[a]&&r.push({s:a,f:e[a]});var s=r.length,o=r.slice();if(!s)return[z,0];if(1==s){var l=new n(r[0].s+1);return l[r[0].s]=1,[l,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var c=r[0],u=r[1],h=0,d=1,p=2;for(r[0]={s:-1,f:c.f+u.f,l:c,r:u};d!=s-1;)c=r[r[h].f<r[p].f?h++:p++],u=r[h!=d&&r[h].f<r[p].f?h++:p++],r[d++]={s:-1,f:c.f+u.f,l:c,r:u};var f=o[0].s;for(a=1;a<s;++a)o[a].s>f&&(f=o[a].s);var m=new i(f+1),g=D(r[d-1],m,0);if(g>t){a=0;var v=0,A=g-t,y=1<<A;for(o.sort((function(e,t){return m[t.s]-m[e.s]||e.f-t.f}));a<s;++a){var x=o[a].s;if(!(m[x]>t))break;v+=y-(1<<g-m[x]),m[x]=t}for(v>>>=A;v>0;){var b=o[a].s;m[b]<t?v-=1<<t-m[b]++-1:++a}for(;a>=0&&v;--a){var w=o[a].s;m[w]==t&&(--m[w],++v)}g=t}return[new n(m),g]},D=function(e,t,r){return-1==e.s?Math.max(D(e.l,t,r+1),D(e.r,t,r+1)):t[e.s]=r},U=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new i(++t),n=0,a=e[0],s=1,o=function(e){r[n++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=e[l]}return[r.subarray(0,n),t]},N=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},k=function(e,t,r){var n=r.length,i=I(t+2);e[i]=255&n,e[i+1]=n>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;a<n;++a)e[i+a+4]=r[a];return 8*(i+4+n)},O=function(e,t,r,n,a,c,u,h,d,p,f){P(t,f++,r),++a[256];for(var m=L(a,15),g=m[0],v=m[1],A=L(c,15),E=A[0],M=A[1],_=U(g),T=_[0],C=_[1],I=U(E),B=I[0],R=I[1],D=new i(19),O=0;O<T.length;++O)D[31&T[O]]++;for(O=0;O<B.length;++O)D[31&B[O]]++;for(var G=L(D,7),z=G[0],V=G[1],H=19;H>4&&!z[l[H-1]];--H);var Q,j,W,X,Y=p+5<<3,q=N(a,x)+N(c,b)+u,K=N(a,g)+N(c,E)+u+14+3*H+N(D,z)+(2*D[16]+3*D[17]+7*D[18]);if(Y<=q&&Y<=K)return k(t,f,e.subarray(d,d+p));if(P(t,f,1+(K<q)),f+=2,K<q){Q=y(g,v,0),j=g,W=y(E,M,0),X=E;var J=y(z,V,0);P(t,f,C-257),P(t,f+5,R-1),P(t,f+10,H-4),f+=14;for(O=0;O<H;++O)P(t,f+3*O,z[l[O]]);f+=3*H;for(var Z=[T,B],$=0;$<2;++$){var ee=Z[$];for(O=0;O<ee.length;++O){var te=31&ee[O];P(t,f,J[te]),f+=z[te],te>15&&(P(t,f,ee[O]>>>5&127),f+=ee[O]>>>12)}}}else Q=w,j=x,W=S,X=b;for(O=0;O<h;++O)if(n[O]>255){te=n[O]>>>18&31;F(t,f,Q[te+257]),f+=j[te+257],te>7&&(P(t,f,n[O]>>>23&31),f+=s[te]);var re=31&n[O];F(t,f,W[re]),f+=X[re],re>3&&(F(t,f,n[O]>>>5&8191),f+=o[re])}else F(t,f,Q[n[O]]),f+=j[n[O]];return F(t,f,Q[256]),f+j[256]},G=new a([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),z=new n(0),V=function(e,t,r,l,c,u){var h=e.length,p=new n(l+h+5*(1+Math.ceil(h/7e3))+c),f=p.subarray(l,p.length-c),g=0;if(!t||h<8)for(var v=0;v<=h;v+=65535){var A=v+65535;A<h?g=k(f,g,e.subarray(v,A)):(f[v]=u,g=k(f,g,e.subarray(v,h)))}else{for(var y=G[t-1],x=y>>>13,b=8191&y,w=(1<<r)-1,E=new i(32768),S=new i(w+1),M=Math.ceil(r/3),_=2*M,T=function(t){return(e[t]^e[t+1]<<M^e[t+2]<<_)&w},C=new a(25e3),R=new i(288),P=new i(32),F=0,L=0,D=(v=0,0),U=0,N=0;v<h;++v){var V=T(v),H=32767&v,Q=S[V];if(E[H]=Q,S[V]=H,U<=v){var j=h-v;if((F>7e3||D>24576)&&j>423){g=O(e,f,0,C,R,P,L,D,N,v-N,g),D=F=L=0,N=v;for(var W=0;W<286;++W)R[W]=0;for(W=0;W<30;++W)P[W]=0}var X=2,Y=0,q=b,K=H-Q&32767;if(j>2&&V==T(v-K))for(var J=Math.min(x,j)-1,Z=Math.min(32767,v),$=Math.min(258,j);K<=Z&&--q&&H!=Q;){if(e[v+X]==e[v+X-K]){for(var ee=0;ee<$&&e[v+ee]==e[v+ee-K];++ee);if(ee>X){if(X=ee,Y=K,ee>J)break;var te=Math.min(K,ee-2),re=0;for(W=0;W<te;++W){var ne=v-K+W+32768&32767,ie=ne-E[ne]+32768&32767;ie>re&&(re=ie,Q=ne)}}}K+=(H=Q)-(Q=E[H])+32768&32767}if(Y){C[D++]=268435456|d[X]<<18|m[Y];var ae=31&d[X],se=31&m[Y];L+=s[ae]+o[se],++R[257+ae],++P[se],U=v+X,++F}else C[D++]=e[v],++R[e[v]]}}g=O(e,f,u,C,R,P,L,D,N,v-N,g),!u&&7&g&&(g=k(f,g+1,z))}return B(p,0,l+I(g)+c)},H=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&-306674912)^r>>>1;e[t]=r}return e}(),Q=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=H[255&r^t[n]]^r>>>8;e=r},d:function(){return~e}}},j=function(e,t,r,n,i){return V(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!i)},W=function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},X=function(e,t){return e[t]|e[t+1]<<8},Y=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},q=function(e,t){return Y(e,t)+4294967296*Y(e,t+4)},K=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},J=function(e){if(31!=e[0]||139!=e[1]||8!=e[2])throw"invalid gzip data";var t=e[3],r=10;4&t&&(r+=e[10]|2+(e[11]<<8));for(var n=(t>>3&1)+(t>>4&1);n>0;n-=!e[r++]);return r+(2&t)},Z=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},$=function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"};function ee(e,t){return j(e,t||{},0,0)}function te(e,t){return R(e,t)}function re(e,t){return R(e.subarray(J(e),-8),t||new n(Z(e)))}function ne(e,t){return R(($(e),e.subarray(2,-4)),t)}var ie=function(e,t,r,i){for(var a in e){var s=e[a],o=t+a;s instanceof n?r[o]=[s,i]:Array.isArray(s)?r[o]=[s[0],W(i,s[1])]:ie(s,o+"/",r,i)}},ae="undefined"!=typeof TextEncoder&&new TextEncoder,se="undefined"!=typeof TextDecoder&&new TextDecoder;try{se.decode(z,{stream:!0}),1}catch(Ae){}var oe=function(e){for(var t="",r=0;;){var n=e[r++],i=(n>127)+(n>223)+(n>239);if(r+i>e.length)return[t,B(e,r-1)];i?3==i?(n=((15&n)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,t+=String.fromCharCode(55296|n>>10,56320|1023&n)):t+=1&i?String.fromCharCode((31&n)<<6|63&e[r++]):String.fromCharCode((15&n)<<12|(63&e[r++])<<6|63&e[r++]):t+=String.fromCharCode(n)}};function le(e,t){if(t){for(var r=new n(e.length),i=0;i<e.length;++i)r[i]=e.charCodeAt(i);return r}if(ae)return ae.encode(e);var a=e.length,s=new n(e.length+(e.length>>1)),o=0,l=function(e){s[o++]=e};for(i=0;i<a;++i){if(o+5>s.length){var c=new n(o+8+(a-i<<1));c.set(s),s=c}var u=e.charCodeAt(i);u<128||t?l(u):u<2048?(l(192|u>>6),l(128|63&u)):u>55295&&u<57344?(l(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++i))>>18),l(128|u>>12&63),l(128|u>>6&63),l(128|63&u)):(l(224|u>>12),l(128|u>>6&63),l(128|63&u))}return B(s,0,o)}function ce(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}if(se)return se.decode(e);var i=oe(e),a=i[0];if(i[1].length)throw"invalid utf-8 data";return a}var ue=function(e,t){return t+30+X(e,t+26)+X(e,t+28)},he=function(e,t,r){var n=X(e,t+28),i=ce(e.subarray(t+46,t+46+n),!(2048&X(e,t+8))),a=t+46+n,s=Y(e,t+20),o=r&&4294967295==s?de(e,a):[s,Y(e,t+24),Y(e,t+42)],l=o[0],c=o[1],u=o[2];return[X(e,t+10),l,c,i,a+X(e,t+30)+X(e,t+32),u]},de=function(e,t){for(;1!=X(e,t);t+=4+X(e,t+2));return[q(e,t+12),q(e,t+4),q(e,t+20)]},pe=function(e){var t=0;if(e)for(var r in e){var n=e[r].length;if(n>65535)throw"extra field too long";t+=n+4}return t},fe=function(e,t,r,n,i,a,s,o){var l=n.length,c=r.extra,u=o&&o.length,h=pe(c);K(e,t,null!=s?33639248:67324752),t+=4,null!=s&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(null==a&&8),e[t++]=i&&8,e[t++]=255&r.compression,e[t++]=r.compression>>8;var d=new Date(null==r.mtime?Date.now():r.mtime),p=d.getFullYear()-1980;if(p<0||p>119)throw"date not in range 1980-2099";if(K(e,t,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),t+=4,null!=a&&(K(e,t,r.crc),K(e,t+4,a),K(e,t+8,r.size)),K(e,t+12,l),K(e,t+14,h),t+=16,null!=s&&(K(e,t,u),K(e,t+6,r.attrs),K(e,t+10,s),t+=14),e.set(n,t),t+=l,h)for(var f in c){var m=c[f],g=m.length;K(e,t,+f),K(e,t+2,g),e.set(m,t+4),t+=4+g}return u&&(e.set(o,t),t+=u),t},me=function(e,t,r,n,i){K(e,t,101010256),K(e,t+8,r),K(e,t+10,r),K(e,t+12,n),K(e,t+16,i)};function ge(e,t){t||(t={});var r={},i=[];ie(e,"",r,t);var a=0,s=0;for(var o in r){var l=r[o],c=l[0],u=l[1],h=0==u.level?0:8,d=(S=le(o)).length,p=u.comment,f=p&&le(p),m=f&&f.length,g=pe(u.extra);if(d>65535)throw"filename too long";var v=h?ee(c,u):c,A=v.length,y=Q();y.p(c),i.push(W(u,{size:c.length,crc:y.d(),c:v,f:S,m:f,u:d!=o.length||f&&p.length!=m,o:a,compression:h})),a+=30+d+g+A,s+=76+2*(d+g)+(m||0)+A}for(var x=new n(s+22),b=a,w=s-a,E=0;E<i.length;++E){var S=i[E];fe(x,S.o,S,S.f,S.u,S.c.length);var M=30+S.f.length+pe(S.extra);x.set(S.c,S.o+M),fe(x,a,S,S.f,S.u,S.c.length,S.o,S.m),a+=16+M+(S.m?S.m.length:0)}return me(x,a,i.length,w,b),x}function ve(e){for(var t={},r=e.length-22;101010256!=Y(e,r);--r)if(!r||e.length-r>65558)throw"invalid zip file";var i=X(e,r+8);if(!i)return{};var a=Y(e,r+16),s=4294967295==a;if(s){if(r=Y(e,r-12),101075792!=Y(e,r))throw"invalid zip file";i=Y(e,r+32),a=Y(e,r+48)}for(var o=0;o<i;++o){var l=he(e,a,s),c=l[0],u=l[1],h=l[2],d=l[3],p=l[4],f=l[5],m=ue(e,f);if(a=p,c){if(8!=c)throw"unknown compression type "+c;t[d]=te(e.subarray(m,m+u),new n(h))}else t[d]=B(e,m,m+u)}return t}},76427:(e,t,r)=>{var n="__lodash_hash_undefined__",i=9007199254740991,a="[object Symbol]",s=/^\[object .+?Constructor\]$/,o=/^(?:0|[1-9]\d*)$/,l="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")();function h(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function d(e,t){return!!(e?e.length:0)&&function(e,t,r){if(t!=t)return function(e,t,r,n){var i=e.length,a=r+(n?1:-1);for(;n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}(e,g,r);var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,0)>-1}function p(e,t,r){for(var n=-1,i=e?e.length:0;++n<i;)if(r(t,e[n]))return!0;return!1}function f(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function m(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function g(e){return e!=e}function v(e,t){return e.has(t)}function A(e,t){return function(r){return e(t(r))}}var y,x=Array.prototype,b=Function.prototype,w=Object.prototype,E=u["__core-js_shared__"],S=(y=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",M=b.toString,_=w.hasOwnProperty,T=w.toString,C=RegExp("^"+M.call(_).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),I=u.Symbol,B=A(Object.getPrototypeOf,Object),R=w.propertyIsEnumerable,P=x.splice,F=I?I.isConcatSpreadable:void 0,L=Object.getOwnPropertySymbols,D=Math.max,U=q(u,"Map"),N=q(Object,"create");function k(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function O(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function G(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function z(e){var t=-1,r=e?e.length:0;for(this.__data__=new G;++t<r;)this.add(e[t])}function V(e,t){var r=re(e)||te(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,i=!!n;for(var a in e)!t&&!_.call(e,a)||i&&("length"==a||$(a,n))||r.push(a);return r}function H(e,t){for(var r,n,i=e.length;i--;)if((r=e[i][0])===(n=t)||r!=r&&n!=n)return i;return-1}function Q(e,t,r,n,i){var a=-1,s=e.length;for(r||(r=Z),i||(i=[]);++a<s;){var o=e[a];t>0&&r(o)?t>1?Q(o,t-1,r,n,i):m(i,o):n||(i[i.length]=o)}return i}function j(e){if(!ae(e)||(t=e,S&&S in t))return!1;var t,r=ie(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(r){}return t}(e)?C:s;return r.test(function(e){if(null!=e){try{return M.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(e))}function W(e){if(!ae(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t,r,n,i=(r=(t=e)&&t.constructor,n="function"==typeof r&&r.prototype||w,t===n),a=[];for(var s in e)("constructor"!=s||!i&&_.call(e,s))&&a.push(s);return a}function X(e){return function(e,t,r){var n=t(e);return re(e)?n:m(n,r(e))}(e,oe,J)}function Y(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function q(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return j(r)?r:void 0}k.prototype.clear=function(){this.__data__=N?N(null):{}},k.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},k.prototype.get=function(e){var t=this.__data__;if(N){var r=t[e];return r===n?void 0:r}return _.call(t,e)?t[e]:void 0},k.prototype.has=function(e){var t=this.__data__;return N?void 0!==t[e]:_.call(t,e)},k.prototype.set=function(e,t){return this.__data__[e]=N&&void 0===t?n:t,this},O.prototype.clear=function(){this.__data__=[]},O.prototype.delete=function(e){var t=this.__data__,r=H(t,e);return!(r<0)&&(r==t.length-1?t.pop():P.call(t,r,1),!0)},O.prototype.get=function(e){var t=this.__data__,r=H(t,e);return r<0?void 0:t[r][1]},O.prototype.has=function(e){return H(this.__data__,e)>-1},O.prototype.set=function(e,t){var r=this.__data__,n=H(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},G.prototype.clear=function(){this.__data__={hash:new k,map:new(U||O),string:new k}},G.prototype.delete=function(e){return Y(this,e).delete(e)},G.prototype.get=function(e){return Y(this,e).get(e)},G.prototype.has=function(e){return Y(this,e).has(e)},G.prototype.set=function(e,t){return Y(this,e).set(e,t),this},z.prototype.add=z.prototype.push=function(e){return this.__data__.set(e,n),this},z.prototype.has=function(e){return this.__data__.has(e)};var K=L?A(L,Object):he,J=L?function(e){for(var t=[];e;)m(t,K(e)),e=B(e);return t}:he;function Z(e){return re(e)||te(e)||!!(F&&e&&e[F])}function $(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||o.test(e))&&e>-1&&e%1==0&&e<t}function ee(e){if("string"==typeof e||function(e){return"symbol"==typeof e||se(e)&&T.call(e)==a}(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function te(e){return function(e){return se(e)&&ne(e)}(e)&&_.call(e,"callee")&&(!R.call(e,"callee")||"[object Arguments]"==T.call(e))}var re=Array.isArray;function ne(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}(e.length)&&!ie(e)}function ie(e){var t=ae(e)?T.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function ae(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function se(e){return!!e&&"object"==typeof e}function oe(e){return ne(e)?V(e,!0):W(e)}var le,ce,ue=(le=function(e,t){return null==e?{}:(t=f(Q(t,1),ee),function(e,t){return function(e,t,r){for(var n=-1,i=t.length,a={};++n<i;){var s=t[n],o=e[s];r(o,s)&&(a[s]=o)}return a}(e=Object(e),t,(function(t,r){return r in e}))}(e,function(e,t,r,n){var i,a=-1,s=d,o=!0,l=e.length,c=[],u=t.length;if(!l)return c;r&&(t=f(t,(i=r,function(e){return i(e)}))),n?(s=p,o=!1):t.length>=200&&(s=v,o=!1,t=new z(t));e:for(;++a<l;){var h=e[a],m=r?r(h):h;if(h=n||0!==h?h:0,o&&m==m){for(var g=u;g--;)if(t[g]===m)continue e;c.push(h)}else s(t,m,n)||c.push(h)}return c}(X(e),t)))},ce=D(void 0===ce?le.length-1:ce,0),function(){for(var e=arguments,t=-1,r=D(e.length-ce,0),n=Array(r);++t<r;)n[t]=e[ce+t];t=-1;for(var i=Array(ce+1);++t<ce;)i[t]=e[t];return i[ce]=n,h(le,this,i)});function he(){return[]}e.exports=ue},25030:(e,t,r)=>{var n=9007199254740991,i="[object Arguments]",a="[object Function]",s="[object GeneratorFunction]",o="[object Symbol]",l="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")();function h(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function d(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var p=Object.prototype,f=p.hasOwnProperty,m=p.toString,g=u.Symbol,v=p.propertyIsEnumerable,A=g?g.isConcatSpreadable:void 0,y=Math.max;function x(e,t,r,n,i){var a=-1,s=e.length;for(r||(r=b),i||(i=[]);++a<s;){var o=e[a];t>0&&r(o)?t>1?x(o,t-1,r,n,i):d(i,o):n||(i[i.length]=o)}return i}function b(e){return E(e)||function(e){return function(e){return S(e)&&function(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?m.call(e):"";return t==a||t==s}(e)}(e)}(e)&&f.call(e,"callee")&&(!v.call(e,"callee")||m.call(e)==i)}(e)||!!(A&&e&&e[A])}function w(e){if("string"==typeof e||function(e){return"symbol"==typeof e||S(e)&&m.call(e)==o}(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}var E=Array.isArray;function S(e){return!!e&&"object"==typeof e}var M,_,T=(M=function(e,t){return null==e?{}:function(e,t){return function(e,t,r){for(var n=-1,i=t.length,a={};++n<i;){var s=t[n],o=e[s];r(o,s)&&(a[s]=o)}return a}(e=Object(e),t,(function(t,r){return r in e}))}(e,function(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}(x(t,1),w))},_=y(void 0===_?M.length-1:_,0),function(){for(var e=arguments,t=-1,r=y(e.length-_,0),n=Array(r);++t<r;)n[t]=e[_+t];t=-1;for(var i=Array(_+1);++t<_;)i[t]=e[t];return i[_]=n,h(M,this,i)});e.exports=T},66193:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}},47443:(e,t,r)=>{var n=r(42118);e.exports=function(e,t){return!!(null==e?0:e.length)&&n(e,t,0)>-1}},1196:e=>{e.exports=function(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}},62663:e=>{e.exports=function(e,t,r,n){var i=-1,a=null==e?0:e.length;for(n&&a&&(r=e[++i]);++i<a;)r=t(r,e[i],i,e);return r}},44286:e=>{e.exports=function(e){return e.split("")}},20731:(e,t,r)=>{var n=r(88668),i=r(47443),a=r(1196),s=r(29932),o=r(7518),l=r(74757);e.exports=function(e,t,r,c){var u=-1,h=i,d=!0,p=e.length,f=[],m=t.length;if(!p)return f;r&&(t=s(t,o(r))),c?(h=a,d=!1):t.length>=200&&(h=l,d=!1,t=new n(t));e:for(;++u<p;){var g=e[u],v=null==r?g:r(g);if(g=c||0!==g?g:0,d&&v==v){for(var A=m;A--;)if(t[A]===v)continue e;f.push(g)}else h(t,v,c)||f.push(g)}return f}},93239:(e,t,r)=>{var n=r(89881);e.exports=function(e,t){var r=!0;return n(e,(function(e,n,i){return r=!!t(e,n,i)})),r}},80760:(e,t,r)=>{var n=r(89881);e.exports=function(e,t){var r=[];return n(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}},41848:e=>{e.exports=function(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}},78565:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,r){return null!=e&&t.call(e,r)}},42118:(e,t,r)=>{var n=r(41848),i=r(62722),a=r(42351);e.exports=function(e,t,r){return t==t?a(e,t,r):n(e,i,r)}},62722:e=>{e.exports=function(e){return e!=e}},23933:(e,t,r)=>{var n=r(44239),i=r(37005);e.exports=function(e){return i(e)&&"[object RegExp]"==n(e)}},69199:(e,t,r)=>{var n=r(89881),i=r(98612);e.exports=function(e,t){var r=-1,a=i(e)?Array(e.length):[];return n(e,(function(e,n,i){a[++r]=t(e,n,i)})),a}},63012:(e,t,r)=>{var n=r(97786),i=r(10611),a=r(71811);e.exports=function(e,t,r){for(var s=-1,o=t.length,l={};++s<o;){var c=t[s],u=n(e,c);r(u,c)&&i(l,a(c,e),u)}return l}},10107:e=>{e.exports=function(e,t,r,n,i){return i(e,(function(e,i,a){r=n?(n=!1,e):t(r,e,i,a)})),r}},5976:(e,t,r)=>{var n=r(6557),i=r(45357),a=r(30061);e.exports=function(e,t){return a(i(e,t,n),e+"")}},10611:(e,t,r)=>{var n=r(34865),i=r(71811),a=r(65776),s=r(13218),o=r(40327);e.exports=function(e,t,r,l){if(!s(e))return e;for(var c=-1,u=(t=i(t,e)).length,h=u-1,d=e;null!=d&&++c<u;){var p=o(t[c]),f=r;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(c!=h){var m=d[p];void 0===(f=l?l(m,p,d):void 0)&&(f=s(m)?m:a(t[c+1])?[]:{})}n(d,p,f),d=d[p]}return e}},5076:(e,t,r)=>{var n=r(89881);e.exports=function(e,t){var r;return n(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}},27561:(e,t,r)=>{var n=r(67990),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},45652:(e,t,r)=>{var n=r(88668),i=r(47443),a=r(1196),s=r(74757),o=r(23593),l=r(21814);e.exports=function(e,t,r){var c=-1,u=i,h=e.length,d=!0,p=[],f=p;if(r)d=!1,u=a;else if(h>=200){var m=t?null:o(e);if(m)return l(m);d=!1,u=s,f=new n}else f=t?[]:p;e:for(;++c<h;){var g=e[c],v=t?t(g):g;if(g=r||0!==g?g:0,d&&v==v){for(var A=f.length;A--;)if(f[A]===v)continue e;t&&f.push(v),p.push(g)}else u(f,v,r)||(f!==p&&f.push(v),p.push(g))}return p}},47415:(e,t,r)=>{var n=r(29932);e.exports=function(e,t){return n(t,(function(t){return e[t]}))}},54290:(e,t,r)=>{var n=r(6557);e.exports=function(e){return"function"==typeof e?e:n}},40180:(e,t,r)=>{var n=r(14259);e.exports=function(e,t,r){var i=e.length;return r=void 0===r?i:r,!t&&r>=i?e:n(e,t,r)}},21463:(e,t,r)=>{var n=r(5976),i=r(16612);e.exports=function(e){return n((function(t,r){var n=-1,a=r.length,s=a>1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(s=e.length>3&&"function"==typeof s?(a--,s):void 0,o&&i(r[0],r[1],o)&&(s=a<3?void 0:s,a=1),t=Object(t);++n<a;){var l=r[n];l&&e(t,l,n,s)}return t}))}},98805:(e,t,r)=>{var n=r(40180),i=r(62689),a=r(83140),s=r(79833);e.exports=function(e){return function(t){t=s(t);var r=i(t)?a(t):void 0,o=r?r[0]:t.charAt(0),l=r?n(r,1).join(""):t.slice(1);return o[e]()+l}}},67740:(e,t,r)=>{var n=r(67206),i=r(98612),a=r(3674);e.exports=function(e){return function(t,r,s){var o=Object(t);if(!i(t)){var l=n(r,3);t=a(t),r=function(e){return l(o[e],e,o)}}var c=e(t,r,s);return c>-1?o[l?t[c]:c]:void 0}}},23593:(e,t,r)=>{var n=r(58525),i=r(50308),a=r(21814),s=n&&1/a(new n([,-0]))[1]==1/0?function(e){return new n(e)}:i;e.exports=s},62689:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},16612:(e,t,r)=>{var n=r(77813),i=r(98612),a=r(65776),s=r(13218);e.exports=function(e,t,r){if(!s(r))return!1;var o=typeof t;return!!("number"==o?i(r)&&a(t,r.length):"string"==o&&t in r)&&n(r[t],e)}},42351:e=>{e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}},83140:(e,t,r)=>{var n=r(44286),i=r(62689),a=r(676);e.exports=function(e){return i(e)?a(e):n(e)}},67990:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},676:e=>{var t="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",o="(?:"+r+"|"+n+")"+"?",l="[\\ufe0e\\ufe0f]?",c=l+o+("(?:\\u200d(?:"+[i,a,s].join("|")+")"+l+o+")*"),u="(?:"+[i+r+"?",r,a,s,t].join("|")+")",h=RegExp(n+"(?="+n+")|"+u+c,"g");e.exports=function(e){return e.match(h)||[]}},28583:(e,t,r)=>{var n=r(34865),i=r(98363),a=r(21463),s=r(98612),o=r(25726),l=r(3674),c=Object.prototype.hasOwnProperty,u=a((function(e,t){if(o(t)||s(t))i(t,l(t),e);else for(var r in t)c.call(t,r)&&n(e,r,t[r])}));e.exports=u},66678:(e,t,r)=>{var n=r(85990);e.exports=function(e){return n(e,4)}},39693:e=>{e.exports=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var a=e[t];a&&(i[n++]=a)}return i}},91747:(e,t,r)=>{var n=r(5976),i=r(77813),a=r(16612),s=r(81704),o=Object.prototype,l=o.hasOwnProperty,c=n((function(e,t){e=Object(e);var r=-1,n=t.length,c=n>2?t[2]:void 0;for(c&&a(t[0],t[1],c)&&(n=1);++r<n;)for(var u=t[r],h=s(u),d=-1,p=h.length;++d<p;){var f=h[d],m=e[f];(void 0===m||i(m,o[f])&&!l.call(e,f))&&(e[f]=u[f])}return e}));e.exports=c},91966:(e,t,r)=>{var n=r(20731),i=r(21078),a=r(5976),s=r(29246),o=a((function(e,t){return s(e)?n(e,i(t,1,s,!0)):[]}));e.exports=o},30731:(e,t,r)=>{var n=r(14259),i=r(40554);e.exports=function(e,t,r){var a=null==e?0:e.length;return a?(t=r||void 0===t?1:i(t),n(e,t<0?0:t,a)):[]}},43624:(e,t,r)=>{var n=r(14259),i=r(40554);e.exports=function(e,t,r){var a=null==e?0:e.length;return a?(t=r||void 0===t?1:i(t),n(e,0,(t=a-t)<0?0:t)):[]}},711:(e,t,r)=>{var n=r(66193),i=r(93239),a=r(67206),s=r(1469),o=r(16612);e.exports=function(e,t,r){var l=s(e)?n:i;return r&&o(e,t,r)&&(t=void 0),l(e,a(t,3))}},63105:(e,t,r)=>{var n=r(34963),i=r(80760),a=r(67206),s=r(1469);e.exports=function(e,t){return(s(e)?n:i)(e,a(t,3))}},13311:(e,t,r)=>{var n=r(67740)(r(30998));e.exports=n},30998:(e,t,r)=>{var n=r(41848),i=r(67206),a=r(40554),s=Math.max;e.exports=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var l=null==r?0:a(r);return l<0&&(l=s(o+l,0)),n(e,i(t,3),l)}},8804:(e,t,r)=>{e.exports=r(91175)},94654:(e,t,r)=>{var n=r(21078),i=r(35161);e.exports=function(e,t){return n(i(e,t),1)}},84486:(e,t,r)=>{var n=r(77412),i=r(89881),a=r(54290),s=r(1469);e.exports=function(e,t){return(s(e)?n:i)(e,a(t))}},18721:(e,t,r)=>{var n=r(78565),i=r(222);e.exports=function(e,t){return null!=e&&i(e,t,n)}},91175:e=>{e.exports=function(e){return e&&e.length?e[0]:void 0}},64721:(e,t,r)=>{var n=r(42118),i=r(98612),a=r(47037),s=r(40554),o=r(52628),l=Math.max;e.exports=function(e,t,r,c){e=i(e)?e:o(e),r=r&&!c?s(r):0;var u=e.length;return r<0&&(r=l(u+r,0)),a(e)?r<=u&&e.indexOf(t,r)>-1:!!u&&n(e,t,r)>-1}},3651:(e,t,r)=>{var n=r(42118),i=r(40554),a=Math.max;e.exports=function(e,t,r){var s=null==e?0:e.length;if(!s)return-1;var o=null==r?0:i(r);return o<0&&(o=a(s+o,0)),n(e,t,o)}},29246:(e,t,r)=>{var n=r(98612),i=r(37005);e.exports=function(e){return i(e)&&n(e)}},41609:(e,t,r)=>{var n=r(280),i=r(64160),a=r(35694),s=r(1469),o=r(98612),l=r(44144),c=r(25726),u=r(36719),h=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(o(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||u(e)||a(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!n(e).length;for(var r in e)if(h.call(e,r))return!1;return!0}},96347:(e,t,r)=>{var n=r(23933),i=r(7518),a=r(31167),s=a&&a.isRegExp,o=s?i(s):n;e.exports=o},47037:(e,t,r)=>{var n=r(44239),i=r(1469),a=r(37005);e.exports=function(e){return"string"==typeof e||!i(e)&&a(e)&&"[object String]"==n(e)}},52353:e=>{e.exports=function(e){return void 0===e}},35161:(e,t,r)=>{var n=r(29932),i=r(67206),a=r(69199),s=r(1469);e.exports=function(e,t){return(s(e)?n:a)(e,i(t,3))}},94885:e=>{e.exports=function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}},50308:e=>{e.exports=function(){}},35937:(e,t,r)=>{var n=r(29932),i=r(67206),a=r(63012),s=r(46904);e.exports=function(e,t){if(null==e)return{};var r=n(s(e),(function(e){return[e]}));return t=i(t),a(e,r,(function(e,r){return t(e,r[0])}))}},54061:(e,t,r)=>{var n=r(62663),i=r(89881),a=r(67206),s=r(10107),o=r(1469);e.exports=function(e,t,r){var l=o(e)?n:s,c=arguments.length<3;return l(e,a(t,4),r,c,i)}},43063:(e,t,r)=>{var n=r(34963),i=r(80760),a=r(67206),s=r(1469),o=r(94885);e.exports=function(e,t){return(s(e)?n:i)(e,o(a(t,3)))}},59704:(e,t,r)=>{var n=r(82908),i=r(67206),a=r(5076),s=r(1469),o=r(16612);e.exports=function(e,t,r){var l=s(e)?n:a;return r&&o(e,t,r)&&(t=void 0),l(e,i(t,3))}},18601:(e,t,r)=>{var n=r(14841),i=1/0;e.exports=function(e){return e?(e=n(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},40554:(e,t,r)=>{var n=r(18601);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},14841:(e,t,r)=>{var n=r(27561),i=r(13218),a=r(33448),s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=o.test(e);return r||l.test(e)?c(e.slice(2),r?2:8):s.test(e)?NaN:+e}},44908:(e,t,r)=>{var n=r(45652);e.exports=function(e){return e&&e.length?n(e):[]}},11700:(e,t,r)=>{var n=r(98805)("toUpperCase");e.exports=n},52628:(e,t,r)=>{var n=r(47415),i=r(3674);e.exports=function(e){return null==e?[]:n(e,i(e))}},49933:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n={scrollToBottom:"scrollToBottom_NE5w",hide:"hide_q_kn"}},56216:(e,t,r)=>{"use strict";r.r(t)},51928:(e,t,r)=>{"use strict";r.r(t)},8981:(e,t,r)=>{"use strict";r.r(t)},46774:(e,t,r)=>{"use strict";r.r(t)},69774:(e,t,r)=>{"use strict";r.r(t)},91786:(e,t,r)=>{"use strict";r.r(t)},85661:(e,t,r)=>{"use strict";r.r(t)},57255:(e,t,r)=>{"use strict";r.r(t)},30204:(e,t,r)=>{"use strict";r.r(t)},6460:(e,t,r)=>{"use strict";r.r(t)},61588:(e,t,r)=>{"use strict";r.r(t)},92751:(e,t,r)=>{"use strict";r.r(t)},53175:(e,t,r)=>{"use strict";r.r(t)},63428:(e,t,r)=>{"use strict";r.r(t)},74166:(e,t,r)=>{"use strict";r.r(t)},13344:(e,t,r)=>{"use strict";r.r(t)},40431:function(e,t){!function(e){"use strict";function t(){}function r(e,r){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===r||r,this.encoder=new t}function n(){}function i(){}t.prototype.s2u=function(e){for(var t=this.s2uTable,r="",n=0;n<e.length;){var i=e[n++];if(!(i>=0&&i<=126||i>=161&&i<=223)&&n<e.length&&(i=i<<8|e[n++]),void 0===t[i])return console.error("unknown char code "+i+"."),r;r+=String.fromCharCode(t[i])}return r},t.prototype.s2uTable={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:92,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:126,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:65340,33120:65374,33121:8741,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:65293,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:65504,33170:65505,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:65506,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34624:9312,34625:9313,34626:9314,34627:9315,34628:9316,34629:9317,34630:9318,34631:9319,34632:9320,34633:9321,34634:9322,34635:9323,34636:9324,34637:9325,34638:9326,34639:9327,34640:9328,34641:9329,34642:9330,34643:9331,34644:8544,34645:8545,34646:8546,34647:8547,34648:8548,34649:8549,34650:8550,34651:8551,34652:8552,34653:8553,34655:13129,34656:13076,34657:13090,34658:13133,34659:13080,34660:13095,34661:13059,34662:13110,34663:13137,34664:13143,34665:13069,34666:13094,34667:13091,34668:13099,34669:13130,34670:13115,34671:13212,34672:13213,34673:13214,34674:13198,34675:13199,34676:13252,34677:13217,34686:13179,34688:12317,34689:12319,34690:8470,34691:13261,34692:8481,34693:12964,34694:12965,34695:12966,34696:12967,34697:12968,34698:12849,34699:12850,34700:12857,34701:13182,34702:13181,34703:13180,34704:8786,34705:8801,34706:8747,34707:8750,34708:8721,34709:8730,34710:8869,34711:8736,34712:8735,34713:8895,34714:8757,34715:8745,34716:8746,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081,60736:32394,60737:35100,60738:37704,60739:37512,60740:34012,60741:20425,60742:28859,60743:26161,60744:26824,60745:37625,60746:26363,60747:24389,60748:20008,60749:20193,60750:20220,60751:20224,60752:20227,60753:20281,60754:20310,60755:20370,60756:20362,60757:20378,60758:20372,60759:20429,60760:20544,60761:20514,60762:20479,60763:20510,60764:20550,60765:20592,60766:20546,60767:20628,60768:20724,60769:20696,60770:20810,60771:20836,60772:20893,60773:20926,60774:20972,60775:21013,60776:21148,60777:21158,60778:21184,60779:21211,60780:21248,60781:21255,60782:21284,60783:21362,60784:21395,60785:21426,60786:21469,60787:64014,60788:21660,60789:21642,60790:21673,60791:21759,60792:21894,60793:22361,60794:22373,60795:22444,60796:22472,60797:22471,60798:64015,60800:64016,60801:22686,60802:22706,60803:22795,60804:22867,60805:22875,60806:22877,60807:22883,60808:22948,60809:22970,60810:23382,60811:23488,60812:29999,60813:23512,60814:23532,60815:23582,60816:23718,60817:23738,60818:23797,60819:23847,60820:23891,60821:64017,60822:23874,60823:23917,60824:23992,60825:23993,60826:24016,60827:24353,60828:24372,60829:24423,60830:24503,60831:24542,60832:24669,60833:24709,60834:24714,60835:24798,60836:24789,60837:24864,60838:24818,60839:24849,60840:24887,60841:24880,60842:24984,60843:25107,60844:25254,60845:25589,60846:25696,60847:25757,60848:25806,60849:25934,60850:26112,60851:26133,60852:26171,60853:26121,60854:26158,60855:26142,60856:26148,60857:26213,60858:26199,60859:26201,60860:64018,60861:26227,60862:26265,60863:26272,60864:26290,60865:26303,60866:26362,60867:26382,60868:63785,60869:26470,60870:26555,60871:26706,60872:26560,60873:26625,60874:26692,60875:26831,60876:64019,60877:26984,60878:64020,60879:27032,60880:27106,60881:27184,60882:27243,60883:27206,60884:27251,60885:27262,60886:27362,60887:27364,60888:27606,60889:27711,60890:27740,60891:27782,60892:27759,60893:27866,60894:27908,60895:28039,60896:28015,60897:28054,60898:28076,60899:28111,60900:28152,60901:28146,60902:28156,60903:28217,60904:28252,60905:28199,60906:28220,60907:28351,60908:28552,60909:28597,60910:28661,60911:28677,60912:28679,60913:28712,60914:28805,60915:28843,60916:28943,60917:28932,60918:29020,60919:28998,60920:28999,60921:64021,60922:29121,60923:29182,60924:29361,60992:29374,60993:29476,60994:64022,60995:29559,60996:29629,60997:29641,60998:29654,60999:29667,61e3:29650,61001:29703,61002:29685,61003:29734,61004:29738,61005:29737,61006:29742,61007:29794,61008:29833,61009:29855,61010:29953,61011:30063,61012:30338,61013:30364,61014:30366,61015:30363,61016:30374,61017:64023,61018:30534,61019:21167,61020:30753,61021:30798,61022:30820,61023:30842,61024:31024,61025:64024,61026:64025,61027:64026,61028:31124,61029:64027,61030:31131,61031:31441,61032:31463,61033:64028,61034:31467,61035:31646,61036:64029,61037:32072,61038:32092,61039:32183,61040:32160,61041:32214,61042:32338,61043:32583,61044:32673,61045:64030,61046:33537,61047:33634,61048:33663,61049:33735,61050:33782,61051:33864,61052:33972,61053:34131,61054:34137,61056:34155,61057:64031,61058:34224,61059:64032,61060:64033,61061:34823,61062:35061,61063:35346,61064:35383,61065:35449,61066:35495,61067:35518,61068:35551,61069:64034,61070:35574,61071:35667,61072:35711,61073:36080,61074:36084,61075:36114,61076:36214,61077:64035,61078:36559,61079:64036,61080:64037,61081:36967,61082:37086,61083:64038,61084:37141,61085:37159,61086:37338,61087:37335,61088:37342,61089:37357,61090:37358,61091:37348,61092:37349,61093:37382,61094:37392,61095:37386,61096:37434,61097:37440,61098:37436,61099:37454,61100:37465,61101:37457,61102:37433,61103:37479,61104:37543,61105:37495,61106:37496,61107:37607,61108:37591,61109:37593,61110:37584,61111:64039,61112:37589,61113:37600,61114:37587,61115:37669,61116:37665,61117:37627,61118:64040,61119:37662,61120:37631,61121:37661,61122:37634,61123:37744,61124:37719,61125:37796,61126:37830,61127:37854,61128:37880,61129:37937,61130:37957,61131:37960,61132:38290,61133:63964,61134:64041,61135:38557,61136:38575,61137:38707,61138:38715,61139:38723,61140:38733,61141:38735,61142:38737,61143:38741,61144:38999,61145:39013,61146:64042,61147:64043,61148:39207,61149:64044,61150:39326,61151:39502,61152:39641,61153:39644,61154:39797,61155:39794,61156:39823,61157:39857,61158:39867,61159:39936,61160:40304,61161:40299,61162:64045,61163:40473,61164:40657,61167:8560,61168:8561,61169:8562,61170:8563,61171:8564,61172:8565,61173:8566,61174:8567,61175:8568,61176:8569,61177:65506,61178:65508,61179:65287,61180:65282,61504:57344,61505:57345,61506:57346,61507:57347,61508:57348,61509:57349,61510:57350,61511:57351,61512:57352,61513:57353,61514:57354,61515:57355,61516:57356,61517:57357,61518:57358,61519:57359,61520:57360,61521:57361,61522:57362,61523:57363,61524:57364,61525:57365,61526:57366,61527:57367,61528:57368,61529:57369,61530:57370,61531:57371,61532:57372,61533:57373,61534:57374,61535:57375,61536:57376,61537:57377,61538:57378,61539:57379,61540:57380,61541:57381,61542:57382,61543:57383,61544:57384,61545:57385,61546:57386,61547:57387,61548:57388,61549:57389,61550:57390,61551:57391,61552:57392,61553:57393,61554:57394,61555:57395,61556:57396,61557:57397,61558:57398,61559:57399,61560:57400,61561:57401,61562:57402,61563:57403,61564:57404,61565:57405,61566:57406,61568:57407,61569:57408,61570:57409,61571:57410,61572:57411,61573:57412,61574:57413,61575:57414,61576:57415,61577:57416,61578:57417,61579:57418,61580:57419,61581:57420,61582:57421,61583:57422,61584:57423,61585:57424,61586:57425,61587:57426,61588:57427,61589:57428,61590:57429,61591:57430,61592:57431,61593:57432,61594:57433,61595:57434,61596:57435,61597:57436,61598:57437,61599:57438,61600:57439,61601:57440,61602:57441,61603:57442,61604:57443,61605:57444,61606:57445,61607:57446,61608:57447,61609:57448,61610:57449,61611:57450,61612:57451,61613:57452,61614:57453,61615:57454,61616:57455,61617:57456,61618:57457,61619:57458,61620:57459,61621:57460,61622:57461,61623:57462,61624:57463,61625:57464,61626:57465,61627:57466,61628:57467,61629:57468,61630:57469,61631:57470,61632:57471,61633:57472,61634:57473,61635:57474,61636:57475,61637:57476,61638:57477,61639:57478,61640:57479,61641:57480,61642:57481,61643:57482,61644:57483,61645:57484,61646:57485,61647:57486,61648:57487,61649:57488,61650:57489,61651:57490,61652:57491,61653:57492,61654:57493,61655:57494,61656:57495,61657:57496,61658:57497,61659:57498,61660:57499,61661:57500,61662:57501,61663:57502,61664:57503,61665:57504,61666:57505,61667:57506,61668:57507,61669:57508,61670:57509,61671:57510,61672:57511,61673:57512,61674:57513,61675:57514,61676:57515,61677:57516,61678:57517,61679:57518,61680:57519,61681:57520,61682:57521,61683:57522,61684:57523,61685:57524,61686:57525,61687:57526,61688:57527,61689:57528,61690:57529,61691:57530,61692:57531,61760:57532,61761:57533,61762:57534,61763:57535,61764:57536,61765:57537,61766:57538,61767:57539,61768:57540,61769:57541,61770:57542,61771:57543,61772:57544,61773:57545,61774:57546,61775:57547,61776:57548,61777:57549,61778:57550,61779:57551,61780:57552,61781:57553,61782:57554,61783:57555,61784:57556,61785:57557,61786:57558,61787:57559,61788:57560,61789:57561,61790:57562,61791:57563,61792:57564,61793:57565,61794:57566,61795:57567,61796:57568,61797:57569,61798:57570,61799:57571,61800:57572,61801:57573,61802:57574,61803:57575,61804:57576,61805:57577,61806:57578,61807:57579,61808:57580,61809:57581,61810:57582,61811:57583,61812:57584,61813:57585,61814:57586,61815:57587,61816:57588,61817:57589,61818:57590,61819:57591,61820:57592,61821:57593,61822:57594,61824:57595,61825:57596,61826:57597,61827:57598,61828:57599,61829:57600,61830:57601,61831:57602,61832:57603,61833:57604,61834:57605,61835:57606,61836:57607,61837:57608,61838:57609,61839:57610,61840:57611,61841:57612,61842:57613,61843:57614,61844:57615,61845:57616,61846:57617,61847:57618,61848:57619,61849:57620,61850:57621,61851:57622,61852:57623,61853:57624,61854:57625,61855:57626,61856:57627,61857:57628,61858:57629,61859:57630,61860:57631,61861:57632,61862:57633,61863:57634,61864:57635,61865:57636,61866:57637,61867:57638,61868:57639,61869:57640,61870:57641,61871:57642,61872:57643,61873:57644,61874:57645,61875:57646,61876:57647,61877:57648,61878:57649,61879:57650,61880:57651,61881:57652,61882:57653,61883:57654,61884:57655,61885:57656,61886:57657,61887:57658,61888:57659,61889:57660,61890:57661,61891:57662,61892:57663,61893:57664,61894:57665,61895:57666,61896:57667,61897:57668,61898:57669,61899:57670,61900:57671,61901:57672,61902:57673,61903:57674,61904:57675,61905:57676,61906:57677,61907:57678,61908:57679,61909:57680,61910:57681,61911:57682,61912:57683,61913:57684,61914:57685,61915:57686,61916:57687,61917:57688,61918:57689,61919:57690,61920:57691,61921:57692,61922:57693,61923:57694,61924:57695,61925:57696,61926:57697,61927:57698,61928:57699,61929:57700,61930:57701,61931:57702,61932:57703,61933:57704,61934:57705,61935:57706,61936:57707,61937:57708,61938:57709,61939:57710,61940:57711,61941:57712,61942:57713,61943:57714,61944:57715,61945:57716,61946:57717,61947:57718,61948:57719,62016:57720,62017:57721,62018:57722,62019:57723,62020:57724,62021:57725,62022:57726,62023:57727,62024:57728,62025:57729,62026:57730,62027:57731,62028:57732,62029:57733,62030:57734,62031:57735,62032:57736,62033:57737,62034:57738,62035:57739,62036:57740,62037:57741,62038:57742,62039:57743,62040:57744,62041:57745,62042:57746,62043:57747,62044:57748,62045:57749,62046:57750,62047:57751,62048:57752,62049:57753,62050:57754,62051:57755,62052:57756,62053:57757,62054:57758,62055:57759,62056:57760,62057:57761,62058:57762,62059:57763,62060:57764,62061:57765,62062:57766,62063:57767,62064:57768,62065:57769,62066:57770,62067:57771,62068:57772,62069:57773,62070:57774,62071:57775,62072:57776,62073:57777,62074:57778,62075:57779,62076:57780,62077:57781,62078:57782,62080:57783,62081:57784,62082:57785,62083:57786,62084:57787,62085:57788,62086:57789,62087:57790,62088:57791,62089:57792,62090:57793,62091:57794,62092:57795,62093:57796,62094:57797,62095:57798,62096:57799,62097:57800,62098:57801,62099:57802,62100:57803,62101:57804,62102:57805,62103:57806,62104:57807,62105:57808,62106:57809,62107:57810,62108:57811,62109:57812,62110:57813,62111:57814,62112:57815,62113:57816,62114:57817,62115:57818,62116:57819,62117:57820,62118:57821,62119:57822,62120:57823,62121:57824,62122:57825,62123:57826,62124:57827,62125:57828,62126:57829,62127:57830,62128:57831,62129:57832,62130:57833,62131:57834,62132:57835,62133:57836,62134:57837,62135:57838,62136:57839,62137:57840,62138:57841,62139:57842,62140:57843,62141:57844,62142:57845,62143:57846,62144:57847,62145:57848,62146:57849,62147:57850,62148:57851,62149:57852,62150:57853,62151:57854,62152:57855,62153:57856,62154:57857,62155:57858,62156:57859,62157:57860,62158:57861,62159:57862,62160:57863,62161:57864,62162:57865,62163:57866,62164:57867,62165:57868,62166:57869,62167:57870,62168:57871,62169:57872,62170:57873,62171:57874,62172:57875,62173:57876,62174:57877,62175:57878,62176:57879,62177:57880,62178:57881,62179:57882,62180:57883,62181:57884,62182:57885,62183:57886,62184:57887,62185:57888,62186:57889,62187:57890,62188:57891,62189:57892,62190:57893,62191:57894,62192:57895,62193:57896,62194:57897,62195:57898,62196:57899,62197:57900,62198:57901,62199:57902,62200:57903,62201:57904,62202:57905,62203:57906,62204:57907,62272:57908,62273:57909,62274:57910,62275:57911,62276:57912,62277:57913,62278:57914,62279:57915,62280:57916,62281:57917,62282:57918,62283:57919,62284:57920,62285:57921,62286:57922,62287:57923,62288:57924,62289:57925,62290:57926,62291:57927,62292:57928,62293:57929,62294:57930,62295:57931,62296:57932,62297:57933,62298:57934,62299:57935,62300:57936,62301:57937,62302:57938,62303:57939,62304:57940,62305:57941,62306:57942,62307:57943,62308:57944,62309:57945,62310:57946,62311:57947,62312:57948,62313:57949,62314:57950,62315:57951,62316:57952,62317:57953,62318:57954,62319:57955,62320:57956,62321:57957,62322:57958,62323:57959,62324:57960,62325:57961,62326:57962,62327:57963,62328:57964,62329:57965,62330:57966,62331:57967,62332:57968,62333:57969,62334:57970,62336:57971,62337:57972,62338:57973,62339:57974,62340:57975,62341:57976,62342:57977,62343:57978,62344:57979,62345:57980,62346:57981,62347:57982,62348:57983,62349:57984,62350:57985,62351:57986,62352:57987,62353:57988,62354:57989,62355:57990,62356:57991,62357:57992,62358:57993,62359:57994,62360:57995,62361:57996,62362:57997,62363:57998,62364:57999,62365:58e3,62366:58001,62367:58002,62368:58003,62369:58004,62370:58005,62371:58006,62372:58007,62373:58008,62374:58009,62375:58010,62376:58011,62377:58012,62378:58013,62379:58014,62380:58015,62381:58016,62382:58017,62383:58018,62384:58019,62385:58020,62386:58021,62387:58022,62388:58023,62389:58024,62390:58025,62391:58026,62392:58027,62393:58028,62394:58029,62395:58030,62396:58031,62397:58032,62398:58033,62399:58034,62400:58035,62401:58036,62402:58037,62403:58038,62404:58039,62405:58040,62406:58041,62407:58042,62408:58043,62409:58044,62410:58045,62411:58046,62412:58047,62413:58048,62414:58049,62415:58050,62416:58051,62417:58052,62418:58053,62419:58054,62420:58055,62421:58056,62422:58057,62423:58058,62424:58059,62425:58060,62426:58061,62427:58062,62428:58063,62429:58064,62430:58065,62431:58066,62432:58067,62433:58068,62434:58069,62435:58070,62436:58071,62437:58072,62438:58073,62439:58074,62440:58075,62441:58076,62442:58077,62443:58078,62444:58079,62445:58080,62446:58081,62447:58082,62448:58083,62449:58084,62450:58085,62451:58086,62452:58087,62453:58088,62454:58089,62455:58090,62456:58091,62457:58092,62458:58093,62459:58094,62460:58095,62528:58096,62529:58097,62530:58098,62531:58099,62532:58100,62533:58101,62534:58102,62535:58103,62536:58104,62537:58105,62538:58106,62539:58107,62540:58108,62541:58109,62542:58110,62543:58111,62544:58112,62545:58113,62546:58114,62547:58115,62548:58116,62549:58117,62550:58118,62551:58119,62552:58120,62553:58121,62554:58122,62555:58123,62556:58124,62557:58125,62558:58126,62559:58127,62560:58128,62561:58129,62562:58130,62563:58131,62564:58132,62565:58133,62566:58134,62567:58135,62568:58136,62569:58137,62570:58138,62571:58139,62572:58140,62573:58141,62574:58142,62575:58143,62576:58144,62577:58145,62578:58146,62579:58147,62580:58148,62581:58149,62582:58150,62583:58151,62584:58152,62585:58153,62586:58154,62587:58155,62588:58156,62589:58157,62590:58158,62592:58159,62593:58160,62594:58161,62595:58162,62596:58163,62597:58164,62598:58165,62599:58166,62600:58167,62601:58168,62602:58169,62603:58170,62604:58171,62605:58172,62606:58173,62607:58174,62608:58175,62609:58176,62610:58177,62611:58178,62612:58179,62613:58180,62614:58181,62615:58182,62616:58183,62617:58184,62618:58185,62619:58186,62620:58187,62621:58188,62622:58189,62623:58190,62624:58191,62625:58192,62626:58193,62627:58194,62628:58195,62629:58196,62630:58197,62631:58198,62632:58199,62633:58200,62634:58201,62635:58202,62636:58203,62637:58204,62638:58205,62639:58206,62640:58207,62641:58208,62642:58209,62643:58210,62644:58211,62645:58212,62646:58213,62647:58214,62648:58215,62649:58216,62650:58217,62651:58218,62652:58219,62653:58220,62654:58221,62655:58222,62656:58223,62657:58224,62658:58225,62659:58226,62660:58227,62661:58228,62662:58229,62663:58230,62664:58231,62665:58232,62666:58233,62667:58234,62668:58235,62669:58236,62670:58237,62671:58238,62672:58239,62673:58240,62674:58241,62675:58242,62676:58243,62677:58244,62678:58245,62679:58246,62680:58247,62681:58248,62682:58249,62683:58250,62684:58251,62685:58252,62686:58253,62687:58254,62688:58255,62689:58256,62690:58257,62691:58258,62692:58259,62693:58260,62694:58261,62695:58262,62696:58263,62697:58264,62698:58265,62699:58266,62700:58267,62701:58268,62702:58269,62703:58270,62704:58271,62705:58272,62706:58273,62707:58274,62708:58275,62709:58276,62710:58277,62711:58278,62712:58279,62713:58280,62714:58281,62715:58282,62716:58283,62784:58284,62785:58285,62786:58286,62787:58287,62788:58288,62789:58289,62790:58290,62791:58291,62792:58292,62793:58293,62794:58294,62795:58295,62796:58296,62797:58297,62798:58298,62799:58299,62800:58300,62801:58301,62802:58302,62803:58303,62804:58304,62805:58305,62806:58306,62807:58307,62808:58308,62809:58309,62810:58310,62811:58311,62812:58312,62813:58313,62814:58314,62815:58315,62816:58316,62817:58317,62818:58318,62819:58319,62820:58320,62821:58321,62822:58322,62823:58323,62824:58324,62825:58325,62826:58326,62827:58327,62828:58328,62829:58329,62830:58330,62831:58331,62832:58332,62833:58333,62834:58334,62835:58335,62836:58336,62837:58337,62838:58338,62839:58339,62840:58340,62841:58341,62842:58342,62843:58343,62844:58344,62845:58345,62846:58346,62848:58347,62849:58348,62850:58349,62851:58350,62852:58351,62853:58352,62854:58353,62855:58354,62856:58355,62857:58356,62858:58357,62859:58358,62860:58359,62861:58360,62862:58361,62863:58362,62864:58363,62865:58364,62866:58365,62867:58366,62868:58367,62869:58368,62870:58369,62871:58370,62872:58371,62873:58372,62874:58373,62875:58374,62876:58375,62877:58376,62878:58377,62879:58378,62880:58379,62881:58380,62882:58381,62883:58382,62884:58383,62885:58384,62886:58385,62887:58386,62888:58387,62889:58388,62890:58389,62891:58390,62892:58391,62893:58392,62894:58393,62895:58394,62896:58395,62897:58396,62898:58397,62899:58398,62900:58399,62901:58400,62902:58401,62903:58402,62904:58403,62905:58404,62906:58405,62907:58406,62908:58407,62909:58408,62910:58409,62911:58410,62912:58411,62913:58412,62914:58413,62915:58414,62916:58415,62917:58416,62918:58417,62919:58418,62920:58419,62921:58420,62922:58421,62923:58422,62924:58423,62925:58424,62926:58425,62927:58426,62928:58427,62929:58428,62930:58429,62931:58430,62932:58431,62933:58432,62934:58433,62935:58434,62936:58435,62937:58436,62938:58437,62939:58438,62940:58439,62941:58440,62942:58441,62943:58442,62944:58443,62945:58444,62946:58445,62947:58446,62948:58447,62949:58448,62950:58449,62951:58450,62952:58451,62953:58452,62954:58453,62955:58454,62956:58455,62957:58456,62958:58457,62959:58458,62960:58459,62961:58460,62962:58461,62963:58462,62964:58463,62965:58464,62966:58465,62967:58466,62968:58467,62969:58468,62970:58469,62971:58470,62972:58471,63040:58472,63041:58473,63042:58474,63043:58475,63044:58476,63045:58477,63046:58478,63047:58479,63048:58480,63049:58481,63050:58482,63051:58483,63052:58484,63053:58485,63054:58486,63055:58487,63056:58488,63057:58489,63058:58490,63059:58491,63060:58492,63061:58493,63062:58494,63063:58495,63064:58496,63065:58497,63066:58498,63067:58499,63068:58500,63069:58501,63070:58502,63071:58503,63072:58504,63073:58505,63074:58506,63075:58507,63076:58508,63077:58509,63078:58510,63079:58511,63080:58512,63081:58513,63082:58514,63083:58515,63084:58516,63085:58517,63086:58518,63087:58519,63088:58520,63089:58521,63090:58522,63091:58523,63092:58524,63093:58525,63094:58526,63095:58527,63096:58528,63097:58529,63098:58530,63099:58531,63100:58532,63101:58533,63102:58534,63104:58535,63105:58536,63106:58537,63107:58538,63108:58539,63109:58540,63110:58541,63111:58542,63112:58543,63113:58544,63114:58545,63115:58546,63116:58547,63117:58548,63118:58549,63119:58550,63120:58551,63121:58552,63122:58553,63123:58554,63124:58555,63125:58556,63126:58557,63127:58558,63128:58559,63129:58560,63130:58561,63131:58562,63132:58563,63133:58564,63134:58565,63135:58566,63136:58567,63137:58568,63138:58569,63139:58570,63140:58571,63141:58572,63142:58573,63143:58574,63144:58575,63145:58576,63146:58577,63147:58578,63148:58579,63149:58580,63150:58581,63151:58582,63152:58583,63153:58584,63154:58585,63155:58586,63156:58587,63157:58588,63158:58589,63159:58590,63160:58591,63161:58592,63162:58593,63163:58594,63164:58595,63165:58596,63166:58597,63167:58598,63168:58599,63169:58600,63170:58601,63171:58602,63172:58603,63173:58604,63174:58605,63175:58606,63176:58607,63177:58608,63178:58609,63179:58610,63180:58611,63181:58612,63182:58613,63183:58614,63184:58615,63185:58616,63186:58617,63187:58618,63188:58619,63189:58620,63190:58621,63191:58622,63192:58623,63193:58624,63194:58625,63195:58626,63196:58627,63197:58628,63198:58629,63199:58630,63200:58631,63201:58632,63202:58633,63203:58634,63204:58635,63205:58636,63206:58637,63207:58638,63208:58639,63209:58640,63210:58641,63211:58642,63212:58643,63213:58644,63214:58645,63215:58646,63216:58647,63217:58648,63218:58649,63219:58650,63220:58651,63221:58652,63222:58653,63223:58654,63224:58655,63225:58656,63226:58657,63227:58658,63228:58659,63296:58660,63297:58661,63298:58662,63299:58663,63300:58664,63301:58665,63302:58666,63303:58667,63304:58668,63305:58669,63306:58670,63307:58671,63308:58672,63309:58673,63310:58674,63311:58675,63312:58676,63313:58677,63314:58678,63315:58679,63316:58680,63317:58681,63318:58682,63319:58683,63320:58684,63321:58685,63322:58686,63323:58687,63324:58688,63325:58689,63326:58690,63327:58691,63328:58692,63329:58693,63330:58694,63331:58695,63332:58696,63333:58697,63334:58698,63335:58699,63336:58700,63337:58701,63338:58702,63339:58703,63340:58704,63341:58705,63342:58706,63343:58707,63344:58708,63345:58709,63346:58710,63347:58711,63348:58712,63349:58713,63350:58714,63351:58715,63352:58716,63353:58717,63354:58718,63355:58719,63356:58720,63357:58721,63358:58722,63360:58723,63361:58724,63362:58725,63363:58726,63364:58727,63365:58728,63366:58729,63367:58730,63368:58731,63369:58732,63370:58733,63371:58734,63372:58735,63373:58736,63374:58737,63375:58738,63376:58739,63377:58740,63378:58741,63379:58742,63380:58743,63381:58744,63382:58745,63383:58746,63384:58747,63385:58748,63386:58749,63387:58750,63388:58751,63389:58752,63390:58753,63391:58754,63392:58755,63393:58756,63394:58757,63395:58758,63396:58759,63397:58760,63398:58761,63399:58762,63400:58763,63401:58764,63402:58765,63403:58766,63404:58767,63405:58768,63406:58769,63407:58770,63408:58771,63409:58772,63410:58773,63411:58774,63412:58775,63413:58776,63414:58777,63415:58778,63416:58779,63417:58780,63418:58781,63419:58782,63420:58783,63421:58784,63422:58785,63423:58786,63424:58787,63425:58788,63426:58789,63427:58790,63428:58791,63429:58792,63430:58793,63431:58794,63432:58795,63433:58796,63434:58797,63435:58798,63436:58799,63437:58800,63438:58801,63439:58802,63440:58803,63441:58804,63442:58805,63443:58806,63444:58807,63445:58808,63446:58809,63447:58810,63448:58811,63449:58812,63450:58813,63451:58814,63452:58815,63453:58816,63454:58817,63455:58818,63456:58819,63457:58820,63458:58821,63459:58822,63460:58823,63461:58824,63462:58825,63463:58826,63464:58827,63465:58828,63466:58829,63467:58830,63468:58831,63469:58832,63470:58833,63471:58834,63472:58835,63473:58836,63474:58837,63475:58838,63476:58839,63477:58840,63478:58841,63479:58842,63480:58843,63481:58844,63482:58845,63483:58846,63484:58847,63552:58848,63553:58849,63554:58850,63555:58851,63556:58852,63557:58853,63558:58854,63559:58855,63560:58856,63561:58857,63562:58858,63563:58859,63564:58860,63565:58861,63566:58862,63567:58863,63568:58864,63569:58865,63570:58866,63571:58867,63572:58868,63573:58869,63574:58870,63575:58871,63576:58872,63577:58873,63578:58874,63579:58875,63580:58876,63581:58877,63582:58878,63583:58879,63584:58880,63585:58881,63586:58882,63587:58883,63588:58884,63589:58885,63590:58886,63591:58887,63592:58888,63593:58889,63594:58890,63595:58891,63596:58892,63597:58893,63598:58894,63599:58895,63600:58896,63601:58897,63602:58898,63603:58899,63604:58900,63605:58901,63606:58902,63607:58903,63608:58904,63609:58905,63610:58906,63611:58907,63612:58908,63613:58909,63614:58910,63616:58911,63617:58912,63618:58913,63619:58914,63620:58915,63621:58916,63622:58917,63623:58918,63624:58919,63625:58920,63626:58921,63627:58922,63628:58923,63629:58924,63630:58925,63631:58926,63632:58927,63633:58928,63634:58929,63635:58930,63636:58931,63637:58932,63638:58933,63639:58934,63640:58935,63641:58936,63642:58937,63643:58938,63644:58939,63645:58940,63646:58941,63647:58942,63648:58943,63649:58944,63650:58945,63651:58946,63652:58947,63653:58948,63654:58949,63655:58950,63656:58951,63657:58952,63658:58953,63659:58954,63660:58955,63661:58956,63662:58957,63663:58958,63664:58959,63665:58960,63666:58961,63667:58962,63668:58963,63669:58964,63670:58965,63671:58966,63672:58967,63673:58968,63674:58969,63675:58970,63676:58971,63677:58972,63678:58973,63679:58974,63680:58975,63681:58976,63682:58977,63683:58978,63684:58979,63685:58980,63686:58981,63687:58982,63688:58983,63689:58984,63690:58985,63691:58986,63692:58987,63693:58988,63694:58989,63695:58990,63696:58991,63697:58992,63698:58993,63699:58994,63700:58995,63701:58996,63702:58997,63703:58998,63704:58999,63705:59e3,63706:59001,63707:59002,63708:59003,63709:59004,63710:59005,63711:59006,63712:59007,63713:59008,63714:59009,63715:59010,63716:59011,63717:59012,63718:59013,63719:59014,63720:59015,63721:59016,63722:59017,63723:59018,63724:59019,63725:59020,63726:59021,63727:59022,63728:59023,63729:59024,63730:59025,63731:59026,63732:59027,63733:59028,63734:59029,63735:59030,63736:59031,63737:59032,63738:59033,63739:59034,63740:59035,64064:8560,64065:8561,64066:8562,64067:8563,64068:8564,64069:8565,64070:8566,64071:8567,64072:8568,64073:8569,64074:8544,64075:8545,64076:8546,64077:8547,64078:8548,64079:8549,64080:8550,64081:8551,64082:8552,64083:8553,64084:65506,64085:65508,64086:65287,64087:65282,64088:12849,64089:8470,64090:8481,64091:8757,64092:32394,64093:35100,64094:37704,64095:37512,64096:34012,64097:20425,64098:28859,64099:26161,64100:26824,64101:37625,64102:26363,64103:24389,64104:20008,64105:20193,64106:20220,64107:20224,64108:20227,64109:20281,64110:20310,64111:20370,64112:20362,64113:20378,64114:20372,64115:20429,64116:20544,64117:20514,64118:20479,64119:20510,64120:20550,64121:20592,64122:20546,64123:20628,64124:20724,64125:20696,64126:20810,64128:20836,64129:20893,64130:20926,64131:20972,64132:21013,64133:21148,64134:21158,64135:21184,64136:21211,64137:21248,64138:21255,64139:21284,64140:21362,64141:21395,64142:21426,64143:21469,64144:64014,64145:21660,64146:21642,64147:21673,64148:21759,64149:21894,64150:22361,64151:22373,64152:22444,64153:22472,64154:22471,64155:64015,64156:64016,64157:22686,64158:22706,64159:22795,64160:22867,64161:22875,64162:22877,64163:22883,64164:22948,64165:22970,64166:23382,64167:23488,64168:29999,64169:23512,64170:23532,64171:23582,64172:23718,64173:23738,64174:23797,64175:23847,64176:23891,64177:64017,64178:23874,64179:23917,64180:23992,64181:23993,64182:24016,64183:24353,64184:24372,64185:24423,64186:24503,64187:24542,64188:24669,64189:24709,64190:24714,64191:24798,64192:24789,64193:24864,64194:24818,64195:24849,64196:24887,64197:24880,64198:24984,64199:25107,64200:25254,64201:25589,64202:25696,64203:25757,64204:25806,64205:25934,64206:26112,64207:26133,64208:26171,64209:26121,64210:26158,64211:26142,64212:26148,64213:26213,64214:26199,64215:26201,64216:64018,64217:26227,64218:26265,64219:26272,64220:26290,64221:26303,64222:26362,64223:26382,64224:63785,64225:26470,64226:26555,64227:26706,64228:26560,64229:26625,64230:26692,64231:26831,64232:64019,64233:26984,64234:64020,64235:27032,64236:27106,64237:27184,64238:27243,64239:27206,64240:27251,64241:27262,64242:27362,64243:27364,64244:27606,64245:27711,64246:27740,64247:27782,64248:27759,64249:27866,64250:27908,64251:28039,64252:28015,64320:28054,64321:28076,64322:28111,64323:28152,64324:28146,64325:28156,64326:28217,64327:28252,64328:28199,64329:28220,64330:28351,64331:28552,64332:28597,64333:28661,64334:28677,64335:28679,64336:28712,64337:28805,64338:28843,64339:28943,64340:28932,64341:29020,64342:28998,64343:28999,64344:64021,64345:29121,64346:29182,64347:29361,64348:29374,64349:29476,64350:64022,64351:29559,64352:29629,64353:29641,64354:29654,64355:29667,64356:29650,64357:29703,64358:29685,64359:29734,64360:29738,64361:29737,64362:29742,64363:29794,64364:29833,64365:29855,64366:29953,64367:30063,64368:30338,64369:30364,64370:30366,64371:30363,64372:30374,64373:64023,64374:30534,64375:21167,64376:30753,64377:30798,64378:30820,64379:30842,64380:31024,64381:64024,64382:64025,64384:64026,64385:31124,64386:64027,64387:31131,64388:31441,64389:31463,64390:64028,64391:31467,64392:31646,64393:64029,64394:32072,64395:32092,64396:32183,64397:32160,64398:32214,64399:32338,64400:32583,64401:32673,64402:64030,64403:33537,64404:33634,64405:33663,64406:33735,64407:33782,64408:33864,64409:33972,64410:34131,64411:34137,64412:34155,64413:64031,64414:34224,64415:64032,64416:64033,64417:34823,64418:35061,64419:35346,64420:35383,64421:35449,64422:35495,64423:35518,64424:35551,64425:64034,64426:35574,64427:35667,64428:35711,64429:36080,64430:36084,64431:36114,64432:36214,64433:64035,64434:36559,64435:64036,64436:64037,64437:36967,64438:37086,64439:64038,64440:37141,64441:37159,64442:37338,64443:37335,64444:37342,64445:37357,64446:37358,64447:37348,64448:37349,64449:37382,64450:37392,64451:37386,64452:37434,64453:37440,64454:37436,64455:37454,64456:37465,64457:37457,64458:37433,64459:37479,64460:37543,64461:37495,64462:37496,64463:37607,64464:37591,64465:37593,64466:37584,64467:64039,64468:37589,64469:37600,64470:37587,64471:37669,64472:37665,64473:37627,64474:64040,64475:37662,64476:37631,64477:37661,64478:37634,64479:37744,64480:37719,64481:37796,64482:37830,64483:37854,64484:37880,64485:37937,64486:37957,64487:37960,64488:38290,64489:63964,64490:64041,64491:38557,64492:38575,64493:38707,64494:38715,64495:38723,64496:38733,64497:38735,64498:38737,64499:38741,64500:38999,64501:39013,64502:64042,64503:64043,64504:39207,64505:64044,64506:39326,64507:39502,64508:39641,64576:39644,64577:39797,64578:39794,64579:39823,64580:39857,64581:39867,64582:39936,64583:40304,64584:40299,64585:64045,64586:40473,64587:40657},r.prototype={constructor:r,getInt8:function(){var e=this.dv.getInt8(this.offset);return this.offset+=1,e},getInt8Array:function(e){for(var t=[],r=0;r<e;r++)t.push(this.getInt8());return t},getUint8:function(){var e=this.dv.getUint8(this.offset);return this.offset+=1,e},getUint8Array:function(e){for(var t=[],r=0;r<e;r++)t.push(this.getUint8());return t},getInt16:function(){var e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e},getInt16Array:function(e){for(var t=[],r=0;r<e;r++)t.push(this.getInt16());return t},getUint16:function(){var e=this.dv.getUint16(this.offset,this.littleEndian);return this.offset+=2,e},getUint16Array:function(e){for(var t=[],r=0;r<e;r++)t.push(this.getUint16());return t},getInt32:function(){var e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e},getInt32Array:function(e){for(var t=[],r=0;r<e;r++)t.push(this.getInt32());return t},getUint32:function(){var e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e},getUint32Array:function(e){for(var t=[],r=0;r<e;r++)t.push(this.getUint32());return t},getFloat32:function(){var e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e},getFloat32Array:function(e){for(var t=[],r=0;r<e;r++)t.push(this.getFloat32());return t},getFloat64:function(){var e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e},getFloat64Array:function(e){for(var t=[],r=0;r<e;r++)t.push(this.getFloat64());return t},getIndex:function(e,t){switch(e){case 1:return!0===t?this.getUint8():this.getInt8();case 2:return!0===t?this.getUint16():this.getInt16();case 4:return this.getInt32();default:throw"unknown number type "+e+" exception."}},getIndexArray:function(e,t,r){for(var n=[],i=0;i<t;i++)n.push(this.getIndex(e,r));return n},getChars:function(e){for(var t="";e>0;){var r=this.getUint8();if(e--,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getSjisStringsAsUnicode:function(e){for(var t=[];e>0;){var r=this.getUint8();if(e--,0===r)break;t.push(r)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))},getUnicodeStrings:function(e){for(var t="";e>0;){var r=this.getUint16();if(e-=2,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getTextBuffer:function(){var e=this.getUint32();return this.getUnicodeStrings(e)}},n.prototype={constructor:n,leftToRightVector3:function(e){e[2]=-e[2]},leftToRightQuaternion:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightEuler:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightIndexOrder:function(e){var t=e[2];e[2]=e[0],e[0]=t},leftToRightVector3Range:function(e,t){var r=-t[2];t[2]=-e[2],e[2]=r},leftToRightEulerRange:function(e,t){var r=-t[0],n=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=r,e[1]=n}},i.prototype.parsePmd=function(e,t){var n={},i=new r(e);n.metadata={},n.metadata.format="pmd",n.metadata.coordinateSystem="left";var a=function(){var e=function(){var e={};return e.position=i.getFloat32Array(3),e.normal=i.getFloat32Array(3),e.uv=i.getFloat32Array(2),e.skinIndices=i.getUint16Array(2),e.skinWeights=[i.getUint8()/100],e.skinWeights.push(1-e.skinWeights[0]),e.edgeFlag=i.getUint8(),e},t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r<t.vertexCount;r++)n.vertices.push(e())},s=function(){var e=function(){var e={};return e.indices=i.getUint16Array(3),e},t=n.metadata;t.faceCount=i.getUint32()/3,n.faces=[];for(var r=0;r<t.faceCount;r++)n.faces.push(e())},o=function(){var e=function(){var e={};return e.diffuse=i.getFloat32Array(4),e.shininess=i.getFloat32(),e.specular=i.getFloat32Array(3),e.ambient=i.getFloat32Array(3),e.toonIndex=i.getInt8(),e.edgeFlag=i.getUint8(),e.faceCount=i.getUint32()/3,e.fileName=i.getSjisStringsAsUnicode(20),e},t=n.metadata;t.materialCount=i.getUint32(),n.materials=[];for(var r=0;r<t.materialCount;r++)n.materials.push(e())},l=function(){var e=function(){var e={};return e.name=i.getSjisStringsAsUnicode(20),e.parentIndex=i.getInt16(),e.tailIndex=i.getInt16(),e.type=i.getUint8(),e.ikIndex=i.getInt16(),e.position=i.getFloat32Array(3),e},t=n.metadata;t.boneCount=i.getUint16(),n.bones=[];for(var r=0;r<t.boneCount;r++)n.bones.push(e())},c=function(){var e=function(){var e={};e.target=i.getUint16(),e.effector=i.getUint16(),e.linkCount=i.getUint8(),e.iteration=i.getUint16(),e.maxAngle=i.getFloat32(),e.links=[];for(var t=0;t<e.linkCount;t++){var r={};r.index=i.getUint16(),e.links.push(r)}return e},t=n.metadata;t.ikCount=i.getUint16(),n.iks=[];for(var r=0;r<t.ikCount;r++)n.iks.push(e())},u=function(){var e=function(){var e={};e.name=i.getSjisStringsAsUnicode(20),e.elementCount=i.getUint32(),e.type=i.getUint8(),e.elements=[];for(var t=0;t<e.elementCount;t++)e.elements.push({index:i.getUint32(),position:i.getFloat32Array(3)});return e},t=n.metadata;t.morphCount=i.getUint16(),n.morphs=[];for(var r=0;r<t.morphCount;r++)n.morphs.push(e())},h=function(){var e=function(){var e={};return e.index=i.getUint16(),e},t=n.metadata;t.morphFrameCount=i.getUint8(),n.morphFrames=[];for(var r=0;r<t.morphFrameCount;r++)n.morphFrames.push(e())},d=function(){var e=function(){var e={};return e.name=i.getSjisStringsAsUnicode(50),e},t=n.metadata;t.boneFrameNameCount=i.getUint8(),n.boneFrameNames=[];for(var r=0;r<t.boneFrameNameCount;r++)n.boneFrameNames.push(e())},p=function(){var e=function(){var e={};return e.boneIndex=i.getInt16(),e.frameIndex=i.getUint8(),e},t=n.metadata;t.boneFrameCount=i.getUint32(),n.boneFrames=[];for(var r=0;r<t.boneFrameCount;r++)n.boneFrames.push(e())},f=function(){var e=n.metadata;e.englishCompatibility=i.getUint8(),e.englishCompatibility>0&&(e.englishModelName=i.getSjisStringsAsUnicode(20),e.englishComment=i.getSjisStringsAsUnicode(256))},m=function(){var e=function(){var e={};return e.name=i.getSjisStringsAsUnicode(20),e},t=n.metadata;if(0!==t.englishCompatibility){n.englishBoneNames=[];for(var r=0;r<t.boneCount;r++)n.englishBoneNames.push(e())}},g=function(){var e=function(){var e={};return e.name=i.getSjisStringsAsUnicode(20),e},t=n.metadata;if(0!==t.englishCompatibility){n.englishMorphNames=[];for(var r=0;r<t.morphCount-1;r++)n.englishMorphNames.push(e())}},v=function(){var e=function(){var e={};return e.name=i.getSjisStringsAsUnicode(50),e},t=n.metadata;if(0!==t.englishCompatibility){n.englishBoneFrameNames=[];for(var r=0;r<t.boneFrameNameCount;r++)n.englishBoneFrameNames.push(e())}},A=function(){var e=function(){var e={};return e.fileName=i.getSjisStringsAsUnicode(100),e};n.toonTextures=[];for(var t=0;t<10;t++)n.toonTextures.push(e())},y=function(){var e=function(){var e={};return e.name=i.getSjisStringsAsUnicode(20),e.boneIndex=i.getInt16(),e.groupIndex=i.getUint8(),e.groupTarget=i.getUint16(),e.shapeType=i.getUint8(),e.width=i.getFloat32(),e.height=i.getFloat32(),e.depth=i.getFloat32(),e.position=i.getFloat32Array(3),e.rotation=i.getFloat32Array(3),e.weight=i.getFloat32(),e.positionDamping=i.getFloat32(),e.rotationDamping=i.getFloat32(),e.restitution=i.getFloat32(),e.friction=i.getFloat32(),e.type=i.getUint8(),e},t=n.metadata;t.rigidBodyCount=i.getUint32(),n.rigidBodies=[];for(var r=0;r<t.rigidBodyCount;r++)n.rigidBodies.push(e())},x=function(){var e=function(){var e={};return e.name=i.getSjisStringsAsUnicode(20),e.rigidBodyIndex1=i.getUint32(),e.rigidBodyIndex2=i.getUint32(),e.position=i.getFloat32Array(3),e.rotation=i.getFloat32Array(3),e.translationLimitation1=i.getFloat32Array(3),e.translationLimitation2=i.getFloat32Array(3),e.rotationLimitation1=i.getFloat32Array(3),e.rotationLimitation2=i.getFloat32Array(3),e.springPosition=i.getFloat32Array(3),e.springRotation=i.getFloat32Array(3),e},t=n.metadata;t.constraintCount=i.getUint32(),n.constraints=[];for(var r=0;r<t.constraintCount;r++)n.constraints.push(e())};return function(){var e=n.metadata;if(e.magic=i.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=i.getFloat32(),e.modelName=i.getSjisStringsAsUnicode(20),e.comment=i.getSjisStringsAsUnicode(256)}(),a(),s(),o(),l(),c(),u(),h(),d(),p(),f(),m(),g(),v(),A(),y(),x(),!0===t&&this.leftToRightModel(n),n},i.prototype.parsePmx=function(e,t){var n={},i=new r(e);n.metadata={},n.metadata.format="pmx",n.metadata.coordinateSystem="left";var a=function(){var e=function(){var e={};e.position=i.getFloat32Array(3),e.normal=i.getFloat32Array(3),e.uv=i.getFloat32Array(2),e.auvs=[];for(var r=0;r<n.metadata.additionalUvNum;r++)e.auvs.push(i.getFloat32Array(4));e.type=i.getUint8();var a=t.boneIndexSize;if(0===e.type)e.skinIndices=i.getIndexArray(a,1),e.skinWeights=[1];else if(1===e.type)e.skinIndices=i.getIndexArray(a,2),e.skinWeights=i.getFloat32Array(1),e.skinWeights.push(1-e.skinWeights[0]);else if(2===e.type)e.skinIndices=i.getIndexArray(a,4),e.skinWeights=i.getFloat32Array(4);else{if(3!==e.type)throw"unsupport bone type "+e.type+" exception.";e.skinIndices=i.getIndexArray(a,2),e.skinWeights=i.getFloat32Array(1),e.skinWeights.push(1-e.skinWeights[0]),e.skinC=i.getFloat32Array(3),e.skinR0=i.getFloat32Array(3),e.skinR1=i.getFloat32Array(3),e.type=1}return e.edgeRatio=i.getFloat32(),e},t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r<t.vertexCount;r++)n.vertices.push(e())},s=function(){var e=function(){var e={};return e.indices=i.getIndexArray(t.vertexIndexSize,3,!0),e},t=n.metadata;t.faceCount=i.getUint32()/3,n.faces=[];for(var r=0;r<t.faceCount;r++)n.faces.push(e())},o=function(){var e=function(){return i.getTextBuffer()},t=n.metadata;t.textureCount=i.getUint32(),n.textures=[];for(var r=0;r<t.textureCount;r++)n.textures.push(e())},l=function(){var e=function(){var e={};if(e.name=i.getTextBuffer(),e.englishName=i.getTextBuffer(),e.diffuse=i.getFloat32Array(4),e.specular=i.getFloat32Array(3),e.shininess=i.getFloat32(),e.ambient=i.getFloat32Array(3),e.flag=i.getUint8(),e.edgeColor=i.getFloat32Array(4),e.edgeSize=i.getFloat32(),e.textureIndex=i.getIndex(n.metadata.textureIndexSize),e.envTextureIndex=i.getIndex(n.metadata.textureIndexSize),e.envFlag=i.getUint8(),e.toonFlag=i.getUint8(),0===e.toonFlag)e.toonIndex=i.getIndex(n.metadata.textureIndexSize);else{if(1!==e.toonFlag)throw"unknown toon flag "+e.toonFlag+" exception.";e.toonIndex=i.getInt8()}return e.comment=i.getTextBuffer(),e.faceCount=i.getUint32()/3,e},t=n.metadata;t.materialCount=i.getUint32(),n.materials=[];for(var r=0;r<t.materialCount;r++)n.materials.push(e())},c=function(){var e=function(){var e={};if(e.name=i.getTextBuffer(),e.englishName=i.getTextBuffer(),e.position=i.getFloat32Array(3),e.parentIndex=i.getIndex(n.metadata.boneIndexSize),e.transformationClass=i.getUint32(),e.flag=i.getUint16(),1&e.flag?e.connectIndex=i.getIndex(n.metadata.boneIndexSize):e.offsetPosition=i.getFloat32Array(3),256&e.flag||512&e.flag){var t={};t.isLocal=0!=(128&e.flag),t.affectRotation=0!=(256&e.flag),t.affectPosition=0!=(512&e.flag),t.parentIndex=i.getIndex(n.metadata.boneIndexSize),t.ratio=i.getFloat32(),e.grant=t}if(1024&e.flag&&(e.fixAxis=i.getFloat32Array(3)),2048&e.flag&&(e.localXVector=i.getFloat32Array(3),e.localZVector=i.getFloat32Array(3)),8192&e.flag&&(e.key=i.getUint32()),32&e.flag){var r={};r.effector=i.getIndex(n.metadata.boneIndexSize),r.target=null,r.iteration=i.getUint32(),r.maxAngle=i.getFloat32(),r.linkCount=i.getUint32(),r.links=[];for(var a=0;a<r.linkCount;a++){var s={};s.index=i.getIndex(n.metadata.boneIndexSize),s.angleLimitation=i.getUint8(),1===s.angleLimitation&&(s.lowerLimitationAngle=i.getFloat32Array(3),s.upperLimitationAngle=i.getFloat32Array(3)),r.links.push(s)}e.ik=r}return e},t=n.metadata;t.boneCount=i.getUint32(),n.bones=[];for(var r=0;r<t.boneCount;r++)n.bones.push(e())},u=function(){var e=function(){var e={};e.name=i.getTextBuffer(),e.englishName=i.getTextBuffer(),e.panel=i.getUint8(),e.type=i.getUint8(),e.elementCount=i.getUint32(),e.elements=[];for(var t=0;t<e.elementCount;t++)if(0===e.type)(r={}).index=i.getIndex(n.metadata.morphIndexSize),r.ratio=i.getFloat32(),e.elements.push(r);else if(1===e.type)(r={}).index=i.getIndex(n.metadata.vertexIndexSize,!0),r.position=i.getFloat32Array(3),e.elements.push(r);else if(2===e.type)(r={}).index=i.getIndex(n.metadata.boneIndexSize),r.position=i.getFloat32Array(3),r.rotation=i.getFloat32Array(4),e.elements.push(r);else if(3===e.type)(r={}).index=i.getIndex(n.metadata.vertexIndexSize,!0),r.uv=i.getFloat32Array(4),e.elements.push(r);else if(4===e.type);else if(5===e.type);else if(6===e.type);else if(7===e.type);else if(8===e.type){var r;(r={}).index=i.getIndex(n.metadata.materialIndexSize),r.type=i.getUint8(),r.diffuse=i.getFloat32Array(4),r.specular=i.getFloat32Array(3),r.shininess=i.getFloat32(),r.ambient=i.getFloat32Array(3),r.edgeColor=i.getFloat32Array(4),r.edgeSize=i.getFloat32(),r.textureColor=i.getFloat32Array(4),r.sphereTextureColor=i.getFloat32Array(4),r.toonColor=i.getFloat32Array(4),e.elements.push(r)}return e},t=n.metadata;t.morphCount=i.getUint32(),n.morphs=[];for(var r=0;r<t.morphCount;r++)n.morphs.push(e())},h=function(){var e=function(){var e={};e.name=i.getTextBuffer(),e.englishName=i.getTextBuffer(),e.type=i.getUint8(),e.elementCount=i.getUint32(),e.elements=[];for(var t=0;t<e.elementCount;t++){var r={};r.target=i.getUint8(),r.index=0===r.target?i.getIndex(n.metadata.boneIndexSize):i.getIndex(n.metadata.morphIndexSize),e.elements.push(r)}return e},t=n.metadata;t.frameCount=i.getUint32(),n.frames=[];for(var r=0;r<t.frameCount;r++)n.frames.push(e())},d=function(){var e=function(){var e={};return e.name=i.getTextBuffer(),e.englishName=i.getTextBuffer(),e.boneIndex=i.getIndex(n.metadata.boneIndexSize),e.groupIndex=i.getUint8(),e.groupTarget=i.getUint16(),e.shapeType=i.getUint8(),e.width=i.getFloat32(),e.height=i.getFloat32(),e.depth=i.getFloat32(),e.position=i.getFloat32Array(3),e.rotation=i.getFloat32Array(3),e.weight=i.getFloat32(),e.positionDamping=i.getFloat32(),e.rotationDamping=i.getFloat32(),e.restitution=i.getFloat32(),e.friction=i.getFloat32(),e.type=i.getUint8(),e},t=n.metadata;t.rigidBodyCount=i.getUint32(),n.rigidBodies=[];for(var r=0;r<t.rigidBodyCount;r++)n.rigidBodies.push(e())},p=function(){var e=function(){var e={};return e.name=i.getTextBuffer(),e.englishName=i.getTextBuffer(),e.type=i.getUint8(),e.rigidBodyIndex1=i.getIndex(n.metadata.rigidBodyIndexSize),e.rigidBodyIndex2=i.getIndex(n.metadata.rigidBodyIndexSize),e.position=i.getFloat32Array(3),e.rotation=i.getFloat32Array(3),e.translationLimitation1=i.getFloat32Array(3),e.translationLimitation2=i.getFloat32Array(3),e.rotationLimitation1=i.getFloat32Array(3),e.rotationLimitation2=i.getFloat32Array(3),e.springPosition=i.getFloat32Array(3),e.springRotation=i.getFloat32Array(3),e},t=n.metadata;t.constraintCount=i.getUint32(),n.constraints=[];for(var r=0;r<t.constraintCount;r++)n.constraints.push(e())};return function(){var e=n.metadata;if(e.magic=i.getChars(4),"PMX "!==e.magic)throw"PMX file magic is not PMX , but "+e.magic;if(e.version=i.getFloat32(),2!==e.version&&2.1!==e.version)throw"PMX version "+e.version+" is not supported.";e.headerSize=i.getUint8(),e.encoding=i.getUint8(),e.additionalUvNum=i.getUint8(),e.vertexIndexSize=i.getUint8(),e.textureIndexSize=i.getUint8(),e.materialIndexSize=i.getUint8(),e.boneIndexSize=i.getUint8(),e.morphIndexSize=i.getUint8(),e.rigidBodyIndexSize=i.getUint8(),e.modelName=i.getTextBuffer(),e.englishModelName=i.getTextBuffer(),e.comment=i.getTextBuffer(),e.englishComment=i.getTextBuffer()}(),a(),s(),o(),l(),c(),u(),h(),d(),p(),!0===t&&this.leftToRightModel(n),n},i.prototype.parseVmd=function(e,t){var n={},i=new r(e);n.metadata={},n.metadata.coordinateSystem="left";var a=function(){var e=function(){var e={};return e.boneName=i.getSjisStringsAsUnicode(15),e.frameNum=i.getUint32(),e.position=i.getFloat32Array(3),e.rotation=i.getFloat32Array(4),e.interpolation=i.getUint8Array(64),e},t=n.metadata;t.motionCount=i.getUint32(),n.motions=[];for(var r=0;r<t.motionCount;r++)n.motions.push(e())},s=function(){var e=function(){var e={};return e.morphName=i.getSjisStringsAsUnicode(15),e.frameNum=i.getUint32(),e.weight=i.getFloat32(),e},t=n.metadata;t.morphCount=i.getUint32(),n.morphs=[];for(var r=0;r<t.morphCount;r++)n.morphs.push(e())},o=function(){var e=function(){var e={};return e.frameNum=i.getUint32(),e.distance=i.getFloat32(),e.position=i.getFloat32Array(3),e.rotation=i.getFloat32Array(3),e.interpolation=i.getUint8Array(24),e.fov=i.getUint32(),e.perspective=i.getUint8(),e},t=n.metadata;t.cameraCount=i.getUint32(),n.cameras=[];for(var r=0;r<t.cameraCount;r++)n.cameras.push(e())};return function(){var e=n.metadata;if(e.magic=i.getChars(30),"Vocaloid Motion Data 0002"!==e.magic)throw"VMD file magic is not Vocaloid Motion Data 0002, but "+e.magic;e.name=i.getSjisStringsAsUnicode(20)}(),a(),s(),o(),!0===t&&this.leftToRightVmd(n),n},i.prototype.parseVpd=function(e,t){var r={metadata:{}};r.metadata.coordinateSystem="left",r.bones=[];var n=/\/\/\w*(\r|\n|\r\n)/g,i=/\r|\n|\r\n/,a=e.replace(n,"").split(i);function s(){throw"the file seems not vpd file."}function o(){"Vocaloid Pose Data file"!==a[0]&&s()}function l(){a.length<4&&s(),r.metadata.parentFile=a[2],r.metadata.boneCount=parseInt(a[3])}function c(){for(var e=/^\s*(Bone[0-9]+)\s*\{\s*(.*)$/,t=/^\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*;/,n=/^\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*;/,i=/^\s*}/,o=r.bones,l=null,c=null,u=null,h=4;h<a.length;h++){var d,p=a[h];null!==(d=p.match(e))&&(null!==l&&s(),l=d[2]),null!==(d=p.match(t))&&(null!==c&&s(),c=[parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])]),null!==(d=p.match(n))&&(null!==u&&s(),u=[parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]),parseFloat(d[4])]),null!==(d=p.match(i))&&(null!==l&&null!==c&&null!==u||s(),o.push({name:l,translation:c,quaternion:u}),l=null,c=null,u=null)}null===l&&null===c&&null===u||s()}return o(),l(),c(),!0===t&&this.leftToRightVpd(r),r},i.prototype.mergeVmds=function(e){var t={metadata:{}};t.metadata.name=e[0].metadata.name,t.metadata.coordinateSystem=e[0].metadata.coordinateSystem,t.metadata.motionCount=0,t.metadata.morphCount=0,t.metadata.cameraCount=0,t.motions=[],t.morphs=[],t.cameras=[];for(var r=0;r<e.length;r++){var n=e[r];t.metadata.motionCount+=n.metadata.motionCount,t.metadata.morphCount+=n.metadata.morphCount,t.metadata.cameraCount+=n.metadata.cameraCount;for(var i=0;i<n.metadata.motionCount;i++)t.motions.push(n.motions[i]);for(i=0;i<n.metadata.morphCount;i++)t.morphs.push(n.morphs[i]);for(i=0;i<n.metadata.cameraCount;i++)t.cameras.push(n.cameras[i])}return t},i.prototype.leftToRightModel=function(e){if("right"!==e.metadata.coordinateSystem){e.metadata.coordinateSystem="right";for(var t=new n,r=0;r<e.metadata.vertexCount;r++)t.leftToRightVector3(e.vertices[r].position),t.leftToRightVector3(e.vertices[r].normal);for(r=0;r<e.metadata.faceCount;r++)t.leftToRightIndexOrder(e.faces[r].indices);for(r=0;r<e.metadata.boneCount;r++)t.leftToRightVector3(e.bones[r].position);for(r=0;r<e.metadata.morphCount;r++){var i=e.morphs[r];if("pmx"!==e.metadata.format||1===i.type)for(var a=0;a<i.elements.length;a++)t.leftToRightVector3(i.elements[a].position)}for(r=0;r<e.metadata.rigidBodyCount;r++)t.leftToRightVector3(e.rigidBodies[r].position),t.leftToRightEuler(e.rigidBodies[r].rotation);for(r=0;r<e.metadata.constraintCount;r++)t.leftToRightVector3(e.constraints[r].position),t.leftToRightEuler(e.constraints[r].rotation),t.leftToRightVector3Range(e.constraints[r].translationLimitation1,e.constraints[r].translationLimitation2),t.leftToRightEulerRange(e.constraints[r].rotationLimitation1,e.constraints[r].rotationLimitation2)}},i.prototype.leftToRightVmd=function(e){if("right"!==e.metadata.coordinateSystem){e.metadata.coordinateSystem="right";for(var t=new n,r=0;r<e.metadata.motionCount;r++)t.leftToRightVector3(e.motions[r].position),t.leftToRightQuaternion(e.motions[r].rotation);for(r=0;r<e.metadata.cameraCount;r++)t.leftToRightVector3(e.cameras[r].position),t.leftToRightEuler(e.cameras[r].rotation)}},i.prototype.leftToRightVpd=function(e){if("right"!==e.metadata.coordinateSystem){e.metadata.coordinateSystem="right";for(var t=new n,r=0;r<e.bones.length;r++)t.leftToRightVector3(e.bones[r].translation),t.leftToRightQuaternion(e.bones[r].quaternion)}};var a={CharsetEncoder:t,Parser:i};e.MMDParser=a,e.CharsetEncoder=t,e.Parser=i,Object.defineProperty(e,"__esModule",{value:!0})}(t)},67287:(e,t,r)=>{(e=r.nmd(e)).exports=function(t){var n={},i=r(27418),a=r(67294),s=r(63840);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,c=60103,u=60106,h=60107,d=60108,p=60114,f=60109,m=60110,g=60112,v=60113,A=60120,y=60115,x=60116,b=60121,w=60129,E=60130,S=60131;if("function"==typeof Symbol&&Symbol.for){var M=Symbol.for;c=M("react.element"),u=M("react.portal"),h=M("react.fragment"),d=M("react.strict_mode"),p=M("react.profiler"),f=M("react.provider"),m=M("react.context"),g=M("react.forward_ref"),v=M("react.suspense"),A=M("react.suspense_list"),y=M("react.memo"),x=M("react.lazy"),b=M("react.block"),M("react.scope"),w=M("react.debug_trace_mode"),E=M("react.offscreen"),S=M("react.legacy_hidden")}var _="function"==typeof Symbol&&Symbol.iterator;function T(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=_&&e[_]||e["@@iterator"])?e:null}function C(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case h:return"Fragment";case u:return"Portal";case p:return"Profiler";case d:return"StrictMode";case v:return"Suspense";case A:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case m:return(e.displayName||"Context")+".Consumer";case f:return(e._context.displayName||"Context")+".Provider";case g:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case y:return C(e.type);case b:return C(e._render);case x:t=e._payload,e=e._init;try{return C(e(t))}catch(r){}}return null}function I(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function B(e){if(I(e)!==e)throw Error(o(188))}function R(e){var t=e.alternate;if(!t){if(null===(t=I(e)))throw Error(o(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(n=i.return)){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return B(i),e;if(a===n)return B(i),t;a=a.sibling}throw Error(o(188))}if(r.return!==n.return)r=i,n=a;else{for(var s=!1,l=i.child;l;){if(l===r){s=!0,r=i,n=a;break}if(l===n){s=!0,n=i,r=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===r){s=!0,r=a,n=i;break}if(l===n){s=!0,n=a,r=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(r.alternate!==n)throw Error(o(190))}if(3!==r.tag)throw Error(o(188));return r.stateNode.current===r?e:t}function P(e){if(!(e=R(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function F(e,t){for(var r=e.alternate;null!==t;){if(t===e||t===r)return!0;t=t.return}return!1}var L,D=t.getPublicInstance,U=t.getRootHostContext,N=t.getChildHostContext,k=t.prepareForCommit,O=t.resetAfterCommit,G=t.createInstance,z=t.appendInitialChild,V=t.finalizeInitialChildren,H=t.prepareUpdate,Q=t.shouldSetTextContent,j=t.createTextInstance,W=t.scheduleTimeout,X=t.cancelTimeout,Y=t.noTimeout,q=t.isPrimaryRenderer,K=t.supportsMutation,J=t.supportsPersistence,Z=t.supportsHydration,$=t.getInstanceFromNode,ee=t.makeOpaqueHydratingObject,te=t.makeClientId,re=t.beforeActiveInstanceBlur,ne=t.afterActiveInstanceBlur,ie=t.preparePortalMount,ae=t.supportsTestSelectors,se=t.findFiberRoot,oe=t.getBoundingRect,le=t.getTextContent,ce=t.isHiddenSubtree,ue=t.matchAccessibilityRole,he=t.setFocusIfFocusable,de=t.setupIntersectionObserver,pe=t.appendChild,fe=t.appendChildToContainer,me=t.commitTextUpdate,ge=t.commitMount,ve=t.commitUpdate,Ae=t.insertBefore,ye=t.insertInContainerBefore,xe=t.removeChild,be=t.removeChildFromContainer,we=t.resetTextContent,Ee=t.hideInstance,Se=t.hideTextInstance,Me=t.unhideInstance,_e=t.unhideTextInstance,Te=t.clearContainer,Ce=t.cloneInstance,Ie=t.createContainerChildSet,Be=t.appendChildToContainerChildSet,Re=t.finalizeContainerChildren,Pe=t.replaceContainerChildren,Fe=t.cloneHiddenInstance,Le=t.cloneHiddenTextInstance,De=t.canHydrateInstance,Ue=t.canHydrateTextInstance,Ne=t.isSuspenseInstancePending,ke=t.isSuspenseInstanceFallback,Oe=t.getNextHydratableSibling,Ge=t.getFirstHydratableChild,ze=t.hydrateInstance,Ve=t.hydrateTextInstance,He=t.getNextHydratableInstanceAfterSuspenseInstance,Qe=t.commitHydratedContainer,je=t.commitHydratedSuspenseInstance;function We(e){if(void 0===L)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);L=t&&t[1]||""}return"\n"+L+e}var Xe=!1;function Ye(e,t){if(!e||Xe)return"";Xe=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var n=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){n=l}e.call(t.prototype)}else{try{throw Error()}catch(l){n=l}e()}}catch(l){if(l&&n&&"string"==typeof l.stack){for(var i=l.stack.split("\n"),a=n.stack.split("\n"),s=i.length-1,o=a.length-1;1<=s&&0<=o&&i[s]!==a[o];)o--;for(;1<=s&&0<=o;s--,o--)if(i[s]!==a[o]){if(1!==s||1!==o)do{if(s--,0>--o||i[s]!==a[o])return"\n"+i[s].replace(" at new "," at ")}while(1<=s&&0<=o);break}}}finally{Xe=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?We(e):""}var qe=[],Ke=-1;function Je(e){return{current:e}}function Ze(e){0>Ke||(e.current=qe[Ke],qe[Ke]=null,Ke--)}function $e(e,t){Ke++,qe[Ke]=e.current,e.current=t}var et={},tt=Je(et),rt=Je(!1),nt=et;function it(e,t){var r=e.type.contextTypes;if(!r)return et;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in r)a[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function at(e){return null!=(e=e.childContextTypes)}function st(){Ze(rt),Ze(tt)}function ot(e,t,r){if(tt.current!==et)throw Error(o(168));$e(tt,t),$e(rt,r)}function lt(e,t,r){var n=e.stateNode;if(e=t.childContextTypes,"function"!=typeof n.getChildContext)return r;for(var a in n=n.getChildContext())if(!(a in e))throw Error(o(108,C(t)||"Unknown",a));return i({},r,n)}function ct(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||et,nt=tt.current,$e(tt,e),$e(rt,rt.current),!0}function ut(e,t,r){var n=e.stateNode;if(!n)throw Error(o(169));r?(e=lt(e,t,nt),n.__reactInternalMemoizedMergedChildContext=e,Ze(rt),Ze(tt),$e(tt,e)):Ze(rt),$e(rt,r)}var ht=null,dt=null;(0,s.unstable_now)();var pt=0,ft=8;function mt(e){if(0!=(1&e))return ft=15,1;if(0!=(2&e))return ft=14,2;if(0!=(4&e))return ft=13,4;var t=24&e;return 0!==t?(ft=12,t):0!=(32&e)?(ft=11,32):0!==(t=192&e)?(ft=10,t):0!=(256&e)?(ft=9,256):0!==(t=3584&e)?(ft=8,t):0!=(4096&e)?(ft=7,4096):0!==(t=4186112&e)?(ft=6,t):0!==(t=62914560&e)?(ft=5,t):67108864&e?(ft=4,67108864):0!=(134217728&e)?(ft=3,134217728):0!==(t=805306368&e)?(ft=2,t):0!=(1073741824&e)?(ft=1,1073741824):(ft=8,e)}function gt(e,t){var r=e.pendingLanes;if(0===r)return ft=0;var n=0,i=0,a=e.expiredLanes,s=e.suspendedLanes,o=e.pingedLanes;if(0!==a)n=a,i=ft=15;else if(0!==(a=134217727&r)){var l=a&~s;0!==l?(n=mt(l),i=ft):0!==(o&=a)&&(n=mt(o),i=ft)}else 0!==(a=r&~s)?(n=mt(a),i=ft):0!==o&&(n=mt(o),i=ft);if(0===n)return 0;if(n=r&((0>(n=31-wt(n))?0:1<<n)<<1)-1,0!==t&&t!==n&&0==(t&s)){if(mt(t),i<=ft)return t;ft=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0<t;)i=1<<(r=31-wt(t)),n|=e[r],t&=~i;return n}function vt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function At(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=yt(24&~t))?At(10,t):e;case 10:return 0===(e=yt(192&~t))?At(8,t):e;case 8:return 0===(e=yt(3584&~t))&&(0===(e=yt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=yt(805306368&~t))&&(t=268435456),t}throw Error(o(358,e))}function yt(e){return e&-e}function xt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function bt(e,t,r){e.pendingLanes|=t;var n=t-1;e.suspendedLanes&=n,e.pingedLanes&=n,(e=e.eventTimes)[t=31-wt(t)]=r}var wt=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Et(e)/St|0)|0},Et=Math.log,St=Math.LN2;var Mt=s.unstable_runWithPriority,_t=s.unstable_scheduleCallback,Tt=s.unstable_cancelCallback,Ct=s.unstable_shouldYield,It=s.unstable_requestPaint,Bt=s.unstable_now,Rt=s.unstable_getCurrentPriorityLevel,Pt=s.unstable_ImmediatePriority,Ft=s.unstable_UserBlockingPriority,Lt=s.unstable_NormalPriority,Dt=s.unstable_LowPriority,Ut=s.unstable_IdlePriority,Nt={},kt=void 0!==It?It:function(){},Ot=null,Gt=null,zt=!1,Vt=Bt(),Ht=1e4>Vt?Bt:function(){return Bt()-Vt};function Qt(){switch(Rt()){case Pt:return 99;case Ft:return 98;case Lt:return 97;case Dt:return 96;case Ut:return 95;default:throw Error(o(332))}}function jt(e){switch(e){case 99:return Pt;case 98:return Ft;case 97:return Lt;case 96:return Dt;case 95:return Ut;default:throw Error(o(332))}}function Wt(e,t){return e=jt(e),Mt(e,t)}function Xt(e,t,r){return e=jt(e),_t(e,t,r)}function Yt(){if(null!==Gt){var e=Gt;Gt=null,Tt(e)}qt()}function qt(){if(!zt&&null!==Ot){zt=!0;var e=0;try{var t=Ot;Wt(99,(function(){for(;e<t.length;e++){var r=t[e];do{r=r(!0)}while(null!==r)}})),Ot=null}catch(r){throw null!==Ot&&(Ot=Ot.slice(e+1)),_t(Pt,Yt),r}finally{zt=!1}}}var Kt=l.ReactCurrentBatchConfig;var Jt="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Zt=Object.prototype.hasOwnProperty;function $t(e,t){if(Jt(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++)if(!Zt.call(t,r[n])||!Jt(e[r[n]],t[r[n]]))return!1;return!0}function er(e){switch(e.tag){case 5:return We(e.type);case 16:return We("Lazy");case 13:return We("Suspense");case 19:return We("SuspenseList");case 0:case 2:case 15:return e=Ye(e.type,!1);case 11:return e=Ye(e.type.render,!1);case 22:return e=Ye(e.type._render,!1);case 1:return e=Ye(e.type,!0);default:return""}}function tr(e,t){if(e&&e.defaultProps){for(var r in t=i({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}var rr=Je(null),nr=null,ir=null,ar=null;function sr(){ar=ir=nr=null}function or(e,t){e=e.type._context,q?($e(rr,e._currentValue),e._currentValue=t):($e(rr,e._currentValue2),e._currentValue2=t)}function lr(e){var t=rr.current;Ze(rr),e=e.type._context,q?e._currentValue=t:e._currentValue2=t}function cr(e,t){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)===t){if(null===r||(r.childLanes&t)===t)break;r.childLanes|=t}else e.childLanes|=t,null!==r&&(r.childLanes|=t);e=e.return}}function ur(e,t){nr=e,ar=ir=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Vn=!0),e.firstContext=null)}function hr(e,t){if(ar!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(ar=e,t=1073741823),t={context:e,observedBits:t,next:null},null===ir){if(null===nr)throw Error(o(308));ir=t,nr.dependencies={lanes:0,firstContext:t,responders:null}}else ir=ir.next=t;return q?e._currentValue:e._currentValue2}var dr=!1;function pr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function fr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function mr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function gr(e,t){if(null!==(e=e.updateQueue)){var r=(e=e.shared).pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}}function vr(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,a=null;if(null!==(r=r.firstBaseUpdate)){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};null===a?i=a=s:a=a.next=s,r=r.next}while(null!==r);null===a?i=a=t:a=a.next=t}else i=a=t;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ar(e,t,r,n){var a=e.updateQueue;dr=!1;var s=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(null!==l){a.shared.pending=null;var c=l,u=c.next;c.next=null,null===o?s=u:o.next=u,o=c;var h=e.alternate;if(null!==h){var d=(h=h.updateQueue).lastBaseUpdate;d!==o&&(null===d?h.firstBaseUpdate=u:d.next=u,h.lastBaseUpdate=c)}}if(null!==s){for(d=a.baseState,o=0,h=u=c=null;;){l=s.lane;var p=s.eventTime;if((n&l)===l){null!==h&&(h=h.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var f=e,m=s;switch(l=t,p=r,m.tag){case 1:if("function"==typeof(f=m.payload)){d=f.call(p,d,l);break e}d=f;break e;case 3:f.flags=-4097&f.flags|64;case 0:if(null==(l="function"==typeof(f=m.payload)?f.call(p,d,l):f))break e;d=i({},d,l);break e;case 2:dr=!0}}null!==s.callback&&(e.flags|=32,null===(l=a.effects)?a.effects=[s]:l.push(s))}else p={eventTime:p,lane:l,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===h?(u=h=p,c=d):h=h.next=p,o|=l;if(null===(s=s.next)){if(null===(l=a.shared.pending))break;s=l.next,l.next=null,a.lastBaseUpdate=l,a.shared.pending=null}}null===h&&(c=d),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=h,ha|=o,e.lanes=o,e.memoizedState=d}}function yr(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(null!==i){if(n.callback=null,n=r,"function"!=typeof i)throw Error(o(191,i));i.call(n)}}}var xr=(new a.Component).refs;function br(e,t,r,n){r=null==(r=r(n,t=e.memoizedState))?t:i({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}var wr={isMounted:function(e){return!!(e=e._reactInternals)&&I(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Ua(),i=Na(e),a=mr(n,i);a.payload=t,null!=r&&(a.callback=r),gr(e,a),ka(e,i,n)},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Ua(),i=Na(e),a=mr(n,i);a.tag=1,a.payload=t,null!=r&&(a.callback=r),gr(e,a),ka(e,i,n)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Ua(),n=Na(e),i=mr(r,n);i.tag=2,null!=t&&(i.callback=t),gr(e,i),ka(e,n,r)}};function Er(e,t,r,n,i,a,s){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,a,s):!t.prototype||!t.prototype.isPureReactComponent||(!$t(r,n)||!$t(i,a))}function Sr(e,t,r){var n=!1,i=et,a=t.contextType;return"object"==typeof a&&null!==a?a=hr(a):(i=at(t)?nt:tt.current,a=(n=null!=(n=t.contextTypes))?it(e,i):et),t=new t(r,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=wr,e.stateNode=t,t._reactInternals=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Mr(e,t,r,n){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&wr.enqueueReplaceState(t,t.state,null)}function _r(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs=xr,pr(e);var a=t.contextType;"object"==typeof a&&null!==a?i.context=hr(a):(a=at(t)?nt:tt.current,i.context=it(e,a)),Ar(e,r,i,n),i.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(br(e,t,a,r),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&wr.enqueueReplaceState(i,i.state,null),Ar(e,r,i,n),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var Tr=Array.isArray;function Cr(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(o(309));var n=r.stateNode}if(!n)throw Error(o(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=n.refs;t===xr&&(t=n.refs={}),null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!=typeof e)throw Error(o(284));if(!r._owner)throw Error(o(290,e))}return e}function Ir(e,t){if("textarea"!==e.type)throw Error(o(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Br(e){function t(t,r){if(e){var n=t.lastEffect;null!==n?(n.nextEffect=r,t.lastEffect=r):t.firstEffect=t.lastEffect=r,r.nextEffect=null,r.flags=8}}function r(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function n(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Es(e,t)).index=0,e.sibling=null,e}function a(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.flags=2,r):n:(t.flags=2,r):r}function s(t){return e&&null===t.alternate&&(t.flags=2),t}function l(e,t,r,n){return null===t||6!==t.tag?((t=Ts(r,e.mode,n)).return=e,t):((t=i(t,r)).return=e,t)}function d(e,t,r,n){return null!==t&&t.elementType===r.type?((n=i(t,r.props)).ref=Cr(e,t,r),n.return=e,n):((n=Ss(r.type,r.key,r.props,null,e.mode,n)).ref=Cr(e,t,r),n.return=e,n)}function p(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=Cs(r,e.mode,n)).return=e,t):((t=i(t,r.children||[])).return=e,t)}function f(e,t,r,n,a){return null===t||7!==t.tag?((t=Ms(r,e.mode,n,a)).return=e,t):((t=i(t,r)).return=e,t)}function m(e,t,r){if("string"==typeof t||"number"==typeof t)return(t=Ts(""+t,e.mode,r)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case c:return(r=Ss(t.type,t.key,t.props,null,e.mode,r)).ref=Cr(e,null,t),r.return=e,r;case u:return(t=Cs(t,e.mode,r)).return=e,t}if(Tr(t)||T(t))return(t=Ms(t,e.mode,r,null)).return=e,t;Ir(e,t)}return null}function g(e,t,r,n){var i=null!==t?t.key:null;if("string"==typeof r||"number"==typeof r)return null!==i?null:l(e,t,""+r,n);if("object"==typeof r&&null!==r){switch(r.$$typeof){case c:return r.key===i?r.type===h?f(e,t,r.props.children,n,i):d(e,t,r,n):null;case u:return r.key===i?p(e,t,r,n):null}if(Tr(r)||T(r))return null!==i?null:f(e,t,r,n,null);Ir(e,r)}return null}function v(e,t,r,n,i){if("string"==typeof n||"number"==typeof n)return l(t,e=e.get(r)||null,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case c:return e=e.get(null===n.key?r:n.key)||null,n.type===h?f(t,e,n.props.children,i,n.key):d(t,e,n,i);case u:return p(t,e=e.get(null===n.key?r:n.key)||null,n,i)}if(Tr(n)||T(n))return f(t,e=e.get(r)||null,n,i,null);Ir(t,n)}return null}function A(i,s,o,l){for(var c=null,u=null,h=s,d=s=0,p=null;null!==h&&d<o.length;d++){h.index>d?(p=h,h=null):p=h.sibling;var f=g(i,h,o[d],l);if(null===f){null===h&&(h=p);break}e&&h&&null===f.alternate&&t(i,h),s=a(f,s,d),null===u?c=f:u.sibling=f,u=f,h=p}if(d===o.length)return r(i,h),c;if(null===h){for(;d<o.length;d++)null!==(h=m(i,o[d],l))&&(s=a(h,s,d),null===u?c=h:u.sibling=h,u=h);return c}for(h=n(i,h);d<o.length;d++)null!==(p=v(h,i,d,o[d],l))&&(e&&null!==p.alternate&&h.delete(null===p.key?d:p.key),s=a(p,s,d),null===u?c=p:u.sibling=p,u=p);return e&&h.forEach((function(e){return t(i,e)})),c}function y(i,s,l,c){var u=T(l);if("function"!=typeof u)throw Error(o(150));if(null==(l=u.call(l)))throw Error(o(151));for(var h=u=null,d=s,p=s=0,f=null,A=l.next();null!==d&&!A.done;p++,A=l.next()){d.index>p?(f=d,d=null):f=d.sibling;var y=g(i,d,A.value,c);if(null===y){null===d&&(d=f);break}e&&d&&null===y.alternate&&t(i,d),s=a(y,s,p),null===h?u=y:h.sibling=y,h=y,d=f}if(A.done)return r(i,d),u;if(null===d){for(;!A.done;p++,A=l.next())null!==(A=m(i,A.value,c))&&(s=a(A,s,p),null===h?u=A:h.sibling=A,h=A);return u}for(d=n(i,d);!A.done;p++,A=l.next())null!==(A=v(d,i,p,A.value,c))&&(e&&null!==A.alternate&&d.delete(null===A.key?p:A.key),s=a(A,s,p),null===h?u=A:h.sibling=A,h=A);return e&&d.forEach((function(e){return t(i,e)})),u}return function(e,n,a,l){var d="object"==typeof a&&null!==a&&a.type===h&&null===a.key;d&&(a=a.props.children);var p="object"==typeof a&&null!==a;if(p)switch(a.$$typeof){case c:e:{for(p=a.key,d=n;null!==d;){if(d.key===p){if(7===d.tag){if(a.type===h){r(e,d.sibling),(n=i(d,a.props.children)).return=e,e=n;break e}}else if(d.elementType===a.type){r(e,d.sibling),(n=i(d,a.props)).ref=Cr(e,d,a),n.return=e,e=n;break e}r(e,d);break}t(e,d),d=d.sibling}a.type===h?((n=Ms(a.props.children,e.mode,l,a.key)).return=e,e=n):((l=Ss(a.type,a.key,a.props,null,e.mode,l)).ref=Cr(e,n,a),l.return=e,e=l)}return s(e);case u:e:{for(d=a.key;null!==n;){if(n.key===d){if(4===n.tag&&n.stateNode.containerInfo===a.containerInfo&&n.stateNode.implementation===a.implementation){r(e,n.sibling),(n=i(n,a.children||[])).return=e,e=n;break e}r(e,n);break}t(e,n),n=n.sibling}(n=Cs(a,e.mode,l)).return=e,e=n}return s(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==n&&6===n.tag?(r(e,n.sibling),(n=i(n,a)).return=e,e=n):(r(e,n),(n=Ts(a,e.mode,l)).return=e,e=n),s(e);if(Tr(a))return A(e,n,a,l);if(T(a))return y(e,n,a,l);if(p&&Ir(e,a),void 0===a&&!d)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(o(152,C(e.type)||"Component"))}return r(e,n)}}var Rr=Br(!0),Pr=Br(!1),Fr={},Lr=Je(Fr),Dr=Je(Fr),Ur=Je(Fr);function Nr(e){if(e===Fr)throw Error(o(174));return e}function kr(e,t){$e(Ur,t),$e(Dr,e),$e(Lr,Fr),e=U(t),Ze(Lr),$e(Lr,e)}function Or(){Ze(Lr),Ze(Dr),Ze(Ur)}function Gr(e){var t=Nr(Ur.current),r=Nr(Lr.current);r!==(t=N(r,e.type,t))&&($e(Dr,e),$e(Lr,t))}function zr(e){Dr.current===e&&(Ze(Lr),Ze(Dr))}var Vr=Je(0);function Hr(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||Ne(r)||ke(r)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Qr=null,jr=null,Wr=!1;function Xr(e,t){var r=bs(5,null,null,0);r.elementType="DELETED",r.type="DELETED",r.stateNode=t,r.return=e,r.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=r,e.lastEffect=r):e.firstEffect=e.lastEffect=r}function Yr(e,t){switch(e.tag){case 5:return null!==(t=De(t,e.type,e.pendingProps))&&(e.stateNode=t,!0);case 6:return null!==(t=Ue(t,e.pendingProps))&&(e.stateNode=t,!0);default:return!1}}function qr(e){if(Wr){var t=jr;if(t){var r=t;if(!Yr(e,t)){if(!(t=Oe(r))||!Yr(e,t))return e.flags=-1025&e.flags|2,Wr=!1,void(Qr=e);Xr(Qr,r)}Qr=e,jr=Ge(t)}else e.flags=-1025&e.flags|2,Wr=!1,Qr=e}}function Kr(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Qr=e}function Jr(e){if(!Z||e!==Qr)return!1;if(!Wr)return Kr(e),Wr=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Q(t,e.memoizedProps))for(t=jr;t;)Xr(e,t),t=Oe(t);if(Kr(e),13===e.tag){if(!Z)throw Error(o(316));if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));jr=He(e)}else jr=Qr?Oe(e.stateNode):null;return!0}function Zr(){Z&&(jr=Qr=null,Wr=!1)}var $r=[];function en(){for(var e=0;e<$r.length;e++){var t=$r[e];q?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}$r.length=0}var tn=l.ReactCurrentDispatcher,rn=l.ReactCurrentBatchConfig,nn=0,an=null,sn=null,on=null,ln=!1,cn=!1;function un(){throw Error(o(321))}function hn(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Jt(e[r],t[r]))return!1;return!0}function dn(e,t,r,n,i,a){if(nn=a,an=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,tn.current=null===e||null===e.memoizedState?kn:On,e=r(n,i),cn){a=0;do{if(cn=!1,!(25>a))throw Error(o(301));a+=1,on=sn=null,t.updateQueue=null,tn.current=Gn,e=r(n,i)}while(cn)}if(tn.current=Nn,t=null!==sn&&null!==sn.next,nn=0,on=sn=an=null,ln=!1,t)throw Error(o(300));return e}function pn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===on?an.memoizedState=on=e:on=on.next=e,on}function fn(){if(null===sn){var e=an.alternate;e=null!==e?e.memoizedState:null}else e=sn.next;var t=null===on?an.memoizedState:on.next;if(null!==t)on=t,sn=e;else{if(null===e)throw Error(o(310));e={memoizedState:(sn=e).memoizedState,baseState:sn.baseState,baseQueue:sn.baseQueue,queue:sn.queue,next:null},null===on?an.memoizedState=on=e:on=on.next=e}return on}function mn(e,t){return"function"==typeof t?t(e):t}function gn(e){var t=fn(),r=t.queue;if(null===r)throw Error(o(311));r.lastRenderedReducer=e;var n=sn,i=n.baseQueue,a=r.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}n.baseQueue=i=a,r.pending=null}if(null!==i){i=i.next,n=n.baseState;var l=s=a=null,c=i;do{var u=c.lane;if((nn&u)===u)null!==l&&(l=l.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),n=c.eagerReducer===e?c.eagerState:e(n,c.action);else{var h={lane:u,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===l?(s=l=h,a=n):l=l.next=h,an.lanes|=u,ha|=u}c=c.next}while(null!==c&&c!==i);null===l?a=n:l.next=s,Jt(n,t.memoizedState)||(Vn=!0),t.memoizedState=n,t.baseState=a,t.baseQueue=l,r.lastRenderedState=n}return[t.memoizedState,r.dispatch]}function vn(e){var t=fn(),r=t.queue;if(null===r)throw Error(o(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(null!==i){r.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);Jt(a,t.memoizedState)||(Vn=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function An(e,t,r){var n=t._getVersion;n=n(t._source);var i=q?t._workInProgressVersionPrimary:t._workInProgressVersionSecondary;if(null!==i?e=i===n:(e=e.mutableReadLanes,(e=(nn&e)===e)&&(q?t._workInProgressVersionPrimary=n:t._workInProgressVersionSecondary=n,$r.push(t))),e)return r(t._source);throw $r.push(t),Error(o(350))}function yn(e,t,r,n){var i=na;if(null===i)throw Error(o(349));var a=t._getVersion,s=a(t._source),l=tn.current,c=l.useState((function(){return An(i,t,r)})),u=c[1],h=c[0];c=on;var d=e.memoizedState,p=d.refs,f=p.getSnapshot,m=d.source;d=d.subscribe;var g=an;return e.memoizedState={refs:p,source:t,subscribe:n},l.useEffect((function(){p.getSnapshot=r,p.setSnapshot=u;var e=a(t._source);if(!Jt(s,e)){e=r(t._source),Jt(h,e)||(u(e),e=Na(g),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var n=i.entanglements,o=e;0<o;){var l=31-wt(o),c=1<<l;n[l]|=e,o&=~c}}}),[r,t,n]),l.useEffect((function(){return n(t._source,(function(){var e=p.getSnapshot,r=p.setSnapshot;try{r(e(t._source));var n=Na(g);i.mutableReadLanes|=n&i.pendingLanes}catch(a){r((function(){throw a}))}}))}),[t,n]),Jt(f,r)&&Jt(m,t)&&Jt(d,n)||((e={pending:null,dispatch:null,lastRenderedReducer:mn,lastRenderedState:h}).dispatch=u=Un.bind(null,an,e),c.queue=e,c.baseQueue=null,h=An(i,t,r),c.memoizedState=c.baseState=h),h}function xn(e,t,r){return yn(fn(),e,t,r)}function bn(e){var t=pn();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:mn,lastRenderedState:e}).dispatch=Un.bind(null,an,e),[t.memoizedState,e]}function wn(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=an.updateQueue)?(t={lastEffect:null},an.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function En(e){return e={current:e},pn().memoizedState=e}function Sn(){return fn().memoizedState}function Mn(e,t,r,n){var i=pn();an.flags|=e,i.memoizedState=wn(1|t,r,void 0,void 0===n?null:n)}function _n(e,t,r,n){var i=fn();n=void 0===n?null:n;var a=void 0;if(null!==sn){var s=sn.memoizedState;if(a=s.destroy,null!==n&&hn(n,s.deps))return void wn(t,r,a,n)}an.flags|=e,i.memoizedState=wn(1|t,r,a,n)}function Tn(e,t){return Mn(516,4,e,t)}function Cn(e,t){return _n(516,4,e,t)}function In(e,t){return _n(4,2,e,t)}function Bn(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Rn(e,t,r){return r=null!=r?r.concat([e]):null,_n(4,2,Bn.bind(null,t,e),r)}function Pn(){}function Fn(e,t){var r=fn();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&hn(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Ln(e,t){var r=fn();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&hn(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Dn(e,t){var r=Qt();Wt(98>r?98:r,(function(){e(!0)})),Wt(97<r?97:r,(function(){var r=rn.transition;rn.transition=1;try{e(!1),t()}finally{rn.transition=r}}))}function Un(e,t,r){var n=Ua(),i=Na(e),a={lane:i,action:r,eagerReducer:null,eagerState:null,next:null},s=t.pending;if(null===s?a.next=a:(a.next=s.next,s.next=a),t.pending=a,s=e.alternate,e===an||null!==s&&s===an)cn=ln=!0;else{if(0===e.lanes&&(null===s||0===s.lanes)&&null!==(s=t.lastRenderedReducer))try{var o=t.lastRenderedState,l=s(o,r);if(a.eagerReducer=s,a.eagerState=l,Jt(l,o))return}catch(c){}ka(e,i,n)}}var Nn={readContext:hr,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useLayoutEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useMutableSource:un,useOpaqueIdentifier:un,unstable_isNewReconciler:!1},kn={readContext:hr,useCallback:function(e,t){return pn().memoizedState=[e,void 0===t?null:t],e},useContext:hr,useEffect:Tn,useImperativeHandle:function(e,t,r){return r=null!=r?r.concat([e]):null,Mn(4,2,Bn.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Mn(4,2,e,t)},useMemo:function(e,t){var r=pn();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=pn();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e=(e=n.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Un.bind(null,an,e),[n.memoizedState,e]},useRef:En,useState:bn,useDebugValue:Pn,useDeferredValue:function(e){var t=bn(e),r=t[0],n=t[1];return Tn((function(){var t=rn.transition;rn.transition=1;try{n(e)}finally{rn.transition=t}}),[e]),r},useTransition:function(){var e=bn(!1),t=e[0];return En(e=Dn.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,r){var n=pn();return n.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:r},yn(n,e,t,r)},useOpaqueIdentifier:function(){if(Wr){var e=!1,t=ee((function(){throw e||(e=!0,r(te())),Error(o(355))})),r=bn(t)[1];return 0==(2&an.mode)&&(an.flags|=516,wn(5,(function(){r(te())}),void 0,null)),t}return bn(t=te()),t},unstable_isNewReconciler:!1},On={readContext:hr,useCallback:Fn,useContext:hr,useEffect:Cn,useImperativeHandle:Rn,useLayoutEffect:In,useMemo:Ln,useReducer:gn,useRef:Sn,useState:function(){return gn(mn)},useDebugValue:Pn,useDeferredValue:function(e){var t=gn(mn),r=t[0],n=t[1];return Cn((function(){var t=rn.transition;rn.transition=1;try{n(e)}finally{rn.transition=t}}),[e]),r},useTransition:function(){var e=gn(mn)[0];return[Sn().current,e]},useMutableSource:xn,useOpaqueIdentifier:function(){return gn(mn)[0]},unstable_isNewReconciler:!1},Gn={readContext:hr,useCallback:Fn,useContext:hr,useEffect:Cn,useImperativeHandle:Rn,useLayoutEffect:In,useMemo:Ln,useReducer:vn,useRef:Sn,useState:function(){return vn(mn)},useDebugValue:Pn,useDeferredValue:function(e){var t=vn(mn),r=t[0],n=t[1];return Cn((function(){var t=rn.transition;rn.transition=1;try{n(e)}finally{rn.transition=t}}),[e]),r},useTransition:function(){var e=vn(mn)[0];return[Sn().current,e]},useMutableSource:xn,useOpaqueIdentifier:function(){return vn(mn)[0]},unstable_isNewReconciler:!1},zn=l.ReactCurrentOwner,Vn=!1;function Hn(e,t,r,n){t.child=null===e?Pr(t,null,r,n):Rr(t,e.child,r,n)}function Qn(e,t,r,n,i){r=r.render;var a=t.ref;return ur(t,i),n=dn(e,t,r,n,a,i),null===e||Vn?(t.flags|=1,Hn(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,hi(e,t,i))}function jn(e,t,r,n,i,a){if(null===e){var s=r.type;return"function"!=typeof s||ws(s)||void 0!==s.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=Ss(r.type,null,n,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=s,Wn(e,t,s,n,i,a))}return s=e.child,0==(i&a)&&(i=s.memoizedProps,(r=null!==(r=r.compare)?r:$t)(i,n)&&e.ref===t.ref)?hi(e,t,a):(t.flags|=1,(e=Es(s,n)).ref=t.ref,e.return=t,t.child=e)}function Wn(e,t,r,n,i,a){if(null!==e&&$t(e.memoizedProps,n)&&e.ref===t.ref){if(Vn=!1,0==(a&i))return t.lanes=e.lanes,hi(e,t,a);0!=(16384&e.flags)&&(Vn=!0)}return qn(e,t,r,n,a)}function Xn(e,t,r){var n=t.pendingProps,i=n.children,a=null!==e?e.memoizedState:null;if("hidden"===n.mode||"unstable-defer-without-hiding"===n.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},Wa(t,r);else{if(0==(1073741824&r))return e=null!==a?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},Wa(t,e),null;t.memoizedState={baseLanes:0},Wa(t,null!==a?a.baseLanes:r)}else null!==a?(n=a.baseLanes|r,t.memoizedState=null):n=r,Wa(t,n);return Hn(e,t,i,r),t.child}function Yn(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.flags|=128)}function qn(e,t,r,n,i){var a=at(r)?nt:tt.current;return a=it(t,a),ur(t,i),r=dn(e,t,r,n,a,i),null===e||Vn?(t.flags|=1,Hn(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,hi(e,t,i))}function Kn(e,t,r,n,i){if(at(r)){var a=!0;ct(t)}else a=!1;if(ur(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),Sr(t,r,n),_r(t,r,n,i),n=!0;else if(null===e){var s=t.stateNode,o=t.memoizedProps;s.props=o;var l=s.context,c=r.contextType;"object"==typeof c&&null!==c?c=hr(c):c=it(t,c=at(r)?nt:tt.current);var u=r.getDerivedStateFromProps,h="function"==typeof u||"function"==typeof s.getSnapshotBeforeUpdate;h||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(o!==n||l!==c)&&Mr(t,s,n,c),dr=!1;var d=t.memoizedState;s.state=d,Ar(t,n,s,i),l=t.memoizedState,o!==n||d!==l||rt.current||dr?("function"==typeof u&&(br(t,r,u,n),l=t.memoizedState),(o=dr||Er(t,r,o,n,d,l,c))?(h||"function"!=typeof s.UNSAFE_componentWillMount&&"function"!=typeof s.componentWillMount||("function"==typeof s.componentWillMount&&s.componentWillMount(),"function"==typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"==typeof s.componentDidMount&&(t.flags|=4)):("function"==typeof s.componentDidMount&&(t.flags|=4),t.memoizedProps=n,t.memoizedState=l),s.props=n,s.state=l,s.context=c,n=o):("function"==typeof s.componentDidMount&&(t.flags|=4),n=!1)}else{s=t.stateNode,fr(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:tr(t.type,o),s.props=c,h=t.pendingProps,d=s.context,"object"==typeof(l=r.contextType)&&null!==l?l=hr(l):l=it(t,l=at(r)?nt:tt.current);var p=r.getDerivedStateFromProps;(u="function"==typeof p||"function"==typeof s.getSnapshotBeforeUpdate)||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(o!==h||d!==l)&&Mr(t,s,n,l),dr=!1,d=t.memoizedState,s.state=d,Ar(t,n,s,i);var f=t.memoizedState;o!==h||d!==f||rt.current||dr?("function"==typeof p&&(br(t,r,p,n),f=t.memoizedState),(c=dr||Er(t,r,c,n,d,f,l))?(u||"function"!=typeof s.UNSAFE_componentWillUpdate&&"function"!=typeof s.componentWillUpdate||("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(n,f,l),"function"==typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(n,f,l)),"function"==typeof s.componentDidUpdate&&(t.flags|=4),"function"==typeof s.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof s.componentDidUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),t.memoizedProps=n,t.memoizedState=f),s.props=n,s.state=f,s.context=l,n=c):("function"!=typeof s.componentDidUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),n=!1)}return Jn(e,t,r,n,a,i)}function Jn(e,t,r,n,i,a){Yn(e,t);var s=0!=(64&t.flags);if(!n&&!s)return i&&ut(t,r,!1),hi(e,t,a);n=t.stateNode,zn.current=t;var o=s&&"function"!=typeof r.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&s?(t.child=Rr(t,e.child,null,a),t.child=Rr(t,null,o,a)):Hn(e,t,o,a),t.memoizedState=n.state,i&&ut(t,r,!0),t.child}function Zn(e){var t=e.stateNode;t.pendingContext?ot(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ot(0,t.context,!1),kr(e,t.containerInfo)}var $n,ei,ti,ri,ni={dehydrated:null,retryLane:0};function ii(e,t,r){var n,i=t.pendingProps,a=Vr.current,s=!1;return(n=0!=(64&t.flags))||(n=(null===e||null!==e.memoizedState)&&0!=(2&a)),n?(s=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(a|=1),$e(Vr,1&a),null===e?(void 0!==i.fallback&&qr(t),e=i.children,a=i.fallback,s?(e=ai(t,e,a,r),t.child.memoizedState={baseLanes:r},t.memoizedState=ni,e):"number"==typeof i.unstable_expectedLoadTime?(e=ai(t,e,a,r),t.child.memoizedState={baseLanes:r},t.memoizedState=ni,t.lanes=33554432,e):((r=_s({mode:"visible",children:e},t.mode,r,null)).return=t,t.child=r)):(e.memoizedState,s?(i=oi(e,t,i.children,i.fallback,r),s=t.child,a=e.child.memoizedState,s.memoizedState=null===a?{baseLanes:r}:{baseLanes:a.baseLanes|r},s.childLanes=e.childLanes&~r,t.memoizedState=ni,i):(r=si(e,t,i.children,r),t.memoizedState=null,r))}function ai(e,t,r,n){var i=e.mode,a=e.child;return t={mode:"hidden",children:t},0==(2&i)&&null!==a?(a.childLanes=0,a.pendingProps=t):a=_s(t,i,0,null),r=Ms(r,i,n,null),a.return=e,r.return=e,a.sibling=r,e.child=a,r}function si(e,t,r,n){var i=e.child;return e=i.sibling,r=Es(i,{mode:"visible",children:r}),0==(2&t.mode)&&(r.lanes=n),r.return=t,r.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=r}function oi(e,t,r,n,i){var a=t.mode,s=e.child;e=s.sibling;var o={mode:"hidden",children:r};return 0==(2&a)&&t.child!==s?((r=t.child).childLanes=0,r.pendingProps=o,null!==(s=r.lastEffect)?(t.firstEffect=r.firstEffect,t.lastEffect=s,s.nextEffect=null):t.firstEffect=t.lastEffect=null):r=Es(s,o),null!==e?n=Es(e,n):(n=Ms(n,a,i,null)).flags|=2,n.return=t,r.return=t,r.sibling=n,t.child=r,n}function li(e,t){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),cr(e.return,t)}function ci(e,t,r,n,i,a){var s=e.memoizedState;null===s?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i,lastEffect:a}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i,s.lastEffect=a)}function ui(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Hn(e,t,n.children,r),0!=(2&(n=Vr.current)))n=1&n|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&li(e,r);else if(19===e.tag)li(e,r);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if($e(Vr,n),0==(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(e=r.alternate)&&null===Hr(e)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),ci(t,!1,i,r,a,t.lastEffect);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Hr(e)){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}ci(t,!0,r,null,a,t.lastEffect);break;case"together":ci(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function hi(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),ha|=t.lanes,0!=(r&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(r=Es(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Es(e,e.pendingProps)).return=t;r.sibling=null}return t.child}return null}function di(e){e.flags|=4}if(K)$n=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)z(e,r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},ei=function(){},ti=function(e,t,r,n,i){if((e=e.memoizedProps)!==n){var a=t.stateNode,s=Nr(Lr.current);r=H(a,r,e,n,i,s),(t.updateQueue=r)&&di(t)}},ri=function(e,t,r,n){r!==n&&di(t)};else if(J){$n=function(e,t,r,n){for(var i=t.child;null!==i;){if(5===i.tag){var a=i.stateNode;r&&n&&(a=Fe(a,i.type,i.memoizedProps,i)),z(e,a)}else if(6===i.tag)a=i.stateNode,r&&n&&(a=Le(a,i.memoizedProps,i)),z(e,a);else if(4!==i.tag){if(13===i.tag&&0!=(4&i.flags)&&(a=null!==i.memoizedState)){var s=i.child;if(null!==s&&(null!==s.child&&(s.child.return=s,$n(e,s,!0,a)),null!==(a=s.sibling))){a.return=i,i=a;continue}}if(null!==i.child){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};var pi=function(e,t,r,n){for(var i=t.child;null!==i;){if(5===i.tag){var a=i.stateNode;r&&n&&(a=Fe(a,i.type,i.memoizedProps,i)),Be(e,a)}else if(6===i.tag)a=i.stateNode,r&&n&&(a=Le(a,i.memoizedProps,i)),Be(e,a);else if(4!==i.tag){if(13===i.tag&&0!=(4&i.flags)&&(a=null!==i.memoizedState)){var s=i.child;if(null!==s&&(null!==s.child&&(s.child.return=s,pi(e,s,!0,a)),null!==(a=s.sibling))){a.return=i,i=a;continue}}if(null!==i.child){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};ei=function(e){var t=e.stateNode;if(null!==e.firstEffect){var r=t.containerInfo,n=Ie(r);pi(n,e,!1,!1),t.pendingChildren=n,di(e),Re(r,n)}},ti=function(e,t,r,n,i){var a=e.stateNode,s=e.memoizedProps;if((e=null===t.firstEffect)&&s===n)t.stateNode=a;else{var o=t.stateNode,l=Nr(Lr.current),c=null;s!==n&&(c=H(o,r,s,n,i,l)),e&&null===c?t.stateNode=a:(a=Ce(a,c,r,s,n,t,e,o),V(a,r,n,i,l)&&di(t),t.stateNode=a,e?di(t):$n(a,t,!1,!1))}},ri=function(e,t,r,n){r!==n?(e=Nr(Ur.current),r=Nr(Lr.current),t.stateNode=j(n,e,r,t),di(t)):t.stateNode=e.stateNode}}else ei=function(){},ti=function(){},ri=function(){};function fi(e,t){if(!Wr)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function mi(e,t,r){var n=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return at(t.type)&&st(),null;case 3:return Or(),Ze(rt),Ze(tt),en(),(n=t.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(Jr(t)?di(t):n.hydrate||(t.flags|=256)),ei(t),null;case 5:zr(t);var i=Nr(Ur.current);if(r=t.type,null!==e&&null!=t.stateNode)ti(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=128);else{if(!n){if(null===t.stateNode)throw Error(o(166));return null}if(e=Nr(Lr.current),Jr(t)){if(!Z)throw Error(o(175));e=ze(t.stateNode,t.type,t.memoizedProps,i,e,t),t.updateQueue=e,null!==e&&di(t)}else{var a=G(r,n,i,e,t);$n(a,t,!1,!1),t.stateNode=a,V(a,r,n,i,e)&&di(t)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)ri(e,t,e.memoizedProps,n);else{if("string"!=typeof n&&null===t.stateNode)throw Error(o(166));if(e=Nr(Ur.current),i=Nr(Lr.current),Jr(t)){if(!Z)throw Error(o(176));Ve(t.stateNode,t.memoizedProps,t)&&di(t)}else t.stateNode=j(n,e,i,t)}return null;case 13:return Ze(Vr),n=t.memoizedState,0!=(64&t.flags)?(t.lanes=r,t):(n=null!==n,i=!1,null===e?void 0!==t.memoizedProps.fallback&&Jr(t):i=null!==e.memoizedState,n&&!i&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Vr.current)?0===la&&(la=3):(0!==la&&3!==la||(la=4),null===na||0==(134217727&ha)&&0==(134217727&da)||Va(na,aa))),J&&n&&(t.flags|=4),K&&(n||i)&&(t.flags|=4),null);case 4:return Or(),ei(t),null===e&&ie(t.stateNode.containerInfo),null;case 10:return lr(t),null;case 19:if(Ze(Vr),null===(n=t.memoizedState))return null;if(i=0!=(64&t.flags),null===(a=n.rendering))if(i)fi(n,!1);else{if(0!==la||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(a=Hr(e))){for(t.flags|=64,fi(n,!1),null!==(e=a.updateQueue)&&(t.updateQueue=e,t.flags|=4),null===n.lastEffect&&(t.firstEffect=null),t.lastEffect=n.lastEffect,e=r,n=t.child;null!==n;)r=e,(i=n).flags&=2,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null,null===(a=i.alternate)?(i.childLanes=0,i.lanes=r,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,r=a.dependencies,i.dependencies=null===r?null:{lanes:r.lanes,firstContext:r.firstContext}),n=n.sibling;return $e(Vr,1&Vr.current|2),t.child}e=e.sibling}null!==n.tail&&Ht()>ga&&(t.flags|=64,i=!0,fi(n,!1),t.lanes=33554432)}else{if(!i)if(null!==(e=Hr(a))){if(t.flags|=64,i=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),fi(n,!0),null===n.tail&&"hidden"===n.tailMode&&!a.alternate&&!Wr)return null!==(t=t.lastEffect=n.lastEffect)&&(t.nextEffect=null),null}else 2*Ht()-n.renderingStartTime>ga&&1073741824!==r&&(t.flags|=64,i=!0,fi(n,!1),t.lanes=33554432);n.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=n.last)?e.sibling=a:t.child=a,n.last=a)}return null!==n.tail?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.lastEffect=t.lastEffect,n.renderingStartTime=Ht(),e.sibling=null,t=Vr.current,$e(Vr,i?1&t|2:1&t),e):null;case 23:case 24:return Xa(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==n.mode&&(t.flags|=4),null}throw Error(o(156,t.tag))}function gi(e){switch(e.tag){case 1:at(e.type)&&st();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Or(),Ze(rt),Ze(tt),en(),0!=(64&(t=e.flags)))throw Error(o(285));return e.flags=-4097&t|64,e;case 5:return zr(e),null;case 13:return Ze(Vr),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return Ze(Vr),null;case 4:return Or(),null;case 10:return lr(e),null;case 23:case 24:return Xa(),null;default:return null}}function vi(e,t){try{var r="",n=t;do{r+=er(n),n=n.return}while(n);var i=r}catch(a){i="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:i}}function Ai(e,t){try{console.error(t.value)}catch(r){setTimeout((function(){throw r}))}}var yi="function"==typeof WeakMap?WeakMap:Map;function xi(e,t,r){(r=mr(-1,r)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){xa||(xa=!0,ba=n),Ai(0,t)},r}function bi(e,t,r){(r=mr(-1,r)).tag=3;var n=e.type.getDerivedStateFromError;if("function"==typeof n){var i=t.value;r.payload=function(){return Ai(0,t),n(i)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(r.callback=function(){"function"!=typeof n&&(null===wa?wa=new Set([this]):wa.add(this),Ai(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),r}var wi="function"==typeof WeakSet?WeakSet:Set;function Ei(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(r){us(e,r)}else t.current=null}function Si(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var r=e.memoizedProps,n=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?r:tr(t.type,r),n),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(K&&256&t.flags&&Te(t.stateNode.containerInfo))}throw Error(o(163))}function Mi(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.destroy;r.destroy=void 0,void 0!==n&&n()}r=r.next}while(r!==t)}}function _i(e,t,r){switch(r.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=r.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var n=e.create;e.destroy=n()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=r.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;n=i.next,0!=(4&(i=i.tag))&&0!=(1&i)&&(os(r,e),ss(r,e)),e=n}while(e!==t)}return;case 1:return e=r.stateNode,4&r.flags&&(null===t?e.componentDidMount():(n=r.elementType===r.type?t.memoizedProps:tr(r.type,t.memoizedProps),e.componentDidUpdate(n,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=r.updateQueue)&&yr(r,t,e));case 3:if(null!==(t=r.updateQueue)){if(e=null,null!==r.child)switch(r.child.tag){case 5:e=D(r.child.stateNode);break;case 1:e=r.child.stateNode}yr(r,t,e)}return;case 5:return e=r.stateNode,void(null===t&&4&r.flags&&ge(e,r.type,r.memoizedProps,r));case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(Z&&null===r.memoizedState&&(r=r.alternate,null!==r&&(r=r.memoizedState,null!==r&&(r=r.dehydrated,null!==r&&je(r)))))}throw Error(o(163))}function Ti(e,t){if(K)for(var r=e;;){if(5===r.tag){var n=r.stateNode;t?Ee(n):Me(r.stateNode,r.memoizedProps)}else if(6===r.tag)n=r.stateNode,t?Se(n):_e(n,r.memoizedProps);else if((23!==r.tag&&24!==r.tag||null===r.memoizedState||r===e)&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}function Ci(e,t){if(dt&&"function"==typeof dt.onCommitFiberUnmount)try{dt.onCommitFiberUnmount(ht,t)}catch(a){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e=e.next;do{var n=r,i=n.destroy;if(n=n.tag,void 0!==i)if(0!=(4&n))os(t,r);else{n=t;try{i()}catch(a){us(n,a)}}r=r.next}while(r!==e)}break;case 1:if(Ei(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(a){us(t,a)}break;case 5:Ei(t);break;case 4:K?Di(e,t):J&&J&&(t=t.stateNode.containerInfo,e=Ie(t),Pe(t,e))}}function Ii(e,t){for(var r=t;;)if(Ci(e,r),null===r.child||K&&4===r.tag){if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}else r.child.return=r,r=r.child}function Bi(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function Ri(e){return 5===e.tag||3===e.tag||4===e.tag}function Pi(e){if(K){e:{for(var t=e.return;null!==t;){if(Ri(t))break e;t=t.return}throw Error(o(160))}var r=t;switch(t=r.stateNode,r.tag){case 5:var n=!1;break;case 3:case 4:t=t.containerInfo,n=!0;break;default:throw Error(o(161))}16&r.flags&&(we(t),r.flags&=-17);e:t:for(r=e;;){for(;null===r.sibling;){if(null===r.return||Ri(r.return)){r=null;break e}r=r.return}for(r.sibling.return=r.return,r=r.sibling;5!==r.tag&&6!==r.tag&&18!==r.tag;){if(2&r.flags)continue t;if(null===r.child||4===r.tag)continue t;r.child.return=r,r=r.child}if(!(2&r.flags)){r=r.stateNode;break e}}n?Fi(e,r,t):Li(e,r,t)}}function Fi(e,t,r){var n=e.tag,i=5===n||6===n;if(i)e=i?e.stateNode:e.stateNode.instance,t?ye(r,e,t):fe(r,e);else if(4!==n&&null!==(e=e.child))for(Fi(e,t,r),e=e.sibling;null!==e;)Fi(e,t,r),e=e.sibling}function Li(e,t,r){var n=e.tag,i=5===n||6===n;if(i)e=i?e.stateNode:e.stateNode.instance,t?Ae(r,e,t):pe(r,e);else if(4!==n&&null!==(e=e.child))for(Li(e,t,r),e=e.sibling;null!==e;)Li(e,t,r),e=e.sibling}function Di(e,t){for(var r,n,i=t,a=!1;;){if(!a){a=i.return;e:for(;;){if(null===a)throw Error(o(160));switch(r=a.stateNode,a.tag){case 5:n=!1;break e;case 3:case 4:r=r.containerInfo,n=!0;break e}a=a.return}a=!0}if(5===i.tag||6===i.tag)Ii(e,i),n?be(r,i.stateNode):xe(r,i.stateNode);else if(4===i.tag){if(null!==i.child){r=i.stateNode.containerInfo,n=!0,i.child.return=i,i=i.child;continue}}else if(Ci(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(a=!1)}i.sibling.return=i.return,i=i.sibling}}function Ui(e,t){if(K){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void Mi(3,t);case 1:case 12:case 17:return;case 5:var r=t.stateNode;if(null!=r){var n=t.memoizedProps;e=null!==e?e.memoizedProps:n;var i=t.type,a=t.updateQueue;t.updateQueue=null,null!==a&&ve(r,a,i,e,n,t)}return;case 6:if(null===t.stateNode)throw Error(o(162));return r=t.memoizedProps,void me(t.stateNode,null!==e?e.memoizedProps:r,r);case 3:return void(Z&&(t=t.stateNode,t.hydrate&&(t.hydrate=!1,Qe(t.containerInfo))));case 13:return Ni(t),void ki(t);case 19:return void ki(t);case 23:case 24:return void Ti(t,null!==t.memoizedState)}throw Error(o(163))}switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void Mi(3,t);case 12:case 23:case 24:return;case 13:return Ni(t),void ki(t);case 19:return void ki(t);case 3:Z&&((r=t.stateNode).hydrate&&(r.hydrate=!1,Qe(r.containerInfo)))}e:if(J){switch(t.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:t=t.stateNode,Pe(t.containerInfo,t.pendingChildren);break e}throw Error(o(163))}}function Ni(e){null!==e.memoizedState&&(ma=Ht(),K&&Ti(e.child,!0))}function ki(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new wi),t.forEach((function(t){var n=ds.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}function Oi(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Gi=0,zi=1,Vi=2,Hi=3,Qi=4;if("function"==typeof Symbol&&Symbol.for){var ji=Symbol.for;Gi=ji("selector.component"),zi=ji("selector.has_pseudo_class"),Vi=ji("selector.role"),Hi=ji("selector.test_id"),Qi=ji("selector.text")}function Wi(e){var t=$(e);if(null!=t){if("string"!=typeof t.memoizedProps["data-testname"])throw Error(o(364));return t}if(null===(e=se(e)))throw Error(o(362));return e.stateNode.current}function Xi(e,t){switch(t.$$typeof){case Gi:if(e.type===t.value)return!0;break;case zi:e:{t=t.value,e=[e,0];for(var r=0;r<e.length;){var n=e[r++],i=e[r++],a=t[i];if(5!==n.tag||!ce(n)){for(;null!=a&&Xi(n,a);)a=t[++i];if(i===t.length){t=!0;break e}for(n=n.child;null!==n;)e.push(n,i),n=n.sibling}}t=!1}return t;case Vi:if(5===e.tag&&ue(e.stateNode,t.value))return!0;break;case Qi:if((5===e.tag||6===e.tag)&&(null!==(e=le(e))&&0<=e.indexOf(t.value)))return!0;break;case Hi:if(5===e.tag&&("string"==typeof(e=e.memoizedProps["data-testname"])&&e.toLowerCase()===t.value.toLowerCase()))return!0;break;default:throw Error(o(365,t))}return!1}function Yi(e){switch(e.$$typeof){case Gi:return"<"+(C(e.value)||"Unknown")+">";case zi:return":has("+(Yi(e)||"")+")";case Vi:return'[role="'+e.value+'"]';case Qi:return'"'+e.value+'"';case Hi:return'[data-testname="'+e.value+'"]';default:throw Error(o(365,e))}}function qi(e,t){var r=[];e=[e,0];for(var n=0;n<e.length;){var i=e[n++],a=e[n++],s=t[a];if(5!==i.tag||!ce(i)){for(;null!=s&&Xi(i,s);)s=t[++a];if(a===t.length)r.push(i);else for(i=i.child;null!==i;)e.push(i,a),i=i.sibling}}return r}function Ki(e,t){if(!ae)throw Error(o(363));e=qi(e=Wi(e),t),t=[],e=Array.from(e);for(var r=0;r<e.length;){var n=e[r++];if(5===n.tag)ce(n)||t.push(n.stateNode);else for(n=n.child;null!==n;)e.push(n),n=n.sibling}return t}var Ji=null;var Zi=Math.ceil,$i=l.ReactCurrentDispatcher,ea=l.ReactCurrentOwner,ta=l.IsSomeRendererActing,ra=0,na=null,ia=null,aa=0,sa=0,oa=Je(0),la=0,ca=null,ua=0,ha=0,da=0,pa=0,fa=null,ma=0,ga=1/0;function va(){ga=Ht()+500}var Aa,ya=null,xa=!1,ba=null,wa=null,Ea=!1,Sa=null,Ma=90,_a=[],Ta=[],Ca=null,Ia=0,Ba=null,Ra=-1,Pa=0,Fa=0,La=null,Da=!1;function Ua(){return 0!=(48&ra)?Ht():-1!==Ra?Ra:Ra=Ht()}function Na(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===Qt()?1:2;if(0===Pa&&(Pa=ua),0!==Kt.transition){0!==Fa&&(Fa=null!==fa?fa.pendingLanes:0),e=Pa;var t=4186112&~Fa;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Qt(),0!=(4&ra)&&98===e?e=At(12,Pa):e=At(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),Pa),e}function ka(e,t,r){if(50<Ia)throw Ia=0,Ba=null,Error(o(185));if(null===(e=Oa(e,t)))return null;bt(e,t,r),e===na&&(da|=t,4===la&&Va(e,aa));var n=Qt();1===t?0!=(8&ra)&&0==(48&ra)?Ha(e):(Ga(e,r),0===ra&&(va(),Yt())):(0==(4&ra)||98!==n&&99!==n||(null===Ca?Ca=new Set([e]):Ca.add(e)),Ga(e,r)),fa=e}function Oa(e,t){e.lanes|=t;var r=e.alternate;for(null!==r&&(r.lanes|=t),r=e,e=e.return;null!==e;)e.childLanes|=t,null!==(r=e.alternate)&&(r.childLanes|=t),r=e,e=e.return;return 3===r.tag?r.stateNode:null}function Ga(e,t){for(var r=e.callbackNode,n=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes;0<s;){var l=31-wt(s),c=1<<l,u=a[l];if(-1===u){if(0==(c&n)||0!=(c&i)){u=t,mt(c);var h=ft;a[l]=10<=h?u+250:6<=h?u+5e3:-1}}else u<=t&&(e.expiredLanes|=c);s&=~c}if(n=gt(e,e===na?aa:0),t=ft,0===n)null!==r&&(r!==Nt&&Tt(r),e.callbackNode=null,e.callbackPriority=0);else{if(null!==r){if(e.callbackPriority===t)return;r!==Nt&&Tt(r)}15===t?(r=Ha.bind(null,e),null===Ot?(Ot=[r],Gt=_t(Pt,qt)):Ot.push(r),r=Nt):14===t?r=Xt(99,Ha.bind(null,e)):(r=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(o(358,e))}}(t),r=Xt(r,za.bind(null,e))),e.callbackPriority=t,e.callbackNode=r}}function za(e){if(Ra=-1,Fa=Pa=0,0!=(48&ra))throw Error(o(327));var t=e.callbackNode;if(as()&&e.callbackNode!==t)return null;var r=gt(e,e===na?aa:0);if(0===r)return null;var n=r,i=ra;ra|=16;var a=Ka();for(na===e&&aa===n||(va(),Ya(e,n));;)try{$a();break}catch(l){qa(e,l)}if(sr(),$i.current=a,ra=i,null!==ia?n=0:(na=null,aa=0,n=la),0!=(ua&da))Ya(e,0);else if(0!==n){if(2===n&&(ra|=64,e.hydrate&&(e.hydrate=!1,Te(e.containerInfo)),0!==(r=vt(e))&&(n=Ja(e,r))),1===n)throw t=ca,Ya(e,0),Va(e,r),Ga(e,Ht()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=r,n){case 0:case 1:throw Error(o(345));case 2:case 5:rs(e);break;case 3:if(Va(e,r),(62914560&r)===r&&10<(n=ma+500-Ht())){if(0!==gt(e,0))break;if(((i=e.suspendedLanes)&r)!==r){Ua(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=W(rs.bind(null,e),n);break}rs(e);break;case 4:if(Va(e,r),(4186112&r)===r)break;for(n=e.eventTimes,i=-1;0<r;){var s=31-wt(r);a=1<<s,(s=n[s])>i&&(i=s),r&=~a}if(r=i,10<(r=(120>(r=Ht()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Zi(r/1960))-r)){e.timeoutHandle=W(rs.bind(null,e),r);break}rs(e);break;default:throw Error(o(329))}}return Ga(e,Ht()),e.callbackNode===t?za.bind(null,e):null}function Va(e,t){for(t&=~pa,t&=~da,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-wt(t),n=1<<r;e[r]=-1,t&=~n}}function Ha(e){if(0!=(48&ra))throw Error(o(327));if(as(),e===na&&0!=(e.expiredLanes&aa)){var t=aa,r=Ja(e,t);0!=(ua&da)&&(r=Ja(e,t=gt(e,t)))}else r=Ja(e,t=gt(e,0));if(0!==e.tag&&2===r&&(ra|=64,e.hydrate&&(e.hydrate=!1,Te(e.containerInfo)),0!==(t=vt(e))&&(r=Ja(e,t))),1===r)throw r=ca,Ya(e,0),Va(e,t),Ga(e,Ht()),r;return e.finishedWork=e.current.alternate,e.finishedLanes=t,rs(e),Ga(e,Ht()),null}function Qa(e,t){var r=ra;ra|=1;try{return e(t)}finally{0===(ra=r)&&(va(),Yt())}}function ja(e,t){var r=ra;if(0!=(48&r))return e(t);ra|=1;try{if(e)return Wt(99,e.bind(null,t))}finally{ra=r,Yt()}}function Wa(e,t){$e(oa,sa),sa|=t,ua|=t}function Xa(){sa=oa.current,Ze(oa)}function Ya(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==Y&&(e.timeoutHandle=Y,X(r)),null!==ia)for(r=ia.return;null!==r;){var n=r;switch(n.tag){case 1:null!=(n=n.type.childContextTypes)&&st();break;case 3:Or(),Ze(rt),Ze(tt),en();break;case 5:zr(n);break;case 4:Or();break;case 13:case 19:Ze(Vr);break;case 10:lr(n);break;case 23:case 24:Xa()}r=r.return}na=e,ia=Es(e.current,null),aa=sa=ua=t,la=0,ca=null,pa=da=ha=0}function qa(e,t){for(;;){var r=ia;try{if(sr(),tn.current=Nn,ln){for(var n=an.memoizedState;null!==n;){var i=n.queue;null!==i&&(i.pending=null),n=n.next}ln=!1}if(nn=0,on=sn=an=null,cn=!1,ea.current=null,null===r||null===r.return){la=1,ca=t,ia=null;break}e:{var a=e,s=r.return,o=r,l=t;if(t=aa,o.flags|=2048,o.firstEffect=o.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var c=l;if(0==(2&o.mode)){var u=o.alternate;u?(o.updateQueue=u.updateQueue,o.memoizedState=u.memoizedState,o.lanes=u.lanes):(o.updateQueue=null,o.memoizedState=null)}var h=0!=(1&Vr.current),d=s;do{var p;if(p=13===d.tag){var f=d.memoizedState;if(null!==f)p=null!==f.dehydrated;else{var m=d.memoizedProps;p=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!h)}}if(p){var g=d.updateQueue;if(null===g){var v=new Set;v.add(c),d.updateQueue=v}else g.add(c);if(0==(2&d.mode)){if(d.flags|=64,o.flags|=16384,o.flags&=-2981,1===o.tag)if(null===o.alternate)o.tag=17;else{var A=mr(-1,1);A.tag=2,gr(o,A)}o.lanes|=1;break e}l=void 0,o=t;var y=a.pingCache;if(null===y?(y=a.pingCache=new yi,l=new Set,y.set(c,l)):void 0===(l=y.get(c))&&(l=new Set,y.set(c,l)),!l.has(o)){l.add(o);var x=hs.bind(null,a,c,o);c.then(x,x)}d.flags|=4096,d.lanes=t;break e}d=d.return}while(null!==d);l=Error((C(o.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==la&&(la=2),l=vi(l,o),d=s;do{switch(d.tag){case 3:a=l,d.flags|=4096,t&=-t,d.lanes|=t,vr(d,xi(0,a,t));break e;case 1:a=l;var b=d.type,w=d.stateNode;if(0==(64&d.flags)&&("function"==typeof b.getDerivedStateFromError||null!==w&&"function"==typeof w.componentDidCatch&&(null===wa||!wa.has(w)))){d.flags|=4096,t&=-t,d.lanes|=t,vr(d,bi(d,a,t));break e}}d=d.return}while(null!==d)}ts(r)}catch(E){t=E,ia===r&&null!==r&&(ia=r=r.return);continue}break}}function Ka(){var e=$i.current;return $i.current=Nn,null===e?Nn:e}function Ja(e,t){var r=ra;ra|=16;var n=Ka();for(na===e&&aa===t||Ya(e,t);;)try{Za();break}catch(i){qa(e,i)}if(sr(),ra=r,$i.current=n,null!==ia)throw Error(o(261));return na=null,aa=0,la}function Za(){for(;null!==ia;)es(ia)}function $a(){for(;null!==ia&&!Ct();)es(ia)}function es(e){var t=Aa(e.alternate,e,sa);e.memoizedProps=e.pendingProps,null===t?ts(e):ia=t,ea.current=null}function ts(e){var t=e;do{var r=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(r=mi(r,t,sa)))return void(ia=r);if(24!==(r=t).tag&&23!==r.tag||null===r.memoizedState||0!=(1073741824&sa)||0==(4&r.mode)){for(var n=0,i=r.child;null!==i;)n|=i.lanes|i.childLanes,i=i.sibling;r.childLanes=n}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(r=gi(t)))return r.flags&=2047,void(ia=r);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(ia=t);ia=t=e}while(null!==t);0===la&&(la=5)}function rs(e){var t=Qt();return Wt(99,ns.bind(null,e,t)),null}function ns(e,t){do{as()}while(null!==Sa);if(0!=(48&ra))throw Error(o(327));var r=e.finishedWork;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(o(177));e.callbackNode=null;var n=r.lanes|r.childLanes,i=n,a=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var s=e.eventTimes,l=e.expirationTimes;0<a;){var c=31-wt(a),u=1<<c;i[c]=0,s[c]=-1,l[c]=-1,a&=~u}if(null!==Ca&&0==(24&n)&&Ca.has(e)&&Ca.delete(e),e===na&&(ia=na=null,aa=0),1<r.flags?null!==r.lastEffect?(r.lastEffect.nextEffect=r,n=r.firstEffect):n=r:n=r.firstEffect,null!==n){i=ra,ra|=32,ea.current=null,La=k(e.containerInfo),Da=!1,ya=n;do{try{is()}catch(A){if(null===ya)throw Error(o(330));us(ya,A),ya=ya.nextEffect}}while(null!==ya);La=null,ya=n;do{try{for(s=e;null!==ya;){var h=ya.flags;if(16&h&&K&&we(ya.stateNode),128&h){var d=ya.alternate;if(null!==d){var p=d.ref;null!==p&&("function"==typeof p?p(null):p.current=null)}}switch(1038&h){case 2:Pi(ya),ya.flags&=-3;break;case 6:Pi(ya),ya.flags&=-3,Ui(ya.alternate,ya);break;case 1024:ya.flags&=-1025;break;case 1028:ya.flags&=-1025,Ui(ya.alternate,ya);break;case 4:Ui(ya.alternate,ya);break;case 8:l=s,a=ya,K?Di(l,a):Ii(l,a);var f=a.alternate;Bi(a),null!==f&&Bi(f)}ya=ya.nextEffect}}catch(A){if(null===ya)throw Error(o(330));us(ya,A),ya=ya.nextEffect}}while(null!==ya);Da&&ne(),O(e.containerInfo),e.current=r,ya=n;do{try{for(h=e;null!==ya;){var m=ya.flags;if(36&m&&_i(h,ya.alternate,ya),128&m){d=void 0;var g=ya.ref;if(null!==g){var v=ya.stateNode;if(5===ya.tag)d=D(v);else d=v;"function"==typeof g?g(d):g.current=d}}ya=ya.nextEffect}}catch(A){if(null===ya)throw Error(o(330));us(ya,A),ya=ya.nextEffect}}while(null!==ya);ya=null,kt(),ra=i}else e.current=r;if(Ea)Ea=!1,Sa=e,Ma=t;else for(ya=n;null!==ya;)t=ya.nextEffect,ya.nextEffect=null,8&ya.flags&&((m=ya).sibling=null,m.stateNode=null),ya=t;if(0===(n=e.pendingLanes)&&(wa=null),1===n?e===Ba?Ia++:(Ia=0,Ba=e):Ia=0,r=r.stateNode,dt&&"function"==typeof dt.onCommitFiberRoot)try{dt.onCommitFiberRoot(ht,r,void 0,64==(64&r.current.flags))}catch(A){}if(Ga(e,Ht()),xa)throw xa=!1,e=ba,ba=null,e;return 0!=(8&ra)||Yt(),null}function is(){for(;null!==ya;){var e=ya.alternate;Da||null===La||(0!=(8&ya.flags)?F(ya,La)&&(Da=!0,re()):13===ya.tag&&Oi(e,ya)&&F(ya,La)&&(Da=!0,re()));var t=ya.flags;0!=(256&t)&&Si(e,ya),0==(512&t)||Ea||(Ea=!0,Xt(97,(function(){return as(),null}))),ya=ya.nextEffect}}function as(){if(90!==Ma){var e=97<Ma?97:Ma;return Ma=90,Wt(e,ls)}return!1}function ss(e,t){_a.push(t,e),Ea||(Ea=!0,Xt(97,(function(){return as(),null})))}function os(e,t){Ta.push(t,e),Ea||(Ea=!0,Xt(97,(function(){return as(),null})))}function ls(){if(null===Sa)return!1;var e=Sa;if(Sa=null,0!=(48&ra))throw Error(o(331));var t=ra;ra|=32;var r=Ta;Ta=[];for(var n=0;n<r.length;n+=2){var i=r[n],a=r[n+1],s=i.destroy;if(i.destroy=void 0,"function"==typeof s)try{s()}catch(c){if(null===a)throw Error(o(330));us(a,c)}}for(r=_a,_a=[],n=0;n<r.length;n+=2){i=r[n],a=r[n+1];try{var l=i.create;i.destroy=l()}catch(c){if(null===a)throw Error(o(330));us(a,c)}}for(l=e.current.firstEffect;null!==l;)e=l.nextEffect,l.nextEffect=null,8&l.flags&&(l.sibling=null,l.stateNode=null),l=e;return ra=t,Yt(),!0}function cs(e,t,r){gr(e,t=xi(0,t=vi(r,t),1)),t=Ua(),null!==(e=Oa(e,1))&&(bt(e,1,t),Ga(e,t))}function us(e,t){if(3===e.tag)cs(e,e,t);else for(var r=e.return;null!==r;){if(3===r.tag){cs(r,e,t);break}if(1===r.tag){var n=r.stateNode;if("function"==typeof r.type.getDerivedStateFromError||"function"==typeof n.componentDidCatch&&(null===wa||!wa.has(n))){var i=bi(r,e=vi(t,e),1);if(gr(r,i),i=Ua(),null!==(r=Oa(r,1)))bt(r,1,i),Ga(r,i);else if("function"==typeof n.componentDidCatch&&(null===wa||!wa.has(n)))try{n.componentDidCatch(t,e)}catch(a){}break}}r=r.return}}function hs(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),t=Ua(),e.pingedLanes|=e.suspendedLanes&r,na===e&&(aa&r)===r&&(4===la||3===la&&(62914560&aa)===aa&&500>Ht()-ma?Ya(e,0):pa|=r),Ga(e,t)}function ds(e,t){var r=e.stateNode;null!==r&&r.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===Qt()?1:2:(0===Pa&&(Pa=ua),0===(t=yt(62914560&~Pa))&&(t=4194304))),r=Ua(),null!==(e=Oa(e,t))&&(bt(e,t,r),Ga(e,r))}Aa=function(e,t,r){var n=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||rt.current)Vn=!0;else{if(0==(r&n)){switch(Vn=!1,t.tag){case 3:Zn(t),Zr();break;case 5:Gr(t);break;case 1:at(t.type)&&ct(t);break;case 4:kr(t,t.stateNode.containerInfo);break;case 10:or(t,t.memoizedProps.value);break;case 13:if(null!==t.memoizedState)return 0!=(r&t.child.childLanes)?ii(e,t,r):($e(Vr,1&Vr.current),null!==(t=hi(e,t,r))?t.sibling:null);$e(Vr,1&Vr.current);break;case 19:if(n=0!=(r&t.childLanes),0!=(64&e.flags)){if(n)return ui(e,t,r);t.flags|=64}var i=t.memoizedState;if(null!==i&&(i.rendering=null,i.tail=null,i.lastEffect=null),$e(Vr,Vr.current),n)break;return null;case 23:case 24:return t.lanes=0,Xn(e,t,r)}return hi(e,t,r)}Vn=0!=(16384&e.flags)}else Vn=!1;switch(t.lanes=0,t.tag){case 2:if(n=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=it(t,tt.current),ur(t,r),i=dn(null,t,n,e,i,r),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,at(n)){var a=!0;ct(t)}else a=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,pr(t);var s=n.getDerivedStateFromProps;"function"==typeof s&&br(t,n,s,e),i.updater=wr,t.stateNode=i,i._reactInternals=t,_r(t,n,e,r),t=Jn(null,t,n,!0,a,r)}else t.tag=0,Hn(null,t,i,r),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(a=i._init)(i._payload),t.type=i,a=t.tag=function(e){if("function"==typeof e)return ws(e)?1:0;if(null!=e){if((e=e.$$typeof)===g)return 11;if(e===y)return 14}return 2}(i),e=tr(i,e),a){case 0:t=qn(null,t,i,e,r);break e;case 1:t=Kn(null,t,i,e,r);break e;case 11:t=Qn(null,t,i,e,r);break e;case 14:t=jn(null,t,i,tr(i.type,e),n,r);break e}throw Error(o(306,i,""))}return t;case 0:return n=t.type,i=t.pendingProps,qn(e,t,n,i=t.elementType===n?i:tr(n,i),r);case 1:return n=t.type,i=t.pendingProps,Kn(e,t,n,i=t.elementType===n?i:tr(n,i),r);case 3:if(Zn(t),n=t.updateQueue,null===e||null===n)throw Error(o(282));if(n=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,fr(e,t),Ar(t,n,null,r),(n=t.memoizedState.element)===i)Zr(),t=hi(e,t,r);else{if((a=(i=t.stateNode).hydrate)&&(Z?(jr=Ge(t.stateNode.containerInfo),Qr=t,a=Wr=!0):a=!1),a){if(Z&&null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)a=e[i],s=e[i+1],q?a._workInProgressVersionPrimary=s:a._workInProgressVersionSecondary=s,$r.push(a);for(r=Pr(t,null,n,r),t.child=r;r;)r.flags=-3&r.flags|1024,r=r.sibling}else Hn(e,t,n,r),Zr();t=t.child}return t;case 5:return Gr(t),null===e&&qr(t),n=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,s=i.children,Q(n,i)?s=null:null!==a&&Q(n,a)&&(t.flags|=16),Yn(e,t),Hn(e,t,s,r),t.child;case 6:return null===e&&qr(t),null;case 13:return ii(e,t,r);case 4:return kr(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=Rr(t,null,n,r):Hn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,Qn(e,t,n,i=t.elementType===n?i:tr(n,i),r);case 7:return Hn(e,t,t.pendingProps,r),t.child;case 8:case 12:return Hn(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,s=t.memoizedProps,or(t,a=i.value),null!==s){var l=s.value;if(0===(a=Jt(l,a)?0:0|("function"==typeof n._calculateChangedBits?n._calculateChangedBits(l,a):1073741823))){if(s.children===i.children&&!rt.current){t=hi(e,t,r);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var c=l.dependencies;if(null!==c){s=l.child;for(var u=c.firstContext;null!==u;){if(u.context===n&&0!=(u.observedBits&a)){1===l.tag&&((u=mr(-1,r&-r)).tag=2,gr(l,u)),l.lanes|=r,null!==(u=l.alternate)&&(u.lanes|=r),cr(l.return,r),c.lanes|=r;break}u=u.next}}else s=10===l.tag&&l.type===t.type?null:l.child;if(null!==s)s.return=l;else for(s=l;null!==s;){if(s===t){s=null;break}if(null!==(l=s.sibling)){l.return=s.return,s=l;break}s=s.return}l=s}}Hn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=(a=t.pendingProps).children,ur(t,r),n=n(i=hr(i,a.unstable_observedBits)),t.flags|=1,Hn(e,t,n,r),t.child;case 14:return a=tr(i=t.type,t.pendingProps),jn(e,t,i,a=tr(i.type,a),n,r);case 15:return Wn(e,t,t.type,t.pendingProps,n,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:tr(n,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,at(n)?(e=!0,ct(t)):e=!1,ur(t,r),Sr(t,n,i),_r(t,n,i,r),Jn(null,t,n,!0,e,r);case 19:return ui(e,t,r);case 23:case 24:return Xn(e,t,r)}throw Error(o(156,t.tag))};var ps={current:!1},fs=s.unstable_flushAllWithoutAsserting,ms="function"==typeof fs;function gs(){if(void 0!==fs)return fs();for(var e=!1;as();)e=!0;return e}function vs(t){try{gs(),function(t){if(null===Ji)try{var r=("require"+Math.random()).slice(0,7);Ji=(e&&e[r]).call(e,"timers").setImmediate}catch(n){Ji=function(e){var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}Ji(t)}((function(){gs()?vs(t):t()}))}catch(r){t(r)}}var As=0,ys=!1;function xs(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function bs(e,t,r,n){return new xs(e,t,r,n)}function ws(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Es(e,t){var r=e.alternate;return null===r?((r=bs(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Ss(e,t,r,n,i,a){var s=2;if(n=e,"function"==typeof e)ws(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case h:return Ms(r.children,i,a,t);case w:s=8,i|=16;break;case d:s=8,i|=1;break;case p:return(e=bs(12,r,t,8|i)).elementType=p,e.type=p,e.lanes=a,e;case v:return(e=bs(13,r,t,i)).type=v,e.elementType=v,e.lanes=a,e;case A:return(e=bs(19,r,t,i)).elementType=A,e.lanes=a,e;case E:return _s(r,i,a,t);case S:return(e=bs(24,r,t,i)).elementType=S,e.lanes=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case f:s=10;break e;case m:s=9;break e;case g:s=11;break e;case y:s=14;break e;case x:s=16,n=null;break e;case b:s=22;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=bs(s,r,t,i)).elementType=e,t.type=n,t.lanes=a,t}function Ms(e,t,r,n){return(e=bs(7,e,n,t)).lanes=r,e}function _s(e,t,r,n){return(e=bs(23,e,n,t)).elementType=E,e.lanes=r,e}function Ts(e,t,r){return(e=bs(6,e,null,t)).lanes=r,e}function Cs(e,t,r){return(t=bs(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Is(e,t,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Y,this.pendingContext=this.context=null,this.hydrate=r,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=xt(0),this.expirationTimes=xt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xt(0),Z&&(this.mutableSourceEagerHydrationData=null)}function Bs(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(o(188));throw Error(o(268,Object.keys(e)))}return null===(e=P(t))?null:e.stateNode}function Rs(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var r=e.retryLane;e.retryLane=0!==r&&r<t?r:t}}function Ps(e,t){Rs(e,t),(e=e.alternate)&&Rs(e,t)}function Fs(e){return null===(e=P(e))?null:e.stateNode}function Ls(){return null}return n.IsThisRendererActing=ps,n.act=function(e){function t(){As--,ta.current=r,ps.current=n}!1===ys&&(ys=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected.")),As++;var r=ta.current,n=ps.current;ta.current=!0,ps.current=!0;try{var i=Qa(e)}catch(a){throw t(),a}if(null!==i&&"object"==typeof i&&"function"==typeof i.then)return{then:function(e,n){i.then((function(){1<As||!0===ms&&!0===r?(t(),e()):vs((function(r){t(),r?n(r):e()}))}),(function(e){t(),n(e)}))}};try{1!==As||!1!==ms&&!1!==r||gs(),t()}catch(a){throw t(),a}return{then:function(e){e()}}},n.attemptContinuousHydration=function(e){13===e.tag&&(ka(e,67108864,Ua()),Ps(e,67108864))},n.attemptHydrationAtCurrentPriority=function(e){if(13===e.tag){var t=Ua(),r=Na(e);ka(e,r,t),Ps(e,r)}},n.attemptSynchronousHydration=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.hydrate){var r=mt(t.pendingLanes);t.expiredLanes|=r&t.pendingLanes,Ga(t,Ht()),0==(48&ra)&&(va(),Yt())}break;case 13:var n=Ua();ja((function(){return ka(e,1,n)})),Ps(e,4)}},n.attemptUserBlockingHydration=function(e){13===e.tag&&(ka(e,4,Ua()),Ps(e,4))},n.batchedEventUpdates=function(e,t){var r=ra;ra|=2;try{return e(t)}finally{0===(ra=r)&&(va(),Yt())}},n.batchedUpdates=Qa,n.createComponentSelector=function(e){return{$$typeof:Gi,value:e}},n.createContainer=function(e,t,r){return e=new Is(e,t,r),t=bs(3,null,null,2===t?7:1===t?3:0),e.current=t,t.stateNode=e,pr(t),e},n.createHasPsuedoClassSelector=function(e){return{$$typeof:zi,value:e}},n.createPortal=function(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:u,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}},n.createRoleSelector=function(e){return{$$typeof:Vi,value:e}},n.createTestNameSelector=function(e){return{$$typeof:Hi,value:e}},n.createTextSelector=function(e){return{$$typeof:Qi,value:e}},n.deferredUpdates=function(e){return Wt(97,e)},n.discreteUpdates=function(e,t,r,n,i){var a=ra;ra|=4;try{return Wt(98,e.bind(null,t,r,n,i))}finally{0===(ra=a)&&(va(),Yt())}},n.findAllNodes=Ki,n.findBoundingRects=function(e,t){if(!ae)throw Error(o(363));t=Ki(e,t),e=[];for(var r=0;r<t.length;r++)e.push(oe(t[r]));for(t=e.length-1;0<t;t--)for(var n=(r=e[t]).x,i=n+r.width,a=r.y,s=a+r.height,l=t-1;0<=l;l--)if(t!==l){var c=e[l],u=c.x,h=u+c.width,d=c.y,p=d+c.height;if(n>=u&&a>=d&&i<=h&&s<=p){e.splice(t,1);break}if(!(n!==u||r.width!==c.width||p<a||d>s)){d>a&&(c.height+=d-a,c.y=a),p<s&&(c.height=s-d),e.splice(t,1);break}if(!(a!==d||r.height!==c.height||h<n||u>i)){u>n&&(c.width+=u-n,c.x=n),h<i&&(c.width=i-u),e.splice(t,1);break}}return e},n.findHostInstance=Bs,n.findHostInstanceWithNoPortals=function(e){return null===(e=function(e){if(!(e=R(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child&&4!==t.tag)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}(e))?null:20===e.tag?e.stateNode.instance:e.stateNode},n.findHostInstanceWithWarning=function(e){return Bs(e)},n.flushControlled=function(e){var t=ra;ra|=1;try{Wt(99,e)}finally{0===(ra=t)&&(va(),Yt())}},n.flushDiscreteUpdates=function(){0==(49&ra)&&(function(){if(null!==Ca){var e=Ca;Ca=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,Ga(e,Ht())}))}Yt()}(),as())},n.flushPassiveEffects=as,n.flushSync=ja,n.focusWithin=function(e,t){if(!ae)throw Error(o(363));for(t=qi(e=Wi(e),t),t=Array.from(t),e=0;e<t.length;){var r=t[e++];if(!ce(r)){if(5===r.tag&&he(r.stateNode))return!0;for(r=r.child;null!==r;)t.push(r),r=r.sibling}}return!1},n.getCurrentUpdateLanePriority=function(){return pt},n.getFindAllNodesFailureDescription=function(e,t){if(!ae)throw Error(o(363));var r=0,n=[];e=[Wi(e),0];for(var i=0;i<e.length;){var a=e[i++],s=e[i++],l=t[s];if((5!==a.tag||!ce(a))&&(Xi(a,l)&&(n.push(Yi(l)),++s>r&&(r=s)),s<t.length))for(a=a.child;null!==a;)e.push(a,s),a=a.sibling}if(r<t.length){for(e=[];r<t.length;r++)e.push(Yi(t[r]));return"findAllNodes was able to match part of the selector:\n "+n.join(" > ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},n.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?D(e.child.stateNode):e.child.stateNode:null},n.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:Fs,findFiberByHostInstance:e.findFiberByHostInstance||Ls,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t.isDisabled&&t.supportsFiber)try{ht=t.inject(e),dt=t}catch(r){}e=!0}return e},n.observeVisibleRects=function(e,t,r,n){if(!ae)throw Error(o(363));e=Ki(e,t);var i=de(e,r,n).disconnect;return{disconnect:function(){i()}}},n.registerMutableSourceForHydration=function(e,t){var r=t._getVersion;r=r(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,r]:e.mutableSourceEagerHydrationData.push(t,r)},n.runWithPriority=function(e,t){var r=pt;try{return pt=e,t()}finally{pt=r}},n.shouldSuspend=function(){return!1},n.unbatchedUpdates=function(e,t){var r=ra;ra&=-2,ra|=8;try{return e(t)}finally{0===(ra=r)&&(va(),Yt())}},n.updateContainer=function(e,t,r,n){var i=t.current,a=Ua(),s=Na(i);e:if(r){t:{if(I(r=r._reactInternals)!==r||1!==r.tag)throw Error(o(170));var l=r;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(at(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(o(171))}if(1===r.tag){var c=r.type;if(at(c)){r=lt(r,c,l);break e}}r=l}else r=et;return null===t.context?t.context=r:t.pendingContext=r,(t=mr(a,s)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),gr(i,t),ka(i,s,a),s},n}},76525:(e,t,r)=>{"use strict";e.exports=r(67287)},94556:function(e,t){var r,n,i;"undefined"!=typeof self&&self,n=[],void 0===(i="function"==typeof(r=function(){function e(){}e.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},e.prototype.restoreState=function(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx},e.prototype.pattern=function(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");var t=this.disjunction();this.consumeChar("/");for(var r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":o(r,"global");break;case"i":o(r,"ignoreCase");break;case"m":o(r,"multiLine");break;case"u":o(r,"unicode");break;case"y":o(r,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:t,loc:this.loc(0)}},e.prototype.disjunction=function(){var e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}},e.prototype.alternative=function(){for(var e=[],t=this.idx;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}},e.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},e.prototype.assertion=function(){var e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":var t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead"}l(t);var r=this.disjunction();return this.consumeChar(")"),{type:t,value:r,loc:this.loc(e)}}c()},e.prototype.quantifier=function(e){var t,r=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":var n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":t=this.isDigit()?{atLeast:n,atMost:this.integerIncludingZero()}:{atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;l(t)}if(!0!==e||void 0!==t)return l(t),"?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(r),t},e.prototype.atom=function(){var e,t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),l(e),e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e},e.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[a("\n"),a("\r"),a("\u2028"),a("\u2029")]}},e.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.decimalEscapeAtom=function(){return{type:"GroupBackReference",value:this.positiveInteger()}},e.prototype.characterClassEscape=function(){var e,t=!1;switch(this.popChar()){case"d":e=u;break;case"D":e=u,t=!0;break;case"s":e=d;break;case"S":e=d,t=!0;break;case"w":e=h;break;case"W":e=h,t=!0}return l(e),{type:"Set",value:e,complement:t}},e.prototype.controlEscapeAtom=function(){var e;switch(this.popChar()){case"f":e=a("\f");break;case"n":e=a("\n");break;case"r":e=a("\r");break;case"t":e=a("\t");break;case"v":e=a("\v")}return l(e),{type:"Character",value:e}},e.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}},e.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:a("\0")}},e.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},e.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},e.prototype.identityEscapeAtom=function(){return{type:"Character",value:a(this.popChar())}},e.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:a(this.popChar())}}},e.prototype.characterClass=function(){var e=[],t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){var r=this.classAtom();if("Character"===r.type&&this.isRangeDash()){this.consumeChar("-");var n=this.classAtom();if("Character"===n.type){if(n.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:n.value})}else s(r.value,e),e.push(a("-")),s(n.value,e)}else s(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:t,value:e}},e.prototype.classAtom=function(){switch(this.peekChar()){case"]":case"\n":case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},e.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:a("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.group=function(){var e=!0;this.consumeChar("("),"?"===this.peekChar(0)?(this.consumeChar("?"),this.consumeChar(":"),e=!1):this.groupIdx++;var t=this.disjunction();this.consumeChar(")");var r={type:"Group",capturing:e,value:t};return e&&(r.idx=this.groupIdx),r},e.prototype.positiveInteger=function(){var e=this.popChar();if(!1===i.test(e))throw Error("Expecting a positive integer");for(;n.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.integerIncludingZero=function(){var e=this.popChar();if(!1===n.test(e))throw Error("Expecting an integer");for(;n.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.patternCharacter=function(){var e=this.popChar();switch(e){case"\n":case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:a(e)}}},e.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},e.prototype.isRangeDash=function(){return"-"===this.peekChar()&&this.isClassAtom(1)},e.prototype.isDigit=function(){return n.test(this.peekChar(0))},e.prototype.isClassAtom=function(e){switch(void 0===e&&(e=0),this.peekChar(e)){case"]":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},e.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},e.prototype.isAssertion=function(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return"?"===this.peekChar(1)&&("="===this.peekChar(2)||"!"===this.peekChar(2));default:return!1}},e.prototype.isQuantifier=function(){var e=this.saveState();try{return void 0!==this.quantifier(!0)}catch(t){return!1}finally{this.restoreState(e)}},e.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.parseHexDigits=function(e){for(var t="",n=0;n<e;n++){var i=this.popChar();if(!1===r.test(i))throw Error("Expecting a HexDecimal digits");t+=i}return{type:"Character",value:parseInt(t,16)}},e.prototype.peekChar=function(e){return void 0===e&&(e=0),this.input[this.idx+e]},e.prototype.popChar=function(){var e=this.peekChar(0);return this.consumeChar(),e},e.prototype.consumeChar=function(e){if(void 0!==e&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},e.prototype.loc=function(e){return{begin:e,end:this.idx}};var t,r=/[0-9a-fA-F]/,n=/[0-9]/,i=/[1-9]/;function a(e){return e.charCodeAt(0)}function s(e,t){void 0!==e.length?e.forEach((function(e){t.push(e)})):t.push(e)}function o(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t]=!0}function l(e){if(void 0===e)throw Error("Internal Error - Should never get here!")}function c(){throw Error("Internal Error - Should never get here!")}var u=[];for(t=a("0");t<=a("9");t++)u.push(t);var h=[a("_")].concat(u);for(t=a("a");t<=a("z");t++)h.push(t);for(t=a("A");t<=a("Z");t++)h.push(t);var d=[a(" "),a("\f"),a("\n"),a("\r"),a("\t"),a("\v"),a("\t"),a("\xa0"),a("\u1680"),a("\u2000"),a("\u2001"),a("\u2002"),a("\u2003"),a("\u2004"),a("\u2005"),a("\u2006"),a("\u2007"),a("\u2008"),a("\u2009"),a("\u200a"),a("\u2028"),a("\u2029"),a("\u202f"),a("\u205f"),a("\u3000"),a("\ufeff")];function p(){}return p.prototype.visitChildren=function(e){for(var t in e){var r=e[t];e.hasOwnProperty(t)&&(void 0!==r.type?this.visit(r):Array.isArray(r)&&r.forEach((function(e){this.visit(e)}),this))}},p.prototype.visit=function(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)},p.prototype.visitPattern=function(e){},p.prototype.visitFlags=function(e){},p.prototype.visitDisjunction=function(e){},p.prototype.visitAlternative=function(e){},p.prototype.visitStartAnchor=function(e){},p.prototype.visitEndAnchor=function(e){},p.prototype.visitWordBoundary=function(e){},p.prototype.visitNonWordBoundary=function(e){},p.prototype.visitLookahead=function(e){},p.prototype.visitNegativeLookahead=function(e){},p.prototype.visitCharacter=function(e){},p.prototype.visitSet=function(e){},p.prototype.visitGroup=function(e){},p.prototype.visitGroupBackReference=function(e){},p.prototype.visitQuantifier=function(e){},{RegExpParser:e,BaseRegExpVisitor:p,VERSION:"0.5.0"}})?r.apply(t,n):r)||(e.exports=i)},73466:function(e){var t;e.exports=(t=function(){function e(e){return i.appendChild(e.dom),e}function r(e){for(var t=0;t<i.children.length;t++)i.children[t].style.display=t===e?"block":"none";n=e}var n=0,i=document.createElement("div");i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",(function(e){e.preventDefault(),r(++n%i.children.length)}),!1);var a=(performance||Date).now(),s=a,o=0,l=e(new t.Panel("FPS","#0ff","#002")),c=e(new t.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var u=e(new t.Panel("MB","#f08","#201"));return r(0),{REVISION:16,dom:i,addPanel:e,showPanel:r,begin:function(){a=(performance||Date).now()},end:function(){o++;var e=(performance||Date).now();if(c.update(e-a,200),e>s+1e3&&(l.update(1e3*o/(e-s),100),s=e,o=0,u)){var t=performance.memory;u.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:r}},t.Panel=function(e,t,r){var n=1/0,i=0,a=Math.round,s=a(window.devicePixelRatio||1),o=80*s,l=48*s,c=3*s,u=2*s,h=3*s,d=15*s,p=74*s,f=30*s,m=document.createElement("canvas");m.width=o,m.height=l,m.style.cssText="width:80px;height:48px";var g=m.getContext("2d");return g.font="bold "+9*s+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=r,g.fillRect(0,0,o,l),g.fillStyle=t,g.fillText(e,c,u),g.fillRect(h,d,p,f),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(h,d,p,f),{dom:m,update:function(l,v){n=Math.min(n,l),i=Math.max(i,l),g.fillStyle=r,g.globalAlpha=1,g.fillRect(0,0,o,d),g.fillStyle=t,g.fillText(a(l)+" "+e+" ("+a(n)+"-"+a(i)+")",c,u),g.drawImage(m,h+s,d,p-s,f,h,d,p-s,f),g.fillRect(h+p-s,d,s,f),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(h+p-s,d,s,a((1-l/v)*f))}}},t)},81111:(e,t,r)=>{"use strict";r.d(t,{J:()=>i});var n=r(99477);class i extends n.Texture{constructor(e=null,t=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=n.NearestFilter,this.minFilter=n.NearestFilter,this.wrapR=n.ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}},1687:(e,t,r)=>{"use strict";r.d(t,{A:()=>p});var n=r(99477),i=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const s={IDLE:Symbol(),ROTATE:Symbol(),PAN:Symbol(),SCALE:Symbol(),FOV:Symbol(),FOCUS:Symbol(),ZROTATE:Symbol(),TOUCH_MULTI:Symbol(),ANIMATION_FOCUS:Symbol(),ANIMATION_ROTATE:Symbol()},o={NONE:Symbol(),ONE_FINGER:Symbol(),ONE_FINGER_SWITCHED:Symbol(),TWO_FINGER:Symbol(),MULT_FINGER:Symbol(),CURSOR:Symbol()},l={x:0,y:0},c={camera:new n.Matrix4,gizmos:new n.Matrix4},u={type:"change"},h={type:"start"},d={type:"end"};class p extends n.EventDispatcher{constructor(e,t=null,r=null){super(),a(this,"camera"),a(this,"domElement"),a(this,"scene"),a(this,"mouseActions"),a(this,"_mouseOp"),a(this,"_v2_1"),a(this,"_v3_1"),a(this,"_v3_2"),a(this,"_m4_1"),a(this,"_m4_2"),a(this,"_quat"),a(this,"_translationMatrix"),a(this,"_rotationMatrix"),a(this,"_scaleMatrix"),a(this,"_rotationAxis"),a(this,"_cameraMatrixState"),a(this,"_cameraProjectionState"),a(this,"_fovState"),a(this,"_upState"),a(this,"_zoomState"),a(this,"_nearPos"),a(this,"_farPos"),a(this,"_gizmoMatrixState"),a(this,"_up0"),a(this,"_zoom0"),a(this,"_fov0"),a(this,"_initialNear"),a(this,"_nearPos0"),a(this,"_initialFar"),a(this,"_farPos0"),a(this,"_cameraMatrixState0"),a(this,"_gizmoMatrixState0"),a(this,"_button"),a(this,"_touchStart"),a(this,"_touchCurrent"),a(this,"_input"),a(this,"_switchSensibility"),a(this,"_startFingerDistance"),a(this,"_currentFingerDistance"),a(this,"_startFingerRotation"),a(this,"_currentFingerRotation"),a(this,"_devPxRatio"),a(this,"_downValid"),a(this,"_nclicks"),a(this,"_downEvents"),a(this,"_clickStart"),a(this,"_maxDownTime"),a(this,"_maxInterval"),a(this,"_posThreshold"),a(this,"_movementThreshold"),a(this,"_currentCursorPosition"),a(this,"_startCursorPosition"),a(this,"_grid"),a(this,"_gridPosition"),a(this,"_gizmos"),a(this,"_curvePts"),a(this,"_timeStart"),a(this,"_animationId"),a(this,"focusAnimationTime"),a(this,"_timePrev"),a(this,"_timeCurrent"),a(this,"_anglePrev"),a(this,"_angleCurrent"),a(this,"_cursorPosPrev"),a(this,"_cursorPosCurr"),a(this,"_wPrev"),a(this,"_wCurr"),a(this,"adjustNearFar"),a(this,"scaleFactor"),a(this,"dampingFactor"),a(this,"wMax"),a(this,"enableAnimations"),a(this,"enableGrid"),a(this,"cursorZoom"),a(this,"minFov"),a(this,"maxFov"),a(this,"enabled"),a(this,"enablePan"),a(this,"enableRotate"),a(this,"enableZoom"),a(this,"minDistance"),a(this,"maxDistance"),a(this,"minZoom"),a(this,"maxZoom"),a(this,"target"),a(this,"_currentTarget"),a(this,"_tbRadius"),a(this,"_state"),a(this,"onWindowResize",(()=>{const e=(this._gizmos.scale.x+this._gizmos.scale.y+this._gizmos.scale.z)/3;if(this.camera){const e=this.calculateTbRadius(this.camera);void 0!==e&&(this._tbRadius=e)}const t=this._tbRadius/e,r=new n.EllipseCurve(0,0,t,t).getPoints(this._curvePts),i=(new n.BufferGeometry).setFromPoints(r);for(const n in this._gizmos.children){this._gizmos.children[n].geometry=i}this.dispatchEvent(u)})),a(this,"onContextMenu",(e=>{if(this.enabled)for(let t=0;t<this.mouseActions.length;t++)if(2==this.mouseActions[t].mouse){e.preventDefault();break}})),a(this,"onPointerCancel",(()=>{this._touchStart.splice(0,this._touchStart.length),this._touchCurrent.splice(0,this._touchCurrent.length),this._input=o.NONE})),a(this,"onPointerDown",(e=>{if(0==e.button&&e.isPrimary?(this._downValid=!0,this._downEvents.push(e)):this._downValid=!1,"touch"==e.pointerType&&this._input!=o.CURSOR)switch(this._touchStart.push(e),this._touchCurrent.push(e),this._input){case o.NONE:this._input=o.ONE_FINGER,this.onSinglePanStart(e,"ROTATE"),window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp);break;case o.ONE_FINGER:case o.ONE_FINGER_SWITCHED:this._input=o.TWO_FINGER,this.onRotateStart(),this.onPinchStart(),this.onDoublePanStart();break;case o.TWO_FINGER:this._input=o.MULT_FINGER,this.onTriplePanStart()}else if("touch"!=e.pointerType&&this._input==o.NONE){let t=null;e.ctrlKey||e.metaKey?t="CTRL":e.shiftKey&&(t="SHIFT"),this._mouseOp=this.getOpFromAction(e.button,t),this._mouseOp&&(window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),this._input=o.CURSOR,this._button=e.button,this.onSinglePanStart(e,this._mouseOp))}})),a(this,"onPointerMove",(e=>{if("touch"==e.pointerType&&this._input!=o.CURSOR)switch(this._input){case o.ONE_FINGER:this.updateTouchEvent(e),this.onSinglePanMove(e,s.ROTATE);break;case o.ONE_FINGER_SWITCHED:if(this.calculatePointersDistance(this._touchCurrent[0],e)*this._devPxRatio>=this._switchSensibility){this._input=o.ONE_FINGER,this.updateTouchEvent(e),this.onSinglePanStart(e,"ROTATE");break}break;case o.TWO_FINGER:this.updateTouchEvent(e),this.onRotateMove(),this.onPinchMove(),this.onDoublePanMove();break;case o.MULT_FINGER:this.updateTouchEvent(e),this.onTriplePanMove()}else if("touch"!=e.pointerType&&this._input==o.CURSOR){let t=null;e.ctrlKey||e.metaKey?t="CTRL":e.shiftKey&&(t="SHIFT");const r=this.getOpStateFromAction(this._button,t);r&&this.onSinglePanMove(e,r)}if(this._downValid){this.calculatePointersDistance(this._downEvents[this._downEvents.length-1],e)*this._devPxRatio>this._movementThreshold&&(this._downValid=!1)}})),a(this,"onPointerUp",(e=>{if("touch"==e.pointerType&&this._input!=o.CURSOR){const t=this._touchCurrent.length;for(let r=0;r<t;r++)if(this._touchCurrent[r].pointerId==e.pointerId){this._touchCurrent.splice(r,1),this._touchStart.splice(r,1);break}switch(this._input){case o.ONE_FINGER:case o.ONE_FINGER_SWITCHED:window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),this._input=o.NONE,this.onSinglePanEnd();break;case o.TWO_FINGER:this.onDoublePanEnd(),this.onPinchEnd(),this.onRotateEnd(),this._input=o.ONE_FINGER_SWITCHED;break;case o.MULT_FINGER:0==this._touchCurrent.length&&(window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),this._input=o.NONE,this.onTriplePanEnd())}}else"touch"!=e.pointerType&&this._input==o.CURSOR&&(window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),this._input=o.NONE,this.onSinglePanEnd(),this._button=-1);if(e.isPrimary)if(this._downValid){if(e.timeStamp-this._downEvents[this._downEvents.length-1].timeStamp<=this._maxDownTime)if(0==this._nclicks)this._nclicks=1,this._clickStart=performance.now();else{const t=e.timeStamp-this._clickStart,r=this.calculatePointersDistance(this._downEvents[1],this._downEvents[0])*this._devPxRatio;t<=this._maxInterval&&r<=this._posThreshold?(this._nclicks=0,this._downEvents.splice(0,this._downEvents.length),this.onDoubleTap(e)):(this._nclicks=1,this._downEvents.shift(),this._clickStart=performance.now())}else this._downValid=!1,this._nclicks=0,this._downEvents.splice(0,this._downEvents.length)}else this._nclicks=0,this._downEvents.splice(0,this._downEvents.length)})),a(this,"onWheel",(e=>{var t,r;if(this.enabled&&this.enableZoom&&this.domElement){let i=null;e.ctrlKey||e.metaKey?i="CTRL":e.shiftKey&&(i="SHIFT");const a=this.getOpFromAction("WHEEL",i);if(a){e.preventDefault(),this.dispatchEvent(h);const i=125;let o=e.deltaY/i,l=1;switch(o>0?l=1/this.scaleFactor:o<0&&(l=this.scaleFactor),a){case"ZOOM":if(this.updateTbState(s.SCALE,!0),o>0?l=1/Math.pow(this.scaleFactor,o):o<0&&(l=Math.pow(this.scaleFactor,-o)),this.cursorZoom&&this.enablePan){let i;this.camera instanceof n.OrthographicCamera&&(i=null==(t=this.unprojectOnTbPlane(this.camera,e.clientX,e.clientY,this.domElement))?void 0:t.applyQuaternion(this.camera.quaternion).multiplyScalar(1/this.camera.zoom).add(this._gizmos.position)),this.camera instanceof n.PerspectiveCamera&&(i=null==(r=this.unprojectOnTbPlane(this.camera,e.clientX,e.clientY,this.domElement))?void 0:r.applyQuaternion(this.camera.quaternion).add(this._gizmos.position)),void 0!==i&&this.applyTransformMatrix(this.applyScale(l,i))}else this.applyTransformMatrix(this.applyScale(l,this._gizmos.position));this._grid&&(this.disposeGrid(),this.drawGrid()),this.updateTbState(s.IDLE,!1),this.dispatchEvent(u),this.dispatchEvent(d);break;case"FOV":if(this.camera instanceof n.PerspectiveCamera){this.updateTbState(s.FOV,!0),0!=e.deltaX&&(o=e.deltaX/i,l=1,o>0?l=1/Math.pow(this.scaleFactor,o):o<0&&(l=Math.pow(this.scaleFactor,-o))),this._v3_1.setFromMatrixPosition(this._cameraMatrixState);const t=this._v3_1.distanceTo(this._gizmos.position);let r=t/l;r=n.MathUtils.clamp(r,this.minDistance,this.maxDistance);const a=t*Math.tan(n.MathUtils.DEG2RAD*this.camera.fov*.5);let c=n.MathUtils.RAD2DEG*(2*Math.atan(a/r));c>this.maxFov?c=this.maxFov:c<this.minFov&&(c=this.minFov);l=t/(a/Math.tan(n.MathUtils.DEG2RAD*(c/2))),this.setFov(c),this.applyTransformMatrix(this.applyScale(l,this._gizmos.position,!1))}this._grid&&(this.disposeGrid(),this.drawGrid()),this.updateTbState(s.IDLE,!1),this.dispatchEvent(u),this.dispatchEvent(d)}}}})),a(this,"onSinglePanStart",((e,t)=>{if(this.enabled&&this.domElement)switch(this.dispatchEvent(h),this.setCenter(e.clientX,e.clientY),t){case"PAN":if(!this.enablePan)return;if(-1!=this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=-1,this._timeStart=-1,this.activateGizmos(!1),this.dispatchEvent(u)),this.camera){this.updateTbState(s.PAN,!0);const e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement);void 0!==e&&this._startCursorPosition.copy(e),this.enableGrid&&(this.drawGrid(),this.dispatchEvent(u))}break;case"ROTATE":if(!this.enableRotate)return;if(-1!=this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=-1,this._timeStart=-1),this.camera){this.updateTbState(s.ROTATE,!0);const e=this.unprojectOnTbSurface(this.camera,l.x,l.y,this.domElement,this._tbRadius);void 0!==e&&this._startCursorPosition.copy(e),this.activateGizmos(!0),this.enableAnimations&&(this._timePrev=this._timeCurrent=performance.now(),this._angleCurrent=this._anglePrev=0,this._cursorPosPrev.copy(this._startCursorPosition),this._cursorPosCurr.copy(this._cursorPosPrev),this._wCurr=0,this._wPrev=this._wCurr)}this.dispatchEvent(u);break;case"FOV":if(!this.enableZoom)return;this.camera instanceof n.PerspectiveCamera&&(-1!=this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=-1,this._timeStart=-1,this.activateGizmos(!1),this.dispatchEvent(u)),this.updateTbState(s.FOV,!0),this._startCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition));break;case"ZOOM":if(!this.enableZoom)return;-1!=this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=-1,this._timeStart=-1,this.activateGizmos(!1),this.dispatchEvent(u)),this.updateTbState(s.SCALE,!0),this._startCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition)}})),a(this,"onSinglePanMove",((e,t)=>{if(this.enabled&&this.domElement){const r=t!=this._state;switch(this.setCenter(e.clientX,e.clientY),t){case s.PAN:if(this.enablePan&&this.camera)if(r){this.dispatchEvent(d),this.dispatchEvent(h),this.updateTbState(t,!0);const e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement);void 0!==e&&this._startCursorPosition.copy(e),this.enableGrid&&this.drawGrid(),this.activateGizmos(!1)}else{const e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement);void 0!==e&&this._currentCursorPosition.copy(e),this.applyTransformMatrix(this.pan(this._startCursorPosition,this._currentCursorPosition))}break;case s.ROTATE:if(this.enableRotate&&this.camera)if(r){this.dispatchEvent(d),this.dispatchEvent(h),this.updateTbState(t,!0);const e=this.unprojectOnTbSurface(this.camera,l.x,l.y,this.domElement,this._tbRadius);void 0!==e&&this._startCursorPosition.copy(e),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!0)}else{const e=this.unprojectOnTbSurface(this.camera,l.x,l.y,this.domElement,this._tbRadius);void 0!==e&&this._currentCursorPosition.copy(e);const t=this._startCursorPosition.distanceTo(this._currentCursorPosition),r=this._startCursorPosition.angleTo(this._currentCursorPosition),n=Math.max(t/this._tbRadius,r);this.applyTransformMatrix(this.rotate(this.calculateRotationAxis(this._startCursorPosition,this._currentCursorPosition),n)),this.enableAnimations&&(this._timePrev=this._timeCurrent,this._timeCurrent=performance.now(),this._anglePrev=this._angleCurrent,this._angleCurrent=n,this._cursorPosPrev.copy(this._cursorPosCurr),this._cursorPosCurr.copy(this._currentCursorPosition),this._wPrev=this._wCurr,this._wCurr=this.calculateAngularSpeed(this._anglePrev,this._angleCurrent,this._timePrev,this._timeCurrent))}break;case s.SCALE:if(this.enableZoom)if(r)this.dispatchEvent(d),this.dispatchEvent(h),this.updateTbState(t,!0),this._startCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!1);else{const e=8;this._currentCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y);const t=this._currentCursorPosition.y-this._startCursorPosition.y;let r=1;t<0?r=1/Math.pow(this.scaleFactor,-t*e):t>0&&(r=Math.pow(this.scaleFactor,t*e)),this.applyTransformMatrix(this.applyScale(r,this._gizmos.position))}break;case s.FOV:if(this.enableZoom&&this.camera instanceof n.PerspectiveCamera)if(r)this.dispatchEvent(d),this.dispatchEvent(h),this.updateTbState(t,!0),this._startCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!1);else{const e=8;this._currentCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y);const t=this._currentCursorPosition.y-this._startCursorPosition.y;let r=1;t<0?r=1/Math.pow(this.scaleFactor,-t*e):t>0&&(r=Math.pow(this.scaleFactor,t*e)),this._v3_1.setFromMatrixPosition(this._cameraMatrixState);const i=this._v3_1.distanceTo(this._gizmos.position);let a=i/r;a=n.MathUtils.clamp(a,this.minDistance,this.maxDistance);const s=i*Math.tan(n.MathUtils.DEG2RAD*this._fovState*.5);let o=n.MathUtils.RAD2DEG*(2*Math.atan(s/a));o=n.MathUtils.clamp(o,this.minFov,this.maxFov);const c=s/Math.tan(n.MathUtils.DEG2RAD*(o/2));r=i/c,this._v3_2.setFromMatrixPosition(this._gizmoMatrixState),this.setFov(o),this.applyTransformMatrix(this.applyScale(r,this._v3_2,!1));const u=this._gizmos.position.clone().sub(this.camera.position).normalize().multiplyScalar(c/i);this._m4_1.makeTranslation(u.x,u.y,u.z)}}this.dispatchEvent(u)}})),a(this,"onSinglePanEnd",(()=>{if(this._state==s.ROTATE){if(!this.enableRotate)return;if(this.enableAnimations){if(performance.now()-this._timeCurrent<120){const e=Math.abs((this._wPrev+this._wCurr)/2),t=this;this._animationId=window.requestAnimationFrame((function(r){t.updateTbState(s.ANIMATION_ROTATE,!0);const n=t.calculateRotationAxis(t._cursorPosPrev,t._cursorPosCurr);t.onRotationAnim(r,n,Math.min(e,t.wMax))}))}else this.updateTbState(s.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(u)}else this.updateTbState(s.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(u)}else this._state!=s.PAN&&this._state!=s.IDLE||(this.updateTbState(s.IDLE,!1),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!1),this.dispatchEvent(u));this.dispatchEvent(d)})),a(this,"onDoubleTap",(e=>{if(this.enabled&&this.enablePan&&this.scene&&this.camera&&this.domElement){this.dispatchEvent(h),this.setCenter(e.clientX,e.clientY);const t=this.unprojectOnObj(this.getCursorNDC(l.x,l.y,this.domElement),this.camera);if(t&&this.enableAnimations){const e=this;-1!=this._animationId&&window.cancelAnimationFrame(this._animationId),this._timeStart=-1,this._animationId=window.requestAnimationFrame((function(r){e.updateTbState(s.ANIMATION_FOCUS,!0),e.onFocusAnim(r,t,e._cameraMatrixState,e._gizmoMatrixState)}))}else t&&!this.enableAnimations&&(this.updateTbState(s.FOCUS,!0),this.focus(t,this.scaleFactor),this.updateTbState(s.IDLE,!1),this.dispatchEvent(u))}this.dispatchEvent(d)})),a(this,"onDoublePanStart",(()=>{if(this.enabled&&this.enablePan&&this.camera&&this.domElement){this.dispatchEvent(h),this.updateTbState(s.PAN,!0),this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2);const e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement,!0);void 0!==e&&this._startCursorPosition.copy(e),this._currentCursorPosition.copy(this._startCursorPosition),this.activateGizmos(!1)}})),a(this,"onDoublePanMove",(()=>{if(this.enabled&&this.enablePan&&this.camera&&this.domElement){this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2),this._state!=s.PAN&&(this.updateTbState(s.PAN,!0),this._startCursorPosition.copy(this._currentCursorPosition));const e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement,!0);void 0!==e&&this._currentCursorPosition.copy(e),this.applyTransformMatrix(this.pan(this._startCursorPosition,this._currentCursorPosition,!0)),this.dispatchEvent(u)}})),a(this,"onDoublePanEnd",(()=>{this.updateTbState(s.IDLE,!1),this.dispatchEvent(d)})),a(this,"onRotateStart",(()=>{var e;this.enabled&&this.enableRotate&&(this.dispatchEvent(h),this.updateTbState(s.ZROTATE,!0),this._startFingerRotation=this.getAngle(this._touchCurrent[1],this._touchCurrent[0])+this.getAngle(this._touchStart[1],this._touchStart[0]),this._currentFingerRotation=this._startFingerRotation,null==(e=this.camera)||e.getWorldDirection(this._rotationAxis),this.enablePan||this.enableZoom||this.activateGizmos(!0))})),a(this,"onRotateMove",(()=>{var e;if(this.enabled&&this.enableRotate&&this.camera&&this.domElement){let t;this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2),this._state!=s.ZROTATE&&(this.updateTbState(s.ZROTATE,!0),this._startFingerRotation=this._currentFingerRotation),this._currentFingerRotation=this.getAngle(this._touchCurrent[1],this._touchCurrent[0])+this.getAngle(this._touchStart[1],this._touchStart[0]),this.enablePan?this.camera&&(this._v3_2.setFromMatrixPosition(this._gizmoMatrixState),t=null==(e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement))?void 0:e.applyQuaternion(this.camera.quaternion).multiplyScalar(1/this.camera.zoom).add(this._v3_2)):t=(new n.Vector3).setFromMatrixPosition(this._gizmoMatrixState);const r=n.MathUtils.DEG2RAD*(this._startFingerRotation-this._currentFingerRotation);void 0!==t&&this.applyTransformMatrix(this.zRotate(t,r)),this.dispatchEvent(u)}})),a(this,"onRotateEnd",(()=>{this.updateTbState(s.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(d)})),a(this,"onPinchStart",(()=>{this.enabled&&this.enableZoom&&(this.dispatchEvent(h),this.updateTbState(s.SCALE,!0),this._startFingerDistance=this.calculatePointersDistance(this._touchCurrent[0],this._touchCurrent[1]),this._currentFingerDistance=this._startFingerDistance,this.activateGizmos(!1))})),a(this,"onPinchMove",(()=>{var e,t;if(this.enabled&&this.enableZoom&&this.domElement){this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2);const r=12;this._state!=s.SCALE&&(this._startFingerDistance=this._currentFingerDistance,this.updateTbState(s.SCALE,!0)),this._currentFingerDistance=Math.max(this.calculatePointersDistance(this._touchCurrent[0],this._touchCurrent[1]),r*this._devPxRatio);const i=this._currentFingerDistance/this._startFingerDistance;let a;this.enablePan?this.camera instanceof n.OrthographicCamera?a=null==(e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement))?void 0:e.applyQuaternion(this.camera.quaternion).multiplyScalar(1/this.camera.zoom).add(this._gizmos.position):this.camera instanceof n.PerspectiveCamera&&(a=null==(t=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement))?void 0:t.applyQuaternion(this.camera.quaternion).add(this._gizmos.position)):a=this._gizmos.position,void 0!==a&&this.applyTransformMatrix(this.applyScale(i,a)),this.dispatchEvent(u)}})),a(this,"onPinchEnd",(()=>{this.updateTbState(s.IDLE,!1),this.dispatchEvent(d)})),a(this,"onTriplePanStart",(()=>{if(this.enabled&&this.enableZoom&&this.domElement){this.dispatchEvent(h),this.updateTbState(s.SCALE,!0);let e=0,t=0;const r=this._touchCurrent.length;for(let n=0;n<r;n++)e+=this._touchCurrent[n].clientX,t+=this._touchCurrent[n].clientY;this.setCenter(e/r,t/r),this._startCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition)}})),a(this,"onTriplePanMove",(()=>{if(this.enabled&&this.enableZoom&&this.camera&&this.domElement){let e=0,t=0;const r=this._touchCurrent.length;for(let n=0;n<r;n++)e+=this._touchCurrent[n].clientX,t+=this._touchCurrent[n].clientY;this.setCenter(e/r,t/r);const i=8;this._currentCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y);const a=this._currentCursorPosition.y-this._startCursorPosition.y;let s=1;a<0?s=1/Math.pow(this.scaleFactor,-a*i):a>0&&(s=Math.pow(this.scaleFactor,a*i)),this._v3_1.setFromMatrixPosition(this._cameraMatrixState);const o=this._v3_1.distanceTo(this._gizmos.position);let c=o/s;c=n.MathUtils.clamp(c,this.minDistance,this.maxDistance);const h=o*Math.tan(n.MathUtils.DEG2RAD*this._fovState*.5);let d=n.MathUtils.RAD2DEG*(2*Math.atan(h/c));d=n.MathUtils.clamp(d,this.minFov,this.maxFov);const p=h/Math.tan(n.MathUtils.DEG2RAD*(d/2));s=o/p,this._v3_2.setFromMatrixPosition(this._gizmoMatrixState),this.setFov(d),this.applyTransformMatrix(this.applyScale(s,this._v3_2,!1));const f=this._gizmos.position.clone().sub(this.camera.position).normalize().multiplyScalar(p/o);this._m4_1.makeTranslation(f.x,f.y,f.z),this.dispatchEvent(u)}})),a(this,"onTriplePanEnd",(()=>{this.updateTbState(s.IDLE,!1),this.dispatchEvent(d)})),a(this,"setCenter",((e,t)=>{l.x=e,l.y=t})),a(this,"initializeMouseActions",(()=>{this.setMouseAction("PAN",0,"CTRL"),this.setMouseAction("PAN",2),this.setMouseAction("ROTATE",0),this.setMouseAction("ZOOM","WHEEL"),this.setMouseAction("ZOOM",1),this.setMouseAction("FOV","WHEEL","SHIFT"),this.setMouseAction("FOV",1,"SHIFT")})),a(this,"setMouseAction",((e,t,r=null)=>{let n;if(!["PAN","ROTATE","ZOOM","FOV"].includes(e)||![0,1,2,"WHEEL"].includes(t)||!["CTRL","SHIFT",null].includes(r))return!1;if("WHEEL"==t&&"ZOOM"!=e&&"FOV"!=e)return!1;switch(e){case"PAN":n=s.PAN;break;case"ROTATE":n=s.ROTATE;break;case"ZOOM":n=s.SCALE;break;case"FOV":n=s.FOV}const i={operation:e,mouse:t,key:r,state:n};for(let a=0;a<this.mouseActions.length;a++)if(this.mouseActions[a].mouse==i.mouse&&this.mouseActions[a].key==i.key)return this.mouseActions.splice(a,1,i),!0;return this.mouseActions.push(i),!0})),a(this,"getOpFromAction",((e,t)=>{let r;for(let n=0;n<this.mouseActions.length;n++)if(r=this.mouseActions[n],r.mouse==e&&r.key==t)return r.operation;if(t)for(let n=0;n<this.mouseActions.length;n++)if(r=this.mouseActions[n],r.mouse==e&&null==r.key)return r.operation;return null})),a(this,"getOpStateFromAction",((e,t)=>{let r;for(let n=0;n<this.mouseActions.length;n++)if(r=this.mouseActions[n],r.mouse==e&&r.key==t)return r.state;if(t)for(let n=0;n<this.mouseActions.length;n++)if(r=this.mouseActions[n],r.mouse==e&&null==r.key)return r.state;return null})),a(this,"getAngle",((e,t)=>180*Math.atan2(t.clientY-e.clientY,t.clientX-e.clientX)/Math.PI)),a(this,"updateTouchEvent",(e=>{for(let t=0;t<this._touchCurrent.length;t++)if(this._touchCurrent[t].pointerId==e.pointerId){this._touchCurrent.splice(t,1,e);break}})),a(this,"calculateAngularSpeed",((e,t,r,n)=>{const i=(n-r)/1e3;return 0==i?0:(t-e)/i})),a(this,"calculatePointersDistance",((e,t)=>Math.sqrt(Math.pow(t.clientX-e.clientX,2)+Math.pow(t.clientY-e.clientY,2)))),a(this,"calculateRotationAxis",((e,t)=>(this._rotationMatrix.extractRotation(this._cameraMatrixState),this._quat.setFromRotationMatrix(this._rotationMatrix),this._rotationAxis.crossVectors(e,t).applyQuaternion(this._quat),this._rotationAxis.normalize().clone()))),a(this,"calculateTbRadius",(e=>{const t=e.position.distanceTo(this._gizmos.position);if(e instanceof n.PerspectiveCamera){const r=n.MathUtils.DEG2RAD*e.fov*.5,i=Math.atan(e.aspect*Math.tan(r));return Math.tan(Math.min(r,i))*t*.67}if(e instanceof n.OrthographicCamera)return.67*Math.min(e.top,e.right)})),a(this,"focus",((e,t,r=1)=>{if(this.camera){const n=e.clone();n.sub(this._gizmos.position).multiplyScalar(r),this._translationMatrix.makeTranslation(n.x,n.y,n.z);const i=this._gizmoMatrixState.clone();this._gizmoMatrixState.premultiply(this._translationMatrix),this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale);const a=this._cameraMatrixState.clone();this._cameraMatrixState.premultiply(this._translationMatrix),this._cameraMatrixState.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.enableZoom&&this.applyTransformMatrix(this.applyScale(t,this._gizmos.position)),this._gizmoMatrixState.copy(i),this._cameraMatrixState.copy(a)}})),a(this,"drawGrid",(()=>{if(this.scene){const e=8947848,t=3;let r,i,a,s;if(this.camera instanceof n.OrthographicCamera){const e=this.camera.right-this.camera.left,n=this.camera.bottom-this.camera.top;a=Math.max(e,n),s=a/20,r=a/this.camera.zoom*t,i=r/s*this.camera.zoom}else if(this.camera instanceof n.PerspectiveCamera){const e=this.camera.position.distanceTo(this._gizmos.position),o=n.MathUtils.DEG2RAD*this.camera.fov*.5,l=Math.atan(this.camera.aspect*Math.tan(o));a=Math.tan(Math.max(o,l))*e*2,s=a/20,r=a*t,i=r/s}null==this._grid&&this.camera&&(this._grid=new n.GridHelper(r,i,e,e),this._grid.position.copy(this._gizmos.position),this._gridPosition.copy(this._grid.position),this._grid.quaternion.copy(this.camera.quaternion),this._grid.rotateX(.5*Math.PI),this.scene.add(this._grid))}})),a(this,"connect",(e=>{e===document&&console.error('THREE.ArcballControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.domElement=e,this.domElement.style.touchAction="none",this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointercancel",this.onPointerCancel),this.domElement.addEventListener("wheel",this.onWheel)})),a(this,"dispose",(()=>{var e,t,r,n,i;-1!=this._animationId&&window.cancelAnimationFrame(this._animationId),null==(e=this.domElement)||e.removeEventListener("pointerdown",this.onPointerDown),null==(t=this.domElement)||t.removeEventListener("pointercancel",this.onPointerCancel),null==(r=this.domElement)||r.removeEventListener("wheel",this.onWheel),null==(n=this.domElement)||n.removeEventListener("contextmenu",this.onContextMenu),window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),null==(i=this.scene)||i.remove(this._gizmos),this.disposeGrid()})),a(this,"disposeGrid",(()=>{this._grid&&this.scene&&(this.scene.remove(this._grid),this._grid=null)})),a(this,"easeOutCubic",(e=>1-Math.pow(1-e,3))),a(this,"activateGizmos",(e=>{for(const t of this._gizmos.children)t.material.setValues({opacity:e?1:.6})})),a(this,"getCursorNDC",((e,t,r)=>{const n=r.getBoundingClientRect();return this._v2_1.setX((e-n.left)/n.width*2-1),this._v2_1.setY((n.bottom-t)/n.height*2-1),this._v2_1.clone()})),a(this,"getCursorPosition",((e,t,r)=>(this._v2_1.copy(this.getCursorNDC(e,t,r)),this.camera instanceof n.OrthographicCamera&&(this._v2_1.x*=.5*(this.camera.right-this.camera.left),this._v2_1.y*=.5*(this.camera.top-this.camera.bottom)),this._v2_1.clone()))),a(this,"setCamera",(e=>{if(e){e.lookAt(this.target),e.updateMatrix(),e instanceof n.PerspectiveCamera&&(this._fov0=e.fov,this._fovState=e.fov),this._cameraMatrixState0.copy(e.matrix),this._cameraMatrixState.copy(this._cameraMatrixState0),this._cameraProjectionState.copy(e.projectionMatrix),this._zoom0=e.zoom,this._zoomState=this._zoom0,this._initialNear=e.near,this._nearPos0=e.position.distanceTo(this.target)-e.near,this._nearPos=this._initialNear,this._initialFar=e.far,this._farPos0=e.position.distanceTo(this.target)-e.far,this._farPos=this._initialFar,this._up0.copy(e.up),this._upState.copy(e.up),this.camera=e,this.camera.updateProjectionMatrix();const t=this.calculateTbRadius(e);void 0!==t&&(this._tbRadius=t),this.makeGizmos(this.target,this._tbRadius)}})),a(this,"makeGizmos",((e,t)=>{const r=new n.EllipseCurve(0,0,t,t).getPoints(this._curvePts),i=(new n.BufferGeometry).setFromPoints(r),a=new n.LineBasicMaterial({color:16744576,fog:!1,transparent:!0,opacity:.6}),s=new n.LineBasicMaterial({color:8454016,fog:!1,transparent:!0,opacity:.6}),o=new n.LineBasicMaterial({color:8421631,fog:!1,transparent:!0,opacity:.6}),l=new n.Line(i,a),c=new n.Line(i,s),u=new n.Line(i,o),h=.5*Math.PI;if(l.rotation.x=h,c.rotation.y=h,this._gizmoMatrixState0.identity().setPosition(e),this._gizmoMatrixState.copy(this._gizmoMatrixState0),this.camera&&1!=this.camera.zoom){const t=1/this.camera.zoom;this._scaleMatrix.makeScale(t,t,t),this._translationMatrix.makeTranslation(-e.x,-e.y,-e.z),this._gizmoMatrixState.premultiply(this._translationMatrix).premultiply(this._scaleMatrix),this._translationMatrix.makeTranslation(e.x,e.y,e.z),this._gizmoMatrixState.premultiply(this._translationMatrix)}this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this._gizmos.clear(),this._gizmos.add(l),this._gizmos.add(c),this._gizmos.add(u)})),a(this,"onFocusAnim",((e,t,r,n)=>{if(-1==this._timeStart&&(this._timeStart=e),this._state==s.ANIMATION_FOCUS){const i=(e-this._timeStart)/this.focusAnimationTime;if(this._gizmoMatrixState.copy(n),i>=1)this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this.focus(t,this.scaleFactor),this._timeStart=-1,this.updateTbState(s.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(u);else{const e=this.easeOutCubic(i),a=1-e+this.scaleFactor*e;this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this.focus(t,a,e),this.dispatchEvent(u);const s=this;this._animationId=window.requestAnimationFrame((function(e){s.onFocusAnim(e,t,r,n.clone())}))}}else this._animationId=-1,this._timeStart=-1})),a(this,"onRotationAnim",((e,t,r)=>{if(-1==this._timeStart&&(this._anglePrev=0,this._angleCurrent=0,this._timeStart=e),this._state==s.ANIMATION_ROTATE){const n=(e-this._timeStart)/1e3;if(r+-this.dampingFactor*n>0){this._angleCurrent=.5*-this.dampingFactor*Math.pow(n,2)+r*n+0,this.applyTransformMatrix(this.rotate(t,this._angleCurrent)),this.dispatchEvent(u);const e=this;this._animationId=window.requestAnimationFrame((function(n){e.onRotationAnim(n,t,r)}))}else this._animationId=-1,this._timeStart=-1,this.updateTbState(s.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(u)}else this._animationId=-1,this._timeStart=-1,this._state!=s.ROTATE&&(this.activateGizmos(!1),this.dispatchEvent(u))})),a(this,"pan",((e,t,r=!1)=>{if(this.camera){const i=e.clone().sub(t);if(this.camera instanceof n.OrthographicCamera&&i.multiplyScalar(1/this.camera.zoom),this.camera instanceof n.PerspectiveCamera&&r){this._v3_1.setFromMatrixPosition(this._cameraMatrixState0),this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0);const e=this._v3_1.distanceTo(this._v3_2)/this.camera.position.distanceTo(this._gizmos.position);i.multiplyScalar(1/e)}this._v3_1.set(i.x,i.y,0).applyQuaternion(this.camera.quaternion),this._m4_1.makeTranslation(this._v3_1.x,this._v3_1.y,this._v3_1.z),this.setTransformationMatrices(this._m4_1,this._m4_1)}return c})),a(this,"reset",(()=>{if(this.camera){this.camera.zoom=this._zoom0,this.camera instanceof n.PerspectiveCamera&&(this.camera.fov=this._fov0),this.camera.near=this._nearPos,this.camera.far=this._farPos,this._cameraMatrixState.copy(this._cameraMatrixState0),this._cameraMatrixState.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.up.copy(this._up0),this.camera.updateMatrix(),this.camera.updateProjectionMatrix(),this._gizmoMatrixState.copy(this._gizmoMatrixState0),this._gizmoMatrixState0.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this._gizmos.updateMatrix();const e=this.calculateTbRadius(this.camera);void 0!==e&&(this._tbRadius=e),this.makeGizmos(this._gizmos.position,this._tbRadius),this.camera.lookAt(this._gizmos.position),this.updateTbState(s.IDLE,!1),this.dispatchEvent(u)}})),a(this,"rotate",((e,t)=>{const r=this._gizmos.position;return this._translationMatrix.makeTranslation(-r.x,-r.y,-r.z),this._rotationMatrix.makeRotationAxis(e,-t),this._m4_1.makeTranslation(r.x,r.y,r.z),this._m4_1.multiply(this._rotationMatrix),this._m4_1.multiply(this._translationMatrix),this.setTransformationMatrices(this._m4_1),c})),a(this,"copyState",(()=>{if(this.camera){const e=JSON.stringify(this.camera instanceof n.OrthographicCamera?{arcballState:{cameraFar:this.camera.far,cameraMatrix:this.camera.matrix,cameraNear:this.camera.near,cameraUp:this.camera.up,cameraZoom:this.camera.zoom,gizmoMatrix:this._gizmos.matrix}}:{arcballState:{cameraFar:this.camera.far,cameraFov:this.camera.fov,cameraMatrix:this.camera.matrix,cameraNear:this.camera.near,cameraUp:this.camera.up,cameraZoom:this.camera.zoom,gizmoMatrix:this._gizmos.matrix}});navigator.clipboard.writeText(e)}})),a(this,"pasteState",(()=>{const e=this;navigator.clipboard.readText().then((function(t){e.setStateFromJSON(t)}))})),a(this,"saveState",(()=>{this.camera&&(this._cameraMatrixState0.copy(this.camera.matrix),this._gizmoMatrixState0.copy(this._gizmos.matrix),this._nearPos=this.camera.near,this._farPos=this.camera.far,this._zoom0=this.camera.zoom,this._up0.copy(this.camera.up),this.camera instanceof n.PerspectiveCamera&&(this._fov0=this.camera.fov))})),a(this,"applyScale",((e,t,r=!0)=>{if(!this.camera)return;const i=t.clone();let a=1/e;if(this.camera instanceof n.OrthographicCamera){this.camera.zoom=this._zoomState,this.camera.zoom*=e,this.camera.zoom>this.maxZoom?(this.camera.zoom=this.maxZoom,a=this._zoomState/this.maxZoom):this.camera.zoom<this.minZoom&&(this.camera.zoom=this.minZoom,a=this._zoomState/this.minZoom),this.camera.updateProjectionMatrix(),this._v3_1.setFromMatrixPosition(this._gizmoMatrixState),this._scaleMatrix.makeScale(a,a,a),this._translationMatrix.makeTranslation(-this._v3_1.x,-this._v3_1.y,-this._v3_1.z),this._m4_2.makeTranslation(this._v3_1.x,this._v3_1.y,this._v3_1.z).multiply(this._scaleMatrix),this._m4_2.multiply(this._translationMatrix),i.sub(this._v3_1);const t=i.clone().multiplyScalar(a);return i.sub(t),this._m4_1.makeTranslation(i.x,i.y,i.z),this._m4_2.premultiply(this._m4_1),this.setTransformationMatrices(this._m4_1,this._m4_2),c}if(this.camera instanceof n.PerspectiveCamera){this._v3_1.setFromMatrixPosition(this._cameraMatrixState),this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);let e=this._v3_1.distanceTo(i),t=e-e*a;const n=e-t;n<this.minDistance?(a=this.minDistance/e,t=e-e*a):n>this.maxDistance&&(a=this.maxDistance/e,t=e-e*a);let s=i.clone().sub(this._v3_1).normalize().multiplyScalar(t);if(this._m4_1.makeTranslation(s.x,s.y,s.z),r){const r=this._v3_2;e=r.distanceTo(i),t=e-e*a,s=i.clone().sub(this._v3_2).normalize().multiplyScalar(t),this._translationMatrix.makeTranslation(r.x,r.y,r.z),this._scaleMatrix.makeScale(a,a,a),this._m4_2.makeTranslation(s.x,s.y,s.z).multiply(this._translationMatrix),this._m4_2.multiply(this._scaleMatrix),this._translationMatrix.makeTranslation(-r.x,-r.y,-r.z),this._m4_2.multiply(this._translationMatrix),this.setTransformationMatrices(this._m4_1,this._m4_2)}else this.setTransformationMatrices(this._m4_1);return c}})),a(this,"setFov",(e=>{this.camera instanceof n.PerspectiveCamera&&(this.camera.fov=n.MathUtils.clamp(e,this.minFov,this.maxFov),this.camera.updateProjectionMatrix())})),a(this,"setTarget",((e,t,r)=>{if(this.camera){this.target.set(e,t,r),this._gizmos.position.set(e,t,r);const n=this.calculateTbRadius(this.camera);void 0!==n&&(this._tbRadius=n),this.makeGizmos(this.target,this._tbRadius),this.camera.lookAt(this.target)}})),a(this,"zRotate",((e,t)=>(this._rotationMatrix.makeRotationAxis(this._rotationAxis,t),this._translationMatrix.makeTranslation(-e.x,-e.y,-e.z),this._m4_1.makeTranslation(e.x,e.y,e.z),this._m4_1.multiply(this._rotationMatrix),this._m4_1.multiply(this._translationMatrix),this._v3_1.setFromMatrixPosition(this._gizmoMatrixState).sub(e),this._v3_2.copy(this._v3_1).applyAxisAngle(this._rotationAxis,t),this._v3_2.sub(this._v3_1),this._m4_2.makeTranslation(this._v3_2.x,this._v3_2.y,this._v3_2.z),this.setTransformationMatrices(this._m4_1,this._m4_2),c))),a(this,"unprojectOnObj",((e,t)=>{if(!this.scene)return null;const r=new n.Raycaster;r.near=t.near,r.far=t.far,r.setFromCamera(e,t);const i=r.intersectObjects(this.scene.children,!0);for(let n=0;n<i.length;n++)if(i[n].object.uuid!=this._gizmos.uuid&&i[n].face)return i[n].point.clone();return null})),a(this,"unprojectOnTbSurface",((e,t,r,i,a)=>{if(e instanceof n.OrthographicCamera){this._v2_1.copy(this.getCursorPosition(t,r,i)),this._v3_1.set(this._v2_1.x,this._v2_1.y,0);const e=Math.pow(this._v2_1.x,2),n=Math.pow(this._v2_1.y,2),a=Math.pow(this._tbRadius,2);return e+n<=.5*a?this._v3_1.setZ(Math.sqrt(a-(e+n))):this._v3_1.setZ(.5*a/Math.sqrt(e+n)),this._v3_1}if(e instanceof n.PerspectiveCamera){this._v2_1.copy(this.getCursorNDC(t,r,i)),this._v3_1.set(this._v2_1.x,this._v2_1.y,-1),this._v3_1.applyMatrix4(e.projectionMatrixInverse);const s=this._v3_1.clone().normalize(),o=e.position.distanceTo(this._gizmos.position),l=Math.pow(a,2),c=this._v3_1.z,u=Math.sqrt(Math.pow(this._v3_1.x,2)+Math.pow(this._v3_1.y,2));if(0==u)return s.set(this._v3_1.x,this._v3_1.y,a),s;const h=c/u,d=o;let p=Math.pow(h,2)+1,f=2*h*d,m=Math.pow(d,2)-l,g=Math.pow(f,2)-4*p*m;if(g>=0){this._v2_1.setX((-f-Math.sqrt(g))/(2*p)),this._v2_1.setY(h*this._v2_1.x+d);if(n.MathUtils.RAD2DEG*this._v2_1.angle()>=45){const e=Math.sqrt(Math.pow(this._v2_1.x,2)+Math.pow(o-this._v2_1.y,2));return s.multiplyScalar(e),s.z+=o,s}}p=h,f=d,m=.5*-l,g=Math.pow(f,2)-4*p*m,this._v2_1.setX((-f-Math.sqrt(g))/(2*p)),this._v2_1.setY(h*this._v2_1.x+d);const v=Math.sqrt(Math.pow(this._v2_1.x,2)+Math.pow(o-this._v2_1.y,2));return s.multiplyScalar(v),s.z+=o,s}})),a(this,"unprojectOnTbPlane",((e,t,r,i,a=!1)=>{if(e instanceof n.OrthographicCamera)return this._v2_1.copy(this.getCursorPosition(t,r,i)),this._v3_1.set(this._v2_1.x,this._v2_1.y,0),this._v3_1.clone();if(e instanceof n.PerspectiveCamera){this._v2_1.copy(this.getCursorNDC(t,r,i)),this._v3_1.set(this._v2_1.x,this._v2_1.y,-1),this._v3_1.applyMatrix4(e.projectionMatrixInverse);const n=this._v3_1.clone().normalize(),s=this._v3_1.z,o=Math.sqrt(Math.pow(this._v3_1.x,2)+Math.pow(this._v3_1.y,2));let l;if(l=a?this._v3_1.setFromMatrixPosition(this._cameraMatrixState0).distanceTo(this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0)):e.position.distanceTo(this._gizmos.position),0==o)return n.set(0,0,0),n;const c=l,u=-c/(s/o),h=Math.sqrt(Math.pow(c,2)+Math.pow(u,2));return n.multiplyScalar(h),n.z=0,n}})),a(this,"updateMatrixState",(()=>{this.camera&&(this._cameraMatrixState.copy(this.camera.matrix),this._gizmoMatrixState.copy(this._gizmos.matrix),this.camera instanceof n.OrthographicCamera&&(this._cameraProjectionState.copy(this.camera.projectionMatrix),this.camera.updateProjectionMatrix(),this._zoomState=this.camera.zoom),this.camera instanceof n.PerspectiveCamera&&(this._fovState=this.camera.fov))})),a(this,"updateTbState",((e,t)=>{this._state=e,t&&this.updateMatrixState()})),a(this,"update",(()=>{const e=1e-6;if(!this.target.equals(this._currentTarget)&&this.camera){this._gizmos.position.set(this.target.x,this.target.y,this.target.z);const e=this.calculateTbRadius(this.camera);void 0!==e&&(this._tbRadius=e),this.makeGizmos(this.target,this._tbRadius),this._currentTarget.copy(this.target)}if(this.camera){if(this.camera instanceof n.OrthographicCamera&&(this.camera.zoom>this.maxZoom||this.camera.zoom<this.minZoom)){const e=n.MathUtils.clamp(this.camera.zoom,this.minZoom,this.maxZoom);this.applyTransformMatrix(this.applyScale(e/this.camera.zoom,this._gizmos.position,!0))}if(this.camera instanceof n.PerspectiveCamera){const t=this.camera.position.distanceTo(this._gizmos.position);if(t>this.maxDistance+e||t<this.minDistance-e){const e=n.MathUtils.clamp(t,this.minDistance,this.maxDistance);this.applyTransformMatrix(this.applyScale(e/t,this._gizmos.position)),this.updateMatrixState()}(this.camera.fov<this.minFov||this.camera.fov>this.maxFov)&&(this.camera.fov=n.MathUtils.clamp(this.camera.fov,this.minFov,this.maxFov),this.camera.updateProjectionMatrix());const r=this._tbRadius,i=this.calculateTbRadius(this.camera);if(void 0!==i&&(this._tbRadius=i),r<this._tbRadius-e||r>this._tbRadius+e){const e=(this._gizmos.scale.x+this._gizmos.scale.y+this._gizmos.scale.z)/3,t=this._tbRadius/e,r=new n.EllipseCurve(0,0,t,t).getPoints(this._curvePts),i=(new n.BufferGeometry).setFromPoints(r);for(const n in this._gizmos.children){this._gizmos.children[n].geometry=i}}}this.camera.lookAt(this._gizmos.position)}})),a(this,"setStateFromJSON",(e=>{const t=JSON.parse(e);if(t.arcballState&&this.camera){this._cameraMatrixState.fromArray(t.arcballState.cameraMatrix.elements),this._cameraMatrixState.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.up.copy(t.arcballState.cameraUp),this.camera.near=t.arcballState.cameraNear,this.camera.far=t.arcballState.cameraFar,this.camera.zoom=t.arcballState.cameraZoom,this.camera instanceof n.PerspectiveCamera&&(this.camera.fov=t.arcballState.cameraFov),this._gizmoMatrixState.fromArray(t.arcballState.gizmoMatrix.elements),this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this.camera.updateMatrix(),this.camera.updateProjectionMatrix(),this._gizmos.updateMatrix();const e=this.calculateTbRadius(this.camera);void 0!==e&&(this._tbRadius=e);const r=(new n.Matrix4).copy(this._gizmoMatrixState0);this.makeGizmos(this._gizmos.position,this._tbRadius),this._gizmoMatrixState0.copy(r),this.camera.lookAt(this._gizmos.position),this.updateTbState(s.IDLE,!1),this.dispatchEvent(u)}})),this.camera=null,this.domElement=t,this.scene=r,this.mouseActions=[],this._mouseOp=null,this._v2_1=new n.Vector2,this._v3_1=new n.Vector3,this._v3_2=new n.Vector3,this._m4_1=new n.Matrix4,this._m4_2=new n.Matrix4,this._quat=new n.Quaternion,this._translationMatrix=new n.Matrix4,this._rotationMatrix=new n.Matrix4,this._scaleMatrix=new n.Matrix4,this._rotationAxis=new n.Vector3,this._cameraMatrixState=new n.Matrix4,this._cameraProjectionState=new n.Matrix4,this._fovState=1,this._upState=new n.Vector3,this._zoomState=1,this._nearPos=0,this._farPos=0,this._gizmoMatrixState=new n.Matrix4,this._up0=new n.Vector3,this._zoom0=1,this._fov0=0,this._initialNear=0,this._nearPos0=0,this._initialFar=0,this._farPos0=0,this._cameraMatrixState0=new n.Matrix4,this._gizmoMatrixState0=new n.Matrix4,this._button=-1,this._touchStart=[],this._touchCurrent=[],this._input=o.NONE,this._switchSensibility=32,this._startFingerDistance=0,this._currentFingerDistance=0,this._startFingerRotation=0,this._currentFingerRotation=0,this._devPxRatio=0,this._downValid=!0,this._nclicks=0,this._downEvents=[],this._clickStart=0,this._maxDownTime=250,this._maxInterval=300,this._posThreshold=24,this._movementThreshold=24,this._currentCursorPosition=new n.Vector3,this._startCursorPosition=new n.Vector3,this._grid=null,this._gridPosition=new n.Vector3,this._gizmos=new n.Group,this._curvePts=128,this._timeStart=-1,this._animationId=-1,this.focusAnimationTime=500,this._timePrev=0,this._timeCurrent=0,this._anglePrev=0,this._angleCurrent=0,this._cursorPosPrev=new n.Vector3,this._cursorPosCurr=new n.Vector3,this._wPrev=0,this._wCurr=0,this.adjustNearFar=!1,this.scaleFactor=1.1,this.dampingFactor=25,this.wMax=20,this.enableAnimations=!0,this.enableGrid=!1,this.cursorZoom=!1,this.minFov=5,this.maxFov=90,this.enabled=!0,this.enablePan=!0,this.enableRotate=!0,this.enableZoom=!0,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.target=new n.Vector3(0,0,0),this._currentTarget=new n.Vector3(0,0,0),this._tbRadius=1,this._state=s.IDLE,this.setCamera(e),this.scene&&this.scene.add(this._gizmos),this._devPxRatio=window.devicePixelRatio,this.initializeMouseActions(),this.domElement&&this.connect(this.domElement),window.addEventListener("resize",this.onWindowResize)}applyTransformMatrix(e){if((null==e?void 0:e.camera)&&this.camera&&(this._m4_1.copy(this._cameraMatrixState).premultiply(e.camera),this._m4_1.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.updateMatrix(),this._state!=s.ROTATE&&this._state!=s.ZROTATE&&this._state!=s.ANIMATION_ROTATE||this.camera.up.copy(this._upState).applyQuaternion(this.camera.quaternion)),(null==e?void 0:e.gizmos)&&(this._m4_1.copy(this._gizmoMatrixState).premultiply(e.gizmos),this._m4_1.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this._gizmos.updateMatrix()),(this._state==s.SCALE||this._state==s.FOCUS||this._state==s.ANIMATION_FOCUS)&&this.camera){const e=this.calculateTbRadius(this.camera);if(void 0!==e&&(this._tbRadius=e),this.adjustNearFar){const e=this.camera.position.distanceTo(this._gizmos.position),t=new n.Box3;t.setFromObject(this._gizmos);const r=new n.Sphere;t.getBoundingSphere(r);const i=Math.max(this._nearPos0,r.radius+r.center.length()),a=e-this._initialNear,s=Math.min(i,a);this.camera.near=e-s;const o=Math.min(this._farPos0,-r.radius+r.center.length()),l=e-this._initialFar,c=Math.min(o,l);this.camera.far=e-c,this.camera.updateProjectionMatrix()}else{let e=!1;this.camera.near!=this._initialNear&&(this.camera.near=this._initialNear,e=!0),this.camera.far!=this._initialFar&&(this.camera.far=this._initialFar,e=!0),e&&this.camera.updateProjectionMatrix()}}}setGizmosVisible(e){this._gizmos.visible=e,this.dispatchEvent(u)}setTransformationMatrices(e=null,t=null){e?c.camera?c.camera.copy(e):c.camera=e.clone():c.camera=null,t?c.gizmos?c.gizmos.copy(t):c.gizmos=t.clone():c.gizmos=null}}},41743:(e,t,r)=>{"use strict";r.d(t,{W:()=>s});var n=r(99477),i=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class s extends n.EventDispatcher{constructor(e){super(),a(this,"object"),a(this,"changeEvent",{type:"change"}),a(this,"EPS",1e-6),a(this,"enabled",!0),a(this,"deviceOrientation",{alpha:0,beta:0,gamma:0}),a(this,"screenOrientation",0),a(this,"alphaOffset",0),a(this,"onDeviceOrientationChangeEvent",(e=>{this.deviceOrientation=e})),a(this,"onScreenOrientationChangeEvent",(()=>{this.screenOrientation=window.orientation||0})),a(this,"zee",new n.Vector3(0,0,1)),a(this,"euler",new n.Euler),a(this,"q0",new n.Quaternion),a(this,"q1",new n.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5))),a(this,"setObjectQuaternion",((e,t,r,n,i)=>{this.euler.set(r,t,-n,"YXZ"),e.setFromEuler(this.euler),e.multiply(this.q1),e.multiply(this.q0.setFromAxisAngle(this.zee,-i))})),a(this,"connect",(()=>{this.onScreenOrientationChangeEvent(),void 0!==window.DeviceOrientationEvent&&"function"==typeof window.DeviceOrientationEvent.requestPermission?window.DeviceOrientationEvent.requestPermission().then((e=>{"granted"==e&&(window.addEventListener("orientationchange",this.onScreenOrientationChangeEvent),window.addEventListener("deviceorientation",this.onDeviceOrientationChangeEvent))})).catch((e=>{console.error("THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:",e)})):(window.addEventListener("orientationchange",this.onScreenOrientationChangeEvent),window.addEventListener("deviceorientation",this.onDeviceOrientationChangeEvent)),this.enabled=!0})),a(this,"disconnect",(()=>{window.removeEventListener("orientationchange",this.onScreenOrientationChangeEvent),window.removeEventListener("deviceorientation",this.onDeviceOrientationChangeEvent),this.enabled=!1})),a(this,"lastQuaternion",new n.Quaternion),a(this,"update",(()=>{if(!1===this.enabled)return;const e=this.deviceOrientation;if(e){const t=e.alpha?n.MathUtils.degToRad(e.alpha)+this.alphaOffset:0,r=e.beta?n.MathUtils.degToRad(e.beta):0,i=e.gamma?n.MathUtils.degToRad(e.gamma):0,a=this.screenOrientation?n.MathUtils.degToRad(this.screenOrientation):0;this.setObjectQuaternion(this.object.quaternion,t,r,i,a),8*(1-this.lastQuaternion.dot(this.object.quaternion))>this.EPS&&(this.lastQuaternion.copy(this.object.quaternion),this.dispatchEvent(this.changeEvent))}})),a(this,"dispose",(()=>this.disconnect())),this.object=e,this.object.rotation.reorder("YXZ"),this.connect()}}},55259:(e,t,r)=>{"use strict";r.d(t,{o:()=>o});var n=r(99477),i=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const s=new n.Vector3;class o extends n.EventDispatcher{constructor(e,t){super(),a(this,"object"),a(this,"domElement"),a(this,"enabled",!0),a(this,"movementSpeed",1),a(this,"lookSpeed",.005),a(this,"lookVertical",!0),a(this,"autoForward",!1),a(this,"activeLook",!0),a(this,"heightSpeed",!1),a(this,"heightCoef",1),a(this,"heightMin",0),a(this,"heightMax",1),a(this,"constrainVertical",!1),a(this,"verticalMin",0),a(this,"verticalMax",Math.PI),a(this,"mouseDragOn",!1),a(this,"autoSpeedFactor",0),a(this,"mouseX",0),a(this,"mouseY",0),a(this,"moveForward",!1),a(this,"moveBackward",!1),a(this,"moveLeft",!1),a(this,"moveRight",!1),a(this,"moveUp",!1),a(this,"moveDown",!1),a(this,"viewHalfX",0),a(this,"viewHalfY",0),a(this,"lat",0),a(this,"lon",0),a(this,"lookDirection",new n.Vector3),a(this,"spherical",new n.Spherical),a(this,"target",new n.Vector3),a(this,"connect",(e=>{e.setAttribute("tabindex","-1"),e.style.touchAction="none",e.addEventListener("contextmenu",this.contextmenu),e.addEventListener("mousemove",this.onMouseMove),e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),this.domElement=e,window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.handleResize()})),a(this,"dispose",(()=>{var e,t,r,n;null==(e=this.domElement)||e.removeEventListener("contextmenu",this.contextmenu),null==(t=this.domElement)||t.removeEventListener("mousedown",this.onMouseDown),null==(r=this.domElement)||r.removeEventListener("mousemove",this.onMouseMove),null==(n=this.domElement)||n.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)})),a(this,"handleResize",(()=>{this.domElement&&(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)})),a(this,"onMouseDown",(e=>{var t;if(null==(t=this.domElement)||t.focus(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0})),a(this,"onMouseUp",(e=>{if(this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1})),a(this,"onMouseMove",(e=>{this.domElement&&(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)})),a(this,"onKeyDown",(e=>{switch(e.code){case"ArrowUp":case"KeyW":this.moveForward=!0;break;case"ArrowLeft":case"KeyA":this.moveLeft=!0;break;case"ArrowDown":case"KeyS":this.moveBackward=!0;break;case"ArrowRight":case"KeyD":this.moveRight=!0;break;case"KeyR":this.moveUp=!0;break;case"KeyF":this.moveDown=!0}})),a(this,"onKeyUp",(e=>{switch(e.code){case"ArrowUp":case"KeyW":this.moveForward=!1;break;case"ArrowLeft":case"KeyA":this.moveLeft=!1;break;case"ArrowDown":case"KeyS":this.moveBackward=!1;break;case"ArrowRight":case"KeyD":this.moveRight=!1;break;case"KeyR":this.moveUp=!1;break;case"KeyF":this.moveDown=!1}})),a(this,"lookAt",((e,t,r)=>(e instanceof n.Vector3?this.target.copy(e):t&&r&&this.target.set(e,t,r),this.object.lookAt(this.target),this.setOrientation(),this))),a(this,"update",(e=>{if(!this.enabled)return;if(this.heightSpeed){const t=n.MathUtils.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;const t=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(t+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(t),this.moveLeft&&this.object.translateX(-t),this.moveRight&&this.object.translateX(t),this.moveUp&&this.object.translateY(t),this.moveDown&&this.object.translateY(-t);let r=e*this.lookSpeed;this.activeLook||(r=0);let i=1;this.constrainVertical&&(i=Math.PI/(this.verticalMax-this.verticalMin)),this.lon-=this.mouseX*r,this.lookVertical&&(this.lat-=this.mouseY*r*i),this.lat=Math.max(-85,Math.min(85,this.lat));let a=n.MathUtils.degToRad(90-this.lat);const o=n.MathUtils.degToRad(this.lon);this.constrainVertical&&(a=n.MathUtils.mapLinear(a,0,Math.PI,this.verticalMin,this.verticalMax));const l=this.object.position;s.setFromSphericalCoords(1,a,o).add(l),this.object.lookAt(s)})),a(this,"contextmenu",(e=>e.preventDefault())),a(this,"setOrientation",(()=>{this.lookDirection.set(0,0,-1).applyQuaternion(this.object.quaternion),this.spherical.setFromVector3(this.lookDirection),this.lat=90-n.MathUtils.radToDeg(this.spherical.phi),this.lon=n.MathUtils.radToDeg(this.spherical.theta)})),this.object=e,this.domElement=t,this.setOrientation(),t&&this.connect(t)}}},32044:(e,t,r)=>{"use strict";r.d(t,{m:()=>o});var n=r(99477),i=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);function s(e){e.preventDefault()}class o extends n.EventDispatcher{constructor(e,t){super(),a(this,"object"),a(this,"domElement",null),a(this,"movementSpeed",1),a(this,"rollSpeed",.005),a(this,"dragToLook",!1),a(this,"autoForward",!1),a(this,"changeEvent",{type:"change"}),a(this,"EPS",1e-6),a(this,"tmpQuaternion",new n.Quaternion),a(this,"mouseStatus",0),a(this,"movementSpeedMultiplier",1),a(this,"moveState",{up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0}),a(this,"moveVector",new n.Vector3(0,0,0)),a(this,"rotationVector",new n.Vector3(0,0,0)),a(this,"keydown",(e=>{if(!e.altKey){switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this.moveState.forward=1;break;case"KeyS":this.moveState.back=1;break;case"KeyA":this.moveState.left=1;break;case"KeyD":this.moveState.right=1;break;case"KeyR":this.moveState.up=1;break;case"KeyF":this.moveState.down=1;break;case"ArrowUp":this.moveState.pitchUp=1;break;case"ArrowDown":this.moveState.pitchDown=1;break;case"ArrowLeft":this.moveState.yawLeft=1;break;case"ArrowRight":this.moveState.yawRight=1;break;case"KeyQ":this.moveState.rollLeft=1;break;case"KeyE":this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}})),a(this,"keyup",(e=>{switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this.moveState.forward=0;break;case"KeyS":this.moveState.back=0;break;case"KeyA":this.moveState.left=0;break;case"KeyD":this.moveState.right=0;break;case"KeyR":this.moveState.up=0;break;case"KeyF":this.moveState.down=0;break;case"ArrowUp":this.moveState.pitchUp=0;break;case"ArrowDown":this.moveState.pitchDown=0;break;case"ArrowLeft":this.moveState.yawLeft=0;break;case"ArrowRight":this.moveState.yawRight=0;break;case"KeyQ":this.moveState.rollLeft=0;break;case"KeyE":this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()})),a(this,"pointerdown",(e=>{if(this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}})),a(this,"pointermove",(e=>{if(!this.dragToLook||this.mouseStatus>0){const t=this.getContainerDimensions(),r=t.size[0]/2,n=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-r)/r,this.moveState.pitchDown=(e.pageY-t.offset[1]-n)/n,this.updateRotationVector()}})),a(this,"pointerup",(e=>{if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()})),a(this,"lastQuaternion",new n.Quaternion),a(this,"lastPosition",new n.Vector3),a(this,"update",(e=>{const t=e*this.movementSpeed,r=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*r,this.rotationVector.y*r,this.rotationVector.z*r,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),(this.lastPosition.distanceToSquared(this.object.position)>this.EPS||8*(1-this.lastQuaternion.dot(this.object.quaternion))>this.EPS)&&(this.dispatchEvent(this.changeEvent),this.lastQuaternion.copy(this.object.quaternion),this.lastPosition.copy(this.object.position))})),a(this,"updateMovementVector",(()=>{const e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back})),a(this,"updateRotationVector",(()=>{this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft})),a(this,"getContainerDimensions",(()=>this.domElement==document||this.domElement instanceof Document?{size:[window.innerWidth,window.innerHeight],offset:[0,0]}:{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]})),a(this,"connect",(e=>{this.domElement=e,!e||e instanceof Document||e.setAttribute("tabindex",-1),this.domElement.addEventListener("contextmenu",s),this.domElement.addEventListener("pointermove",this.pointermove),this.domElement.addEventListener("pointerdown",this.pointerdown),this.domElement.addEventListener("pointerup",this.pointerup),window.addEventListener("keydown",this.keydown),window.addEventListener("keyup",this.keyup)})),a(this,"dispose",(()=>{this.domElement.removeEventListener("contextmenu",s),this.domElement.removeEventListener("pointermove",this.pointermove),this.domElement.removeEventListener("pointerdown",this.pointerdown),this.domElement.removeEventListener("pointerup",this.pointerup),window.removeEventListener("keydown",this.keydown),window.removeEventListener("keyup",this.keyup)})),this.object=e,void 0!==t&&this.connect(t),this.updateMovementVector(),this.updateRotationVector()}}},22227:(e,t,r)=>{"use strict";r.d(t,{o:()=>l,z:()=>o});var n=r(99477),i=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const s=(e,t)=>(e%t+t)%t;class o extends n.EventDispatcher{constructor(e,t){super(),a(this,"object"),a(this,"domElement"),a(this,"enabled",!0),a(this,"target",new n.Vector3),a(this,"minDistance",0),a(this,"maxDistance",1/0),a(this,"minZoom",0),a(this,"maxZoom",1/0),a(this,"minPolarAngle",0),a(this,"maxPolarAngle",Math.PI),a(this,"minAzimuthAngle",-1/0),a(this,"maxAzimuthAngle",1/0),a(this,"enableDamping",!1),a(this,"dampingFactor",.05),a(this,"enableZoom",!0),a(this,"zoomSpeed",1),a(this,"enableRotate",!0),a(this,"rotateSpeed",1),a(this,"enablePan",!0),a(this,"panSpeed",1),a(this,"screenSpacePanning",!0),a(this,"keyPanSpeed",7),a(this,"autoRotate",!1),a(this,"autoRotateSpeed",2),a(this,"reverseOrbit",!1),a(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),a(this,"mouseButtons",{LEFT:n.MOUSE.ROTATE,MIDDLE:n.MOUSE.DOLLY,RIGHT:n.MOUSE.PAN}),a(this,"touches",{ONE:n.TOUCH.ROTATE,TWO:n.TOUCH.DOLLY_PAN}),a(this,"target0"),a(this,"position0"),a(this,"zoom0"),a(this,"_domElementKeyEvents",null),a(this,"getPolarAngle"),a(this,"getAzimuthalAngle"),a(this,"setPolarAngle"),a(this,"setAzimuthalAngle"),a(this,"getDistance"),a(this,"listenToKeyEvents"),a(this,"saveState"),a(this,"reset"),a(this,"update"),a(this,"connect"),a(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>d.phi,this.getAzimuthalAngle=()=>d.theta,this.setPolarAngle=e=>{let t=s(e,2*Math.PI),n=d.phi;n<0&&(n+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-n);2*Math.PI-i<i&&(t<n?t+=2*Math.PI:n+=2*Math.PI),p.phi=t-n,r.update()},this.setAzimuthalAngle=e=>{let t=s(e,2*Math.PI),n=d.theta;n<0&&(n+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-n);2*Math.PI-i<i&&(t<n?t+=2*Math.PI:n+=2*Math.PI),p.theta=t-n,r.update()},this.getDistance=()=>r.object.position.distanceTo(r.target),this.listenToKeyEvents=e=>{e.addEventListener("keydown",q),this._domElementKeyEvents=e},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),u=c.NONE},this.update=(()=>{const t=new n.Vector3,a=(new n.Quaternion).setFromUnitVectors(e.up,new n.Vector3(0,1,0)),s=a.clone().invert(),o=new n.Vector3,l=new n.Quaternion,v=2*Math.PI;return function(){const e=r.object.position;t.copy(e).sub(r.target),t.applyQuaternion(a),d.setFromVector3(t),r.autoRotate&&u===c.NONE&&I(2*Math.PI/60/60*r.autoRotateSpeed),r.enableDamping?(d.theta+=p.theta*r.dampingFactor,d.phi+=p.phi*r.dampingFactor):(d.theta+=p.theta,d.phi+=p.phi);let n=r.minAzimuthAngle,A=r.maxAzimuthAngle;return isFinite(n)&&isFinite(A)&&(n<-Math.PI?n+=v:n>Math.PI&&(n-=v),A<-Math.PI?A+=v:A>Math.PI&&(A-=v),d.theta=n<=A?Math.max(n,Math.min(A,d.theta)):d.theta>(n+A)/2?Math.max(n,d.theta):Math.min(A,d.theta)),d.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,d.phi)),d.makeSafe(),d.radius*=f,d.radius=Math.max(r.minDistance,Math.min(r.maxDistance,d.radius)),!0===r.enableDamping?r.target.addScaledVector(m,r.dampingFactor):r.target.add(m),t.setFromSpherical(d),t.applyQuaternion(s),e.copy(r.target).add(t),r.object.lookAt(r.target),!0===r.enableDamping?(p.theta*=1-r.dampingFactor,p.phi*=1-r.dampingFactor,m.multiplyScalar(1-r.dampingFactor)):(p.set(0,0,0),m.set(0,0,0)),f=1,!!(g||o.distanceToSquared(r.object.position)>h||8*(1-l.dot(r.object.quaternion))>h)&&(r.dispatchEvent(i),o.copy(r.object.position),l.copy(r.object.quaternion),g=!1,!0)}})(),this.connect=e=>{e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),r.domElement=e,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",K),r.domElement.addEventListener("pointerdown",Q),r.domElement.addEventListener("pointercancel",X),r.domElement.addEventListener("wheel",Y)},this.dispose=()=>{var e,t,n,i,a,s;null==(e=r.domElement)||e.removeEventListener("contextmenu",K),null==(t=r.domElement)||t.removeEventListener("pointerdown",Q),null==(n=r.domElement)||n.removeEventListener("pointercancel",X),null==(i=r.domElement)||i.removeEventListener("wheel",Y),null==(a=r.domElement)||a.ownerDocument.removeEventListener("pointermove",j),null==(s=r.domElement)||s.ownerDocument.removeEventListener("pointerup",W),null!==r._domElementKeyEvents&&r._domElementKeyEvents.removeEventListener("keydown",q)};const r=this,i={type:"change"},o={type:"start"},l={type:"end"},c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let u=c.NONE;const h=1e-6,d=new n.Spherical,p=new n.Spherical;let f=1;const m=new n.Vector3;let g=!1;const v=new n.Vector2,A=new n.Vector2,y=new n.Vector2,x=new n.Vector2,b=new n.Vector2,w=new n.Vector2,E=new n.Vector2,S=new n.Vector2,M=new n.Vector2,_=[],T={};function C(){return Math.pow(.95,r.zoomSpeed)}function I(e){r.reverseOrbit?p.theta+=e:p.theta-=e}function B(e){r.reverseOrbit?p.phi+=e:p.phi-=e}const R=(()=>{const e=new n.Vector3;return function(t,r){e.setFromMatrixColumn(r,0),e.multiplyScalar(-t),m.add(e)}})(),P=(()=>{const e=new n.Vector3;return function(t,n){!0===r.screenSpacePanning?e.setFromMatrixColumn(n,1):(e.setFromMatrixColumn(n,0),e.crossVectors(r.object.up,e)),e.multiplyScalar(t),m.add(e)}})(),F=(()=>{const e=new n.Vector3;return function(t,i){const a=r.domElement;if(a&&r.object instanceof n.PerspectiveCamera&&r.object.isPerspectiveCamera){const n=r.object.position;e.copy(n).sub(r.target);let s=e.length();s*=Math.tan(r.object.fov/2*Math.PI/180),R(2*t*s/a.clientHeight,r.object.matrix),P(2*i*s/a.clientHeight,r.object.matrix)}else a&&r.object instanceof n.OrthographicCamera&&r.object.isOrthographicCamera?(R(t*(r.object.right-r.object.left)/r.object.zoom/a.clientWidth,r.object.matrix),P(i*(r.object.top-r.object.bottom)/r.object.zoom/a.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function L(e){r.object instanceof n.PerspectiveCamera&&r.object.isPerspectiveCamera?f/=e:r.object instanceof n.OrthographicCamera&&r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*e)),r.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function D(e){r.object instanceof n.PerspectiveCamera&&r.object.isPerspectiveCamera?f*=e:r.object instanceof n.OrthographicCamera&&r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/e)),r.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function U(e){v.set(e.clientX,e.clientY)}function N(e){x.set(e.clientX,e.clientY)}function k(){if(1==_.length)v.set(_[0].pageX,_[0].pageY);else{const e=.5*(_[0].pageX+_[1].pageX),t=.5*(_[0].pageY+_[1].pageY);v.set(e,t)}}function O(){if(1==_.length)x.set(_[0].pageX,_[0].pageY);else{const e=.5*(_[0].pageX+_[1].pageX),t=.5*(_[0].pageY+_[1].pageY);x.set(e,t)}}function G(){const e=_[0].pageX-_[1].pageX,t=_[0].pageY-_[1].pageY,r=Math.sqrt(e*e+t*t);E.set(0,r)}function z(e){if(1==_.length)A.set(e.pageX,e.pageY);else{const t=$(e),r=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);A.set(r,n)}y.subVectors(A,v).multiplyScalar(r.rotateSpeed);const t=r.domElement;t&&(I(2*Math.PI*y.x/t.clientHeight),B(2*Math.PI*y.y/t.clientHeight)),v.copy(A)}function V(e){if(1==_.length)b.set(e.pageX,e.pageY);else{const t=$(e),r=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);b.set(r,n)}w.subVectors(b,x).multiplyScalar(r.panSpeed),F(w.x,w.y),x.copy(b)}function H(e){const t=$(e),n=e.pageX-t.x,i=e.pageY-t.y,a=Math.sqrt(n*n+i*i);S.set(0,a),M.set(0,Math.pow(S.y/E.y,r.zoomSpeed)),L(M.y),E.copy(S)}function Q(e){var t,i;!1!==r.enabled&&(0===_.length&&(null==(t=r.domElement)||t.ownerDocument.addEventListener("pointermove",j),null==(i=r.domElement)||i.ownerDocument.addEventListener("pointerup",W)),function(e){_.push(e)}(e),"touch"===e.pointerType?function(e){switch(Z(e),_.length){case 1:switch(r.touches.ONE){case n.TOUCH.ROTATE:if(!1===r.enableRotate)return;k(),u=c.TOUCH_ROTATE;break;case n.TOUCH.PAN:if(!1===r.enablePan)return;O(),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(r.touches.TWO){case n.TOUCH.DOLLY_PAN:if(!1===r.enableZoom&&!1===r.enablePan)return;r.enableZoom&&G(),r.enablePan&&O(),u=c.TOUCH_DOLLY_PAN;break;case n.TOUCH.DOLLY_ROTATE:if(!1===r.enableZoom&&!1===r.enableRotate)return;r.enableZoom&&G(),r.enableRotate&&k(),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&r.dispatchEvent(o)}(e):function(e){let t;switch(e.button){case 0:t=r.mouseButtons.LEFT;break;case 1:t=r.mouseButtons.MIDDLE;break;case 2:t=r.mouseButtons.RIGHT;break;default:t=-1}switch(t){case n.MOUSE.DOLLY:if(!1===r.enableZoom)return;!function(e){E.set(e.clientX,e.clientY)}(e),u=c.DOLLY;break;case n.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===r.enablePan)return;N(e),u=c.PAN}else{if(!1===r.enableRotate)return;U(e),u=c.ROTATE}break;case n.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===r.enableRotate)return;U(e),u=c.ROTATE}else{if(!1===r.enablePan)return;N(e),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&r.dispatchEvent(o)}(e))}function j(e){!1!==r.enabled&&("touch"===e.pointerType?function(e){switch(Z(e),u){case c.TOUCH_ROTATE:if(!1===r.enableRotate)return;z(e),r.update();break;case c.TOUCH_PAN:if(!1===r.enablePan)return;V(e),r.update();break;case c.TOUCH_DOLLY_PAN:if(!1===r.enableZoom&&!1===r.enablePan)return;!function(e){r.enableZoom&&H(e),r.enablePan&&V(e)}(e),r.update();break;case c.TOUCH_DOLLY_ROTATE:if(!1===r.enableZoom&&!1===r.enableRotate)return;!function(e){r.enableZoom&&H(e),r.enableRotate&&z(e)}(e),r.update();break;default:u=c.NONE}}(e):function(e){if(!1===r.enabled)return;switch(u){case c.ROTATE:if(!1===r.enableRotate)return;!function(e){A.set(e.clientX,e.clientY),y.subVectors(A,v).multiplyScalar(r.rotateSpeed);const t=r.domElement;t&&(I(2*Math.PI*y.x/t.clientHeight),B(2*Math.PI*y.y/t.clientHeight)),v.copy(A),r.update()}(e);break;case c.DOLLY:if(!1===r.enableZoom)return;!function(e){S.set(e.clientX,e.clientY),M.subVectors(S,E),M.y>0?L(C()):M.y<0&&D(C()),E.copy(S),r.update()}(e);break;case c.PAN:if(!1===r.enablePan)return;!function(e){b.set(e.clientX,e.clientY),w.subVectors(b,x).multiplyScalar(r.panSpeed),F(w.x,w.y),x.copy(b),r.update()}(e)}}(e))}function W(e){var t,n,i;J(e),0===_.length&&(null==(t=r.domElement)||t.releasePointerCapture(e.pointerId),null==(n=r.domElement)||n.ownerDocument.removeEventListener("pointermove",j),null==(i=r.domElement)||i.ownerDocument.removeEventListener("pointerup",W)),r.dispatchEvent(l),u=c.NONE}function X(e){J(e)}function Y(e){!1===r.enabled||!1===r.enableZoom||u!==c.NONE&&u!==c.ROTATE||(e.preventDefault(),r.dispatchEvent(o),function(e){e.deltaY<0?D(C()):e.deltaY>0&&L(C()),r.update()}(e),r.dispatchEvent(l))}function q(e){!1!==r.enabled&&!1!==r.enablePan&&function(e){let t=!1;switch(e.code){case r.keys.UP:F(0,r.keyPanSpeed),t=!0;break;case r.keys.BOTTOM:F(0,-r.keyPanSpeed),t=!0;break;case r.keys.LEFT:F(r.keyPanSpeed,0),t=!0;break;case r.keys.RIGHT:F(-r.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),r.update())}(e)}function K(e){!1!==r.enabled&&e.preventDefault()}function J(e){delete T[e.pointerId];for(let t=0;t<_.length;t++)if(_[t].pointerId==e.pointerId)return void _.splice(t,1)}function Z(e){let t=T[e.pointerId];void 0===t&&(t=new n.Vector2,T[e.pointerId]=t),t.set(e.pageX,e.pageY)}function $(e){const t=e.pointerId===_[0].pointerId?_[1]:_[0];return T[t.pointerId]}void 0!==t&&this.connect(t),this.update()}}class l extends o{constructor(e,t){super(e,t),this.screenSpacePanning=!1,this.mouseButtons.LEFT=n.MOUSE.PAN,this.mouseButtons.RIGHT=n.MOUSE.ROTATE,this.touches.ONE=n.TOUCH.PAN,this.touches.TWO=n.TOUCH.DOLLY_ROTATE}}},2679:(e,t,r)=>{"use strict";r.d(t,{q:()=>d});var n=r(99477),i=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const s=new n.Euler(0,0,0,"YXZ"),o=new n.Vector3,l={type:"change"},c={type:"lock"},u={type:"unlock"},h=Math.PI/2;class d extends n.EventDispatcher{constructor(e,t){super(),a(this,"camera"),a(this,"domElement"),a(this,"isLocked"),a(this,"minPolarAngle"),a(this,"maxPolarAngle"),a(this,"pointerSpeed"),a(this,"onMouseMove",(e=>{if(!this.domElement||!1===this.isLocked)return;const t=e.movementX||e.mozMovementX||e.webkitMovementX||0,r=e.movementY||e.mozMovementY||e.webkitMovementY||0;s.setFromQuaternion(this.camera.quaternion),s.y-=.002*t*this.pointerSpeed,s.x-=.002*r*this.pointerSpeed,s.x=Math.max(h-this.maxPolarAngle,Math.min(h-this.minPolarAngle,s.x)),this.camera.quaternion.setFromEuler(s),this.dispatchEvent(l)})),a(this,"onPointerlockChange",(()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(c),this.isLocked=!0):(this.dispatchEvent(u),this.isLocked=!1))})),a(this,"onPointerlockError",(()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")})),a(this,"connect",(e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))})),a(this,"disconnect",(()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))})),a(this,"dispose",(()=>{this.disconnect()})),a(this,"getObject",(()=>this.camera)),a(this,"direction",new n.Vector3(0,0,-1)),a(this,"getDirection",(e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion))),a(this,"moveForward",(e=>{o.setFromMatrixColumn(this.camera.matrix,0),o.crossVectors(this.camera.up,o),this.camera.position.addScaledVector(o,e)})),a(this,"moveRight",(e=>{o.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(o,e)})),a(this,"lock",(()=>{this.domElement&&this.domElement.requestPointerLock()})),a(this,"unlock",(()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()})),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}}},7703:(e,t,r)=>{"use strict";r.d(t,{$:()=>s});var n=r(99477),i=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class s extends n.EventDispatcher{constructor(e,t){super(),a(this,"enabled",!0),a(this,"screen",{left:0,top:0,width:0,height:0}),a(this,"rotateSpeed",1),a(this,"zoomSpeed",1.2),a(this,"panSpeed",.3),a(this,"noRotate",!1),a(this,"noZoom",!1),a(this,"noPan",!1),a(this,"staticMoving",!1),a(this,"dynamicDampingFactor",.2),a(this,"minDistance",0),a(this,"maxDistance",1/0),a(this,"keys",["KeyA","KeyS","KeyD"]),a(this,"mouseButtons",{LEFT:n.MOUSE.ROTATE,MIDDLE:n.MOUSE.DOLLY,RIGHT:n.MOUSE.PAN}),a(this,"object"),a(this,"domElement"),a(this,"cursorZoom",!1),a(this,"target",new n.Vector3),a(this,"mousePosition",new n.Vector2),a(this,"STATE",{NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4}),a(this,"EPS",1e-6),a(this,"lastZoom",1),a(this,"lastPosition",new n.Vector3),a(this,"cursorVector",new n.Vector3),a(this,"targetVector",new n.Vector3),a(this,"_state",this.STATE.NONE),a(this,"_keyState",this.STATE.NONE),a(this,"_eye",new n.Vector3),a(this,"_movePrev",new n.Vector2),a(this,"_moveCurr",new n.Vector2),a(this,"_lastAxis",new n.Vector3),a(this,"_lastAngle",0),a(this,"_zoomStart",new n.Vector2),a(this,"_zoomEnd",new n.Vector2),a(this,"_touchZoomDistanceStart",0),a(this,"_touchZoomDistanceEnd",0),a(this,"_panStart",new n.Vector2),a(this,"_panEnd",new n.Vector2),a(this,"target0"),a(this,"position0"),a(this,"up0"),a(this,"zoom0"),a(this,"changeEvent",{type:"change"}),a(this,"startEvent",{type:"start"}),a(this,"endEvent",{type:"end"}),a(this,"onScreenVector",new n.Vector2),a(this,"getMouseOnScreen",((e,t)=>(this.onScreenVector.set((e-this.screen.left)/this.screen.width,(t-this.screen.top)/this.screen.height),this.onScreenVector))),a(this,"onCircleVector",new n.Vector2),a(this,"getMouseOnCircle",((e,t)=>(this.onCircleVector.set((e-.5*this.screen.width-this.screen.left)/(.5*this.screen.width),(this.screen.height+2*(this.screen.top-t))/this.screen.width),this.onCircleVector))),a(this,"axis",new n.Vector3),a(this,"quaternion",new n.Quaternion),a(this,"eyeDirection",new n.Vector3),a(this,"objectUpDirection",new n.Vector3),a(this,"objectSidewaysDirection",new n.Vector3),a(this,"moveDirection",new n.Vector3),a(this,"angle",0),a(this,"rotateCamera",(()=>{this.moveDirection.set(this._moveCurr.x-this._movePrev.x,this._moveCurr.y-this._movePrev.y,0),this.angle=this.moveDirection.length(),this.angle?(this._eye.copy(this.object.position).sub(this.target),this.eyeDirection.copy(this._eye).normalize(),this.objectUpDirection.copy(this.object.up).normalize(),this.objectSidewaysDirection.crossVectors(this.objectUpDirection,this.eyeDirection).normalize(),this.objectUpDirection.setLength(this._moveCurr.y-this._movePrev.y),this.objectSidewaysDirection.setLength(this._moveCurr.x-this._movePrev.x),this.moveDirection.copy(this.objectUpDirection.add(this.objectSidewaysDirection)),this.axis.crossVectors(this.moveDirection,this._eye).normalize(),this.angle*=this.rotateSpeed,this.quaternion.setFromAxisAngle(this.axis,this.angle),this._eye.applyQuaternion(this.quaternion),this.object.up.applyQuaternion(this.quaternion),this._lastAxis.copy(this.axis),this._lastAngle=this.angle):!this.staticMoving&&this._lastAngle&&(this._lastAngle*=Math.sqrt(1-this.dynamicDampingFactor),this._eye.copy(this.object.position).sub(this.target),this.quaternion.setFromAxisAngle(this._lastAxis,this._lastAngle),this._eye.applyQuaternion(this.quaternion),this.object.up.applyQuaternion(this.quaternion)),this._movePrev.copy(this._moveCurr)})),a(this,"zoomCamera",(()=>{let e;if(this._state===this.STATE.TOUCH_ZOOM_PAN)e=this._touchZoomDistanceStart/this._touchZoomDistanceEnd,this._touchZoomDistanceStart=this._touchZoomDistanceEnd,this.object.isPerspectiveCamera?this._eye.multiplyScalar(e):this.object.isOrthographicCamera?(this.object.zoom/=e,this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type");else{if(e=1+(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed,Math.abs(e-1)>this.EPS&&e>0&&(this.object.isPerspectiveCamera?(e>1&&this._eye.length()>=this.maxDistance-this.EPS&&(e=1),this._eye.multiplyScalar(e)):this.object.isOrthographicCamera?(e>1&&this.object.zoom<this.maxDistance*this.maxDistance&&(e=1),this.object.zoom/=e):console.warn("THREE.TrackballControls: Unsupported camera type")),this.staticMoving?this._zoomStart.copy(this._zoomEnd):this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor,this.cursorZoom){this.targetVector.copy(this.target).project(this.object);let t=this.cursorVector.set(this.mousePosition.x,this.mousePosition.y,this.targetVector.z).unproject(this.object);this.target.lerpVectors(t,this.target,e)}this.object.isOrthographicCamera&&this.object.updateProjectionMatrix()}})),a(this,"mouseChange",new n.Vector2),a(this,"objectUp",new n.Vector3),a(this,"pan",new n.Vector3),a(this,"panCamera",(()=>{if(this.domElement&&(this.mouseChange.copy(this._panEnd).sub(this._panStart),this.mouseChange.lengthSq()>this.EPS)){if(this.object.isOrthographicCamera){const e=this.object,t=(e.right-e.left)/this.object.zoom,r=(e.top-e.bottom)/this.object.zoom;this.mouseChange.x*=t,this.mouseChange.y*=r}else this.mouseChange.multiplyScalar(this._eye.length()*this.panSpeed);this.pan.copy(this._eye).cross(this.object.up).setLength(this.mouseChange.x),this.pan.add(this.objectUp.copy(this.object.up).setLength(this.mouseChange.y)),this.object.position.add(this.pan),this.target.add(this.pan),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(this.mouseChange.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}})),a(this,"checkDistances",(()=>{this.noZoom&&this.noPan||(this._eye.lengthSq()>this.maxDistance*this.maxDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.maxDistance)),this._zoomStart.copy(this._zoomEnd)),this._eye.lengthSq()<this.minDistance*this.minDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.minDistance)),this._zoomStart.copy(this._zoomEnd)))})),a(this,"handleResize",(()=>{if(!this.domElement)return;const e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height})),a(this,"update",(()=>{this._eye.subVectors(this.object.position,this.target),this.noRotate||this.rotateCamera(),this.noZoom||this.zoomCamera(),this.noPan||this.panCamera(),this.object.position.addVectors(this.target,this._eye),this.object.isPerspectiveCamera?(this.checkDistances(),this.object.lookAt(this.target),this.lastPosition.distanceToSquared(this.object.position)>this.EPS&&(this.dispatchEvent(this.changeEvent),this.lastPosition.copy(this.object.position))):this.object.isOrthographicCamera?(this.object.lookAt(this.target),(this.lastPosition.distanceToSquared(this.object.position)>this.EPS||this.lastZoom!==this.object.zoom)&&(this.dispatchEvent(this.changeEvent),this.lastPosition.copy(this.object.position),this.lastZoom=this.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type")})),a(this,"reset",(()=>{this._state=this.STATE.NONE,this._keyState=this.STATE.NONE,this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.up.copy(this.up0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this._eye.subVectors(this.object.position,this.target),this.object.lookAt(this.target),this.dispatchEvent(this.changeEvent),this.lastPosition.copy(this.object.position),this.lastZoom=this.object.zoom})),a(this,"keydown",(e=>{!1!==this.enabled&&(window.removeEventListener("keydown",this.keydown),this._keyState===this.STATE.NONE&&(e.code!==this.keys[this.STATE.ROTATE]||this.noRotate?e.code!==this.keys[this.STATE.ZOOM]||this.noZoom?e.code!==this.keys[this.STATE.PAN]||this.noPan||(this._keyState=this.STATE.PAN):this._keyState=this.STATE.ZOOM:this._keyState=this.STATE.ROTATE))})),a(this,"onPointerDown",(e=>{if(!1!==this.enabled)switch(e.pointerType){case"mouse":case"pen":this.onMouseDown(e)}})),a(this,"onPointerMove",(e=>{if(!1!==this.enabled)switch(e.pointerType){case"mouse":case"pen":this.onMouseMove(e)}})),a(this,"onPointerUp",(e=>{if(!1!==this.enabled)switch(e.pointerType){case"mouse":case"pen":this.onMouseUp()}})),a(this,"keyup",(()=>{!1!==this.enabled&&(this._keyState=this.STATE.NONE,window.addEventListener("keydown",this.keydown))})),a(this,"onMouseDown",(e=>{if(!this.domElement)return;if(this._state===this.STATE.NONE)switch(e.button){case this.mouseButtons.LEFT:this._state=this.STATE.ROTATE;break;case this.mouseButtons.MIDDLE:this._state=this.STATE.ZOOM;break;case this.mouseButtons.RIGHT:this._state=this.STATE.PAN;break;default:this._state=this.STATE.NONE}const t=this._keyState!==this.STATE.NONE?this._keyState:this._state;t!==this.STATE.ROTATE||this.noRotate?t!==this.STATE.ZOOM||this.noZoom?t!==this.STATE.PAN||this.noPan||(this._panStart.copy(this.getMouseOnScreen(e.pageX,e.pageY)),this._panEnd.copy(this._panStart)):(this._zoomStart.copy(this.getMouseOnScreen(e.pageX,e.pageY)),this._zoomEnd.copy(this._zoomStart)):(this._moveCurr.copy(this.getMouseOnCircle(e.pageX,e.pageY)),this._movePrev.copy(this._moveCurr)),this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp),this.dispatchEvent(this.startEvent)})),a(this,"onMouseMove",(e=>{if(!1===this.enabled)return;const t=this._keyState!==this.STATE.NONE?this._keyState:this._state;t!==this.STATE.ROTATE||this.noRotate?t!==this.STATE.ZOOM||this.noZoom?t!==this.STATE.PAN||this.noPan||this._panEnd.copy(this.getMouseOnScreen(e.pageX,e.pageY)):this._zoomEnd.copy(this.getMouseOnScreen(e.pageX,e.pageY)):(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this.getMouseOnCircle(e.pageX,e.pageY)))})),a(this,"onMouseUp",(()=>{this.domElement&&!1!==this.enabled&&(this._state=this.STATE.NONE,this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp),this.dispatchEvent(this.endEvent))})),a(this,"mousewheel",(e=>{if(!1!==this.enabled&&!0!==this.noZoom){switch(e.preventDefault(),e.deltaMode){case 2:this._zoomStart.y-=.025*e.deltaY;break;case 1:this._zoomStart.y-=.01*e.deltaY;break;default:this._zoomStart.y-=25e-5*e.deltaY}this.mousePosition.x=e.offsetX/this.screen.width*2-1,this.mousePosition.y=-e.offsetY/this.screen.height*2+1,this.dispatchEvent(this.startEvent),this.dispatchEvent(this.endEvent)}})),a(this,"touchstart",(e=>{if(!1!==this.enabled){if(e.preventDefault(),1===e.touches.length)this._state=this.STATE.TOUCH_ROTATE,this._moveCurr.copy(this.getMouseOnCircle(e.touches[0].pageX,e.touches[0].pageY)),this._movePrev.copy(this._moveCurr);else{this._state=this.STATE.TOUCH_ZOOM_PAN;const t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(t*t+r*r);const n=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;this._panStart.copy(this.getMouseOnScreen(n,i)),this._panEnd.copy(this._panStart)}this.dispatchEvent(this.startEvent)}})),a(this,"touchmove",(e=>{if(!1!==this.enabled)if(e.preventDefault(),1===e.touches.length)this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this.getMouseOnCircle(e.touches[0].pageX,e.touches[0].pageY));else{const t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY;this._touchZoomDistanceEnd=Math.sqrt(t*t+r*r);const n=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;this._panEnd.copy(this.getMouseOnScreen(n,i))}})),a(this,"touchend",(e=>{if(!1!==this.enabled){switch(e.touches.length){case 0:this._state=this.STATE.NONE;break;case 1:this._state=this.STATE.TOUCH_ROTATE,this._moveCurr.copy(this.getMouseOnCircle(e.touches[0].pageX,e.touches[0].pageY)),this._movePrev.copy(this._moveCurr)}this.dispatchEvent(this.endEvent)}})),a(this,"contextmenu",(e=>{!1!==this.enabled&&e.preventDefault()})),a(this,"connect",(e=>{e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.domElement=e,this.domElement.addEventListener("contextmenu",this.contextmenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("wheel",this.mousewheel),this.domElement.addEventListener("touchstart",this.touchstart),this.domElement.addEventListener("touchend",this.touchend),this.domElement.addEventListener("touchmove",this.touchmove),this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp),window.addEventListener("keydown",this.keydown),window.addEventListener("keyup",this.keyup),this.handleResize()})),a(this,"dispose",(()=>{this.domElement&&(this.domElement.removeEventListener("contextmenu",this.contextmenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("wheel",this.mousewheel),this.domElement.removeEventListener("touchstart",this.touchstart),this.domElement.removeEventListener("touchend",this.touchend),this.domElement.removeEventListener("touchmove",this.touchmove),this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("keydown",this.keydown),window.removeEventListener("keyup",this.keyup))})),this.object=e,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.zoom0=this.object.zoom,void 0!==t&&this.connect(t),this.update()}}},35041:(e,t,r)=>{"use strict";r.d(t,{EC:()=>l,JW:()=>o,Ys:()=>s});var n=r(99477),i=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class s extends n.Object3D{constructor(e,t){super(),a(this,"isTransformControls",!0),a(this,"visible",!1),a(this,"domElement"),a(this,"raycaster",new n.Raycaster),a(this,"gizmo"),a(this,"plane"),a(this,"tempVector",new n.Vector3),a(this,"tempVector2",new n.Vector3),a(this,"tempQuaternion",new n.Quaternion),a(this,"unit",{X:new n.Vector3(1,0,0),Y:new n.Vector3(0,1,0),Z:new n.Vector3(0,0,1)}),a(this,"pointStart",new n.Vector3),a(this,"pointEnd",new n.Vector3),a(this,"offset",new n.Vector3),a(this,"rotationAxis",new n.Vector3),a(this,"startNorm",new n.Vector3),a(this,"endNorm",new n.Vector3),a(this,"rotationAngle",0),a(this,"cameraPosition",new n.Vector3),a(this,"cameraQuaternion",new n.Quaternion),a(this,"cameraScale",new n.Vector3),a(this,"parentPosition",new n.Vector3),a(this,"parentQuaternion",new n.Quaternion),a(this,"parentQuaternionInv",new n.Quaternion),a(this,"parentScale",new n.Vector3),a(this,"worldPositionStart",new n.Vector3),a(this,"worldQuaternionStart",new n.Quaternion),a(this,"worldScaleStart",new n.Vector3),a(this,"worldPosition",new n.Vector3),a(this,"worldQuaternion",new n.Quaternion),a(this,"worldQuaternionInv",new n.Quaternion),a(this,"worldScale",new n.Vector3),a(this,"eye",new n.Vector3),a(this,"positionStart",new n.Vector3),a(this,"quaternionStart",new n.Quaternion),a(this,"scaleStart",new n.Vector3),a(this,"camera"),a(this,"object"),a(this,"enabled",!0),a(this,"axis",null),a(this,"mode","translate"),a(this,"translationSnap",null),a(this,"rotationSnap",null),a(this,"scaleSnap",null),a(this,"space","world"),a(this,"size",1),a(this,"dragging",!1),a(this,"showX",!0),a(this,"showY",!0),a(this,"showZ",!0),a(this,"changeEvent",{type:"change"}),a(this,"mouseDownEvent",{type:"mouseDown",mode:this.mode}),a(this,"mouseUpEvent",{type:"mouseUp",mode:this.mode}),a(this,"objectChangeEvent",{type:"objectChange"}),a(this,"intersectObjectWithRay",((e,t,r)=>{const n=t.intersectObject(e,!0);for(let i=0;i<n.length;i++)if(n[i].object.visible||r)return n[i];return!1})),a(this,"attach",(e=>(this.object=e,this.visible=!0,this))),a(this,"detach",(()=>(this.object=void 0,this.visible=!1,this.axis=null,this))),a(this,"reset",(()=>this.enabled?(this.dragging&&void 0!==this.object&&(this.object.position.copy(this.positionStart),this.object.quaternion.copy(this.quaternionStart),this.object.scale.copy(this.scaleStart),this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent),this.pointStart.copy(this.pointEnd)),this):this)),a(this,"updateMatrixWorld",(()=>{void 0!==this.object&&(this.object.updateMatrixWorld(),null===this.object.parent?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this.parentPosition,this.parentQuaternion,this.parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this.worldScale),this.parentQuaternionInv.copy(this.parentQuaternion).invert(),this.worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this.cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld()})),a(this,"pointerHover",(e=>{if(void 0===this.object||!0===this.dragging)return;this.raycaster.setFromCamera(e,this.camera);const t=this.intersectObjectWithRay(this.gizmo.picker[this.mode],this.raycaster);this.axis=t?t.object.name:null})),a(this,"pointerDown",(e=>{if(void 0!==this.object&&!0!==this.dragging&&0===e.button&&null!==this.axis){this.raycaster.setFromCamera(e,this.camera);const t=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(t){let e=this.space;if("scale"===this.mode?e="local":"E"!==this.axis&&"XYZE"!==this.axis&&"XYZ"!==this.axis||(e="world"),"local"===e&&"rotate"===this.mode){const e=this.rotationSnap;"X"===this.axis&&e&&(this.object.rotation.x=Math.round(this.object.rotation.x/e)*e),"Y"===this.axis&&e&&(this.object.rotation.y=Math.round(this.object.rotation.y/e)*e),"Z"===this.axis&&e&&(this.object.rotation.z=Math.round(this.object.rotation.z/e)*e)}this.object.updateMatrixWorld(),this.object.parent&&this.object.parent.updateMatrixWorld(),this.positionStart.copy(this.object.position),this.quaternionStart.copy(this.object.quaternion),this.scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this.worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)}this.dragging=!0,this.mouseDownEvent.mode=this.mode,this.dispatchEvent(this.mouseDownEvent)}})),a(this,"pointerMove",(e=>{const t=this.axis,r=this.mode,n=this.object;let i=this.space;if("scale"===r?i="local":"E"!==t&&"XYZE"!==t&&"XYZ"!==t||(i="world"),void 0===n||null===t||!1===this.dragging||-1!==e.button)return;this.raycaster.setFromCamera(e,this.camera);const a=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),"translate"===r)this.offset.copy(this.pointEnd).sub(this.pointStart),"local"===i&&"XYZ"!==t&&this.offset.applyQuaternion(this.worldQuaternionInv),-1===t.indexOf("X")&&(this.offset.x=0),-1===t.indexOf("Y")&&(this.offset.y=0),-1===t.indexOf("Z")&&(this.offset.z=0),"local"===i&&"XYZ"!==t?this.offset.applyQuaternion(this.quaternionStart).divide(this.parentScale):this.offset.applyQuaternion(this.parentQuaternionInv).divide(this.parentScale),n.position.copy(this.offset).add(this.positionStart),this.translationSnap&&("local"===i&&(n.position.applyQuaternion(this.tempQuaternion.copy(this.quaternionStart).invert()),-1!==t.search("X")&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.position.applyQuaternion(this.quaternionStart)),"world"===i&&(n.parent&&n.position.add(this.tempVector.setFromMatrixPosition(n.parent.matrixWorld)),-1!==t.search("X")&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.parent&&n.position.sub(this.tempVector.setFromMatrixPosition(n.parent.matrixWorld))));else if("scale"===r){if(-1!==t.search("XYZ")){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),this.tempVector2.set(e,e,e)}else this.tempVector.copy(this.pointStart),this.tempVector2.copy(this.pointEnd),this.tempVector.applyQuaternion(this.worldQuaternionInv),this.tempVector2.applyQuaternion(this.worldQuaternionInv),this.tempVector2.divide(this.tempVector),-1===t.search("X")&&(this.tempVector2.x=1),-1===t.search("Y")&&(this.tempVector2.y=1),-1===t.search("Z")&&(this.tempVector2.z=1);n.scale.copy(this.scaleStart).multiply(this.tempVector2),this.scaleSnap&&this.object&&(-1!==t.search("X")&&(this.object.scale.x=Math.round(n.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Y")&&(n.scale.y=Math.round(n.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Z")&&(n.scale.z=Math.round(n.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if("rotate"===r){this.offset.copy(this.pointEnd).sub(this.pointStart);const e=20/this.worldPosition.distanceTo(this.tempVector.setFromMatrixPosition(this.camera.matrixWorld));"E"===t?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this.startNorm.copy(this.pointStart).normalize(),this.endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this.endNorm.cross(this.startNorm).dot(this.eye)<0?1:-1):"XYZE"===t?(this.rotationAxis.copy(this.offset).cross(this.eye).normalize(),this.rotationAngle=this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye))*e):"X"!==t&&"Y"!==t&&"Z"!==t||(this.rotationAxis.copy(this.unit[t]),this.tempVector.copy(this.unit[t]),"local"===i&&this.tempVector.applyQuaternion(this.worldQuaternion),this.rotationAngle=this.offset.dot(this.tempVector.cross(this.eye).normalize())*e),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),"local"===i&&"E"!==t&&"XYZE"!==t?(n.quaternion.copy(this.quaternionStart),n.quaternion.multiply(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this.parentQuaternionInv),n.quaternion.copy(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),n.quaternion.multiply(this.quaternionStart).normalize())}this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent)}})),a(this,"pointerUp",(e=>{0===e.button&&(this.dragging&&null!==this.axis&&(this.mouseUpEvent.mode=this.mode,this.dispatchEvent(this.mouseUpEvent)),this.dragging=!1,this.axis=null)})),a(this,"getPointer",(e=>{var t,r;if(this.domElement&&(null==(t=this.domElement.ownerDocument)?void 0:t.pointerLockElement))return{x:0,y:0,button:e.button};{const t=e.changedTouches?e.changedTouches[0]:e,n=null==(r=this.domElement)?void 0:r.getBoundingClientRect();return{x:(t.clientX-n.left)/n.width*2-1,y:-(t.clientY-n.top)/n.height*2+1,button:e.button}}})),a(this,"onPointerHover",(e=>{if(this.enabled)switch(e.pointerType){case"mouse":case"pen":this.pointerHover(this.getPointer(e))}})),a(this,"onPointerDown",(e=>{this.enabled&&this.domElement&&(this.domElement.style.touchAction="none",this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.pointerHover(this.getPointer(e)),this.pointerDown(this.getPointer(e)))})),a(this,"onPointerMove",(e=>{this.enabled&&this.pointerMove(this.getPointer(e))})),a(this,"onPointerUp",(e=>{this.enabled&&this.domElement&&(this.domElement.style.touchAction="",this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.pointerUp(this.getPointer(e)))})),a(this,"getMode",(()=>this.mode)),a(this,"setMode",(e=>{this.mode=e})),a(this,"setTranslationSnap",(e=>{this.translationSnap=e})),a(this,"setRotationSnap",(e=>{this.rotationSnap=e})),a(this,"setScaleSnap",(e=>{this.scaleSnap=e})),a(this,"setSize",(e=>{this.size=e})),a(this,"setSpace",(e=>{this.space=e})),a(this,"update",(()=>{console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")})),a(this,"connect",(e=>{e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.domElement=e,this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointermove",this.onPointerHover),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp)})),a(this,"dispose",(()=>{var e,t,r,n,i,a;null==(e=this.domElement)||e.removeEventListener("pointerdown",this.onPointerDown),null==(t=this.domElement)||t.removeEventListener("pointermove",this.onPointerHover),null==(n=null==(r=this.domElement)?void 0:r.ownerDocument)||n.removeEventListener("pointermove",this.onPointerMove),null==(a=null==(i=this.domElement)?void 0:i.ownerDocument)||a.removeEventListener("pointerup",this.onPointerUp),this.traverse((e=>{const t=e;t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()}))})),this.domElement=t,this.camera=e,this.gizmo=new o,this.add(this.gizmo),this.plane=new l,this.add(this.plane);const r=(e,t)=>{let r=t;Object.defineProperty(this,e,{get:function(){return void 0!==r?r:t},set:function(t){r!==t&&(r=t,this.plane[e]=t,this.gizmo[e]=t,this.dispatchEvent({type:e+"-changed",value:t}),this.dispatchEvent(this.changeEvent))}}),this[e]=t,this.plane[e]=t,this.gizmo[e]=t};r("camera",this.camera),r("object",this.object),r("enabled",this.enabled),r("axis",this.axis),r("mode",this.mode),r("translationSnap",this.translationSnap),r("rotationSnap",this.rotationSnap),r("scaleSnap",this.scaleSnap),r("space",this.space),r("size",this.size),r("dragging",this.dragging),r("showX",this.showX),r("showY",this.showY),r("showZ",this.showZ),r("worldPosition",this.worldPosition),r("worldPositionStart",this.worldPositionStart),r("worldQuaternion",this.worldQuaternion),r("worldQuaternionStart",this.worldQuaternionStart),r("cameraPosition",this.cameraPosition),r("cameraQuaternion",this.cameraQuaternion),r("pointStart",this.pointStart),r("pointEnd",this.pointEnd),r("rotationAxis",this.rotationAxis),r("rotationAngle",this.rotationAngle),r("eye",this.eye),void 0!==t&&this.connect(t)}}class o extends n.Object3D{constructor(){super(),a(this,"isTransformControlsGizmo",!0),a(this,"type","TransformControlsGizmo"),a(this,"tempVector",new n.Vector3(0,0,0)),a(this,"tempEuler",new n.Euler),a(this,"alignVector",new n.Vector3(0,1,0)),a(this,"zeroVector",new n.Vector3(0,0,0)),a(this,"lookAtMatrix",new n.Matrix4),a(this,"tempQuaternion",new n.Quaternion),a(this,"tempQuaternion2",new n.Quaternion),a(this,"identityQuaternion",new n.Quaternion),a(this,"unitX",new n.Vector3(1,0,0)),a(this,"unitY",new n.Vector3(0,1,0)),a(this,"unitZ",new n.Vector3(0,0,1)),a(this,"gizmo"),a(this,"picker"),a(this,"helper"),a(this,"rotationAxis",new n.Vector3),a(this,"cameraPosition",new n.Vector3),a(this,"worldPositionStart",new n.Vector3),a(this,"worldQuaternionStart",new n.Quaternion),a(this,"worldPosition",new n.Vector3),a(this,"worldQuaternion",new n.Quaternion),a(this,"eye",new n.Vector3),a(this,"camera",null),a(this,"enabled",!0),a(this,"axis",null),a(this,"mode","translate"),a(this,"space","world"),a(this,"size",1),a(this,"dragging",!1),a(this,"showX",!0),a(this,"showY",!0),a(this,"showZ",!0),a(this,"updateMatrixWorld",(()=>{let e=this.space;"scale"===this.mode&&(e="local");const t="local"===e?this.worldQuaternion:this.identityQuaternion;this.gizmo.translate.visible="translate"===this.mode,this.gizmo.rotate.visible="rotate"===this.mode,this.gizmo.scale.visible="scale"===this.mode,this.helper.translate.visible="translate"===this.mode,this.helper.rotate.visible="rotate"===this.mode,this.helper.scale.visible="scale"===this.mode;let r=[];r=r.concat(this.picker[this.mode].children),r=r.concat(this.gizmo[this.mode].children),r=r.concat(this.helper[this.mode].children);for(let i=0;i<r.length;i++){const e=r[i];let a;if(e.visible=!0,e.rotation.set(0,0,0),e.position.copy(this.worldPosition),a=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),e.scale.set(1,1,1).multiplyScalar(a*this.size/7),"helper"!==e.tag){if(e.quaternion.copy(t),"translate"===this.mode||"scale"===this.mode){const r=.99,n=.2,i=0;"X"!==e.name&&"XYZX"!==e.name||Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))>r&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"Y"!==e.name&&"XYZY"!==e.name||Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>r&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"Z"!==e.name&&"XYZZ"!==e.name||Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>r&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"XY"===e.name&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))<n&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"YZ"===e.name&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))<n&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"XZ"===e.name&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))<n&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),-1!==e.name.search("X")&&(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye)<i?"fwd"===e.tag?e.visible=!1:e.scale.x*=-1:"bwd"===e.tag&&(e.visible=!1)),-1!==e.name.search("Y")&&(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye)<i?"fwd"===e.tag?e.visible=!1:e.scale.y*=-1:"bwd"===e.tag&&(e.visible=!1)),-1!==e.name.search("Z")&&(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye)<i?"fwd"===e.tag?e.visible=!1:e.scale.z*=-1:"bwd"===e.tag&&(e.visible=!1))}else"rotate"===this.mode&&(this.tempQuaternion2.copy(t),this.alignVector.copy(this.eye).applyQuaternion(this.tempQuaternion.copy(t).invert()),-1!==e.name.search("E")&&e.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.eye,this.zeroVector,this.unitY)),"X"===e.name&&(this.tempQuaternion.setFromAxisAngle(this.unitX,Math.atan2(-this.alignVector.y,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),e.quaternion.copy(this.tempQuaternion)),"Y"===e.name&&(this.tempQuaternion.setFromAxisAngle(this.unitY,Math.atan2(this.alignVector.x,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),e.quaternion.copy(this.tempQuaternion)),"Z"===e.name&&(this.tempQuaternion.setFromAxisAngle(this.unitZ,Math.atan2(this.alignVector.y,this.alignVector.x)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),e.quaternion.copy(this.tempQuaternion)));e.visible=e.visible&&(-1===e.name.indexOf("X")||this.showX),e.visible=e.visible&&(-1===e.name.indexOf("Y")||this.showY),e.visible=e.visible&&(-1===e.name.indexOf("Z")||this.showZ),e.visible=e.visible&&(-1===e.name.indexOf("E")||this.showX&&this.showY&&this.showZ),e.material.tempOpacity=e.material.tempOpacity||e.material.opacity,e.material.tempColor=e.material.tempColor||e.material.color.clone(),e.material.color.copy(e.material.tempColor),e.material.opacity=e.material.tempOpacity,this.enabled?this.axis&&(e.name===this.axis||this.axis.split("").some((function(t){return e.name===t}))?(e.material.opacity=1,e.material.color.lerp(new n.Color(1,1,1),.5)):(e.material.opacity*=.25,e.material.color.lerp(new n.Color(1,1,1),.5))):(e.material.opacity*=.5,e.material.color.lerp(new n.Color(1,1,1),.5))}else e.visible=!1,"AXIS"===e.name?(e.position.copy(this.worldPositionStart),e.visible=!!this.axis,"X"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,0)),e.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))>.9&&(e.visible=!1)),"Y"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,Math.PI/2)),e.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>.9&&(e.visible=!1)),"Z"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),e.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>.9&&(e.visible=!1)),"XYZE"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),this.alignVector.copy(this.rotationAxis),e.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.zeroVector,this.alignVector,this.unitY)),e.quaternion.multiply(this.tempQuaternion),e.visible=this.dragging),"E"===this.axis&&(e.visible=!1)):"START"===e.name?(e.position.copy(this.worldPositionStart),e.visible=this.dragging):"END"===e.name?(e.position.copy(this.worldPosition),e.visible=this.dragging):"DELTA"===e.name?(e.position.copy(this.worldPositionStart),e.quaternion.copy(this.worldQuaternionStart),this.tempVector.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),this.tempVector.applyQuaternion(this.worldQuaternionStart.clone().invert()),e.scale.copy(this.tempVector),e.visible=this.dragging):(e.quaternion.copy(t),this.dragging?e.position.copy(this.worldPositionStart):e.position.copy(this.worldPosition),this.axis&&(e.visible=-1!==this.axis.search(e.name)))}super.updateMatrixWorld()}));const e=new n.MeshBasicMaterial({depthTest:!1,depthWrite:!1,transparent:!0,side:n.DoubleSide,fog:!1,toneMapped:!1}),t=new n.LineBasicMaterial({depthTest:!1,depthWrite:!1,transparent:!0,linewidth:1,fog:!1,toneMapped:!1}),r=e.clone();r.opacity=.15;const i=e.clone();i.opacity=.33;const s=e.clone();s.color.set(16711680);const o=e.clone();o.color.set(65280);const l=e.clone();l.color.set(255);const c=e.clone();c.opacity=.25;const u=c.clone();u.color.set(16776960);const h=c.clone();h.color.set(65535);const d=c.clone();d.color.set(16711935);e.clone().color.set(16776960);const p=t.clone();p.color.set(16711680);const f=t.clone();f.color.set(65280);const m=t.clone();m.color.set(255);const g=t.clone();g.color.set(65535);const v=t.clone();v.color.set(16711935);const A=t.clone();A.color.set(16776960);const y=t.clone();y.color.set(7895160);const x=A.clone();x.opacity=.25;const b=new n.CylinderGeometry(0,.05,.2,12,1,!1),w=new n.BoxGeometry(.125,.125,.125),E=new n.BufferGeometry;E.setAttribute("position",new n.Float32BufferAttribute([0,0,0,1,0,0],3));const S=(e,t)=>{const r=new n.BufferGeometry,i=[];for(let n=0;n<=64*t;++n)i.push(0,Math.cos(n/32*Math.PI)*e,Math.sin(n/32*Math.PI)*e);return r.setAttribute("position",new n.Float32BufferAttribute(i,3)),r},M={X:[[new n.Mesh(b,s),[1,0,0],[0,0,-Math.PI/2],null,"fwd"],[new n.Mesh(b,s),[1,0,0],[0,0,Math.PI/2],null,"bwd"],[new n.Line(E,p)]],Y:[[new n.Mesh(b,o),[0,1,0],null,null,"fwd"],[new n.Mesh(b,o),[0,1,0],[Math.PI,0,0],null,"bwd"],[new n.Line(E,f),null,[0,0,Math.PI/2]]],Z:[[new n.Mesh(b,l),[0,0,1],[Math.PI/2,0,0],null,"fwd"],[new n.Mesh(b,l),[0,0,1],[-Math.PI/2,0,0],null,"bwd"],[new n.Line(E,m),null,[0,-Math.PI/2,0]]],XYZ:[[new n.Mesh(new n.OctahedronGeometry(.1,0),c.clone()),[0,0,0],[0,0,0]]],XY:[[new n.Mesh(new n.PlaneGeometry(.295,.295),u.clone()),[.15,.15,0]],[new n.Line(E,A),[.18,.3,0],null,[.125,1,1]],[new n.Line(E,A),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new n.Mesh(new n.PlaneGeometry(.295,.295),h.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new n.Line(E,g),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new n.Line(E,g),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new n.Mesh(new n.PlaneGeometry(.295,.295),d.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new n.Line(E,v),[.18,0,.3],null,[.125,1,1]],[new n.Line(E,v),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]},_={X:[[new n.Mesh(new n.CylinderGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new n.Mesh(new n.CylinderGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new n.Mesh(new n.CylinderGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new n.Mesh(new n.OctahedronGeometry(.2,0),r)]],XY:[[new n.Mesh(new n.PlaneGeometry(.4,.4),r),[.2,.2,0]]],YZ:[[new n.Mesh(new n.PlaneGeometry(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new n.Mesh(new n.PlaneGeometry(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},T={START:[[new n.Mesh(new n.OctahedronGeometry(.01,2),i),null,null,null,"helper"]],END:[[new n.Mesh(new n.OctahedronGeometry(.01,2),i),null,null,null,"helper"]],DELTA:[[new n.Line((()=>{const e=new n.BufferGeometry;return e.setAttribute("position",new n.Float32BufferAttribute([0,0,0,1,1,1],3)),e})(),i),null,null,null,"helper"]],X:[[new n.Line(E,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new n.Line(E,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new n.Line(E,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},C={X:[[new n.Line(S(1,.5),p)],[new n.Mesh(new n.OctahedronGeometry(.04,0),s),[0,0,.99],null,[1,3,1]]],Y:[[new n.Line(S(1,.5),f),null,[0,0,-Math.PI/2]],[new n.Mesh(new n.OctahedronGeometry(.04,0),o),[0,0,.99],null,[3,1,1]]],Z:[[new n.Line(S(1,.5),m),null,[0,Math.PI/2,0]],[new n.Mesh(new n.OctahedronGeometry(.04,0),l),[.99,0,0],null,[1,3,1]]],E:[[new n.Line(S(1.25,1),x),null,[0,Math.PI/2,0]],[new n.Mesh(new n.CylinderGeometry(.03,0,.15,4,1,!1),x),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new n.Mesh(new n.CylinderGeometry(.03,0,.15,4,1,!1),x),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new n.Mesh(new n.CylinderGeometry(.03,0,.15,4,1,!1),x),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new n.Mesh(new n.CylinderGeometry(.03,0,.15,4,1,!1),x),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new n.Line(S(1,1),y),null,[0,Math.PI/2,0]]]},I={AXIS:[[new n.Line(E,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},B={X:[[new n.Mesh(new n.TorusGeometry(1,.1,4,24),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new n.Mesh(new n.TorusGeometry(1,.1,4,24),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new n.Mesh(new n.TorusGeometry(1,.1,4,24),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new n.Mesh(new n.TorusGeometry(1.25,.1,2,24),r)]],XYZE:[[new n.Mesh(new n.SphereGeometry(.7,10,8),r)]]},R={X:[[new n.Mesh(w,s),[.8,0,0],[0,0,-Math.PI/2]],[new n.Line(E,p),null,null,[.8,1,1]]],Y:[[new n.Mesh(w,o),[0,.8,0]],[new n.Line(E,f),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new n.Mesh(w,l),[0,0,.8],[Math.PI/2,0,0]],[new n.Line(E,m),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new n.Mesh(w,u),[.85,.85,0],null,[2,2,.2]],[new n.Line(E,A),[.855,.98,0],null,[.125,1,1]],[new n.Line(E,A),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new n.Mesh(w,h),[0,.85,.85],null,[.2,2,2]],[new n.Line(E,g),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new n.Line(E,g),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new n.Mesh(w,d),[.85,0,.85],null,[2,.2,2]],[new n.Line(E,v),[.855,0,.98],null,[.125,1,1]],[new n.Line(E,v),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new n.Mesh(new n.BoxGeometry(.125,.125,.125),c.clone()),[1.1,0,0]]],XYZY:[[new n.Mesh(new n.BoxGeometry(.125,.125,.125),c.clone()),[0,1.1,0]]],XYZZ:[[new n.Mesh(new n.BoxGeometry(.125,.125,.125),c.clone()),[0,0,1.1]]]},P={X:[[new n.Mesh(new n.CylinderGeometry(.2,0,.8,4,1,!1),r),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new n.Mesh(new n.CylinderGeometry(.2,0,.8,4,1,!1),r),[0,.5,0]]],Z:[[new n.Mesh(new n.CylinderGeometry(.2,0,.8,4,1,!1),r),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new n.Mesh(w,r),[.85,.85,0],null,[3,3,.2]]],YZ:[[new n.Mesh(w,r),[0,.85,.85],null,[.2,3,3]]],XZ:[[new n.Mesh(w,r),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new n.Mesh(new n.BoxGeometry(.2,.2,.2),r),[1.1,0,0]]],XYZY:[[new n.Mesh(new n.BoxGeometry(.2,.2,.2),r),[0,1.1,0]]],XYZZ:[[new n.Mesh(new n.BoxGeometry(.2,.2,.2),r),[0,0,1.1]]]},F={X:[[new n.Line(E,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new n.Line(E,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new n.Line(E,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},L=e=>{const t=new n.Object3D;for(let r in e)for(let n=e[r].length;n--;){const i=e[r][n][0].clone(),a=e[r][n][1],s=e[r][n][2],o=e[r][n][3],l=e[r][n][4];i.name=r,i.tag=l,a&&i.position.set(a[0],a[1],a[2]),s&&i.rotation.set(s[0],s[1],s[2]),o&&i.scale.set(o[0],o[1],o[2]),i.updateMatrix();const c=i.geometry.clone();c.applyMatrix4(i.matrix),i.geometry=c,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t};this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=L(M)),this.add(this.gizmo.rotate=L(C)),this.add(this.gizmo.scale=L(R)),this.add(this.picker.translate=L(_)),this.add(this.picker.rotate=L(B)),this.add(this.picker.scale=L(P)),this.add(this.helper.translate=L(T)),this.add(this.helper.rotate=L(I)),this.add(this.helper.scale=L(F)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}}class l extends n.Mesh{constructor(){super(new n.PlaneGeometry(1e5,1e5,2,2),new n.MeshBasicMaterial({visible:!1,wireframe:!0,side:n.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),a(this,"isTransformControlsPlane",!0),a(this,"type","TransformControlsPlane"),a(this,"unitX",new n.Vector3(1,0,0)),a(this,"unitY",new n.Vector3(0,1,0)),a(this,"unitZ",new n.Vector3(0,0,1)),a(this,"tempVector",new n.Vector3),a(this,"dirVector",new n.Vector3),a(this,"alignVector",new n.Vector3),a(this,"tempMatrix",new n.Matrix4),a(this,"identityQuaternion",new n.Quaternion),a(this,"cameraQuaternion",new n.Quaternion),a(this,"worldPosition",new n.Vector3),a(this,"worldQuaternion",new n.Quaternion),a(this,"eye",new n.Vector3),a(this,"axis",null),a(this,"mode","translate"),a(this,"space","world"),a(this,"updateMatrixWorld",(()=>{let e=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(e="local"),this.unitX.set(1,0,0).applyQuaternion("local"===e?this.worldQuaternion:this.identityQuaternion),this.unitY.set(0,1,0).applyQuaternion("local"===e?this.worldQuaternion:this.identityQuaternion),this.unitZ.set(0,0,1).applyQuaternion("local"===e?this.worldQuaternion:this.identityQuaternion),this.alignVector.copy(this.unitY),this.mode){case"translate":case"scale":switch(this.axis){case"X":this.alignVector.copy(this.eye).cross(this.unitX),this.dirVector.copy(this.unitX).cross(this.alignVector);break;case"Y":this.alignVector.copy(this.eye).cross(this.unitY),this.dirVector.copy(this.unitY).cross(this.alignVector);break;case"Z":this.alignVector.copy(this.eye).cross(this.unitZ),this.dirVector.copy(this.unitZ).cross(this.alignVector);break;case"XY":this.dirVector.copy(this.unitZ);break;case"YZ":this.dirVector.copy(this.unitX);break;case"XZ":this.alignVector.copy(this.unitZ),this.dirVector.copy(this.unitY);break;case"XYZ":case"E":this.dirVector.set(0,0,0)}break;default:this.dirVector.set(0,0,0)}0===this.dirVector.length()?this.quaternion.copy(this.cameraQuaternion):(this.tempMatrix.lookAt(this.tempVector.set(0,0,0),this.dirVector,this.alignVector),this.quaternion.setFromRotationMatrix(this.tempMatrix)),super.updateMatrixWorld()}))}}},33785:(e,t,r)=>{"use strict";r.d(t,{e:()=>a});var n=r(99477),i=r(71246);class a extends n.Curve{constructor(e,t,r,i,a){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=i||0,this.endKnot=a||this.knots.length-1;for(let s=0;s<r.length;++s){const e=r[s];this.controlPoints[s]=new n.Vector4(e.x,e.y,e.z,e.w)}}getPoint(e,t){const r=t||new n.Vector3,a=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),s=(0,i.bF)(this.degree,this.knots,this.controlPoints,a);return 1!=s.w&&s.divideScalar(s.w),r.set(s.x,s.y,s.z)}getTangent(e,t){const r=t||new n.Vector3,a=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),s=(0,i.MI)(this.degree,this.knots,this.controlPoints,a,1);return r.copy(s[1]).normalize(),r}}},71246:(e,t,r)=>{"use strict";r.d(t,{EP:()=>a,HB:()=>o,MI:()=>h,Yb:()=>u,bF:()=>s,eR:()=>l,nl:()=>d,sj:()=>i,wD:()=>c});var n=r(99477);function i(e,t,r){const n=r.length-e-1;if(t>=r[n])return n-1;if(t<=r[e])return e;let i=e,a=n,s=Math.floor((i+a)/2);for(;t<r[s]||t>=r[s+1];)t<r[s]?a=s:i=s,s=Math.floor((i+a)/2);return s}function a(e,t,r,n){const i=[],a=[],s=[];i[0]=1;for(let o=1;o<=r;++o){a[o]=t-n[e+1-o],s[o]=n[e+o]-t;let r=0;for(let e=0;e<o;++e){const t=s[e+1],n=a[o-e],l=i[e]/(t+n);i[e]=r+t*l,r=n*l}i[o]=r}return i}function s(e,t,r,s){const o=i(e,s,t),l=a(o,s,e,t),c=new n.Vector4(0,0,0,0);for(let n=0;n<=e;++n){const t=r[o-e+n],i=l[n],a=t.w*i;c.x+=t.x*a,c.y+=t.y*a,c.z+=t.z*a,c.w+=t.w*i}return c}function o(e,t,r,n,i){const a=[];for(let h=0;h<=r;++h)a[h]=0;const s=[];for(let h=0;h<=n;++h)s[h]=a.slice(0);const o=[];for(let h=0;h<=r;++h)o[h]=a.slice(0);o[0][0]=1;const l=a.slice(0),c=a.slice(0);for(let h=1;h<=r;++h){l[h]=t-i[e+1-h],c[h]=i[e+h]-t;let r=0;for(let e=0;e<h;++e){const t=c[e+1],n=l[h-e];o[h][e]=t+n;const i=o[e][h-1]/o[h][e];o[e][h]=r+t*i,r=n*i}o[h][h]=r}for(let h=0;h<=r;++h)s[0][h]=o[h][r];for(let h=0;h<=r;++h){let e=0,t=1;const i=[];for(let n=0;n<=r;++n)i[n]=a.slice(0);i[0][0]=1;for(let a=1;a<=n;++a){let n=0;const l=h-a,c=r-a;h>=a&&(i[t][0]=i[e][0]/o[c+1][l],n=i[t][0]*o[l][c]);const u=h-1<=c?a-1:r-h;for(let r=l>=-1?1:-l;r<=u;++r)i[t][r]=(i[e][r]-i[e][r-1])/o[c+1][l+r],n+=i[t][r]*o[l+r][c];h<=c&&(i[t][a]=-i[e][a-1]/o[c+1][h],n+=i[t][a]*o[h][c]),s[a][h]=n;const d=e;e=t,t=d}}let u=r;for(let h=1;h<=n;++h){for(let e=0;e<=r;++e)s[h][e]*=u;u*=r-h}return s}function l(e,t,r,a,s){const l=s<e?s:e,c=[],u=i(e,a,t),h=o(u,a,e,l,t),d=[];for(let n=0;n<r.length;++n){const e=r[n].clone(),t=e.w;e.x*=t,e.y*=t,e.z*=t,d[n]=e}for(let n=0;n<=l;++n){const t=d[u-e].clone().multiplyScalar(h[n][0]);for(let r=1;r<=e;++r)t.add(d[u-e+r].clone().multiplyScalar(h[n][r]));c[n]=t}for(let i=l+1;i<=s+1;++i)c[i]=new n.Vector4(0,0,0);return c}function c(e,t){let r=1;for(let i=2;i<=e;++i)r*=i;let n=1;for(let i=2;i<=t;++i)n*=i;for(let i=2;i<=e-t;++i)n*=i;return r/n}function u(e){const t=e.length,r=[],i=[];for(let s=0;s<t;++s){const t=e[s];r[s]=new n.Vector3(t.x,t.y,t.z),i[s]=t.w}const a=[];for(let n=0;n<t;++n){const e=r[n].clone();for(let t=1;t<=n;++t)e.sub(a[n-t].clone().multiplyScalar(c(n,t)*i[t]));a[n]=e.divideScalar(i[0])}return a}function h(e,t,r,n,i){return u(l(e,t,r,n,i))}function d(e,t,r,s,o,l,c,u){const h=i(e,l,r),d=i(t,c,s),p=a(h,l,e,r),f=a(d,c,t,s),m=[];for(let i=0;i<=t;++i){m[i]=new n.Vector4(0,0,0,0);for(let r=0;r<=e;++r){const n=o[h-e+r][d-t+i].clone(),a=n.w;n.x*=a,n.y*=a,n.z*=a,m[i].add(n.multiplyScalar(p[r]))}}const g=new n.Vector4(0,0,0,0);for(let n=0;n<=t;++n)g.add(m[n].multiplyScalar(f[n]));g.divideScalar(g.w),u.set(g.x,g.y,g.z)}},84849:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ACESFilmicToneMappingShader:()=>Uo,AMFLoader:()=>Cm,ARButton:()=>Es,AdaptiveToneMappingPass:()=>La,AfterimagePass:()=>qa,AfterimageShader:()=>Wa,AmmoPhysics:()=>Fl,AnaglyphEffect:()=>kl,AnimationClipCreator:()=>nr,ArcballControls:()=>ji.A,AsciiEffect:()=>Ol,AssimpLoader:()=>Yp,BVHLoader:()=>rc,BasicShader:()=>No,BasisTextureLoader:()=>uf,BleachBypassShader:()=>ko,BlendShader:()=>Oo,BloomPass:()=>As,BlurShaderUtils:()=>Ha,BokehDepthShader:()=>Gn,BokehPass:()=>Ba,BokehShader:()=>Ta,BokehShader2:()=>On,BoxLineGeometry:()=>xo,BrightnessContrastShader:()=>Go,CCDIKHelper:()=>Ar,CCDIKSolver:()=>mr,CSM:()=>Lo,CSMFrustum:()=>_o,CSMHelper:()=>Do,CSMShader:()=>To,CSS2DObject:()=>Z,CSS2DRenderer:()=>ie,CSS3DObject:()=>le,CSS3DRenderer:()=>de,CSS3DSprite:()=>ce,CameraControls:()=>Pi,Capsule:()=>ui,CinematicCamera:()=>zn,CinquefoilKnot:()=>Xg,ClearMaskPass:()=>Ka.M,ClearPass:()=>$i,ColladaExporter:()=>jt,ColladaLoader:()=>nc,ColorConverter:()=>di,ColorCorrectionShader:()=>zo,ColorMapKeywords:()=>Ci,ColorifyShader:()=>Vo,ConvexGeometry:()=>y,ConvexHull:()=>f,ConvexObjectBreaker:()=>b,ConvolutionShader:()=>ms,CopyShader:()=>ga.C,CubeTexturePass:()=>Ga,DDSLoader:()=>tf,DOFMipMapShader:()=>Ho,DRACOExporter:()=>Vt,DRACOLoader:()=>Hm._,DecalGeometry:()=>bo,DecalVertex:()=>wo,DecoratedTorusKnot4a:()=>Kg,DecoratedTorusKnot4b:()=>Jg,DecoratedTorusKnot5a:()=>Zg,DecoratedTorusKnot5c:()=>$g,DepthLimitedBlurShader:()=>Va,DeviceOrientationControls:()=>Vi.W,DigitalGlitch:()=>ea,DotScreenPass:()=>ts,DotScreenShader:()=>Za,DragControls:()=>Gi,EXRLoader:()=>Kp,EdgeSplitModifier:()=>Le,EffectComposer:()=>Ja.x,FBXLoader:()=>zl.y,FXAAShader:()=>Qo,Face:()=>m,Face3:()=>av,FigureEightPolynomialKnot:()=>qg,FilmPass:()=>ma,FilmShader:()=>da,FirstPersonControls:()=>Ui.o,FlakesTexture:()=>be,Flow:()=>we.Zw,FlyControls:()=>Wi.m,FocusShader:()=>jo,Font:()=>jl,FontLoader:()=>Ql,FreiChenShader:()=>Wo,FresnelShader:()=>Xo,FullScreenQuad:()=>Ki.T,GCodeLoader:()=>af,GLTFExporter:()=>Qe,GLTFLoader:()=>Ss.E,GPUComputationRenderer:()=>w,GammaCorrectionShader:()=>Yo.Y,Geometry:()=>nv,GeometryCompressionUtils:()=>Nn,GeometryUtils:()=>bn,GlitchPass:()=>na,GodRaysCombineShader:()=>Jo,GodRaysDepthMaskShader:()=>qo,GodRaysFakeSunShader:()=>Zo,GodRaysGenerateShader:()=>Ko,GrannyKnot:()=>Gg,GroundProjectedEnv:()=>gn,Gyroscope:()=>I,HDRCubeTextureLoader:()=>Qm,HTMLMesh:()=>Sl,HalfEdge:()=>g,HalftonePass:()=>oa,HalftoneShader:()=>ia,HeartCurve:()=>zg,HelixCurve:()=>Qg,HorizontalBlurShader:()=>$o.P,HorizontalTiltShiftShader:()=>el,HueSaturationShader:()=>tl,ImprovedNoise:()=>Ai,InstancedFlow:()=>we.iJ,InteractiveGroup:()=>Bl,KMZLoader:()=>ic,KTX2Loader:()=>vc.a,KTXLoader:()=>Um,KaleidoShader:()=>rl,KnotCurve:()=>Hg,LDrawLoader:()=>dm,LUT3dlLoader:()=>ef,LUTCubeLoader:()=>ql,LUTPass:()=>qi,LWOLoader:()=>hg,Lensflare:()=>qr,LensflareElement:()=>Kr,LightProbeGenerator:()=>Ug,LightProbeHelper:()=>Mg,LightningStorm:()=>on,LightningStrike:()=>sn,Line2:()=>Eg.w,LineGeometry:()=>vg.L,LineMaterial:()=>Ag.Y,LineSegments2:()=>Sg.w,LineSegmentsGeometry:()=>gg.z,LottieLoader:()=>Ac,LuminosityHighPassShader:()=>Da,LuminosityShader:()=>Pa,Lut:()=>Ti,MD2Character:()=>X,MD2CharacterComplex:()=>l,MD2Loader:()=>s,MDDLoader:()=>qp,MMDAnimationHelper:()=>Cr,MMDExporter:()=>qt,MMDLoader:()=>Im,MMDPhysics:()=>yr,MTLLoader:()=>$l,MapControls:()=>Qi.o,MapControlsExp:()=>Li,MarchingCubes:()=>Zr,MaskPass:()=>Ka.F,MeshSurfaceSampler:()=>Vn.a,MeshoptDecoder:()=>sv.z,MirrorShader:()=>nl,MorphAnimMesh:()=>B,MorphBlendMesh:()=>o,MotionController:()=>$s,MotionControllerConstants:()=>Ws,NRRDLoader:()=>Kl,NURBSCurve:()=>kg.e,NURBSSurface:()=>Og,NormalMapShader:()=>il,OBB:()=>ai,OBJExporter:()=>tr,OBJLoader:()=>Tm,Octree:()=>_i,OculusHandModel:()=>Bs,OculusHandPointerModel:()=>Os,OrbitControls:()=>Qi.z,OrbitControlsExp:()=>Fi,OutlineEffect:()=>Nl,OutlinePass:()=>ya,PCDLoader:()=>ig,PDBLoader:()=>jm,PLYExporter:()=>kt,PLYLoader:()=>mg,PRWMLoader:()=>Jm,PVRLoader:()=>rf,PackedPhongMaterial:()=>kn,ParallaxBarrierEffect:()=>Dl,ParallaxShader:()=>al,ParametricGeometries:()=>go,ParametricGeometry:()=>fo,Pass:()=>Ki.w,PeppersGhostEffect:()=>Ul,PixelShader:()=>sl,PointerLockControls:()=>zi.q,PositionalAudioHelper:()=>Ig,ProgressiveLightMap:()=>J,Projector:()=>Ae,RGBELoader:()=>Xp.x,RGBMLoader:()=>eg,RGBShiftShader:()=>ol,RectAreaLightHelper:()=>Lg,RectAreaLightUniformsLib:()=>Dg,Reflector:()=>kr,ReflectorForSSRPass:()=>hn,ReflectorRTT:()=>ln,Refractor:()=>Vr,RenderPass:()=>ds.C,RenderPixelatedPass:()=>ps,RenderableFace:()=>fe,RenderableLine:()=>ge,RenderableObject:()=>pe,RenderableSprite:()=>ve,RenderableVertex:()=>me,Rhino3dmLoader:()=>mm,RollerCoasterGeometry:()=>R,RollerCoasterLiftersGeometry:()=>P,RollerCoasterShadowGeometry:()=>F,RoomEnvironment:()=>rr,RoughnessMipmapper:()=>Cn,RoundedBoxGeometry:()=>yo,SAOPass:()=>ja,SAOShader:()=>za,SMAABlendShader:()=>ua,SMAAEdgesShader:()=>la,SMAAPass:()=>ha,SMAAWeightsShader:()=>ca,SSAARenderPass:()=>ls,SSAOBlurShader:()=>wa,SSAODepthShader:()=>ba,SSAOPass:()=>Ma,SSAOShader:()=>xa,SSRBlurShader:()=>is,SSRDepthShader:()=>ns,SSRPass:()=>os,SSRShader:()=>rs,STATE:()=>Ri,STLExporter:()=>Zt,STLLoader:()=>Zl,SVGLoader:()=>pm,SVGObject:()=>ye,SVGRenderer:()=>xe,SavePass:()=>_a,SceneUtils:()=>vn,SelectionBox:()=>Pl.M,SelectionHelper:()=>Rl,SepiaShader:()=>ll,ShaderPass:()=>Xi.T,ShadowMapViewer:()=>Un,ShadowMesh:()=>Qr,SimplexNoise:()=>tn.L,SimplifyModifier:()=>Re,SkeletonUtils:()=>Ln,Sky:()=>dn.q,SkyGeometry:()=>L,SobelOperatorShader:()=>cl,StereoEffect:()=>Gl,SubsurfaceScatteringShader:()=>dl,TAARenderPass:()=>us,TDSLoader:()=>hf,TGALoader:()=>Xl,TTFLoader:()=>Wp,TeapotGeometry:()=>Eo,TechnicolorShader:()=>pl,TessellateModifier:()=>Ne,TextBufferGeometry:()=>So,TextGeometry:()=>So,TexturePass:()=>Ra,ThreeMFLoader:()=>Jp,TiltLoader:()=>km,Timer:()=>k,ToneMapShader:()=>Fa,ToonShader1:()=>fl,ToonShader2:()=>ml,ToonShaderDotted:()=>vl,ToonShaderHatching:()=>gl,TorusKnot:()=>Wg,TrackballControls:()=>Hi.$,TrackballControlsExp:()=>Di,TransformControls:()=>Ni.Ys,TransformControlsGizmo:()=>Ni.JW,TransformControlsPlane:()=>Ni.EC,TreesGeometry:()=>D,TrefoilKnot:()=>jg,TrefoilPolynomialKnot:()=>Yg,TriangleBlurShader:()=>Al,TubePainter:()=>q,USDZExporter:()=>Nt,UVsDebug:()=>An,UnpackDepthRGBAShader:()=>Dn,UnrealBloomPass:()=>Oa,VOXData3DTexture:()=>ng,VOXLoader:()=>tg,VOXMesh:()=>rg,VRButton:()=>Hs,VRMLLoader:()=>uc,VRMLoader:()=>ac,VTKLoader:()=>$p,VertexList:()=>A,VertexNode:()=>v,VertexNormalsHelper:()=>Fg,VertexTangentsHelper:()=>Cg,VerticalBlurShader:()=>yl.Z,VerticalTiltShiftShader:()=>xl,VignetteShader:()=>bl,VivianiCurve:()=>Vg,Volume:()=>K,VolumeRenderShader1:()=>wl,VolumeSlice:()=>Y,Water:()=>Jr,Water2:()=>mn,WaterPass:()=>ws,WaterRefractionShader:()=>El,Wireframe:()=>bg,WireframeGeometry2:()=>wg,XLoader:()=>tc,XRControllerModelFactory:()=>ao,XREstimatedLight:()=>oo,XRHandMeshModel:()=>Ts,XRHandModelFactory:()=>po,XRHandPrimitiveModel:()=>uo,XYZLoader:()=>Zp,calcBSplineDerivatives:()=>Ng.eR,calcBSplinePoint:()=>Ng.bF,calcBasisFunctionDerivatives:()=>Ng.HB,calcBasisFunctions:()=>Ng.EP,calcKoverI:()=>Ng.wD,calcNURBSDerivatives:()=>Ng.MI,calcRationalCurveDerivatives:()=>Ng.Yb,calcSurfacePoint:()=>Ng.nl,computeMorphedAttributes:()=>Ee.computeMorphedAttributes,createText:()=>Gs,edgeTable:()=>$r,estimateBytesUsed:()=>Ee.estimateBytesUsed,fetchProfile:()=>qs,fetchProfilesList:()=>Ys,findSpan:()=>Ng.sj,getErrorMessage:()=>W,getUniforms:()=>we.az,getWebGL2ErrorMessage:()=>j,getWebGLErrorMessage:()=>Q,initSplineTexture:()=>we.z_,interleaveAttributes:()=>Ee.interleaveAttributes,isWebGL2Available:()=>H,isWebGLAvailable:()=>V,mergeBufferAttributes:()=>Ee.mergeBufferAttributes,mergeBufferGeometries:()=>Ee.mergeBufferGeometries,mergeVertices:()=>Ee.mergeVertices,modifyShader:()=>we.i_,toCreasedNormals:()=>Ee.toCreasedNormals,toTrianglesDrawMode:()=>Ee.toTrianglesDrawMode,triTable:()=>en,updateSplineTexture:()=>we.TU});var n=r(99477);const a=[[-.525731,0,.850651],[-.442863,.238856,.864188],[-.295242,0,.955423],[-.309017,.5,.809017],[-.16246,.262866,.951056],[0,0,1],[0,.850651,.525731],[-.147621,.716567,.681718],[.147621,.716567,.681718],[0,.525731,.850651],[.309017,.5,.809017],[.525731,0,.850651],[.295242,0,.955423],[.442863,.238856,.864188],[.16246,.262866,.951056],[-.681718,.147621,.716567],[-.809017,.309017,.5],[-.587785,.425325,.688191],[-.850651,.525731,0],[-.864188,.442863,.238856],[-.716567,.681718,.147621],[-.688191,.587785,.425325],[-.5,.809017,.309017],[-.238856,.864188,.442863],[-.425325,.688191,.587785],[-.716567,.681718,-.147621],[-.5,.809017,-.309017],[-.525731,.850651,0],[0,.850651,-.525731],[-.238856,.864188,-.442863],[0,.955423,-.295242],[-.262866,.951056,-.16246],[0,1,0],[0,.955423,.295242],[-.262866,.951056,.16246],[.238856,.864188,.442863],[.262866,.951056,.16246],[.5,.809017,.309017],[.238856,.864188,-.442863],[.262866,.951056,-.16246],[.5,.809017,-.309017],[.850651,.525731,0],[.716567,.681718,.147621],[.716567,.681718,-.147621],[.525731,.850651,0],[.425325,.688191,.587785],[.864188,.442863,.238856],[.688191,.587785,.425325],[.809017,.309017,.5],[.681718,.147621,.716567],[.587785,.425325,.688191],[.955423,.295242,0],[1,0,0],[.951056,.16246,.262866],[.850651,-.525731,0],[.955423,-.295242,0],[.864188,-.442863,.238856],[.951056,-.16246,.262866],[.809017,-.309017,.5],[.681718,-.147621,.716567],[.850651,0,.525731],[.864188,.442863,-.238856],[.809017,.309017,-.5],[.951056,.16246,-.262866],[.525731,0,-.850651],[.681718,.147621,-.716567],[.681718,-.147621,-.716567],[.850651,0,-.525731],[.809017,-.309017,-.5],[.864188,-.442863,-.238856],[.951056,-.16246,-.262866],[.147621,.716567,-.681718],[.309017,.5,-.809017],[.425325,.688191,-.587785],[.442863,.238856,-.864188],[.587785,.425325,-.688191],[.688191,.587785,-.425325],[-.147621,.716567,-.681718],[-.309017,.5,-.809017],[0,.525731,-.850651],[-.525731,0,-.850651],[-.442863,.238856,-.864188],[-.295242,0,-.955423],[-.16246,.262866,-.951056],[0,0,-1],[.295242,0,-.955423],[.16246,.262866,-.951056],[-.442863,-.238856,-.864188],[-.309017,-.5,-.809017],[-.16246,-.262866,-.951056],[0,-.850651,-.525731],[-.147621,-.716567,-.681718],[.147621,-.716567,-.681718],[0,-.525731,-.850651],[.309017,-.5,-.809017],[.442863,-.238856,-.864188],[.16246,-.262866,-.951056],[.238856,-.864188,-.442863],[.5,-.809017,-.309017],[.425325,-.688191,-.587785],[.716567,-.681718,-.147621],[.688191,-.587785,-.425325],[.587785,-.425325,-.688191],[0,-.955423,-.295242],[0,-1,0],[.262866,-.951056,-.16246],[0,-.850651,.525731],[0,-.955423,.295242],[.238856,-.864188,.442863],[.262866,-.951056,.16246],[.5,-.809017,.309017],[.716567,-.681718,.147621],[.525731,-.850651,0],[-.238856,-.864188,-.442863],[-.5,-.809017,-.309017],[-.262866,-.951056,-.16246],[-.850651,-.525731,0],[-.716567,-.681718,-.147621],[-.716567,-.681718,.147621],[-.525731,-.850651,0],[-.5,-.809017,.309017],[-.238856,-.864188,.442863],[-.262866,-.951056,.16246],[-.864188,-.442863,.238856],[-.809017,-.309017,.5],[-.688191,-.587785,.425325],[-.681718,-.147621,.716567],[-.442863,-.238856,.864188],[-.587785,-.425325,.688191],[-.309017,-.5,.809017],[-.147621,-.716567,.681718],[-.425325,-.688191,.587785],[-.16246,-.262866,.951056],[.442863,-.238856,.864188],[.16246,-.262866,.951056],[.309017,-.5,.809017],[.147621,-.716567,.681718],[0,-.525731,.850651],[.425325,-.688191,.587785],[.587785,-.425325,.688191],[.688191,-.587785,.425325],[-.955423,.295242,0],[-.951056,.16246,.262866],[-1,0,0],[-.850651,0,.525731],[-.955423,-.295242,0],[-.951056,-.16246,.262866],[-.864188,.442863,-.238856],[-.951056,.16246,-.262866],[-.809017,.309017,-.5],[-.864188,-.442863,-.238856],[-.951056,-.16246,-.262866],[-.809017,-.309017,-.5],[-.681718,.147621,-.716567],[-.681718,-.147621,-.716567],[-.850651,0,-.525731],[-.688191,.587785,-.425325],[-.587785,.425325,-.688191],[-.425325,.688191,-.587785],[-.425325,-.688191,-.587785],[-.587785,-.425325,-.688191],[-.688191,-.587785,-.425325]];class s extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=this,s=new n.FileLoader(a.manager);s.setPath(a.path),s.setResponseType("arraybuffer"),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){const t=new DataView(e),r={},i=["ident","version","skinwidth","skinheight","framesize","num_skins","num_vertices","num_st","num_tris","num_glcmds","num_frames","offset_skins","offset_st","offset_tris","offset_frames","offset_glcmds","offset_end"];for(let n=0;n<i.length;n++)r[i[n]]=t.getInt32(4*n,!0);if(844121161!==r.ident||8!==r.version)return void console.error("Not a valid MD2 file");if(r.offset_end!==t.byteLength)return void console.error("Corrupted MD2 file");const s=new n.BufferGeometry,o=[];let l=r.offset_st;for(let n=0,a=r.num_st;n<a;n++){const e=t.getInt16(l+0,!0),n=t.getInt16(l+2,!0);o.push(e/r.skinwidth,1-n/r.skinheight),l+=4}l=r.offset_tris;const c=[],u=[];for(let n=0,a=r.num_tris;n<a;n++)c.push(t.getUint16(l+0,!0),t.getUint16(l+2,!0),t.getUint16(l+4,!0)),u.push(t.getUint16(l+6,!0),t.getUint16(l+8,!0),t.getUint16(l+10,!0)),l+=12;const h=new n.Vector3,d=new n.Vector3,p=[],f=[];l=r.offset_frames;for(let n=0,w=r.num_frames;n<w;n++){d.set(t.getFloat32(l+0,!0),t.getFloat32(l+4,!0),t.getFloat32(l+8,!0)),h.set(t.getFloat32(l+12,!0),t.getFloat32(l+16,!0),t.getFloat32(l+20,!0)),l+=24;for(let r=0;r<16;r++){const e=t.getUint8(l+r,!0);if(0===e)break;p[r]=e}const e={name:String.fromCharCode.apply(null,p),vertices:[],normals:[]};l+=16;for(let n=0;n<r.num_vertices;n++){let r=t.getUint8(l++,!0),n=t.getUint8(l++,!0),i=t.getUint8(l++,!0);const s=a[t.getUint8(l++,!0)];r=r*d.x+h.x,n=n*d.y+h.y,i=i*d.z+h.z,e.vertices.push(r,i,n),e.normals.push(s[0],s[2],s[1])}f.push(e)}const m=[],g=[],v=[],A=f[0].vertices,y=f[0].normals;for(let n=0,a=c.length;n<a;n++){let e=3*c[n];const t=A[e],r=A[e+1],i=A[e+2];m.push(t,r,i);const a=y[e],s=y[e+1],l=y[e+2];g.push(a,s,l);e=2*u[n];const h=o[e],d=o[e+1];v.push(h,d)}s.setAttribute("position",new n.Float32BufferAttribute(m,3)),s.setAttribute("normal",new n.Float32BufferAttribute(g,3)),s.setAttribute("uv",new n.Float32BufferAttribute(v,2));const x=[],b=[];for(let a=0,w=f.length;a<w;a++){const e=f[a],t=e.name;if(e.vertices.length>0){const r=[];for(let t=0,n=c.length;t<n;t++){const n=3*c[t],i=e.vertices[n],a=e.vertices[n+1],s=e.vertices[n+2];r.push(i,a,s)}const i=new n.Float32BufferAttribute(r,3);i.name=t,x.push(i)}if(e.normals.length>0){const r=[];for(let t=0,n=c.length;t<n;t++){const n=3*c[t],i=e.normals[n],a=e.normals[n+1],s=e.normals[n+2];r.push(i,a,s)}const i=new n.Float32BufferAttribute(r,3);i.name=t,b.push(i)}}return s.morphAttributes.position=x,s.morphAttributes.normal=b,s.morphTargetsRelative=!1,s.animations=n.AnimationClip.CreateClipsFromMorphTargetSequences(f,10),s}}class o extends n.Mesh{constructor(e,t){super(e,t),this.animationsMap={},this.animationsList=[];const r=Object.keys(this.morphTargetDictionary).length,n="__default",i=r-1,a=r/1;this.createAnimation(n,0,i,a),this.setAnimationWeight(n,1)}createAnimation(e,t,r,n){const i={start:t,end:r,length:r-t+1,fps:n,duration:(r-t)/n,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[e]=i,this.animationsList.push(i)}autoCreateAnimations(e){const t=/([a-z]+)_?(\d+)/i;let r;const n={};let i=0;for(const a in this.morphTargetDictionary){const e=a.match(t);if(e&&e.length>1){const t=e[1];n[t]||(n[t]={start:1/0,end:-1/0});const a=n[t];i<a.start&&(a.start=i),i>a.end&&(a.end=i),r||(r=t)}i++}for(const a in n){const t=n[a];this.createAnimation(a,t.start,t.end,e)}this.firstAnimation=r}setAnimationDirectionForward(e){const t=this.animationsMap[e];t&&(t.direction=1,t.directionBackwards=!1)}setAnimationDirectionBackward(e){const t=this.animationsMap[e];t&&(t.direction=-1,t.directionBackwards=!0)}setAnimationFPS(e,t){const r=this.animationsMap[e];r&&(r.fps=t,r.duration=(r.end-r.start)/r.fps)}setAnimationDuration(e,t){const r=this.animationsMap[e];r&&(r.duration=t,r.fps=(r.end-r.start)/r.duration)}setAnimationWeight(e,t){const r=this.animationsMap[e];r&&(r.weight=t)}setAnimationTime(e,t){const r=this.animationsMap[e];r&&(r.time=t)}getAnimationTime(e){let t=0;const r=this.animationsMap[e];return r&&(t=r.time),t}getAnimationDuration(e){let t=-1;const r=this.animationsMap[e];return r&&(t=r.duration),t}playAnimation(e){const t=this.animationsMap[e];t?(t.time=0,t.active=!0):console.warn("THREE.MorphBlendMesh: animation["+e+"] undefined in .playAnimation()")}stopAnimation(e){const t=this.animationsMap[e];t&&(t.active=!1)}update(e){for(let t=0,r=this.animationsList.length;t<r;t++){const r=this.animationsList[t];if(!r.active)continue;const i=r.duration/r.length;r.time+=r.direction*e,r.mirroredLoop?(r.time>r.duration||r.time<0)&&(r.direction*=-1,r.time>r.duration&&(r.time=r.duration,r.directionBackwards=!0),r.time<0&&(r.time=0,r.directionBackwards=!1)):(r.time=r.time%r.duration,r.time<0&&(r.time+=r.duration));const a=r.start+n.MathUtils.clamp(Math.floor(r.time/i),0,r.length-1),s=r.weight;a!==r.currentFrame&&(this.morphTargetInfluences[r.lastFrame]=0,this.morphTargetInfluences[r.currentFrame]=1*s,this.morphTargetInfluences[a]=0,r.lastFrame=r.currentFrame,r.currentFrame=a);let o=r.time%i/i;r.directionBackwards&&(o=1-o),r.currentFrame!==r.lastFrame?(this.morphTargetInfluences[r.currentFrame]=o*s,this.morphTargetInfluences[r.lastFrame]=(1-o)*s):this.morphTargetInfluences[r.currentFrame]=s}}}class l{constructor(){this.scale=1,this.animationFPS=6,this.transitionFrames=15,this.maxSpeed=275,this.maxReverseSpeed=-275,this.frontAcceleration=600,this.backAcceleration=600,this.frontDecceleration=600,this.angularSpeed=2.5,this.root=new n.Object3D,this.meshBody=null,this.meshWeapon=null,this.controls=null,this.skinsBody=[],this.skinsWeapon=[],this.weapons=[],this.currentSkin=void 0,this.onLoadComplete=function(){},this.meshes=[],this.animations={},this.loadCounter=0,this.speed=0,this.bodyOrientation=0,this.walkSpeed=this.maxSpeed,this.crouchSpeed=.5*this.maxSpeed,this.activeAnimation=null,this.oldAnimation=null}enableShadows(e){for(let t=0;t<this.meshes.length;t++)this.meshes[t].castShadow=e,this.meshes[t].receiveShadow=e}setVisible(e){for(let t=0;t<this.meshes.length;t++)this.meshes[t].visible=e,this.meshes[t].visible=e}shareParts(e){this.animations=e.animations,this.walkSpeed=e.walkSpeed,this.crouchSpeed=e.crouchSpeed,this.skinsBody=e.skinsBody,this.skinsWeapon=e.skinsWeapon;const t=this._createPart(e.meshBody.geometry,this.skinsBody[0]);t.scale.set(this.scale,this.scale,this.scale),this.root.position.y=e.root.position.y,this.root.add(t),this.meshBody=t,this.meshes.push(t);for(let r=0;r<e.weapons.length;r++){const t=this._createPart(e.weapons[r].geometry,this.skinsWeapon[r]);t.scale.set(this.scale,this.scale,this.scale),t.visible=!1,t.name=e.weapons[r].name,this.root.add(t),this.weapons[r]=t,this.meshWeapon=t,this.meshes.push(t)}}loadParts(e){const t=this;function r(e,t){const r=new n.TextureLoader,a=[];for(let s=0;s<t.length;s++)a[s]=r.load(e+t[s],i),a[s].mapping=n.UVMapping,a[s].name=t[s],"colorSpace"in a[s]?a[s].colorSpace="srgb":a[s].encoding=3001;return a}function i(){t.loadCounter-=1,0===t.loadCounter&&t.onLoadComplete()}this.animations=e.animations,this.walkSpeed=e.walkSpeed,this.crouchSpeed=e.crouchSpeed,this.loadCounter=2*e.weapons.length+e.skins.length+1;const a=[];for(let n=0;n<e.weapons.length;n++)a[n]=e.weapons[n][1];this.skinsBody=r(e.baseUrl+"skins/",e.skins),this.skinsWeapon=r(e.baseUrl+"skins/",a);const o=new s;o.load(e.baseUrl+e.body,(function(e){const r=new n.Box3;r.setFromBufferAttribute(e.attributes.position),t.root.position.y=-t.scale*r.min.y;const a=t._createPart(e,t.skinsBody[0]);a.scale.set(t.scale,t.scale,t.scale),t.root.add(a),t.meshBody=a,t.meshes.push(a),i()}));const l=function(e,r){return function(n){const a=t._createPart(n,t.skinsWeapon[e]);a.scale.set(t.scale,t.scale,t.scale),a.visible=!1,a.name=r,t.root.add(a),t.weapons[e]=a,t.meshWeapon=a,t.meshes.push(a),i()}};for(let n=0;n<e.weapons.length;n++)o.load(e.baseUrl+e.weapons[n][0],l(n,e.weapons[n][0]))}setPlaybackRate(e){this.meshBody&&(this.meshBody.duration=this.meshBody.baseDuration/e),this.meshWeapon&&(this.meshWeapon.duration=this.meshWeapon.baseDuration/e)}setWireframe(e){e?(this.meshBody&&(this.meshBody.material=this.meshBody.materialWireframe),this.meshWeapon&&(this.meshWeapon.material=this.meshWeapon.materialWireframe)):(this.meshBody&&(this.meshBody.material=this.meshBody.materialTexture),this.meshWeapon&&(this.meshWeapon.material=this.meshWeapon.materialTexture))}setSkin(e){this.meshBody&&!1===this.meshBody.material.wireframe&&(this.meshBody.material.map=this.skinsBody[e],this.currentSkin=e)}setWeapon(e){for(let r=0;r<this.weapons.length;r++)this.weapons[r].visible=!1;const t=this.weapons[e];t&&(t.visible=!0,this.meshWeapon=t,this.activeAnimation&&(t.playAnimation(this.activeAnimation),this.meshWeapon.setAnimationTime(this.activeAnimation,this.meshBody.getAnimationTime(this.activeAnimation))))}setAnimation(e){e!==this.activeAnimation&&e&&(this.meshBody&&(this.meshBody.setAnimationWeight(e,0),this.meshBody.playAnimation(e),this.oldAnimation=this.activeAnimation,this.activeAnimation=e,this.blendCounter=this.transitionFrames),this.meshWeapon&&(this.meshWeapon.setAnimationWeight(e,0),this.meshWeapon.playAnimation(e)))}update(e){this.controls&&this.updateMovementModel(e),this.animations&&(this.updateBehaviors(),this.updateAnimations(e))}updateAnimations(e){let t=1;this.blendCounter>0&&(t=(this.transitionFrames-this.blendCounter)/this.transitionFrames,this.blendCounter-=1),this.meshBody&&(this.meshBody.update(e),this.meshBody.setAnimationWeight(this.activeAnimation,t),this.meshBody.setAnimationWeight(this.oldAnimation,1-t)),this.meshWeapon&&(this.meshWeapon.update(e),this.meshWeapon.setAnimationWeight(this.activeAnimation,t),this.meshWeapon.setAnimationWeight(this.oldAnimation,1-t))}updateBehaviors(){const e=this.controls,t=this.animations;let r,n;e.crouch?(r=t.crouchMove,n=t.crouchIdle):(r=t.move,n=t.idle),e.jump&&(r=t.jump,n=t.jump),e.attack&&(e.crouch?(r=t.crouchAttack,n=t.crouchAttack):(r=t.attack,n=t.attack)),(e.moveForward||e.moveBackward||e.moveLeft||e.moveRight)&&this.activeAnimation!==r&&this.setAnimation(r),Math.abs(this.speed)<.2*this.maxSpeed&&!(e.moveLeft||e.moveRight||e.moveForward||e.moveBackward)&&this.activeAnimation!==n&&this.setAnimation(n),e.moveForward&&(this.meshBody&&(this.meshBody.setAnimationDirectionForward(this.activeAnimation),this.meshBody.setAnimationDirectionForward(this.oldAnimation)),this.meshWeapon&&(this.meshWeapon.setAnimationDirectionForward(this.activeAnimation),this.meshWeapon.setAnimationDirectionForward(this.oldAnimation))),e.moveBackward&&(this.meshBody&&(this.meshBody.setAnimationDirectionBackward(this.activeAnimation),this.meshBody.setAnimationDirectionBackward(this.oldAnimation)),this.meshWeapon&&(this.meshWeapon.setAnimationDirectionBackward(this.activeAnimation),this.meshWeapon.setAnimationDirectionBackward(this.oldAnimation)))}updateMovementModel(e){function t(e){return 1===e?1:1-Math.pow(2,-10*e)}const r=this.controls;r.crouch?this.maxSpeed=this.crouchSpeed:this.maxSpeed=this.walkSpeed,this.maxReverseSpeed=-this.maxSpeed,r.moveForward&&(this.speed=n.MathUtils.clamp(this.speed+e*this.frontAcceleration,this.maxReverseSpeed,this.maxSpeed)),r.moveBackward&&(this.speed=n.MathUtils.clamp(this.speed-e*this.backAcceleration,this.maxReverseSpeed,this.maxSpeed));if(r.moveLeft&&(this.bodyOrientation+=e*this.angularSpeed,this.speed=n.MathUtils.clamp(this.speed+1*e*this.frontAcceleration,this.maxReverseSpeed,this.maxSpeed)),r.moveRight&&(this.bodyOrientation-=e*this.angularSpeed,this.speed=n.MathUtils.clamp(this.speed+1*e*this.frontAcceleration,this.maxReverseSpeed,this.maxSpeed)),!r.moveForward&&!r.moveBackward)if(this.speed>0){const r=t(this.speed/this.maxSpeed);this.speed=n.MathUtils.clamp(this.speed-r*e*this.frontDecceleration,0,this.maxSpeed)}else{const r=t(this.speed/this.maxReverseSpeed);this.speed=n.MathUtils.clamp(this.speed+r*e*this.backAcceleration,this.maxReverseSpeed,0)}const i=this.speed*e;this.root.position.x+=Math.sin(this.bodyOrientation)*i,this.root.position.z+=Math.cos(this.bodyOrientation)*i,this.root.rotation.y=this.bodyOrientation}_createPart(e,t){const r=new n.MeshLambertMaterial({color:16755200,wireframe:!0,morphTargets:!0,morphNormals:!0}),i=new n.MeshLambertMaterial({color:16777215,wireframe:!1,map:t,morphTargets:!0,morphNormals:!0}),a=new o(e,i);return a.rotation.y=-Math.PI/2,a.materialTexture=i,a.materialWireframe=r,a.autoCreateAnimations(this.animationFPS),a}}const c=new n.Vector3,u=new n.Line3,h=new n.Plane,d=new n.Vector3,p=new n.Triangle;class f{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new A,this.unassigned=new A,this.vertices=[]}setFromPoints(e){if(e.length>=4){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.vertices.push(new v(e[t]));this.compute()}return this}setFromObject(e){const t=[];return e.updateMatrixWorld(!0),e.traverse((function(e){const r=e.geometry;if(void 0!==r){const i=r.attributes.position;if(void 0!==i)for(let r=0,a=i.count;r<a;r++){const a=new n.Vector3;a.fromBufferAttribute(i,r).applyMatrix4(e.matrixWorld),t.push(a)}}})),this.setFromPoints(t)}containsPoint(e){const t=this.faces;for(let r=0,n=t.length;r<n;r++){if(t[r].distanceToPoint(e)>this.tolerance)return!1}return!0}intersectRay(e,t){const r=this.faces;let n=-1/0,i=1/0;for(let a=0,s=r.length;a<s;a++){const t=r[a],s=t.distanceToPoint(e.origin),o=t.normal.dot(e.direction);if(s>0&&o>=0)return null;const l=0!==o?-s/o:0;if(!(l<=0)&&(o>0?i=Math.min(l,i):n=Math.max(l,n),n>i))return null}return n!==-1/0?e.at(n,t):e.at(i,t),t}intersectsRay(e){return null!==this.intersectRay(e,c)}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(e,t){return e.face=t,null===t.outside?this.assigned.append(e):this.assigned.insertBefore(t.outside,e),t.outside=e,this}removeVertexFromFace(e,t){return e===t.outside&&(null!==e.next&&e.next.face===t?t.outside=e.next:t.outside=null),this.assigned.remove(e),this}removeAllVerticesFromFace(e){if(null!==e.outside){const t=e.outside;let r=e.outside;for(;null!==r.next&&r.next.face===e;)r=r.next;return this.assigned.removeSubList(t,r),t.prev=r.next=null,e.outside=null,t}}deleteFaceVertices(e,t){const r=this.removeAllVerticesFromFace(e);if(void 0!==r)if(void 0===t)this.unassigned.appendChain(r);else{let e=r;do{const r=e.next;t.distanceToPoint(e.point)>this.tolerance?this.addVertexToFace(e,t):this.unassigned.append(e),e=r}while(null!==e)}return this}resolveUnassignedPoints(e){if(!1===this.unassigned.isEmpty()){let t=this.unassigned.first();do{const r=t.next;let n=this.tolerance,i=null;for(let a=0;a<e.length;a++){const r=e[a];if(0===r.mark){const e=r.distanceToPoint(t.point);if(e>n&&(n=e,i=r),n>1e3*this.tolerance)break}}null!==i&&this.addVertexToFace(t,i),t=r}while(null!==t)}return this}computeExtremes(){const e=new n.Vector3,t=new n.Vector3,r=[],i=[];for(let n=0;n<3;n++)r[n]=i[n]=this.vertices[0];e.copy(this.vertices[0].point),t.copy(this.vertices[0].point);for(let n=0,a=this.vertices.length;n<a;n++){const a=this.vertices[n],s=a.point;for(let t=0;t<3;t++)s.getComponent(t)<e.getComponent(t)&&(e.setComponent(t,s.getComponent(t)),r[t]=a);for(let e=0;e<3;e++)s.getComponent(e)>t.getComponent(e)&&(t.setComponent(e,s.getComponent(e)),i[e]=a)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(e.x),Math.abs(t.x))+Math.max(Math.abs(e.y),Math.abs(t.y))+Math.max(Math.abs(e.z),Math.abs(t.z))),{min:r,max:i}}computeInitialHull(){const e=this.vertices,t=this.computeExtremes(),r=t.min,n=t.max;let i=0,a=0;for(let u=0;u<3;u++){const e=n[u].point.getComponent(u)-r[u].point.getComponent(u);e>i&&(i=e,a=u)}const s=r[a],o=n[a];let l,c;i=0,u.set(s.point,o.point);for(let h=0,f=this.vertices.length;h<f;h++){const t=e[h];if(t!==s&&t!==o){u.closestPointToPoint(t.point,!0,d);const e=d.distanceToSquared(t.point);e>i&&(i=e,l=t)}}i=-1,h.setFromCoplanarPoints(s.point,o.point,l.point);for(let u=0,d=this.vertices.length;u<d;u++){const t=e[u];if(t!==s&&t!==o&&t!==l){const e=Math.abs(h.distanceToPoint(t.point));e>i&&(i=e,c=t)}}const p=[];if(h.distanceToPoint(c.point)<0){p.push(m.create(s,o,l),m.create(c,o,s),m.create(c,l,o),m.create(c,s,l));for(let e=0;e<3;e++){const t=(e+1)%3;p[e+1].getEdge(2).setTwin(p[0].getEdge(t)),p[e+1].getEdge(1).setTwin(p[t+1].getEdge(0))}}else{p.push(m.create(s,l,o),m.create(c,s,o),m.create(c,o,l),m.create(c,l,s));for(let e=0;e<3;e++){const t=(e+1)%3;p[e+1].getEdge(2).setTwin(p[0].getEdge((3-e)%3)),p[e+1].getEdge(0).setTwin(p[t+1].getEdge(1))}}for(let u=0;u<4;u++)this.faces.push(p[u]);for(let u=0,h=e.length;u<h;u++){const t=e[u];if(t!==s&&t!==o&&t!==l&&t!==c){i=this.tolerance;let e=null;for(let r=0;r<4;r++){const n=this.faces[r].distanceToPoint(t.point);n>i&&(i=n,e=this.faces[r])}null!==e&&this.addVertexToFace(t,e)}}return this}reindexFaces(){const e=[];for(let t=0;t<this.faces.length;t++){const r=this.faces[t];0===r.mark&&e.push(r)}return this.faces=e,this}nextVertexToAdd(){if(!1===this.assigned.isEmpty()){let e,t=0;const r=this.assigned.first().face;let n=r.outside;do{const i=r.distanceToPoint(n.point);i>t&&(t=i,e=n),n=n.next}while(null!==n&&n.face===r);return e}}computeHorizon(e,t,r,n){let i;this.deleteFaceVertices(r),r.mark=1,i=null===t?t=r.getEdge(0):t.next;do{const t=i.twin,r=t.face;0===r.mark&&(r.distanceToPoint(e)>this.tolerance?this.computeHorizon(e,t,r,n):n.push(i)),i=i.next}while(i!==t);return this}addAdjoiningFace(e,t){const r=m.create(e,t.tail(),t.head());return this.faces.push(r),r.getEdge(-1).setTwin(t.twin),r.getEdge(0)}addNewFaces(e,t){this.newFaces=[];let r=null,n=null;for(let i=0;i<t.length;i++){const a=t[i],s=this.addAdjoiningFace(e,a);null===r?r=s:s.next.setTwin(n),this.newFaces.push(s.face),n=s}return r.next.setTwin(n),this}addVertexToHull(e){const t=[];return this.unassigned.clear(),this.removeVertexFromFace(e,e.face),this.computeHorizon(e.point,null,e.face,t),this.addNewFaces(e,t),this.resolveUnassignedPoints(this.newFaces),this}cleanup(){return this.assigned.clear(),this.unassigned.clear(),this.newFaces=[],this}compute(){let e;for(this.computeInitialHull();void 0!==(e=this.nextVertexToAdd());)this.addVertexToHull(e);return this.reindexFaces(),this.cleanup(),this}}class m{constructor(){this.normal=new n.Vector3,this.midpoint=new n.Vector3,this.area=0,this.constant=0,this.outside=null,this.mark=0,this.edge=null}static create(e,t,r){const n=new m,i=new g(e,n),a=new g(t,n),s=new g(r,n);return i.next=s.prev=a,a.next=i.prev=s,s.next=a.prev=i,n.edge=i,n.compute()}getEdge(e){let t=this.edge;for(;e>0;)t=t.next,e--;for(;e<0;)t=t.prev,e++;return t}compute(){const e=this.edge.tail(),t=this.edge.head(),r=this.edge.next.head();return p.set(e.point,t.point,r.point),p.getNormal(this.normal),p.getMidpoint(this.midpoint),this.area=p.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(e){return this.normal.dot(e)-this.constant}}class g{constructor(e,t){this.vertex=e,this.prev=null,this.next=null,this.twin=null,this.face=t}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const e=this.head(),t=this.tail();return null!==t?t.point.distanceTo(e.point):-1}lengthSquared(){const e=this.head(),t=this.tail();return null!==t?t.point.distanceToSquared(e.point):-1}setTwin(e){return this.twin=e,e.twin=this,this}}class v{constructor(e){this.point=e,this.prev=null,this.next=null,this.face=null}}class A{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(e,t){return t.prev=e.prev,t.next=e,null===t.prev?this.head=t:t.prev.next=t,e.prev=t,this}insertAfter(e,t){return t.prev=e,t.next=e.next,null===t.next?this.tail=t:t.next.prev=t,e.next=t,this}append(e){return null===this.head?this.head=e:this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e,this}appendChain(e){for(null===this.head?this.head=e:this.tail.next=e,e.prev=this.tail;null!==e.next;)e=e.next;return this.tail=e,this}remove(e){return null===e.prev?this.head=e.next:e.prev.next=e.next,null===e.next?this.tail=e.prev:e.next.prev=e.prev,this}removeSubList(e,t){return null===e.prev?this.head=t.next:e.prev.next=t.next,null===t.next?this.tail=e.prev:t.next.prev=e.prev,this}isEmpty(){return null===this.head}}class y extends n.BufferGeometry{constructor(e=[]){super();const t=[],r=[],i=(new f).setFromPoints(e).faces;for(let n=0;n<i.length;n++){const e=i[n];let a=e.edge;do{const n=a.head().point;t.push(n.x,n.y,n.z),r.push(e.normal.x,e.normal.y,e.normal.z),a=a.next}while(a!==e.edge)}this.setAttribute("position",new n.Float32BufferAttribute(t,3)),this.setAttribute("normal",new n.Float32BufferAttribute(r,3))}}const x=new n.Vector3;class b{constructor(e=1.4,t=1e-4){this.minSizeForBreak=e,this.smallDelta=t,this.tempLine1=new n.Line3,this.tempPlane1=new n.Plane,this.tempPlane2=new n.Plane,this.tempPlane_Cut=new n.Plane,this.tempCM1=new n.Vector3,this.tempCM2=new n.Vector3,this.tempVector3=new n.Vector3,this.tempVector3_2=new n.Vector3,this.tempVector3_3=new n.Vector3,this.tempVector3_P0=new n.Vector3,this.tempVector3_P1=new n.Vector3,this.tempVector3_P2=new n.Vector3,this.tempVector3_N0=new n.Vector3,this.tempVector3_N1=new n.Vector3,this.tempVector3_AB=new n.Vector3,this.tempVector3_CB=new n.Vector3,this.tempResultObjects={object1:null,object2:null},this.segments=[];for(let r=0;r<900;r++)this.segments[r]=!1}prepareBreakableObject(e,t,r,n,i){const a=e.userData;a.mass=t,a.velocity=r.clone(),a.angularVelocity=n.clone(),a.breakable=i}subdivideByImpact(e,t,r,n,i){const a=[],s=this.tempPlane1,o=this.tempPlane2;this.tempVector3.addVectors(t,r),s.setFromCoplanarPoints(t,e.position,this.tempVector3);const l=i+n,c=this;return function i(u,h,d,p){if(Math.random()<.05*p||p>l)return void a.push(u);let f=Math.PI;0===p?(o.normal.copy(s.normal),o.constant=s.constant):p<=n?(f=(d-h)*(.2+.6*Math.random())+h,c.tempVector3_2.copy(e.position).sub(t).applyAxisAngle(r,f).add(t),o.setFromCoplanarPoints(t,c.tempVector3,c.tempVector3_2)):(f=(.5*(1&p)+.2*(2-Math.random()))*Math.PI,c.tempVector3_2.copy(t).sub(u.position).applyAxisAngle(r,f).add(u.position),c.tempVector3_3.copy(r).add(u.position),o.setFromCoplanarPoints(u.position,c.tempVector3_3,c.tempVector3_2)),c.cutByPlane(u,o,c.tempResultObjects);const m=c.tempResultObjects.object1,g=c.tempResultObjects.object2;m&&i(m,h,f,p+1),g&&i(g,f,d,p+1)}(e,0,2*Math.PI,0),a}cutByPlane(e,t,r){const i=e.geometry,a=i.attributes.position.array,s=i.attributes.normal.array,o=a.length/3;let l=o/3,c=i.getIndex();function u(e,t){const r=3*e+t;return c?c[r]:r}c&&(c=c.array,l=c.length/3);const h=[],d=[],p=this.smallDelta,f=o*o;for(let n=0;n<f;n++)this.segments[n]=!1;const m=this.tempVector3_P0,g=this.tempVector3_P1,v=this.tempVector3_N0,A=this.tempVector3_N1;for(let n=0;n<l-1;n++){const e=u(n,0),t=u(n,1),r=u(n,2);v.set(s[e],s[e]+1,s[e]+2);for(let i=n+1;i<l;i++){const n=u(i,0),a=u(i,1),l=u(i,2);A.set(s[n],s[n]+1,s[n]+2);1-v.dot(A)<p&&(e===n||e===a||e===l?t===n||t===a||t===l?(this.segments[e*o+t]=!0,this.segments[t*o+e]=!0):(this.segments[r*o+e]=!0,this.segments[e*o+r]=!0):t!==n&&t!==a&&t!==l||(this.segments[r*o+t]=!0,this.segments[t*o+r]=!0))}}const x=this.tempPlane_Cut;e.updateMatrix(),b.transformPlaneToLocalSpace(t,e.matrix,x);for(let y=0;y<l;y++){const e=u(y,0),t=u(y,1),i=u(y,2);for(let s=0;s<3;s++){const l=0===s?e:1===s?t:i,c=0===s?t:1===s?i:e;if(this.segments[l*o+c])continue;this.segments[l*o+c]=!0,this.segments[c*o+l]=!0,m.set(a[3*l],a[3*l+1],a[3*l+2]),g.set(a[3*c],a[3*c+1],a[3*c+2]);let u=0,f=x.distanceToPoint(m);f>p?(u=2,d.push(m.clone())):f<-p?(u=1,h.push(m.clone())):(u=3,h.push(m.clone()),d.push(m.clone()));let v=0;if(f=x.distanceToPoint(g),f>p?(v=2,d.push(g.clone())):f<-p?(v=1,h.push(g.clone())):(v=3,h.push(g.clone()),d.push(g.clone())),1===u&&2===v||2===u&&1===v){this.tempLine1.start.copy(m),this.tempLine1.end.copy(g);let e=new n.Vector3;if(e=x.intersectLine(this.tempLine1,e),null===e)return console.error("Internal error: segment does not intersect plane."),r.segmentedObject1=null,r.segmentedObject2=null,0;h.push(e),d.push(e.clone())}}}const w=.5*e.userData.mass;this.tempCM1.set(0,0,0);let E=0;const S=h.length;if(S>0){for(let e=0;e<S;e++)this.tempCM1.add(h[e]);this.tempCM1.divideScalar(S);for(let e=0;e<S;e++){const t=h[e];t.sub(this.tempCM1),E=Math.max(E,t.x,t.y,t.z)}this.tempCM1.add(e.position)}this.tempCM2.set(0,0,0);let M=0;const _=d.length;if(_>0){for(let e=0;e<_;e++)this.tempCM2.add(d[e]);this.tempCM2.divideScalar(_);for(let e=0;e<_;e++){const t=d[e];t.sub(this.tempCM2),M=Math.max(M,t.x,t.y,t.z)}this.tempCM2.add(e.position)}let T=null,C=null,I=0;return S>4&&(T=new n.Mesh(new y(h),e.material),T.position.copy(this.tempCM1),T.quaternion.copy(e.quaternion),this.prepareBreakableObject(T,w,e.userData.velocity,e.userData.angularVelocity,2*E>this.minSizeForBreak),I++),_>4&&(C=new n.Mesh(new y(d),e.material),C.position.copy(this.tempCM2),C.quaternion.copy(e.quaternion),this.prepareBreakableObject(C,w,e.userData.velocity,e.userData.angularVelocity,2*M>this.minSizeForBreak),I++),r.object1=T,r.object2=C,I}static transformFreeVector(e,t){const r=e.x,n=e.y,i=e.z,a=t.elements;return e.x=a[0]*r+a[4]*n+a[8]*i,e.y=a[1]*r+a[5]*n+a[9]*i,e.z=a[2]*r+a[6]*n+a[10]*i,e}static transformFreeVectorInverse(e,t){const r=e.x,n=e.y,i=e.z,a=t.elements;return e.x=a[0]*r+a[1]*n+a[2]*i,e.y=a[4]*r+a[5]*n+a[6]*i,e.z=a[8]*r+a[9]*n+a[10]*i,e}static transformTiedVectorInverse(e,t){const r=e.x,n=e.y,i=e.z,a=t.elements;return e.x=a[0]*r+a[1]*n+a[2]*i-a[12],e.y=a[4]*r+a[5]*n+a[6]*i-a[13],e.z=a[8]*r+a[9]*n+a[10]*i-a[14],e}static transformPlaneToLocalSpace(e,t,r){r.normal.copy(e.normal),r.constant=e.constant;const n=b.transformTiedVectorInverse(e.coplanarPoint(x),t);b.transformFreeVectorInverse(r.normal,t),r.constant=-n.dot(r.normal)}}class w{constructor(e,t,r){this.variables=[],this.currentTextureIndex=0;let i=n.FloatType;const a=new n.Scene,s=new n.Camera;s.position.z=1;const o={passThruTexture:{value:null}},l=h("uniform sampler2D passThruTexture;\n\nvoid main() {\n\n\tvec2 uv = gl_FragCoord.xy / resolution.xy;\n\n\tgl_FragColor = texture2D( passThruTexture, uv );\n\n}\n",o),c=new n.Mesh(new n.PlaneGeometry(2,2),l);function u(r){r.defines.resolution="vec2( "+e.toFixed(1)+", "+t.toFixed(1)+" )"}function h(e,t){t=t||{};const r=new n.ShaderMaterial({uniforms:t,vertexShader:"void main()\t{\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n",fragmentShader:e});return u(r),r}a.add(c),this.setDataType=function(e){return i=e,this},this.addVariable=function(e,t,r){const i={name:e,initialValueTexture:r,material:this.createShaderMaterial(t),dependencies:null,renderTargets:[],wrapS:null,wrapT:null,minFilter:n.NearestFilter,magFilter:n.NearestFilter};return this.variables.push(i),i},this.setVariableDependencies=function(e,t){e.dependencies=t},this.init=function(){if(!1===r.capabilities.isWebGL2&&!1===r.extensions.has("OES_texture_float"))return"No OES_texture_float support for float textures.";if(0===r.capabilities.maxVertexTextures)return"No support for vertex shader textures.";for(let r=0;r<this.variables.length;r++){const n=this.variables[r];n.renderTargets[0]=this.createRenderTarget(e,t,n.wrapS,n.wrapT,n.minFilter,n.magFilter),n.renderTargets[1]=this.createRenderTarget(e,t,n.wrapS,n.wrapT,n.minFilter,n.magFilter),this.renderTexture(n.initialValueTexture,n.renderTargets[0]),this.renderTexture(n.initialValueTexture,n.renderTargets[1]);const i=n.material,a=i.uniforms;if(null!==n.dependencies)for(let e=0;e<n.dependencies.length;e++){const t=n.dependencies[e];if(t.name!==n.name){let e=!1;for(let r=0;r<this.variables.length;r++)if(t.name===this.variables[r].name){e=!0;break}if(!e)return"Variable dependency not found. Variable="+n.name+", dependency="+t.name}a[t.name]={value:null},i.fragmentShader="\nuniform sampler2D "+t.name+";\n"+i.fragmentShader}}return this.currentTextureIndex=0,null},this.compute=function(){const e=this.currentTextureIndex,t=0===this.currentTextureIndex?1:0;for(let r=0,n=this.variables.length;r<n;r++){const n=this.variables[r];if(null!==n.dependencies){const t=n.material.uniforms;for(let r=0,i=n.dependencies.length;r<i;r++){const i=n.dependencies[r];t[i.name].value=i.renderTargets[e].texture}}this.doRenderTarget(n.material,n.renderTargets[t])}this.currentTextureIndex=t},this.getCurrentRenderTarget=function(e){return e.renderTargets[this.currentTextureIndex]},this.getAlternateRenderTarget=function(e){return e.renderTargets[0===this.currentTextureIndex?1:0]},this.dispose=function(){c.geometry.dispose(),c.material.dispose();const e=this.variables;for(let t=0;t<e.length;t++){const r=e[t];r.initialValueTexture&&r.initialValueTexture.dispose();const n=r.renderTargets;for(let e=0;e<n.length;e++){n[e].dispose()}}},this.addResolutionDefine=u,this.createShaderMaterial=h,this.createRenderTarget=function(r,a,s,o,l,c){r=r||e,a=a||t,s=s||n.ClampToEdgeWrapping,o=o||n.ClampToEdgeWrapping,l=l||n.NearestFilter,c=c||n.NearestFilter;return new n.WebGLRenderTarget(r,a,{wrapS:s,wrapT:o,minFilter:l,magFilter:c,format:n.RGBAFormat,type:i,depthBuffer:!1})},this.createTexture=function(){const r=new Float32Array(e*t*4),i=new n.DataTexture(r,e,t,n.RGBAFormat,n.FloatType);return i.needsUpdate=!0,i},this.renderTexture=function(e,t){o.passThruTexture.value=e,this.doRenderTarget(l,t),o.passThruTexture.value=null},this.doRenderTarget=function(e,t){const i=r.getRenderTarget(),o=r.xr.enabled,u=r.shadowMap.autoUpdate,h=r.outputColorSpace,d=r.toneMapping;r.xr.enabled=!1,r.shadowMap.autoUpdate=!1,"outputColorSpace"in r?r.outputColorSpace="srgb-linear":r.encoding=3e3,r.toneMapping=n.NoToneMapping,c.material=e,r.setRenderTarget(t),r.render(a,s),c.material=l,r.xr.enabled=o,r.shadowMap.autoUpdate=u,r.outputColorSpace=h,r.toneMapping=d,r.setRenderTarget(i)}}}const E=new n.Vector3,S=new n.Quaternion,M=new n.Vector3,_=new n.Vector3,T=new n.Quaternion,C=new n.Vector3;class I extends n.Object3D{constructor(){super()}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null!==this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(_,T,C),this.matrix.decompose(E,S,M),this.matrixWorld.compose(_,S,C)):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(let t=0,r=this.children.length;t<r;t++)this.children[t].updateMatrixWorld(e)}}class B extends n.Mesh{constructor(e,t){super(e,t),this.type="MorphAnimMesh",this.mixer=new n.AnimationMixer(this),this.activeAction=null}setDirectionForward(){this.mixer.timeScale=1}setDirectionBackward(){this.mixer.timeScale=-1}playAnimation(e,t){this.activeAction&&(this.activeAction.stop(),this.activeAction=null);const r=n.AnimationClip.findByName(this,e);if(!r)throw new Error("THREE.MorphAnimMesh: animations["+e+"] undefined in .playAnimation()");{const e=this.mixer.clipAction(r);e.timeScale=r.tracks.length*t/r.duration,this.activeAction=e.play()}}updateAnimation(e){this.mixer.update(e)}copy(e,t){return super.copy(e,t),this.mixer=new n.AnimationMixer(this),this}}class R extends n.BufferGeometry{constructor(e,t){super();const r=[],i=[],a=[],s=[1,1,1],o=[1,1,0],l=new n.Vector3(0,1,0),c=new n.Vector3,u=new n.Vector3,h=new n.Quaternion,d=new n.Quaternion;d.setFromAxisAngle(l,Math.PI/2);const p=new n.Vector3,f=new n.Vector3;f.copy(e.getPointAt(0));const m=[new n.Vector3(-.225,0,0),new n.Vector3(0,-.05,0),new n.Vector3(0,-.175,0),new n.Vector3(0,-.05,0),new n.Vector3(.225,0,0),new n.Vector3(0,-.175,0)],g=2*Math.PI;let v=5;const A=[];for(let F=0;F<v;F++){const e=F/v*g;A.push(new n.Vector3(.06*Math.sin(e),.06*Math.cos(e),0))}v=6;const y=[];for(let F=0;F<v;F++){const e=F/v*g;y.push(new n.Vector3(.025*Math.sin(e),.025*Math.cos(e),0))}const x=new n.Vector3,b=new n.Vector3;function w(e,t){b.set(0,0,-1).applyQuaternion(h);for(let n=0;n<e.length;n++)x.copy(e[n]),x.applyQuaternion(h),x.add(p),r.push(x.x,x.y,x.z),i.push(b.x,b.y,b.z),a.push(t[0],t[1],t[2]);b.set(0,0,1).applyQuaternion(h);for(let n=e.length-1;n>=0;n--)x.copy(e[n]),x.applyQuaternion(h),x.add(p),r.push(x.x,x.y,x.z),i.push(b.x,b.y,b.z),a.push(t[0],t[1],t[2])}const E=new n.Vector3,S=new n.Vector3,M=new n.Vector3,_=new n.Vector3,T=new n.Vector3,C=new n.Vector3,I=new n.Vector3,B=new n.Vector3;function R(e,t,n){for(let s=0,o=e.length;s<o;s++){const l=e[s],c=e[(s+1)%o];E.copy(l).add(t),E.applyQuaternion(h),E.add(p),S.copy(c).add(t),S.applyQuaternion(h),S.add(p),M.copy(c).add(t),M.applyQuaternion(d),M.add(f),_.copy(l).add(t),_.applyQuaternion(d),_.add(f),r.push(E.x,E.y,E.z),r.push(S.x,S.y,S.z),r.push(_.x,_.y,_.z),r.push(S.x,S.y,S.z),r.push(M.x,M.y,M.z),r.push(_.x,_.y,_.z),T.copy(l),T.applyQuaternion(h),T.normalize(),C.copy(c),C.applyQuaternion(h),C.normalize(),I.copy(c),I.applyQuaternion(d),I.normalize(),B.copy(l),B.applyQuaternion(d),B.normalize(),i.push(T.x,T.y,T.z),i.push(C.x,C.y,C.z),i.push(B.x,B.y,B.z),i.push(C.x,C.y,C.z),i.push(I.x,I.y,I.z),i.push(B.x,B.y,B.z),a.push(n[0],n[1],n[2]),a.push(n[0],n[1],n[2]),a.push(n[0],n[1],n[2]),a.push(n[0],n[1],n[2]),a.push(n[0],n[1],n[2]),a.push(n[0],n[1],n[2])}}const P=new n.Vector3;for(let n=1;n<=t;n++){p.copy(e.getPointAt(n/t)),l.set(0,1,0),c.subVectors(p,f).normalize(),u.crossVectors(l,c).normalize(),l.crossVectors(c,u);const r=Math.atan2(c.x,c.z);h.setFromAxisAngle(l,r),n%2==0&&w(m,o),R(A,P.set(0,-.125,0),o),R(y,P.set(.2,0,0),s),R(y,P.set(-.2,0,0),s),f.copy(p),d.copy(h)}this.setAttribute("position",new n.BufferAttribute(new Float32Array(r),3)),this.setAttribute("normal",new n.BufferAttribute(new Float32Array(i),3)),this.setAttribute("color",new n.BufferAttribute(new Float32Array(a),3))}}class P extends n.BufferGeometry{constructor(e,t){super();const r=[],i=[],a=new n.Quaternion,s=new n.Vector3(0,1,0),o=new n.Vector3,l=new n.Vector3,c=[new n.Vector3(0,.05,-.05),new n.Vector3(0,.05,.05),new n.Vector3(0,-.05,0)],u=[new n.Vector3(-.05,0,.05),new n.Vector3(-.05,0,-.05),new n.Vector3(.05,0,0)],h=[new n.Vector3(.05,0,-.05),new n.Vector3(.05,0,.05),new n.Vector3(-.05,0,0)],d=new n.Vector3,p=new n.Vector3,f=new n.Vector3,m=new n.Vector3,g=new n.Vector3,v=new n.Vector3,A=new n.Vector3,y=new n.Vector3;function x(e,t,n){for(let s=0,o=e.length;s<o;s++){const l=e[s],c=e[(s+1)%o];d.copy(l),d.applyQuaternion(a),d.add(t),p.copy(c),p.applyQuaternion(a),p.add(t),f.copy(c),f.applyQuaternion(a),f.add(n),m.copy(l),m.applyQuaternion(a),m.add(n),r.push(d.x,d.y,d.z),r.push(p.x,p.y,p.z),r.push(m.x,m.y,m.z),r.push(p.x,p.y,p.z),r.push(f.x,f.y,f.z),r.push(m.x,m.y,m.z),g.copy(l),g.applyQuaternion(a),g.normalize(),v.copy(c),v.applyQuaternion(a),v.normalize(),A.copy(c),A.applyQuaternion(a),A.normalize(),y.copy(l),y.applyQuaternion(a),y.normalize(),i.push(g.x,g.y,g.z),i.push(v.x,v.y,v.z),i.push(y.x,y.y,y.z),i.push(v.x,v.y,v.z),i.push(A.x,A.y,A.z),i.push(y.x,y.y,y.z)}}const b=new n.Vector3,w=new n.Vector3;for(let n=1;n<=t;n++){o.copy(e.getPointAt(n/t)),l.copy(e.getTangentAt(n/t));const r=Math.atan2(l.x,l.z);a.setFromAxisAngle(s,r),o.y>10?(b.set(-.75,-.35,0),b.applyQuaternion(a),b.add(o),w.set(.75,-.35,0),w.applyQuaternion(a),w.add(o),x(c,b,w),b.set(-.7,-.3,0),b.applyQuaternion(a),b.add(o),w.set(-.7,-o.y,0),w.applyQuaternion(a),w.add(o),x(u,b,w),b.set(.7,-.3,0),b.applyQuaternion(a),b.add(o),w.set(.7,-o.y,0),w.applyQuaternion(a),w.add(o),x(h,b,w)):(b.set(0,-.2,0),b.applyQuaternion(a),b.add(o),w.set(0,-o.y,0),w.applyQuaternion(a),w.add(o),x(h,b,w))}this.setAttribute("position",new n.BufferAttribute(new Float32Array(r),3)),this.setAttribute("normal",new n.BufferAttribute(new Float32Array(i),3))}}class F extends n.BufferGeometry{constructor(e,t){super();const r=[],i=new n.Vector3(0,1,0),a=new n.Vector3,s=new n.Quaternion,o=new n.Quaternion;o.setFromAxisAngle(i,Math.PI/2);const l=new n.Vector3,c=new n.Vector3;c.copy(e.getPointAt(0)),c.y=0;const u=new n.Vector3,h=new n.Vector3,d=new n.Vector3,p=new n.Vector3;for(let n=1;n<=t;n++){l.copy(e.getPointAt(n/t)),l.y=0,a.subVectors(l,c);const f=Math.atan2(a.x,a.z);s.setFromAxisAngle(i,f),u.set(-.3,0,0),u.applyQuaternion(s),u.add(l),h.set(.3,0,0),h.applyQuaternion(s),h.add(l),d.set(.3,0,0),d.applyQuaternion(o),d.add(c),p.set(-.3,0,0),p.applyQuaternion(o),p.add(c),r.push(u.x,u.y,u.z),r.push(h.x,h.y,h.z),r.push(p.x,p.y,p.z),r.push(h.x,h.y,h.z),r.push(d.x,d.y,d.z),r.push(p.x,p.y,p.z),c.copy(l),o.copy(s)}this.setAttribute("position",new n.BufferAttribute(new Float32Array(r),3))}}class L extends n.BufferGeometry{constructor(){super();const e=[];for(let t=0;t<100;t++){const t=800*Math.random()-400,r=50*Math.random()+50,n=800*Math.random()-400,i=40*Math.random()+20;e.push(t-i,r,n-i),e.push(t+i,r,n-i),e.push(t-i,r,n+i),e.push(t+i,r,n-i),e.push(t+i,r,n+i),e.push(t-i,r,n+i)}this.setAttribute("position",new n.BufferAttribute(new Float32Array(e),3))}}class D extends n.BufferGeometry{constructor(e){super();const t=[],r=[],i=new n.Raycaster;i.ray.direction.set(0,-1,0);const a=new n.Color;for(let n=0;n<2e3;n++){const n=500*Math.random()-250,s=500*Math.random()-250;i.ray.origin.set(n,50,s);const o=i.intersectObject(e);if(0===o.length)continue;const l=o[0].point.y,c=5*Math.random()+.5;let u=Math.random()*Math.PI*2;t.push(n+Math.sin(u),l,s+Math.cos(u)),t.push(n,l+c,s),t.push(n+Math.sin(u+Math.PI),l,s+Math.cos(u+Math.PI)),u+=Math.PI/2,t.push(n+Math.sin(u),l,s+Math.cos(u)),t.push(n,l+c,s),t.push(n+Math.sin(u+Math.PI),l,s+Math.cos(u+Math.PI));const h=.1*Math.random();for(let e=0;e<6;e++)a.setRGB(.2+h,.4+h,0,"srgb"),r.push(a.r,a.g,a.b)}this.setAttribute("position",new n.BufferAttribute(new Float32Array(t),3)),this.setAttribute("color",new n.BufferAttribute(new Float32Array(r),3))}}var U=Object.defineProperty,N=(e,t,r)=>(((e,t,r)=>{t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class k{constructor(){N(this,"_previousTime"),N(this,"_currentTime"),N(this,"_delta"),N(this,"_elapsed"),N(this,"_timescale"),N(this,"_useFixedDelta"),N(this,"_fixedDelta"),N(this,"_usePageVisibilityAPI"),N(this,"_pageVisibilityHandler"),this._previousTime=0,this._currentTime=0,this._delta=0,this._elapsed=0,this._timescale=1,this._useFixedDelta=!1,this._fixedDelta=16.67,this._usePageVisibilityAPI="undefined"!=typeof document&&void 0!==document.hidden}connect(){return this._usePageVisibilityAPI&&(this._pageVisibilityHandler=O.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler,!1)),this}dispose(){return this._usePageVisibilityAPI&&this._pageVisibilityHandler&&document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this}disableFixedDelta(){return this._useFixedDelta=!1,this}enableFixedDelta(){return this._useFixedDelta=!0,this}getDelta(){return this._delta/1e3}getElapsedTime(){return this._elapsed/1e3}getFixedDelta(){return this._fixedDelta/1e3}getTimescale(){return this._timescale}reset(){return this._currentTime=this._now(),this}setFixedDelta(e){return this._fixedDelta=1e3*e,this}setTimescale(e){return this._timescale=e,this}update(){return!0===this._useFixedDelta?this._delta=this._fixedDelta:(this._previousTime=this._currentTime,this._currentTime=this._now(),this._delta=this._currentTime-this._previousTime),this._delta*=this._timescale,this._elapsed+=this._delta,this}get elapsedTime(){return this.getElapsedTime()}_now(){return("undefined"==typeof performance?Date:performance).now()}}function O(){!1===document.hidden&&this.reset()}let G,z;function V(){var e;if(void 0!==G)return G;try{let t;const r=document.createElement("canvas");return G=!(!window.WebGLRenderingContext||!(t=r.getContext("webgl"))),t&&(null==(e=t.getExtension("WEBGL_lose_context"))||e.loseContext()),G}catch(t){return G=!1}}function H(){var e;if(void 0!==z)return z;try{let t;const r=document.createElement("canvas");return z=!(!window.WebGL2RenderingContext||!(t=r.getContext("webgl2"))),t&&(null==(e=t.getExtension("WEBGL_lose_context"))||e.loseContext()),z}catch(t){return z=!1}}function Q(){return W(1)}function j(){return W(2)}function W(e){const t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},r=document.createElement("div");r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="13px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0";let n='Your $0 does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">$1</a>';return n=t[e]?n.replace("$0","graphics card"):n.replace("$0","browser"),n=n.replace("$1",{1:"WebGL",2:"WebGL 2"}[e]),r.innerHTML=n,r}class X{constructor(){this.scale=1,this.animationFPS=6,this.root=new n.Object3D,this.meshBody=null,this.meshWeapon=null,this.skinsBody=[],this.skinsWeapon=[],this.weapons=[],this.activeAnimation=null,this.mixer=null,this.onLoadComplete=function(){},this.loadCounter=0}loadParts(e){const t=this;function r(e,t){const r=new n.MeshLambertMaterial({color:16755200,wireframe:!0,morphTargets:!0,morphNormals:!0}),i=new n.MeshLambertMaterial({color:16777215,wireframe:!1,map:t,morphTargets:!0,morphNormals:!0}),a=new n.Mesh(e,i);return a.rotation.y=-Math.PI/2,a.castShadow=!0,a.receiveShadow=!0,a.materialTexture=i,a.materialWireframe=r,a}function i(e,t){const r=new n.TextureLoader,i=[];for(let s=0;s<t.length;s++)i[s]=r.load(e+t[s],a),i[s].mapping=n.UVMapping,i[s].name=t[s],"colorSpace"in i[s]?i[s].colorSpace="srgb":i[s].encoding=3001;return i}function a(){t.loadCounter-=1,0===t.loadCounter&&t.onLoadComplete()}this.loadCounter=2*e.weapons.length+e.skins.length+1;const o=[];for(let n=0;n<e.weapons.length;n++)o[n]=e.weapons[n][1];this.skinsBody=i(e.baseUrl+"skins/",e.skins),this.skinsWeapon=i(e.baseUrl+"skins/",o);const l=new s;l.load(e.baseUrl+e.body,(function(e){const i=new n.Box3;i.setFromBufferAttribute(e.attributes.position),t.root.position.y=-t.scale*i.min.y;const s=r(e,t.skinsBody[0]);s.scale.set(t.scale,t.scale,t.scale),t.root.add(s),t.meshBody=s,t.meshBody.clipOffset=0,t.activeAnimationClipName=s.geometry.animations[0].name,t.mixer=new n.AnimationMixer(s),a()}));const c=function(e,n){return function(i){const s=r(i,t.skinsWeapon[e]);s.scale.set(t.scale,t.scale,t.scale),s.visible=!1,s.name=n,t.root.add(s),t.weapons[e]=s,t.meshWeapon=s,a()}};for(let n=0;n<e.weapons.length;n++)l.load(e.baseUrl+e.weapons[n][0],c(n,e.weapons[n][0]))}setPlaybackRate(e){this.mixer.timeScale=0!==e?1/e:0}setWireframe(e){e?(this.meshBody&&(this.meshBody.material=this.meshBody.materialWireframe),this.meshWeapon&&(this.meshWeapon.material=this.meshWeapon.materialWireframe)):(this.meshBody&&(this.meshBody.material=this.meshBody.materialTexture),this.meshWeapon&&(this.meshWeapon.material=this.meshWeapon.materialTexture))}setSkin(e){this.meshBody&&!1===this.meshBody.material.wireframe&&(this.meshBody.material.map=this.skinsBody[e])}setWeapon(e){for(let r=0;r<this.weapons.length;r++)this.weapons[r].visible=!1;const t=this.weapons[e];t&&(t.visible=!0,this.meshWeapon=t,this.syncWeaponAnimation())}setAnimation(e){if(this.meshBody){this.meshBody.activeAction&&(this.meshBody.activeAction.stop(),this.meshBody.activeAction=null);const t=this.mixer.clipAction(e,this.meshBody);t&&(this.meshBody.activeAction=t.play())}this.activeClipName=e,this.syncWeaponAnimation()}syncWeaponAnimation(){const e=this.activeClipName;if(this.meshWeapon){this.meshWeapon.activeAction&&(this.meshWeapon.activeAction.stop(),this.meshWeapon.activeAction=null);const t=this.mixer.clipAction(e,this.meshWeapon);t&&(this.meshWeapon.activeAction=t.syncWith(this.meshBody.activeAction).play())}}update(e){this.mixer&&this.mixer.update(e)}}class Y{constructor(e,t,r){const i=this;this.volume=e,t=t||0,Object.defineProperty(this,"index",{get:function(){return t},set:function(e){return t=e,i.geometryNeedsUpdate=!0,t}}),this.axis=r||"z",this.canvas=document.createElement("canvas"),this.canvasBuffer=document.createElement("canvas"),this.updateGeometry();const a=new n.Texture(this.canvas);a.minFilter=n.LinearFilter,a.wrapS=a.wrapT=n.ClampToEdgeWrapping,"colorSpace"in a?a.colorSpace="srgb":a.encoding=3001;const s=new n.MeshBasicMaterial({map:a,side:n.DoubleSide,transparent:!0});this.mesh=new n.Mesh(this.geometry,s),this.mesh.matrixAutoUpdate=!1,this.geometryNeedsUpdate=!0,this.repaint()}repaint(){this.geometryNeedsUpdate&&this.updateGeometry();const e=this.iLength,t=this.jLength,r=this.sliceAccess,n=this.volume,i=this.canvasBuffer,a=this.ctxBuffer,s=a.getImageData(0,0,e,t),o=s.data,l=n.data,c=n.upperThreshold,u=n.lowerThreshold,h=n.windowLow,d=n.windowHigh;let p=0;if("label"===n.dataType)for(let f=0;f<t;f++)for(let t=0;t<e;t++){let e=l[r(t,f)];e=e>=this.colorMap.length?e%this.colorMap.length+1:e;const n=this.colorMap[e];o[4*p]=n>>24&255,o[4*p+1]=n>>16&255,o[4*p+2]=n>>8&255,o[4*p+3]=255&n,p++}else for(let f=0;f<t;f++)for(let t=0;t<e;t++){let e=l[r(t,f)],n=255;n=c>=e&&u<=e?n:0,e=Math.floor(255*(e-h)/(d-h)),e=e>255?255:e<0?0:0|e,o[4*p]=e,o[4*p+1]=e,o[4*p+2]=e,o[4*p+3]=n,p++}a.putImageData(s,0,0),this.ctx.drawImage(i,0,0,e,t,0,0,this.canvas.width,this.canvas.height),this.mesh.material.map.needsUpdate=!0}updateGeometry(){const e=this.volume.extractPerpendicularPlane(this.axis,this.index);this.sliceAccess=e.sliceAccess,this.jLength=e.jLength,this.iLength=e.iLength,this.matrix=e.matrix,this.canvas.width=e.planeWidth,this.canvas.height=e.planeHeight,this.canvasBuffer.width=this.iLength,this.canvasBuffer.height=this.jLength,this.ctx=this.canvas.getContext("2d"),this.ctxBuffer=this.canvasBuffer.getContext("2d"),this.geometry&&this.geometry.dispose(),this.geometry=new n.PlaneGeometry(e.planeWidth,e.planeHeight),this.mesh&&(this.mesh.geometry=this.geometry,this.mesh.matrix.identity(),this.mesh.applyMatrix4(this.matrix)),this.geometryNeedsUpdate=!1}}function q(){const e=3e6,t=new n.BufferAttribute(new Float32Array(e),3);t.usage=n.DynamicDrawUsage;const r=new n.BufferAttribute(new Float32Array(e),3);r.usage=n.DynamicDrawUsage;const i=new n.BufferAttribute(new Float32Array(e),3);i.usage=n.DynamicDrawUsage;const a=new n.BufferGeometry;a.setAttribute("position",t),a.setAttribute("normal",r),a.setAttribute("color",i),a.drawRange.count=0;const s=new n.MeshStandardMaterial({vertexColors:!0}),o=new n.Mesh(a,s);o.frustumCulled=!1;const l=new n.Vector3,c=new n.Vector3,u=new n.Vector3,h=new n.Vector3,d=new n.Color(16777215);let p=1;function f(e,s,o,f){if(0===e.distanceToSquared(s))return;let m=a.drawRange.count;const g=function(e){const t=2*Math.PI,r=[],i=.01*e;for(let a=0;a<10;a++){const e=a/10*t;r.push(new n.Vector3(Math.sin(e)*i,Math.cos(e)*i,0))}return r}(p);for(let n=0,a=g.length;n<a;n++){const p=g[n],v=g[(n+1)%a];l.copy(p).applyMatrix4(f).add(s),c.copy(v).applyMatrix4(f).add(s),u.copy(v).applyMatrix4(o).add(e),h.copy(p).applyMatrix4(o).add(e),l.toArray(t.array,3*(m+0)),c.toArray(t.array,3*(m+1)),h.toArray(t.array,3*(m+2)),c.toArray(t.array,3*(m+3)),u.toArray(t.array,3*(m+4)),h.toArray(t.array,3*(m+5)),l.copy(p).applyMatrix4(f).normalize(),c.copy(v).applyMatrix4(f).normalize(),u.copy(v).applyMatrix4(o).normalize(),h.copy(p).applyMatrix4(o).normalize(),l.toArray(r.array,3*(m+0)),c.toArray(r.array,3*(m+1)),h.toArray(r.array,3*(m+2)),c.toArray(r.array,3*(m+3)),u.toArray(r.array,3*(m+4)),h.toArray(r.array,3*(m+5)),d.toArray(i.array,3*(m+0)),d.toArray(i.array,3*(m+1)),d.toArray(i.array,3*(m+2)),d.toArray(i.array,3*(m+3)),d.toArray(i.array,3*(m+4)),d.toArray(i.array,3*(m+5)),m+=6}a.drawRange.count=m}const m=new n.Vector3(0,1,0),g=new n.Vector3,v=new n.Vector3,A=new n.Matrix4,y=new n.Matrix4;let x=0;return{mesh:o,moveTo:function(e){g.copy(e),A.lookAt(v,g,m),v.copy(e),y.copy(A)},lineTo:function(e){g.copy(e),A.lookAt(v,g,m),f(g,v,A,y),v.copy(g),y.copy(A)},setSize:function(e){p=e},update:function(){const e=x,n=a.drawRange.count;e!==n&&(t.updateRange.offset=3*e,t.updateRange.count=3*(n-e),t.needsUpdate=!0,r.updateRange.offset=3*e,r.updateRange.count=3*(n-e),r.needsUpdate=!0,i.updateRange.offset=3*e,i.updateRange.count=3*(n-e),i.needsUpdate=!0,x=a.drawRange.count)}}}class K{constructor(e,t,r,i,a){if(void 0!==e){switch(this.xLength=Number(e)||1,this.yLength=Number(t)||1,this.zLength=Number(r)||1,this.axisOrder=["x","y","z"],i){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":default:this.data=new Uint8Array(a);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(a);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(a);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(a);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(a);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(a);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw new Error("Error in Volume constructor : this type is not supported in JavaScript");case"Float32":case"float32":case"float":this.data=new Float32Array(a);break;case"Float64":case"float64":case"double":this.data=new Float64Array(a)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw new Error("Error in Volume constructor, lengths are not matching arrayBuffer size")}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new n.Matrix3,this.matrix.identity();let s=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return s},set:function(e){s=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}});let o=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return o},set:function(e){o=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}}),this.sliceList=[],this.segmentation=!1}getData(e,t,r){return this.data[r*this.xLength*this.yLength+t*this.xLength+e]}access(e,t,r){return r*this.xLength*this.yLength+t*this.xLength+e}reverseAccess(e){const t=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-t*this.yLength*this.xLength)/this.xLength);return[e-t*this.yLength*this.xLength-r*this.xLength,r,t]}map(e,t){const r=this.data.length;t=t||this;for(let n=0;n<r;n++)this.data[n]=e.call(t,this.data[n],n,this.data);return this}extractPerpendicularPlane(e,t){let r,i,a,s;const o=new n.Vector3,l=new n.Vector3,c=new n.Vector3,u=(new n.Matrix4).identity(),h=this,d=new n.Vector3(this.xLength,this.yLength,this.zLength);switch(e){case"x":o.set(1,0,0),l.set(0,0,-1),c.set(0,-1,0),r=this.spacing[this.axisOrder.indexOf("z")],i=this.spacing[this.axisOrder.indexOf("y")],s=new n.Vector3(t,0,0),u.multiply((new n.Matrix4).makeRotationY(Math.PI/2)),a=(h.RASDimensions[0]-1)/2,u.setPosition(new n.Vector3(t-a,0,0));break;case"y":o.set(0,1,0),l.set(1,0,0),c.set(0,0,1),r=this.spacing[this.axisOrder.indexOf("x")],i=this.spacing[this.axisOrder.indexOf("z")],s=new n.Vector3(0,t,0),u.multiply((new n.Matrix4).makeRotationX(-Math.PI/2)),a=(h.RASDimensions[1]-1)/2,u.setPosition(new n.Vector3(0,t-a,0));break;default:o.set(0,0,1),l.set(1,0,0),c.set(0,-1,0),r=this.spacing[this.axisOrder.indexOf("x")],i=this.spacing[this.axisOrder.indexOf("y")],s=new n.Vector3(0,0,t),a=(h.RASDimensions[2]-1)/2,u.setPosition(new n.Vector3(0,0,t-a))}let p,f;this.segmentation||(l.applyMatrix4(h.inverseMatrix).normalize(),c.applyMatrix4(h.inverseMatrix).normalize(),o.applyMatrix4(h.inverseMatrix).normalize()),l.arglet="i",c.arglet="j",p=Math.floor(Math.abs(l.dot(d))),f=Math.floor(Math.abs(c.dot(d)));const m=Math.abs(p*r),g=Math.abs(f*i);s=Math.abs(Math.round(s.applyMatrix4(h.inverseMatrix).dot(o)));const v=[new n.Vector3(1,0,0),new n.Vector3(0,1,0),new n.Vector3(0,0,1)],A=[l,c,o].find((function(e){return Math.abs(e.dot(v[0]))>.9})),y=[l,c,o].find((function(e){return Math.abs(e.dot(v[1]))>.9})),x=[l,c,o].find((function(e){return Math.abs(e.dot(v[2]))>.9}));return{iLength:p,jLength:f,sliceAccess:function(e,t){const r=A===o?s:"i"===A.arglet?e:t,n=y===o?s:"i"===y.arglet?e:t,i=x===o?s:"i"===x.arglet?e:t,a=A.dot(v[0])>0?r:h.xLength-1-r,l=y.dot(v[1])>0?n:h.yLength-1-n,c=x.dot(v[2])>0?i:h.zLength-1-i;return h.access(a,l,c)},matrix:u,planeWidth:m,planeHeight:g}}extractSlice(e,t){const r=new Y(this,t,e);return this.sliceList.push(r),r}repaintAllSlices(){return this.sliceList.forEach((function(e){e.repaint()})),this}computeMinMax(){let e=1/0,t=-1/0;const r=this.data.length;let n=0;for(n=0;n<r;n++)if(!isNaN(this.data[n])){const r=this.data[n];e=Math.min(e,r),t=Math.max(t,r)}return this.min=e,this.max=t,[e,t]}}class J{constructor(e,t=1024){this.renderer=e,this.res=t,this.lightMapContainers=[],this.compiled=!1,this.scene=new n.Scene,this.scene.background=null,this.tinyTarget=new n.WebGLRenderTarget(1,1),this.buffer1Active=!1,this.firstUpdate=!0,this.warned=!1;const r=/(Android|iPad|iPhone|iPod)/g.test(navigator.userAgent)?alfFloatType:n.FloatType;this.progressiveLightMap1=new n.WebGLRenderTarget(this.res,this.res,{type:r}),this.progressiveLightMap2=new n.WebGLRenderTarget(this.res,this.res,{type:r}),this.uvMat=new n.MeshPhongMaterial,this.uvMat.uniforms={},this.uvMat.onBeforeCompile=e=>{e.vertexShader="#define USE_LIGHTMAP\n"+e.vertexShader.slice(0,-1)+"\tgl_Position = vec4((uv2 - 0.5) * 2.0, 1.0, 1.0); }";const t=e.fragmentShader.indexOf("void main() {");e.fragmentShader="varying vec2 vUv2;\n"+e.fragmentShader.slice(0,t)+"\tuniform sampler2D previousShadowMap;\n\tuniform float averagingWindow;\n"+e.fragmentShader.slice(t-1,-1)+"\nvec3 texelOld = texture2D(previousShadowMap, vUv2).rgb;\n\t\t\t\tgl_FragColor.rgb = mix(texelOld, gl_FragColor.rgb, 1.0/averagingWindow);\n\t\t\t}",e.uniforms.previousShadowMap={value:this.progressiveLightMap1.texture},e.uniforms.averagingWindow={value:100},this.uvMat.uniforms=e.uniforms,this.uvMat.userData.shader=e,this.compiled=!0}}addObjectsToLightMap(e){this.uv_boxes=[];const t=3/this.res;for(let n=0;n<e.length;n++){const r=e[n];r.isLight?this.scene.attach(r):r.geometry.hasAttribute("uv")?(null==this.blurringPlane&&this._initializeBlurPlane(this.res,this.progressiveLightMap1),r.material.lightMap=this.progressiveLightMap2.texture,r.material.dithering=!0,r.castShadow=!0,r.receiveShadow=!0,r.renderOrder=1e3+n,this.uv_boxes.push({w:1+2*t,h:1+2*t,index:n}),this.lightMapContainers.push({basicMat:r.material,object:r}),this.compiled=!1):console.warn("All lightmap objects need UVs!")}const r=function(e){let t=0,r=0;for(const s of e)t+=s.w*s.h,r=Math.max(r,s.w);e.sort(((e,t)=>t.h-e.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let i=0,a=0;for(const s of e)for(let e=n.length-1;e>=0;e--){const t=n[e];if(!(s.w>t.w||s.h>t.h)){if(s.x=t.x,s.y=t.y,a=Math.max(a,s.y+s.h),i=Math.max(i,s.x+s.w),s.w===t.w&&s.h===t.h){const t=n.pop();e<n.length&&(n[e]=t)}else s.h===t.h?(t.x+=s.w,t.w-=s.w):s.w===t.w?(t.y+=s.h,t.h-=s.h):(n.push({x:t.x+s.w,y:t.y,w:t.w-s.w,h:s.h}),t.y+=s.h,t.h-=s.h);break}}return{w:i,h:a,fill:t/(i*a)||0}}(this.uv_boxes);this.uv_boxes.forEach((n=>{const i=e[n.index].geometry.getAttribute("uv").clone();for(let e=0;e<i.array.length;e+=i.itemSize)i.array[e]=(i.array[e]+n.x+t)/r.w,i.array[e+1]=(i.array[e+1]+n.y+t)/r.h;e[n.index].geometry.setAttribute("uv2",i),e[n.index].geometry.getAttribute("uv2").needsUpdate=!0}))}update(e,t=100,r=!0){if(null==this.blurringPlane)return;const n=this.renderer.getRenderTarget();this.blurringPlane.visible=r;for(let s=0;s<this.lightMapContainers.length;s++)this.lightMapContainers[s].object.oldScene=this.lightMapContainers[s].object.parent,this.scene.attach(this.lightMapContainers[s].object);this.firstUpdate&&(this.renderer.setRenderTarget(this.tinyTarget),this.renderer.render(this.scene,e),this.firstUpdate=!1);for(let s=0;s<this.lightMapContainers.length;s++)this.uvMat.uniforms.averagingWindow={value:t},this.lightMapContainers[s].object.material=this.uvMat,this.lightMapContainers[s].object.oldFrustumCulled=this.lightMapContainers[s].object.frustumCulled,this.lightMapContainers[s].object.frustumCulled=!1;const i=this.buffer1Active?this.progressiveLightMap1:this.progressiveLightMap2,a=this.buffer1Active?this.progressiveLightMap2:this.progressiveLightMap1;this.renderer.setRenderTarget(i),this.uvMat.uniforms.previousShadowMap={value:a.texture},this.blurringPlane.material.uniforms.previousShadowMap={value:a.texture},this.buffer1Active=!this.buffer1Active,this.renderer.render(this.scene,e);for(let s=0;s<this.lightMapContainers.length;s++)this.lightMapContainers[s].object.frustumCulled=this.lightMapContainers[s].object.oldFrustumCulled,this.lightMapContainers[s].object.material=this.lightMapContainers[s].basicMat,this.lightMapContainers[s].object.oldScene.attach(this.lightMapContainers[s].object);this.renderer.setRenderTarget(n)}showDebugLightmap(e,t){0!=this.lightMapContainers.length?(null==this.labelMesh&&(this.labelMaterial=new n.MeshBasicMaterial({map:this.progressiveLightMap1.texture,side:n.DoubleSide}),this.labelPlane=new n.PlaneGeometry(100,100),this.labelMesh=new n.Mesh(this.labelPlane,this.labelMaterial),this.labelMesh.position.y=250,this.lightMapContainers[0].object.parent.add(this.labelMesh)),null!=t&&this.labelMesh.position.copy(t),this.labelMesh.visible=e):this.warned||(console.warn("Call this after adding the objects!"),this.warned=!0)}_initializeBlurPlane(e,t=null){const r=new n.MeshBasicMaterial;r.uniforms={previousShadowMap:{value:null},pixelOffset:{value:1/e},polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:3},r.onBeforeCompile=n=>{n.vertexShader="#define USE_UV\n"+n.vertexShader.slice(0,-1)+"\tgl_Position = vec4((uv - 0.5) * 2.0, 1.0, 1.0); }";const i=n.fragmentShader.indexOf("void main() {");n.fragmentShader="#define USE_UV\n"+n.fragmentShader.slice(0,i)+"\tuniform sampler2D previousShadowMap;\n\tuniform float pixelOffset;\n"+n.fragmentShader.slice(i-1,-1)+"\tgl_FragColor.rgb = (\n\t\t\t texture2D(previousShadowMap, vUv + vec2( pixelOffset, 0.0 )).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2( 0.0 , pixelOffset)).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2( 0.0 , -pixelOffset)).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2(-pixelOffset, 0.0 )).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2( pixelOffset, pixelOffset)).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2(-pixelOffset, pixelOffset)).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2( pixelOffset, -pixelOffset)).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2(-pixelOffset, -pixelOffset)).rgb)/8.0;\n\t\t}",n.uniforms.previousShadowMap={value:t.texture},n.uniforms.pixelOffset={value:.5/e},r.uniforms=n.uniforms,r.userData.shader=n,this.compiled=!0},this.blurringPlane=new n.Mesh(new n.PlaneGeometry(1,1),r),this.blurringPlane.name="Blurring Plane",this.blurringPlane.frustumCulled=!1,this.blurringPlane.renderOrder=0,this.blurringPlane.material.depthWrite=!1,this.scene.add(this.blurringPlane)}}class Z extends n.Object3D{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new n.Vector2(.5,.5),this.addEventListener("removed",(function(){this.traverse((function(e){e.element instanceof Element&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const $=new n.Vector3,ee=new n.Matrix4,te=new n.Matrix4,re=new n.Vector3,ne=new n.Vector3;class ie{constructor(e={}){const t=this;let r,n,i,a;const s={objects:new WeakMap},o=void 0!==e.element?e.element:document.createElement("div");function l(e,r,n){if(e.isCSS2DObject){$.setFromMatrixPosition(e.matrixWorld),$.applyMatrix4(te);const l=!0===e.visible&&$.z>=-1&&$.z<=1&&!0===e.layers.test(n.layers);if(e.element.style.display=!0===l?"":"none",!0===l){e.onBeforeRender(t,r,n);const s=e.element;s.style.transform="translate("+-100*e.center.x+"%,"+-100*e.center.y+"%)translate("+($.x*i+i)+"px,"+(-$.y*a+a)+"px)",s.parentNode!==o&&o.appendChild(s),e.onAfterRender(t,r,n)}const u={distanceToCameraSquared:c(n,e)};s.objects.set(e,u)}for(let t=0,i=e.children.length;t<i;t++)l(e.children[t],r,n)}function c(e,t){return re.setFromMatrixPosition(e.matrixWorld),ne.setFromMatrixPosition(t.matrixWorld),re.distanceToSquared(ne)}o.style.overflow="hidden",this.domElement=o,this.getSize=function(){return{width:r,height:n}},this.render=function(e,t){!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),ee.copy(t.matrixWorldInverse),te.multiplyMatrices(t.projectionMatrix,ee),l(e,e,t),function(e){const t=function(e){const t=[];return e.traverse((function(e){e.isCSS2DObject&&t.push(e)})),t}(e).sort((function(e,t){if(e.renderOrder!==t.renderOrder)return t.renderOrder-e.renderOrder;return s.objects.get(e).distanceToCameraSquared-s.objects.get(t).distanceToCameraSquared})),r=t.length;for(let n=0,i=t.length;n<i;n++)t[n].element.style.zIndex=r-n}(e)},this.setSize=function(e,t){r=e,n=t,i=r/2,a=n/2,o.style.width=e+"px",o.style.height=t+"px"}}}const ae=new n.Vector3,se=new n.Quaternion,oe=new n.Vector3;class le extends n.Object3D{constructor(e=document.createElement("div")){super(),this.isCSS3DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",(function(){this.traverse((function(e){e.element instanceof Element&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this}}class ce extends le{constructor(e){super(e),this.isCSS3DSprite=!0,this.rotation2D=0}copy(e,t){return super.copy(e,t),this.rotation2D=e.rotation2D,this}}const ue=new n.Matrix4,he=new n.Matrix4;class de{constructor(e={}){const t=this;let r,n,i,a;const s={camera:{fov:0,style:""},objects:new WeakMap},o=void 0!==e.element?e.element:document.createElement("div");o.style.overflow="hidden",this.domElement=o;const l=document.createElement("div");l.style.transformOrigin="0 0",l.style.pointerEvents="none",o.appendChild(l);const c=document.createElement("div");function u(e){return Math.abs(e)<1e-10?0:e}function h(e){const t=e.elements;return"matrix3d("+u(t[0])+","+u(-t[1])+","+u(t[2])+","+u(t[3])+","+u(t[4])+","+u(-t[5])+","+u(t[6])+","+u(t[7])+","+u(t[8])+","+u(-t[9])+","+u(t[10])+","+u(t[11])+","+u(t[12])+","+u(-t[13])+","+u(t[14])+","+u(t[15])+")"}function d(e){const t=e.elements;return"translate(-50%,-50%)"+("matrix3d("+u(t[0])+","+u(t[1])+","+u(t[2])+","+u(t[3])+","+u(-t[4])+","+u(-t[5])+","+u(-t[6])+","+u(-t[7])+","+u(t[8])+","+u(t[9])+","+u(t[10])+","+u(t[11])+","+u(t[12])+","+u(t[13])+","+u(t[14])+","+u(t[15])+")")}function p(e,r,n,i){if(e.isCSS3DObject){const i=!0===e.visible&&!0===e.layers.test(n.layers);if(e.element.style.display=!0===i?"":"none",!0===i){let i;e.onBeforeRender(t,r,n),e.isCSS3DSprite?(ue.copy(n.matrixWorldInverse),ue.transpose(),0!==e.rotation2D&&ue.multiply(he.makeRotationZ(e.rotation2D)),e.matrixWorld.decompose(ae,se,oe),ue.setPosition(ae),ue.scale(oe),ue.elements[3]=0,ue.elements[7]=0,ue.elements[11]=0,ue.elements[15]=1,i=d(ue)):i=d(e.matrixWorld);const a=e.element,o=s.objects.get(e);if(void 0===o||o.style!==i){a.style.transform=i;const t={style:i};s.objects.set(e,t)}a.parentNode!==c&&c.appendChild(a),e.onAfterRender(t,r,n)}}for(let t=0,a=e.children.length;t<a;t++)p(e.children[t],r,n,i)}c.style.transformStyle="preserve-3d",l.appendChild(c),this.getSize=function(){return{width:r,height:n}},this.render=function(e,t){const o=t.projectionMatrix.elements[5]*a;let d,f;s.camera.fov!==o&&(l.style.perspective=t.isPerspectiveCamera?o+"px":"",s.camera.fov=o),t.view&&t.view.enabled?(l.style.transform=`translate( ${-t.view.offsetX*(r/t.view.width)}px, ${-t.view.offsetY*(n/t.view.height)}px )`,l.style.transform+=`scale( ${t.view.fullWidth/t.view.width}, ${t.view.fullHeight/t.view.height} )`):l.style.transform="",!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),t.isOrthographicCamera&&(d=-(t.right+t.left)/2,f=(t.top+t.bottom)/2);const m=t.view&&t.view.enabled?t.view.height/t.view.fullHeight:1,g=t.isOrthographicCamera?`scale( ${m} )scale(`+o+")translate("+u(d)+"px,"+u(f)+"px)"+h(t.matrixWorldInverse):`scale( ${m} )translateZ(`+o+"px)"+h(t.matrixWorldInverse),v=g+"translate("+i+"px,"+a+"px)";s.camera.style!==v&&(c.style.transform=v,s.camera.style=v),p(e,e,t,g)},this.setSize=function(e,t){r=e,n=t,i=r/2,a=n/2,o.style.width=e+"px",o.style.height=t+"px",l.style.width=e+"px",l.style.height=t+"px",c.style.width=e+"px",c.style.height=t+"px"}}}class pe{constructor(){this.id=0,this.object=null,this.z=0,this.renderOrder=0}}class fe{constructor(){this.id=0,this.v1=new me,this.v2=new me,this.v3=new me,this.normalModel=new n.Vector3,this.vertexNormalsModel=[new n.Vector3,new n.Vector3,new n.Vector3],this.vertexNormalsLength=0,this.color=new n.Color,this.material=null,this.uvs=[new n.Vector2,new n.Vector2,new n.Vector2],this.z=0,this.renderOrder=0}}class me{constructor(){this.position=new n.Vector3,this.positionWorld=new n.Vector3,this.positionScreen=new n.Vector4,this.visible=!0}copy(e){this.positionWorld.copy(e.positionWorld),this.positionScreen.copy(e.positionScreen)}}class ge{constructor(){this.id=0,this.v1=new me,this.v2=new me,this.vertexColors=[new n.Color,new n.Color],this.material=null,this.z=0,this.renderOrder=0}}class ve{constructor(){this.id=0,this.object=null,this.x=0,this.y=0,this.z=0,this.rotation=0,this.scale=new n.Vector2,this.material=null,this.renderOrder=0}}class Ae{constructor(){let e,t,r,i,a,s,o,l,c,u,h,d=0,p=0,f=0,m=0,g=0;const v={objects:[],lights:[],elements:[]},A=new n.Vector3,y=new n.Vector4,x=new n.Box3(new n.Vector3(-1,-1,-1),new n.Vector3(1,1,1)),b=new n.Box3,w=new Array(3),E=new n.Matrix4,S=new n.Matrix4,M=new n.Matrix4,_=new n.Frustum,T=[],C=[],I=[],B=[],R=[];const P=new function(){const e=[],t=[],s=[];let c=null;const u=new n.Matrix3;function d(e){const t=e.position,r=e.positionWorld,n=e.positionScreen;r.copy(t).applyMatrix4(h),n.copy(r).applyMatrix4(S);const i=1/n.w;n.x*=i,n.y*=i,n.z*=i,e.visible=n.x>=-1&&n.x<=1&&n.y>=-1&&n.y<=1&&n.z>=-1&&n.z<=1}function f(e,t,r){return!0===e.visible||!0===t.visible||!0===r.visible||(w[0]=e.positionScreen,w[1]=t.positionScreen,w[2]=r.positionScreen,x.intersectsBox(b.setFromPoints(w)))}function g(e,t,r){return(r.positionScreen.x-e.positionScreen.x)*(t.positionScreen.y-e.positionScreen.y)-(r.positionScreen.y-e.positionScreen.y)*(t.positionScreen.x-e.positionScreen.x)<0}return{setObject:function(r){c=r,u.getNormalMatrix(c.matrixWorld),e.length=0,t.length=0,s.length=0},projectVertex:d,checkTriangleVisibility:f,checkBackfaceCulling:g,pushVertex:function(e,t,n){r=function(){if(i===p){const e=new me;return C.push(e),p++,i++,e}return C[i++]}(),r.position.set(e,t,n),d(r)},pushNormal:function(t,r,n){e.push(t,r,n)},pushColor:function(e,r,n){t.push(e,r,n)},pushUv:function(e,t){s.push(e,t)},pushLine:function(e,r){const n=C[e],i=C[r];n.positionScreen.copy(n.position).applyMatrix4(M),i.positionScreen.copy(i.position).applyMatrix4(M),!0===function(e,t){let r=0,n=1;const i=e.z+e.w,a=t.z+t.w,s=-e.z+e.w,o=-t.z+t.w;return i>=0&&a>=0&&s>=0&&o>=0||!(i<0&&a<0||s<0&&o<0)&&(i<0?r=Math.max(r,i/(i-a)):a<0&&(n=Math.min(n,i/(i-a))),s<0?r=Math.max(r,s/(s-o)):o<0&&(n=Math.min(n,s/(s-o))),!(n<r)&&(e.lerp(t,r),t.lerp(e,1-n),!0))}(n.positionScreen,i.positionScreen)&&(n.positionScreen.multiplyScalar(1/n.positionScreen.w),i.positionScreen.multiplyScalar(1/i.positionScreen.w),o=function(){if(l===m){const e=new ge;return B.push(e),m++,l++,e}return B[l++]}(),o.id=c.id,o.v1.copy(n),o.v2.copy(i),o.z=Math.max(n.positionScreen.z,i.positionScreen.z),o.renderOrder=c.renderOrder,o.material=c.material,c.material.vertexColors&&(o.vertexColors[0].fromArray(t,3*e),o.vertexColors[1].fromArray(t,3*r)),v.elements.push(o))},pushTriangle:function(r,i,o,l){const h=C[r],d=C[i],p=C[o];if(!1!==f(h,d,p)&&(l.side===n.DoubleSide||!0===g(h,d,p))){a=U(),a.id=c.id,a.v1.copy(h),a.v2.copy(d),a.v3.copy(p),a.z=(h.positionScreen.z+d.positionScreen.z+p.positionScreen.z)/3,a.renderOrder=c.renderOrder,A.subVectors(p.position,d.position),y.subVectors(h.position,d.position),A.cross(y),a.normalModel.copy(A),a.normalModel.applyMatrix3(u).normalize();for(let t=0;t<3;t++){const r=a.vertexNormalsModel[t];r.fromArray(e,3*arguments[t]),r.applyMatrix3(u).normalize();a.uvs[t].fromArray(s,2*arguments[t])}a.vertexNormalsLength=3,a.material=l,l.vertexColors&&a.color.fromArray(t,3*r),v.elements.push(a)}}}};function F(e){if(!1===e.visible)return;if(e.isLight)v.lights.push(e);else if(e.isMesh||e.isLine||e.isPoints){if(!1===e.material.visible)return;if(!0===e.frustumCulled&&!1===_.intersectsObject(e))return;L(e)}else if(e.isSprite){if(!1===e.material.visible)return;if(!0===e.frustumCulled&&!1===_.intersectsSprite(e))return;L(e)}const t=e.children;for(let r=0,n=t.length;r<n;r++)F(t[r])}function L(r){e=function(){if(t===d){const e=new pe;return T.push(e),d++,t++,e}return T[t++]}(),e.id=r.id,e.object=r,A.setFromMatrixPosition(r.matrixWorld),A.applyMatrix4(S),e.z=A.z,e.renderOrder=r.renderOrder,v.objects.push(e)}function D(e,t,r){const n=1/e.w;e.z*=n,e.z>=-1&&e.z<=1&&(c=function(){if(u===g){const e=new ve;return R.push(e),g++,u++,e}return R[u++]}(),c.id=t.id,c.x=e.x*n,c.y=e.y*n,c.z=e.z,c.renderOrder=t.renderOrder,c.object=t,c.rotation=t.rotation,c.scale.x=t.scale.x*Math.abs(c.x-(e.x+r.projectionMatrix.elements[0])/(e.w+r.projectionMatrix.elements[12])),c.scale.y=t.scale.y*Math.abs(c.y-(e.y+r.projectionMatrix.elements[5])/(e.w+r.projectionMatrix.elements[13])),c.material=t.material,v.elements.push(c))}function U(){if(s===f){const e=new fe;return I.push(e),f++,s++,e}return I[s++]}function N(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id!==t.id?e.id-t.id:0}this.projectScene=function(e,r,n,a){s=0,l=0,u=0,v.elements.length=0,!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===r.parent&&!0===r.matrixWorldAutoUpdate&&r.updateMatrixWorld(),E.copy(r.matrixWorldInverse),S.multiplyMatrices(r.projectionMatrix,E),_.setFromProjectionMatrix(S),t=0,v.objects.length=0,v.lights.length=0,F(e),!0===n&&v.objects.sort(N);const o=v.objects;for(let t=0,s=o.length;t<s;t++){const e=o[t].object,n=e.geometry;if(P.setObject(e),h=e.matrixWorld,i=0,e.isMesh){let t=e.material;const r=Array.isArray(t),i=n.attributes,a=n.groups;if(void 0===i.position)continue;const s=i.position.array;for(let o=0,l=s.length;o<l;o+=3){let t=s[o],r=s[o+1],i=s[o+2];const a=n.morphAttributes.position;if(void 0!==a){const l=n.morphTargetsRelative,c=e.morphTargetInfluences;for(let e=0,n=a.length;e<n;e++){const n=c[e];if(0===n)continue;const u=a[e];l?(t+=u.getX(o/3)*n,r+=u.getY(o/3)*n,i+=u.getZ(o/3)*n):(t+=(u.getX(o/3)-s[o])*n,r+=(u.getY(o/3)-s[o+1])*n,i+=(u.getZ(o/3)-s[o+2])*n)}}P.pushVertex(t,r,i)}if(void 0!==i.normal){const e=i.normal.array;for(let t=0,r=e.length;t<r;t+=3)P.pushNormal(e[t],e[t+1],e[t+2])}if(void 0!==i.color){const e=i.color.array;for(let t=0,r=e.length;t<r;t+=3)P.pushColor(e[t],e[t+1],e[t+2])}if(void 0!==i.uv){const e=i.uv.array;for(let t=0,r=e.length;t<r;t+=2)P.pushUv(e[t],e[t+1])}if(null!==n.index){const i=n.index.array;if(a.length>0)for(let n=0;n<a.length;n++){const s=a[n];if(t=!0===r?e.material[s.materialIndex]:e.material,void 0!==t)for(let e=s.start,r=s.start+s.count;e<r;e+=3)P.pushTriangle(i[e],i[e+1],i[e+2],t)}else for(let e=0,r=i.length;e<r;e+=3)P.pushTriangle(i[e],i[e+1],i[e+2],t)}else if(a.length>0)for(let n=0;n<a.length;n++){const i=a[n];if(t=!0===r?e.material[i.materialIndex]:e.material,void 0!==t)for(let e=i.start,r=i.start+i.count;e<r;e+=3)P.pushTriangle(e,e+1,e+2,t)}else for(let e=0,n=s.length/3;e<n;e+=3)P.pushTriangle(e,e+1,e+2,t)}else if(e.isLine){M.multiplyMatrices(S,h);const t=n.attributes;if(void 0!==t.position){const r=t.position.array;for(let e=0,t=r.length;e<t;e+=3)P.pushVertex(r[e],r[e+1],r[e+2]);if(void 0!==t.color){const e=t.color.array;for(let t=0,r=e.length;t<r;t+=3)P.pushColor(e[t],e[t+1],e[t+2])}if(null!==n.index){const e=n.index.array;for(let t=0,r=e.length;t<r;t+=2)P.pushLine(e[t],e[t+1])}else{const t=e.isLineSegments?2:1;for(let e=0,n=r.length/3-1;e<n;e+=t)P.pushLine(e,e+1)}}}else if(e.isPoints){M.multiplyMatrices(S,h);const t=n.attributes;if(void 0!==t.position){const n=t.position.array;for(let t=0,i=n.length;t<i;t+=3)y.set(n[t],n[t+1],n[t+2],1),y.applyMatrix4(M),D(y,e,r)}}else e.isSprite&&(e.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,e.matrixWorld),y.set(h.elements[12],h.elements[13],h.elements[14],1),y.applyMatrix4(S),D(y,e,r))}return!0===a&&v.elements.sort(N),v}}}class ye extends n.Object3D{constructor(e){super(),this.isSVGObject=!0,this.node=e}}class xe{constructor(){let e,t,r,i,a,s,o,l,c,u,h,d,p,f=0,m=null,g=1;const v=this,A=new n.Box2,y=new n.Box2,x=new n.Color,b=new n.Color,w=new n.Color,E=new n.Color,S=new n.Color,M=new n.Color,_=new n.Vector3,T=new n.Vector3,C=new n.Vector3,I=new n.Matrix3,B=new n.Matrix4,R=new n.Matrix4,P=[],F=new Ae,L=document.createElementNS("http://www.w3.org/2000/svg","svg");function D(){for(f=0;L.childNodes.length>0;)L.removeChild(L.childNodes[0])}function U(e){return null!==m?e.toFixed(m):e}function N(e,t,r){let n=t.scale.x*s,i=t.scale.y*o;r.isPointsMaterial&&(n*=r.size,i*=r.size);const a="M"+U(e.x-.5*n)+","+U(e.y-.5*i)+"h"+U(n)+"v"+U(i)+"h"+U(-n)+"z";let l="";(r.isSpriteMaterial||r.isPointsMaterial)&&(l="fill:"+r.color.getStyle()+";fill-opacity:"+r.opacity),z(l,a)}function k(e,t,r){const n="M"+U(e.positionScreen.x)+","+U(e.positionScreen.y)+"L"+U(t.positionScreen.x)+","+U(t.positionScreen.y);if(r.isLineBasicMaterial){let e="fill:none;stroke:"+r.color.getStyle()+";stroke-opacity:"+r.opacity+";stroke-width:"+r.linewidth+";stroke-linecap:"+r.linecap;r.isLineDashedMaterial&&(e=e+";stroke-dasharray:"+r.dashSize+","+r.gapSize),z(e,n)}}function O(e,t,n,i,a){v.info.render.vertices+=3,v.info.render.faces++;const s="M"+U(e.positionScreen.x)+","+U(e.positionScreen.y)+"L"+U(t.positionScreen.x)+","+U(t.positionScreen.y)+"L"+U(n.positionScreen.x)+","+U(n.positionScreen.y)+"z";let o="";a.isMeshBasicMaterial?(x.copy(a.color),a.vertexColors&&x.multiply(i.color)):a.isMeshLambertMaterial||a.isMeshPhongMaterial||a.isMeshStandardMaterial?(b.copy(a.color),a.vertexColors&&b.multiply(i.color),x.copy(w),T.copy(e.positionWorld).add(t.positionWorld).add(n.positionWorld).divideScalar(3),function(e,t,r,n){for(let i=0,a=e.length;i<a;i++){const a=e[i],s=a.color;if(a.isDirectionalLight){const e=_.setFromMatrixPosition(a.matrixWorld).normalize();let t=r.dot(e);if(t<=0)continue;t*=a.intensity,n.r+=s.r*t,n.g+=s.g*t,n.b+=s.b*t}else if(a.isPointLight){const e=_.setFromMatrixPosition(a.matrixWorld);let i=r.dot(_.subVectors(e,t).normalize());if(i<=0)continue;if(i*=0==a.distance?1:1-Math.min(t.distanceTo(e)/a.distance,1),0==i)continue;i*=a.intensity,n.r+=s.r*i,n.g+=s.g*i,n.b+=s.b*i}}}(r,T,i.normalModel,x),x.multiply(b).add(a.emissive)):a.isMeshNormalMaterial&&(C.copy(i.normalModel).applyMatrix3(I).normalize(),x.setRGB(C.x,C.y,C.z).multiplyScalar(.5).addScalar(.5)),o=a.wireframe?"fill:none;stroke:"+x.getStyle()+";stroke-opacity:"+a.opacity+";stroke-width:"+a.wireframeLinewidth+";stroke-linecap:"+a.wireframeLinecap+";stroke-linejoin:"+a.wireframeLinejoin:"fill:"+x.getStyle()+";fill-opacity:"+a.opacity,z(o,s)}function G(e,t,r){let n=t.x-e.x,i=t.y-e.y;const a=n*n+i*i;if(0===a)return;const s=r/Math.sqrt(a);n*=s,i*=s,t.x+=n,t.y+=i,e.x-=n,e.y-=i}function z(e,t){p===e?d+=t:(V(),p=e,d=t)}function V(){d&&(h=function(e){if(null==P[e])return P[e]=document.createElementNS("http://www.w3.org/2000/svg","path"),0==g&&P[e].setAttribute("shape-rendering","crispEdges"),P[e];return P[e]}(f++),h.setAttribute("d",d),h.setAttribute("style",p),L.appendChild(h)),d="",p=""}this.domElement=L,this.autoClear=!0,this.sortObjects=!0,this.sortElements=!0,this.overdraw=.5,this.info={render:{vertices:0,faces:0}},this.setQuality=function(e){switch(e){case"high":g=1;break;case"low":g=0}},this.setClearColor=function(e){M.set(e)},this.setPixelRatio=function(){},this.setSize=function(e,t){i=e,a=t,s=i/2,o=a/2,L.setAttribute("viewBox",-s+" "+-o+" "+i+" "+a),L.setAttribute("width",i),L.setAttribute("height",a),A.min.set(-s,-o),A.max.set(s,o)},this.getSize=function(){return{width:i,height:a}},this.setPrecision=function(e){m=e},this.clear=function(){D(),L.style.backgroundColor=M.getStyle()},this.render=function(i,a){if(a instanceof n.Camera==!1)return void console.error("THREE.SVGRenderer.render: camera is not an instance of Camera.");const h=i.background;h&&h.isColor?(D(),L.style.backgroundColor=h.getStyle()):!0===this.autoClear&&this.clear(),v.info.render.vertices=0,v.info.render.faces=0,B.copy(a.matrixWorldInverse),R.multiplyMatrices(a.projectionMatrix,B),e=F.projectScene(i,a,this.sortObjects,this.sortElements),t=e.elements,r=e.lights,I.getNormalMatrix(a.matrixWorldInverse),function(e){w.setRGB(0,0,0),E.setRGB(0,0,0),S.setRGB(0,0,0);for(let t=0,r=e.length;t<r;t++){const r=e[t],n=r.color;r.isAmbientLight?(w.r+=n.r,w.g+=n.g,w.b+=n.b):r.isDirectionalLight?(E.r+=n.r,E.g+=n.g,E.b+=n.b):r.isPointLight&&(S.r+=n.r,S.g+=n.g,S.b+=n.b)}}(r),d="",p="";for(let e=0,r=t.length;e<r;e++){const r=t[e],n=r.material;if(void 0!==n&&0!==n.opacity)if(y.makeEmpty(),r instanceof ve)l=r,l.x*=s,l.y*=-o,N(l,r,n);else if(r instanceof ge)l=r.v1,c=r.v2,l.positionScreen.x*=s,l.positionScreen.y*=-o,c.positionScreen.x*=s,c.positionScreen.y*=-o,y.setFromPoints([l.positionScreen,c.positionScreen]),!0===A.intersectsBox(y)&&k(l,c,n);else if(r instanceof fe){if(l=r.v1,c=r.v2,u=r.v3,l.positionScreen.z<-1||l.positionScreen.z>1)continue;if(c.positionScreen.z<-1||c.positionScreen.z>1)continue;if(u.positionScreen.z<-1||u.positionScreen.z>1)continue;l.positionScreen.x*=s,l.positionScreen.y*=-o,c.positionScreen.x*=s,c.positionScreen.y*=-o,u.positionScreen.x*=s,u.positionScreen.y*=-o,this.overdraw>0&&(G(l.positionScreen,c.positionScreen,this.overdraw),G(c.positionScreen,u.positionScreen,this.overdraw),G(u.positionScreen,l.positionScreen,this.overdraw)),y.setFromPoints([l.positionScreen,c.positionScreen,u.positionScreen]),!0===A.intersectsBox(y)&&O(l,c,u,r,n)}}V(),i.traverseVisible((function(e){if(e.isSVGObject){if(_.setFromMatrixPosition(e.matrixWorld),_.applyMatrix4(R),_.z<-1||_.z>1)return;const t=_.x*s,r=-_.y*o,n=e.node;n.setAttribute("transform","translate("+t+","+r+")"),L.appendChild(n)}}))}}}class be{constructor(e=512,t=512){const r=document.createElement("canvas");r.width=e,r.height=t;const n=r.getContext("2d");n.fillStyle="rgb(127,127,255)",n.fillRect(0,0,e,t);for(let i=0;i<4e3;i++){const r=Math.random()*e,i=Math.random()*t,a=3*Math.random()+3;let s=2*Math.random()-1,o=2*Math.random()-1,l=1.5;const c=Math.sqrt(s*s+o*o+l*l);s/=c,o/=c,l/=c,n.fillStyle="rgb("+(127*s+127)+","+(127*o+127)+","+255*l+")",n.beginPath(),n.arc(r,i,a,0,2*Math.PI),n.fill()}return r}}var we=r(53615),Ee=r(84975),Se=Object.defineProperty,Me=(e,t,r)=>(((e,t,r)=>{t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const _e=new n.Vector3,Te=new n.Vector3;function Ce(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class Ie{constructor(e,t){Me(this,"position"),Me(this,"id"),Me(this,"faces"),Me(this,"neighbors"),Me(this,"collapseCost"),Me(this,"collapseNeighbor"),Me(this,"minCost",0),Me(this,"totalCost",0),Me(this,"costCount",0),this.position=e,this.id=t,this.faces=[],this.neighbors=[],this.collapseCost=0,this.collapseNeighbor=null}addUniqueNeighbor(e){var t,r;t=this.neighbors,r=e,-1===t.indexOf(r)&&t.push(r)}removeIfNonNeighbor(e){const t=this.neighbors,r=this.faces,n=t.indexOf(e);if(-1!==n){for(let t=0;t<r.length;t++)if(r[t].hasVertex(e))return;t.splice(n,1)}}}class Be{constructor(e,t,r,i,a,s){Me(this,"a"),Me(this,"b"),Me(this,"c"),Me(this,"v1"),Me(this,"v2"),Me(this,"v3"),Me(this,"normal",new n.Vector3),this.a=i,this.b=a,this.c=s,this.v1=e,this.v2=t,this.v3=r,this.computeNormal(),e.faces.push(this),e.addUniqueNeighbor(t),e.addUniqueNeighbor(r),t.faces.push(this),t.addUniqueNeighbor(e),t.addUniqueNeighbor(r),r.faces.push(this),r.addUniqueNeighbor(e),r.addUniqueNeighbor(t)}computeNormal(){const e=this.v1.position,t=this.v2.position,r=this.v3.position;_e.subVectors(r,t),Te.subVectors(e,t),_e.cross(Te).normalize(),this.normal.copy(_e)}hasVertex(e){return e===this.v1||e===this.v2||e===this.v3}replaceVertex(e,t){e===this.v1?this.v1=t:e===this.v2?this.v2=t:e===this.v3&&(this.v3=t),Ce(e.faces,this),t.faces.push(this),e.removeIfNonNeighbor(this.v1),this.v1.removeIfNonNeighbor(e),e.removeIfNonNeighbor(this.v2),this.v2.removeIfNonNeighbor(e),e.removeIfNonNeighbor(this.v3),this.v3.removeIfNonNeighbor(e),this.v1.addUniqueNeighbor(this.v2),this.v1.addUniqueNeighbor(this.v3),this.v2.addUniqueNeighbor(this.v1),this.v2.addUniqueNeighbor(this.v3),this.v3.addUniqueNeighbor(this.v1),this.v3.addUniqueNeighbor(this.v2),this.computeNormal()}}class Re{constructor(){Me(this,"computeEdgeCollapseCost",((e,t)=>{const r=t.position.distanceTo(e.position);let n=0;const i=[];let a,s,o,l=e.faces.length;for(a=0;a<l;a++)s=e.faces[a],s.hasVertex(t)&&i.push(s);for(a=0;a<l;a++){let t=1;s=e.faces[a];for(let e=0;e<i.length;e++){o=i[e];const r=s.normal.dot(o.normal);t=Math.min(t,(1.001-r)/2)}n=Math.max(n,t)}i.length<2&&(n=1);return r*n+0})),Me(this,"computeEdgeCostAtVertex",(e=>{if(0===e.neighbors.length)return e.collapseNeighbor=null,void(e.collapseCost=-.01);e.collapseCost=1e5,e.collapseNeighbor=null;for(let t=0;t<e.neighbors.length;t++){const r=this.computeEdgeCollapseCost(e,e.neighbors[t]);e.collapseNeighbor||(e.collapseNeighbor=e.neighbors[t],e.collapseCost=r,e.minCost=r,e.totalCost=0,e.costCount=0),e.costCount++,e.totalCost+=r,r<e.minCost&&(e.collapseNeighbor=e.neighbors[t],e.minCost=r)}e.collapseCost=e.totalCost/e.costCount})),Me(this,"removeFace",((e,t)=>{Ce(t,e),e.v1&&Ce(e.v1.faces,e),e.v2&&Ce(e.v2.faces,e),e.v3&&Ce(e.v3.faces,e);const r=[e.v1,e.v2,e.v3];let n,i;for(let a=0;a<3;a++)n=r[a],i=r[(a+1)%3],n&&i&&(n.removeIfNonNeighbor(i),i.removeIfNonNeighbor(n))})),Me(this,"collapse",((e,t,r,n)=>{if(!n)return void this.removeVertex(r,e);let i;const a=[];for(i=0;i<r.neighbors.length;i++)a.push(r.neighbors[i]);for(i=r.faces.length-1;i>=0;i--)r.faces[i].hasVertex(n)&&this.removeFace(r.faces[i],t);for(i=r.faces.length-1;i>=0;i--)r.faces[i].replaceVertex(r,n);for(this.removeVertex(r,e),i=0;i<a.length;i++)this.computeEdgeCostAtVertex(a[i])})),Me(this,"minimumCostEdge",(e=>{let t=e[0];for(let r=0;r<e.length;r++)e[r].collapseCost<t.collapseCost&&(t=e[r]);return t})),Me(this,"modify",((e,t)=>{const r=(e=e.clone()).attributes;for(let n in r)"position"!==n&&e.deleteAttribute(n);const i=[],a=[],s=(e=(0,Ee.mergeVertices)(e)).getAttribute("position");for(let p=0;p<s.count;p++){const e=(new n.Vector3).fromBufferAttribute(s,p),t=new Ie(e,p);i.push(t)}const o=e.getIndex();if(null!==o)for(let n=0;n<o.count;n+=3){const e=o.getX(n),t=o.getX(n+1),r=o.getX(n+2),s=new Be(i[e],i[t],i[r],e,t,r);a.push(s)}else for(let n=0;n<s.count;n+=3){const e=n,t=n+1,r=n+2,s=new Be(i[e],i[t],i[r],e,t,r);a.push(s)}for(let n=0,p=i.length;n<p;n++)this.computeEdgeCostAtVertex(i[n]);let l,c=t;for(;c--;){if(l=this.minimumCostEdge(i),!l){console.log("THREE.SimplifyModifier: No next vertex");break}this.collapse(i,a,l,l.collapseNeighbor)}const u=new n.BufferGeometry,h=[];let d=[];for(let n=0;n<i.length;n++){const e=i[n].position;h.push(e.x,e.y,e.z)}for(let n=0;n<a.length;n++){const e=a[n],t=i.indexOf(e.v1),r=i.indexOf(e.v2),s=i.indexOf(e.v3);d.push(t,r,s)}return u.setAttribute("position",new n.Float32BufferAttribute(h,3)),u.setIndex(d),u}))}removeVertex(e,t){for(console.assert(0===e.faces.length);e.neighbors.length;){Ce(e.neighbors.pop().neighbors,e)}Ce(t,e)}}var Pe=Object.defineProperty,Fe=(e,t,r)=>(((e,t,r)=>{t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class Le{constructor(){Fe(this,"A",new n.Vector3),Fe(this,"B",new n.Vector3),Fe(this,"C",new n.Vector3),Fe(this,"positions",[]),Fe(this,"normals",new Float32Array),Fe(this,"indexes",[]),Fe(this,"pointToIndexMap",[]),Fe(this,"splitIndexes",[]),Fe(this,"oldNormals",[]),Fe(this,"computeNormals",(()=>{this.normals=new Float32Array(3*this.indexes.length);for(let e=0;e<this.indexes.length;e+=3){let t=this.indexes[e];this.A.set(this.positions[3*t],this.positions[3*t+1],this.positions[3*t+2]),t=this.indexes[e+1],this.B.set(this.positions[3*t],this.positions[3*t+1],this.positions[3*t+2]),t=this.indexes[e+2],this.C.set(this.positions[3*t],this.positions[3*t+1],this.positions[3*t+2]),this.C.sub(this.B),this.A.sub(this.B);const r=this.C.cross(this.A).normalize();for(let n=0;n<3;n++)this.normals[3*(e+n)]=r.x,this.normals[3*(e+n)+1]=r.y,this.normals[3*(e+n)+2]=r.z}})),Fe(this,"mapPositionsToIndexes",(()=>{this.pointToIndexMap=Array(this.positions.length/3);for(let e=0;e<this.indexes.length;e++){const t=this.indexes[e];null==this.pointToIndexMap[t]&&(this.pointToIndexMap[t]=[]),this.pointToIndexMap[t].push(e)}})),Fe(this,"edgeSplitToGroups",((e,t,r)=>{this.A.set(this.normals[3*r],this.normals[3*r+1],this.normals[3*r+2]).normalize();const n={splitGroup:[],currentGroup:[r]};for(let i of e)i!==r&&(this.B.set(this.normals[3*i],this.normals[3*i+1],this.normals[3*i+2]).normalize(),this.B.dot(this.A)<t?n.splitGroup.push(i):n.currentGroup.push(i));return n})),Fe(this,"edgeSplit",((e,t,r=null)=>{if(0===e.length)return;const n=[];for(let a of e)n.push(this.edgeSplitToGroups(e,t,a));let i=n[0];for(let a of n)a.currentGroup.length>i.currentGroup.length&&(i=a);null!=r&&this.splitIndexes.push({original:r,indexes:i.currentGroup}),i.splitGroup.length&&this.edgeSplit(i.splitGroup,t,r||i.currentGroup[0])})),Fe(this,"modify",((e,t,r=!0)=>{let i=!1;if(e.attributes.normal&&(i=!0,e=e.clone(),!0===r&&null!==e.index&&(this.oldNormals=e.attributes.normal.array),e.deleteAttribute("normal")),null==e.index){if(void 0===Ee)throw"THREE.EdgeSplitModifier relies on BufferGeometryUtils";e=(0,Ee.mergeVertices)(e)}this.indexes=e.index.array,this.positions=e.getAttribute("position").array,this.computeNormals(),this.mapPositionsToIndexes(),this.splitIndexes=[];for(let n of this.pointToIndexMap)this.edgeSplit(n,Math.cos(t)-.001);const a={};for(let o of Object.keys(e.attributes)){const t=e.attributes[o],r=new t.array.constructor((this.indexes.length+this.splitIndexes.length)*t.itemSize);r.set(t.array),a[o]=new n.BufferAttribute(r,t.itemSize,t.normalized)}const s=new Uint32Array(this.indexes.length);s.set(this.indexes);for(let n=0;n<this.splitIndexes.length;n++){const e=this.splitIndexes[n],t=this.indexes[e.original];for(let r of Object.values(a))for(let e=0;e<r.itemSize;e++)r.array[(this.indexes.length+n)*r.itemSize+e]=r.array[t*r.itemSize+e];for(let r of e.indexes)s[r]=this.indexes.length+n}(e=new n.BufferGeometry).setIndex(new n.BufferAttribute(s,1));for(let n of Object.keys(a))e.setAttribute(n,a[n]);if(i&&(e.computeVertexNormals(),null!==this.oldNormals)){const t=new Array(this.oldNormals.length/3).fill(!1);for(let e of this.splitIndexes)t[e.original]=!0;for(let r=0;r<t.length;r++)if(!1===t[r])for(let t=0;t<3;t++)e.attributes.normal.array[3*r+t]=this.oldNormals[3*r+t]}return e}))}}var De=Object.defineProperty,Ue=(e,t,r)=>(((e,t,r)=>{t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class Ne{constructor(e=.1,t=6){Ue(this,"maxEdgeLength"),Ue(this,"maxIterations"),Ue(this,"modify",(e=>{null!==e.index&&(e=e.toNonIndexed());const t=this.maxIterations,r=this.maxEdgeLength*this.maxEdgeLength,i=new n.Vector3,a=new n.Vector3,s=new n.Vector3,o=new n.Vector3,l=[i,a,s,o],c=new n.Vector3,u=new n.Vector3,h=new n.Vector3,d=new n.Vector3,p=[c,u,h,d],f=new n.Color,m=new n.Color,g=new n.Color,v=new n.Color,A=[f,m,g,v],y=new n.Vector2,x=new n.Vector2,b=new n.Vector2,w=new n.Vector2,E=[y,x,b,w],S=new n.Vector2,M=new n.Vector2,_=new n.Vector2,T=new n.Vector2,C=[S,M,_,T],I=e.attributes,B=void 0!==I.normal,R=void 0!==I.color,P=void 0!==I.uv,F=void 0!==I.uv2;let L=I.position.array,D=B?I.normal.array:null,U=R?I.color.array:null,N=P?I.uv.array:null,k=F?I.uv2.array:null,O=L,G=D,z=U,V=N,H=k,Q=0,j=!0;function W(e,t,r){const n=l[e],i=l[t],a=l[r];if(O.push(n.x,n.y,n.z),O.push(i.x,i.y,i.z),O.push(a.x,a.y,a.z),B){const n=p[e],i=p[t],a=p[r];G.push(n.x,n.y,n.z),G.push(i.x,i.y,i.z),G.push(a.x,a.y,a.z)}if(R){const n=A[e],i=A[t],a=A[r];z.push(n.r,n.g,n.b),z.push(i.r,i.g,i.b),z.push(a.r,a.g,a.b)}if(P){const n=E[e],i=E[t],a=E[r];V.push(n.x,n.y),V.push(i.x,i.y),V.push(a.x,a.y)}if(F){const n=C[e],i=C[t],a=C[r];H.push(n.x,n.y),H.push(i.x,i.y),H.push(a.x,a.y)}}for(;j&&Q<t;){Q++,j=!1,L=O,O=[],B&&(D=G,G=[]),R&&(U=z,z=[]),P&&(N=V,V=[]),F&&(k=H,H=[]);for(let e=0,t=0,n=L.length;e<n;e+=9,t+=6){i.fromArray(L,e+0),a.fromArray(L,e+3),s.fromArray(L,e+6),B&&D&&(c.fromArray(D,e+0),u.fromArray(D,e+3),h.fromArray(D,e+6)),R&&U&&(f.fromArray(U,e+0),m.fromArray(U,e+3),g.fromArray(U,e+6)),P&&N&&(y.fromArray(N,t+0),x.fromArray(N,t+2),b.fromArray(N,t+4)),F&&k&&(S.fromArray(k,t+0),M.fromArray(k,t+2),_.fromArray(k,t+4));const n=i.distanceToSquared(a),l=a.distanceToSquared(s),p=i.distanceToSquared(s);n>r||l>r||p>r?(j=!0,n>=l&&n>=p?(o.lerpVectors(i,a,.5),B&&d.lerpVectors(c,u,.5),R&&v.lerpColors(f,m,.5),P&&w.lerpVectors(y,x,.5),F&&T.lerpVectors(S,M,.5),W(0,3,2),W(3,1,2)):l>=n&&l>=p?(o.lerpVectors(a,s,.5),B&&d.lerpVectors(u,h,.5),R&&v.lerpColors(m,g,.5),P&&w.lerpVectors(x,b,.5),F&&T.lerpVectors(M,_,.5),W(0,1,3),W(3,2,0)):(o.lerpVectors(i,s,.5),B&&d.lerpVectors(c,h,.5),R&&v.lerpColors(f,g,.5),P&&w.lerpVectors(y,b,.5),F&&T.lerpVectors(S,_,.5),W(0,1,3),W(3,1,2))):W(0,1,2)}}const X=new n.BufferGeometry;return X.setAttribute("position",new n.Float32BufferAttribute(O,3)),B&&X.setAttribute("normal",new n.Float32BufferAttribute(G,3)),R&&X.setAttribute("color",new n.Float32BufferAttribute(z,3)),P&&X.setAttribute("uv",new n.Float32BufferAttribute(V,2)),F&&X.setAttribute("uv2",new n.Float32BufferAttribute(H,2)),X})),this.maxEdgeLength=e,this.maxIterations=t}}let ke,Oe,Ge,ze;function Ve(e,t=1/0,r=null){Oe||(Oe=new n.PlaneGeometry(2,2,1,1)),Ge||(Ge=new n.ShaderMaterial({uniforms:{blitTexture:new n.Uniform(e)},vertexShader:"\n varying vec2 vUv;\n void main(){\n vUv = uv;\n gl_Position = vec4(position.xy * 1.0,0.,.999999);\n }\n ",fragmentShader:"\n uniform sampler2D blitTexture; \n varying vec2 vUv;\n\n void main(){ \n gl_FragColor = vec4(vUv.xy, 0, 1);\n \n #ifdef IS_SRGB\n gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) );\n #else\n gl_FragColor = texture2D( blitTexture, vUv);\n #endif\n }\n "})),Ge.uniforms.blitTexture.value=e,Ge.defines.IS_SRGB="colorSpace"in e?"srgb"===e.colorSpace:3001===e.encoding,Ge.needsUpdate=!0,ze||(ze=new n.Mesh(Oe,Ge),ze.frustrumCulled=!1);const i=new n.PerspectiveCamera,a=new n.Scene;a.add(ze),r||(r=ke=new n.WebGLRenderer({antialias:!1})),r.setSize(Math.min(e.image.width,t),Math.min(e.image.height,t)),r.clear(),r.render(a,i);const s=new n.Texture(r.domElement);return s.minFilter=e.minFilter,s.magFilter=e.magFilter,s.wrapS=e.wrapS,s.wrapT=e.wrapT,s.name=e.name,ke&&(ke.dispose(),ke=null),s}const He={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class Qe{constructor(){this.pluginCallbacks=[],this.register((function(e){return new Et(e)})),this.register((function(e){return new St(e)})),this.register((function(e){return new Tt(e)})),this.register((function(e){return new Ct(e)})),this.register((function(e){return new It(e)})),this.register((function(e){return new Bt(e)})),this.register((function(e){return new Mt(e)})),this.register((function(e){return new _t(e)})),this.register((function(e){return new Rt(e)})),this.register((function(e){return new Pt(e)})),this.register((function(e){return new Ft(e)}))}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,r,n){const i=new wt,a=[];for(let s=0,o=this.pluginCallbacks.length;s<o;s++)a.push(this.pluginCallbacks[s](i));i.setPlugins(a),i.write(e,t,n).catch(r)}parseAsync(e,t){const r=this;return new Promise((function(n,i){r.parse(e,n,i,t)}))}}const je=0,We=1,Xe=2,Ye=3,qe=4,Ke=5120,Je=5121,Ze=5122,$e=5123,et=5124,tt=5125,rt=5126,nt=34962,it=34963,at=9728,st=9729,ot=9984,lt=9985,ct=9986,ut=9987,ht=33071,dt=33648,pt=10497,ft={};ft[n.NearestFilter]=at,ft[n.NearestMipmapNearestFilter]=ot,ft[n.NearestMipmapLinearFilter]=ct,ft[n.LinearFilter]=st,ft[n.LinearMipmapNearestFilter]=lt,ft[n.LinearMipmapLinearFilter]=ut,ft[n.ClampToEdgeWrapping]=ht,ft[n.RepeatWrapping]=pt,ft[n.MirroredRepeatWrapping]=dt;const mt={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},gt=new n.Color;function vt(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))}function At(e){return 4*Math.ceil(e/4)}function yt(e,t=0){const r=At(e.byteLength);if(r!==e.byteLength){const n=new Uint8Array(r);if(n.set(new Uint8Array(e)),0!==t)for(let i=e.byteLength;i<r;i++)n[i]=t;return n.buffer}return e}function xt(){return"undefined"==typeof document&&"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas")}function bt(e,t){if(void 0!==e.toBlob)return new Promise((r=>e.toBlob(r,t)));let r;return"image/jpeg"===t?r=.92:"image/webp"===t&&(r=.8),e.convertToBlob({type:t,quality:r})}class wt{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,r={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const n=this,i=n.buffers,a=n.json;r=n.options;const s=n.extensionsUsed,o=n.extensionsRequired,l=new Blob(i,{type:"application/octet-stream"}),c=Object.keys(s),u=Object.keys(o);if(c.length>0&&(a.extensionsUsed=c),u.length>0&&(a.extensionsRequired=u),a.buffers&&a.buffers.length>0&&(a.buffers[0].byteLength=l.size),!0===r.binary){const e=new FileReader;e.readAsArrayBuffer(l),e.onloadend=function(){const r=yt(e.result),n=new DataView(new ArrayBuffer(8));n.setUint32(0,r.byteLength,!0),n.setUint32(4,5130562,!0);const i=yt((s=JSON.stringify(a),(new TextEncoder).encode(s).buffer),32);var s;const o=new DataView(new ArrayBuffer(8));o.setUint32(0,i.byteLength,!0),o.setUint32(4,1313821514,!0);const l=new ArrayBuffer(12),c=new DataView(l);c.setUint32(0,1179937895,!0),c.setUint32(4,2,!0);const u=12+o.byteLength+i.byteLength+n.byteLength+r.byteLength;c.setUint32(8,u,!0);const h=new Blob([l,o,i,n,r],{type:"application/octet-stream"}),d=new FileReader;d.readAsArrayBuffer(h),d.onloadend=function(){t(d.result)}}}else if(a.buffers&&a.buffers.length>0){const e=new FileReader;e.readAsDataURL(l),e.onloadend=function(){const r=e.result;a.buffers[0].uri=r,t(a)}}else t(a)}serializeUserData(e,t){if(0===Object.keys(e.userData).length)return;const r=this.options,n=this.extensionsUsed;try{const i=JSON.parse(JSON.stringify(e.userData));if(r.includeCustomExtensions&&i.gltfExtensions){void 0===t.extensions&&(t.extensions={});for(const e in i.gltfExtensions)t.extensions[e]=i.gltfExtensions[e],n[e]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(t.extras=i)}catch(i){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+i.message)}}getUID(e,t=!1){if(!1===this.uids.has(e)){const t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const t=new n.Vector3;for(let r=0,n=e.count;r<n;r++)if(Math.abs(t.fromBufferAttribute(e,r).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const r=e.clone(),i=new n.Vector3;for(let n=0,a=r.count;n<a;n++)i.fromBufferAttribute(r,n),0===i.x&&0===i.y&&0===i.z?i.setX(1):i.normalize(),r.setXYZ(n,i.x,i.y,i.z);return t.attributesNormalized.set(e,r),r}applyTextureTransform(e,t){let r=!1;const n={};0===t.offset.x&&0===t.offset.y||(n.offset=t.offset.toArray(),r=!0),0!==t.rotation&&(n.rotation=t.rotation,r=!0),1===t.repeat.x&&1===t.repeat.y||(n.scale=t.repeat.toArray(),r=!0),r&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=n,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function r(e){return("colorSpace"in e?"srgb"===e.colorSpace:3001===e.encoding)?function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}:function(e){return e}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof n.CompressedTexture&&(e=Ve(e)),t instanceof n.CompressedTexture&&(t=Ve(t));const i=e?e.image:null,a=t?t.image:null,s=Math.max(i?i.width:0,a?a.width:0),o=Math.max(i?i.height:0,a?a.height:0),l=xt();l.width=s,l.height=o;const c=l.getContext("2d");c.fillStyle="#00ffff",c.fillRect(0,0,s,o);const u=c.getImageData(0,0,s,o);if(i){c.drawImage(i,0,0,s,o);const t=r(e),n=c.getImageData(0,0,s,o).data;for(let e=2;e<n.length;e+=4)u.data[e]=256*t(n[e]/256)}if(a){c.drawImage(a,0,0,s,o);const e=r(t),n=c.getImageData(0,0,s,o).data;for(let t=1;t<n.length;t+=4)u.data[t]=256*e(n[t]/256)}c.putImageData(u,0,0);const h=(e||t).clone();return h.source=new n.Source(l),"colorSpace"in h?h.colorSpace="":h.encoding=3e3,h.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),h}processBuffer(e){const t=this.json,r=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),r.push(e),0}processBufferView(e,t,r,i,a){const s=this.json;let o;switch(s.bufferViews||(s.bufferViews=[]),t){case Ke:case Je:o=1;break;case Ze:case $e:o=2;break;default:o=4}const l=At(i*e.itemSize*o),c=new DataView(new ArrayBuffer(l));let u=0;for(let d=r;d<r+i;d++)for(let r=0;r<e.itemSize;r++){let i;e.itemSize>4?i=e.array[d*e.itemSize+r]:(0===r?i=e.getX(d):1===r?i=e.getY(d):2===r?i=e.getZ(d):3===r&&(i=e.getW(d)),!0===e.normalized&&(i=n.MathUtils.normalize(i,e.array))),t===rt?c.setFloat32(u,i,!0):t===et?c.setInt32(u,i,!0):t===tt?c.setUint32(u,i,!0):t===Ze?c.setInt16(u,i,!0):t===$e?c.setUint16(u,i,!0):t===Ke?c.setInt8(u,i):t===Je&&c.setUint8(u,i),u+=o}const h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};void 0!==a&&(h.target=a),a===nt&&(h.byteStride=e.itemSize*o),this.byteOffset+=l,s.bufferViews.push(h);return{id:s.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,r=t.json;return r.bufferViews||(r.bufferViews=[]),new Promise((function(n){const i=new FileReader;i.readAsArrayBuffer(e),i.onloadend=function(){const e=yt(i.result),a={buffer:t.processBuffer(e),byteOffset:t.byteOffset,byteLength:e.byteLength};t.byteOffset+=e.byteLength,n(r.bufferViews.push(a)-1)}}))}processAccessor(e,t,r,i){const a=this.json;let s;if(e.array.constructor===Float32Array)s=rt;else if(e.array.constructor===Int32Array)s=et;else if(e.array.constructor===Uint32Array)s=tt;else if(e.array.constructor===Int16Array)s=Ze;else if(e.array.constructor===Uint16Array)s=$e;else if(e.array.constructor===Int8Array)s=Ke;else{if(e.array.constructor!==Uint8Array)throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);s=Je}if(void 0===r&&(r=0),void 0===i&&(i=e.count),0===i)return null;const o=function(e,t,r){const i={min:new Array(e.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(e.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let a=t;a<t+r;a++)for(let t=0;t<e.itemSize;t++){let r;e.itemSize>4?r=e.array[a*e.itemSize+t]:(0===t?r=e.getX(a):1===t?r=e.getY(a):2===t?r=e.getZ(a):3===t&&(r=e.getW(a)),!0===e.normalized&&(r=n.MathUtils.normalize(r,e.array))),i.min[t]=Math.min(i.min[t],r),i.max[t]=Math.max(i.max[t],r)}return i}(e,r,i);let l;void 0!==t&&(l=e===t.index?it:nt);const c=this.processBufferView(e,s,r,i,l),u={bufferView:c.id,byteOffset:c.byteOffset,componentType:s,count:i,max:o.max,min:o.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(u.normalized=!0),a.accessors||(a.accessors=[]),a.accessors.push(u)-1}processImage(e,t,r,i="image/png"){if(null!==e){const a=this,s=a.cache,o=a.json,l=a.options,c=a.pending;s.images.has(e)||s.images.set(e,{});const u=s.images.get(e),h=i+":flipY/"+r.toString();if(void 0!==u[h])return u[h];o.images||(o.images=[]);const d={mimeType:i},p=xt();p.width=Math.min(e.width,l.maxTextureSize),p.height=Math.min(e.height,l.maxTextureSize);const f=p.getContext("2d");if(!0===r&&(f.translate(0,p.height),f.scale(1,-1)),void 0!==e.data){t!==n.RGBAFormat&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>l.maxTextureSize||e.height>l.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const r=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;t<r.length;t+=4)r[t+0]=e.data[t+0],r[t+1]=e.data[t+1],r[t+2]=e.data[t+2],r[t+3]=e.data[t+3];f.putImageData(new ImageData(r,e.width,e.height),0,0)}else f.drawImage(e,0,0,p.width,p.height);!0===l.binary?c.push(bt(p,i).then((e=>a.processBufferViewImage(e))).then((e=>{d.bufferView=e}))):void 0!==p.toDataURL?d.uri=p.toDataURL(i):c.push(bt(p,i).then((e=>(new FileReader).readAsDataURL(e))).then((e=>{d.uri=e})));const m=o.images.push(d)-1;return u[h]=m,m}throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const r={magFilter:ft[e.magFilter],minFilter:ft[e.minFilter],wrapS:ft[e.wrapS],wrapT:ft[e.wrapT]};return t.samplers.push(r)-1}processTexture(e){const t=this.options,r=this.cache,i=this.json;if(r.textures.has(e))return r.textures.get(e);i.textures||(i.textures=[]),e instanceof n.CompressedTexture&&(e=Ve(e,t.maxTextureSize));let a=e.userData.mimeType;"image/webp"===a&&(a="image/png");const s={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,a)};e.name&&(s.name=e.name),this._invokeAll((function(t){t.writeTexture&&t.writeTexture(e,s)}));const o=i.textures.push(s)-1;return r.textures.set(e,o),o}processMaterial(e){const t=this.cache,r=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);const i={pbrMetallicRoughness:{}};!0!==e.isMeshStandardMaterial&&!0!==e.isMeshBasicMaterial&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const a=e.color.toArray().concat([e.opacity]);if(vt(a,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=a),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){const t=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),r={index:this.processTexture(t),channel:t.channel};this.applyTextureTransform(r,t),i.pbrMetallicRoughness.metallicRoughnessTexture=r}if(e.map){const t={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(t,e.map),i.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){const t=e.emissive;if(Math.max(t.r,t.g,t.b)>0&&(i.emissiveFactor=e.emissive.toArray()),e.emissiveMap){const t={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(t,e.emissiveMap),i.emissiveTexture=t}}if(e.normalMap){const t={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&1!==e.normalScale.x&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),i.normalTexture=t}if(e.aoMap){const t={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};1!==e.aoMapIntensity&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),i.occlusionTexture=t}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===n.DoubleSide&&(i.doubleSided=!0),""!==e.name&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll((function(t){t.writeMaterial&&t.writeMaterial(e,i)}));const s=r.materials.push(i)-1;return t.materials.set(e,s),s}processMesh(e){const t=this.cache,r=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let n=0,y=e.material.length;n<y;n++)i.push(e.material[n].uuid);else i.push(e.material.uuid);const a=i.join(":");if(t.meshes.has(a))return t.meshes.get(a);const s=e.geometry;let o;o=e.isLineSegments?We:e.isLineLoop?Xe:e.isLine?Ye:e.isPoints?je:e.material.wireframe?We:qe;const l={},c={},u=[],h=[],d={uv:"TEXCOORD_0",[n.REVISION.replace(/\D+/g,"")>=152?"uv1":"uv2"]:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},p=s.getAttribute("normal");void 0===p||this.isNormalizedNormalAttribute(p)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),s.setAttribute("normal",this.createNormalizedNormalAttribute(p)));let f=null;for(let y in s.attributes){if("morph"===y.slice(0,5))continue;const e=s.attributes[y];y=d[y]||y.toUpperCase();if(/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(y)||(y="_"+y),t.attributes.has(this.getUID(e))){c[y]=t.attributes.get(this.getUID(e));continue}f=null;const r=e.array;"JOINTS_0"!==y||r instanceof Uint16Array||r instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),f=new n.BufferAttribute(new Uint16Array(r),e.itemSize,e.normalized));const i=this.processAccessor(f||e,s);null!==i&&(y.startsWith("_")||this.detectMeshQuantization(y,e),c[y]=i,t.attributes.set(this.getUID(e),i))}if(void 0!==p&&s.setAttribute("normal",p),0===Object.keys(c).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){const r=[],n=[],i={};if(void 0!==e.morphTargetDictionary)for(const t in e.morphTargetDictionary)i[e.morphTargetDictionary[t]]=t;for(let a=0;a<e.morphTargetInfluences.length;++a){const o={};let l=!1;for(const e in s.morphAttributes){if("position"!==e&&"normal"!==e){l||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),l=!0);continue}const r=s.morphAttributes[e][a],n=e.toUpperCase(),i=s.attributes[e];if(t.attributes.has(this.getUID(r,!0))){o[n]=t.attributes.get(this.getUID(r,!0));continue}const c=r.clone();if(!s.morphTargetsRelative)for(let e=0,t=r.count;e<t;e++)for(let n=0;n<r.itemSize;n++)0===n&&c.setX(e,r.getX(e)-i.getX(e)),1===n&&c.setY(e,r.getY(e)-i.getY(e)),2===n&&c.setZ(e,r.getZ(e)-i.getZ(e)),3===n&&c.setW(e,r.getW(e)-i.getW(e));o[n]=this.processAccessor(c,s),t.attributes.set(this.getUID(i,!0),o[n])}h.push(o),r.push(e.morphTargetInfluences[a]),void 0!==e.morphTargetDictionary&&n.push(i[a])}l.weights=r,n.length>0&&(l.extras={},l.extras.targetNames=n)}const m=Array.isArray(e.material);if(m&&0===s.groups.length)return null;const g=m?e.material:[e.material],v=m?s.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let n=0,y=v.length;n<y;n++){const e={mode:o,attributes:c};if(this.serializeUserData(s,e),h.length>0&&(e.targets=h),null!==s.index){let r=this.getUID(s.index);void 0===v[n].start&&void 0===v[n].count||(r+=":"+v[n].start+":"+v[n].count),t.attributes.has(r)?e.indices=t.attributes.get(r):(e.indices=this.processAccessor(s.index,s,v[n].start,v[n].count),t.attributes.set(r,e.indices)),null===e.indices&&delete e.indices}const r=this.processMaterial(g[v[n].materialIndex]);null!==r&&(e.material=r),u.push(e)}l.primitives=u,r.meshes||(r.meshes=[]),this._invokeAll((function(t){t.writeMesh&&t.writeMesh(e,l)}));const A=r.meshes.push(l)-1;return t.meshes.set(a,A),A}detectMeshQuantization(e,t){if(this.extensionsUsed.KHR_mesh_quantization)return;let r;switch(t.array.constructor){case Int8Array:r="byte";break;case Uint8Array:r="unsigned byte";break;case Int16Array:r="short";break;case Uint16Array:r="unsigned short";break;default:return}t.normalized&&(r+=" normalized");const n=e.split("_",1)[0];He[n]&&He[n].includes(r)&&(this.extensionsUsed.KHR_mesh_quantization=!0,this.extensionsRequired.KHR_mesh_quantization=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const r=e.isOrthographicCamera,i={type:r?"orthographic":"perspective"};return r?i.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:n.MathUtils.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){const r=this.json,i=this.nodeMap;r.animations||(r.animations=[]);const a=(e=Qe.Utils.mergeMorphTargetTracks(e.clone(),t)).tracks,s=[],o=[];for(let l=0;l<a.length;++l){const e=a[l],r=n.PropertyBinding.parseTrackName(e.name);let c=n.PropertyBinding.findNode(t,r.nodeName);const u=mt[r.propertyName];if("bones"===r.objectName&&(c=!0===c.isSkinnedMesh?c.skeleton.getBoneByName(r.objectIndex):void 0),!c||!u)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',e.name),null;const h=1;let d,p=e.values.length/e.times.length;u===mt.morphTargetInfluences&&(p/=c.morphTargetInfluences.length),!0===e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline?(d="CUBICSPLINE",p/=3):d=e.getInterpolation()===n.InterpolateDiscrete?"STEP":"LINEAR",o.push({input:this.processAccessor(new n.BufferAttribute(e.times,h)),output:this.processAccessor(new n.BufferAttribute(e.values,p)),interpolation:d}),s.push({sampler:o.length-1,target:{node:i.get(c),path:u}})}return r.animations.push({name:e.name||"clip_"+r.animations.length,samplers:o,channels:s}),r.animations.length-1}processSkin(e){const t=this.json,r=this.nodeMap,i=t.nodes[r.get(e)],a=e.skeleton;if(void 0===a)return null;const s=e.skeleton.bones[0];if(void 0===s)return null;const o=[],l=new Float32Array(16*a.bones.length),c=new n.Matrix4;for(let n=0;n<a.bones.length;++n)o.push(r.get(a.bones[n])),c.copy(a.boneInverses[n]),c.multiply(e.bindMatrix).toArray(l,16*n);void 0===t.skins&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new n.BufferAttribute(l,16)),joints:o,skeleton:r.get(s)});return i.skin=t.skins.length-1}processNode(e){const t=this.json,r=this.options,n=this.nodeMap;t.nodes||(t.nodes=[]);const i={};if(r.trs){const t=e.quaternion.toArray(),r=e.position.toArray(),n=e.scale.toArray();vt(t,[0,0,0,1])||(i.rotation=t),vt(r,[0,0,0])||(i.translation=r),vt(n,[1,1,1])||(i.scale=n)}else e.matrixAutoUpdate&&e.updateMatrix(),!1===function(e){return vt(e.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}(e.matrix)&&(i.matrix=e.matrix.elements);if(""!==e.name&&(i.name=String(e.name)),this.serializeUserData(e,i),e.isMesh||e.isLine||e.isPoints){const t=this.processMesh(e);null!==t&&(i.mesh=t)}else e.isCamera&&(i.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const t=[];for(let n=0,i=e.children.length;n<i;n++){const i=e.children[n];if(i.visible||!1===r.onlyVisible){const e=this.processNode(i);null!==e&&t.push(e)}}t.length>0&&(i.children=t)}this._invokeAll((function(t){t.writeNode&&t.writeNode(e,i)}));const a=t.nodes.push(i)-1;return n.set(e,a),a}processScene(e){const t=this.json,r=this.options;t.scenes||(t.scenes=[],t.scene=0);const n={};""!==e.name&&(n.name=e.name),t.scenes.push(n);const i=[];for(let a=0,s=e.children.length;a<s;a++){const t=e.children[a];if(t.visible||!1===r.onlyVisible){const e=this.processNode(t);null!==e&&i.push(e)}}i.length>0&&(n.nodes=i),this.serializeUserData(e,n)}processObjects(e){const t=new n.Scene;t.name="AuxScene";for(let r=0;r<e.length;r++)t.children.push(e[r]);this.processScene(t)}processInput(e){const t=this.options;e=e instanceof Array?e:[e],this._invokeAll((function(t){t.beforeParse&&t.beforeParse(e)}));const r=[];for(let i=0;i<e.length;i++)e[i]instanceof n.Scene?this.processScene(e[i]):r.push(e[i]);r.length>0&&this.processObjects(r);for(let n=0;n<this.skins.length;++n)this.processSkin(this.skins[n]);for(let n=0;n<t.animations.length;++n)this.processAnimation(t.animations[n],e[0]);this._invokeAll((function(t){t.afterParse&&t.afterParse(e)}))}_invokeAll(e){for(let t=0,r=this.plugins.length;t<r;t++)e(this.plugins[t])}}class Et{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);const r=this.writer,n=r.json,i=r.extensionsUsed,a={};e.name&&(a.name=e.name),a.color=e.color.toArray(),a.intensity=e.intensity,e.isDirectionalLight?a.type="directional":e.isPointLight?(a.type="point",e.distance>0&&(a.range=e.distance)):e.isSpotLight&&(a.type="spot",e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,a.spot.outerConeAngle=e.angle),void 0!==e.decay&&2!==e.decay&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),!e.target||e.target.parent===e&&0===e.target.position.x&&0===e.target.position.y&&-1===e.target.position.z||console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),i[this.name]||(n.extensions=n.extensions||{},n.extensions[this.name]={lights:[]},i[this.name]=!0);const s=n.extensions[this.name].lights;s.push(a),t.extensions=t.extensions||{},t.extensions[this.name]={light:s.length-1}}}class St{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const r=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},r[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class Mt{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.clearcoat)return;const r=this.writer,n=r.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){const t={index:r.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};r.applyTextureTransform(t,e.clearcoatMap),i.clearcoatTexture=t}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const t={index:r.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};r.applyTextureTransform(t,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){const t={index:r.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};r.applyTextureTransform(t,e.clearcoatNormalMap),i.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class _t{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.iridescence)return;const r=this.writer,n=r.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){const t={index:r.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};r.applyTextureTransform(t,e.iridescenceMap),i.iridescenceTexture=t}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const t={index:r.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};r.applyTextureTransform(t,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class Tt{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;const r=this.writer,n=r.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){const t={index:r.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};r.applyTextureTransform(t,e.transmissionMap),i.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class Ct{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;const r=this.writer,n=r.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){const t={index:r.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};r.applyTextureTransform(t,e.thicknessMap),i.thicknessTexture=t}i.attenuationDistance=e.attenuationDistance,i.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class It{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||1.5===e.ior)return;const r=this.writer.extensionsUsed,n={};n.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}}class Bt{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||1===e.specularIntensity&&e.specularColor.equals(gt)&&!e.specularIntensityMap&&!e.specularColorTexture)return;const r=this.writer,n=r.extensionsUsed,i={};if(e.specularIntensityMap){const t={index:r.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};r.applyTextureTransform(t,e.specularIntensityMap),i.specularTexture=t}if(e.specularColorMap){const t={index:r.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};r.applyTextureTransform(t,e.specularColorMap),i.specularColorTexture=t}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class Rt{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0==e.sheen)return;const r=this.writer,n=r.extensionsUsed,i={};if(e.sheenRoughnessMap){const t={index:r.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};r.applyTextureTransform(t,e.sheenRoughnessMap),i.sheenRoughnessTexture=t}if(e.sheenColorMap){const t={index:r.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};r.applyTextureTransform(t,e.sheenColorMap),i.sheenColorTexture=t}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class Pt{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0==e.anisotropy)return;const r=this.writer,n=r.extensionsUsed,i={};if(e.anisotropyMap){const t={index:r.processTexture(e.anisotropyMap)};r.applyTextureTransform(t,e.anisotropyMap),i.anisotropyTexture=t}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class Ft{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||1===e.emissiveIntensity)return;const r=this.writer.extensionsUsed,n={};n.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}}Qe.Utils={insertKeyframe:function(e,t){const r=.001,n=e.getValueSize(),i=new e.TimeBufferType(e.times.length+1),a=new e.ValueBufferType(e.values.length+n),s=e.createInterpolant(new e.ValueBufferType(n));let o;if(0===e.times.length){i[0]=t;for(let e=0;e<n;e++)a[e]=0;o=0}else if(t<e.times[0]){if(Math.abs(e.times[0]-t)<r)return 0;i[0]=t,i.set(e.times,1),a.set(s.evaluate(t),0),a.set(e.values,n),o=0}else if(t>e.times[e.times.length-1]){if(Math.abs(e.times[e.times.length-1]-t)<r)return e.times.length-1;i[i.length-1]=t,i.set(e.times,0),a.set(e.values,0),a.set(s.evaluate(t),e.values.length),o=i.length-1}else for(let l=0;l<e.times.length;l++){if(Math.abs(e.times[l]-t)<r)return l;if(e.times[l]<t&&e.times[l+1]>t){i.set(e.times.slice(0,l+1),0),i[l+1]=t,i.set(e.times.slice(l+1),l+2),a.set(e.values.slice(0,(l+1)*n),0),a.set(s.evaluate(t),(l+1)*n),a.set(e.values.slice((l+1)*n),(l+2)*n),o=l+1;break}}return e.times=i,e.values=a,o},mergeMorphTargetTracks:function(e,t){const r=[],i={},a=e.tracks;for(let s=0;s<a.length;++s){let e=a[s];const o=n.PropertyBinding.parseTrackName(e.name),l=n.PropertyBinding.findNode(t,o.nodeName);if("morphTargetInfluences"!==o.propertyName||void 0===o.propertyIndex){r.push(e);continue}if(e.createInterpolant!==e.InterpolantFactoryMethodDiscrete&&e.createInterpolant!==e.InterpolantFactoryMethodLinear){if(e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),e=e.clone(),e.setInterpolation(n.InterpolateLinear)}const c=l.morphTargetInfluences.length,u=l.morphTargetDictionary[o.propertyIndex];if(void 0===u)throw new Error("THREE.GLTFExporter: Morph target name not found: "+o.propertyIndex);let h;if(void 0===i[l.uuid]){h=e.clone();const t=new h.ValueBufferType(c*h.times.length);for(let e=0;e<h.times.length;e++)t[e*c+u]=h.values[e];h.name=(o.nodeName||"")+".morphTargetInfluences",h.values=t,i[l.uuid]=h,r.push(h);continue}const d=e.createInterpolant(new e.ValueBufferType(1));h=i[l.uuid];for(let t=0;t<h.times.length;t++)h.values[t*c+u]=d.evaluate(h.times[t]);for(let t=0;t<e.times.length;t++){const r=this.insertKeyframe(h,e.times[t]);h.values[r*c+u]=e.values[t]}}return e.tracks=r,e}};var Lt=r(93778),Dt=Object.defineProperty,Ut=(e,t,r)=>(((e,t,r)=>{t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class Nt{constructor(){Ut(this,"PRECISION",7),Ut(this,"materials"),Ut(this,"textures"),Ut(this,"files"),this.materials={},this.textures={},this.files={}}async parse(e){this.files["model.usda"]=null;let t=this.buildHeader();e.traverseVisible((e=>{if(e instanceof n.Mesh&&e.isMesh&&e.material.isMeshStandardMaterial){const r=e.geometry,n=e.material,i="geometries/Geometry_"+r.id+".usd";if(!(i in this.files)){const e=this.buildMeshObject(r);this.files[i]=this.buildUSDFileAsString(e)}n.uuid in this.materials||(this.materials[n.uuid]=n),t+=this.buildXform(e,r,n)}})),t+=this.buildMaterials(this.materials),this.files["model.usda"]=(0,Lt.TD)(t),t=null;for(const n in this.textures){const e=this.textures[n],t=n.split("_")[1],r=1023===e.format,i=this.imageToCanvas(e.image,t),a=await new Promise((e=>null==i?void 0:i.toBlob(e,r?"image/png":"image/jpeg",1)));a&&(this.files[`textures/Texture_${n}.${r?"png":"jpg"}`]=new Uint8Array(await a.arrayBuffer()))}let r=0;for(const n in this.files){const e=this.files[n];r+=34+n.length;const t=63&r;if(4!==t&&null!==e&&e instanceof Uint8Array){const r=new Uint8Array(64-t);this.files[n]=[e,{extra:{12345:r}}]}e&&"number"==typeof e.length&&(r=e.length)}return(0,Lt.Xo)(this.files,{level:0})}imageToCanvas(e,t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=1024/Math.max(e.width,e.height),n=document.createElement("canvas");n.width=e.width*Math.min(1,r),n.height=e.height*Math.min(1,r);const i=n.getContext("2d");if(null==i||i.drawImage(e,0,0,n.width,n.height),void 0!==t){const e=parseInt(t,16),r=(e>>16&255)/255,a=(e>>8&255)/255,s=(255&e)/255,o=null==i?void 0:i.getImageData(0,0,n.width,n.height);if(o){const e=null==o?void 0:o.data;for(let t=0;t<e.length;t+=4)e[t+0]=e[t+0]*r,e[t+1]=e[t+1]*a,e[t+2]=e[t+2]*s;null==i||i.putImageData(o,0,0)}}return n}}buildHeader(){return'#usda 1.0\n(\n customLayerData = {\n string creator = "Three.js USDZExporter"\n }\n metersPerUnit = 1\n upAxis = "Y"\n)\n'}buildUSDFileAsString(e){let t=this.buildHeader();return t+=e,(0,Lt.TD)(t)}buildXform(e,t,r){const n="Object_"+e.id,i=this.buildMatrix(e.matrixWorld);return e.matrixWorld.determinant()<0&&console.warn("THREE.USDZExporter: USDZ does not support negative scales",e),`def Xform "${n}" (\n prepend references = @./geometries/Geometry_${t.id}.usd@</Geometry>\n)\n{\n matrix4d xformOp:transform = ${i}\n uniform token[] xformOpOrder = ["xformOp:transform"]\n rel material:binding = </Materials/Material_${r.id}>\n}\n`}buildMatrix(e){const t=e.elements;return`( ${this.buildMatrixRow(t,0)}, ${this.buildMatrixRow(t,4)}, ${this.buildMatrixRow(t,8)}, ${this.buildMatrixRow(t,12)} )`}buildMatrixRow(e,t){return`(${e[t+0]}, ${e[t+1]}, ${e[t+2]}, ${e[t+3]})`}buildMeshObject(e){return`\ndef "Geometry"\n{\n ${this.buildMesh(e)}\n}\n`}buildMesh(e){const t=e.attributes,r=t.position.count;return`\n def Mesh "Geometry"\n {\n int[] faceVertexCounts = [${this.buildMeshVertexCount(e)}]\n int[] faceVertexIndices = [${this.buildMeshVertexIndices(e)}]\n normal3f[] normals = [${this.buildVector3Array(t.normal,r)}] (\n interpolation = "vertex"\n )\n point3f[] points = [${this.buildVector3Array(t.position,r)}]\n float2[] primvars:st = [${this.buildVector2Array(t.uv,r)}] (\n interpolation = "vertex"\n )\n uniform token subdivisionScheme = "none"\n }\n`}buildMeshVertexCount(e){const t=null!==e.index?e.index.array.length:e.attributes.position.count;return Array(t/3).fill(3).join(", ")}buildMeshVertexIndices(e){if(null!==e.index)return e.index.array.join(", ");const t=[],r=e.attributes.position.count;for(let n=0;n<r;n++)t.push(n);return t.join(", ")}buildVector3Array(e,t){if(void 0===e)return console.warn("USDZExporter: Normals missing."),Array(t).fill("(0, 0, 0)").join(", ");const r=[],n=e.array;for(let i=0;i<n.length;i+=3)r.push(`(${n[i+0].toPrecision(this.PRECISION)}, ${n[i+1].toPrecision(this.PRECISION)}, ${n[i+2].toPrecision(this.PRECISION)})`);return r.join(", ")}buildVector2Array(e,t){if(void 0===e)return console.warn("USDZExporter: UVs missing."),Array(t).fill("(0, 0)").join(", ");const r=[],n=e.array;for(let i=0;i<n.length;i+=2)r.push(`(${n[i+0].toPrecision(this.PRECISION)}, ${1-n[i+1].toPrecision(this.PRECISION)})`);return r.join(", ")}buildMaterials(e){const t=[];for(const r in e){const n=e[r];t.push(this.buildMaterial(n))}return`def "Materials"\n{\n${t.join("")}\n}\n`}buildMaterial(e){const t=" ",r=[],i=[];return null!==e.map?(r.push(`${t}color3f inputs:diffuseColor.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:rgb>`),i.push(this.buildTexture(e,e.map,"diffuse",e.color))):r.push(`${t}color3f inputs:diffuseColor = ${this.buildColor(e.color)}`),null!==e.emissiveMap?(r.push(`${t}color3f inputs:emissiveColor.connect = </Materials/Material_${e.id}/Texture_${e.emissiveMap.id}_emissive.outputs:rgb>`),i.push(this.buildTexture(e,e.emissiveMap,"emissive"))):e.emissive.getHex()>0&&r.push(`${t}color3f inputs:emissiveColor = ${this.buildColor(e.emissive)}`),null!==e.normalMap&&(r.push(`${t}normal3f inputs:normal.connect = </Materials/Material_${e.id}/Texture_${e.normalMap.id}_normal.outputs:rgb>`),i.push(this.buildTexture(e,e.normalMap,"normal"))),null!==e.aoMap&&(r.push(`${t}float inputs:occlusion.connect = </Materials/Material_${e.id}/Texture_${e.aoMap.id}_occlusion.outputs:r>`),i.push(this.buildTexture(e,e.aoMap,"occlusion"))),null!==e.roughnessMap&&1===e.roughness?(r.push(`${t}float inputs:roughness.connect = </Materials/Material_${e.id}/Texture_${e.roughnessMap.id}_roughness.outputs:g>`),i.push(this.buildTexture(e,e.roughnessMap,"roughness"))):r.push(`${t}float inputs:roughness = ${e.roughness}`),null!==e.metalnessMap&&1===e.metalness?(r.push(`${t}float inputs:metallic.connect = </Materials/Material_${e.id}/Texture_${e.metalnessMap.id}_metallic.outputs:b>`),i.push(this.buildTexture(e,e.metalnessMap,"metallic"))):r.push(`${t}float inputs:metallic = ${e.metalness}`),r.push(`${t}float inputs:opacity = ${e.opacity}`),e instanceof n.MeshPhysicalMaterial&&(r.push(`${t}float inputs:clearcoat = ${e.clearcoat}`),r.push(`${t}float inputs:clearcoatRoughness = ${e.clearcoatRoughness}`),r.push(`${t}float inputs:ior = ${e.ior}`)),`\n def Material "Material_${e.id}"\n {\n def Shader "PreviewSurface"\n {\n uniform token info:id = "UsdPreviewSurface"\n${r.join("\n")}\n int inputs:useSpecularWorkflow = 0\n token outputs:surface\n }\n token outputs:surface.connect = </Materials/Material_${e.id}/PreviewSurface.outputs:surface>\n token inputs:frame:stPrimvarName = "st"\n def Shader "uvReader_st"\n {\n uniform token info:id = "UsdPrimvarReader_float2"\n token inputs:varname.connect = </Materials/Material_${e.id}.inputs:frame:stPrimvarName>\n float2 inputs:fallback = (0.0, 0.0)\n float2 outputs:result\n }\n${i.join("\n")}\n }\n`}buildTexture(e,t,r,n){const i=t.id+(n?"_"+n.getHexString():""),a=1023===t.format;return this.textures[i]=t,`\n def Shader "Transform2d_${r}" (\n sdrMetadata = {\n string role = "math"\n }\n )\n {\n uniform token info:id = "UsdTransform2d"\n float2 inputs:in.connect = </Materials/Material_${e.id}/uvReader_st.outputs:result>\n float2 inputs:scale = ${this.buildVector2(t.repeat)}\n float2 inputs:translation = ${this.buildVector2(t.offset)}\n float2 outputs:result\n }\n def Shader "Texture_${t.id}_${r}"\n {\n uniform token info:id = "UsdUVTexture"\n asset inputs:file = @textures/Texture_${i}.${a?"png":"jpg"}@\n float2 inputs:st.connect = </Materials/Material_${e.id}/Transform2d_${r}.outputs:result>\n token inputs:wrapS = "repeat"\n token inputs:wrapT = "repeat"\n float outputs:r\n float outputs:g\n float outputs:b\n float3 outputs:rgb\n }`}buildColor(e){return`(${e.r}, ${e.g}, ${e.b})`}buildVector2(e){return`(${e.x}, ${e.y})`}}class kt{parse(e,t,r){t&&"object"==typeof t&&(console.warn('THREE.PLYExporter: The options parameter is now the third argument to the "parse" function. See the documentation for the new API.'),r=t,t=void 0);const i=(r=Object.assign({binary:!1,excludeAttributes:[],littleEndian:!1},r)).excludeAttributes;let a=!1,s=!1,o=!1,l=0,c=0;e.traverse((function(e){if(e instanceof n.Mesh&&e.isMesh){const t=e.geometry;if(!t.isBufferGeometry)throw new Error("THREE.PLYExporter: Geometry is not of type THREE.BufferGeometry.");const r=t.getAttribute("position"),n=t.getAttribute("normal"),i=t.getAttribute("uv"),u=t.getAttribute("color"),h=t.getIndex();if(void 0===r)return;l+=r.count,c+=h?h.count/3:r.count/3,void 0!==n&&(a=!0),void 0!==i&&(o=!0),void 0!==u&&(s=!0)}}));const u=-1===(null==i?void 0:i.indexOf("index"));if(a=a&&-1===(null==i?void 0:i.indexOf("normal")),s=s&&-1===(null==i?void 0:i.indexOf("color")),o=o&&-1===(null==i?void 0:i.indexOf("uv")),u&&c!==Math.floor(c))return console.error("PLYExporter: Failed to generate a valid PLY file with triangle indices because the number of indices is not divisible by 3."),null;let h=`ply\nformat ${r.binary?r.littleEndian?"binary_little_endian":"binary_big_endian":"ascii"} 1.0\nelement vertex ${l}\nproperty float x\nproperty float y\nproperty float z\n`;a&&(h+="property float nx\nproperty float ny\nproperty float nz\n"),o&&(h+="property float s\nproperty float t\n"),s&&(h+="property uchar red\nproperty uchar green\nproperty uchar blue\n"),u&&(h+=`element face ${c}\nproperty list uchar int vertex_index\n`),h+="end_header\n";const d=new n.Vector3,p=new n.Matrix3;let f=null;if(r.binary){const t=(new TextEncoder).encode(h),n=l*(12+(a?12:0)+(s?3:0)+(o?8:0)),i=u?13*c:0,m=new DataView(new ArrayBuffer(t.length+n+i));new Uint8Array(m.buffer).set(t,0);let g=t.length,v=t.length+n,A=0;this.traverseMeshes(e,(function(e,t){const n=t.getAttribute("position"),i=t.getAttribute("normal"),l=t.getAttribute("uv"),c=t.getAttribute("color"),h=t.getIndex();p.getNormalMatrix(e.matrixWorld);for(let u=0,f=n.count;u<f;u++)d.x=n.getX(u),d.y=n.getY(u),d.z=n.getZ(u),d.applyMatrix4(e.matrixWorld),m.setFloat32(g,d.x,r.littleEndian),g+=4,m.setFloat32(g,d.y,r.littleEndian),g+=4,m.setFloat32(g,d.z,r.littleEndian),g+=4,a&&(null!=i?(d.x=i.getX(u),d.y=i.getY(u),d.z=i.getZ(u),d.applyMatrix3(p).normalize(),m.setFloat32(g,d.x,r.littleEndian),g+=4,m.setFloat32(g,d.y,r.littleEndian),g+=4,m.setFloat32(g,d.z,r.littleEndian),g+=4):(m.setFloat32(g,0,r.littleEndian),g+=4,m.setFloat32(g,0,r.littleEndian),g+=4,m.setFloat32(g,0,r.littleEndian),g+=4)),o&&(null!=l?(m.setFloat32(g,l.getX(u),r.littleEndian),g+=4,m.setFloat32(g,l.getY(u),r.littleEndian),g+=4):o||(m.setFloat32(g,0,r.littleEndian),g+=4,m.setFloat32(g,0,r.littleEndian),g+=4)),s&&(null!=c?(m.setUint8(g,Math.floor(255*c.getX(u))),g+=1,m.setUint8(g,Math.floor(255*c.getY(u))),g+=1,m.setUint8(g,Math.floor(255*c.getZ(u))),g+=1):(m.setUint8(g,255),g+=1,m.setUint8(g,255),g+=1,m.setUint8(g,255),g+=1));if(u)if(null!==h)for(let a=0,s=h.count;a<s;a+=3)m.setUint8(v,3),v+=1,m.setUint32(v,h.getX(a+0)+A,r.littleEndian),v+=4,m.setUint32(v,h.getX(a+1)+A,r.littleEndian),v+=4,m.setUint32(v,h.getX(a+2)+A,r.littleEndian),v+=4;else for(let a=0,s=n.count;a<s;a+=3)m.setUint8(v,3),v+=1,m.setUint32(v,A+a,r.littleEndian),v+=4,m.setUint32(v,A+a+1,r.littleEndian),v+=4,m.setUint32(v,A+a+2,r.littleEndian),v+=4;A+=n.count})),f=m.buffer}else{let t=0,r="",n="";this.traverseMeshes(e,(function(e,i){const l=i.getAttribute("position"),h=i.getAttribute("normal"),f=i.getAttribute("uv"),m=i.getAttribute("color"),g=i.getIndex();p.getNormalMatrix(e.matrixWorld);for(let t=0,n=l.count;t<n;t++){d.x=l.getX(t),d.y=l.getY(t),d.z=l.getZ(t),d.applyMatrix4(e.matrixWorld);let n=d.x+" "+d.y+" "+d.z;a&&(null!=h?(d.x=h.getX(t),d.y=h.getY(t),d.z=h.getZ(t),d.applyMatrix3(p).normalize(),n+=" "+d.x+" "+d.y+" "+d.z):n+=" 0 0 0"),o&&(null!=f?n+=" "+f.getX(t)+" "+f.getY(t):o&&(n+=" 0 0")),s&&(n+=null!=m?" "+Math.floor(255*m.getX(t))+" "+Math.floor(255*m.getY(t))+" "+Math.floor(255*m.getZ(t)):" 255 255 255"),r+=n+"\n"}if(u){if(null!==g)for(let e=0,r=g.count;e<r;e+=3)n+=`3 ${g.getX(e+0)+t}`,n+=` ${g.getX(e+1)+t}`,n+=` ${g.getX(e+2)+t}\n`;else for(let e=0,r=l.count;e<r;e+=3)n+=`3 ${t+e} ${t+e+1} ${t+e+2}\n`;c+=g?g.count/3:l.count/3}t+=l.count})),f=`${h}${r}${u?`${n}\n`:"\n"}`}return"function"==typeof t&&requestAnimationFrame((()=>t&&t("string"==typeof f?f:""))),f}traverseMeshes(e,t){e.traverse((function(e){if(e instanceof n.Mesh&&e.isMesh){const r=e,n=r.geometry;if(!n.isBufferGeometry)throw new Error("THREE.PLYExporter: Geometry is not of type THREE.BufferGeometry.");n.hasAttribute("position")&&t(r,n)}}))}}var Ot=Object.defineProperty,Gt=(e,t,r)=>(((e,t,r)=>{t in e?Ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const zt=class{parse(e,t={decodeSpeed:5,encodeSpeed:5,encoderMethod:zt.MESH_EDGEBREAKER_ENCODING,quantization:[16,8,8,8,8],exportUvs:!0,exportNormals:!0,exportColor:!1}){if(e instanceof n.BufferGeometry&&e.isBufferGeometry)throw new Error("DRACOExporter: The first parameter of parse() is now an instance of Mesh or Points.");if(void 0===DracoEncoderModule)throw new Error("THREE.DRACOExporter: required the draco_encoder to work.");const r=e.geometry,i=DracoEncoderModule(),a=new i.Encoder;let s,o;if(!r.isBufferGeometry)throw new Error("THREE.DRACOExporter.parse(geometry, options): geometry is not a THREE.BufferGeometry instance.");if(e instanceof n.Mesh&&e.isMesh){s=new i.MeshBuilder,o=new i.Mesh;const e=r.getAttribute("position");s.AddFloatAttributeToMesh(o,i.POSITION,e.count,e.itemSize,e.array);const n=r.getIndex();if(null!==n)s.AddFacesToMesh(o,n.count/3,n.array);else{const t=new(e.count>65535?Uint32Array:Uint16Array)(e.count);for(let e=0;e<t.length;e++)t[e]=e;s.AddFacesToMesh(o,e.count,t)}if(t.exportNormals){const e=r.getAttribute("normal");void 0!==e&&s.AddFloatAttributeToMesh(o,i.NORMAL,e.count,e.itemSize,e.array)}if(t.exportUvs){const e=r.getAttribute("uv");void 0!==e&&s.AddFloatAttributeToMesh(o,i.TEX_COORD,e.count,e.itemSize,e.array)}if(t.exportColor){const e=r.getAttribute("color");void 0!==e&&s.AddFloatAttributeToMesh(o,i.COLOR,e.count,e.itemSize,e.array)}}else{if(!(e instanceof n.Points&&e.isPoints))throw new Error("DRACOExporter: Unsupported object type.");{s=new i.PointCloudBuilder,o=new i.PointCloud;const e=r.getAttribute("position");if(s.AddFloatAttribute(o,i.POSITION,e.count,e.itemSize,e.array),t.exportColor){const e=r.getAttribute("color");void 0!==e&&s.AddFloatAttribute(o,i.COLOR,e.count,e.itemSize,e.array)}}}const l=new i.DracoInt8Array,c=void 0!==t.encodeSpeed?t.encodeSpeed:5,u=void 0!==t.decodeSpeed?t.decodeSpeed:5;if(a.SetSpeedOptions(c,u),void 0!==t.encoderMethod&&a.SetEncodingMethod(t.encoderMethod),void 0!==t.quantization)for(let n=0;n<5;n++)void 0!==t.quantization[n]&&a.SetAttributeQuantization(n,t.quantization[n]);let h;if(h=e instanceof n.Mesh&&e.isMesh?a.EncodeMeshToDracoBuffer(o,l):a.EncodePointCloudToDracoBuffer(o,!0,l),i.destroy(o),0===h)throw new Error("THREE.DRACOExporter: Draco encoding failed.");const d=new Int8Array(new ArrayBuffer(h));for(let n=0;n<h;n++)d[n]=l.GetValue(n);return i.destroy(l),i.destroy(a),i.destroy(s),d}};let Vt=zt;Gt(Vt,"MESH_EDGEBREAKER_ENCODING",1),Gt(Vt,"MESH_SEQUENTIAL_ENCODING",0),Gt(Vt,"POINT_CLOUD",0),Gt(Vt,"TRIANGULAR_MESH",1),Gt(Vt,"INVALID",-1),Gt(Vt,"POSITION",0),Gt(Vt,"NORMAL",1),Gt(Vt,"COLOR",2),Gt(Vt,"TEX_COORD",3),Gt(Vt,"GENERIC",4);var Ht=Object.defineProperty,Qt=(e,t,r)=>(((e,t,r)=>{t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class jt{constructor(){Qt(this,"options"),Qt(this,"geometryInfo"),Qt(this,"materialMap"),Qt(this,"imageMap"),Qt(this,"textures"),Qt(this,"libraryImages"),Qt(this,"libraryGeometries"),Qt(this,"libraryEffects"),Qt(this,"libraryMaterials"),Qt(this,"canvas"),Qt(this,"ctx"),Qt(this,"transMat"),Qt(this,"getFuncs",["getX","getY","getZ","getW"]),this.options={version:"1.4.1",author:null,textureDirectory:"",upAxis:"Y_UP",unitName:null,unitMeter:null},this.geometryInfo=new WeakMap,this.materialMap=new WeakMap,this.imageMap=new WeakMap,this.textures=[],this.libraryImages=[],this.libraryGeometries=[],this.libraryEffects=[],this.libraryMaterials=[],this.canvas=null,this.ctx=null,this.transMat=null}parse(e,t,r={}){if(this.options={...this.options,...r},null===this.options.upAxis.match(/^[XYZ]_UP$/))return console.error("ColladaExporter: Invalid upAxis: valid values are X_UP, Y_UP or Z_UP."),null;if(null!==this.options.unitName&&null===this.options.unitMeter)return console.error("ColladaExporter: unitMeter needs to be specified if unitName is specified."),null;if(null!==this.options.unitMeter&&null===this.options.unitName)return console.error("ColladaExporter: unitName needs to be specified if unitMeter is specified."),null;if(""!==this.options.textureDirectory&&(this.options.textureDirectory=`${this.options.textureDirectory}/`.replace(/\\/g,"/").replace(/\/+/g,"/")),"1.4.1"!==this.options.version&&"1.5.0"!==this.options.version)return console.warn(`ColladaExporter : Version ${this.options.version} not supported for export. Only 1.4.1 and 1.5.0.`),null;const n=this.processObject(e);let i=`<?xml version="1.0" encoding="UTF-8" standalone="no" ?><COLLADA xmlns="${"1.4.1"===this.options.version?"http://www.collada.org/2005/11/COLLADASchema":"https://www.khronos.org/collada/"}" version="${this.options.version}"><asset><contributor><authoring_tool>three.js Collada Exporter</authoring_tool>${null!==this.options.author?`<author>${this.options.author}</author>`:""}</contributor><created>${(new Date).toISOString()}</created><modified>${(new Date).toISOString()}</modified><up_axis>Y_UP</up_axis></asset>`;i+=`<library_images>${this.libraryImages.join("")}</library_images>`,i+=`<library_effects>${this.libraryEffects.join("")}</library_effects>`,i+=`<library_materials>${this.libraryMaterials.join("")}</library_materials>`,i+=`<library_geometries>${this.libraryGeometries.join("")}</library_geometries>`,i+=`<library_visual_scenes><visual_scene id="Scene" name="scene">${n}</visual_scene></library_visual_scenes>`,i+='<scene><instance_visual_scene url="#Scene"/></scene>',i+="</COLLADA>";const a={data:this.format(i),textures:this.textures};return"function"==typeof t&&requestAnimationFrame((()=>t(a))),a}format(e){var t,r;const n=/^<\//,i=/(\?>$)|(\/>$)/,a=/<[^>]+>[^<]*<\/[^<]+>/,s=(e,t)=>t>0?e+s(e,t-1):"";let o=0;return null!=(r=null==(t=e.match(/(<[^>]+>[^<]+<\/[^<]+>)|(<[^>]+>)/g))?void 0:t.map((e=>{a.test(e)||i.test(e)||!n.test(e)||o--;const t=`${s(" ",o)}${e}`;return a.test(e)||i.test(e)||n.test(e)||o++,t})).join("\n"))?r:""}base64ToBuffer(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0,i=r.length;n<i;n++)r[n]=t.charCodeAt(n);return r}imageToData(e,t){var r;this.canvas=this.canvas||document.createElement("canvas"),this.ctx=this.ctx||this.canvas.getContext("2d"),this.canvas.width=e.width instanceof SVGAnimatedLength?0:e.width,this.canvas.height=e.height instanceof SVGAnimatedLength?0:e.height,null==(r=this.ctx)||r.drawImage(e,0,0);const n=this.canvas.toDataURL(`image/${t}`,1).replace(/^data:image\/(png|jpg);base64,/,"");return this.base64ToBuffer(n)}attrBufferToArray(e){if(e instanceof n.InterleavedBufferAttribute&&e.isInterleavedBufferAttribute){const t=new(0,e.array.constructor)(e.count*e.itemSize),r=e.itemSize;for(let n=0,i=e.count;n<i;n++)for(let a=0;a<r;a++)t[n*r+a]=e[this.getFuncs[a]](n);return t}return e.array}subArray(e,t,r){if(Array.isArray(e))return e.slice(t,t+r);return new(0,e.constructor)(e.buffer,t*e.BYTES_PER_ELEMENT,r)}getAttribute(e,t,r,n){const i=this.attrBufferToArray(e);return Array.isArray(i)?`${`<source id="${t}"><float_array id="${t}-array" count="${i.length}">`+i.join(" ")}</float_array><technique_common><accessor source="#${t}-array" count="${Math.floor(i.length/e.itemSize)}" stride="${e.itemSize}">${r.map((e=>`<param name="${e}" type="${n}" />`)).join("")}</accessor></technique_common></source>`:""}getTransform(e){return e.updateMatrix(),this.transMat=this.transMat||new n.Matrix4,this.transMat.copy(e.matrix),this.transMat.transpose(),`<matrix>${this.transMat.toArray().join(" ")}</matrix>`}processGeometry(e){let t=this.geometryInfo.get(e);if(!t){const r=e;if(!r.isBufferGeometry)throw new Error("THREE.ColladaExporter: Geometry is not of type THREE.BufferGeometry.");const n=`Mesh${this.libraryGeometries.length+1}`,i=r.index?r.index.count*r.index.itemSize:r.attributes.position.count,a=null!=r.groups&&0!==r.groups.length?r.groups:[{start:0,count:i,materialIndex:0}];let s=`<geometry id="${n}"${e.name?` name="${e.name}"`:""}><mesh>`;const o=`${n}-position`,l=`${n}-vertices`;s+=this.getAttribute(r.attributes.position,o,["X","Y","Z"],"float"),s+=`<vertices id="${l}"><input semantic="POSITION" source="#${o}" /></vertices>`;let c=`<input semantic="VERTEX" source="#${l}" offset="0" />`;if("normal"in r.attributes){const e=`${n}-normal`;s+=this.getAttribute(r.attributes.normal,e,["X","Y","Z"],"float"),c+=`<input semantic="NORMAL" source="#${e}" offset="0" />`}if("uv"in r.attributes){const e=`${n}-texcoord`;s+=this.getAttribute(r.attributes.uv,e,["S","T"],"float"),c+=`<input semantic="TEXCOORD" source="#${e}" offset="0" set="0" />`}if("uv2"in r.attributes){const e=`${n}-texcoord2`;s+=this.getAttribute(r.attributes.uv2,e,["S","T"],"float"),c+=`<input semantic="TEXCOORD" source="#${e}" offset="0" set="1" />`}if("color"in r.attributes){const e=`${n}-color`;s+=this.getAttribute(r.attributes.color,e,["X","Y","Z"],"uint8"),c+=`<input semantic="COLOR" source="#${e}" offset="0" />`}let u=null;if(r.index)u=this.attrBufferToArray(r.index);else{u=new Array(i);for(let e=0,t=u.length;e<t&&Array.isArray(u);e++)u[e]=e}for(let e=0,t=a.length;e<t;e++){const t=a[e],r=this.subArray(u,t.start,t.count),n=r.length/3;s+=`<triangles material="MESH_MATERIAL_${t.materialIndex}" count="${n}">`,s+=c,s+=`<p>${r.join(" ")}</p>`,s+="</triangles>"}s+="</mesh></geometry>",this.libraryGeometries.push(s),t={meshid:n,bufferGeometry:r},this.geometryInfo.set(e,t)}return t}processTexture(e){let t=this.imageMap.get(e);if(null==t){t=`image-${this.libraryImages.length+1}`;const r="png",n=e.name||t;let i=`<image id="${t}" name="${n}">`;"1.5.0"===this.options.version?i+=`<init_from><ref>${this.options.textureDirectory}${n}.${r}</ref></init_from>`:i+=`<init_from>${this.options.textureDirectory}${n}.${r}</init_from>`,i+="</image>",this.libraryImages.push(i),this.imageMap.set(e,t),this.textures.push({directory:this.options.textureDirectory,name:n,ext:r,data:this.imageToData(e.image,r),original:e})}return t}processMaterial(e){let t=this.materialMap.get(e);if(null==t){t=`Mat${this.libraryEffects.length+1}`;let r="phong";if(e instanceof n.MeshLambertMaterial?r="lambert":e instanceof n.MeshBasicMaterial&&(r="constant",null!==e.map&&console.warn("ColladaExporter: Texture maps not supported with MeshBasicMaterial.")),e instanceof n.MeshPhongMaterial){const i=e.emissive?e.emissive:new n.Color(0,0,0),a=e.color?e.color:new n.Color(0,0,0),s=e.specular?e.specular:new n.Color(1,1,1),o=e.shininess||0,l=e.reflectivity||0;let c="";e.transparent&&(c+=`<transparent>${e.map?'<texture texture="diffuse-sampler"></texture>':"<float>1</float>"}</transparent>`,e.opacity<1&&(c+=`<transparency><float>${e.opacity}</float></transparency>`));const u=`<technique sid="common"><${r}><emission>${e.emissiveMap?'<texture texture="emissive-sampler" texcoord="TEXCOORD" />':`<color sid="emission">${i.r} ${i.g} ${i.b} 1</color>`}</emission>${"constant"!==r?`<diffuse>${e.map?'<texture texture="diffuse-sampler" texcoord="TEXCOORD" />':`<color sid="diffuse">${a.r} ${a.g} ${a.b} 1</color>`}</diffuse>`:""}${"constant"!==r?`<bump>${e.normalMap?'<texture texture="bump-sampler" texcoord="TEXCOORD" />':""}</bump>`:""}${"phong"===r?`<specular><color sid="specular">${s.r} ${s.g} ${s.b} 1</color></specular><shininess>${e.specularMap?'<texture texture="specular-sampler" texcoord="TEXCOORD" />':`<float sid="shininess">${o}</float>`}</shininess>`:""}<reflective><color>${a.r} ${a.g} ${a.b} 1</color></reflective><reflectivity><float>${l}</float></reflectivity>${c}</${r}></technique>`,h=`<effect id="${t}-effect"><profile_COMMON>${e.map?`<newparam sid="diffuse-surface"><surface type="2D"><init_from>${this.processTexture(e.map)}</init_from></surface></newparam><newparam sid="diffuse-sampler"><sampler2D><source>diffuse-surface</source></sampler2D></newparam>`:""}${e.specularMap?`<newparam sid="specular-surface"><surface type="2D"><init_from>${this.processTexture(e.specularMap)}</init_from></surface></newparam><newparam sid="specular-sampler"><sampler2D><source>specular-surface</source></sampler2D></newparam>`:""}${e.emissiveMap?`<newparam sid="emissive-surface"><surface type="2D"><init_from>${this.processTexture(e.emissiveMap)}</init_from></surface></newparam><newparam sid="emissive-sampler"><sampler2D><source>emissive-surface</source></sampler2D></newparam>`:""}${e.normalMap?`<newparam sid="bump-surface"><surface type="2D"><init_from>${this.processTexture(e.normalMap)}</init_from></surface></newparam><newparam sid="bump-sampler"><sampler2D><source>bump-surface</source></sampler2D></newparam>`:""}${u}${e.side===n.DoubleSide?'<extra><technique profile="THREEJS"><double_sided sid="double_sided" type="int">1</double_sided></technique></extra>':""}</profile_COMMON></effect>`,d=`<material id="${t}"${e.name?` name="${e.name}"`:""}><instance_effect url="#${t}-effect" /></material>`;this.libraryMaterials.push(d),this.libraryEffects.push(h),this.materialMap.set(e,t)}}return t}processObject(e){let t=`<node name="${e.name}">`;t+=this.getTransform(e);if((new n.Mesh).geometry,e instanceof n.Mesh&&e.isMesh&&null!==e.geometry){const r=this.processGeometry(e.geometry),i=r.meshid,a=r.bufferGeometry;let s,o=null;const l=e.material||new n.MeshBasicMaterial,c=Array.isArray(l)?l:[l];s=a.groups.length>c.length?new Array(a.groups.length):new Array(c.length),o=s.fill(null).map(((e,t)=>this.processMaterial(c[t%c.length]))),t+=`<instance_geometry url="#${i}">`+(null!=o?`<bind_material><technique_common>${o.map(((e,t)=>`<instance_material symbol="MESH_MATERIAL_${t}" target="#${e}" ><bind_vertex_input semantic="TEXCOORD" input_semantic="TEXCOORD" input_set="0" /></instance_material>`)).join("")}</technique_common></bind_material>`:"")+"</instance_geometry>"}return e.children.forEach((e=>t+=this.processObject(e))),t+="</node>",t}}var Wt=r(40431),Xt=Object.defineProperty,Yt=(e,t,r)=>(((e,t,r)=>{t in e?Xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class qt{constructor(){Yt(this,"u2sTable")}parseVpd(e,t,r){if(!0!==e.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function i(e){Math.abs(e)<1e-6&&(e=0);let t=e.toString();-1===t.indexOf(".")&&(t+="."),t+="000000";const r=t.indexOf(".");return t.slice(0,r)+"."+t.slice(r+1,r+7)}function a(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(i(e[r]));return t.join(",")}e.updateMatrixWorld(!0);const s=e.skeleton.bones,o=this.getBindBones(e),l=new n.Vector3,c=new n.Quaternion,u=new n.Quaternion,h=new n.Matrix4,d=[];d.push("Vocaloid Pose Data file"),d.push(""),d.push((""!==e.name?e.name.replace(/\s/g,"_"):"skin")+".osm;"),d.push(s.length+";"),d.push("");for(let n=0,f=s.length;n<f;n++){const e=s[n],t=o[n];!0===r&&void 0!==e.userData.ik&&void 0!==e.userData.ik.originalMatrix?h.fromArray(e.userData.ik.originalMatrix):h.copy(e.matrix),l.setFromMatrixPosition(h),c.setFromRotationMatrix(h);const i=l.sub(t.position).toArray(),p=u.copy(t.quaternion).conjugate().multiply(c).toArray();i[2]=-i[2],p[0]=-p[0],p[1]=-p[1],d.push("Bone"+n+"{"+e.name),d.push(" "+a(i)+";"),d.push(" "+a(p)+";"),d.push("}"),d.push("")}d.push("");const p=d.join("\n");return!0===t?this.unicodeToShiftjis(p):p}unicodeToShiftjis(e){if(void 0===this.u2sTable){const e=(new Wt.CharsetEncoder).s2uTable;this.u2sTable={};const t=Object.keys(e);for(let r=0,n=t.length;r<n;r++){let n=t[r];const i=e[n];this.u2sTable[i]=parseInt(n)}}const t=[];for(let r=0,n=e.length;r<n;r++){const n=e.charCodeAt(r),i=this.u2sTable[n];if(void 0===i)throw"cannot convert charcode 0x"+n.toString(16);i>255?(t.push(i>>8&255),t.push(255&i)):t.push(255&i)}return new Uint8Array(t)}getBindBones(e){const t=e.clone();return t.pose(),t.skeleton.bones}}var Kt=Object.defineProperty,Jt=(e,t,r)=>(((e,t,r)=>{t in e?Kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class Zt{constructor(){Jt(this,"binary"),Jt(this,"output"),Jt(this,"offset"),Jt(this,"objects"),Jt(this,"triangles"),Jt(this,"vA"),Jt(this,"vB"),Jt(this,"vC"),Jt(this,"cb"),Jt(this,"ab"),Jt(this,"normal"),this.binary=!1,this.output="",this.offset=80,this.objects=[],this.triangles=0,this.vA=new n.Vector3,this.vB=new n.Vector3,this.vC=new n.Vector3,this.cb=new n.Vector3,this.ab=new n.Vector3,this.normal=new n.Vector3}parse(e,t){if(this.binary=void 0!==t.binary&&t.binary,e.traverse((e=>{if(e instanceof n.Mesh&&e.isMesh){const t=e.geometry;if(!t.isBufferGeometry)throw new Error("THREE.STLExporter: Geometry is not of type THREE.BufferGeometry.");const r=t.index,n=t.getAttribute("position");this.triangles+=null!==r?r.count/3:n.count/3,this.objects.push({object3d:e,geometry:t})}})),this.binary){const e=2*this.triangles+3*this.triangles*4*4+80+4,t=new ArrayBuffer(e);this.output=new DataView(t),this.output.setUint32(this.offset,this.triangles,!0),this.offset+=4}else this.output="",this.output+="solid exported\n";for(let r=0,i=this.objects.length;r<i;r++){const e=this.objects[r].object3d,t=this.objects[r].geometry,i=t.index,a=t.getAttribute("position");if(e instanceof n.SkinnedMesh)if(null!==i)for(let r=0;r<i.count;r+=3){const t=i.getX(r+0),n=i.getX(r+1),s=i.getX(r+2);this.writeFace(t,n,s,a,e)}else for(let r=0;r<a.count;r+=3){const t=r+0,n=r+1,i=r+2;this.writeFace(t,n,i,a,e)}}return this.binary||(this.output+="endsolid exported\n"),this.output}writeFace(e,t,r,n,i){this.vA.fromBufferAttribute(n,e),this.vB.fromBufferAttribute(n,t),this.vC.fromBufferAttribute(n,r),i.isSkinnedMesh&&(i.boneTransform(e,this.vA),i.boneTransform(t,this.vB),i.boneTransform(r,this.vC)),this.vA.applyMatrix4(i.matrixWorld),this.vB.applyMatrix4(i.matrixWorld),this.vC.applyMatrix4(i.matrixWorld),this.writeNormal(this.vA,this.vB,this.vC),this.writeVertex(this.vA),this.writeVertex(this.vB),this.writeVertex(this.vC),this.binary&&this.output instanceof DataView?(this.output.setUint16(this.offset,0,!0),this.offset+=2):(this.output+="\t\tendloop\n",this.output+="\tendfacet\n")}writeNormal(e,t,r){this.cb.subVectors(r,t),this.ab.subVectors(e,t),this.cb.cross(this.ab).normalize(),this.normal.copy(this.cb).normalize(),this.binary&&this.output instanceof DataView?(this.output.setFloat32(this.offset,this.normal.x,!0),this.offset+=4,this.output.setFloat32(this.offset,this.normal.y,!0),this.offset+=4,this.output.setFloat32(this.offset,this.normal.z,!0),this.offset+=4):(this.output+=`\tfacet normal ${this.normal.x} ${this.normal.y} ${this.normal.z}\n`,this.output+="\t\touter loop\n")}writeVertex(e){this.binary&&this.output instanceof DataView?(this.output.setFloat32(this.offset,e.x,!0),this.offset+=4,this.output.setFloat32(this.offset,e.y,!0),this.offset+=4,this.output.setFloat32(this.offset,e.z,!0),this.offset+=4):this.output+="\t\t\tvertex vertex.x vertex.y vertex.z\n"}}var $t=Object.defineProperty,er=(e,t,r)=>(((e,t,r)=>{t in e?$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class tr{constructor(){er(this,"output"),er(this,"indexVertex"),er(this,"indexVertexUvs"),er(this,"indexNormals"),er(this,"vertex"),er(this,"color"),er(this,"normal"),er(this,"uv"),er(this,"face"),this.output="",this.indexVertex=0,this.indexVertexUvs=0,this.indexNormals=0,this.vertex=new n.Vector3,this.color=new n.Color,this.normal=new n.Vector3,this.uv=new n.Vector2,this.face=[]}parse(e){return e.traverse((e=>{e instanceof n.Mesh&&e.isMesh&&this.parseMesh(e),e instanceof n.Line&&e.isLine&&this.parseLine(e),e instanceof n.Points&&e.isPoints&&this.parsePoints(e)})),this.output}parseMesh(e){let t=0,r=0,i=0;const a=e.geometry,s=new n.Matrix3;if(!a.isBufferGeometry)throw new Error("THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry.");const o=a.getAttribute("position"),l=a.getAttribute("normal"),c=a.getAttribute("uv"),u=a.getIndex();if(this.output+=`o ${e.name}\n`,e.material&&!Array.isArray(e.material)&&e.material.name&&(this.output+=`usemtl ${e.material.name}\n`),void 0!==o)for(let n=0,h=o.count;n<h;n++,t++)this.vertex.x=o.getX(n),this.vertex.y=o.getY(n),this.vertex.z=o.getZ(n),this.vertex.applyMatrix4(e.matrixWorld),this.output+=`v ${this.vertex.x} ${this.vertex.y} ${this.vertex.z}\n`;if(void 0!==c)for(let n=0,h=c.count;n<h;n++,i++)this.uv.x=c.getX(n),this.uv.y=c.getY(n),this.output+=`vt ${this.uv.x} ${this.uv.y}\n`;if(void 0!==l){s.getNormalMatrix(e.matrixWorld);for(let e=0,t=l.count;e<t;e++,r++)this.normal.x=l.getX(e),this.normal.y=l.getY(e),this.normal.z=l.getZ(e),this.normal.applyMatrix3(s).normalize(),this.output+=`vn ${this.normal.x} ${this.normal.y} ${this.normal.z}\n`}if(null!==u)for(let n=0,h=u.count;n<h;n+=3){for(let e=0;e<3;e++){const t=u.getX(n+e)+1;this.face[e]=this.indexVertex+t+(l||c?`/${c?this.indexVertexUvs+t:""}${l?`/${this.indexNormals+t}`:""}`:"")}this.output+=`f ${this.face.join(" ")}\n`}else for(let n=0,h=o.count;n<h;n+=3){for(let e=0;e<3;e++){const t=n+e+1;this.face[e]=this.indexVertex+t+(l||c?`/${c?this.indexVertexUvs+t:""}${l?`/${this.indexNormals+t}`:""}`:"")}this.output+=`f ${this.face.join(" ")}\n`}this.indexVertex+=t,this.indexVertexUvs+=i,this.indexNormals+=r}parseLine(e){let t=0;const r=e.geometry,n=e.type;if(r.isBufferGeometry)throw new Error("THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry.");const i=r.getAttribute("position");if(this.output+=`o ${e.name}\n`,void 0!==i)for(let a=0,s=i.count;a<s;a++,t++)this.vertex.x=i.getX(a),this.vertex.y=i.getY(a),this.vertex.z=i.getZ(a),this.vertex.applyMatrix4(e.matrixWorld),this.output+=`v ${this.vertex.x} ${this.vertex.y} ${this.vertex.z}\n`;if("Line"===n){this.output+="l ";for(let e=1,t=i.count;e<=t;e++)this.output+=`${this.indexVertex+e} `;this.output+="\n"}if("LineSegments"===n)for(let a=1,s=a+1,o=i.count;a<o;a+=2,s=a+1)this.output+=`l ${this.indexVertex+a} ${this.indexVertex+s}\n`;this.indexVertex+=t}parsePoints(e){let t=0;const r=e.geometry;if(!r.isBufferGeometry)throw new Error("THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry.");const i=r.getAttribute("position"),a=r.getAttribute("color");if(this.output+=`o ${e.name}\n`,void 0!==i)for(let s=0,o=i.count;s<o;s++,t++)this.vertex.fromBufferAttribute(i,s),this.vertex.applyMatrix4(e.matrixWorld),this.output+=`v ${this.vertex.x} ${this.vertex.y} ${this.vertex.z}`,void 0!==a&&a instanceof n.BufferAttribute&&(this.color.fromBufferAttribute(a,s),this.output+=` ${this.color.r} ${this.color.g} ${this.color.b}`),this.output+="\n";this.output+="p ";for(let n=1,s=i.count;n<=s;n++)this.output+=`${this.indexVertex+n} `;this.output+="\n",this.indexVertex+=t}}function rr(){const e=new n.Scene,t=new n.BoxGeometry;t.deleteAttribute("uv");const r=new n.MeshStandardMaterial({side:n.BackSide}),i=new n.MeshStandardMaterial,a=new n.PointLight(16777215,5,28,2);a.position.set(.418,16.199,.3),e.add(a);const s=new n.Mesh(t,r);s.position.set(-.757,13.219,.717),s.scale.set(31.713,28.305,28.591),e.add(s);const o=new n.Mesh(t,i);o.position.set(-10.906,2.009,1.846),o.rotation.set(0,-.195,0),o.scale.set(2.328,7.905,4.651),e.add(o);const l=new n.Mesh(t,i);l.position.set(-5.607,-.754,-.758),l.rotation.set(0,.994,0),l.scale.set(1.97,1.534,3.955),e.add(l);const c=new n.Mesh(t,i);c.position.set(6.167,.857,7.803),c.rotation.set(0,.561,0),c.scale.set(3.927,6.285,3.687),e.add(c);const u=new n.Mesh(t,i);u.position.set(-2.017,.018,6.124),u.rotation.set(0,.333,0),u.scale.set(2.002,4.566,2.064),e.add(u);const h=new n.Mesh(t,i);h.position.set(2.291,-.756,-2.621),h.rotation.set(0,-.286,0),h.scale.set(1.546,1.552,1.496),e.add(h);const d=new n.Mesh(t,i);d.position.set(-2.193,-.369,-5.547),d.rotation.set(0,.516,0),d.scale.set(3.875,3.487,2.986),e.add(d);const p=new n.Mesh(t,y(50));p.position.set(-16.116,14.37,8.208),p.scale.set(.1,2.428,2.739),e.add(p);const f=new n.Mesh(t,y(50));f.position.set(-16.109,18.021,-8.207),f.scale.set(.1,2.425,2.751),e.add(f);const m=new n.Mesh(t,y(17));m.position.set(14.904,12.198,-1.832),m.scale.set(.15,4.265,6.331),e.add(m);const g=new n.Mesh(t,y(43));g.position.set(-.462,8.89,14.52),g.scale.set(4.38,5.441,.088),e.add(g);const v=new n.Mesh(t,y(20));v.position.set(3.235,11.486,-12.541),v.scale.set(2.5,2,.1),e.add(v);const A=new n.Mesh(t,y(100));function y(e){const t=new n.MeshBasicMaterial;return t.color.setScalar(e),t}return A.position.set(0,20,0),A.scale.set(1,.1,1),e.add(A),e}class nr{static CreateRotationAnimation(e,t="x"){const r=[0,e],i=".rotation["+t+"]",a=new n.NumberKeyframeTrack(i,r,[0,360]);return new n.AnimationClip(null,e,[a])}static CreateScaleAxisAnimation(e,t="x"){const r=[0,e],i=".scale["+t+"]",a=new n.NumberKeyframeTrack(i,r,[0,1]);return new n.AnimationClip(null,e,[a])}static CreateShakeAnimation(e,t){const r=[],i=[],a=new n.Vector3;for(let n=0;n<10*e;n++)r.push(n/10),a.set(2*Math.random()-1,2*Math.random()-1,2*Math.random()-1).multiply(t).toArray(i,i.length);const s=new n.VectorKeyframeTrack(".position",r,i);return new n.AnimationClip(null,e,[s])}static CreatePulsationAnimation(e,t){const r=[],i=[],a=new n.Vector3;for(let n=0;n<10*e;n++){r.push(n/10);const e=Math.random()*t;a.set(e,e,e).toArray(i,i.length)}const s=new n.VectorKeyframeTrack(".scale",r,i);return new n.AnimationClip(null,e,[s])}static CreateVisibilityAnimation(e){const t=[0,e/2,e],r=new n.BooleanKeyframeTrack(".visible",t,[!0,!1,!0]);return new n.AnimationClip(null,e,[r])}static CreateMaterialColorAnimation(e,t){const r=[],i=[],a=e/t.length;for(let n=0;n<t.length;n++){r.push(n*a);const e=t[n];i.push(e.r,e.g,e.b)}const s=new n.ColorKeyframeTrack(".material.color",r,i);return new n.AnimationClip(null,e,[s])}}const ir=new n.Quaternion,ar=new n.Vector3,sr=new n.Vector3,or=new n.Vector3,lr=new n.Vector3,cr=new n.Vector3,ur=new n.Quaternion,hr=new n.Vector3,dr=new n.Vector3,pr=new n.Vector3,fr=new n.Matrix4;class mr{constructor(e,t=[]){this.mesh=e,this.iks=t,this._valid()}update(){const e=this.iks;for(let t=0,r=e.length;t<r;t++)this.updateOne(e[t]);return this}updateOne(e){const t=this.mesh.skeleton.bones,r=Math,n=t[e.effector],i=t[e.target];ar.setFromMatrixPosition(i.matrixWorld);const a=e.links,s=void 0!==e.iteration?e.iteration:1;for(let o=0;o<s;o++){let i=!1;for(let s=0,o=a.length;s<o;s++){const o=t[a[s].index];if(!1===a[s].enabled)break;const l=a[s].limitation,c=a[s].rotationMin,u=a[s].rotationMax;o.matrixWorld.decompose(cr,ur,hr),ur.invert(),or.setFromMatrixPosition(n.matrixWorld),lr.subVectors(or,cr),lr.applyQuaternion(ur),lr.normalize(),sr.subVectors(ar,cr),sr.applyQuaternion(ur),sr.normalize();let h=sr.dot(lr);if(h>1?h=1:h<-1&&(h=-1),h=r.acos(h),!(h<1e-5)){if(void 0!==e.minAngle&&h<e.minAngle&&(h=e.minAngle),void 0!==e.maxAngle&&h>e.maxAngle&&(h=e.maxAngle),dr.crossVectors(lr,sr),dr.normalize(),ir.setFromAxisAngle(dr,h),o.quaternion.multiply(ir),void 0!==l){let e=o.quaternion.w;e>1&&(e=1);const t=r.sqrt(1-e*e);o.quaternion.set(l.x*t,l.y*t,l.z*t,e)}void 0!==c&&o.rotation.setFromVector3(pr.setFromEuler(o.rotation).max(c)),void 0!==u&&o.rotation.setFromVector3(pr.setFromEuler(o.rotation).min(u)),o.updateMatrixWorld(!0),i=!0}}if(!i)break}return this}createHelper(){return new Ar(this.mesh,this.iks)}_valid(){const e=this.iks,t=this.mesh.skeleton.bones;for(let r=0,n=e.length;r<n;r++){const n=e[r],i=t[n.effector],a=n.links;let s,o;s=i;for(let e=0,r=a.length;e<r;e++)o=t[a[e].index],s.parent!==o&&console.warn("THREE.CCDIKSolver: bone "+s.name+" is not the child of bone "+o.name),s=o}}}function gr(e,t){return pr.setFromMatrixPosition(e.matrixWorld).applyMatrix4(t)}function vr(e,t,r,n){const i=gr(r,n);e[3*t+0]=i.x,e[3*t+1]=i.y,e[3*t+2]=i.z}class Ar extends n.Object3D{constructor(e,t=[],r=.25){super(),this.root=e,this.iks=t,this.matrix.copy(e.matrixWorld),this.matrixAutoUpdate=!1,this.sphereGeometry=new n.SphereGeometry(r,16,8),this.targetSphereMaterial=new n.MeshBasicMaterial({color:new n.Color(16746632),depthTest:!1,depthWrite:!1,transparent:!0}),this.effectorSphereMaterial=new n.MeshBasicMaterial({color:new n.Color(8978312),depthTest:!1,depthWrite:!1,transparent:!0}),this.linkSphereMaterial=new n.MeshBasicMaterial({color:new n.Color(8947967),depthTest:!1,depthWrite:!1,transparent:!0}),this.lineMaterial=new n.LineBasicMaterial({color:new n.Color(16711680),depthTest:!1,depthWrite:!1,transparent:!0}),this._init()}updateMatrixWorld(e){const t=this.root;if(this.visible){let e=0;const r=this.iks,n=t.skeleton.bones;fr.copy(t.matrixWorld).invert();for(let t=0,i=r.length;t<i;t++){const i=r[t],a=n[i.target],s=n[i.effector],o=this.children[e++],l=this.children[e++];o.position.copy(gr(a,fr)),l.position.copy(gr(s,fr));for(let t=0,r=i.links.length;t<r;t++){const r=n[i.links[t].index];this.children[e++].position.copy(gr(r,fr))}const c=this.children[e++],u=c.geometry.attributes.position.array;vr(u,0,a,fr),vr(u,1,s,fr);for(let e=0,t=i.links.length;e<t;e++){vr(u,e+2,n[i.links[e].index],fr)}c.geometry.attributes.position.needsUpdate=!0}}this.matrix.copy(t.matrixWorld),super.updateMatrixWorld(e)}dispose(){this.sphereGeometry.dispose(),this.targetSphereMaterial.dispose(),this.effectorSphereMaterial.dispose(),this.linkSphereMaterial.dispose(),this.lineMaterial.dispose();const e=this.children;for(let t=0;t<e.length;t++){const r=e[t];r.isLine&&r.geometry.dispose()}}_init(){const e=this,t=this.iks;function r(t){return new n.Line(function(e){const t=new n.BufferGeometry,r=new Float32Array(3*(2+e.links.length));return t.setAttribute("position",new n.BufferAttribute(r,3)),t}(t),e.lineMaterial)}for(let i=0,a=t.length;i<a;i++){const a=t[i];this.add(new n.Mesh(e.sphereGeometry,e.targetSphereMaterial)),this.add(new n.Mesh(e.sphereGeometry,e.effectorSphereMaterial));for(let t=0,r=a.links.length;t<r;t++)this.add(new n.Mesh(e.sphereGeometry,e.linkSphereMaterial));this.add(r(a))}}}class yr{constructor(e,t,r=[],i={}){if("undefined"==typeof Ammo)throw new Error("THREE.MMDPhysics: Import ammo.js https://github.com/kripken/ammo.js");this.manager=new xr,this.mesh=e,this.unitStep=void 0!==i.unitStep?i.unitStep:1/65,this.maxStepNum=void 0!==i.maxStepNum?i.maxStepNum:3,this.gravity=new n.Vector3(0,-98,0),void 0!==i.gravity&&this.gravity.copy(i.gravity),this.world=void 0!==i.world?i.world:null,this.bodies=[],this.constraints=[],this._init(e,t,r)}update(e){const t=this.manager,r=this.mesh;let n=!1;const i=t.allocThreeVector3(),a=t.allocThreeQuaternion(),s=t.allocThreeVector3();let o;return r.matrixWorld.decompose(i,a,s),1===s.x&&1===s.y&&1===s.z||(n=!0),n&&(o=r.parent,null!==o&&(r.parent=null),s.copy(this.mesh.scale),r.scale.set(1,1,1),r.updateMatrixWorld(!0)),this._updateRigidBodies(),this._stepSimulation(e),this._updateBones(),n&&(null!==o&&(r.parent=o),r.scale.copy(s)),t.freeThreeVector3(s),t.freeThreeQuaternion(a),t.freeThreeVector3(i),this}reset(){for(let e=0,t=this.bodies.length;e<t;e++)this.bodies[e].reset();return this}warmup(e){for(let t=0;t<e;t++)this.update(1/60);return this}setGravity(e){return this.world.setGravity(new Ammo.btVector3(e.x,e.y,e.z)),this.gravity.copy(e),this}createHelper(){return new Tr(this.mesh,this)}_init(e,t,r){const n=this.manager,i=e.parent;null!==i&&(e.parent=null);const a=n.allocThreeVector3(),s=n.allocThreeQuaternion(),o=n.allocThreeVector3();a.copy(e.position),s.copy(e.quaternion),o.copy(e.scale),e.position.set(0,0,0),e.quaternion.set(0,0,0,1),e.scale.set(1,1,1),e.updateMatrixWorld(!0),null===this.world&&(this.world=this._createWorld(),this.setGravity(this.gravity)),this._initRigidBodies(t),this._initConstraints(r),null!==i&&(e.parent=i),e.position.copy(a),e.quaternion.copy(s),e.scale.copy(o),e.updateMatrixWorld(!0),this.reset(),n.freeThreeVector3(a),n.freeThreeQuaternion(s),n.freeThreeVector3(o)}_createWorld(){const e=new Ammo.btDefaultCollisionConfiguration,t=new Ammo.btCollisionDispatcher(e),r=new Ammo.btDbvtBroadphase,n=new Ammo.btSequentialImpulseConstraintSolver;return new Ammo.btDiscreteDynamicsWorld(t,r,n,e)}_initRigidBodies(e){for(let t=0,r=e.length;t<r;t++)this.bodies.push(new br(this.mesh,this.world,e[t],this.manager))}_initConstraints(e){for(let t=0,r=e.length;t<r;t++){const r=e[t],n=this.bodies[r.rigidBodyIndex1],i=this.bodies[r.rigidBodyIndex2];this.constraints.push(new wr(this.mesh,this.world,n,i,r,this.manager))}}_stepSimulation(e){const t=this.unitStep;let r=e,n=1+(e/t|0);r<t&&(r=t,n=1),n>this.maxStepNum&&(n=this.maxStepNum),this.world.stepSimulation(r,n,t)}_updateRigidBodies(){for(let e=0,t=this.bodies.length;e<t;e++)this.bodies[e].updateFromBone()}_updateBones(){for(let e=0,t=this.bodies.length;e<t;e++)this.bodies[e].updateBone()}}class xr{constructor(){this.threeVector3s=[],this.threeMatrix4s=[],this.threeQuaternions=[],this.threeEulers=[],this.transforms=[],this.quaternions=[],this.vector3s=[]}allocThreeVector3(){return this.threeVector3s.length>0?this.threeVector3s.pop():new n.Vector3}freeThreeVector3(e){this.threeVector3s.push(e)}allocThreeMatrix4(){return this.threeMatrix4s.length>0?this.threeMatrix4s.pop():new n.Matrix4}freeThreeMatrix4(e){this.threeMatrix4s.push(e)}allocThreeQuaternion(){return this.threeQuaternions.length>0?this.threeQuaternions.pop():new n.Quaternion}freeThreeQuaternion(e){this.threeQuaternions.push(e)}allocThreeEuler(){return this.threeEulers.length>0?this.threeEulers.pop():new n.Euler}freeThreeEuler(e){this.threeEulers.push(e)}allocTransform(){return this.transforms.length>0?this.transforms.pop():new Ammo.btTransform}freeTransform(e){this.transforms.push(e)}allocQuaternion(){return this.quaternions.length>0?this.quaternions.pop():new Ammo.btQuaternion}freeQuaternion(e){this.quaternions.push(e)}allocVector3(){return this.vector3s.length>0?this.vector3s.pop():new Ammo.btVector3}freeVector3(e){this.vector3s.push(e)}setIdentity(e){e.setIdentity()}getBasis(e){var t=this.allocQuaternion();return e.getBasis().getRotation(t),t}getBasisAsMatrix3(e){var t=this.getBasis(e),r=this.quaternionToMatrix3(t);return this.freeQuaternion(t),r}getOrigin(e){return e.getOrigin()}setOrigin(e,t){e.getOrigin().setValue(t.x(),t.y(),t.z())}copyOrigin(e,t){var r=t.getOrigin();this.setOrigin(e,r)}setBasis(e,t){e.setRotation(t)}setBasisFromMatrix3(e,t){var r=this.matrix3ToQuaternion(t);this.setBasis(e,r),this.freeQuaternion(r)}setOriginFromArray3(e,t){e.getOrigin().setValue(t[0],t[1],t[2])}setOriginFromThreeVector3(e,t){e.getOrigin().setValue(t.x,t.y,t.z)}setBasisFromArray3(e,t){var r=this.allocThreeQuaternion(),n=this.allocThreeEuler();n.set(t[0],t[1],t[2]),this.setBasisFromThreeQuaternion(e,r.setFromEuler(n)),this.freeThreeEuler(n),this.freeThreeQuaternion(r)}setBasisFromThreeQuaternion(e,t){var r=this.allocQuaternion();r.setX(t.x),r.setY(t.y),r.setZ(t.z),r.setW(t.w),this.setBasis(e,r),this.freeQuaternion(r)}multiplyTransforms(e,t){var r=this.allocTransform();this.setIdentity(r);var n=this.getBasisAsMatrix3(e),i=this.getBasisAsMatrix3(t),a=this.getOrigin(e),s=this.getOrigin(t),o=this.multiplyMatrix3ByVector3(n,s),l=this.addVector3(o,a);this.setOrigin(r,l);var c=this.multiplyMatrices3(n,i);return this.setBasisFromMatrix3(r,c),this.freeVector3(o),this.freeVector3(l),r}inverseTransform(e){var t=this.allocTransform(),r=this.getBasisAsMatrix3(e),n=this.getOrigin(e),i=this.transposeMatrix3(r),a=this.negativeVector3(n),s=this.multiplyMatrix3ByVector3(i,a);return this.setOrigin(t,s),this.setBasisFromMatrix3(t,i),this.freeVector3(a),this.freeVector3(s),t}multiplyMatrices3(e,t){var r=[],n=this.rowOfMatrix3(e,0),i=this.rowOfMatrix3(e,1),a=this.rowOfMatrix3(e,2),s=this.columnOfMatrix3(t,0),o=this.columnOfMatrix3(t,1),l=this.columnOfMatrix3(t,2);return r[0]=this.dotVectors3(n,s),r[1]=this.dotVectors3(n,o),r[2]=this.dotVectors3(n,l),r[3]=this.dotVectors3(i,s),r[4]=this.dotVectors3(i,o),r[5]=this.dotVectors3(i,l),r[6]=this.dotVectors3(a,s),r[7]=this.dotVectors3(a,o),r[8]=this.dotVectors3(a,l),this.freeVector3(n),this.freeVector3(i),this.freeVector3(a),this.freeVector3(s),this.freeVector3(o),this.freeVector3(l),r}addVector3(e,t){var r=this.allocVector3();return r.setValue(e.x()+t.x(),e.y()+t.y(),e.z()+t.z()),r}dotVectors3(e,t){return e.x()*t.x()+e.y()*t.y()+e.z()*t.z()}rowOfMatrix3(e,t){var r=this.allocVector3();return r.setValue(e[3*t+0],e[3*t+1],e[3*t+2]),r}columnOfMatrix3(e,t){var r=this.allocVector3();return r.setValue(e[t+0],e[t+3],e[t+6]),r}negativeVector3(e){var t=this.allocVector3();return t.setValue(-e.x(),-e.y(),-e.z()),t}multiplyMatrix3ByVector3(e,t){var r=this.allocVector3(),n=this.rowOfMatrix3(e,0),i=this.rowOfMatrix3(e,1),a=this.rowOfMatrix3(e,2),s=this.dotVectors3(n,t),o=this.dotVectors3(i,t),l=this.dotVectors3(a,t);return r.setValue(s,o,l),this.freeVector3(n),this.freeVector3(i),this.freeVector3(a),r}transposeMatrix3(e){var t=[];return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t}quaternionToMatrix3(e){var t=[],r=e.x(),n=e.y(),i=e.z(),a=e.w(),s=r*r,o=n*n,l=i*i,c=r*n,u=n*i,h=i*r,d=r*a,p=n*a,f=i*a;return t[0]=1-2*(o+l),t[1]=2*(c-f),t[2]=2*(h+p),t[3]=2*(c+f),t[4]=1-2*(l+s),t[5]=2*(u-d),t[6]=2*(h-p),t[7]=2*(u+d),t[8]=1-2*(s+o),t}matrix3ToQuaternion(e){var t,r,n,i,a,s=e[0]+e[4]+e[8];s>0?(a=.25*(t=2*Math.sqrt(s+1)),r=(e[7]-e[5])/t,n=(e[2]-e[6])/t,i=(e[3]-e[1])/t):e[0]>e[4]&&e[0]>e[8]?(t=2*Math.sqrt(1+e[0]-e[4]-e[8]),a=(e[7]-e[5])/t,r=.25*t,n=(e[1]+e[3])/t,i=(e[2]+e[6])/t):e[4]>e[8]?(t=2*Math.sqrt(1+e[4]-e[0]-e[8]),a=(e[2]-e[6])/t,r=(e[1]+e[3])/t,n=.25*t,i=(e[5]+e[7])/t):(t=2*Math.sqrt(1+e[8]-e[0]-e[4]),a=(e[3]-e[1])/t,r=(e[2]+e[6])/t,n=(e[5]+e[7])/t,i=.25*t);var o=this.allocQuaternion();return o.setX(r),o.setY(n),o.setZ(i),o.setW(a),o}}class br{constructor(e,t,r,n){this.mesh=e,this.world=t,this.params=r,this.manager=n,this.body=null,this.bone=null,this.boneOffsetForm=null,this.boneOffsetFormInverse=null,this._init()}reset(){return this._setTransformFromBone(),this}updateFromBone(){return-1!==this.params.boneIndex&&0===this.params.type&&this._setTransformFromBone(),this}updateBone(){return 0===this.params.type||-1===this.params.boneIndex||(this._updateBoneRotation(),1===this.params.type&&this._updateBonePosition(),this.bone.updateMatrixWorld(!0),2===this.params.type&&this._setPositionFromBone()),this}_init(){const e=this.manager,t=this.params,r=this.mesh.skeleton.bones,i=-1===t.boneIndex?new n.Bone:r[t.boneIndex],a=function(e){switch(e.shapeType){case 0:return new Ammo.btSphereShape(e.width);case 1:return new Ammo.btBoxShape(new Ammo.btVector3(e.width,e.height,e.depth));case 2:return new Ammo.btCapsuleShape(e.width,e.height);default:throw new Error("unknown shape type "+e.shapeType)}}(t),s=0===t.type?0:t.weight,o=e.allocVector3();o.setValue(0,0,0),0!==s&&a.calculateLocalInertia(s,o);const l=e.allocTransform();e.setIdentity(l),e.setOriginFromArray3(l,t.position),e.setBasisFromArray3(l,t.rotation);const c=e.allocThreeVector3(),u=e.allocTransform();e.setIdentity(u),e.setOriginFromThreeVector3(u,i.getWorldPosition(c));const h=e.multiplyTransforms(u,l),d=new Ammo.btDefaultMotionState(h),p=new Ammo.btRigidBodyConstructionInfo(s,d,a,o);p.set_m_friction(t.friction),p.set_m_restitution(t.restitution);const f=new Ammo.btRigidBody(p);0===t.type&&(f.setCollisionFlags(2|f.getCollisionFlags()),f.setActivationState(4)),f.setDamping(t.positionDamping,t.rotationDamping),f.setSleepingThresholds(0,0),this.world.addRigidBody(f,1<<t.groupIndex,t.groupTarget),this.body=f,this.bone=i,this.boneOffsetForm=l,this.boneOffsetFormInverse=e.inverseTransform(l),e.freeVector3(o),e.freeTransform(h),e.freeTransform(u),e.freeThreeVector3(c)}_getBoneTransform(){const e=this.manager,t=e.allocThreeVector3(),r=e.allocThreeQuaternion(),n=e.allocThreeVector3();this.bone.matrixWorld.decompose(t,r,n);const i=e.allocTransform();e.setOriginFromThreeVector3(i,t),e.setBasisFromThreeQuaternion(i,r);const a=e.multiplyTransforms(i,this.boneOffsetForm);return e.freeTransform(i),e.freeThreeVector3(n),e.freeThreeQuaternion(r),e.freeThreeVector3(t),a}_getWorldTransformForBone(){const e=this.manager,t=this.body.getCenterOfMassTransform();return e.multiplyTransforms(t,this.boneOffsetFormInverse)}_setTransformFromBone(){const e=this.manager,t=this._getBoneTransform();this.body.setCenterOfMassTransform(t),this.body.getMotionState().setWorldTransform(t),e.freeTransform(t)}_setPositionFromBone(){const e=this.manager,t=this._getBoneTransform(),r=e.allocTransform();this.body.getMotionState().getWorldTransform(r),e.copyOrigin(r,t),this.body.setCenterOfMassTransform(r),this.body.getMotionState().setWorldTransform(r),e.freeTransform(r),e.freeTransform(t)}_updateBoneRotation(){const e=this.manager,t=this._getWorldTransformForBone(),r=e.getBasis(t),n=e.allocThreeQuaternion(),i=e.allocThreeQuaternion(),a=e.allocThreeQuaternion();n.set(r.x(),r.y(),r.z(),r.w()),i.setFromRotationMatrix(this.bone.matrixWorld),i.conjugate(),i.multiply(n),a.setFromRotationMatrix(this.bone.matrix),this.bone.quaternion.copy(i.multiply(a).normalize()),e.freeThreeQuaternion(n),e.freeThreeQuaternion(i),e.freeThreeQuaternion(a),e.freeQuaternion(r),e.freeTransform(t)}_updateBonePosition(){const e=this.manager,t=this._getWorldTransformForBone(),r=e.allocThreeVector3(),n=e.getOrigin(t);r.set(n.x(),n.y(),n.z()),this.bone.parent&&this.bone.parent.worldToLocal(r),this.bone.position.copy(r),e.freeThreeVector3(r),e.freeTransform(t)}}class wr{constructor(e,t,r,n,i,a){this.mesh=e,this.world=t,this.bodyA=r,this.bodyB=n,this.params=i,this.manager=a,this.constraint=null,this._init()}_init(){const e=this.manager,t=this.params,r=this.bodyA,n=this.bodyB,i=e.allocTransform();e.setIdentity(i),e.setOriginFromArray3(i,t.position),e.setBasisFromArray3(i,t.rotation);const a=e.allocTransform(),s=e.allocTransform();r.body.getMotionState().getWorldTransform(a),n.body.getMotionState().getWorldTransform(s);const o=e.inverseTransform(a),l=e.inverseTransform(s),c=e.multiplyTransforms(o,i),u=e.multiplyTransforms(l,i),h=new Ammo.btGeneric6DofSpringConstraint(r.body,n.body,c,u,!0),d=e.allocVector3(),p=e.allocVector3(),f=e.allocVector3(),m=e.allocVector3();d.setValue(t.translationLimitation1[0],t.translationLimitation1[1],t.translationLimitation1[2]),p.setValue(t.translationLimitation2[0],t.translationLimitation2[1],t.translationLimitation2[2]),f.setValue(t.rotationLimitation1[0],t.rotationLimitation1[1],t.rotationLimitation1[2]),m.setValue(t.rotationLimitation2[0],t.rotationLimitation2[1],t.rotationLimitation2[2]),h.setLinearLowerLimit(d),h.setLinearUpperLimit(p),h.setAngularLowerLimit(f),h.setAngularUpperLimit(m);for(let g=0;g<3;g++)0!==t.springPosition[g]&&(h.enableSpring(g,!0),h.setStiffness(g,t.springPosition[g]));for(let g=0;g<3;g++)0!==t.springRotation[g]&&(h.enableSpring(g+3,!0),h.setStiffness(g+3,t.springRotation[g]));if(void 0!==h.setParam)for(let g=0;g<6;g++)h.setParam(2,.475,g);this.world.addConstraint(h,!0),this.constraint=h,e.freeTransform(i),e.freeTransform(a),e.freeTransform(s),e.freeTransform(o),e.freeTransform(l),e.freeTransform(c),e.freeTransform(u),e.freeVector3(d),e.freeVector3(p),e.freeVector3(f),e.freeVector3(m)}}const Er=new n.Vector3,Sr=new n.Quaternion,Mr=new n.Vector3,_r=new n.Matrix4;class Tr extends n.Object3D{constructor(e,t){super(),this.root=e,this.physics=t,this.matrix.copy(e.matrixWorld),this.matrixAutoUpdate=!1,this.materials=[],this.materials.push(new n.MeshBasicMaterial({color:new n.Color(16746632),wireframe:!0,depthTest:!1,depthWrite:!1,opacity:.25,transparent:!0})),this.materials.push(new n.MeshBasicMaterial({color:new n.Color(8978312),wireframe:!0,depthTest:!1,depthWrite:!1,opacity:.25,transparent:!0})),this.materials.push(new n.MeshBasicMaterial({color:new n.Color(8947967),wireframe:!0,depthTest:!1,depthWrite:!1,opacity:.25,transparent:!0})),this._init()}dispose(){const e=this.materials,t=this.children;for(let r=0;r<e.length;r++)e[r].dispose();for(let r=0;r<t.length;r++){const e=t[r];e.isMesh&&e.geometry.dispose()}}updateMatrixWorld(e){var t=this.root;if(this.visible){var r=this.physics.bodies;_r.copy(t.matrixWorld).decompose(Er,Sr,Mr).compose(Er,Sr,Mr.set(1,1,1)).invert();for(var n=0,i=r.length;n<i;n++){var a=r[n].body,s=this.children[n],o=a.getCenterOfMassTransform(),l=o.getOrigin(),c=o.getRotation();s.position.set(l.x(),l.y(),l.z()).applyMatrix4(_r),s.quaternion.setFromRotationMatrix(_r).multiply(Sr.set(c.x(),c.y(),c.z(),c.w()))}}this.matrix.copy(t.matrixWorld).decompose(Er,Sr,Mr).compose(Er,Sr,Mr.set(1,1,1)),super.updateMatrixWorld(e)}_init(){var e=this.physics.bodies;function t(e){switch(e.shapeType){case 0:return new n.SphereGeometry(e.width,16,8);case 1:return new n.BoxGeometry(2*e.width,2*e.height,2*e.depth,8,8,8);case 2:return new n.CapsuleGeometry(e.width,e.height,8,16);default:return null}}for(var r=0,i=e.length;r<i;r++){var a=e[r].params;this.add(new n.Mesh(t(a),this.materials[a.type]))}}}class Cr{constructor(e={}){this.meshes=[],this.camera=null,this.cameraTarget=new n.Object3D,this.cameraTarget.name="target",this.audio=null,this.audioManager=null,this.objects=new WeakMap,this.configuration={sync:void 0===e.sync||e.sync,afterglow:void 0!==e.afterglow?e.afterglow:0,resetPhysicsOnLoop:void 0===e.resetPhysicsOnLoop||e.resetPhysicsOnLoop,pmxAnimation:void 0!==e.pmxAnimation&&e.pmxAnimation},this.enabled={animation:!0,ik:!0,grant:!0,physics:!0,cameraAnimation:!0},this.onBeforePhysics=function(){},this.sharedPhysics=!1,this.masterPhysics=null}add(e,t={}){if(e.isSkinnedMesh)this._addMesh(e,t);else if(e.isCamera)this._setupCamera(e,t);else{if("Audio"!==e.type)throw new Error("THREE.MMDAnimationHelper.add: accepts only THREE.SkinnedMesh or THREE.Camera or THREE.Audio instance.");this._setupAudio(e,t)}return this.configuration.sync&&this._syncDuration(),this}remove(e){if(e.isSkinnedMesh)this._removeMesh(e);else if(e.isCamera)this._clearCamera(e);else{if("Audio"!==e.type)throw new Error("THREE.MMDAnimationHelper.remove: accepts only THREE.SkinnedMesh or THREE.Camera or THREE.Audio instance.");this._clearAudio(e)}return this.configuration.sync&&this._syncDuration(),this}update(e){null!==this.audioManager&&this.audioManager.control(e);for(let t=0;t<this.meshes.length;t++)this._animateMesh(this.meshes[t],e);return this.sharedPhysics&&this._updateSharedPhysics(e),null!==this.camera&&this._animateCamera(this.camera,e),this}pose(e,t,r={}){!1!==r.resetPose&&e.pose();const i=e.skeleton.bones,a=t.bones,s={};for(let n=0,c=i.length;n<c;n++)s[i[n].name]=n;const o=new n.Vector3,l=new n.Quaternion;for(let n=0,c=a.length;n<c;n++){const e=a[n],t=s[e.name];if(void 0===t)continue;const r=i[t];r.position.add(o.fromArray(e.translation)),r.quaternion.multiply(l.fromArray(e.quaternion))}if(e.updateMatrixWorld(!0),this.configuration.pmxAnimation&&e.geometry.userData.MMD&&"pmx"===e.geometry.userData.MMD.format){const t=this._sortBoneDataArray(e.geometry.userData.MMD.bones.slice()),n=!1!==r.ik?this._createCCDIKSolver(e):null,i=!1!==r.grant?this.createGrantSolver(e):null;this._animatePMXMesh(e,t,n,i)}else!1!==r.ik&&this._createCCDIKSolver(e).update(),!1!==r.grant&&this.createGrantSolver(e).update();return this}enable(e,t){if(void 0===this.enabled[e])throw new Error("THREE.MMDAnimationHelper.enable: unknown key "+e);if(this.enabled[e]=t,"physics"===e)for(let r=0,n=this.meshes.length;r<n;r++)this._optimizeIK(this.meshes[r],t);return this}createGrantSolver(e){return new Dr(e,e.geometry.userData.MMD.grants)}_addMesh(e,t){if(this.meshes.indexOf(e)>=0)throw new Error("THREE.MMDAnimationHelper._addMesh: SkinnedMesh '"+e.name+"' has already been added.");return this.meshes.push(e),this.objects.set(e,{looped:!1}),this._setupMeshAnimation(e,t.animation),!1!==t.physics&&this._setupMeshPhysics(e,t),this}_setupCamera(e,t){if(this.camera===e)throw new Error("THREE.MMDAnimationHelper._setupCamera: Camera '"+e.name+"' has already been set.");return this.camera&&this.clearCamera(this.camera),this.camera=e,e.add(this.cameraTarget),this.objects.set(e,{}),void 0!==t.animation&&this._setupCameraAnimation(e,t.animation),this}_setupAudio(e,t){if(this.audio===e)throw new Error("THREE.MMDAnimationHelper._setupAudio: Audio '"+e.name+"' has already been set.");return this.audio&&this.clearAudio(this.audio),this.audio=e,this.audioManager=new Fr(e,t),this.objects.set(this.audioManager,{duration:this.audioManager.duration}),this}_removeMesh(e){let t=!1,r=0;for(let n=0,i=this.meshes.length;n<i;n++)this.meshes[n]!==e?this.meshes[r++]=this.meshes[n]:(this.objects.delete(e),t=!0);if(!t)throw new Error("THREE.MMDAnimationHelper._removeMesh: SkinnedMesh '"+e.name+"' has not been added yet.");return this.meshes.length=r,this}_clearCamera(e){if(e!==this.camera)throw new Error("THREE.MMDAnimationHelper._clearCamera: Camera '"+e.name+"' has not been set yet.");return this.camera.remove(this.cameraTarget),this.objects.delete(this.camera),this.camera=null,this}_clearAudio(e){if(e!==this.audio)throw new Error("THREE.MMDAnimationHelper._clearAudio: Audio '"+e.name+"' has not been set yet.");return this.objects.delete(this.audioManager),this.audio=null,this.audioManager=null,this}_setupMeshAnimation(e,t){const r=this.objects.get(e);if(void 0!==t){const i=Array.isArray(t)?t:[t];r.mixer=new n.AnimationMixer(e);for(let e=0,t=i.length;e<t;e++)r.mixer.clipAction(i[e]).play();r.mixer.addEventListener("loop",(function(e){const t=e.action._clip.tracks;t.length>0&&".bones"!==t[0].name.slice(0,6)||(r.looped=!0)}))}return r.ikSolver=this._createCCDIKSolver(e),r.grantSolver=this.createGrantSolver(e),this}_setupCameraAnimation(e,t){const r=Array.isArray(t)?t:[t],i=this.objects.get(e);i.mixer=new n.AnimationMixer(e);for(let n=0,a=r.length;n<a;n++)i.mixer.clipAction(r[n]).play()}_setupMeshPhysics(e,t){const r=this.objects.get(e);if(void 0===t.world&&this.sharedPhysics){const e=this._getMasterPhysics();null!==e&&(world=e.world)}r.physics=this._createMMDPhysics(e,t),r.mixer&&!1!==t.animationWarmup&&(this._animateMesh(e,0),r.physics.reset()),r.physics.warmup(void 0!==t.warmup?t.warmup:60),this._optimizeIK(e,!0)}_animateMesh(e,t){const r=this.objects.get(e),n=r.mixer,i=r.ikSolver,a=r.grantSolver,s=r.physics,o=r.looped;n&&this.enabled.animation&&(this._restoreBones(e),n.update(t),this._saveBones(e),this.configuration.pmxAnimation&&e.geometry.userData.MMD&&"pmx"===e.geometry.userData.MMD.format?(r.sortedBonesData||(r.sortedBonesData=this._sortBoneDataArray(e.geometry.userData.MMD.bones.slice())),this._animatePMXMesh(e,r.sortedBonesData,i&&this.enabled.ik?i:null,a&&this.enabled.grant?a:null)):(i&&this.enabled.ik&&(e.updateMatrixWorld(!0),i.update()),a&&this.enabled.grant&&a.update())),!0===o&&this.enabled.physics&&(s&&this.configuration.resetPhysicsOnLoop&&s.reset(),r.looped=!1),s&&this.enabled.physics&&!this.sharedPhysics&&(this.onBeforePhysics(e),s.update(t))}_sortBoneDataArray(e){return e.sort((function(e,t){return e.transformationClass!==t.transformationClass?e.transformationClass-t.transformationClass:e.index-t.index}))}_animatePMXMesh(e,t,r,n){Br=0,Rr.clear();for(let i=0,a=t.length;i<a;i++)Pr(e,t[i].index,r,n);return e.updateMatrixWorld(!0),this}_animateCamera(e,t){const r=this.objects.get(e).mixer;r&&this.enabled.cameraAnimation&&(r.update(t),e.updateProjectionMatrix(),e.up.set(0,1,0),e.up.applyQuaternion(e.quaternion),e.lookAt(this.cameraTarget.position))}_optimizeIK(e,t){const r=e.geometry.userData.MMD.iks,n=e.geometry.userData.MMD.bones;for(let i=0,a=r.length;i<a;i++){const e=r[i].links;for(let r=0,i=e.length;r<i;r++){const i=e[r];i.enabled=!0!==t||!(n[i.index].rigidBodyType>0)}}}_createCCDIKSolver(e){if(void 0===mr)throw new Error("THREE.MMDAnimationHelper: Import CCDIKSolver.");return new mr(e,e.geometry.userData.MMD.iks)}_createMMDPhysics(e,t){if(void 0===yr)throw new Error("THREE.MMDPhysics: Import MMDPhysics.");return new yr(e,e.geometry.userData.MMD.rigidBodies,e.geometry.userData.MMD.constraints,t)}_syncDuration(){let e=0;const t=this.objects,r=this.meshes,n=this.camera,i=this.audioManager;for(let a=0,s=r.length;a<s;a++){const n=this.objects.get(r[a]).mixer;if(void 0!==n)for(let r=0;r<n._actions.length;r++){const i=n._actions[r]._clip;t.has(i)||t.set(i,{duration:i.duration}),e=Math.max(e,t.get(i).duration)}}if(null!==n){const r=this.objects.get(n).mixer;if(void 0!==r)for(let n=0,i=r._actions.length;n<i;n++){const i=r._actions[n]._clip;t.has(i)||t.set(i,{duration:i.duration}),e=Math.max(e,t.get(i).duration)}}null!==i&&(e=Math.max(e,t.get(i).duration)),e+=this.configuration.afterglow;for(let a=0,s=this.meshes.length;a<s;a++){const t=this.objects.get(this.meshes[a]).mixer;if(void 0!==t)for(let r=0,n=t._actions.length;r<n;r++)t._actions[r]._clip.duration=e}if(null!==n){const t=this.objects.get(n).mixer;if(void 0!==t)for(let r=0,n=t._actions.length;r<n;r++)t._actions[r]._clip.duration=e}null!==i&&(i.duration=e)}_updatePropertyMixersBuffer(e){const t=this.objects.get(e).mixer,r=t._bindings,n=t._accuIndex;for(let i=0,a=r.length;i<a;i++){const e=r[i],t=e.buffer,a=(n+1)*e.valueSize;e.binding.getValue(t,a)}}_saveBones(e){const t=this.objects.get(e),r=e.skeleton.bones;let n=t.backupBones;void 0===n&&(n=new Float32Array(7*r.length),t.backupBones=n);for(let i=0,a=r.length;i<a;i++){const e=r[i];e.position.toArray(n,7*i),e.quaternion.toArray(n,7*i+3)}}_restoreBones(e){const t=this.objects.get(e).backupBones;if(void 0===t)return;const r=e.skeleton.bones;for(let n=0,i=r.length;n<i;n++){const e=r[n];e.position.fromArray(t,7*n),e.quaternion.fromArray(t,7*n+3)}}_getMasterPhysics(){if(null!==this.masterPhysics)return this.masterPhysics;for(let e=0,t=this.meshes.length;e<t;e++){const t=this.meshes[e].physics;if(null!=t)return this.masterPhysics=t,this.masterPhysics}return null}_updateSharedPhysics(e){if(0===this.meshes.length||!this.enabled.physics||!this.sharedPhysics)return;const t=this._getMasterPhysics();if(null!==t){for(let e=0,t=this.meshes.length;e<t;e++){const t=this.meshes[e].physics;null!=t&&t.updateRigidBodies()}t.stepSimulation(e);for(let e=0,t=this.meshes.length;e<t;e++){const t=this.meshes[e].physics;null!=t&&t.updateBones()}}}}const Ir=[];let Br=0;const Rr=new Map;function Pr(e,t,r,i){const a=e.skeleton.bones,s=e.geometry.userData.MMD.bones[t],o=a[t];if(Rr.has(t))return;const l=(Br>=Ir.length&&Ir.push(new n.Quaternion),Ir[Br++]);if(Rr.set(t,l.copy(o.quaternion)),i&&s.grant&&!s.grant.isLocal&&s.grant.affectRotation){const t=s.grant.parentIndex,n=s.grant.ratio;Rr.has(t)||Pr(e,t,r,i),i.addGrantRotation(o,Rr.get(t),n)}if(r&&s.ik){e.updateMatrixWorld(!0),r.updateOne(s.ik);const t=s.ik.links;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(!1===r.enabled)continue;const n=r.index;Rr.has(n)&&Rr.set(n,Rr.get(n).copy(a[n].quaternion))}}l.copy(o.quaternion)}class Fr{constructor(e,t={}){this.audio=e,this.elapsedTime=0,this.currentTime=0,this.delayTime=void 0!==t.delayTime?t.delayTime:0,this.audioDuration=this.audio.buffer.duration,this.duration=this.audioDuration+this.delayTime}control(e){return this.elapsed+=e,this.currentTime+=e,this._shouldStopAudio()&&this.audio.stop(),this._shouldStartAudio()&&this.audio.play(),this}_shouldStartAudio(){if(this.audio.isPlaying)return!1;for(;this.currentTime>=this.duration;)this.currentTime-=this.duration;return!(this.currentTime<this.delayTime)&&!(this.currentTime-this.delayTime>this.audioDuration)}_shouldStopAudio(){return this.audio.isPlaying&&this.currentTime>=this.duration}}const Lr=new n.Quaternion;class Dr{constructor(e,t=[]){this.mesh=e,this.grants=t}update(){const e=this.grants;for(let t=0,r=e.length;t<r;t++)this.updateOne(e[t]);return this}updateOne(e){const t=this.mesh.skeleton.bones,r=t[e.index],n=t[e.parentIndex];return e.isLocal?(e.affectPosition,e.affectRotation):(e.affectPosition,e.affectRotation&&this.addGrantRotation(r,n.quaternion,e.ratio)),this}addGrantRotation(e,t,r){return Lr.set(0,0,0,1),Lr.slerp(t,r),e.quaternion.multiply(Lr),this}}var Ur=Object.defineProperty;const Nr=class extends n.Mesh{constructor(e,t={}){super(e),this.isReflector=!0,this.type="Reflector",this.camera=new n.PerspectiveCamera;const r=this,i=void 0!==t.color?new n.Color(t.color):new n.Color(8355711),a=t.textureWidth||512,s=t.textureHeight||512,o=t.clipBias||0,l=t.shader||Nr.ReflectorShader,c=void 0!==t.multisample?t.multisample:4,u=new n.Plane,h=new n.Vector3,d=new n.Vector3,p=new n.Vector3,f=new n.Matrix4,m=new n.Vector3(0,0,-1),g=new n.Vector4,v=new n.Vector3,A=new n.Vector3,y=new n.Vector4,x=new n.Matrix4,b=this.camera,w=new n.WebGLRenderTarget(a,s,{samples:c,type:n.HalfFloatType}),E=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(l.uniforms),fragmentShader:l.fragmentShader,vertexShader:l.vertexShader});E.uniforms.tDiffuse.value=w.texture,E.uniforms.color.value=i,E.uniforms.textureMatrix.value=x,this.material=E,this.onBeforeRender=function(e,t,i){if(d.setFromMatrixPosition(r.matrixWorld),p.setFromMatrixPosition(i.matrixWorld),f.extractRotation(r.matrixWorld),h.set(0,0,1),h.applyMatrix4(f),v.subVectors(d,p),v.dot(h)>0)return;v.reflect(h).negate(),v.add(d),f.extractRotation(i.matrixWorld),m.set(0,0,-1),m.applyMatrix4(f),m.add(p),A.subVectors(d,m),A.reflect(h).negate(),A.add(d),b.position.copy(v),b.up.set(0,1,0),b.up.applyMatrix4(f),b.up.reflect(h),b.lookAt(A),b.far=i.far,b.updateMatrixWorld(),b.projectionMatrix.copy(i.projectionMatrix),x.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),x.multiply(b.projectionMatrix),x.multiply(b.matrixWorldInverse),x.multiply(r.matrixWorld),u.setFromNormalAndCoplanarPoint(h,d),u.applyMatrix4(b.matrixWorldInverse),g.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const a=b.projectionMatrix;y.x=(Math.sign(g.x)+a.elements[8])/a.elements[0],y.y=(Math.sign(g.y)+a.elements[9])/a.elements[5],y.z=-1,y.w=(1+a.elements[10])/a.elements[14],g.multiplyScalar(2/g.dot(y)),a.elements[2]=g.x,a.elements[6]=g.y,a.elements[10]=g.z+1-o,a.elements[14]=g.w,r.visible=!1;const s=e.getRenderTarget(),l=e.xr.enabled,c=e.shadowMap.autoUpdate,E=e.toneMapping;let S=!1;S="outputColorSpace"in e?"srgb"===e.outputColorSpace:3001===e.outputEncoding,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,"outputColorSpace"in e?e.outputColorSpace="linear-srgb":e.outputEncoding=3e3,e.toneMapping=n.NoToneMapping,e.setRenderTarget(w),e.state.buffers.depth.setMask(!0),!1===e.autoClear&&e.clear(),e.render(t,b),e.xr.enabled=l,e.shadowMap.autoUpdate=c,e.toneMapping=E,"outputColorSpace"in e?e.outputColorSpace=S?"srgb":"srgb-linear":e.outputEncoding=S?3001:3e3,e.setRenderTarget(s);const M=i.viewport;void 0!==M&&e.state.viewport(M),r.visible=!0},this.getRenderTarget=function(){return w},this.dispose=function(){w.dispose(),r.material.dispose()}}};let kr=Nr;var Or;((e,t,r)=>{t in e?Ur(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(kr,"symbol"!=typeof(Or="ReflectorShader")?Or+"":Or,{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:"\n\t\tuniform mat4 textureMatrix;\n\t\tvarying vec4 vUv;\n\n\t\t#include <common>\n\t\t#include <logdepthbuf_pars_vertex>\n\n\t\tvoid main() {\n\n\t\t\tvUv = textureMatrix * vec4( position, 1.0 );\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t#include <logdepthbuf_vertex>\n\n\t\t}",fragmentShader:"\n\t\tuniform vec3 color;\n\t\tuniform sampler2D tDiffuse;\n\t\tvarying vec4 vUv;\n\n\t\t#include <logdepthbuf_pars_fragment>\n\n\t\tfloat blendOverlay( float base, float blend ) {\n\n\t\t\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );\n\n\t\t}\n\n\t\tvec3 blendOverlay( vec3 base, vec3 blend ) {\n\n\t\t\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include <logdepthbuf_fragment>\n\n\t\t\tvec4 base = texture2DProj( tDiffuse, vUv );\n\t\t\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\n\t\t}"});var Gr=Object.defineProperty;const zr=class extends n.Mesh{constructor(e,t={}){super(e),this.isRefractor=!0,this.type="Refractor",this.camera=new n.PerspectiveCamera;const r=this,i=void 0!==t.color?new n.Color(t.color):new n.Color(8355711),a=t.textureWidth||512,s=t.textureHeight||512,o=t.clipBias||0,l=t.shader||zr.RefractorShader,c=void 0!==t.multisample?t.multisample:4,u=this.camera;u.matrixAutoUpdate=!1,u.userData.refractor=!0;const h=new n.Plane,d=new n.Matrix4,p=new n.WebGLRenderTarget(a,s,{samples:c,type:n.HalfFloatType});this.material=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader,transparent:!0}),this.material.uniforms.color.value=i,this.material.uniforms.tDiffuse.value=p.texture,this.material.uniforms.textureMatrix.value=d;const f=function(){const e=new n.Vector3,t=new n.Vector3,i=new n.Matrix4,a=new n.Vector3,s=new n.Vector3;return function(n){return e.setFromMatrixPosition(r.matrixWorld),t.setFromMatrixPosition(n.matrixWorld),a.subVectors(e,t),i.extractRotation(r.matrixWorld),s.set(0,0,1),s.applyMatrix4(i),a.dot(s)<0}}(),m=function(){const e=new n.Vector3,t=new n.Vector3,i=new n.Quaternion,a=new n.Vector3;return function(){r.matrixWorld.decompose(t,i,a),e.set(0,0,1).applyQuaternion(i).normalize(),e.negate(),h.setFromNormalAndCoplanarPoint(e,t)}}(),g=function(){const e=new n.Plane,t=new n.Vector4,r=new n.Vector4;return function(n){u.matrixWorld.copy(n.matrixWorld),u.matrixWorldInverse.copy(u.matrixWorld).invert(),u.projectionMatrix.copy(n.projectionMatrix),u.far=n.far,e.copy(h),e.applyMatrix4(u.matrixWorldInverse),t.set(e.normal.x,e.normal.y,e.normal.z,e.constant);const i=u.projectionMatrix;r.x=(Math.sign(t.x)+i.elements[8])/i.elements[0],r.y=(Math.sign(t.y)+i.elements[9])/i.elements[5],r.z=-1,r.w=(1+i.elements[10])/i.elements[14],t.multiplyScalar(2/t.dot(r)),i.elements[2]=t.x,i.elements[6]=t.y,i.elements[10]=t.z+1-o,i.elements[14]=t.w}}();this.onBeforeRender=function(e,t,i){!0!==i.userData.refractor&&!0!=!f(i)&&(m(),function(e){d.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),d.multiply(e.projectionMatrix),d.multiply(e.matrixWorldInverse),d.multiply(r.matrixWorld)}(i),g(i),function(e,t,i){r.visible=!1;const a=e.getRenderTarget(),s=e.xr.enabled,o=e.shadowMap.autoUpdate,l=e.toneMapping;let c=!1;c="outputColorSpace"in e?"srgb"===e.outputColorSpace:3001===e.outputEncoding,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,"outputColorSpace"in e?e.outputColorSpace="linear-srgb":e.outputEncoding=3e3,e.toneMapping=n.NoToneMapping,e.setRenderTarget(p),!1===e.autoClear&&e.clear(),e.render(t,u),e.xr.enabled=s,e.shadowMap.autoUpdate=o,e.toneMapping=l,e.setRenderTarget(a),"outputColorSpace"in e?e.outputColorSpace=c?"srgb":"srgb-linear":e.outputEncoding=c?3001:3e3;const h=i.viewport;void 0!==h&&e.state.viewport(h),r.visible=!0}(e,t,i))},this.getRenderTarget=function(){return p},this.dispose=function(){p.dispose(),r.material.dispose()}}};let Vr=zr;((e,t,r)=>{((e,t,r)=>{t in e?Gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r)})(Vr,"RefractorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:"\n\n\t\tuniform mat4 textureMatrix;\n\n\t\tvarying vec4 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = textureMatrix * vec4( position, 1.0 );\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform vec3 color;\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec4 vUv;\n\n\t\tfloat blendOverlay( float base, float blend ) {\n\n\t\t\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );\n\n\t\t}\n\n\t\tvec3 blendOverlay( vec3 base, vec3 blend ) {\n\n\t\t\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvec4 base = texture2DProj( tDiffuse, vUv );\n\t\t\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\n\t\t}"});const Hr=new n.Matrix4;class Qr extends n.Mesh{constructor(e){const t=new n.MeshBasicMaterial({color:0,transparent:!0,opacity:.6,depthWrite:!1,stencilWrite:!0,stencilFunc:n.EqualStencilFunc,stencilRef:0,stencilZPass:n.IncrementStencilOp});super(e.geometry,t),this.isShadowMesh=!0,this.meshMatrix=e.matrixWorld,this.frustumCulled=!1,this.matrixAutoUpdate=!1}update(e,t){const r=e.normal.x*t.x+e.normal.y*t.y+e.normal.z*t.z+-e.constant*t.w,n=Hr.elements;n[0]=r-t.x*e.normal.x,n[4]=-t.x*e.normal.y,n[8]=-t.x*e.normal.z,n[12]=-t.x*-e.constant,n[1]=-t.y*e.normal.x,n[5]=r-t.y*e.normal.y,n[9]=-t.y*e.normal.z,n[13]=-t.y*-e.constant,n[2]=-t.z*e.normal.x,n[6]=-t.z*e.normal.y,n[10]=r-t.z*e.normal.z,n[14]=-t.z*-e.constant,n[3]=-t.w*e.normal.x,n[7]=-t.w*e.normal.y,n[11]=-t.w*e.normal.z,n[15]=r-t.w*-e.constant,this.matrix.multiplyMatrices(Hr,this.meshMatrix)}}var jr=Object.defineProperty,Wr=(e,t,r)=>(((e,t,r)=>{t in e?jr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const Xr=new n.BufferGeometry,Yr=class extends n.Mesh{constructor(){super(Yr.Geometry,new n.MeshBasicMaterial({opacity:0,transparent:!0})),this.isLensflare=!0,this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const e=new n.Vector3,t=new n.Vector3,r=new n.DataTexture(new Uint8Array(768),16,16,n.RGBAFormat);r.minFilter=n.NearestFilter,r.magFilter=n.NearestFilter,r.wrapS=n.ClampToEdgeWrapping,r.wrapT=n.ClampToEdgeWrapping;const i=new n.DataTexture(new Uint8Array(768),16,16,n.RGBAFormat);i.minFilter=n.NearestFilter,i.magFilter=n.NearestFilter,i.wrapS=n.ClampToEdgeWrapping,i.wrapT=n.ClampToEdgeWrapping;const a=Yr.Geometry,s=new n.RawShaderMaterial({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform vec3 screenPosition;\n\t\t\t\tuniform vec2 scale;\n\n\t\t\t\tattribute vec3 position;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 );\n\n\t\t\t\t}",fragmentShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 );\n\n\t\t\t\t}",depthTest:!0,depthWrite:!1,transparent:!1}),o=new n.RawShaderMaterial({uniforms:{map:{value:r},scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform vec3 screenPosition;\n\t\t\t\tuniform vec2 scale;\n\n\t\t\t\tattribute vec3 position;\n\t\t\t\tattribute vec2 uv;\n\n\t\t\t\tvarying vec2 vUV;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUV = uv;\n\n\t\t\t\t\tgl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 );\n\n\t\t\t\t}",fragmentShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform sampler2D map;\n\n\t\t\t\tvarying vec2 vUV;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = texture2D( map, vUV );\n\n\t\t\t\t}",depthTest:!1,depthWrite:!1,transparent:!1}),l=new n.Mesh(a,s),c=[],u=Kr.Shader,h=new n.RawShaderMaterial({uniforms:{map:{value:null},occlusionMap:{value:i},color:{value:new n.Color(16777215)},scale:{value:new n.Vector2},screenPosition:{value:new n.Vector3}},vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,blending:n.AdditiveBlending,transparent:!0,depthWrite:!1}),d=new n.Mesh(a,h);this.addElement=function(e){c.push(e)};const p=new n.Vector2,f=new n.Vector2,m=new n.Box2,g=new n.Vector4;this.onBeforeRender=function(n,u,v){n.getCurrentViewport(g);const A=g.w/g.z,y=g.z/2,x=g.w/2;let b=16/g.w;if(p.set(b*A,b),m.min.set(g.x,g.y),m.max.set(g.x+(g.z-16),g.y+(g.w-16)),t.setFromMatrixPosition(this.matrixWorld),t.applyMatrix4(v.matrixWorldInverse),!(t.z>0)&&(e.copy(t).applyMatrix4(v.projectionMatrix),f.x=g.x+e.x*y+y-8,f.y=g.y+e.y*x+x-8,m.containsPoint(f))){n.copyFramebufferToTexture(f,r);let t=s.uniforms;t.scale.value=p,t.screenPosition.value=e,n.renderBufferDirect(v,null,a,s,l,null),n.copyFramebufferToTexture(f,i),t=o.uniforms,t.scale.value=p,t.screenPosition.value=e,n.renderBufferDirect(v,null,a,o,l,null);const u=2*-e.x,m=2*-e.y;for(let r=0,i=c.length;r<i;r++){const t=c[r],i=h.uniforms;i.color.value.copy(t.color),i.map.value=t.texture,i.screenPosition.value.x=e.x+u*t.distance,i.screenPosition.value.y=e.y+m*t.distance,b=t.size/g.w;const s=g.w/g.z;i.scale.value.set(b*s,b),h.uniformsNeedUpdate=!0,n.renderBufferDirect(v,null,a,h,d,null)}}},this.dispose=function(){s.dispose(),o.dispose(),h.dispose(),r.dispose(),i.dispose();for(let e=0,t=c.length;e<t;e++)c[e].texture.dispose()}}};let qr=Yr;Wr(qr,"Geometry",Xr);class Kr{constructor(e,t=1,r=0,i=new n.Color(16777215)){this.texture=e,this.size=t,this.distance=r,this.color=i}}Wr(Kr,"Shader",{uniforms:{map:{value:null},occlusionMap:{value:null},color:{value:null},scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\tprecision highp float;\n\n\t\tuniform vec3 screenPosition;\n\t\tuniform vec2 scale;\n\n\t\tuniform sampler2D occlusionMap;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\n\t\tvarying vec2 vUV;\n\t\tvarying float vVisibility;\n\n\t\tvoid main() {\n\n\t\t\tvUV = uv;\n\n\t\t\tvec2 pos = position.xy;\n\n\t\t\tvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\n\n\t\t\tvVisibility = visibility.r / 9.0;\n\t\t\tvVisibility *= 1.0 - visibility.g / 9.0;\n\t\t\tvVisibility *= visibility.b / 9.0;\n\n\t\t\tgl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tprecision highp float;\n\n\t\tuniform sampler2D map;\n\t\tuniform vec3 color;\n\n\t\tvarying vec2 vUV;\n\t\tvarying float vVisibility;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texture = texture2D( map, vUV );\n\t\t\ttexture.a *= vVisibility;\n\t\t\tgl_FragColor = texture;\n\t\t\tgl_FragColor.rgb *= color;\n\n\t\t}"});class Jr extends n.Mesh{constructor(e,t={}){super(e),this.isWater=!0;const r=this,i=void 0!==t.textureWidth?t.textureWidth:512,a=void 0!==t.textureHeight?t.textureHeight:512,s=void 0!==t.clipBias?t.clipBias:0,o=void 0!==t.alpha?t.alpha:1,l=void 0!==t.time?t.time:0,c=void 0!==t.waterNormals?t.waterNormals:null,u=void 0!==t.sunDirection?t.sunDirection:new n.Vector3(.70707,.70707,0),h=new n.Color(void 0!==t.sunColor?t.sunColor:16777215),d=new n.Color(void 0!==t.waterColor?t.waterColor:8355711),p=void 0!==t.eye?t.eye:new n.Vector3(0,0,0),f=void 0!==t.distortionScale?t.distortionScale:20,m=void 0!==t.side?t.side:n.FrontSide,g=void 0!==t.fog&&t.fog,v=new n.Plane,A=new n.Vector3,y=new n.Vector3,x=new n.Vector3,b=new n.Matrix4,w=new n.Vector3(0,0,-1),E=new n.Vector4,S=new n.Vector3,M=new n.Vector3,_=new n.Vector4,T=new n.Matrix4,C=new n.PerspectiveCamera,I=new n.WebGLRenderTarget(i,a),B={uniforms:n.UniformsUtils.merge([n.UniformsLib.fog,n.UniformsLib.lights,{normalSampler:{value:null},mirrorSampler:{value:null},alpha:{value:1},time:{value:0},size:{value:1},distortionScale:{value:20},textureMatrix:{value:new n.Matrix4},sunColor:{value:new n.Color(8355711)},sunDirection:{value:new n.Vector3(.70707,.70707,0)},eye:{value:new n.Vector3},waterColor:{value:new n.Color(5592405)}}]),vertexShader:"\n\t\t\t\tuniform mat4 textureMatrix;\n\t\t\t\tuniform float time;\n\n\t\t\t\tvarying vec4 mirrorCoord;\n\t\t\t\tvarying vec4 worldPosition;\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <fog_pars_vertex>\n\t\t\t\t#include <shadowmap_pars_vertex>\n\t\t\t\t#include <logdepthbuf_pars_vertex>\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tmirrorCoord = modelMatrix * vec4( position, 1.0 );\n\t\t\t\t\tworldPosition = mirrorCoord.xyzw;\n\t\t\t\t\tmirrorCoord = textureMatrix * mirrorCoord;\n\t\t\t\t\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t\tgl_Position = projectionMatrix * mvPosition;\n\n\t\t\t\t#include <beginnormal_vertex>\n\t\t\t\t#include <defaultnormal_vertex>\n\t\t\t\t#include <logdepthbuf_vertex>\n\t\t\t\t#include <fog_vertex>\n\t\t\t\t#include <shadowmap_vertex>\n\t\t\t}",fragmentShader:"\n\t\t\t\tuniform sampler2D mirrorSampler;\n\t\t\t\tuniform float alpha;\n\t\t\t\tuniform float time;\n\t\t\t\tuniform float size;\n\t\t\t\tuniform float distortionScale;\n\t\t\t\tuniform sampler2D normalSampler;\n\t\t\t\tuniform vec3 sunColor;\n\t\t\t\tuniform vec3 sunDirection;\n\t\t\t\tuniform vec3 eye;\n\t\t\t\tuniform vec3 waterColor;\n\n\t\t\t\tvarying vec4 mirrorCoord;\n\t\t\t\tvarying vec4 worldPosition;\n\n\t\t\t\tvec4 getNoise( vec2 uv ) {\n\t\t\t\t\tvec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0);\n\t\t\t\t\tvec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 );\n\t\t\t\t\tvec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 );\n\t\t\t\t\tvec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 );\n\t\t\t\t\tvec4 noise = texture2D( normalSampler, uv0 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv1 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv2 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv3 );\n\t\t\t\t\treturn noise * 0.5 - 1.0;\n\t\t\t\t}\n\n\t\t\t\tvoid sunLight( const vec3 surfaceNormal, const vec3 eyeDirection, float shiny, float spec, float diffuse, inout vec3 diffuseColor, inout vec3 specularColor ) {\n\t\t\t\t\tvec3 reflection = normalize( reflect( -sunDirection, surfaceNormal ) );\n\t\t\t\t\tfloat direction = max( 0.0, dot( eyeDirection, reflection ) );\n\t\t\t\t\tspecularColor += pow( direction, shiny ) * sunColor * spec;\n\t\t\t\t\tdiffuseColor += max( dot( sunDirection, surfaceNormal ), 0.0 ) * sunColor * diffuse;\n\t\t\t\t}\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <packing>\n\t\t\t\t#include <bsdfs>\n\t\t\t\t#include <fog_pars_fragment>\n\t\t\t\t#include <logdepthbuf_pars_fragment>\n\t\t\t\t#include <lights_pars_begin>\n\t\t\t\t#include <shadowmap_pars_fragment>\n\t\t\t\t#include <shadowmask_pars_fragment>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#include <logdepthbuf_fragment>\n\t\t\t\t\tvec4 noise = getNoise( worldPosition.xz * size );\n\t\t\t\t\tvec3 surfaceNormal = normalize( noise.xzy * vec3( 1.5, 1.0, 1.5 ) );\n\n\t\t\t\t\tvec3 diffuseLight = vec3(0.0);\n\t\t\t\t\tvec3 specularLight = vec3(0.0);\n\n\t\t\t\t\tvec3 worldToEye = eye-worldPosition.xyz;\n\t\t\t\t\tvec3 eyeDirection = normalize( worldToEye );\n\t\t\t\t\tsunLight( surfaceNormal, eyeDirection, 100.0, 2.0, 0.5, diffuseLight, specularLight );\n\n\t\t\t\t\tfloat distance = length(worldToEye);\n\n\t\t\t\t\tvec2 distortion = surfaceNormal.xz * ( 0.001 + 1.0 / distance ) * distortionScale;\n\t\t\t\t\tvec3 reflectionSample = vec3( texture2D( mirrorSampler, mirrorCoord.xy / mirrorCoord.w + distortion ) );\n\n\t\t\t\t\tfloat theta = max( dot( eyeDirection, surfaceNormal ), 0.0 );\n\t\t\t\t\tfloat rf0 = 0.3;\n\t\t\t\t\tfloat reflectance = rf0 + ( 1.0 - rf0 ) * pow( ( 1.0 - theta ), 5.0 );\n\t\t\t\t\tvec3 scatter = max( 0.0, dot( surfaceNormal, eyeDirection ) ) * waterColor;\n\t\t\t\t\tvec3 albedo = mix( ( sunColor * diffuseLight * 0.3 + scatter ) * getShadowMask(), ( vec3( 0.1 ) + reflectionSample * 0.9 + reflectionSample * specularLight ), reflectance);\n\t\t\t\t\tvec3 outgoingLight = albedo;\n\t\t\t\t\tgl_FragColor = vec4( outgoingLight, alpha );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <encodings_fragment>\n\t\t\t\t\t#include <fog_fragment>\t\n\t\t\t\t}"},R=new n.ShaderMaterial({fragmentShader:B.fragmentShader,vertexShader:B.vertexShader,uniforms:n.UniformsUtils.clone(B.uniforms),lights:!0,side:m,fog:g});R.uniforms.mirrorSampler.value=I.texture,R.uniforms.textureMatrix.value=T,R.uniforms.alpha.value=o,R.uniforms.time.value=l,R.uniforms.normalSampler.value=c,R.uniforms.sunColor.value=h,R.uniforms.waterColor.value=d,R.uniforms.sunDirection.value=u,R.uniforms.distortionScale.value=f,R.uniforms.eye.value=p,r.material=R,r.onBeforeRender=function(e,t,n){if(y.setFromMatrixPosition(r.matrixWorld),x.setFromMatrixPosition(n.matrixWorld),b.extractRotation(r.matrixWorld),A.set(0,0,1),A.applyMatrix4(b),S.subVectors(y,x),S.dot(A)>0)return;S.reflect(A).negate(),S.add(y),b.extractRotation(n.matrixWorld),w.set(0,0,-1),w.applyMatrix4(b),w.add(x),M.subVectors(y,w),M.reflect(A).negate(),M.add(y),C.position.copy(S),C.up.set(0,1,0),C.up.applyMatrix4(b),C.up.reflect(A),C.lookAt(M),C.far=n.far,C.updateMatrixWorld(),C.projectionMatrix.copy(n.projectionMatrix),T.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),T.multiply(C.projectionMatrix),T.multiply(C.matrixWorldInverse),v.setFromNormalAndCoplanarPoint(A,y),v.applyMatrix4(C.matrixWorldInverse),E.set(v.normal.x,v.normal.y,v.normal.z,v.constant);const i=C.projectionMatrix;_.x=(Math.sign(E.x)+i.elements[8])/i.elements[0],_.y=(Math.sign(E.y)+i.elements[9])/i.elements[5],_.z=-1,_.w=(1+i.elements[10])/i.elements[14],E.multiplyScalar(2/E.dot(_)),i.elements[2]=E.x,i.elements[6]=E.y,i.elements[10]=E.z+1-s,i.elements[14]=E.w,p.setFromMatrixPosition(n.matrixWorld);const a=e.getRenderTarget(),o=e.xr.enabled,l=e.shadowMap.autoUpdate;r.visible=!1,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,e.setRenderTarget(I),e.state.buffers.depth.setMask(!0),!1===e.autoClear&&e.clear(),e.render(t,C),r.visible=!0,e.xr.enabled=o,e.shadowMap.autoUpdate=l,e.setRenderTarget(a);const c=n.viewport;void 0!==c&&e.state.viewport(c)}}}class Zr extends n.Mesh{constructor(e,t,r=!1,i=!1,a=1e4){const s=new n.BufferGeometry;super(s,t),this.isMarchingCubes=!0;const o=this,l=new Float32Array(36),c=new Float32Array(36),u=new Float32Array(36);function h(e,t,r){return e+(t-e)*r}function d(e,t,r,n,i,a,s,d,p,f){const m=(r-s)/(d-s),g=o.normal_cache;l[t+0]=n+m*o.delta,l[t+1]=i,l[t+2]=a,c[t+0]=h(g[e+0],g[e+3],m),c[t+1]=h(g[e+1],g[e+4],m),c[t+2]=h(g[e+2],g[e+5],m),u[t+0]=h(o.palette[3*p+0],o.palette[3*f+0],m),u[t+1]=h(o.palette[3*p+1],o.palette[3*f+1],m),u[t+2]=h(o.palette[3*p+2],o.palette[3*f+2],m)}function p(e,t,r,n,i,a,s,d,p,f){const m=(r-s)/(d-s),g=o.normal_cache;l[t+0]=n,l[t+1]=i+m*o.delta,l[t+2]=a;const v=e+3*o.yd;c[t+0]=h(g[e+0],g[v+0],m),c[t+1]=h(g[e+1],g[v+1],m),c[t+2]=h(g[e+2],g[v+2],m),u[t+0]=h(o.palette[3*p+0],o.palette[3*f+0],m),u[t+1]=h(o.palette[3*p+1],o.palette[3*f+1],m),u[t+2]=h(o.palette[3*p+2],o.palette[3*f+2],m)}function f(e,t,r,n,i,a,s,d,p,f){const m=(r-s)/(d-s),g=o.normal_cache;l[t+0]=n,l[t+1]=i,l[t+2]=a+m*o.delta;const v=e+3*o.zd;c[t+0]=h(g[e+0],g[v+0],m),c[t+1]=h(g[e+1],g[v+1],m),c[t+2]=h(g[e+2],g[v+2],m),u[t+0]=h(o.palette[3*p+0],o.palette[3*f+0],m),u[t+1]=h(o.palette[3*p+1],o.palette[3*f+1],m),u[t+2]=h(o.palette[3*p+2],o.palette[3*f+2],m)}function m(e){const t=3*e;0===o.normal_cache[t]&&(o.normal_cache[t+0]=o.field[e-1]-o.field[e+1],o.normal_cache[t+1]=o.field[e-o.yd]-o.field[e+o.yd],o.normal_cache[t+2]=o.field[e-o.zd]-o.field[e+o.zd])}function g(e,t,r,n,i){const a=n+1,s=n+o.yd,h=n+o.zd,g=a+o.yd,A=a+o.zd,y=n+o.yd+o.zd,x=a+o.yd+o.zd;let b=0;const w=o.field[n],E=o.field[a],S=o.field[s],M=o.field[g],_=o.field[h],T=o.field[A],C=o.field[y],I=o.field[x];w<i&&(b|=1),E<i&&(b|=2),S<i&&(b|=8),M<i&&(b|=4),_<i&&(b|=16),T<i&&(b|=32),C<i&&(b|=128),I<i&&(b|=64);const B=$r[b];if(0===B)return 0;const R=o.delta,P=e+R,F=t+R,L=r+R;1&B&&(m(n),m(a),d(3*n,0,i,e,t,r,w,E,n,a)),2&B&&(m(a),m(g),p(3*a,3,i,P,t,r,E,M,a,g)),4&B&&(m(s),m(g),d(3*s,6,i,e,F,r,S,M,s,g)),8&B&&(m(n),m(s),p(3*n,9,i,e,t,r,w,S,n,s)),16&B&&(m(h),m(A),d(3*h,12,i,e,t,L,_,T,h,A)),32&B&&(m(A),m(x),p(3*A,15,i,P,t,L,T,I,A,x)),64&B&&(m(y),m(x),d(3*y,18,i,e,F,L,C,I,y,x)),128&B&&(m(h),m(y),p(3*h,21,i,e,t,L,_,C,h,y)),256&B&&(m(n),m(h),f(3*n,24,i,e,t,r,w,_,n,h)),512&B&&(m(a),m(A),f(3*a,27,i,P,t,r,E,T,a,A)),1024&B&&(m(g),m(x),f(3*g,30,i,P,F,r,M,I,g,x)),2048&B&&(m(s),m(y),f(3*s,33,i,e,F,r,S,C,s,y)),b<<=4;let D,U,N,k=0,O=0;for(;-1!=en[b+O];)D=b+O,U=D+1,N=D+2,v(l,c,u,3*en[D],3*en[U],3*en[N]),O+=3,k++;return k}function v(e,t,r,n,i,a){const s=3*o.count;if(o.positionArray[s+0]=e[n],o.positionArray[s+1]=e[n+1],o.positionArray[s+2]=e[n+2],o.positionArray[s+3]=e[i],o.positionArray[s+4]=e[i+1],o.positionArray[s+5]=e[i+2],o.positionArray[s+6]=e[a],o.positionArray[s+7]=e[a+1],o.positionArray[s+8]=e[a+2],!0===o.material.flatShading){const e=(t[n+0]+t[i+0]+t[a+0])/3,r=(t[n+1]+t[i+1]+t[a+1])/3,l=(t[n+2]+t[i+2]+t[a+2])/3;o.normalArray[s+0]=e,o.normalArray[s+1]=r,o.normalArray[s+2]=l,o.normalArray[s+3]=e,o.normalArray[s+4]=r,o.normalArray[s+5]=l,o.normalArray[s+6]=e,o.normalArray[s+7]=r,o.normalArray[s+8]=l}else o.normalArray[s+0]=t[n+0],o.normalArray[s+1]=t[n+1],o.normalArray[s+2]=t[n+2],o.normalArray[s+3]=t[i+0],o.normalArray[s+4]=t[i+1],o.normalArray[s+5]=t[i+2],o.normalArray[s+6]=t[a+0],o.normalArray[s+7]=t[a+1],o.normalArray[s+8]=t[a+2];if(o.enableUvs){const t=2*o.count;o.uvArray[t+0]=e[n+0],o.uvArray[t+1]=e[n+2],o.uvArray[t+2]=e[i+0],o.uvArray[t+3]=e[i+2],o.uvArray[t+4]=e[a+0],o.uvArray[t+5]=e[a+2]}o.enableColors&&(o.colorArray[s+0]=r[n+0],o.colorArray[s+1]=r[n+1],o.colorArray[s+2]=r[n+2],o.colorArray[s+3]=r[i+0],o.colorArray[s+4]=r[i+1],o.colorArray[s+5]=r[i+2],o.colorArray[s+6]=r[a+0],o.colorArray[s+7]=r[a+1],o.colorArray[s+8]=r[a+2]),o.count+=3}this.enableUvs=r,this.enableColors=i,this.init=function(e){this.resolution=e,this.isolation=80,this.size=e,this.size2=this.size*this.size,this.size3=this.size2*this.size,this.halfsize=this.size/2,this.delta=2/this.size,this.yd=this.size,this.zd=this.size2,this.field=new Float32Array(this.size3),this.normal_cache=new Float32Array(3*this.size3),this.palette=new Float32Array(3*this.size3),this.count=0;const t=3*a;this.positionArray=new Float32Array(3*t);const r=new n.BufferAttribute(this.positionArray,3);r.setUsage(n.DynamicDrawUsage),s.setAttribute("position",r),this.normalArray=new Float32Array(3*t);const i=new n.BufferAttribute(this.normalArray,3);if(i.setUsage(n.DynamicDrawUsage),s.setAttribute("normal",i),this.enableUvs){this.uvArray=new Float32Array(2*t);const e=new n.BufferAttribute(this.uvArray,2);e.setUsage(n.DynamicDrawUsage),s.setAttribute("uv",e)}if(this.enableColors){this.colorArray=new Float32Array(3*t);const e=new n.BufferAttribute(this.colorArray,3);e.setUsage(n.DynamicDrawUsage),s.setAttribute("color",e)}s.boundingSphere=new n.Sphere(new n.Vector3,1)},this.addBall=function(e,t,r,i,a,s){const o=Math.sign(i);i=Math.abs(i);const l=!(null==s);let c=new n.Color(e,t,r);if(l)try{c=s instanceof n.Color?s:Array.isArray(s)?new n.Color(Math.min(Math.abs(s[0]),1),Math.min(Math.abs(s[1]),1),Math.min(Math.abs(s[2]),1)):new n.Color(s)}catch(R){c=new n.Color(e,t,r)}const u=this.size*Math.sqrt(i/a),h=r*this.size,d=t*this.size,p=e*this.size;let f=Math.floor(h-u);f<1&&(f=1);let m=Math.floor(h+u);m>this.size-1&&(m=this.size-1);let g=Math.floor(d-u);g<1&&(g=1);let v=Math.floor(d+u);v>this.size-1&&(v=this.size-1);let A=Math.floor(p-u);A<1&&(A=1);let y,x,b,w,E,S,M,_,T,C,I,B=Math.floor(p+u);for(B>this.size-1&&(B=this.size-1),b=f;b<m;b++)for(E=this.size2*b,_=b/this.size-r,T=_*_,x=g;x<v;x++)for(w=E+this.size*x,M=x/this.size-t,C=M*M,y=A;y<B;y++)if(S=y/this.size-e,I=i/(1e-6+S*S+C+T)-a,I>0){this.field[w+y]+=I*o;const e=Math.sqrt((y-p)*(y-p)+(x-d)*(x-d)+(b-h)*(b-h))/u,t=1-e*e*e*(e*(6*e-15)+10);this.palette[3*(w+y)+0]+=c.r*t,this.palette[3*(w+y)+1]+=c.g*t,this.palette[3*(w+y)+2]+=c.b*t}},this.addPlaneX=function(e,t){const r=this.size,n=this.yd,i=this.zd,a=this.field;let s,o,l,c,u,h,d,p=r*Math.sqrt(e/t);for(p>r&&(p=r),s=0;s<p;s++)if(h=s/r,c=h*h,u=e/(1e-4+c)-t,u>0)for(o=0;o<r;o++)for(d=s+o*n,l=0;l<r;l++)a[i*l+d]+=u},this.addPlaneY=function(e,t){const r=this.size,n=this.yd,i=this.zd,a=this.field;let s,o,l,c,u,h,d,p,f=r*Math.sqrt(e/t);for(f>r&&(f=r),o=0;o<f;o++)if(h=o/r,c=h*h,u=e/(1e-4+c)-t,u>0)for(d=o*n,s=0;s<r;s++)for(p=d+s,l=0;l<r;l++)a[i*l+p]+=u},this.addPlaneZ=function(e,t){const r=this.size,n=this.yd,i=this.zd,a=this.field;let s,o,l,c,u,h,d,p,f=r*Math.sqrt(e/t);for(f>r&&(f=r),l=0;l<f;l++)if(h=l/r,c=h*h,u=e/(1e-4+c)-t,u>0)for(d=i*l,o=0;o<r;o++)for(p=d+o*n,s=0;s<r;s++)a[p+s]+=u},this.setCell=function(e,t,r,n){const i=this.size2*r+this.size*t+e;this.field[i]=n},this.getCell=function(e,t,r){const n=this.size2*r+this.size*t+e;return this.field[n]},this.blur=function(e=1){const t=this.field,r=t.slice(),n=this.size,i=this.size2;for(let a=0;a<n;a++)for(let s=0;s<n;s++)for(let o=0;o<n;o++){const l=i*o+n*s+a;let c=r[l],u=1;for(let t=-1;t<=1;t+=2){const l=t+a;if(!(l<0||l>=n))for(let t=-1;t<=1;t+=2){const a=t+s;if(!(a<0||a>=n))for(let t=-1;t<=1;t+=2){const s=t+o;if(s<0||s>=n)continue;const h=r[i*s+n*a+l];u++,c+=e*(h-c)/u}}}t[l]=c}},this.reset=function(){for(let e=0;e<this.size3;e++)this.normal_cache[3*e]=0,this.field[e]=0,this.palette[3*e]=this.palette[3*e+1]=this.palette[3*e+2]=0},this.update=function(){this.count=0;const e=this.size-2;for(let t=1;t<e;t++){const r=this.size2*t,n=(t-this.halfsize)/this.halfsize;for(let t=1;t<e;t++){const i=r+this.size*t,a=(t-this.halfsize)/this.halfsize;for(let t=1;t<e;t++){g((t-this.halfsize)/this.halfsize,a,n,i+t,this.isolation)}}}this.geometry.setDrawRange(0,this.count),s.getAttribute("position").needsUpdate=!0,s.getAttribute("normal").needsUpdate=!0,this.enableUvs&&(s.getAttribute("uv").needsUpdate=!0),this.enableColors&&(s.getAttribute("color").needsUpdate=!0),this.count/3>a&&console.warn("THREE.MarchingCubes: Geometry buffers too small for rendering. Please create an instance with a higher poly count.")},this.init(e)}}const $r=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]),en=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,8,3,9,8,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,2,10,0,2,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,8,3,2,10,8,10,9,8,-1,-1,-1,-1,-1,-1,-1,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,11,2,8,11,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,2,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,11,2,1,9,11,9,8,11,-1,-1,-1,-1,-1,-1,-1,3,10,1,11,10,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,10,1,0,8,10,8,11,10,-1,-1,-1,-1,-1,-1,-1,3,9,0,3,11,9,11,10,9,-1,-1,-1,-1,-1,-1,-1,9,8,10,10,8,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,3,0,7,3,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,1,9,4,7,1,7,3,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,4,7,3,0,4,1,2,10,-1,-1,-1,-1,-1,-1,-1,9,2,10,9,0,2,8,4,7,-1,-1,-1,-1,-1,-1,-1,2,10,9,2,9,7,2,7,3,7,9,4,-1,-1,-1,-1,8,4,7,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,4,7,11,2,4,2,0,4,-1,-1,-1,-1,-1,-1,-1,9,0,1,8,4,7,2,3,11,-1,-1,-1,-1,-1,-1,-1,4,7,11,9,4,11,9,11,2,9,2,1,-1,-1,-1,-1,3,10,1,3,11,10,7,8,4,-1,-1,-1,-1,-1,-1,-1,1,11,10,1,4,11,1,0,4,7,11,4,-1,-1,-1,-1,4,7,8,9,0,11,9,11,10,11,0,3,-1,-1,-1,-1,4,7,11,4,11,9,9,11,10,-1,-1,-1,-1,-1,-1,-1,9,5,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,5,4,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,5,4,1,5,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,5,4,8,3,5,3,1,5,-1,-1,-1,-1,-1,-1,-1,1,2,10,9,5,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,8,1,2,10,4,9,5,-1,-1,-1,-1,-1,-1,-1,5,2,10,5,4,2,4,0,2,-1,-1,-1,-1,-1,-1,-1,2,10,5,3,2,5,3,5,4,3,4,8,-1,-1,-1,-1,9,5,4,2,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,11,2,0,8,11,4,9,5,-1,-1,-1,-1,-1,-1,-1,0,5,4,0,1,5,2,3,11,-1,-1,-1,-1,-1,-1,-1,2,1,5,2,5,8,2,8,11,4,8,5,-1,-1,-1,-1,10,3,11,10,1,3,9,5,4,-1,-1,-1,-1,-1,-1,-1,4,9,5,0,8,1,8,10,1,8,11,10,-1,-1,-1,-1,5,4,0,5,0,11,5,11,10,11,0,3,-1,-1,-1,-1,5,4,8,5,8,10,10,8,11,-1,-1,-1,-1,-1,-1,-1,9,7,8,5,7,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,3,0,9,5,3,5,7,3,-1,-1,-1,-1,-1,-1,-1,0,7,8,0,1,7,1,5,7,-1,-1,-1,-1,-1,-1,-1,1,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,7,8,9,5,7,10,1,2,-1,-1,-1,-1,-1,-1,-1,10,1,2,9,5,0,5,3,0,5,7,3,-1,-1,-1,-1,8,0,2,8,2,5,8,5,7,10,5,2,-1,-1,-1,-1,2,10,5,2,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1,7,9,5,7,8,9,3,11,2,-1,-1,-1,-1,-1,-1,-1,9,5,7,9,7,2,9,2,0,2,7,11,-1,-1,-1,-1,2,3,11,0,1,8,1,7,8,1,5,7,-1,-1,-1,-1,11,2,1,11,1,7,7,1,5,-1,-1,-1,-1,-1,-1,-1,9,5,8,8,5,7,10,1,3,10,3,11,-1,-1,-1,-1,5,7,0,5,0,9,7,11,0,1,0,10,11,10,0,-1,11,10,0,11,0,3,10,5,0,8,0,7,5,7,0,-1,11,10,5,7,11,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,6,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,5,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,0,1,5,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,8,3,1,9,8,5,10,6,-1,-1,-1,-1,-1,-1,-1,1,6,5,2,6,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,6,5,1,2,6,3,0,8,-1,-1,-1,-1,-1,-1,-1,9,6,5,9,0,6,0,2,6,-1,-1,-1,-1,-1,-1,-1,5,9,8,5,8,2,5,2,6,3,2,8,-1,-1,-1,-1,2,3,11,10,6,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,0,8,11,2,0,10,6,5,-1,-1,-1,-1,-1,-1,-1,0,1,9,2,3,11,5,10,6,-1,-1,-1,-1,-1,-1,-1,5,10,6,1,9,2,9,11,2,9,8,11,-1,-1,-1,-1,6,3,11,6,5,3,5,1,3,-1,-1,-1,-1,-1,-1,-1,0,8,11,0,11,5,0,5,1,5,11,6,-1,-1,-1,-1,3,11,6,0,3,6,0,6,5,0,5,9,-1,-1,-1,-1,6,5,9,6,9,11,11,9,8,-1,-1,-1,-1,-1,-1,-1,5,10,6,4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,3,0,4,7,3,6,5,10,-1,-1,-1,-1,-1,-1,-1,1,9,0,5,10,6,8,4,7,-1,-1,-1,-1,-1,-1,-1,10,6,5,1,9,7,1,7,3,7,9,4,-1,-1,-1,-1,6,1,2,6,5,1,4,7,8,-1,-1,-1,-1,-1,-1,-1,1,2,5,5,2,6,3,0,4,3,4,7,-1,-1,-1,-1,8,4,7,9,0,5,0,6,5,0,2,6,-1,-1,-1,-1,7,3,9,7,9,4,3,2,9,5,9,6,2,6,9,-1,3,11,2,7,8,4,10,6,5,-1,-1,-1,-1,-1,-1,-1,5,10,6,4,7,2,4,2,0,2,7,11,-1,-1,-1,-1,0,1,9,4,7,8,2,3,11,5,10,6,-1,-1,-1,-1,9,2,1,9,11,2,9,4,11,7,11,4,5,10,6,-1,8,4,7,3,11,5,3,5,1,5,11,6,-1,-1,-1,-1,5,1,11,5,11,6,1,0,11,7,11,4,0,4,11,-1,0,5,9,0,6,5,0,3,6,11,6,3,8,4,7,-1,6,5,9,6,9,11,4,7,9,7,11,9,-1,-1,-1,-1,10,4,9,6,4,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,10,6,4,9,10,0,8,3,-1,-1,-1,-1,-1,-1,-1,10,0,1,10,6,0,6,4,0,-1,-1,-1,-1,-1,-1,-1,8,3,1,8,1,6,8,6,4,6,1,10,-1,-1,-1,-1,1,4,9,1,2,4,2,6,4,-1,-1,-1,-1,-1,-1,-1,3,0,8,1,2,9,2,4,9,2,6,4,-1,-1,-1,-1,0,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,3,2,8,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1,10,4,9,10,6,4,11,2,3,-1,-1,-1,-1,-1,-1,-1,0,8,2,2,8,11,4,9,10,4,10,6,-1,-1,-1,-1,3,11,2,0,1,6,0,6,4,6,1,10,-1,-1,-1,-1,6,4,1,6,1,10,4,8,1,2,1,11,8,11,1,-1,9,6,4,9,3,6,9,1,3,11,6,3,-1,-1,-1,-1,8,11,1,8,1,0,11,6,1,9,1,4,6,4,1,-1,3,11,6,3,6,0,0,6,4,-1,-1,-1,-1,-1,-1,-1,6,4,8,11,6,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,10,6,7,8,10,8,9,10,-1,-1,-1,-1,-1,-1,-1,0,7,3,0,10,7,0,9,10,6,7,10,-1,-1,-1,-1,10,6,7,1,10,7,1,7,8,1,8,0,-1,-1,-1,-1,10,6,7,10,7,1,1,7,3,-1,-1,-1,-1,-1,-1,-1,1,2,6,1,6,8,1,8,9,8,6,7,-1,-1,-1,-1,2,6,9,2,9,1,6,7,9,0,9,3,7,3,9,-1,7,8,0,7,0,6,6,0,2,-1,-1,-1,-1,-1,-1,-1,7,3,2,6,7,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,11,10,6,8,10,8,9,8,6,7,-1,-1,-1,-1,2,0,7,2,7,11,0,9,7,6,7,10,9,10,7,-1,1,8,0,1,7,8,1,10,7,6,7,10,2,3,11,-1,11,2,1,11,1,7,10,6,1,6,7,1,-1,-1,-1,-1,8,9,6,8,6,7,9,1,6,11,6,3,1,3,6,-1,0,9,1,11,6,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,8,0,7,0,6,3,11,0,11,6,0,-1,-1,-1,-1,7,11,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,8,11,7,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,11,7,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,1,9,8,3,1,11,7,6,-1,-1,-1,-1,-1,-1,-1,10,1,2,6,11,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,10,3,0,8,6,11,7,-1,-1,-1,-1,-1,-1,-1,2,9,0,2,10,9,6,11,7,-1,-1,-1,-1,-1,-1,-1,6,11,7,2,10,3,10,8,3,10,9,8,-1,-1,-1,-1,7,2,3,6,2,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,0,8,7,6,0,6,2,0,-1,-1,-1,-1,-1,-1,-1,2,7,6,2,3,7,0,1,9,-1,-1,-1,-1,-1,-1,-1,1,6,2,1,8,6,1,9,8,8,7,6,-1,-1,-1,-1,10,7,6,10,1,7,1,3,7,-1,-1,-1,-1,-1,-1,-1,10,7,6,1,7,10,1,8,7,1,0,8,-1,-1,-1,-1,0,3,7,0,7,10,0,10,9,6,10,7,-1,-1,-1,-1,7,6,10,7,10,8,8,10,9,-1,-1,-1,-1,-1,-1,-1,6,8,4,11,8,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,6,11,3,0,6,0,4,6,-1,-1,-1,-1,-1,-1,-1,8,6,11,8,4,6,9,0,1,-1,-1,-1,-1,-1,-1,-1,9,4,6,9,6,3,9,3,1,11,3,6,-1,-1,-1,-1,6,8,4,6,11,8,2,10,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,3,0,11,0,6,11,0,4,6,-1,-1,-1,-1,4,11,8,4,6,11,0,2,9,2,10,9,-1,-1,-1,-1,10,9,3,10,3,2,9,4,3,11,3,6,4,6,3,-1,8,2,3,8,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1,0,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,2,3,4,2,4,6,4,3,8,-1,-1,-1,-1,1,9,4,1,4,2,2,4,6,-1,-1,-1,-1,-1,-1,-1,8,1,3,8,6,1,8,4,6,6,10,1,-1,-1,-1,-1,10,1,0,10,0,6,6,0,4,-1,-1,-1,-1,-1,-1,-1,4,6,3,4,3,8,6,10,3,0,3,9,10,9,3,-1,10,9,4,6,10,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,5,7,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,5,11,7,6,-1,-1,-1,-1,-1,-1,-1,5,0,1,5,4,0,7,6,11,-1,-1,-1,-1,-1,-1,-1,11,7,6,8,3,4,3,5,4,3,1,5,-1,-1,-1,-1,9,5,4,10,1,2,7,6,11,-1,-1,-1,-1,-1,-1,-1,6,11,7,1,2,10,0,8,3,4,9,5,-1,-1,-1,-1,7,6,11,5,4,10,4,2,10,4,0,2,-1,-1,-1,-1,3,4,8,3,5,4,3,2,5,10,5,2,11,7,6,-1,7,2,3,7,6,2,5,4,9,-1,-1,-1,-1,-1,-1,-1,9,5,4,0,8,6,0,6,2,6,8,7,-1,-1,-1,-1,3,6,2,3,7,6,1,5,0,5,4,0,-1,-1,-1,-1,6,2,8,6,8,7,2,1,8,4,8,5,1,5,8,-1,9,5,4,10,1,6,1,7,6,1,3,7,-1,-1,-1,-1,1,6,10,1,7,6,1,0,7,8,7,0,9,5,4,-1,4,0,10,4,10,5,0,3,10,6,10,7,3,7,10,-1,7,6,10,7,10,8,5,4,10,4,8,10,-1,-1,-1,-1,6,9,5,6,11,9,11,8,9,-1,-1,-1,-1,-1,-1,-1,3,6,11,0,6,3,0,5,6,0,9,5,-1,-1,-1,-1,0,11,8,0,5,11,0,1,5,5,6,11,-1,-1,-1,-1,6,11,3,6,3,5,5,3,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,9,5,11,9,11,8,11,5,6,-1,-1,-1,-1,0,11,3,0,6,11,0,9,6,5,6,9,1,2,10,-1,11,8,5,11,5,6,8,0,5,10,5,2,0,2,5,-1,6,11,3,6,3,5,2,10,3,10,5,3,-1,-1,-1,-1,5,8,9,5,2,8,5,6,2,3,8,2,-1,-1,-1,-1,9,5,6,9,6,0,0,6,2,-1,-1,-1,-1,-1,-1,-1,1,5,8,1,8,0,5,6,8,3,8,2,6,2,8,-1,1,5,6,2,1,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,6,1,6,10,3,8,6,5,6,9,8,9,6,-1,10,1,0,10,0,6,9,5,0,5,6,0,-1,-1,-1,-1,0,3,8,5,6,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,5,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,5,10,7,5,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,5,10,11,7,5,8,3,0,-1,-1,-1,-1,-1,-1,-1,5,11,7,5,10,11,1,9,0,-1,-1,-1,-1,-1,-1,-1,10,7,5,10,11,7,9,8,1,8,3,1,-1,-1,-1,-1,11,1,2,11,7,1,7,5,1,-1,-1,-1,-1,-1,-1,-1,0,8,3,1,2,7,1,7,5,7,2,11,-1,-1,-1,-1,9,7,5,9,2,7,9,0,2,2,11,7,-1,-1,-1,-1,7,5,2,7,2,11,5,9,2,3,2,8,9,8,2,-1,2,5,10,2,3,5,3,7,5,-1,-1,-1,-1,-1,-1,-1,8,2,0,8,5,2,8,7,5,10,2,5,-1,-1,-1,-1,9,0,1,5,10,3,5,3,7,3,10,2,-1,-1,-1,-1,9,8,2,9,2,1,8,7,2,10,2,5,7,5,2,-1,1,3,5,3,7,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,7,0,7,1,1,7,5,-1,-1,-1,-1,-1,-1,-1,9,0,3,9,3,5,5,3,7,-1,-1,-1,-1,-1,-1,-1,9,8,7,5,9,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5,8,4,5,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,5,0,4,5,11,0,5,10,11,11,3,0,-1,-1,-1,-1,0,1,9,8,4,10,8,10,11,10,4,5,-1,-1,-1,-1,10,11,4,10,4,5,11,3,4,9,4,1,3,1,4,-1,2,5,1,2,8,5,2,11,8,4,5,8,-1,-1,-1,-1,0,4,11,0,11,3,4,5,11,2,11,1,5,1,11,-1,0,2,5,0,5,9,2,11,5,4,5,8,11,8,5,-1,9,4,5,2,11,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,5,10,3,5,2,3,4,5,3,8,4,-1,-1,-1,-1,5,10,2,5,2,4,4,2,0,-1,-1,-1,-1,-1,-1,-1,3,10,2,3,5,10,3,8,5,4,5,8,0,1,9,-1,5,10,2,5,2,4,1,9,2,9,4,2,-1,-1,-1,-1,8,4,5,8,5,3,3,5,1,-1,-1,-1,-1,-1,-1,-1,0,4,5,1,0,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,4,5,8,5,3,9,0,5,0,3,5,-1,-1,-1,-1,9,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,11,7,4,9,11,9,10,11,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,7,9,11,7,9,10,11,-1,-1,-1,-1,1,10,11,1,11,4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);var tn=r(13945),rn=Object.defineProperty,nn=(e,t,r)=>(((e,t,r)=>{t in e?rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const an=class extends n.BufferGeometry{constructor(e={}){super(),this.isLightningStrike=!0,this.type="LightningStrike",this.init(an.copyParameters(e,e)),this.createMesh()}static createRandomGenerator(){const e=2053,t=[];for(let n=0;n<e;n++)t.push(Math.random());const r={currentSeed:0,random:function(){const n=t[r.currentSeed];return r.currentSeed=(r.currentSeed+1)%e,n},getSeed:function(){return r.currentSeed/e},setSeed:function(t){r.currentSeed=Math.floor(t*e)%e}};return r}static copyParameters(e={},t={}){const r=function(r){return t===e?r:r.clone()};return e.sourceOffset=void 0!==t.sourceOffset?r(t.sourceOffset):new n.Vector3(0,100,0),e.destOffset=void 0!==t.destOffset?r(t.destOffset):new n.Vector3(0,0,0),e.timeScale=void 0!==t.timeScale?t.timeScale:1,e.roughness=void 0!==t.roughness?t.roughness:.9,e.straightness=void 0!==t.straightness?t.straightness:.7,e.up0=void 0!==t.up0?r(t.up0):new n.Vector3(0,0,1),e.up1=void 0!==t.up1?r(t.up1):new n.Vector3(0,0,1),e.radius0=void 0!==t.radius0?t.radius0:1,e.radius1=void 0!==t.radius1?t.radius1:1,e.radius0Factor=void 0!==t.radius0Factor?t.radius0Factor:.5,e.radius1Factor=void 0!==t.radius1Factor?t.radius1Factor:.2,e.minRadius=void 0!==t.minRadius?t.minRadius:.2,e.isEternal=void 0!==t.isEternal?t.isEternal:void 0===t.birthTime||void 0===t.deathTime,e.birthTime=t.birthTime,e.deathTime=t.deathTime,e.propagationTimeFactor=void 0!==t.propagationTimeFactor?t.propagationTimeFactor:.1,e.vanishingTimeFactor=void 0!==t.vanishingTimeFactor?t.vanishingTimeFactor:.9,e.subrayPeriod=void 0!==t.subrayPeriod?t.subrayPeriod:4,e.subrayDutyCycle=void 0!==t.subrayDutyCycle?t.subrayDutyCycle:.6,e.maxIterations=void 0!==t.maxIterations?t.maxIterations:9,e.isStatic=void 0!==t.isStatic&&t.isStatic,e.ramification=void 0!==t.ramification?t.ramification:5,e.maxSubrayRecursion=void 0!==t.maxSubrayRecursion?t.maxSubrayRecursion:3,e.recursionProbability=void 0!==t.recursionProbability?t.recursionProbability:.6,e.generateUVs=void 0!==t.generateUVs&&t.generateUVs,e.randomGenerator=t.randomGenerator,e.noiseSeed=t.noiseSeed,e.onDecideSubrayCreation=t.onDecideSubrayCreation,e.onSubrayCreation=t.onSubrayCreation,e}update(e){this.isStatic||(this.rayParameters.isEternal||this.rayParameters.birthTime<=e&&e<=this.rayParameters.deathTime?(this.updateMesh(e),e<this.subrays[0].endPropagationTime?this.state=an.RAY_PROPAGATING:e>this.subrays[0].beginVanishingTime?this.state=an.RAY_VANISHING:this.state=an.RAY_STEADY,this.visible=!0):(this.visible=!1,e<this.rayParameters.birthTime?this.state=an.RAY_UNBORN:this.state=an.RAY_EXTINGUISHED))}init(e){this.rayParameters=e,this.maxIterations=void 0!==e.maxIterations?Math.floor(e.maxIterations):9,e.maxIterations=this.maxIterations,this.isStatic=void 0!==e.isStatic&&e.isStatic,e.isStatic=this.isStatic,this.ramification=void 0!==e.ramification?Math.floor(e.ramification):5,e.ramification=this.ramification,this.maxSubrayRecursion=void 0!==e.maxSubrayRecursion?Math.floor(e.maxSubrayRecursion):3,e.maxSubrayRecursion=this.maxSubrayRecursion,this.recursionProbability=void 0!==e.recursionProbability?e.recursionProbability:.6,e.recursionProbability=this.recursionProbability,this.generateUVs=void 0!==e.generateUVs&&e.generateUVs,e.generateUVs=this.generateUVs,void 0!==e.randomGenerator?(this.randomGenerator=e.randomGenerator,this.seedGenerator=e.randomGenerator,void 0!==e.noiseSeed&&this.seedGenerator.setSeed(e.noiseSeed)):(this.randomGenerator=an.createRandomGenerator(),this.seedGenerator=Math),void 0!==e.onDecideSubrayCreation?this.onDecideSubrayCreation=e.onDecideSubrayCreation:(this.createDefaultSubrayCreationCallbacks(),void 0!==e.onSubrayCreation&&(this.onSubrayCreation=e.onSubrayCreation)),this.state=an.RAY_INITIALIZED,this.maxSubrays=Math.ceil(1+Math.pow(this.ramification,Math.max(0,this.maxSubrayRecursion-1))),e.maxSubrays=this.maxSubrays,this.maxRaySegments=2*(1<<this.maxIterations),this.subrays=[];for(let t=0;t<this.maxSubrays;t++)this.subrays.push(this.createSubray());this.raySegments=[];for(let t=0;t<this.maxRaySegments;t++)this.raySegments.push(this.createSegment());this.time=0,this.timeFraction=0,this.currentSegmentCallback=null,this.currentCreateTriangleVertices=this.generateUVs?this.createTriangleVerticesWithUVs:this.createTriangleVerticesWithoutUVs,this.numSubrays=0,this.currentSubray=null,this.currentSegmentIndex=0,this.isInitialSegment=!1,this.subrayProbability=0,this.currentVertex=0,this.currentIndex=0,this.currentCoordinate=0,this.currentUVCoordinate=0,this.vertices=null,this.uvs=null,this.indices=null,this.positionAttribute=null,this.uvsAttribute=null,this.simplexX=new tn.L(this.seedGenerator),this.simplexY=new tn.L(this.seedGenerator),this.simplexZ=new tn.L(this.seedGenerator),this.forwards=new n.Vector3,this.forwardsFill=new n.Vector3,this.side=new n.Vector3,this.down=new n.Vector3,this.middlePos=new n.Vector3,this.middleLinPos=new n.Vector3,this.newPos=new n.Vector3,this.vPos=new n.Vector3,this.cross1=new n.Vector3}createMesh(){const e=1<<this.maxIterations,t=3*(e+1)*this.maxSubrays,r=18*e*this.maxSubrays;this.vertices=new Float32Array(3*t),this.indices=new Uint32Array(r),this.generateUVs&&(this.uvs=new Float32Array(2*t)),this.fillMesh(0),this.setIndex(new n.Uint32BufferAttribute(this.indices,1)),this.positionAttribute=new n.Float32BufferAttribute(this.vertices,3),this.setAttribute("position",this.positionAttribute),this.generateUVs&&(this.uvsAttribute=new n.Float32BufferAttribute(new Float32Array(this.uvs),2),this.setAttribute("uv",this.uvsAttribute)),this.isStatic||(this.index.usage=n.DynamicDrawUsage,this.positionAttribute.usage=n.DynamicDrawUsage,this.generateUVs&&(this.uvsAttribute.usage=n.DynamicDrawUsage)),this.vertices=this.positionAttribute.array,this.indices=this.index.array,this.generateUVs&&(this.uvs=this.uvsAttribute.array)}updateMesh(e){this.fillMesh(e),this.drawRange.count=this.currentIndex,this.index.needsUpdate=!0,this.positionAttribute.needsUpdate=!0,this.generateUVs&&(this.uvsAttribute.needsUpdate=!0)}fillMesh(e){const t=this;this.currentVertex=0,this.currentIndex=0,this.currentCoordinate=0,this.currentUVCoordinate=0,this.fractalRay(e,(function(r){const n=t.currentSubray;e<n.birthTime||(this.rayParameters.isEternal&&0==t.currentSubray.recursion?(t.createPrism(r),t.onDecideSubrayCreation(r,t)):e<n.endPropagationTime?t.timeFraction>=r.fraction0*n.propagationTimeFactor&&(t.createPrism(r),t.onDecideSubrayCreation(r,t)):e<n.beginVanishingTime?(t.createPrism(r),t.onDecideSubrayCreation(r,t)):(t.timeFraction<=n.vanishingTimeFactor+r.fraction1*(1-n.vanishingTimeFactor)&&t.createPrism(r),t.onDecideSubrayCreation(r,t)))}))}addNewSubray(){return this.subrays[this.numSubrays++]}initSubray(e,t){e.pos0.copy(t.sourceOffset),e.pos1.copy(t.destOffset),e.up0.copy(t.up0),e.up1.copy(t.up1),e.radius0=t.radius0,e.radius1=t.radius1,e.birthTime=t.birthTime,e.deathTime=t.deathTime,e.timeScale=t.timeScale,e.roughness=t.roughness,e.straightness=t.straightness,e.propagationTimeFactor=t.propagationTimeFactor,e.vanishingTimeFactor=t.vanishingTimeFactor,e.maxIterations=this.maxIterations,e.seed=void 0!==t.noiseSeed?t.noiseSeed:0,e.recursion=0}fractalRay(e,t){this.time=e,this.currentSegmentCallback=t,this.numSubrays=0,this.initSubray(this.addNewSubray(),this.rayParameters);for(let r=0;r<this.numSubrays;r++){const t=this.subrays[r];this.currentSubray=t,this.randomGenerator.setSeed(t.seed),t.endPropagationTime=n.MathUtils.lerp(t.birthTime,t.deathTime,t.propagationTimeFactor),t.beginVanishingTime=n.MathUtils.lerp(t.deathTime,t.birthTime,1-t.vanishingTimeFactor);const i=this.randomGenerator.random;t.linPos0.set(i(),i(),i()).multiplyScalar(1e3),t.linPos1.set(i(),i(),i()).multiplyScalar(1e3),this.timeFraction=(e-t.birthTime)/(t.deathTime-t.birthTime),this.currentSegmentIndex=0,this.isInitialSegment=!0;const a=this.getNewSegment();a.iteration=0,a.pos0.copy(t.pos0),a.pos1.copy(t.pos1),a.linPos0.copy(t.linPos0),a.linPos1.copy(t.linPos1),a.up0.copy(t.up0),a.up1.copy(t.up1),a.radius0=t.radius0,a.radius1=t.radius1,a.fraction0=0,a.fraction1=1,a.positionVariationFactor=1-t.straightness,this.subrayProbability=this.ramification*Math.pow(this.recursionProbability,t.recursion)/(1<<t.maxIterations),this.fractalRayRecursive(a)}this.currentSegmentCallback=null,this.currentSubray=null}fractalRayRecursive(e){if(e.iteration>=this.currentSubray.maxIterations)return void this.currentSegmentCallback(e);this.forwards.subVectors(e.pos1,e.pos0);let t=this.forwards.length();t<1e-6&&(this.forwards.set(0,0,.01),t=this.forwards.length());const r=.5*(e.radius0+e.radius1),n=.5*(e.fraction0+e.fraction1),i=this.time*this.currentSubray.timeScale*Math.pow(2,e.iteration);this.middlePos.lerpVectors(e.pos0,e.pos1,.5),this.middleLinPos.lerpVectors(e.linPos0,e.linPos1,.5);const a=this.middleLinPos;this.newPos.set(this.simplexX.noise4d(a.x,a.y,a.z,i),this.simplexY.noise4d(a.x,a.y,a.z,i),this.simplexZ.noise4d(a.x,a.y,a.z,i)),this.newPos.multiplyScalar(e.positionVariationFactor*t),this.newPos.add(this.middlePos);const s=this.getNewSegment();s.pos0.copy(e.pos0),s.pos1.copy(this.newPos),s.linPos0.copy(e.linPos0),s.linPos1.copy(this.middleLinPos),s.up0.copy(e.up0),s.up1.copy(e.up1),s.radius0=e.radius0,s.radius1=r,s.fraction0=e.fraction0,s.fraction1=n,s.positionVariationFactor=e.positionVariationFactor*this.currentSubray.roughness,s.iteration=e.iteration+1;const o=this.getNewSegment();o.pos0.copy(this.newPos),o.pos1.copy(e.pos1),o.linPos0.copy(this.middleLinPos),o.linPos1.copy(e.linPos1),this.cross1.crossVectors(e.up0,this.forwards.normalize()),o.up0.crossVectors(this.forwards,this.cross1).normalize(),o.up1.copy(e.up1),o.radius0=r,o.radius1=e.radius1,o.fraction0=n,o.fraction1=e.fraction1,o.positionVariationFactor=e.positionVariationFactor*this.currentSubray.roughness,o.iteration=e.iteration+1,this.fractalRayRecursive(s),this.fractalRayRecursive(o)}createPrism(e){this.forwardsFill.subVectors(e.pos1,e.pos0).normalize(),this.isInitialSegment&&(this.currentCreateTriangleVertices(e.pos0,e.up0,this.forwardsFill,e.radius0,0),this.isInitialSegment=!1),this.currentCreateTriangleVertices(e.pos1,e.up0,this.forwardsFill,e.radius1,e.fraction1),this.createPrismFaces()}createTriangleVerticesWithoutUVs(e,t,r,n){this.side.crossVectors(t,r).multiplyScalar(n*an.COS30DEG),this.down.copy(t).multiplyScalar(-n*an.SIN30DEG);const i=this.vPos,a=this.vertices;i.copy(e).sub(this.side).add(this.down),a[this.currentCoordinate++]=i.x,a[this.currentCoordinate++]=i.y,a[this.currentCoordinate++]=i.z,i.copy(e).add(this.side).add(this.down),a[this.currentCoordinate++]=i.x,a[this.currentCoordinate++]=i.y,a[this.currentCoordinate++]=i.z,i.copy(t).multiplyScalar(n).add(e),a[this.currentCoordinate++]=i.x,a[this.currentCoordinate++]=i.y,a[this.currentCoordinate++]=i.z,this.currentVertex+=3}createTriangleVerticesWithUVs(e,t,r,n,i){this.side.crossVectors(t,r).multiplyScalar(n*an.COS30DEG),this.down.copy(t).multiplyScalar(-n*an.SIN30DEG);const a=this.vPos,s=this.vertices,o=this.uvs;a.copy(e).sub(this.side).add(this.down),s[this.currentCoordinate++]=a.x,s[this.currentCoordinate++]=a.y,s[this.currentCoordinate++]=a.z,o[this.currentUVCoordinate++]=i,o[this.currentUVCoordinate++]=0,a.copy(e).add(this.side).add(this.down),s[this.currentCoordinate++]=a.x,s[this.currentCoordinate++]=a.y,s[this.currentCoordinate++]=a.z,o[this.currentUVCoordinate++]=i,o[this.currentUVCoordinate++]=.5,a.copy(t).multiplyScalar(n).add(e),s[this.currentCoordinate++]=a.x,s[this.currentCoordinate++]=a.y,s[this.currentCoordinate++]=a.z,o[this.currentUVCoordinate++]=i,o[this.currentUVCoordinate++]=1,this.currentVertex+=3}createPrismFaces(e){const t=this.indices;e=this.currentVertex-6,t[this.currentIndex++]=e+1,t[this.currentIndex++]=e+2,t[this.currentIndex++]=e+5,t[this.currentIndex++]=e+1,t[this.currentIndex++]=e+5,t[this.currentIndex++]=e+4,t[this.currentIndex++]=e+0,t[this.currentIndex++]=e+1,t[this.currentIndex++]=e+4,t[this.currentIndex++]=e+0,t[this.currentIndex++]=e+4,t[this.currentIndex++]=e+3,t[this.currentIndex++]=e+2,t[this.currentIndex++]=e+0,t[this.currentIndex++]=e+3,t[this.currentIndex++]=e+2,t[this.currentIndex++]=e+3,t[this.currentIndex++]=e+5}createDefaultSubrayCreationCallbacks(){const e=this.randomGenerator.random;this.onDecideSubrayCreation=function(t,r){const i=r.currentSubray,a=r.rayParameters.subrayPeriod,s=r.rayParameters.subrayDutyCycle,o=r.rayParameters.isEternal&&0==i.recursion?-e()*a:n.MathUtils.lerp(i.birthTime,i.endPropagationTime,t.fraction0)-e()*a,l=r.time-o,c=Math.floor(l/a),u=e()*(c+1);let h=0;if(l%a<=s*a&&(h=r.subrayProbability),i.recursion<r.maxSubrayRecursion&&r.numSubrays<r.maxSubrays&&e()<h){const n=r.addNewSubray(),l=r.randomGenerator.getSeed();n.seed=u,r.randomGenerator.setSeed(u),n.recursion=i.recursion+1,n.maxIterations=Math.max(1,i.maxIterations-1),n.linPos0.set(e(),e(),e()).multiplyScalar(1e3),n.linPos1.set(e(),e(),e()).multiplyScalar(1e3),n.up0.copy(i.up0),n.up1.copy(i.up1),n.radius0=t.radius0*r.rayParameters.radius0Factor,n.radius1=Math.min(r.rayParameters.minRadius,t.radius1*r.rayParameters.radius1Factor),n.birthTime=o+c*a,n.deathTime=n.birthTime+a*s,r.rayParameters.isEternal||0!=i.recursion||(n.birthTime=Math.max(n.birthTime,i.birthTime),n.deathTime=Math.min(n.deathTime,i.deathTime)),n.timeScale=2*i.timeScale,n.roughness=i.roughness,n.straightness=i.straightness,n.propagationTimeFactor=i.propagationTimeFactor,n.vanishingTimeFactor=i.vanishingTimeFactor,r.onSubrayCreation(t,i,n,r),r.randomGenerator.setSeed(l)}};const t=new n.Vector3,r=new n.Vector3,i=new n.Vector3,a=new n.Vector3;this.onSubrayCreation=function(e,t,r,n){n.subrayCylinderPosition(e,t,r,.5,.6,.2)},this.subrayConePosition=function(n,s,o,l,c,u){o.pos0.copy(n.pos0),t.subVectors(s.pos1,s.pos0),r.copy(t).normalize(),t.multiplyScalar(n.fraction0+(1-n.fraction0)*(e()*l));const h=t.length();i.crossVectors(s.up0,r);const d=2*Math.PI*e();i.multiplyScalar(Math.cos(d)),a.copy(s.up0).multiplyScalar(Math.sin(d)),o.pos1.copy(i).add(a).multiplyScalar(h*c*(u+e()*(1-u))).add(t).add(s.pos0)},this.subrayCylinderPosition=function(n,s,o,l,c,u){o.pos0.copy(n.pos0),t.subVectors(s.pos1,s.pos0),r.copy(t).normalize(),t.multiplyScalar(n.fraction0+(1-n.fraction0)*((2*e()-1)*l));const h=t.length();i.crossVectors(s.up0,r);const d=2*Math.PI*e();i.multiplyScalar(Math.cos(d)),a.copy(s.up0).multiplyScalar(Math.sin(d)),o.pos1.copy(i).add(a).multiplyScalar(h*c*(u+e()*(1-u))).add(t).add(s.pos0)}}createSubray(){return{seed:0,maxIterations:0,recursion:0,pos0:new n.Vector3,pos1:new n.Vector3,linPos0:new n.Vector3,linPos1:new n.Vector3,up0:new n.Vector3,up1:new n.Vector3,radius0:0,radius1:0,birthTime:0,deathTime:0,timeScale:0,roughness:0,straightness:0,propagationTimeFactor:0,vanishingTimeFactor:0,endPropagationTime:0,beginVanishingTime:0}}createSegment(){return{iteration:0,pos0:new n.Vector3,pos1:new n.Vector3,linPos0:new n.Vector3,linPos1:new n.Vector3,up0:new n.Vector3,up1:new n.Vector3,radius0:0,radius1:0,fraction0:0,fraction1:0,positionVariationFactor:0}}getNewSegment(){return this.raySegments[this.currentSegmentIndex++]}copy(e){return super.copy(e),this.init(an.copyParameters({},e.rayParameters)),this}clone(){return new this.constructor(an.copyParameters({},this.rayParameters))}};let sn=an;nn(sn,"RAY_INITIALIZED",0),nn(sn,"RAY_UNBORN",1),nn(sn,"RAY_PROPAGATING",2),nn(sn,"RAY_STEADY",3),nn(sn,"RAY_VANISHING",4),nn(sn,"RAY_EXTINGUISHED",5),nn(sn,"COS30DEG",Math.cos(30*Math.PI/180)),nn(sn,"SIN30DEG",Math.sin(30*Math.PI/180));class on extends n.Object3D{constructor(e={}){super(),this.isLightningStorm=!0,this.stormParams=e,e.size=void 0!==e.size?e.size:1e3,e.minHeight=void 0!==e.minHeight?e.minHeight:80,e.maxHeight=void 0!==e.maxHeight?e.maxHeight:100,e.maxSlope=void 0!==e.maxSlope?e.maxSlope:1.1,e.maxLightnings=void 0!==e.maxLightnings?e.maxLightnings:3,e.lightningMinPeriod=void 0!==e.lightningMinPeriod?e.lightningMinPeriod:3,e.lightningMaxPeriod=void 0!==e.lightningMaxPeriod?e.lightningMaxPeriod:7,e.lightningMinDuration=void 0!==e.lightningMinDuration?e.lightningMinDuration:1,e.lightningMaxDuration=void 0!==e.lightningMaxDuration?e.lightningMaxDuration:2.5,this.lightningParameters=sn.copyParameters(e.lightningParameters,e.lightningParameters),this.lightningParameters.isEternal=!1,this.lightningMaterial=void 0!==e.lightningMaterial?e.lightningMaterial:new n.MeshBasicMaterial({color:11599871}),void 0!==e.onRayPosition?this.onRayPosition=e.onRayPosition:this.onRayPosition=function(t,r){r.set((Math.random()-.5)*e.size,0,(Math.random()-.5)*e.size);const i=n.MathUtils.lerp(e.minHeight,e.maxHeight,Math.random());t.set(e.maxSlope*(2*Math.random()-1),1,e.maxSlope*(2*Math.random()-1)).multiplyScalar(i).add(r)},this.onLightningDown=e.onLightningDown,this.inited=!1,this.nextLightningTime=0,this.lightningsMeshes=[],this.deadLightningsMeshes=[];for(let t=0;t<this.stormParams.maxLightnings;t++){const e=new sn(sn.copyParameters({},this.lightningParameters)),t=new n.Mesh(e,this.lightningMaterial);this.deadLightningsMeshes.push(t)}}update(e){if(this.inited||(this.nextLightningTime=this.getNextLightningTime(e)*Math.random(),this.inited=!0),e>=this.nextLightningTime){const t=this.deadLightningsMeshes.pop();if(t){const r=sn.copyParameters(t.geometry.rayParameters,this.lightningParameters);r.birthTime=e,r.deathTime=e+n.MathUtils.lerp(this.stormParams.lightningMinDuration,this.stormParams.lightningMaxDuration,Math.random()),this.onRayPosition(r.sourceOffset,r.destOffset),r.noiseSeed=Math.random(),this.add(t),this.lightningsMeshes.push(t)}this.nextLightningTime=this.getNextLightningTime(e)}let t=0,r=this.lightningsMeshes.length;for(;t<r;){const n=this.lightningsMeshes[t],i=n.geometry,a=i.state;i.update(e),a===sn.RAY_PROPAGATING&&i.state>a&&this.onLightningDown&&this.onLightningDown(i),i.state===sn.RAY_EXTINGUISHED?(this.lightningsMeshes.splice(this.lightningsMeshes.indexOf(n),1),this.deadLightningsMeshes.push(n),this.remove(n),r--):t++}}getNextLightningTime(e){return e+n.MathUtils.lerp(this.stormParams.lightningMinPeriod,this.stormParams.lightningMaxPeriod,Math.random())/(this.stormParams.maxLightnings+1)}copy(e,t){return super.copy(e,t),this.stormParams.size=e.stormParams.size,this.stormParams.minHeight=e.stormParams.minHeight,this.stormParams.maxHeight=e.stormParams.maxHeight,this.stormParams.maxSlope=e.stormParams.maxSlope,this.stormParams.maxLightnings=e.stormParams.maxLightnings,this.stormParams.lightningMinPeriod=e.stormParams.lightningMinPeriod,this.stormParams.lightningMaxPeriod=e.stormParams.lightningMaxPeriod,this.stormParams.lightningMinDuration=e.stormParams.lightningMinDuration,this.stormParams.lightningMaxDuration=e.stormParams.lightningMaxDuration,this.lightningParameters=sn.copyParameters({},e.lightningParameters),this.lightningMaterial=e.stormParams.lightningMaterial,this.onLightningDown=e.onLightningDown,this}clone(){return new this.constructor(this.stormParams).copy(this)}}class ln extends kr{constructor(e,t){super(e,t),this.geometry.setDrawRange(0,0)}}var cn=Object.defineProperty;const un=class extends n.Mesh{constructor(e,t={}){super(e),this.isReflectorForSSRPass=!0,this.type="ReflectorForSSRPass";const r=this,i=void 0!==t.color?new n.Color(t.color):new n.Color(8355711),a=t.textureWidth||512,s=t.textureHeight||512,o=t.clipBias||0,l=t.shader||un.ReflectorShader,c=!0===t.useDepthTexture,u=new n.Vector3(0,1,0),h=new n.Vector3,d=new n.Vector3;r.needsUpdate=!1,r.maxDistance=un.ReflectorShader.uniforms.maxDistance.value,r.opacity=un.ReflectorShader.uniforms.opacity.value,r.color=i,r.resolution=t.resolution||new n.Vector2(window.innerWidth,window.innerHeight),r._distanceAttenuation=un.ReflectorShader.defines.DISTANCE_ATTENUATION,Object.defineProperty(r,"distanceAttenuation",{get:()=>r._distanceAttenuation,set(e){r._distanceAttenuation!==e&&(r._distanceAttenuation=e,r.material.defines.DISTANCE_ATTENUATION=e,r.material.needsUpdate=!0)}}),r._fresnel=un.ReflectorShader.defines.FRESNEL,Object.defineProperty(r,"fresnel",{get:()=>r._fresnel,set(e){r._fresnel!==e&&(r._fresnel=e,r.material.defines.FRESNEL=e,r.material.needsUpdate=!0)}});const p=new n.Vector3,f=new n.Vector3,m=new n.Vector3,g=new n.Matrix4,v=new n.Vector3(0,0,-1),A=new n.Vector3,y=new n.Vector3,x=new n.Matrix4,b=new n.PerspectiveCamera;let w;c&&(w=new n.DepthTexture,w.type=n.UnsignedShortType,w.minFilter=n.NearestFilter,w.magFilter=n.NearestFilter);const E={depthTexture:c?w:null,type:n.HalfFloatType},S=new n.WebGLRenderTarget(a,s,E),M=new n.ShaderMaterial({transparent:c,defines:Object.assign({},un.ReflectorShader.defines,{useDepthTexture:c}),uniforms:n.UniformsUtils.clone(l.uniforms),fragmentShader:l.fragmentShader,vertexShader:l.vertexShader});M.uniforms.tDiffuse.value=S.texture,M.uniforms.color.value=r.color,M.uniforms.textureMatrix.value=x,c&&(M.uniforms.tDepth.value=S.depthTexture),this.material=M;const _=[new n.Plane(new n.Vector3(0,1,0),o)];this.doRender=function(e,t,n){if(M.uniforms.maxDistance.value=r.maxDistance,M.uniforms.color.value=r.color,M.uniforms.opacity.value=r.opacity,h.copy(n.position).normalize(),d.copy(h).reflect(u),M.uniforms.fresnelCoe.value=(h.dot(d)+1)/2,f.setFromMatrixPosition(r.matrixWorld),m.setFromMatrixPosition(n.matrixWorld),g.extractRotation(r.matrixWorld),p.set(0,0,1),p.applyMatrix4(g),A.subVectors(f,m),A.dot(p)>0)return;A.reflect(p).negate(),A.add(f),g.extractRotation(n.matrixWorld),v.set(0,0,-1),v.applyMatrix4(g),v.add(m),y.subVectors(f,v),y.reflect(p).negate(),y.add(f),b.position.copy(A),b.up.set(0,1,0),b.up.applyMatrix4(g),b.up.reflect(p),b.lookAt(y),b.far=n.far,b.updateMatrixWorld(),b.projectionMatrix.copy(n.projectionMatrix),M.uniforms.virtualCameraNear.value=n.near,M.uniforms.virtualCameraFar.value=n.far,M.uniforms.virtualCameraMatrixWorld.value=b.matrixWorld,M.uniforms.virtualCameraProjectionMatrix.value=n.projectionMatrix,M.uniforms.virtualCameraProjectionMatrixInverse.value=n.projectionMatrixInverse,M.uniforms.resolution.value=r.resolution,x.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),x.multiply(b.projectionMatrix),x.multiply(b.matrixWorldInverse),x.multiply(r.matrixWorld);const i=e.getRenderTarget(),a=e.xr.enabled,s=e.shadowMap.autoUpdate,o=e.clippingPlanes;e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,e.clippingPlanes=_,e.setRenderTarget(S),e.state.buffers.depth.setMask(!0),!1===e.autoClear&&e.clear(),e.render(t,b),e.xr.enabled=a,e.shadowMap.autoUpdate=s,e.clippingPlanes=o,e.setRenderTarget(i);const l=n.viewport;void 0!==l&&e.state.viewport(l)},this.getRenderTarget=function(){return S}}};let hn=un;((e,t,r)=>{((e,t,r)=>{t in e?cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r)})(hn,"ReflectorShader",{defines:{DISTANCE_ATTENUATION:!0,FRESNEL:!0},uniforms:{color:{value:null},tDiffuse:{value:null},tDepth:{value:null},textureMatrix:{value:new n.Matrix4},maxDistance:{value:180},opacity:{value:.5},fresnelCoe:{value:null},virtualCameraNear:{value:null},virtualCameraFar:{value:null},virtualCameraProjectionMatrix:{value:new n.Matrix4},virtualCameraMatrixWorld:{value:new n.Matrix4},virtualCameraProjectionMatrixInverse:{value:new n.Matrix4},resolution:{value:new n.Vector2}},vertexShader:"\n\t\tuniform mat4 textureMatrix;\n\t\tvarying vec4 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = textureMatrix * vec4( position, 1.0 );\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\t\tuniform vec3 color;\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform sampler2D tDepth;\n\t\tuniform float maxDistance;\n\t\tuniform float opacity;\n\t\tuniform float fresnelCoe;\n\t\tuniform float virtualCameraNear;\n\t\tuniform float virtualCameraFar;\n\t\tuniform mat4 virtualCameraProjectionMatrix;\n\t\tuniform mat4 virtualCameraProjectionMatrixInverse;\n\t\tuniform mat4 virtualCameraMatrixWorld;\n\t\tuniform vec2 resolution;\n\t\tvarying vec4 vUv;\n\t\t#include <packing>\n\t\tfloat blendOverlay( float base, float blend ) {\n\t\t\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );\n\t\t}\n\t\tvec3 blendOverlay( vec3 base, vec3 blend ) {\n\t\t\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );\n\t\t}\n\t\tfloat getDepth( const in vec2 uv ) {\n\t\t\treturn texture2D( tDepth, uv ).x;\n\t\t}\n\t\tfloat getViewZ( const in float depth ) {\n\t\t\treturn perspectiveDepthToViewZ( depth, virtualCameraNear, virtualCameraFar );\n\t\t}\n\t\tvec3 getViewPosition( const in vec2 uv, const in float depth/*clip space*/, const in float clipW ) {\n\t\t\tvec4 clipPosition = vec4( ( vec3( uv, depth ) - 0.5 ) * 2.0, 1.0 );//ndc\n\t\t\tclipPosition *= clipW; //clip\n\t\t\treturn ( virtualCameraProjectionMatrixInverse * clipPosition ).xyz;//view\n\t\t}\n\t\tvoid main() {\n\t\t\tvec4 base = texture2DProj( tDiffuse, vUv );\n\t\t\t#ifdef useDepthTexture\n\t\t\t\tvec2 uv=(gl_FragCoord.xy-.5)/resolution.xy;\n\t\t\t\tuv.x=1.-uv.x;\n\t\t\t\tfloat depth = texture2DProj( tDepth, vUv ).r;\n\t\t\t\tfloat viewZ = getViewZ( depth );\n\t\t\t\tfloat clipW = virtualCameraProjectionMatrix[2][3] * viewZ+virtualCameraProjectionMatrix[3][3];\n\t\t\t\tvec3 viewPosition=getViewPosition( uv, depth, clipW );\n\t\t\t\tvec3 worldPosition=(virtualCameraMatrixWorld*vec4(viewPosition,1)).xyz;\n\t\t\t\tif(worldPosition.y>maxDistance) discard;\n\t\t\t\tfloat op=opacity;\n\t\t\t\t#ifdef DISTANCE_ATTENUATION\n\t\t\t\t\tfloat ratio=1.-(worldPosition.y/maxDistance);\n\t\t\t\t\tfloat attenuation=ratio*ratio;\n\t\t\t\t\top=opacity*attenuation;\n\t\t\t\t#endif\n\t\t\t\t#ifdef FRESNEL\n\t\t\t\t\top*=fresnelCoe;\n\t\t\t\t#endif\n\t\t\t\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), op );\n\t\t\t#else\n\t\t\t\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );\n\t\t\t#endif\n\t\t}\n\t"});var dn=r(48756),pn=Object.defineProperty;const fn=class extends n.Mesh{constructor(e,t={}){super(e),this.isWater=!0,this.type="Water";const r=this,i=void 0!==t.color?new n.Color(t.color):new n.Color(16777215),a=t.textureWidth||512,s=t.textureHeight||512,o=t.clipBias||0,l=t.flowDirection||new n.Vector2(1,0),c=t.flowSpeed||.03,u=t.reflectivity||.02,h=t.scale||1,d=t.shader||fn.WaterShader,p=void 0!==t.encoding?t.encoding:3e3,f=t.flowMap||void 0,m=t.normalMap0,g=t.normalMap1,v=.15,A=.075,y=new n.Matrix4,x=new n.Clock;if(void 0===kr)return void console.error("THREE.Water: Required component Reflector not found.");if(void 0===Vr)return void console.error("THREE.Water: Required component Refractor not found.");const b=new kr(e,{textureWidth:a,textureHeight:s,clipBias:o,encoding:p}),w=new Vr(e,{textureWidth:a,textureHeight:s,clipBias:o,encoding:p});b.matrixAutoUpdate=!1,w.matrixAutoUpdate=!1,this.material=new n.ShaderMaterial({uniforms:n.UniformsUtils.merge([n.UniformsLib.fog,d.uniforms]),vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,transparent:!0,fog:!0}),void 0!==f?(this.material.defines.USE_FLOWMAP="",this.material.uniforms.tFlowMap={type:"t",value:f}):this.material.uniforms.flowDirection={type:"v2",value:l},m.wrapS=m.wrapT=n.RepeatWrapping,g.wrapS=g.wrapT=n.RepeatWrapping,this.material.uniforms.tReflectionMap.value=b.getRenderTarget().texture,this.material.uniforms.tRefractionMap.value=w.getRenderTarget().texture,this.material.uniforms.tNormalMap0.value=m,this.material.uniforms.tNormalMap1.value=g,this.material.uniforms.color.value=i,this.material.uniforms.reflectivity.value=u,this.material.uniforms.textureMatrix.value=y,this.material.uniforms.config.value.x=0,this.material.uniforms.config.value.y=A,this.material.uniforms.config.value.z=A,this.material.uniforms.config.value.w=h,this.onBeforeRender=function(e,t,n){!function(e){y.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),y.multiply(e.projectionMatrix),y.multiply(e.matrixWorldInverse),y.multiply(r.matrixWorld)}(n),function(){const e=x.getDelta(),t=r.material.uniforms.config;t.value.x+=c*e,t.value.y=t.value.x+A,t.value.x>=v?(t.value.x=0,t.value.y=A):t.value.y>=v&&(t.value.y=t.value.y-v)}(),r.visible=!1,b.matrixWorld.copy(r.matrixWorld),w.matrixWorld.copy(r.matrixWorld),b.onBeforeRender(e,t,n),w.onBeforeRender(e,t,n),r.visible=!0}}};let mn=fn;((e,t,r)=>{((e,t,r)=>{t in e?pn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r)})(mn,"WaterShader",{uniforms:{color:{value:null},reflectivity:{value:0},tReflectionMap:{value:null},tRefractionMap:{value:null},tNormalMap0:{value:null},tNormalMap1:{value:null},textureMatrix:{value:null},config:{value:new n.Vector4}},vertexShader:"\n\n\t\t#include <common>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\n\t\tuniform mat4 textureMatrix;\n\n\t\tvarying vec4 vCoord;\n\t\tvarying vec2 vUv;\n\t\tvarying vec3 vToEye;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tvCoord = textureMatrix * vec4( position, 1.0 );\n\n\t\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\t\t\tvToEye = cameraPosition - worldPosition.xyz;\n\n\t\t\tvec4 mvPosition = viewMatrix * worldPosition; // used in fog_vertex\n\t\t\tgl_Position = projectionMatrix * mvPosition;\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}",fragmentShader:"\n\n\t\t#include <common>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\n\t\tuniform sampler2D tReflectionMap;\n\t\tuniform sampler2D tRefractionMap;\n\t\tuniform sampler2D tNormalMap0;\n\t\tuniform sampler2D tNormalMap1;\n\n\t\t#ifdef USE_FLOWMAP\n\t\t\tuniform sampler2D tFlowMap;\n\t\t#else\n\t\t\tuniform vec2 flowDirection;\n\t\t#endif\n\n\t\tuniform vec3 color;\n\t\tuniform float reflectivity;\n\t\tuniform vec4 config;\n\n\t\tvarying vec4 vCoord;\n\t\tvarying vec2 vUv;\n\t\tvarying vec3 vToEye;\n\n\t\tvoid main() {\n\n\t\t\t#include <logdepthbuf_fragment>\n\n\t\t\tfloat flowMapOffset0 = config.x;\n\t\t\tfloat flowMapOffset1 = config.y;\n\t\t\tfloat halfCycle = config.z;\n\t\t\tfloat scale = config.w;\n\n\t\t\tvec3 toEye = normalize( vToEye );\n\n\t\t\t// determine flow direction\n\t\t\tvec2 flow;\n\t\t\t#ifdef USE_FLOWMAP\n\t\t\t\tflow = texture2D( tFlowMap, vUv ).rg * 2.0 - 1.0;\n\t\t\t#else\n\t\t\t\tflow = flowDirection;\n\t\t\t#endif\n\t\t\tflow.x *= - 1.0;\n\n\t\t\t// sample normal maps (distort uvs with flowdata)\n\t\t\tvec4 normalColor0 = texture2D( tNormalMap0, ( vUv * scale ) + flow * flowMapOffset0 );\n\t\t\tvec4 normalColor1 = texture2D( tNormalMap1, ( vUv * scale ) + flow * flowMapOffset1 );\n\n\t\t\t// linear interpolate to get the final normal color\n\t\t\tfloat flowLerp = abs( halfCycle - flowMapOffset0 ) / halfCycle;\n\t\t\tvec4 normalColor = mix( normalColor0, normalColor1, flowLerp );\n\n\t\t\t// calculate normal vector\n\t\t\tvec3 normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) );\n\n\t\t\t// calculate the fresnel term to blend reflection and refraction maps\n\t\t\tfloat theta = max( dot( toEye, normal ), 0.0 );\n\t\t\tfloat reflectance = reflectivity + ( 1.0 - reflectivity ) * pow( ( 1.0 - theta ), 5.0 );\n\n\t\t\t// calculate final uv coords\n\t\t\tvec3 coord = vCoord.xyz / vCoord.w;\n\t\t\tvec2 uv = coord.xy + coord.z * normal.xz * 0.05;\n\n\t\t\tvec4 reflectColor = texture2D( tReflectionMap, vec2( 1.0 - uv.x, uv.y ) );\n\t\t\tvec4 refractColor = texture2D( tRefractionMap, uv );\n\n\t\t\t// multiply water color with the mix of both textures\n\t\t\tgl_FragColor = vec4( color, 1.0 ) * mix( refractColor, reflectColor, reflectance );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\n\t\t}"});class gn extends n.Mesh{constructor(e,t){var r,i;const a=(s=e)&&s.isCubeTexture;var s;const o=(null!=(i=a?null==(r=e.image[0])?void 0:r.width:e.image.width)?i:1024)/4,l=Math.floor(Math.log2(o)),c=Math.pow(2,l),u=[a?"#define ENVMAP_TYPE_CUBE":"","#define CUBEUV_TEXEL_WIDTH "+1/(3*Math.max(c,112)),"#define CUBEUV_TEXEL_HEIGHT "+1/(4*c),`#define CUBEUV_MAX_MIP ${l}.0`].join("\n")+"\n #define ENVMAP_TYPE_CUBE_UV\n varying vec3 vWorldPosition;\n uniform float radius;\n uniform float height;\n uniform float angle;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube map;\n #else\n uniform sampler2D map;\n #endif\n // From: https://www.shadertoy.com/view/4tsBD7\n float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) \n {\n float d = dot ( rd, n );\n \n if( d > 0.0 ) { return 1e6; }\n \n vec3 o = ro - c;\n float t = - dot( n, o ) / d;\n vec3 q = o + rd * t;\n \n return ( dot( q, q ) < r * r ) ? t : 1e6;\n }\n // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm\n float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) \n {\n vec3 oc = ro - ce;\n float b = dot( oc, rd );\n float c = dot( oc, oc ) - ra * ra;\n float h = b * b - c;\n \n if( h < 0.0 ) { return -1.0; }\n \n h = sqrt( h );\n \n return - b + h;\n }\n vec3 project() \n {\n vec3 p = normalize( vWorldPosition );\n vec3 camPos = cameraPosition;\n camPos.y -= height;\n float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );\n if( intersection > 0.0 ) {\n \n vec3 h = vec3( 0.0, - height, 0.0 );\n float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );\n p = ( camPos + min( intersection, intersection2 ) * p ) / radius;\n } else {\n p = vec3( 0.0, 1.0, 0.0 );\n }\n return p;\n }\n #include <common>\n #include <cube_uv_reflection_fragment>\n void main() \n {\n vec3 projectedWorldPosition = project();\n \n #ifdef ENVMAP_TYPE_CUBE\n vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;\n #else\n vec3 direction = normalize( projectedWorldPosition );\n vec2 uv = equirectUv( direction );\n vec3 outcolor = texture2D( map, uv ).rgb;\n #endif\n gl_FragColor = vec4( outcolor, 1.0 );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n }\n ",h={map:{value:e},height:{value:(null==t?void 0:t.height)||15},radius:{value:(null==t?void 0:t.radius)||100}};super(new n.IcosahedronGeometry(1,16),new n.ShaderMaterial({uniforms:h,fragmentShader:u,vertexShader:"\n varying vec3 vWorldPosition;\n void main() \n {\n vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );\n vWorldPosition = worldPosition.xyz;\n \n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",side:n.DoubleSide}))}set radius(e){this.material.uniforms.radius.value=e}get radius(){return this.material.uniforms.radius.value}set height(e){this.material.uniforms.height.value=e}get height(){return this.material.uniforms.height.value}}const vn={createMeshesFromInstancedMesh:function(e){const t=new n.Group,r=e.count,i=e.geometry,a=e.material;for(let s=0;s<r;s++){const r=new n.Mesh(i,a);e.getMatrixAt(s,r.matrix),r.matrix.decompose(r.position,r.quaternion,r.scale),t.add(r)}return t.copy(e),t.updateMatrixWorld(),t},createMultiMaterialObject:function(e,t){const r=new n.Group;for(let i=0,a=t.length;i<a;i++)r.add(new n.Mesh(e,t[i]));return r},detach:function(e,t,r){console.warn("THREE.SceneUtils: detach() has been deprecated. Use scene.attach( child ) instead."),r.attach(e)},attach:function(e,t,r){console.warn("THREE.SceneUtils: attach() has been deprecated. Use parent.attach( child ) instead."),r.attach(e)}};function An(e,t=1024){const r=new n.Vector2,i=new n.Vector2,a=[new n.Vector2,new n.Vector2,new n.Vector2],s=[],o=document.createElement("canvas"),l=t,c=t;o.width=l,o.height=c;const u=o.getContext("2d");u.lineWidth=1,u.strokeStyle="rgb( 63, 63, 63 )",u.textAlign="center",u.fillStyle="rgb( 255, 255, 255 )",u.fillRect(0,0,l,c);const h=e.index,d=e.attributes.uv;if(h)for(let n=0,f=h.count;n<f;n+=3)s[0]=h.getX(n),s[1]=h.getX(n+1),s[2]=h.getX(n+2),a[0].fromBufferAttribute(d,s[0]),a[1].fromBufferAttribute(d,s[1]),a[2].fromBufferAttribute(d,s[2]),p(s,a,n/3);else for(let n=0,f=d.count;n<f;n+=3)s[0]=n,s[1]=n+1,s[2]=n+2,a[0].fromBufferAttribute(d,s[0]),a[1].fromBufferAttribute(d,s[1]),a[2].fromBufferAttribute(d,s[2]),p(s,a,n/3);return o;function p(e,t,n){u.beginPath(),r.set(0,0);for(let i=0,a=t.length;i<a;i++){const e=t[i];r.x+=e.x,r.y+=e.y,0===i?u.moveTo(e.x*(l-2)+.5,(1-e.y)*(c-2)+.5):u.lineTo(e.x*(l-2)+.5,(1-e.y)*(c-2)+.5)}u.closePath(),u.stroke(),r.divideScalar(t.length),u.font="18px Arial",u.fillStyle="rgb( 63, 63, 63 )",u.fillText(n,r.x*l,(1-r.y)*c),r.x>.95&&u.fillText(n,r.x%1*l,(1-r.y)*c),u.font="12px Arial",u.fillStyle="rgb( 191, 191, 191 )";for(let a=0,s=t.length;a<s;a++){const n=t[a];i.addVectors(r,n).divideScalar(2);const s=e[a];u.fillText("abc"[a]+s,i.x*l,(1-i.y)*c),i.x>.95&&u.fillText("abc"[a]+s,i.x%1*l,(1-i.y)*c)}}}const yn=(e=new n.Vector3(0,0,0),t=10,r=1,i=0,a=1,s=2,o=3)=>{const l=t/2,c=[new n.Vector3(e.x-l,e.y,e.z-l),new n.Vector3(e.x-l,e.y,e.z+l),new n.Vector3(e.x+l,e.y,e.z+l),new n.Vector3(e.x+l,e.y,e.z-l)],u=[c[i],c[a],c[s],c[o]];if(0<=--r){const e=[];return Array.prototype.push.apply(e,yn(u[0],l,r,i,o,s,a)),Array.prototype.push.apply(e,yn(u[1],l,r,i,a,s,o)),Array.prototype.push.apply(e,yn(u[2],l,r,i,a,s,o)),Array.prototype.push.apply(e,yn(u[3],l,r,s,a,i,o)),e}return u},xn=(e=new n.Vector3(0,0,0),t=10,r=1,i=0,a=1,s=2,o=3,l=4,c=5,u=6,h=7)=>{const d=t/2,p=[new n.Vector3(e.x-d,e.y+d,e.z-d),new n.Vector3(e.x-d,e.y+d,e.z+d),new n.Vector3(e.x-d,e.y-d,e.z+d),new n.Vector3(e.x-d,e.y-d,e.z-d),new n.Vector3(e.x+d,e.y-d,e.z-d),new n.Vector3(e.x+d,e.y-d,e.z+d),new n.Vector3(e.x+d,e.y+d,e.z+d),new n.Vector3(e.x+d,e.y+d,e.z-d)],f=[p[i],p[a],p[s],p[o],p[l],p[c],p[u],p[h]];if(--r>=0){const e=[];return Array.prototype.push.apply(e,xn(f[0],d,r,i,o,l,h,u,c,s,a)),Array.prototype.push.apply(e,xn(f[1],d,r,i,h,u,a,s,c,l,o)),Array.prototype.push.apply(e,xn(f[2],d,r,i,h,u,a,s,c,l,o)),Array.prototype.push.apply(e,xn(f[3],d,r,s,o,i,a,u,h,l,c)),Array.prototype.push.apply(e,xn(f[4],d,r,s,o,i,a,u,h,l,c)),Array.prototype.push.apply(e,xn(f[5],d,r,l,o,s,c,u,a,i,h)),Array.prototype.push.apply(e,xn(f[6],d,r,l,o,s,c,u,a,i,h)),Array.prototype.push.apply(e,xn(f[7],d,r,u,c,s,a,i,o,l,h)),e}return f},bn={hilbert3D:xn,gosper:(e=1)=>function(e){let t=0,r=0,n=0;const i=[0,0,0],a=e.fractal;for(let s=0,o=a.length;s<o;s++){const o=a[s];"+"===o?n+=e.angle:"-"===o?n-=e.angle:"F"===o&&(t+=e.size*Math.cos(n),r+=-e.size*Math.sin(n),i.push(t,r,0))}return i}({fractal:function(e){let t="",r=e.axiom;for(let n=0,i=e.steps;0<=i?n<i:n>i;0<=i?n++:n--){t="";for(let n=0,i=r.length;n<i;n++){const i=r[n];i in e.rules?t+=e.rules[i]:t+=i}r=t}return t}({axiom:"A",steps:4,rules:{A:"A+BF++BF-FA--FAFA-BF+",B:"-FA+BFBF++BF+FA--FA-B"}}),size:e,angle:Math.PI/3}),hilbert2D:yn};var wn=Object.defineProperty,En=(e,t,r)=>(((e,t,r)=>{t in e?wn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),Sn=In(),Mn=new n.Mesh(new n.PlaneGeometry(2,2),Sn),_n=new n.OrthographicCamera(0,1,0,1,0,1),Tn=null;class Cn{constructor(e){En(this,"generateMipmaps",(function(e){if("roughnessMap"in e!=!1){var{roughnessMap:t,normalMap:r}=e;if(null!==t&&null!==r&&t.generateMipmaps&&!e.userData.roughnessUpdated){e.userData.roughnessUpdated=!0;var i=Math.max(t.image.width,r.image.width),a=Math.max(t.image.height,r.image.height);if(n.MathUtils.isPowerOfTwo(i)&&n.MathUtils.isPowerOfTwo(a)){var s=this._renderer.getRenderTarget(),o=this._renderer.autoClear;if(this._renderer.autoClear=!1,null!==Tn&&Tn.width===i&&Tn.height===a||(null!==Tn&&Tn.dispose(),(Tn=new n.WebGLRenderTarget(i,a,{depthBuffer:!1})).scissorTest=!0),i!==t.image.width||a!==t.image.height){var l={wrapS:t.wrapS,wrapT:t.wrapT,magFilter:t.magFilter,minFilter:t.minFilter,depthBuffer:!1},c=new n.WebGLRenderTarget(i,a,l);c.texture.generateMipmaps=!0,this._renderer.setRenderTarget(c),e.roughnessMap=c.texture,e.metalnessMap==t&&(e.metalnessMap=e.roughnessMap),e.aoMap==t&&(e.aoMap=e.roughnessMap)}Sn.uniforms.roughnessMap.value=t,Sn.uniforms.normalMap.value=r;var u=new n.Vector2(0,0),h=Sn.uniforms.texelSize.value;for(let t=0;i>=1&&a>=1;++t,i/=2,a/=2)h.set(1/i,1/a),0==t&&h.set(0,0),Tn.viewport.set(u.x,u.y,i,a),Tn.scissor.set(u.x,u.y,i,a),this._renderer.setRenderTarget(Tn),this._renderer.render(Mn,_n),this._renderer.copyFramebufferToTexture(u,e.roughnessMap,t),Sn.uniforms.roughnessMap.value=e.roughnessMap;t!==e.roughnessMap&&t.dispose(),this._renderer.setRenderTarget(s),this._renderer.autoClear=o}}}})),En(this,"dispose",(function(){Sn.dispose(),Mn.geometry.dispose(),null!=Tn&&Tn.dispose()})),this._renderer=e,this._renderer.compile(Mn,_n)}}function In(){var e=new n.RawShaderMaterial({uniforms:{roughnessMap:{value:null},normalMap:{value:null},texelSize:{value:new n.Vector2(1,1)}},vertexShader:"\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tattribute vec3 position;\n\t\t\tattribute vec2 uv;\n\n\t\t\tvarying vec2 vUv;\n\n\t\t\tvoid main() {\n\n\t\t\t\tvUv = uv;\n\n\t\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t\t}\n\t\t",fragmentShader:"\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec2 vUv;\n\n\t\t\tuniform sampler2D roughnessMap;\n\t\t\tuniform sampler2D normalMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\n\t\t\tvec4 envMapTexelToLinear( vec4 a ) { return a; }\n\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tfloat roughnessToVariance( float roughness ) {\n\n\t\t\t\tfloat variance = 0.0;\n\n\t\t\t\tif ( roughness >= r1 ) {\n\n\t\t\t\t\tvariance = ( r0 - roughness ) * ( v1 - v0 ) / ( r0 - r1 ) + v0;\n\n\t\t\t\t} else if ( roughness >= r4 ) {\n\n\t\t\t\t\tvariance = ( r1 - roughness ) * ( v4 - v1 ) / ( r1 - r4 ) + v1;\n\n\t\t\t\t} else if ( roughness >= r5 ) {\n\n\t\t\t\t\tvariance = ( r4 - roughness ) * ( v5 - v4 ) / ( r4 - r5 ) + v4;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tfloat roughness2 = roughness * roughness;\n\n\t\t\t\t\tvariance = 1.79 * roughness2 * roughness2;\n\n\t\t\t\t}\n\n\t\t\t\treturn variance;\n\n\t\t\t}\n\n\t\t\tfloat varianceToRoughness( float variance ) {\n\n\t\t\t\tfloat roughness = 0.0;\n\n\t\t\t\tif ( variance >= v1 ) {\n\n\t\t\t\t\troughness = ( v0 - variance ) * ( r1 - r0 ) / ( v0 - v1 ) + r0;\n\n\t\t\t\t} else if ( variance >= v4 ) {\n\n\t\t\t\t\troughness = ( v1 - variance ) * ( r4 - r1 ) / ( v1 - v4 ) + r1;\n\n\t\t\t\t} else if ( variance >= v5 ) {\n\n\t\t\t\t\troughness = ( v4 - variance ) * ( r5 - r4 ) / ( v4 - v5 ) + r4;\n\n\t\t\t\t} else {\n\n\t\t\t\t\troughness = pow( 0.559 * variance, 0.25 ); // 0.559 = 1.0 / 1.79\n\n\t\t\t\t}\n\n\t\t\t\treturn roughness;\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = texture2D( roughnessMap, vUv, - 1.0 );\n\n\t\t\t\tif ( texelSize.x == 0.0 ) return;\n\n\t\t\t\tfloat roughness = gl_FragColor.g;\n\n\t\t\t\tfloat variance = roughnessToVariance( roughness );\n\n\t\t\t\tvec3 avgNormal;\n\n\t\t\t\tfor ( float x = - 1.0; x < 2.0; x += 2.0 ) {\n\n\t\t\t\t\tfor ( float y = - 1.0; y < 2.0; y += 2.0 ) {\n\n\t\t\t\t\t\tvec2 uv = vUv + vec2( x, y ) * 0.25 * texelSize;\n\n\t\t\t\t\t\tavgNormal += normalize( texture2D( normalMap, uv, - 1.0 ).xyz - 0.5 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvariance += 1.0 - 0.25 * length( avgNormal );\n\n\t\t\t\tgl_FragColor.g = varianceToRoughness( variance );\n\n\t\t\t}\n\t\t",blending:n.NoBlending,depthTest:!1,depthWrite:!1});return e.type="RoughnessMipmapper",e}function Bn(e,t,r={}){const i=new n.Vector3,a=new n.Quaternion,s=new n.Vector3,o=new n.Matrix4,l=new n.Matrix4,c=new n.Matrix4;r.preserveMatrix=void 0===r.preserveMatrix||r.preserveMatrix,r.preservePosition=void 0===r.preservePosition||r.preservePosition,r.preserveHipPosition=void 0!==r.preserveHipPosition&&r.preserveHipPosition,r.useTargetMatrix=void 0!==r.useTargetMatrix&&r.useTargetMatrix,r.hip=void 0!==r.hip?r.hip:"hip",r.names=r.names||{};const u=t.isObject3D?t.skeleton.bones:Pn(t),h=e.isObject3D?e.skeleton.bones:Pn(e);let d,p,f,m,g;if(e.isObject3D?e.skeleton.pose():(r.useTargetMatrix=!0,r.preserveMatrix=!1),r.preservePosition){g=[];for(let e=0;e<h.length;e++)g.push(h[e].position.clone())}if(r.preserveMatrix){e.updateMatrixWorld(),e.matrixWorld.identity();for(let t=0;t<e.children.length;++t)e.children[t].updateMatrixWorld(!0)}if(r.offsets){d=[];for(let e=0;e<h.length;++e)p=h[e],f=r.names[p.name]||p.name,r.offsets[f]&&(p.matrix.multiply(r.offsets[f]),p.matrix.decompose(p.position,p.quaternion,p.scale),p.updateMatrixWorld()),d.push(p.matrixWorld.clone())}for(let n=0;n<h.length;++n){if(p=h[n],f=r.names[p.name]||p.name,m=Rn(f,u),c.copy(p.matrixWorld),m){if(m.updateMatrixWorld(),r.useTargetMatrix?l.copy(m.matrixWorld):(l.copy(e.matrixWorld).invert(),l.multiply(m.matrixWorld)),s.setFromMatrixScale(l),l.scale(s.set(1/s.x,1/s.y,1/s.z)),c.makeRotationFromQuaternion(a.setFromRotationMatrix(l)),e.isObject3D){const t=h.indexOf(p),r=d?d[t]:o.copy(e.skeleton.boneInverses[t]).invert();c.multiply(r)}c.copyPosition(l)}p.parent&&p.parent.isBone?(p.matrix.copy(p.parent.matrixWorld).invert(),p.matrix.multiply(c)):p.matrix.copy(c),r.preserveHipPosition&&f===r.hip&&p.matrix.setPosition(i.set(0,p.position.y,0)),p.matrix.decompose(p.position,p.quaternion,p.scale),p.updateMatrixWorld()}if(r.preservePosition)for(let n=0;n<h.length;++n)p=h[n],f=r.names[p.name]||p.name,f!==r.hip&&p.position.copy(g[n]);r.preserveMatrix&&e.updateMatrixWorld(!0)}function Rn(e,t){for(let r=0,n=Pn(t);r<n.length;r++)if(e===n[r].name)return n[r]}function Pn(e){return Array.isArray(e)?e:e.bones}function Fn(e,t,r){r(e,t);for(let n=0;n<e.children.length;n++)Fn(e.children[n],t.children[n],r)}const Ln={retarget:Bn,retargetClip:function(e,t,r,i={}){i.useFirstFramePosition=void 0!==i.useFirstFramePosition&&i.useFirstFramePosition,i.fps=void 0!==i.fps?i.fps:30,i.names=i.names||[],t.isObject3D||(t=function(e){const t=new n.SkeletonHelper(e.bones[0]);return t.skeleton=e,t}(t));const a=Math.round(r.duration*(i.fps/1e3)*1e3),s=1/i.fps,o=[],l=new n.AnimationMixer(t),c=Pn(e.skeleton),u=[];let h,d,p,f,m;l.clipAction(r).play(),l.update(0),t.updateMatrixWorld();for(let n=0;n<a;++n){const r=n*s;Bn(e,t,i);for(let e=0;e<c.length;++e)m=i.names[c[e].name]||c[e].name,p=Rn(m,t.skeleton),p&&(d=c[e],f=u[e]=u[e]||{bone:d},i.hip===m&&(f.pos||(f.pos={times:new Float32Array(a),values:new Float32Array(3*a)}),i.useFirstFramePosition&&(0===n&&(h=d.position.clone()),d.position.sub(h)),f.pos.times[n]=r,d.position.toArray(f.pos.values,3*n)),f.quat||(f.quat={times:new Float32Array(a),values:new Float32Array(4*a)}),f.quat.times[n]=r,d.quaternion.toArray(f.quat.values,4*n));l.update(s),t.updateMatrixWorld()}for(let g=0;g<u.length;++g)f=u[g],f&&(f.pos&&o.push(new n.VectorKeyframeTrack(".bones["+f.bone.name+"].position",f.pos.times,f.pos.values)),o.push(new n.QuaternionKeyframeTrack(".bones["+f.bone.name+"].quaternion",f.quat.times,f.quat.values)));return l.uncacheAction(r),new n.AnimationClip(r.name,-1,o)},clone:function(e){const t=new Map,r=new Map,n=e.clone();return Fn(e,n,(function(e,n){t.set(n,e),r.set(e,n)})),n.traverse((function(e){if(!e.isSkinnedMesh)return;const n=e,i=t.get(e),a=i.skeleton.bones;n.skeleton=i.skeleton.clone(),n.bindMatrix.copy(i.bindMatrix),n.skeleton.bones=a.map((function(e){return r.get(e)})),n.bind(n.skeleton,n.bindMatrix)})),n}},Dn={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include <packing>","void main() {","\tfloat depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","\tgl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};class Un{constructor(e){const t=this,r=void 0!==e.name&&""!==e.name;let i;const a=10,s=10,o=256,l=256,c=new n.OrthographicCamera(window.innerWidth/-2,window.innerWidth/2,window.innerHeight/2,window.innerHeight/-2,1,10);c.position.set(0,0,2);const u=new n.Scene,h=Dn,d=n.UniformsUtils.clone(h.uniforms),p=new n.ShaderMaterial({uniforms:d,vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}),f=new n.PlaneGeometry(o,l),m=new n.Mesh(f,p);let g,v;if(u.add(m),r){g=document.createElement("canvas");const t=g.getContext("2d");t.font="Bold 20px Arial";const r=t.measureText(e.name).width;g.width=r,g.height=25,t.font="Bold 20px Arial",t.fillStyle="rgba( 255, 0, 0, 1 )",t.fillText(e.name,0,20);const i=new n.Texture(g);i.magFilter=n.LinearFilter,i.minFilter=n.LinearFilter,i.needsUpdate=!0;const a=new n.MeshBasicMaterial({map:i,side:n.DoubleSide});a.transparent=!0;const s=new n.PlaneGeometry(g.width,g.height);v=new n.Mesh(s,a),u.add(v)}this.enabled=!0,this.size={width:o,height:l,set:function(e,r){this.width=e,this.height=r,m.scale.set(this.width/o,this.height/l,1),t.position.set(t.position.x,t.position.y)}},this.position={x:a,y:s,set:function(e,n){this.x=e,this.y=n;const i=t.size.width,a=t.size.height;m.position.set(-window.innerWidth/2+i/2+this.x,window.innerHeight/2-a/2-this.y,0),r&&v.position.set(m.position.x,m.position.y-t.size.height/2+g.height/2,0)}},this.render=function(t){this.enabled&&(d.tDiffuse.value=e.shadow.map.texture,i=t.autoClear,t.autoClear=!1,t.clearDepth(),t.render(u,c),t.autoClear=i)},this.updateForWindowResize=function(){this.enabled&&(c.left=window.innerWidth/-2,c.right=window.innerWidth/2,c.top=window.innerHeight/2,c.bottom=window.innerHeight/-2,c.updateProjectionMatrix(),this.update())},this.update=function(){this.position.set(this.position.x,this.position.y),this.size.set(this.size.width,this.size.height)},this.update()}}var Nn={compressNormals:function(e,t){e.geometry||console.error("Mesh must contain geometry. ");const r=e.geometry.attributes.normal;if(r||console.error("Geometry must contain normal attribute. "),r.isPacked)return;3!=r.itemSize&&console.error("normal.itemSize is not 3, which cannot be encoded. ");const i=r.array,a=r.count;let s;if("DEFAULT"==t){s=new Uint8Array(3*a);for(let e=0;e<i.length;e+=3){const t=this.EncodingFuncs.defaultEncode(i[e],i[e+1],i[e+2],1);s[e+0]=t[0],s[e+1]=t[1],s[e+2]=t[2]}e.geometry.setAttribute("normal",new n.BufferAttribute(s,3,!0)),e.geometry.attributes.normal.bytes=1*s.length}else if("OCT1Byte"==t){s=new Int8Array(2*a);for(let e=0;e<i.length;e+=3){const t=this.EncodingFuncs.octEncodeBest(i[e],i[e+1],i[e+2],1);s[e/3*2+0]=t[0],s[e/3*2+1]=t[1]}e.geometry.setAttribute("normal",new n.BufferAttribute(s,2,!0)),e.geometry.attributes.normal.bytes=1*s.length}else if("OCT2Byte"==t){s=new Int16Array(2*a);for(let e=0;e<i.length;e+=3){const t=this.EncodingFuncs.octEncodeBest(i[e],i[e+1],i[e+2],2);s[e/3*2+0]=t[0],s[e/3*2+1]=t[1]}e.geometry.setAttribute("normal",new n.BufferAttribute(s,2,!0)),e.geometry.attributes.normal.bytes=2*s.length}else if("ANGLES"==t){s=new Uint16Array(2*a);for(let e=0;e<i.length;e+=3){const t=this.EncodingFuncs.anglesEncode(i[e],i[e+1],i[e+2]);s[e/3*2+0]=t[0],s[e/3*2+1]=t[1]}e.geometry.setAttribute("normal",new n.BufferAttribute(s,2,!0)),e.geometry.attributes.normal.bytes=2*s.length}else console.error("Unrecognized encoding method, should be `DEFAULT` or `ANGLES` or `OCT`. ");e.geometry.attributes.normal.needsUpdate=!0,e.geometry.attributes.normal.isPacked=!0,e.geometry.attributes.normal.packingMethod=t,e.material instanceof kn||(e.material=(new kn).copy(e.material)),"ANGLES"==t&&(e.material.defines.USE_PACKED_NORMAL=0),"OCT1Byte"==t&&(e.material.defines.USE_PACKED_NORMAL=1),"OCT2Byte"==t&&(e.material.defines.USE_PACKED_NORMAL=1),"DEFAULT"==t&&(e.material.defines.USE_PACKED_NORMAL=2)},compressPositions:function(e){e.geometry||console.error("Mesh must contain geometry. ");const t=e.geometry.attributes.position;if(t||console.error("Geometry must contain position attribute. "),t.isPacked)return;3!=t.itemSize&&console.error("position.itemSize is not 3, which cannot be packed. ");const r=t.array,i=this.EncodingFuncs.quantizedEncode(r,2),a=i.quantized,s=i.decodeMat;null==e.geometry.boundingBox&&e.geometry.computeBoundingBox(),null==e.geometry.boundingSphere&&e.geometry.computeBoundingSphere(),e.geometry.setAttribute("position",new n.BufferAttribute(a,3)),e.geometry.attributes.position.isPacked=!0,e.geometry.attributes.position.needsUpdate=!0,e.geometry.attributes.position.bytes=2*a.length,e.material instanceof kn||(e.material=(new kn).copy(e.material)),e.material.defines.USE_PACKED_POSITION=0,e.material.uniforms.quantizeMatPos.value=s,e.material.uniforms.quantizeMatPos.needsUpdate=!0},compressUvs:function(e){e.geometry||console.error("Mesh must contain geometry property. ");const t=e.geometry.attributes.uv;if(t||console.error("Geometry must contain uv attribute. "),t.isPacked)return;const r={min:1/0,max:-1/0},i=t.array;for(let n=0;n<i.length;n++)r.min=Math.min(r.min,i[n]),r.max=Math.max(r.max,i[n]);let a;if(r.min>=-1&&r.max<=1){a=new Uint16Array(i.length);for(let e=0;e<i.length;e+=2){const t=this.EncodingFuncs.defaultEncode(i[e],i[e+1],0,2);a[e]=t[0],a[e+1]=t[1]}e.geometry.setAttribute("uv",new n.BufferAttribute(a,2,!0)),e.geometry.attributes.uv.isPacked=!0,e.geometry.attributes.uv.needsUpdate=!0,e.geometry.attributes.uv.bytes=2*a.length,e.material instanceof kn||(e.material=(new kn).copy(e.material)),e.material.defines.USE_PACKED_UV=0}else a=this.EncodingFuncs.quantizedEncodeUV(i,2),e.geometry.setAttribute("uv",new n.BufferAttribute(a.quantized,2)),e.geometry.attributes.uv.isPacked=!0,e.geometry.attributes.uv.needsUpdate=!0,e.geometry.attributes.uv.bytes=2*a.quantized.length,e.material instanceof kn||(e.material=(new kn).copy(e.material)),e.material.defines.USE_PACKED_UV=1,e.material.uniforms.quantizeMatUV.value=a.decodeMat,e.material.uniforms.quantizeMatUV.needsUpdate=!0},EncodingFuncs:{defaultEncode:function(e,t,r,n){if(1==n){const n=Math.round(.5*(e+1)*255),i=Math.round(.5*(t+1)*255),a=Math.round(.5*(r+1)*255);return new Uint8Array([n,i,a])}if(2==n){const n=Math.round(.5*(e+1)*65535),i=Math.round(.5*(t+1)*65535),a=Math.round(.5*(r+1)*65535);return new Uint16Array([n,i,a])}console.error("number of bytes must be 1 or 2")},defaultDecode:function(e,t){return 1==t?[e[0]/255*2-1,e[1]/255*2-1,e[2]/255*2-1]:2==t?[e[0]/65535*2-1,e[1]/65535*2-1,e[2]/65535*2-1]:void console.error("number of bytes must be 1 or 2")},anglesEncode:function(e,t,r){const n=parseInt(.5*(1+Math.atan2(t,e)/Math.PI)*65535),i=parseInt(.5*(1+r)*65535);return new Uint16Array([n,i])},octEncodeBest:function(e,t,r,n){var i,a,s,o,l;return s=i=c(e,t,r,"floor","floor"),a=u(i),l=h(e,t,r,a),a=u(i=c(e,t,r,"ceil","floor")),(o=h(e,t,r,a))>l&&(s=i,l=o),a=u(i=c(e,t,r,"floor","ceil")),(o=h(e,t,r,a))>l&&(s=i,l=o),a=u(i=c(e,t,r,"ceil","ceil")),(o=h(e,t,r,a))>l&&(s=i),s;function c(e,t,i,a,s){var o=e/(Math.abs(e)+Math.abs(t)+Math.abs(i)),l=t/(Math.abs(e)+Math.abs(t)+Math.abs(i));if(r<0){var c=(1-Math.abs(l))*(o>=0?1:-1),u=(1-Math.abs(o))*(l>=0?1:-1);o=c,l=u;var h=1-Math.abs(o)-Math.abs(l);h>0&&(h+=.001,o+=o>0?h/2:-h/2,l+=l>0?h/2:-h/2)}return 1==n?new Int8Array([Math[a](127.5*o+(o<0?1:0)),Math[s](127.5*l+(l<0?1:0))]):2==n?new Int16Array([Math[a](32767.5*o+(o<0?1:0)),Math[s](32767.5*l+(l<0?1:0))]):void 0}function u(e){var t=e[0],r=e[1];1==n?(t/=t<0?127:128,r/=r<0?127:128):2==n&&(t/=t<0?32767:32768,r/=r<0?32767:32768);var i=1-Math.abs(t)-Math.abs(r);if(i<0){var a=t;t=(1-Math.abs(r))*(t>=0?1:-1),r=(1-Math.abs(a))*(r>=0?1:-1)}var s=Math.sqrt(t*t+r*r+i*i);return[t/s,r/s,i/s]}function h(e,t,r,n){return e*n[0]+t*n[1]+r*n[2]}},quantizedEncode:function(e,t){let r,i;1==t?(r=new Uint8Array(e.length),i=255):2==t?(r=new Uint16Array(e.length),i=65535):console.error("number of bytes error! ");const a=new n.Matrix4,s=new Float32Array(3),o=new Float32Array(3);s[0]=s[1]=s[2]=Number.MAX_VALUE,o[0]=o[1]=o[2]=-Number.MAX_VALUE;for(let n=0;n<e.length;n+=3)s[0]=Math.min(s[0],e[n+0]),s[1]=Math.min(s[1],e[n+1]),s[2]=Math.min(s[2],e[n+2]),o[0]=Math.max(o[0],e[n+0]),o[1]=Math.max(o[1],e[n+1]),o[2]=Math.max(o[2],e[n+2]);a.scale(new n.Vector3((o[0]-s[0])/i,(o[1]-s[1])/i,(o[2]-s[2])/i)),a.elements[12]=s[0],a.elements[13]=s[1],a.elements[14]=s[2],a.transpose();const l=new Float32Array([o[0]!==s[0]?i/(o[0]-s[0]):0,o[1]!==s[1]?i/(o[1]-s[1]):0,o[2]!==s[2]?i/(o[2]-s[2]):0]);for(let n=0;n<e.length;n+=3)r[n+0]=Math.floor((e[n+0]-s[0])*l[0]),r[n+1]=Math.floor((e[n+1]-s[1])*l[1]),r[n+2]=Math.floor((e[n+2]-s[2])*l[2]);return{quantized:r,decodeMat:a}},quantizedEncodeUV:function(e,t){let r,i;1==t?(r=new Uint8Array(e.length),i=255):2==t?(r=new Uint16Array(e.length),i=65535):console.error("number of bytes error! ");const a=new n.Matrix3,s=new Float32Array(2),o=new Float32Array(2);s[0]=s[1]=Number.MAX_VALUE,o[0]=o[1]=-Number.MAX_VALUE;for(let n=0;n<e.length;n+=2)s[0]=Math.min(s[0],e[n+0]),s[1]=Math.min(s[1],e[n+1]),o[0]=Math.max(o[0],e[n+0]),o[1]=Math.max(o[1],e[n+1]);a.scale((o[0]-s[0])/i,(o[1]-s[1])/i),a.elements[6]=s[0],a.elements[7]=s[1],a.transpose();const l=new Float32Array([o[0]!==s[0]?i/(o[0]-s[0]):0,o[1]!==s[1]?i/(o[1]-s[1]):0]);for(let n=0;n<e.length;n+=2)r[n+0]=Math.floor((e[n+0]-s[0])*l[0]),r[n+1]=Math.floor((e[n+1]-s[1])*l[1]);return{quantized:r,decodeMat:a}}}};class kn extends n.MeshPhongMaterial{constructor(e){super(),this.defines={},this.type="PackedPhongMaterial",this.uniforms=n.UniformsUtils.merge([n.ShaderLib.phong.uniforms,{quantizeMatPos:{value:null},quantizeMatUV:{value:null}}]),this.vertexShader=["#define PHONG","varying vec3 vViewPosition;","#ifndef FLAT_SHADED","varying vec3 vNormal;","#endif",n.ShaderChunk.common,n.ShaderChunk.uv_pars_vertex,n.ShaderChunk.uv2_pars_vertex,n.ShaderChunk.displacementmap_pars_vertex,n.ShaderChunk.envmap_pars_vertex,n.ShaderChunk.color_pars_vertex,n.ShaderChunk.fog_pars_vertex,n.ShaderChunk.morphtarget_pars_vertex,n.ShaderChunk.skinning_pars_vertex,n.ShaderChunk.shadowmap_pars_vertex,n.ShaderChunk.logdepthbuf_pars_vertex,n.ShaderChunk.clipping_planes_pars_vertex,"#ifdef USE_PACKED_NORMAL\n\t\t\t\t\t#if USE_PACKED_NORMAL == 0\n\t\t\t\t\t\tvec3 decodeNormal(vec3 packedNormal)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat x = packedNormal.x * 2.0 - 1.0;\n\t\t\t\t\t\t\tfloat y = packedNormal.y * 2.0 - 1.0;\n\t\t\t\t\t\t\tvec2 scth = vec2(sin(x * PI), cos(x * PI));\n\t\t\t\t\t\t\tvec2 scphi = vec2(sqrt(1.0 - y * y), y);\n\t\t\t\t\t\t\treturn normalize( vec3(scth.y * scphi.x, scth.x * scphi.x, scphi.y) );\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\n\t\t\t\t\t#if USE_PACKED_NORMAL == 1\n\t\t\t\t\t\tvec3 decodeNormal(vec3 packedNormal)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvec3 v = vec3(packedNormal.xy, 1.0 - abs(packedNormal.x) - abs(packedNormal.y));\n\t\t\t\t\t\t\tif (v.z < 0.0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tv.xy = (1.0 - abs(v.yx)) * vec2((v.x >= 0.0) ? +1.0 : -1.0, (v.y >= 0.0) ? +1.0 : -1.0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn normalize(v);\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\n\t\t\t\t\t#if USE_PACKED_NORMAL == 2\n\t\t\t\t\t\tvec3 decodeNormal(vec3 packedNormal)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvec3 v = (packedNormal * 2.0) - 1.0;\n\t\t\t\t\t\t\treturn normalize(v);\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\t\t\t\t#endif","#ifdef USE_PACKED_POSITION\n\t\t\t\t\t#if USE_PACKED_POSITION == 0\n\t\t\t\t\t\tuniform mat4 quantizeMatPos;\n\t\t\t\t\t#endif\n\t\t\t\t#endif","#ifdef USE_PACKED_UV\n\t\t\t\t\t#if USE_PACKED_UV == 1\n\t\t\t\t\t\tuniform mat3 quantizeMatUV;\n\t\t\t\t\t#endif\n\t\t\t\t#endif","#ifdef USE_PACKED_UV\n\t\t\t\t\t#if USE_PACKED_UV == 0\n\t\t\t\t\t\tvec2 decodeUV(vec2 packedUV)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvec2 uv = (packedUV * 2.0) - 1.0;\n\t\t\t\t\t\t\treturn uv;\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\n\t\t\t\t\t#if USE_PACKED_UV == 1\n\t\t\t\t\t\tvec2 decodeUV(vec2 packedUV)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvec2 uv = ( vec3(packedUV, 1.0) * quantizeMatUV ).xy;\n\t\t\t\t\t\t\treturn uv;\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\t\t\t\t#endif","void main() {",n.ShaderChunk.uv_vertex,"#ifdef USE_UV\n\t\t\t\t\t#ifdef USE_PACKED_UV\n\t\t\t\t\t\tvUv = decodeUV(vUv);\n\t\t\t\t\t#endif\n\t\t\t\t#endif",n.ShaderChunk.uv2_vertex,n.ShaderChunk.color_vertex,n.ShaderChunk.beginnormal_vertex,"#ifdef USE_PACKED_NORMAL\n\t\t\t\t\tobjectNormal = decodeNormal(objectNormal);\n\t\t\t\t#endif\n\n\t\t\t\t#ifdef USE_TANGENT\n\t\t\t\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t\t\t\t#endif\n\t\t\t\t",n.ShaderChunk.morphnormal_vertex,n.ShaderChunk.skinbase_vertex,n.ShaderChunk.skinnormal_vertex,n.ShaderChunk.defaultnormal_vertex,"#ifndef FLAT_SHADED","\tvNormal = normalize( transformedNormal );","#endif",n.ShaderChunk.begin_vertex,"#ifdef USE_PACKED_POSITION\n\t\t\t\t\t#if USE_PACKED_POSITION == 0\n\t\t\t\t\t\ttransformed = ( vec4(transformed, 1.0) * quantizeMatPos ).xyz;\n\t\t\t\t\t#endif\n\t\t\t\t#endif",n.ShaderChunk.morphtarget_vertex,n.ShaderChunk.skinning_vertex,n.ShaderChunk.displacementmap_vertex,n.ShaderChunk.project_vertex,n.ShaderChunk.logdepthbuf_vertex,n.ShaderChunk.clipping_planes_vertex,"vViewPosition = - mvPosition.xyz;",n.ShaderChunk.worldpos_vertex,n.ShaderChunk.envmap_vertex,n.ShaderChunk.shadowmap_vertex,n.ShaderChunk.fog_vertex,"}"].join("\n"),this.fragmentShader=["#define PHONG","uniform vec3 diffuse;","uniform vec3 emissive;","uniform vec3 specular;","uniform float shininess;","uniform float opacity;",n.ShaderChunk.common,n.ShaderChunk.packing,n.ShaderChunk.dithering_pars_fragment,n.ShaderChunk.color_pars_fragment,n.ShaderChunk.uv_pars_fragment,n.ShaderChunk.uv2_pars_fragment,n.ShaderChunk.map_pars_fragment,n.ShaderChunk.alphamap_pars_fragment,n.ShaderChunk.aomap_pars_fragment,n.ShaderChunk.lightmap_pars_fragment,n.ShaderChunk.emissivemap_pars_fragment,n.ShaderChunk.envmap_common_pars_fragment,n.ShaderChunk.envmap_pars_fragment,n.ShaderChunk.cube_uv_reflection_fragment,n.ShaderChunk.fog_pars_fragment,n.ShaderChunk.bsdfs,n.ShaderChunk.lights_pars_begin,n.ShaderChunk.lights_phong_pars_fragment,n.ShaderChunk.shadowmap_pars_fragment,n.ShaderChunk.bumpmap_pars_fragment,n.ShaderChunk.normalmap_pars_fragment,n.ShaderChunk.specularmap_pars_fragment,n.ShaderChunk.logdepthbuf_pars_fragment,n.ShaderChunk.clipping_planes_pars_fragment,"void main() {",n.ShaderChunk.clipping_planes_fragment,"vec4 diffuseColor = vec4( diffuse, opacity );","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );","vec3 totalEmissiveRadiance = emissive;",n.ShaderChunk.logdepthbuf_fragment,n.ShaderChunk.map_fragment,n.ShaderChunk.color_fragment,n.ShaderChunk.alphamap_fragment,n.ShaderChunk.alphatest_fragment,n.ShaderChunk.specularmap_fragment,n.ShaderChunk.normal_fragment_begin,n.ShaderChunk.normal_fragment_maps,n.ShaderChunk.emissivemap_fragment,n.ShaderChunk.lights_phong_fragment,n.ShaderChunk.lights_fragment_begin,n.ShaderChunk.lights_fragment_maps,n.ShaderChunk.lights_fragment_end,n.ShaderChunk.aomap_fragment,"vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;",n.ShaderChunk.envmap_fragment,"gl_FragColor = vec4( outgoingLight, diffuseColor.a );",n.ShaderChunk.tonemapping_fragment,n.ShaderChunk.encodings_fragment,n.ShaderChunk.fog_fragment,n.ShaderChunk.premultiplied_alpha_fragment,n.ShaderChunk.dithering_fragment,"}"].join("\n"),this.setValues(e)}}const On={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new n.Vector2}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","float penta(vec2 coords) {","\t//pentagonal shape","\tfloat scale = float(rings) - 1.3;","\tvec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","\tvec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","\tvec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","\tvec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","\tvec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","\tvec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","\tvec4 one = vec4( 1.0 );","\tvec4 P = vec4((coords),vec2(scale, scale));","\tvec4 dist = vec4(0.0);","\tfloat inorout = -4.0;","\tdist.x = dot( P, HS0 );","\tdist.y = dot( P, HS1 );","\tdist.z = dot( P, HS2 );","\tdist.w = dot( P, HS3 );","\tdist = smoothstep( -feather, feather, dist );","\tinorout += dot( dist, one );","\tdist.x = dot( P, HS4 );","\tdist.y = HS5.w - abs( P.z );","\tdist = smoothstep( -feather, feather, dist );","\tinorout += dist.x;","\treturn clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","\t// Depth buffer blur","\tfloat d = 0.0;","\tfloat kernel[9];","\tvec2 offset[9];","\tvec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","\toffset[0] = vec2(-wh.x,-wh.y);","\toffset[1] = vec2( 0.0, -wh.y);","\toffset[2] = vec2( wh.x -wh.y);","\toffset[3] = vec2(-wh.x, 0.0);","\toffset[4] = vec2( 0.0, 0.0);","\toffset[5] = vec2( wh.x, 0.0);","\toffset[6] = vec2(-wh.x, wh.y);","\toffset[7] = vec2( 0.0, wh.y);","\toffset[8] = vec2( wh.x, wh.y);","\tkernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","\tkernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","\tkernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","\tfor( int i=0; i<9; i++ ) {","\t\tfloat tmp = texture2D(tDepth, coords + offset[i]).r;","\t\td += tmp * kernel[i];","\t}","\treturn d;","}","vec3 color(vec2 coords,float blur) {","\t//processing the sample","\tvec3 col = vec3(0.0);","\tvec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","\tcol.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","\tcol.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","\tcol.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","\tvec3 lumcoeff = vec3(0.299,0.587,0.114);","\tfloat lum = dot(col.rgb, lumcoeff);","\tfloat thresh = max((lum-threshold)*gain, 0.0);","\treturn col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","\tfloat edge = 0.002*depth; //distance based edge smoothing","\tfloat m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","\tfloat e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","\tcol = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","\tcol = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","\treturn col;","}","float linearize(float depth) {","\treturn -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","\tfloat dist = distance(vUv.xy, vec2(0.5,0.5));","\tdist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","\treturn clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","\tfloat rings2 = float(rings);","\tfloat step = PI*2.0 / float(ringsamples);","\tfloat pw = cos(j*step)*i;","\tfloat ph = sin(j*step)*i;","\tfloat p = 1.0;","\tif (pentagon) {","\t\tp = penta(vec2(pw,ph));","\t}","\tcol += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","\treturn 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","\t//scene depth calculation","\tfloat depth = linearize(texture2D(tDepth,vUv.xy).x);","\t// Blur depth?","\tif ( depthblur ) {","\t\tdepth = linearize(bdepth(vUv.xy));","\t}","\t//focal plane calculation","\tfloat fDepth = focalDepth;","\tif (shaderFocus) {","\t\tfDepth = linearize(texture2D(tDepth,focusCoords).x);","\t}","\t// dof blur factor calculation","\tfloat blur = 0.0;","\tif (manualdof) {","\t\tfloat a = depth-fDepth; // Focal plane","\t\tfloat b = (a-fdofstart)/fdofdist; // Far DoF","\t\tfloat c = (-a-ndofstart)/ndofdist; // Near Dof","\t\tblur = (a>0.0) ? b : c;","\t} else {","\t\tfloat f = focalLength; // focal length in mm","\t\tfloat d = fDepth*1000.0; // focal plane in mm","\t\tfloat o = depth*1000.0; // depth in mm","\t\tfloat a = (o*f)/(o-f);","\t\tfloat b = (d*f)/(d-f);","\t\tfloat c = (d-f)/(d*fstop*CoC);","\t\tblur = abs(a-b)*c;","\t}","\tblur = clamp(blur,0.0,1.0);","\t// calculation of pattern for dithering","\tvec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","\t// getting blur x and y step factor","\tfloat w = (1.0/textureWidth)*blur*maxblur+noise.x;","\tfloat h = (1.0/textureHeight)*blur*maxblur+noise.y;","\t// calculation of final color","\tvec3 col = vec3(0.0);","\tif(blur < 0.05) {","\t\t//some optimization thingy","\t\tcol = texture2D(tColor, vUv.xy).rgb;","\t} else {","\t\tcol = texture2D(tColor, vUv.xy).rgb;","\t\tfloat s = 1.0;","\t\tint ringsamples;","\t\tfor (int i = 1; i <= rings; i++) {","\t\t\t/*unboxstart*/","\t\t\tringsamples = i * samples;","\t\t\tfor (int j = 0 ; j < maxringsamples ; j++) {","\t\t\t\tif (j >= ringsamples) break;","\t\t\t\ts += gather(float(i), float(j), ringsamples, col, w, h, blur);","\t\t\t}","\t\t\t/*unboxend*/","\t\t}","\t\tcol /= s; //divide by sample count","\t}","\tif (showFocus) {","\t\tcol = debugFocus(col, blur, depth);","\t}","\tif (vignetting) {","\t\tcol *= vignette();","\t}","\tgl_FragColor.rgb = col;","\tgl_FragColor.a = 1.0;","} "].join("\n")},Gn={uniforms:{mNear:{value:1},mFar:{value:1e3}},vertexShader:["varying float vViewZDepth;","void main() {","\t#include <begin_vertex>","\t#include <project_vertex>","\tvViewZDepth = - mvPosition.z;","}"].join("\n"),fragmentShader:["uniform float mNear;","uniform float mFar;","varying float vViewZDepth;","void main() {","\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );","\tgl_FragColor = vec4( vec3( color ), 1.0 );","} "].join("\n")};class zn extends n.PerspectiveCamera{constructor(e,t,r,i){super(e,t,r,i),this.type="CinematicCamera",this.postprocessing={enabled:!0},this.shaderSettings={rings:3,samples:4};const a=Gn;this.materialDepth=new n.ShaderMaterial({uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader}),this.materialDepth.uniforms.mNear.value=r,this.materialDepth.uniforms.mFar.value=i,this.setLens(),this.initPostProcessing()}setLens(e,t,r,n){void 0===e&&(e=35),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e),void 0===r&&(r=8),void 0===n&&(n=.019),this.fNumber=r,this.coc=n,this.aperture=e/this.fNumber,this.hyperFocal=e*e/(this.aperture*this.coc)}linearize(e){const t=this.far,r=this.near;return-t*r/(e*(t-r)-t)}smoothstep(e,t,r){const n=this.saturate((r-e)/(t-e));return n*n*(3-2*n)}saturate(e){return Math.max(0,Math.min(1,e))}focusAt(e){void 0===e&&(e=20);const t=this.getFocalLength();this.focus=e,this.nearPoint=this.hyperFocal*this.focus/(this.hyperFocal+(this.focus-t)),this.farPoint=this.hyperFocal*this.focus/(this.hyperFocal-(this.focus-t)),this.depthOfField=this.farPoint-this.nearPoint,this.depthOfField<0&&(this.depthOfField=0),this.sdistance=this.smoothstep(this.near,this.far,this.focus),this.ldistance=this.linearize(1-this.sdistance),this.postprocessing.bokeh_uniforms.focalDepth.value=this.ldistance}initPostProcessing(){if(this.postprocessing.enabled){this.postprocessing.scene=new n.Scene,this.postprocessing.camera=new n.OrthographicCamera(window.innerWidth/-2,window.innerWidth/2,window.innerHeight/2,window.innerHeight/-2,-1e4,1e4),this.postprocessing.scene.add(this.postprocessing.camera),this.postprocessing.rtTextureDepth=new n.WebGLRenderTarget(window.innerWidth,window.innerHeight),this.postprocessing.rtTextureColor=new n.WebGLRenderTarget(window.innerWidth,window.innerHeight);const e=On;this.postprocessing.bokeh_uniforms=n.UniformsUtils.clone(e.uniforms),this.postprocessing.bokeh_uniforms.tColor.value=this.postprocessing.rtTextureColor.texture,this.postprocessing.bokeh_uniforms.tDepth.value=this.postprocessing.rtTextureDepth.texture,this.postprocessing.bokeh_uniforms.manualdof.value=0,this.postprocessing.bokeh_uniforms.shaderFocus.value=0,this.postprocessing.bokeh_uniforms.fstop.value=2.8,this.postprocessing.bokeh_uniforms.showFocus.value=1,this.postprocessing.bokeh_uniforms.focalDepth.value=.1,this.postprocessing.bokeh_uniforms.znear.value=this.near,this.postprocessing.bokeh_uniforms.zfar.value=this.near,this.postprocessing.bokeh_uniforms.textureWidth.value=window.innerWidth,this.postprocessing.bokeh_uniforms.textureHeight.value=window.innerHeight,this.postprocessing.materialBokeh=new n.ShaderMaterial({uniforms:this.postprocessing.bokeh_uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,defines:{RINGS:this.shaderSettings.rings,SAMPLES:this.shaderSettings.samples,DEPTH_PACKING:1}}),this.postprocessing.quad=new n.Mesh(new n.PlaneGeometry(window.innerWidth,window.innerHeight),this.postprocessing.materialBokeh),this.postprocessing.quad.position.z=-500,this.postprocessing.scene.add(this.postprocessing.quad)}}renderCinematic(e,t){if(this.postprocessing.enabled){const r=t.getRenderTarget();t.clear(),e.overrideMaterial=null,t.setRenderTarget(this.postprocessing.rtTextureColor),t.clear(),t.render(e,this),e.overrideMaterial=this.materialDepth,t.setRenderTarget(this.postprocessing.rtTextureDepth),t.clear(),t.render(e,this),t.setRenderTarget(null),t.render(this.postprocessing.scene,this.postprocessing.camera),t.setRenderTarget(r)}}}var Vn=r(96272);const Hn={c:null,u:[new n.Vector3,new n.Vector3,new n.Vector3],e:[]},Qn={c:null,u:[new n.Vector3,new n.Vector3,new n.Vector3],e:[]},jn=[[],[],[]],Wn=[[],[],[]],Xn=[],Yn=new n.Vector3,qn=new n.Vector3,Kn=new n.Vector3,Jn=new n.Vector3,Zn=new n.Vector3,$n=new n.Vector3,ei=new n.Matrix3,ti=new n.Box3,ri=new n.Matrix4,ni=new n.Matrix4,ii=new n.Ray;class ai{constructor(e=new n.Vector3,t=new n.Vector3,r=new n.Matrix3){this.center=e,this.halfSize=t,this.rotation=r}set(e,t,r){return this.center=e,this.halfSize=t,this.rotation=r,this}copy(e){return this.center.copy(e.center),this.halfSize.copy(e.halfSize),this.rotation.copy(e.rotation),this}clone(){return(new this.constructor).copy(this)}getSize(e){return e.copy(this.halfSize).multiplyScalar(2)}clampPoint(e,t){const r=this.halfSize;Jn.subVectors(e,this.center),this.rotation.extractBasis(Yn,qn,Kn),t.copy(this.center);const i=n.MathUtils.clamp(Jn.dot(Yn),-r.x,r.x);t.add(Yn.multiplyScalar(i));const a=n.MathUtils.clamp(Jn.dot(qn),-r.y,r.y);t.add(qn.multiplyScalar(a));const s=n.MathUtils.clamp(Jn.dot(Kn),-r.z,r.z);return t.add(Kn.multiplyScalar(s)),t}containsPoint(e){return Jn.subVectors(e,this.center),this.rotation.extractBasis(Yn,qn,Kn),Math.abs(Jn.dot(Yn))<=this.halfSize.x&&Math.abs(Jn.dot(qn))<=this.halfSize.y&&Math.abs(Jn.dot(Kn))<=this.halfSize.z}intersectsBox3(e){return this.intersectsOBB(si.fromBox3(e))}intersectsSphere(e){return this.clampPoint(e.center,$n),$n.distanceToSquared(e.center)<=e.radius*e.radius}intersectsOBB(e,t=Number.EPSILON){Hn.c=this.center,Hn.e[0]=this.halfSize.x,Hn.e[1]=this.halfSize.y,Hn.e[2]=this.halfSize.z,this.rotation.extractBasis(Hn.u[0],Hn.u[1],Hn.u[2]),Qn.c=e.center,Qn.e[0]=e.halfSize.x,Qn.e[1]=e.halfSize.y,Qn.e[2]=e.halfSize.z,e.rotation.extractBasis(Qn.u[0],Qn.u[1],Qn.u[2]);for(let i=0;i<3;i++)for(let e=0;e<3;e++)jn[i][e]=Hn.u[i].dot(Qn.u[e]);Jn.subVectors(Qn.c,Hn.c),Xn[0]=Jn.dot(Hn.u[0]),Xn[1]=Jn.dot(Hn.u[1]),Xn[2]=Jn.dot(Hn.u[2]);for(let i=0;i<3;i++)for(let e=0;e<3;e++)Wn[i][e]=Math.abs(jn[i][e])+t;let r,n;for(let i=0;i<3;i++)if(r=Hn.e[i],n=Qn.e[0]*Wn[i][0]+Qn.e[1]*Wn[i][1]+Qn.e[2]*Wn[i][2],Math.abs(Xn[i])>r+n)return!1;for(let i=0;i<3;i++)if(r=Hn.e[0]*Wn[0][i]+Hn.e[1]*Wn[1][i]+Hn.e[2]*Wn[2][i],n=Qn.e[i],Math.abs(Xn[0]*jn[0][i]+Xn[1]*jn[1][i]+Xn[2]*jn[2][i])>r+n)return!1;return r=Hn.e[1]*Wn[2][0]+Hn.e[2]*Wn[1][0],n=Qn.e[1]*Wn[0][2]+Qn.e[2]*Wn[0][1],!(Math.abs(Xn[2]*jn[1][0]-Xn[1]*jn[2][0])>r+n)&&(r=Hn.e[1]*Wn[2][1]+Hn.e[2]*Wn[1][1],n=Qn.e[0]*Wn[0][2]+Qn.e[2]*Wn[0][0],!(Math.abs(Xn[2]*jn[1][1]-Xn[1]*jn[2][1])>r+n)&&(r=Hn.e[1]*Wn[2][2]+Hn.e[2]*Wn[1][2],n=Qn.e[0]*Wn[0][1]+Qn.e[1]*Wn[0][0],!(Math.abs(Xn[2]*jn[1][2]-Xn[1]*jn[2][2])>r+n)&&(r=Hn.e[0]*Wn[2][0]+Hn.e[2]*Wn[0][0],n=Qn.e[1]*Wn[1][2]+Qn.e[2]*Wn[1][1],!(Math.abs(Xn[0]*jn[2][0]-Xn[2]*jn[0][0])>r+n)&&(r=Hn.e[0]*Wn[2][1]+Hn.e[2]*Wn[0][1],n=Qn.e[0]*Wn[1][2]+Qn.e[2]*Wn[1][0],!(Math.abs(Xn[0]*jn[2][1]-Xn[2]*jn[0][1])>r+n)&&(r=Hn.e[0]*Wn[2][2]+Hn.e[2]*Wn[0][2],n=Qn.e[0]*Wn[1][1]+Qn.e[1]*Wn[1][0],!(Math.abs(Xn[0]*jn[2][2]-Xn[2]*jn[0][2])>r+n)&&(r=Hn.e[0]*Wn[1][0]+Hn.e[1]*Wn[0][0],n=Qn.e[1]*Wn[2][2]+Qn.e[2]*Wn[2][1],!(Math.abs(Xn[1]*jn[0][0]-Xn[0]*jn[1][0])>r+n)&&(r=Hn.e[0]*Wn[1][1]+Hn.e[1]*Wn[0][1],n=Qn.e[0]*Wn[2][2]+Qn.e[2]*Wn[2][0],!(Math.abs(Xn[1]*jn[0][1]-Xn[0]*jn[1][1])>r+n)&&(r=Hn.e[0]*Wn[1][2]+Hn.e[1]*Wn[0][2],n=Qn.e[0]*Wn[2][1]+Qn.e[1]*Wn[2][0],!(Math.abs(Xn[1]*jn[0][2]-Xn[0]*jn[1][2])>r+n)))))))))}intersectsPlane(e){this.rotation.extractBasis(Yn,qn,Kn);const t=this.halfSize.x*Math.abs(e.normal.dot(Yn))+this.halfSize.y*Math.abs(e.normal.dot(qn))+this.halfSize.z*Math.abs(e.normal.dot(Kn)),r=e.normal.dot(this.center)-e.constant;return Math.abs(r)<=t}intersectRay(e,t){return this.getSize(Zn),ti.setFromCenterAndSize(Jn.set(0,0,0),Zn),ri.setFromMatrix3(this.rotation),ri.setPosition(this.center),ni.copy(ri).invert(),ii.copy(e).applyMatrix4(ni),ii.intersectBox(ti,t)?t.applyMatrix4(ri):null}intersectsRay(e){return null!==this.intersectRay(e,Jn)}fromBox3(e){return e.getCenter(this.center),e.getSize(this.halfSize).multiplyScalar(.5),this.rotation.identity(),this}equals(e){return e.center.equals(this.center)&&e.halfSize.equals(this.halfSize)&&e.rotation.equals(this.rotation)}applyMatrix4(e){const t=e.elements;let r=Jn.set(t[0],t[1],t[2]).length();const n=Jn.set(t[4],t[5],t[6]).length(),i=Jn.set(t[8],t[9],t[10]).length();e.determinant()<0&&(r=-r),ei.setFromMatrix4(e);const a=1/r,s=1/n,o=1/i;return ei.elements[0]*=a,ei.elements[1]*=a,ei.elements[2]*=a,ei.elements[3]*=s,ei.elements[4]*=s,ei.elements[5]*=s,ei.elements[6]*=o,ei.elements[7]*=o,ei.elements[8]*=o,this.rotation.multiply(ei),this.halfSize.x*=r,this.halfSize.y*=n,this.halfSize.z*=i,Jn.setFromMatrixPosition(e),this.center.add(Jn),this}}const si=new ai,oi=new n.Vector3,li=new n.Vector3,ci=new n.Vector3;class ui{constructor(e=new n.Vector3(0,0,0),t=new n.Vector3(0,1,0),r=1){this.start=e,this.end=t,this.radius=r}clone(){return new ui(this.start.clone(),this.end.clone(),this.radius)}set(e,t,r){this.start.copy(e),this.end.copy(t),this.radius=r}copy(e){this.start.copy(e.start),this.end.copy(e.end),this.radius=e.radius}getCenter(e){return e.copy(this.end).add(this.start).multiplyScalar(.5)}translate(e){this.start.add(e),this.end.add(e)}checkAABBAxis(e,t,r,n,i,a,s,o,l){return(i-e<l||i-r<l)&&(e-a<l||r-a<l)&&(s-t<l||s-n<l)&&(t-o<l||n-o<l)}intersectsBox(e){return this.checkAABBAxis(this.start.x,this.start.y,this.end.x,this.end.y,e.min.x,e.max.x,e.min.y,e.max.y,this.radius)&&this.checkAABBAxis(this.start.x,this.start.z,this.end.x,this.end.z,e.min.x,e.max.x,e.min.z,e.max.z,this.radius)&&this.checkAABBAxis(this.start.y,this.start.z,this.end.y,this.end.z,e.min.y,e.max.y,e.min.z,e.max.z,this.radius)}lineLineMinimumPoints(e,t){const r=oi.copy(e.end).sub(e.start),n=li.copy(t.end).sub(t.start),i=ci.copy(t.start).sub(e.start),a=r.dot(n),s=r.dot(r),o=n.dot(n),l=n.dot(i),c=r.dot(i);let u,h;const d=s*o-a*a;if(Math.abs(d)<1e-10){const e=-l/o,t=(a-l)/o;Math.abs(e-.5)<Math.abs(t-.5)?(u=0,h=e):(u=1,h=t)}else u=(l*a+c*o)/d,h=(u*a-l)/o;h=Math.max(0,Math.min(1,h)),u=Math.max(0,Math.min(1,u));return[r.multiplyScalar(u).add(e.start),n.multiplyScalar(h).add(t.start)]}}const hi={};class di{static setHSV(e,t,r,i){return t=n.MathUtils.euclideanModulo(t,1),r=n.MathUtils.clamp(r,0,1),i=n.MathUtils.clamp(i,0,1),e.setHSL(t,r*i/((t=(2-r)*i)<1?t:2-t),.5*t)}static getHSV(e,t){return e.getHSL(hi),hi.s*=hi.l<.5?hi.l:1-hi.l,t.h=hi.h,t.s=2*hi.s/(hi.l+hi.s),t.v=hi.l+hi.s,t}static setCMYK(e,t,r,n,i){const a=(1-t)*(1-i),s=(1-r)*(1-i),o=(1-n)*(1-i);return e.setRGB(a,s,o)}static getCMYK(e,t){const r=e.r,n=e.g,i=e.b,a=1-Math.max(r,n,i),s=(1-r-a)/(1-a),o=(1-n-a)/(1-a),l=(1-i-a)/(1-a);return t.c=s,t.m=o,t.y=l,t.k=a,t}}function pi(){const e=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];for(let t=0;t<256;t++)e[256+t]=e[t];return e}const fi=pi();function mi(e){return e*e*e*(e*(6*e-15)+10)}function gi(e,t,r){return t+e*(r-t)}function vi(e,t,r,n){const i=15&e,a=i<8?t:r,s=i<4?r:12==i||14==i?t:n;return(0==(1&i)?a:-a)+(0==(2&i)?s:-s)}class Ai{noise(e,t,r){const n=Math.floor(e),i=Math.floor(t),a=Math.floor(r),s=255&n,o=255&i,l=255&a,c=(e-=n)-1,u=(t-=i)-1,h=(r-=a)-1,d=mi(e),p=mi(t),f=mi(r),m=fi[s]+o,g=fi[m]+l,v=fi[m+1]+l,A=fi[s+1]+o,y=fi[A]+l,x=fi[A+1]+l;return gi(f,gi(p,gi(d,vi(fi[g],e,t,r),vi(fi[y],c,t,r)),gi(d,vi(fi[v],e,u,r),vi(fi[x],c,u,r))),gi(p,gi(d,vi(fi[g+1],e,t,h),vi(fi[y+1],c,t,h)),gi(d,vi(fi[v+1],e,u,h),vi(fi[x+1],c,u,h))))}}const yi=new n.Vector3,xi=new n.Vector3,bi=new n.Plane,wi=new n.Line3,Ei=new n.Line3,Si=new n.Sphere,Mi=new ui;class _i{constructor(e){this.triangles=[],this.box=e,this.subTrees=[]}addTriangle(e){return this.bounds||(this.bounds=new n.Box3),this.bounds.min.x=Math.min(this.bounds.min.x,e.a.x,e.b.x,e.c.x),this.bounds.min.y=Math.min(this.bounds.min.y,e.a.y,e.b.y,e.c.y),this.bounds.min.z=Math.min(this.bounds.min.z,e.a.z,e.b.z,e.c.z),this.bounds.max.x=Math.max(this.bounds.max.x,e.a.x,e.b.x,e.c.x),this.bounds.max.y=Math.max(this.bounds.max.y,e.a.y,e.b.y,e.c.y),this.bounds.max.z=Math.max(this.bounds.max.z,e.a.z,e.b.z,e.c.z),this.triangles.push(e),this}calcBox(){return this.box=this.bounds.clone(),this.box.min.x-=.01,this.box.min.y-=.01,this.box.min.z-=.01,this}split(e){if(!this.box)return;const t=[],r=xi.copy(this.box.max).sub(this.box.min).multiplyScalar(.5);for(let a=0;a<2;a++)for(let e=0;e<2;e++)for(let i=0;i<2;i++){const s=new n.Box3,o=yi.set(a,e,i);s.min.copy(this.box.min).add(o.multiply(r)),s.max.copy(s.min).add(r),t.push(new _i(s))}let i;for(;i=this.triangles.pop();)for(let e=0;e<t.length;e++)t[e].box.intersectsTriangle(i)&&t[e].triangles.push(i);for(let n=0;n<t.length;n++){const r=t[n].triangles.length;r>8&&e<16&&t[n].split(e+1),0!==r&&this.subTrees.push(t[n])}return this}build(){return this.calcBox(),this.split(0),this}getRayTriangles(e,t){for(let r=0;r<this.subTrees.length;r++){const n=this.subTrees[r];if(e.intersectsBox(n.box))if(n.triangles.length>0)for(let e=0;e<n.triangles.length;e++)-1===t.indexOf(n.triangles[e])&&t.push(n.triangles[e]);else n.getRayTriangles(e,t)}return t}triangleCapsuleIntersect(e,t){t.getPlane(bi);const r=bi.distanceToPoint(e.start)-e.radius,n=bi.distanceToPoint(e.end)-e.radius;if(r>0&&n>0||r<-e.radius&&n<-e.radius)return!1;const i=Math.abs(r/(Math.abs(r)+Math.abs(n))),a=yi.copy(e.start).lerp(e.end,i);if(t.containsPoint(a))return{normal:bi.normal.clone(),point:a.clone(),depth:Math.abs(Math.min(r,n))};const s=e.radius*e.radius,o=wi.set(e.start,e.end),l=[[t.a,t.b],[t.b,t.c],[t.c,t.a]];for(let c=0;c<l.length;c++){const t=Ei.set(l[c][0],l[c][1]),[r,n]=e.lineLineMinimumPoints(o,t);if(r.distanceToSquared(n)<s)return{normal:r.clone().sub(n).normalize(),point:n.clone(),depth:e.radius-r.distanceTo(n)}}return!1}triangleSphereIntersect(e,t){if(t.getPlane(bi),!e.intersectsPlane(bi))return!1;const r=Math.abs(bi.distanceToSphere(e)),n=e.radius*e.radius-r*r,i=bi.projectPoint(e.center,yi);if(t.containsPoint(e.center))return{normal:bi.normal.clone(),point:i.clone(),depth:Math.abs(bi.distanceToSphere(e))};const a=[[t.a,t.b],[t.b,t.c],[t.c,t.a]];for(let s=0;s<a.length;s++){wi.set(a[s][0],a[s][1]),wi.closestPointToPoint(i,!0,xi);const t=xi.distanceToSquared(e.center);if(t<n)return{normal:e.center.clone().sub(xi).normalize(),point:xi.clone(),depth:e.radius-Math.sqrt(t)}}return!1}getSphereTriangles(e,t){for(let r=0;r<this.subTrees.length;r++){const n=this.subTrees[r];if(e.intersectsBox(n.box))if(n.triangles.length>0)for(let e=0;e<n.triangles.length;e++)-1===t.indexOf(n.triangles[e])&&t.push(n.triangles[e]);else n.getSphereTriangles(e,t)}}getCapsuleTriangles(e,t){for(let r=0;r<this.subTrees.length;r++){const n=this.subTrees[r];if(e.intersectsBox(n.box))if(n.triangles.length>0)for(let e=0;e<n.triangles.length;e++)-1===t.indexOf(n.triangles[e])&&t.push(n.triangles[e]);else n.getCapsuleTriangles(e,t)}}sphereIntersect(e){Si.copy(e);const t=[];let r,n=!1;this.getSphereTriangles(e,t);for(let i=0;i<t.length;i++)(r=this.triangleSphereIntersect(Si,t[i]))&&(n=!0,Si.center.add(r.normal.multiplyScalar(r.depth)));if(n){const t=Si.center.clone().sub(e.center),r=t.length();return{normal:t.normalize(),depth:r}}return!1}capsuleIntersect(e){Mi.copy(e);const t=[];let r,i=!1;this.getCapsuleTriangles(Mi,t);for(let n=0;n<t.length;n++)(r=this.triangleCapsuleIntersect(Mi,t[n]))&&(i=!0,Mi.translate(r.normal.multiplyScalar(r.depth)));if(i){const t=Mi.getCenter(new n.Vector3).sub(e.getCenter(yi)),r=t.length();return{normal:t.normalize(),depth:r}}return!1}rayIntersect(e){if(0===e.direction.length())return;const t=[];let r,n,i=1e100;this.getRayTriangles(e,t);for(let a=0;a<t.length;a++){const s=e.intersectTriangle(t[a].a,t[a].b,t[a].c,!0,yi);if(s){const o=s.sub(e.origin).length();i>o&&(n=s.clone().add(e.origin),i=o,r=t[a])}}return i<1e100&&{distance:i,triangle:r,position:n}}fromGraphNode(e){return e.updateWorldMatrix(!0,!0),e.traverse((e=>{if(!0===e.isMesh){let t,r=!1;null!==e.geometry.index?(r=!0,t=e.geometry.toNonIndexed()):t=e.geometry;const i=t.getAttribute("position");for(let a=0;a<i.count;a+=3){const t=(new n.Vector3).fromBufferAttribute(i,a),r=(new n.Vector3).fromBufferAttribute(i,a+1),s=(new n.Vector3).fromBufferAttribute(i,a+2);t.applyMatrix4(e.matrixWorld),r.applyMatrix4(e.matrixWorld),s.applyMatrix4(e.matrixWorld),this.addTriangle(new n.Triangle(t,r,s))}r&&t.dispose()}})),this.build(),this}}class Ti{constructor(e,t=32){this.isLut=!0,this.lut=[],this.map=[],this.n=0,this.minV=0,this.maxV=1,this.setColorMap(e,t)}set(e){return!0===e.isLut&&this.copy(e),this}setMin(e){return this.minV=e,this}setMax(e){return this.maxV=e,this}setColorMap(e,t=32){this.map=Ci[e]||Ci.rainbow,this.n=t;const r=1/this.n,i=new n.Color,a=new n.Color;this.lut.length=0,this.lut.push(new n.Color(this.map[0][1]));for(let s=1;s<t;s++){const e=s*r;for(let t=0;t<this.map.length-1;t++)if(e>this.map[t][0]&&e<=this.map[t+1][0]){const r=this.map[t][0],s=this.map[t+1][0];i.setHex(this.map[t][1],"linear-srgb"),a.setHex(this.map[t+1][1],"linear-srgb");const o=(new n.Color).lerpColors(i,a,(e-r)/(s-r));this.lut.push(o)}}return this.lut.push(new n.Color(this.map[this.map.length-1][1])),this}copy(e){return this.lut=e.lut,this.map=e.map,this.n=e.n,this.minV=e.minV,this.maxV=e.maxV,this}getColor(e){e=((e=n.MathUtils.clamp(e,this.minV,this.maxV))-this.minV)/(this.maxV-this.minV);const t=Math.round(e*this.n);return this.lut[t]}addColorMap(e,t){return Ci[e]=t,this}createCanvas(){const e=document.createElement("canvas");return e.width=1,e.height=this.n,this.updateCanvas(e),e}updateCanvas(e){const t=e.getContext("2d",{alpha:!1}),r=t.getImageData(0,0,1,this.n),i=r.data;let a=0;const s=1/this.n,o=new n.Color,l=new n.Color,c=new n.Color;for(let n=1;n>=0;n-=s)for(let e=this.map.length-1;e>=0;e--)if(n<this.map[e][0]&&n>=this.map[e-1][0]){const t=this.map[e-1][0],r=this.map[e][0];o.setHex(this.map[e-1][1],"linear-srgb"),l.setHex(this.map[e][1],"linear-srgb"),c.lerpColors(o,l,(n-t)/(r-t)),i[4*a]=Math.round(255*c.r),i[4*a+1]=Math.round(255*c.g),i[4*a+2]=Math.round(255*c.b),i[4*a+3]=255,a+=1}return t.putImageData(r,0,0),e}}const Ci={rainbow:[[0,255],[.2,65535],[.5,65280],[.8,16776960],[1,16711680]],cooltowarm:[[0,3952322],[.2,10206463],[.5,14474460],[.8,16163717],[1,11797542]],blackbody:[[0,0],[.2,7864320],[.5,15086080],[.8,16776960],[1,16777215]],grayscale:[[0,0],[.2,4210752],[.5,8355712],[.8,12566463],[1,16777215]]};var Ii=Object.defineProperty,Bi=(e,t,r)=>(((e,t,r)=>{t in e?Ii(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),Ri=(e=>(e[e.NONE=-1]="NONE",e[e.ROTATE=0]="ROTATE",e[e.DOLLY=1]="DOLLY",e[e.PAN=2]="PAN",e[e.TOUCH_ROTATE=3]="TOUCH_ROTATE",e[e.TOUCH_PAN=4]="TOUCH_PAN",e[e.TOUCH_DOLLY_PAN=5]="TOUCH_DOLLY_PAN",e[e.TOUCH_DOLLY_ROTATE=6]="TOUCH_DOLLY_ROTATE",e))(Ri||{});class Pi extends n.EventDispatcher{constructor(e,t){super(),Bi(this,"object"),Bi(this,"domElement"),Bi(this,"enabled",!0),Bi(this,"target",new n.Vector3),Bi(this,"trackball",!1),Bi(this,"minDistance",0),Bi(this,"maxDistance",1/0),Bi(this,"minZoom",0),Bi(this,"maxZoom",1/0),Bi(this,"minPolarAngle",0),Bi(this,"maxPolarAngle",Math.PI),Bi(this,"minAzimuthAngle",-1/0),Bi(this,"maxAzimuthAngle",1/0),Bi(this,"enableDamping",!1),Bi(this,"dampingFactor",.05),Bi(this,"enableZoom",!0),Bi(this,"zoomSpeed",1),Bi(this,"enableRotate",!0),Bi(this,"rotateSpeed",1),Bi(this,"enablePan",!0),Bi(this,"panSpeed",1),Bi(this,"screenSpacePanning",!1),Bi(this,"keyPanSpeed",7),Bi(this,"autoRotate",!1),Bi(this,"autoRotateSpeed",2),Bi(this,"enableKeys",!0),Bi(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Bi(this,"mouseButtons"),Bi(this,"touches",{ONE:n.TOUCH.ROTATE,TWO:n.TOUCH.DOLLY_PAN}),Bi(this,"target0"),Bi(this,"position0"),Bi(this,"quaternion0"),Bi(this,"zoom0"),Bi(this,"spherical",new n.Spherical),Bi(this,"sphericalDelta",new n.Spherical),Bi(this,"changeEvent",{type:"change"}),Bi(this,"startEvent",{type:"start"}),Bi(this,"endEvent",{type:"end"}),Bi(this,"state",-1),Bi(this,"EPS",1e-6),Bi(this,"scale",1),Bi(this,"panOffset",new n.Vector3),Bi(this,"zoomChanged",!1),Bi(this,"rotateStart",new n.Vector2),Bi(this,"rotateEnd",new n.Vector2),Bi(this,"rotateDelta",new n.Vector2),Bi(this,"panStart",new n.Vector2),Bi(this,"panEnd",new n.Vector2),Bi(this,"panDelta",new n.Vector2),Bi(this,"dollyStart",new n.Vector2),Bi(this,"dollyEnd",new n.Vector2),Bi(this,"dollyDelta",new n.Vector2),Bi(this,"offset",new n.Vector3),Bi(this,"lastPosition",new n.Vector3),Bi(this,"lastQuaternion",new n.Quaternion),Bi(this,"q",new n.Quaternion),Bi(this,"v",new n.Vector3),Bi(this,"vec",new n.Vector3),Bi(this,"quat"),Bi(this,"quatInverse"),Bi(this,"getPolarAngle",(()=>this.spherical.phi)),Bi(this,"getAzimuthalAngle",(()=>this.spherical.theta)),Bi(this,"saveState",(()=>{this.target0.copy(this.target),this.position0.copy(this.object.position),this.quaternion0.copy(this.object.quaternion),this.zoom0=this.object.zoom})),Bi(this,"reset",(()=>{this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.quaternion.copy(this.quaternion0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(this.changeEvent),this.update(),this.state=-1})),Bi(this,"dispose",(()=>{this.domElement.removeEventListener("contextmenu",this.onContextMenu,!1),this.domElement.removeEventListener("mousedown",this.onMouseDown,!1),this.domElement.removeEventListener("wheel",this.onMouseWheel,!1),this.domElement.removeEventListener("touchstart",this.onTouchStart,!1),this.domElement.removeEventListener("touchend",this.onTouchEnd,!1),this.domElement.removeEventListener("touchmove",this.onTouchMove,!1),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),this.domElement.removeEventListener("keydown",this.onKeyDown,!1)})),Bi(this,"update",(()=>{const e=this.object.position;if(this.offset.copy(e).sub(this.target),this.trackball){if(this.sphericalDelta.theta){this.vec.set(0,1,0).applyQuaternion(this.object.quaternion);const e=this.enableDamping?this.dampingFactor:1;this.q.setFromAxisAngle(this.vec,this.sphericalDelta.theta*e),this.object.quaternion.premultiply(this.q),this.offset.applyQuaternion(this.q)}if(this.sphericalDelta.phi){this.vec.set(1,0,0).applyQuaternion(this.object.quaternion);const e=this.enableDamping?this.dampingFactor:1;this.q.setFromAxisAngle(this.vec,this.sphericalDelta.phi*e),this.object.quaternion.premultiply(this.q),this.offset.applyQuaternion(this.q)}this.offset.multiplyScalar(this.scale),this.offset.clampLength(this.minDistance,this.maxDistance)}else this.offset.applyQuaternion(this.quat),this.autoRotate&&-1===this.state&&this.rotateLeft(this.getAutoRotationAngle()),this.spherical.setFromVector3(this.offset),this.enableDamping?(this.spherical.theta+=this.sphericalDelta.theta*this.dampingFactor,this.spherical.phi+=this.sphericalDelta.phi*this.dampingFactor):(this.spherical.theta+=this.sphericalDelta.theta,this.spherical.phi+=this.sphericalDelta.phi),this.spherical.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this.spherical.theta)),this.spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this.spherical.phi)),this.spherical.makeSafe(),this.spherical.radius*=this.scale,this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius)),this.offset.setFromSpherical(this.spherical),this.offset.applyQuaternion(this.quatInverse);return!0===this.enableDamping?this.target.addScaledVector(this.panOffset,this.dampingFactor):this.target.add(this.panOffset),e.copy(this.target).add(this.offset),!1===this.trackball&&this.object.lookAt(this.target),!0===this.enableDamping?(this.sphericalDelta.theta*=1-this.dampingFactor,this.sphericalDelta.phi*=1-this.dampingFactor,this.panOffset.multiplyScalar(1-this.dampingFactor)):(this.sphericalDelta.set(0,0,0),this.panOffset.set(0,0,0)),this.scale=1,!!(this.zoomChanged||this.lastPosition.distanceToSquared(this.object.position)>this.EPS||8*(1-this.lastQuaternion.dot(this.object.quaternion))>this.EPS)&&(this.dispatchEvent(this.changeEvent),this.lastPosition.copy(this.object.position),this.lastQuaternion.copy(this.object.quaternion),this.zoomChanged=!1,!0)})),Bi(this,"getAutoRotationAngle",(()=>2*Math.PI/60/60*this.autoRotateSpeed)),Bi(this,"getZoomScale",(()=>Math.pow(.95,this.zoomSpeed))),Bi(this,"rotateLeft",(e=>{this.sphericalDelta.theta-=e})),Bi(this,"rotateUp",(e=>{this.sphericalDelta.phi-=e})),Bi(this,"panLeft",((e,t)=>{this.v.setFromMatrixColumn(t,0),this.v.multiplyScalar(-e),this.panOffset.add(this.v)})),Bi(this,"panUp",((e,t)=>{!0===this.screenSpacePanning?this.v.setFromMatrixColumn(t,1):(this.v.setFromMatrixColumn(t,0),this.v.crossVectors(this.object.up,this.v)),this.v.multiplyScalar(e),this.panOffset.add(this.v)})),Bi(this,"pan",((e,t)=>{const r=this.domElement;if(this.object instanceof n.PerspectiveCamera){const n=this.object.position;this.offset.copy(n).sub(this.target);let i=this.offset.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*e*i/r.clientHeight,this.object.matrix),this.panUp(2*t*i/r.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this.panLeft(e*(this.object.right-this.object.left)/this.object.zoom/r.clientWidth,this.object.matrix),this.panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/r.clientHeight,this.object.matrix)):(console.warn("WARNING: CameraControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)})),Bi(this,"dollyIn",(e=>{this.object instanceof n.PerspectiveCamera?this.scale/=e:this.object instanceof n.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*e)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: CameraControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)})),Bi(this,"dollyOut",(e=>{this.object instanceof n.PerspectiveCamera?this.scale*=e:this.object instanceof n.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/e)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: CameraControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)})),Bi(this,"handleMouseDownRotate",(e=>{this.rotateStart.set(e.clientX,e.clientY)})),Bi(this,"handleMouseDownDolly",(e=>{this.dollyStart.set(e.clientX,e.clientY)})),Bi(this,"handleMouseDownPan",(e=>{this.panStart.set(e.clientX,e.clientY)})),Bi(this,"handleMouseMoveRotate",(e=>{this.rotateEnd.set(e.clientX,e.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this.rotateLeft(2*Math.PI*this.rotateDelta.x/t.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/t.clientHeight),this.rotateStart.copy(this.rotateEnd),this.update()})),Bi(this,"handleMouseMoveDolly",(e=>{this.dollyEnd.set(e.clientX,e.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyIn(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyOut(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()})),Bi(this,"handleMouseMovePan",(e=>{this.panEnd.set(e.clientX,e.clientY),this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd),this.update()})),Bi(this,"handleMouseWheel",(e=>{e.deltaY<0?this.dollyOut(this.getZoomScale()):e.deltaY>0&&this.dollyIn(this.getZoomScale()),this.update()})),Bi(this,"handleKeyDown",(e=>{let t=!1;switch(e.code){case this.keys.UP:this.pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:this.pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:this.pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:this.pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())})),Bi(this,"handleTouchStartRotate",(e=>{if(1==e.touches.length)this.rotateStart.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),r=.5*(e.touches[0].pageY+e.touches[1].pageY);this.rotateStart.set(t,r)}})),Bi(this,"handleTouchStartPan",(e=>{if(1==e.touches.length)this.panStart.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),r=.5*(e.touches[0].pageY+e.touches[1].pageY);this.panStart.set(t,r)}})),Bi(this,"handleTouchStartDolly",(e=>{const t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,n=Math.sqrt(t*t+r*r);this.dollyStart.set(0,n)})),Bi(this,"handleTouchStartDollyPan",(e=>{this.enableZoom&&this.handleTouchStartDolly(e),this.enablePan&&this.handleTouchStartPan(e)})),Bi(this,"handleTouchStartDollyRotate",(e=>{this.enableZoom&&this.handleTouchStartDolly(e),this.enableRotate&&this.handleTouchStartRotate(e)})),Bi(this,"handleTouchMoveRotate",(e=>{if(1==e.touches.length)this.rotateEnd.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),r=.5*(e.touches[0].pageY+e.touches[1].pageY);this.rotateEnd.set(t,r)}this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this.rotateLeft(2*Math.PI*this.rotateDelta.x/t.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/t.clientHeight),this.rotateStart.copy(this.rotateEnd)})),Bi(this,"handleTouchMovePan",(e=>{if(1==e.touches.length)this.panEnd.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),r=.5*(e.touches[0].pageY+e.touches[1].pageY);this.panEnd.set(t,r)}this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)})),Bi(this,"handleTouchMoveDolly",(e=>{const t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,n=Math.sqrt(t*t+r*r);this.dollyEnd.set(0,n),this.dollyDelta.set(0,Math.pow(this.dollyEnd.y/this.dollyStart.y,this.zoomSpeed)),this.dollyIn(this.dollyDelta.y),this.dollyStart.copy(this.dollyEnd)})),Bi(this,"handleTouchMoveDollyPan",(e=>{this.enableZoom&&this.handleTouchMoveDolly(e),this.enablePan&&this.handleTouchMovePan(e)})),Bi(this,"handleTouchMoveDollyRotate",(e=>{this.enableZoom&&this.handleTouchMoveDolly(e),this.enableRotate&&this.handleTouchMoveRotate(e)})),Bi(this,"onMouseDown",(e=>{if(!1===this.enabled)return;let t;switch(e.preventDefault(),this.domElement.focus?this.domElement.focus():window.focus(),e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case n.MOUSE.DOLLY:if(!1===this.enableZoom)return;this.handleMouseDownDolly(e),this.state=1;break;case n.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enablePan)return;this.handleMouseDownPan(e),this.state=2}else{if(!1===this.enableRotate)return;this.handleMouseDownRotate(e),this.state=0}break;case n.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enableRotate)return;this.handleMouseDownRotate(e),this.state=0}else{if(!1===this.enablePan)return;this.handleMouseDownPan(e),this.state=2}break;default:this.state=-1}-1!==this.state&&(document.addEventListener("mousemove",this.onMouseMove,!1),document.addEventListener("mouseup",this.onMouseUp,!1),this.dispatchEvent(this.startEvent))})),Bi(this,"onMouseMove",(e=>{if(!1!==this.enabled)switch(e.preventDefault(),this.state){case 0:if(!1===this.enableRotate)return;this.handleMouseMoveRotate(e);break;case 1:if(!1===this.enableZoom)return;this.handleMouseMoveDolly(e);break;case 2:if(!1===this.enablePan)return;this.handleMouseMovePan(e)}})),Bi(this,"onMouseUp",(()=>{!1!==this.enabled&&(document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),this.dispatchEvent(this.endEvent),this.state=-1)})),Bi(this,"onMouseWheel",(e=>{!1===this.enabled||!1===this.enableZoom||-1!==this.state&&0!==this.state||(e.preventDefault(),this.dispatchEvent(this.startEvent),this.handleMouseWheel(e),this.dispatchEvent(this.endEvent))})),Bi(this,"onKeyDown",(e=>{!1!==this.enabled&&!1!==this.enableKeys&&!1!==this.enablePan&&this.handleKeyDown(e)})),Bi(this,"onTouchStart",(e=>{if(!1!==this.enabled){switch(e.preventDefault(),e.touches.length){case 1:switch(this.touches.ONE){case n.TOUCH.ROTATE:if(!1===this.enableRotate)return;this.handleTouchStartRotate(e),this.state=3;break;case n.TOUCH.PAN:if(!1===this.enablePan)return;this.handleTouchStartPan(e),this.state=4;break;default:this.state=-1}break;case 2:switch(this.touches.TWO){case n.TOUCH.DOLLY_PAN:if(!1===this.enableZoom&&!1===this.enablePan)return;this.handleTouchStartDollyPan(e),this.state=5;break;case n.TOUCH.DOLLY_ROTATE:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchStartDollyRotate(e),this.state=6;break;default:this.state=-1}break;default:this.state=-1}-1!==this.state&&this.dispatchEvent(this.startEvent)}})),Bi(this,"onTouchMove",(e=>{if(!1!==this.enabled)switch(e.preventDefault(),this.state){case 3:if(!1===this.enableRotate)return;this.handleTouchMoveRotate(e),this.update();break;case 4:if(!1===this.enablePan)return;this.handleTouchMovePan(e),this.update();break;case 5:if(!1===this.enableZoom&&!1===this.enablePan)return;this.handleTouchMoveDollyPan(e),this.update();break;case 6:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchMoveDollyRotate(e),this.update();break;default:this.state=-1}})),Bi(this,"onTouchEnd",(()=>{!1!==this.enabled&&(this.dispatchEvent(this.endEvent),this.state=-1)})),Bi(this,"onContextMenu",(e=>{!1!==this.enabled&&e.preventDefault()})),void 0===t&&console.warn('THREE.CameraControls: The second parameter "domElement" is now mandatory.'),t instanceof Document&&console.error('THREE.CameraControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.mouseButtons={LEFT:n.MOUSE.ROTATE,MIDDLE:n.MOUSE.DOLLY,RIGHT:n.MOUSE.PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.quaternion0=this.object.quaternion.clone(),this.zoom0=this.object.zoom,this.quat=(new n.Quaternion).setFromUnitVectors(this.object.up,new n.Vector3(0,1,0)),this.quatInverse=this.quat.clone().invert(),this.lastPosition=new n.Vector3,this.lastQuaternion=new n.Quaternion,this.domElement.addEventListener("contextmenu",this.onContextMenu,!1),this.domElement.addEventListener("mousedown",this.onMouseDown,!1),this.domElement.addEventListener("wheel",this.onMouseWheel,!1),this.domElement.addEventListener("touchstart",this.onTouchStart,!1),this.domElement.addEventListener("touchend",this.onTouchEnd,!1),this.domElement.addEventListener("touchmove",this.onTouchMove,!1),this.domElement.addEventListener("keydown",this.onKeyDown,!1),-1===this.domElement.tabIndex&&(this.domElement.tabIndex=0),this.object.lookAt(this.target),this.update(),this.saveState()}handleMouseUp(){}handleTouchEnd(){}}class Fi extends Pi{constructor(e,t){super(e,t),Bi(this,"mouseButtons"),Bi(this,"touches"),this.mouseButtons={LEFT:n.MOUSE.ROTATE,RIGHT:n.MOUSE.PAN},this.touches={ONE:n.TOUCH.ROTATE,TWO:n.TOUCH.DOLLY_PAN}}}class Li extends Pi{constructor(e,t){super(e,t),Bi(this,"mouseButtons"),Bi(this,"touches"),this.mouseButtons={LEFT:n.MOUSE.PAN,RIGHT:n.MOUSE.ROTATE},this.touches={ONE:n.TOUCH.PAN,TWO:n.TOUCH.DOLLY_ROTATE}}}class Di extends Pi{constructor(e,t){super(e,t),Bi(this,"trackball"),Bi(this,"screenSpacePanning"),Bi(this,"autoRotate"),Bi(this,"mouseButtons"),Bi(this,"touches"),this.trackball=!0,this.screenSpacePanning=!0,this.autoRotate=!1,this.mouseButtons={LEFT:n.MOUSE.ROTATE,RIGHT:n.MOUSE.PAN},this.touches={ONE:n.TOUCH.ROTATE,TWO:n.TOUCH.DOLLY_PAN}}}var Ui=r(55259),Ni=r(35041),ki=Object.defineProperty,Oi=(e,t,r)=>(((e,t,r)=>{t in e?ki(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class Gi extends n.EventDispatcher{constructor(e,t,r){super(),Oi(this,"enabled",!0),Oi(this,"transformGroup",!1),Oi(this,"_objects"),Oi(this,"_camera"),Oi(this,"_domElement"),Oi(this,"_plane",new n.Plane),Oi(this,"_raycaster",new n.Raycaster),Oi(this,"_mouse",new n.Vector2),Oi(this,"_offset",new n.Vector3),Oi(this,"_intersection",new n.Vector3),Oi(this,"_worldPosition",new n.Vector3),Oi(this,"_inverseMatrix",new n.Matrix4),Oi(this,"_intersections",[]),Oi(this,"_selected",null),Oi(this,"_hovered",null),Oi(this,"activate",(()=>{this._domElement.addEventListener("pointermove",this.onPointerMove),this._domElement.addEventListener("pointerdown",this.onPointerDown),this._domElement.addEventListener("pointerup",this.onPointerCancel),this._domElement.addEventListener("pointerleave",this.onPointerCancel),this._domElement.addEventListener("touchmove",this.onTouchMove),this._domElement.addEventListener("touchstart",this.onTouchStart),this._domElement.addEventListener("touchend",this.onTouchEnd)})),Oi(this,"deactivate",(()=>{this._domElement.removeEventListener("pointermove",this.onPointerMove),this._domElement.removeEventListener("pointerdown",this.onPointerDown),this._domElement.removeEventListener("pointerup",this.onPointerCancel),this._domElement.removeEventListener("pointerleave",this.onPointerCancel),this._domElement.removeEventListener("touchmove",this.onTouchMove),this._domElement.removeEventListener("touchstart",this.onTouchStart),this._domElement.removeEventListener("touchend",this.onTouchEnd),this._domElement.style.cursor=""})),Oi(this,"dispose",(()=>this.deactivate())),Oi(this,"getObjects",(()=>this._objects)),Oi(this,"getRaycaster",(()=>this._raycaster)),Oi(this,"onMouseMove",(e=>{const t=this._domElement.getBoundingClientRect();if(this._mouse.x=(e.clientX-t.left)/t.width*2-1,this._mouse.y=-(e.clientY-t.top)/t.height*2+1,this._raycaster.setFromCamera(this._mouse,this._camera),this._selected&&this.enabled)return this._raycaster.ray.intersectPlane(this._plane,this._intersection)&&this._selected.position.copy(this._intersection.sub(this._offset).applyMatrix4(this._inverseMatrix)),void this.dispatchEvent({type:"drag",object:this._selected});if(this._intersections.length=0,this._raycaster.setFromCamera(this._mouse,this._camera),this._raycaster.intersectObjects(this._objects,!0,this._intersections),this._intersections.length>0){const e=this._intersections[0].object;this._plane.setFromNormalAndCoplanarPoint(this._camera.getWorldDirection(this._plane.normal),this._worldPosition.setFromMatrixPosition(e.matrixWorld)),this._hovered!==e&&(this.dispatchEvent({type:"hoveron",object:e}),this._domElement.style.cursor="pointer",this._hovered=e)}else null!==this._hovered&&(this.dispatchEvent({type:"hoveroff",object:this._hovered}),this._domElement.style.cursor="auto",this._hovered=null)})),Oi(this,"onMouseDown",(()=>{this._intersections.length=0,this._raycaster.setFromCamera(this._mouse,this._camera),this._raycaster.intersectObjects(this._objects,!0,this._intersections),this._intersections.length>0&&(this._selected=!0===this.transformGroup?this._objects[0]:this._intersections[0].object,this._raycaster.ray.intersectPlane(this._plane,this._intersection)&&this._selected.parent&&(this._inverseMatrix.copy(this._selected.parent.matrixWorld).invert(),this._offset.copy(this._intersection).sub(this._worldPosition.setFromMatrixPosition(this._selected.matrixWorld))),this._domElement.style.cursor="move",this.dispatchEvent({type:"dragstart",object:this._selected}))})),Oi(this,"onMouseCancel",(()=>{this._selected&&(this.dispatchEvent({type:"dragend",object:this._selected}),this._selected=null),this._domElement.style.cursor=this._hovered?"pointer":"auto"})),Oi(this,"onPointerMove",(e=>{switch(e.pointerType){case"mouse":case"pen":this.onMouseMove(e)}})),Oi(this,"onPointerDown",(e=>{switch(e.pointerType){case"mouse":case"pen":this.onMouseDown()}})),Oi(this,"onPointerCancel",(e=>{switch(e.pointerType){case"mouse":case"pen":this.onMouseCancel()}})),Oi(this,"onTouchMove",(e=>{e.preventDefault();const t=e.changedTouches[0],r=this._domElement.getBoundingClientRect();if(this._mouse.x=(t.clientX-r.left)/r.width*2-1,this._mouse.y=-(t.clientY-r.top)/r.height*2+1,this._raycaster.setFromCamera(this._mouse,this._camera),this._selected&&this.enabled)return this._raycaster.ray.intersectPlane(this._plane,this._intersection)&&this._selected.position.copy(this._intersection.sub(this._offset).applyMatrix4(this._inverseMatrix)),void this.dispatchEvent({type:"drag",object:this._selected})})),Oi(this,"onTouchStart",(e=>{e.preventDefault();const t=e.changedTouches[0],r=this._domElement.getBoundingClientRect();this._mouse.x=(t.clientX-r.left)/r.width*2-1,this._mouse.y=-(t.clientY-r.top)/r.height*2+1,this._intersections.length=0,this._raycaster.setFromCamera(this._mouse,this._camera),this._raycaster.intersectObjects(this._objects,!0,this._intersections),this._intersections.length>0&&(this._selected=!0===this.transformGroup?this._objects[0]:this._intersections[0].object,this._plane.setFromNormalAndCoplanarPoint(this._camera.getWorldDirection(this._plane.normal),this._worldPosition.setFromMatrixPosition(this._selected.matrixWorld)),this._raycaster.ray.intersectPlane(this._plane,this._intersection)&&this._selected.parent&&(this._inverseMatrix.copy(this._selected.parent.matrixWorld).invert(),this._offset.copy(this._intersection).sub(this._worldPosition.setFromMatrixPosition(this._selected.matrixWorld))),this._domElement.style.cursor="move",this.dispatchEvent({type:"dragstart",object:this._selected}))})),Oi(this,"onTouchEnd",(e=>{e.preventDefault(),this._selected&&(this.dispatchEvent({type:"dragend",object:this._selected}),this._selected=null),this._domElement.style.cursor="auto"})),this._objects=e,this._camera=t,this._domElement=r,this.activate()}}var zi=r(2679),Vi=r(41743),Hi=r(7703),Qi=r(22227),ji=r(1687),Wi=r(32044),Xi=r(6073);const Yi={defines:{USE_3DTEXTURE:1},uniforms:{lut3d:{value:null},lut:{value:null},lutSize:{value:0},tDiffuse:{value:null},intensity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}\n\n\t",fragmentShader:"\n\n\t\tuniform float lutSize;\n\t\t#if USE_3DTEXTURE\n\t\tprecision highp sampler3D;\n\t\tuniform sampler3D lut3d;\n\t\t#else\n\t\tuniform sampler2D lut;\n\n\t\tvec3 lutLookup( sampler2D tex, float size, vec3 rgb ) {\n\n\t\t\tfloat sliceHeight = 1.0 / size;\n\t\t\tfloat yPixelHeight = 1.0 / ( size * size );\n\n\t\t\t// Get the slices on either side of the sample\n\t\t\tfloat slice = rgb.b * size;\n\t\t\tfloat interp = fract( slice );\n\t\t\tfloat slice0 = slice - interp;\n\t\t\tfloat centeredInterp = interp - 0.5;\n\n\t\t\tfloat slice1 = slice0 + sign( centeredInterp );\n\n\t\t\t// Pull y sample in by half a pixel in each direction to avoid color\n\t\t\t// bleeding from adjacent slices.\n\t\t\tfloat greenOffset = clamp( rgb.g * sliceHeight, yPixelHeight * 0.5, sliceHeight - yPixelHeight * 0.5 );\n\n\t\t\tvec2 uv0 = vec2(\n\t\t\t\trgb.r,\n\t\t\t\tslice0 * sliceHeight + greenOffset\n\t\t\t);\n\t\t\tvec2 uv1 = vec2(\n\t\t\t\trgb.r,\n\t\t\t\tslice1 * sliceHeight + greenOffset\n\t\t\t);\n\n\t\t\tvec3 sample0 = texture2D( tex, uv0 ).rgb;\n\t\t\tvec3 sample1 = texture2D( tex, uv1 ).rgb;\n\n\t\t\treturn mix( sample0, sample1, abs( centeredInterp ) );\n\n\t\t}\n\t\t#endif\n\n\t\tvarying vec2 vUv;\n\t\tuniform float intensity;\n\t\tuniform sampler2D tDiffuse;\n\t\tvoid main() {\n\n\t\t\tvec4 val = texture2D( tDiffuse, vUv );\n\t\t\tvec4 lutVal;\n\n\t\t\t// pull the sample in by half a pixel so the sample begins\n\t\t\t// at the center of the edge pixels.\n\t\t\tfloat pixelWidth = 1.0 / lutSize;\n\t\t\tfloat halfPixelWidth = 0.5 / lutSize;\n\t\t\tvec3 uvw = vec3( halfPixelWidth ) + val.rgb * ( 1.0 - pixelWidth );\n\n\t\t\t#if USE_3DTEXTURE\n\n\t\t\tlutVal = vec4( texture( lut3d, uvw ).rgb, val.a );\n\n\t\t\t#else\n\n\t\t\tlutVal = vec4( lutLookup( lut, lutSize, uvw ), val.a );\n\n\t\t\t#endif\n\n\t\t\tgl_FragColor = vec4( mix( val, lutVal, intensity ) );\n\n\t\t}\n\n\t"};class qi extends Xi.T{set lut(e){const t=this.material;if(e!==this.lut&&(t.uniforms.lut3d.value=null,t.uniforms.lut.value=null,e)){const r=e.isData3DTexture?1:0;r!==t.defines.USE_3DTEXTURE&&(t.defines.USE_3DTEXTURE=r,t.needsUpdate=!0),t.uniforms.lutSize.value=e.image.width,e.isData3DTexture?t.uniforms.lut3d.value=e:t.uniforms.lut.value=e}}get lut(){return this.material.uniforms.lut.value||this.material.uniforms.lut3d.value}set intensity(e){this.material.uniforms.intensity.value=e}get intensity(){return this.material.uniforms.intensity.value}constructor(e={}){super(Yi),this.lut=e.lut||null,this.intensity="intensity"in e?e.intensity:1}}var Ki=r(87628),Ji=Object.defineProperty,Zi=(e,t,r)=>(((e,t,r)=>{t in e?Ji(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class $i extends Ki.w{constructor(e,t){super(),Zi(this,"clearColor"),Zi(this,"clearAlpha"),Zi(this,"_oldClearColor"),this.needsSwap=!1,this.clearColor=void 0!==e?e:0,this.clearAlpha=void 0!==t?t:0,this._oldClearColor=new n.Color}render(e,t,r){let n;this.clearColor&&(e.getClearColor(this._oldClearColor),n=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),e.setRenderTarget(this.renderToScreen?null:r),e.clear(),this.clearColor&&e.setClearColor(this._oldClearColor,n)}}const ea={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:"varying vec2 vUv;\n void main() {\n \t vUv = uv;\n \t gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"uniform int byp; //should we apply the glitch ?\n uniform sampler2D tDiffuse;\n uniform sampler2D tDisp;\n uniform float amount;\n uniform float angle;\n uniform float seed;\n uniform float seed_x;\n uniform float seed_y;\n uniform float distortion_x;\n uniform float distortion_y;\n uniform float col_s;\n\n varying vec2 vUv;\n\n float rand(vec2 co){\n \t return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n }\n\n void main() {\n \tif(byp<1) {\n \t\tvec2 p = vUv;\n \t\tfloat xs = floor(gl_FragCoord.x / 0.5);\n \t\tfloat ys = floor(gl_FragCoord.y / 0.5);\n //based on staffantans glitch shader for unity https://github.com/staffantan/unityglitch\n \t\tvec4 normal = texture2D (tDisp, p*seed*seed);\n \t\tif(p.y<distortion_x+col_s && p.y>distortion_x-col_s*seed) {\n \t\t\tif(seed_x>0.){\n \t\t\t\tp.y = 1. - (p.y + distortion_y);\n \t\t\t}\n \t\t\telse {\n \t\t\t\tp.y = distortion_y;\n \t\t\t}\n \t\t}\n \t\tif(p.x<distortion_y+col_s && p.x>distortion_y-col_s*seed) {\n \t\t\tif(seed_y>0.){\n \t\t\t\tp.x=distortion_x;\n \t\t\t}\n \t\t\telse {\n \t\t\t\tp.x = 1. - (p.x + distortion_x);\n \t\t\t}\n \t\t}\n \t\tp.x+=normal.x*seed_x*(seed/5.);\n \t\tp.y+=normal.y*seed_y*(seed/5.);\n //base from RGB shift shader\n \t\tvec2 offset = amount * vec2( cos(angle), sin(angle));\n \t\tvec4 cr = texture2D(tDiffuse, p + offset);\n \t\tvec4 cga = texture2D(tDiffuse, p);\n \t\tvec4 cb = texture2D(tDiffuse, p - offset);\n \t\tgl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);\n //add noise\n \t\tvec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);\n \t\tgl_FragColor = gl_FragColor+ snow;\n \t}\n \telse {\n \t\tgl_FragColor=texture2D (tDiffuse, vUv);\n \t}\n }"};var ta=Object.defineProperty,ra=(e,t,r)=>(((e,t,r)=>{t in e?ta(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class na extends Ki.w{constructor(e=64){super(),ra(this,"material"),ra(this,"fsQuad"),ra(this,"goWild"),ra(this,"curF"),ra(this,"randX"),ra(this,"uniforms"),this.uniforms=n.UniformsUtils.clone(ea.uniforms),this.uniforms.tDisp.value=this.generateHeightmap(e),this.material=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:ea.vertexShader,fragmentShader:ea.fragmentShader}),this.fsQuad=new Ki.T(this.material),this.goWild=!1,this.curF=0,this.generateTrigger()}render(e,t,r){!1===e.capabilities.isWebGL2&&(this.uniforms.tDisp.value.format=n.LuminanceFormat),this.uniforms.tDiffuse.value=r.texture,this.uniforms.seed.value=Math.random(),this.uniforms.byp.value=0,this.curF%this.randX==0||1==this.goWild?(this.uniforms.amount.value=Math.random()/30,this.uniforms.angle.value=n.MathUtils.randFloat(-Math.PI,Math.PI),this.uniforms.seed_x.value=n.MathUtils.randFloat(-1,1),this.uniforms.seed_y.value=n.MathUtils.randFloat(-1,1),this.uniforms.distortion_x.value=n.MathUtils.randFloat(0,1),this.uniforms.distortion_y.value=n.MathUtils.randFloat(0,1),this.curF=0,this.generateTrigger()):this.curF%this.randX<this.randX/5?(this.uniforms.amount.value=Math.random()/90,this.uniforms.angle.value=n.MathUtils.randFloat(-Math.PI,Math.PI),this.uniforms.distortion_x.value=n.MathUtils.randFloat(0,1),this.uniforms.distortion_y.value=n.MathUtils.randFloat(0,1),this.uniforms.seed_x.value=n.MathUtils.randFloat(-.3,.3),this.uniforms.seed_y.value=n.MathUtils.randFloat(-.3,.3)):0==this.goWild&&(this.uniforms.byp.value=1),this.curF++,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}generateTrigger(){this.randX=n.MathUtils.randInt(120,240)}generateHeightmap(e){const t=new Float32Array(e*e),r=e*e;for(let a=0;a<r;a++){const e=n.MathUtils.randFloat(0,1);t[a]=e}const i=new n.DataTexture(t,e,e,n.RedFormat,n.FloatType);return i.needsUpdate=!0,i}}const ia={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","\tvUV = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","\treturn a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","\treturn sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","\tfloat dist = hypot( coord.x - p.x, coord.y - p.y );","\tfloat rad = channel;","\tif ( shape == SHAPE_DOT ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t} else if ( shape == SHAPE_ELLIPSE ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t\tif ( dist != 0.0 ) {","\t\t\tfloat dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","\t\t\tdist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","\t\t}","\t} else if ( shape == SHAPE_LINE ) {","\t\trad = pow( abs( rad ), 1.5) * rad_max;","\t\tfloat dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","\t\tdist = hypot( normal.x * dot_p, normal.y * dot_p );","\t} else if ( shape == SHAPE_SQUARE ) {","\t\tfloat theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","\t\tfloat sin_t = abs( sin( theta ) );","\t\tfloat cos_t = abs( cos( theta ) );","\t\trad = pow( abs( rad ), 1.4 );","\t\trad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","\t}","\treturn rad - dist;","}","struct Cell {","\tvec2 normal;","\tvec2 p1;","\tvec2 p2;","\tvec2 p3;","\tvec2 p4;","\tfloat samp2;","\tfloat samp1;","\tfloat samp3;","\tfloat samp4;","};","vec4 getSample( vec2 point ) {","\tvec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","\tfloat base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","\tfloat step = PI2 / float( samples );","\tfloat dist = radius * 0.66;","\tfor ( int i = 0; i < samples; ++i ) {","\t\tfloat r = base + step * float( i );","\t\tvec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","\t\ttex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","\t}","\ttex /= float( samples ) + 1.0;","\treturn tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","\tfloat dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","\tif ( channel == 0 ) {","\t\tc.samp1 = getSample( c.p1 ).r;","\t\tc.samp2 = getSample( c.p2 ).r;","\t\tc.samp3 = getSample( c.p3 ).r;","\t\tc.samp4 = getSample( c.p4 ).r;","\t} else if (channel == 1) {","\t\tc.samp1 = getSample( c.p1 ).g;","\t\tc.samp2 = getSample( c.p2 ).g;","\t\tc.samp3 = getSample( c.p3 ).g;","\t\tc.samp4 = getSample( c.p4 ).g;","\t} else {","\t\tc.samp1 = getSample( c.p1 ).b;","\t\tc.samp3 = getSample( c.p3 ).b;","\t\tc.samp2 = getSample( c.p2 ).b;","\t\tc.samp4 = getSample( c.p4 ).b;","\t}","\tdist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","\tdist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","\tdist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","\tdist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","\tres = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","\tres = clamp( res, 0.0, 1.0 );","\treturn res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","\tCell c;","\tvec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","\tfloat threshold = step * 0.5;","\tfloat dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","\tfloat dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","\tvec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","\tfloat offset_normal = mod( hypot( offset.x, offset.y ), step );","\tfloat normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","\tfloat normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","\tfloat offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","\tfloat line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","\tfloat line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","\tc.normal = n;","\tc.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","\tc.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","\tif ( scatter != 0.0 ) {","\t\tfloat off_mag = scatter * threshold * 0.5;","\t\tfloat off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","\t\tc.p1.x += cos( off_angle ) * off_mag;","\t\tc.p1.y += sin( off_angle ) * off_mag;","\t}","\tfloat normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","\tfloat line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","\tc.p2.x = c.p1.x - n.x * normal_step;","\tc.p2.y = c.p1.y - n.y * normal_step;","\tc.p3.x = c.p1.x + n.y * line_step;","\tc.p3.y = c.p1.y - n.x * line_step;","\tc.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","\tc.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","\treturn c;","}","float blendColour( float a, float b, float t ) {","\tif ( blendingMode == BLENDING_LINEAR ) {","\t\treturn blend( a, b, 1.0 - t );","\t} else if ( blendingMode == BLENDING_ADD ) {","\t\treturn blend( a, min( 1.0, a + b ), t );","\t} else if ( blendingMode == BLENDING_MULTIPLY ) {","\t\treturn blend( a, max( 0.0, a * b ), t );","\t} else if ( blendingMode == BLENDING_LIGHTER ) {","\t\treturn blend( a, max( a, b ), t );","\t} else if ( blendingMode == BLENDING_DARKER ) {","\t\treturn blend( a, min( a, b ), t );","\t} else {","\t\treturn blend( a, b, 1.0 - t );","\t}","}","void main() {","\tif ( ! disable ) {","\t\tvec2 p = vec2( vUV.x * width, vUV.y * height );","\t\tvec2 origin = vec2( 0, 0 );","\t\tfloat aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","\t\tCell cell_r = getReferenceCell( p, origin, rotateR, radius );","\t\tCell cell_g = getReferenceCell( p, origin, rotateG, radius );","\t\tCell cell_b = getReferenceCell( p, origin, rotateB, radius );","\t\tfloat r = getDotColour( cell_r, p, 0, rotateR, aa );","\t\tfloat g = getDotColour( cell_g, p, 1, rotateG, aa );","\t\tfloat b = getDotColour( cell_b, p, 2, rotateB, aa );","\t\tvec4 colour = texture2D( tDiffuse, vUV );","\t\tr = blendColour( r, colour.r, blending );","\t\tg = blendColour( g, colour.g, blending );","\t\tb = blendColour( b, colour.b, blending );","\t\tif ( greyscale ) {","\t\t\tr = g = b = (r + b + g) / 3.0;","\t\t}","\t\tgl_FragColor = vec4( r, g, b, 1.0 );","\t} else {","\t\tgl_FragColor = texture2D( tDiffuse, vUV );","\t}","}"].join("\n")};var aa=Object.defineProperty,sa=(e,t,r)=>(((e,t,r)=>{t in e?aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class oa extends Ki.w{constructor(e,t,r){super(),sa(this,"material"),sa(this,"fsQuad"),sa(this,"uniforms"),void 0===ia&&console.error("THREE.HalftonePass requires HalftoneShader"),this.uniforms=n.UniformsUtils.clone(ia.uniforms),this.material=new n.ShaderMaterial({uniforms:this.uniforms,fragmentShader:ia.fragmentShader,vertexShader:ia.vertexShader}),this.uniforms.width.value=e,this.uniforms.height.value=t;for(const n in r)r.hasOwnProperty(n)&&this.uniforms.hasOwnProperty(n)&&(this.uniforms[n].value=r[n]);this.fsQuad=new Ki.T(this.material)}render(e,t,r){this.material.uniforms.tDiffuse.value=r.texture,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}setSize(e,t){this.uniforms.width.value=e,this.uniforms.height.value=t}}const la={defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new n.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","\tvOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","\tvUv = uv;","\tSMAAEdgeDetectionVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","\tvec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","\tvec4 delta;","\tvec3 C = texture2D( colorTex, texcoord ).rgb;","\tvec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","\tvec3 t = abs( C - Cleft );","\tdelta.x = max( max( t.r, t.g ), t.b );","\tvec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","\tt = abs( C - Ctop );","\tdelta.y = max( max( t.r, t.g ), t.b );","\tvec2 edges = step( threshold, delta.xy );","\tif ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","\t\tdiscard;","\tvec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","\tt = abs( C - Cright );","\tdelta.z = max( max( t.r, t.g ), t.b );","\tvec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","\tt = abs( C - Cbottom );","\tdelta.w = max( max( t.r, t.g ), t.b );","\tfloat maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","\tvec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","\tt = abs( C - Cleftleft );","\tdelta.z = max( max( t.r, t.g ), t.b );","\tvec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","\tt = abs( C - Ctoptop );","\tdelta.w = max( max( t.r, t.g ), t.b );","\tmaxDelta = max( max( maxDelta, delta.z ), delta.w );","\tedges.xy *= step( 0.5 * maxDelta, delta.xy );","\treturn vec4( edges, 0.0, 0.0 );","}","void main() {","\tgl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},ca={defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new n.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","\tvPixcoord = texcoord / resolution;","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","\tvOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","\tvUv = uv;","\tSMAABlendingWeightCalculationVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","#if __VERSION__ == 100","vec2 round( vec2 x ) {","\treturn sign( x ) * floor( abs( x ) + 0.5 );","}","#endif","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","\te.r = bias + e.r * scale;","\treturn 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 0.0, 1.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord -= vec2( 2.0, 0.0 ) * resolution;","\t\tif ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","\t}","\ttexcoord.x += 0.25 * resolution.x;","\ttexcoord.x += resolution.x;","\ttexcoord.x += 2.0 * resolution.x;","\ttexcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","\treturn texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 0.0, 1.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord += vec2( 2.0, 0.0 ) * resolution;","\t\tif ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","\t}","\ttexcoord.x -= 0.25 * resolution.x;","\ttexcoord.x -= resolution.x;","\ttexcoord.x -= 2.0 * resolution.x;","\ttexcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","\treturn texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 1.0, 0.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord += vec2( 0.0, 2.0 ) * resolution;","\t\tif ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","\t}","\ttexcoord.y -= 0.25 * resolution.y;","\ttexcoord.y -= resolution.y;","\ttexcoord.y -= 2.0 * resolution.y;","\ttexcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","\treturn texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 1.0, 0.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord -= vec2( 0.0, 2.0 ) * resolution;","\t\tif ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","\t}","\ttexcoord.y += 0.25 * resolution.y;","\ttexcoord.y += resolution.y;","\ttexcoord.y += 2.0 * resolution.y;","\ttexcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","\treturn texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","\tvec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","\ttexcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","\ttexcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","\treturn texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","\tvec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","\tvec2 e = texture2D( edgesTex, texcoord ).rg;","\tif ( e.g > 0.0 ) {","\t\tvec2 d;","\t\tvec2 coords;","\t\tcoords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","\t\tcoords.y = offset[ 1 ].y;","\t\td.x = coords.x;","\t\tfloat e1 = texture2D( edgesTex, coords, 0.0 ).r;","\t\tcoords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","\t\td.y = coords.x;","\t\td = d / resolution.x - pixcoord.x;","\t\tvec2 sqrt_d = sqrt( abs( d ) );","\t\tcoords.y -= 1.0 * resolution.y;","\t\tfloat e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","\t\tweights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","\t}","\tif ( e.r > 0.0 ) {","\t\tvec2 d;","\t\tvec2 coords;","\t\tcoords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","\t\tcoords.x = offset[ 0 ].x;","\t\td.x = coords.y;","\t\tfloat e1 = texture2D( edgesTex, coords, 0.0 ).g;","\t\tcoords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","\t\td.y = coords.y;","\t\td = d / resolution.y - pixcoord.y;","\t\tvec2 sqrt_d = sqrt( abs( d ) );","\t\tcoords.y -= 1.0 * resolution.y;","\t\tfloat e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","\t\tweights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","\t}","\treturn weights;","}","void main() {","\tgl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},ua={uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new n.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","\tvUv = uv;","\tSMAANeighborhoodBlendingVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","\tvec4 a;","\ta.xz = texture2D( blendTex, texcoord ).xz;","\ta.y = texture2D( blendTex, offset[ 1 ].zw ).g;","\ta.w = texture2D( blendTex, offset[ 1 ].xy ).a;","\tif ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","\t\treturn texture2D( colorTex, texcoord, 0.0 );","\t} else {","\t\tvec2 offset;","\t\toffset.x = a.a > a.b ? a.a : -a.b;","\t\toffset.y = a.g > a.r ? -a.g : a.r;","\t\tif ( abs( offset.x ) > abs( offset.y )) {","\t\t\toffset.y = 0.0;","\t\t} else {","\t\t\toffset.x = 0.0;","\t\t}","\t\tvec4 C = texture2D( colorTex, texcoord, 0.0 );","\t\ttexcoord += sign( offset ) * resolution;","\t\tvec4 Cop = texture2D( colorTex, texcoord, 0.0 );","\t\tfloat s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","\t\tC.xyz = pow(C.xyz, vec3(2.2));","\t\tCop.xyz = pow(Cop.xyz, vec3(2.2));","\t\tvec4 mixed = mix(C, Cop, s);","\t\tmixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","\t\treturn mixed;","\t}","}","void main() {","\tgl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")};class ha extends Ki.w{constructor(e,t){super(),this.edgesRT=new n.WebGLRenderTarget(e,t,{depthBuffer:!1}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new n.WebGLRenderTarget(e,t,{depthBuffer:!1}),this.weightsRT.texture.name="SMAAPass.weights";const r=this,i=new Image;i.src=this.getAreaTexture(),i.onload=function(){r.areaTexture.needsUpdate=!0},this.areaTexture=new n.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=i,this.areaTexture.minFilter=n.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.flipY=!1;const a=new Image;a.src=this.getSearchTexture(),a.onload=function(){r.searchTexture.needsUpdate=!0},this.searchTexture=new n.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=a,this.searchTexture.magFilter=n.NearestFilter,this.searchTexture.minFilter=n.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.flipY=!1,void 0===la&&console.error("THREE.SMAAPass relies on SMAAShader"),this.uniformsEdges=n.UniformsUtils.clone(la.uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new n.ShaderMaterial({defines:Object.assign({},la.defines),uniforms:this.uniformsEdges,vertexShader:la.vertexShader,fragmentShader:la.fragmentShader}),this.uniformsWeights=n.UniformsUtils.clone(ca.uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new n.ShaderMaterial({defines:Object.assign({},ca.defines),uniforms:this.uniformsWeights,vertexShader:ca.vertexShader,fragmentShader:ca.fragmentShader}),this.uniformsBlend=n.UniformsUtils.clone(ua.uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new n.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:ua.vertexShader,fragmentShader:ua.fragmentShader}),this.needsSwap=!1,this.fsQuad=new Ki.T(null)}render(e,t,r){this.uniformsEdges.tDiffuse.value=r.texture,this.fsQuad.material=this.materialEdges,e.setRenderTarget(this.edgesRT),this.clear&&e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialWeights,e.setRenderTarget(this.weightsRT),this.clear&&e.clear(),this.fsQuad.render(e),this.uniformsBlend.tColor.value=r.texture,this.fsQuad.material=this.materialBlend,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}setSize(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)}getAreaTexture(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW9vvubxAP8kAL8H/koAuOKP3+q6+xGnd5kdYCeECnGIJViwGJMAkQKfDvB3WZxjLKGh8VSCCzhwEWBpMc5/kBbjawT4HnwJfhr+pPBIu7uu+OOTo9vsmtQcniMBGkKFd4jDWMSCRUpLjJYNJkM+IRzQ+PQvIeAMTrBS2LEiaiR9b/5PuT6Ap/AcfAFO4Y3dA3DFH7/VS+M8k4baEAQfMI4QfbVDDGIRg7GKaIY52qAjTAgTvGBAPGIIghOCYAUrGFNgzA7Q3QhgCwfwAnwe5vDejgG44o/fbm1C5ZlYQvQDARPAIQGxCWBM+wWl37ZQESb4gImexGMDouhGLx1Cst0Saa4b4AqO4Hk4gxo+3DHAV/nx27p3JziPM2pVgoiia5MdEzCGULprIN7gEEeQ5IQxEBBBQnxhsDb5auGmAAYcHMA9eAAz8PBol8/xij9+C4Djlim4gJjWcwZBhCBgMIIYxGAVIkH3ZtcBuLdtRFMWsPGoY9rN+HoBji9VBYdwD2ZQg4cnO7OSq/z4rU5KKdwVbFAjNojCQzTlCLPFSxtamwh2jMUcEgg2Wm/6XgErIBhBckQtGN3CzbVacERgCnfgLswhnvqf7QyAq/z4rRZm1YglYE3affGITaZsdIe2FmMIpnOCap25I6jt2kCwCW0D1uAD9sZctNGXcQIHCkINDQgc78aCr+zjtw3BU/ijdpw3zhCwcaONwBvdeS2YZKkJNJsMPf2JKEvC28RXxxI0ASJyzQCjCEQrO4Q7sFArEzjZhaFc4cdv+/JFdKULM4px0DfUBI2hIsy06BqLhGTQEVdbfAIZXYMPesq6VoCHICzUyjwInO4Y411//LYLs6TDa9wvg2CC2rElgAnpTBziThxaL22MYhzfkghz6GAs2VHbbdM91VZu1MEEpupMMwKyVTb5ij9+u4VJG/5EgEMMmFF01cFai3isRbKbzb+YaU/MQbAm2XSMoUPAmvZzbuKYRIFApbtlrfFuUGd6vq2hXNnH78ZLh/iFhsQG3T4D1ib7k5CC6vY0DCbtrohgLEIClXiGtl10zc0CnEGIhhatLBva7NP58Tvw0qE8yWhARLQ8h4+AhQSP+I4F5xoU+VilGRJs6wnS7ruti/4KvAY/CfdgqjsMy4pf8fodQO8/gnuX3f/3xi3om1/h7THr+co3x93PP9+FBUfbNUjcjEmhcrkT+8K7ml7V10Jo05mpIEFy1NmCJWx9SIKKt+EjAL4Ez8EBVOB6havuT/rByPvHXK+9zUcfcbb254+9fydJknYnRr1oGfdaiAgpxu1Rx/Rek8KISftx3L+DfsLWAANn8Hvw0/AFeAGO9DFV3c6D+CcWbL8Dj9e7f+T1k8AZv/d7+PXWM/Z+VvdCrIvuAKO09RpEEQJM0Ci6+B4xhTWr4cZNOvhktabw0ta0rSJmqz3Yw5/AKXwenod7cAhTmBSPKf6JBdvH8IP17h95pXqw50/+BFnj88fev4NchyaK47OPhhtI8RFSvAfDSNh0Ck0p2gLxGkib5NJj/JWCr90EWQJvwBzO4AHcgztwAFN1evHPUVGwfXON+0debT1YeGON9Yy9/63X+OguiwmhIhQhD7l4sMqlG3D86Suc3qWZ4rWjI1X7u0Ytw6x3rIMeIOPDprfe2XzNgyj6PahhBjO4C3e6puDgXrdg+/5l948vF3bqwZetZ+z9Rx9zdIY5pInPK4Nk0t+l52xdK2B45Qd87nM8fsD5EfUhIcJcERw4RdqqH7Yde5V7m1vhNmtedkz6EDzUMF/2jJYWbC+4fzzA/Y+/8PPH3j9dcBAPIRP8JLXd5BpAu03aziOL3VVHZzz3CXWDPWd+SH2AnxIqQoTZpo9Ckc6HIrFbAbzNmlcg8Ag8NFDDAhbJvTBZXbC94P7t68EXfv6o+21gUtPETU7bbkLxvNKRFG2+KXzvtObonPP4rBvsgmaKj404DlshFole1Glfh02fE7bYR7dZ82oTewIBGn1Md6CG6YUF26X376oevOLzx95vhUmgblI6LBZwTCDY7vMq0op5WVXgsObOXJ+1x3qaBl9j1FeLxbhU9w1F+Wiba6s1X/TBz1LnUfuYDi4r2C69f1f14BWfP+p+W2GFKuC9phcELMYRRLur9DEZTUdEH+iEqWdaM7X4WOoPGI+ZYD2+wcQ+y+ioHUZ9dTDbArzxmi/bJI9BND0Ynd6lBdve/butBw8+f/T9D3ABa3AG8W3VPX4hBin+bj8dMMmSpp5pg7fJ6xrBFE2WQQEWnV8Qg3FbAWzYfM1rREEnmvkN2o1+acG2d/9u68GDzx91v3mAjb1zkpqT21OipPKO0b9TO5W0nTdOmAQm0TObts3aBKgwARtoPDiCT0gHgwnbArzxmtcLc08HgF1asN0C4Ms/fvD5I+7PhfqyXE/b7RbbrGyRQRT9ARZcwAUmgdoz0ehJ9Fn7QAhUjhDAQSw0bV3T3WbNa59jzmiP6GsWbGXDX2ytjy8+f9T97fiBPq9YeLdBmyuizZHaqXITnXiMUEEVcJ7K4j3BFPurtB4bixW8wTpweL8DC95szWMOqucFYGsWbGU7p3TxxxefP+r+oTVktxY0v5hbq3KiOKYnY8ddJVSBxuMMVffNbxwIOERShst73HZ78DZrHpmJmH3K6sGz0fe3UUj0eyRrSCGTTc+rjVNoGzNSv05srAxUBh8IhqChiQgVNIIBH3AVPnrsnXQZbLTm8ammv8eVXn/vWpaTem5IXRlt+U/LA21zhSb9cye6jcOfCnOwhIAYXAMVTUNV0QhVha9xjgA27ODJbLbmitt3tRN80lqG6N/khgot4ZVlOyO4WNg3OIMzhIZQpUEHieg2im6F91hB3I2tubql6BYNN9Hj5S7G0G2tahslBWKDnOiIvuAEDzakDQKDNFQT6gbn8E2y4BBubM230YIpBnDbMa+y3dx0n1S0BtuG62lCCXwcY0F72T1VRR3t2ONcsmDjbmzNt9RFs2LO2hQNyb022JisaI8rAWuw4HI3FuAIhZdOGIcdjLJvvObqlpqvWTJnnQbyi/1M9O8UxWhBs//H42I0q1Yb/XPGONzcmm+ri172mHKvZBpHkJaNJz6v9jxqiklDj3U4CA2ugpAaYMWqNXsdXbmJNd9egCnJEsphXNM+MnK3m0FCJ5S1kmJpa3DgPVbnQnPGWIDspW9ozbcO4K/9LkfaQO2KHuqlfFXSbdNzcEcwoqNEFE9zcIXu9/6n/ym/BC/C3aJLzEKPuYVlbFnfhZ8kcWxV3dbv4bKl28566wD+8C53aw49lTABp9PWbsB+knfc/Li3eVizf5vv/xmvnPKg5ihwKEwlrcHqucuVcVOxEv8aH37E3ZqpZypUulrHEtIWKUr+txHg+ojZDGlwnqmkGlzcVi1dLiNSJiHjfbRNOPwKpx9TVdTn3K05DBx4psIk4Ei8aCkJahRgffk4YnEXe07T4H2RR1u27E6wfQsBDofUgjFUFnwC2AiVtA+05J2zpiDK2Oa0c5fmAecN1iJzmpqFZxqYBCYhFTCsUNEmUnIcZ6aEA5rQVhEywG6w7HSW02XfOoBlQmjwulOFQAg66SvJblrTEX1YtJ3uG15T/BH1OfOQeuR8g/c0gdpT5fx2SKbs9EfHTKdM8A1GaJRHLVIwhcGyydZsbifAFVKl5EMKNU2Hryo+06BeTgqnxzYjThVySDikbtJPieco75lYfKAJOMEZBTjoITuWHXXZVhcUDIS2hpiXHV9Ku4u44bN5OYLDOkJo8w+xJSMbhBRHEdEs9JZUCkQrPMAvaHyLkxgkEHxiNkx/x2YB0mGsQ8EUWj/stW5YLhtS5SMu+/YBbNPDCkGTUybN8krRLBGPlZkVOA0j+a1+rkyQKWGaPHPLZOkJhioQYnVZ2hS3zVxMtgC46KuRwbJNd9nV2PHgb36F194ecf/Yeu2vAFe5nm/bRBFrnY4BauE8ERmZRFUn0k8hbftiVYSKMEme2dJCJSCGYAlNqh87bXOPdUkGy24P6d1ll21MBqqx48Fvv8ZHH8HZFY7j/uAq1xMJUFqCSUlJPmNbIiNsmwuMs/q9CMtsZsFO6SprzCS1Z7QL8xCQClEelpjTduDMsmWD8S1PT152BtvmIGvUeDA/yRn83u/x0/4qxoPHjx+PXY9pqX9bgMvh/Nz9kpP4pOe1/fYf3axUiMdHLlPpZCNjgtNFAhcHEDxTumNONhHrBduW+vOyY++70WWnPXj98eA4kOt/mj/5E05l9+O4o8ePx67HFqyC+qSSnyselqjZGaVK2TadbFLPWAQ4NBhHqDCCV7OTpo34AlSSylPtIdd2AJZlyzYQrDJ5lcWGNceD80CunPLGGzsfD+7wRb95NevJI5docQ3tgCyr5bGnyaPRlmwNsFELViOOx9loebGNq2moDOKpHLVP5al2cymWHbkfzGXL7kfRl44H9wZy33tvt+PB/Xnf93e+nh5ZlU18wCiRUa9m7kib9LYuOk+hudQNbxwm0AQqbfloimaB2lM5fChex+ylMwuTbfmXQtmWlenZljbdXTLuOxjI/fDDHY4Hjx8/Hrse0zXfPFxbUN1kKqSCCSk50m0Ajtx3ub9XHBKHXESb8iO6E+qGytF4nO0OG3SXzbJlhxBnKtKyl0NwybjvYCD30aMdjgePHz8eu56SVTBbgxJMliQ3Oauwg0QHxXE2Ez/EIReLdQj42Gzb4CLS0YJD9xUx7bsi0vJi5mUbW1QzL0h0PFk17rtiIPfJk52MB48fPx67npJJwyrBa2RCCQRTbGZSPCxTPOiND4G2pYyOQ4h4jINIJh5wFU1NFZt+IsZ59LSnDqBjZ2awbOku+yInunLcd8VA7rNnOxkPHj9+PGY9B0MWJJNozOJmlglvDMXDEozdhQWbgs/U6oBanGzLrdSNNnZFjOkmbi5bNt1lX7JLLhn3vXAg9/h4y/Hg8ePHI9dzQMEkWCgdRfYykYKnkP7D4rIujsujaKPBsB54vE2TS00ccvFY/Tth7JXeq1hz+qgVy04sAJawTsvOknHfCwdyT062HA8eP348Zj0vdoXF4pilKa2BROed+9fyw9rWRXeTFXESMOanvDZfJuJaSXouQdMdDJZtekZcLLvEeK04d8m474UDuaenW44Hjx8/Xns9YYqZpszGWB3AN/4VHw+k7WSFtJ3Qicuqb/NlVmgXWsxh570xg2UwxUw3WfO6B5nOuO8aA7lnZxuPB48fPx6znm1i4bsfcbaptF3zNT78eFPtwi1OaCNOqp1x3zUGcs/PN++AGD1+fMXrSVm2baTtPhPahbPhA71wIHd2bXzRa69nG+3CraTtPivahV/55tXWg8fyRY/9AdsY8VbSdp8V7cKrrgdfM//z6ILQFtJ2nxHtwmuoB4/kf74+gLeRtvvMaBdeSz34+vifx0YG20jbfTa0C6+tHrwe//NmOG0L8EbSdp8R7cLrrQe/996O+ai3ujQOskpTNULa7jOjXXj99eCd8lHvoFiwsbTdZ0a78PrrwTvlo966pLuRtB2fFe3Cm6oHP9kNH/W2FryxtN1nTLvwRurBO+Kj3pWXHidtx2dFu/Bm68Fb81HvykuPlrb7LGkX3mw9eGs+6h1Y8MbSdjegXcguQLjmevDpTQLMxtJ2N6NdyBZu9AbrwVvwUW+LbteULUpCdqm0HTelXbhNPe8G68Gb8lFvVfYfSNuxvrTdTWoXbozAzdaDZzfkorOj1oxVxlIMlpSIlpLrt8D4hrQL17z+c3h6hU/wv4Q/utps4+bm+6P/hIcf0JwQ5oQGPBL0eKPTYEXTW+eL/2DKn73J9BTXYANG57hz1cEMviVf/4tf5b/6C5pTQkMIWoAq7hTpOJjtAM4pxKu5vg5vXeUrtI09/Mo/5H+4z+Mp5xULh7cEm2QbRP2tFIKR7WM3fPf/jZ3SWCqLM2l4NxID5zB72HQXv3jj/8mLR5xXNA5v8EbFQEz7PpRfl1+MB/hlAN65qgDn3wTgH13hK7T59bmP+NIx1SHHU84nLOITt3iVz8mNO+lPrjGAnBFqmioNn1mTyk1ta47R6d4MrX7tjrnjYUpdUbv2rVr6YpVfsGG58AG8Ah9eyUN8CX4WfgV+G8LVWPDGb+Zd4cU584CtqSbMKxauxTg+dyn/LkVgA+IR8KHtejeFKRtTmLLpxN6mYVLjYxwXf5x2VofiZcp/lwKk4wGOpYDnoIZPdg/AAbwMfx0+ge9dgZvYjuqKe4HnGnykYo5TvJbG0Vj12JagRhwKa44H95ShkZa5RyLGGdfYvG7aw1TsF6iapPAS29mNS3NmsTQZCmgTzFwgL3upCTgtBTRwvGMAKrgLn4evwin8+afJRcff+8izUGUM63GOOuAs3tJkw7J4kyoNreqrpO6cYLQeFUd7TTpr5YOTLc9RUUogUOVJQ1GYJaFLAW0oTmKyYS46ZooP4S4EON3xQ5zC8/CX4CnM4c1PE8ApexpoYuzqlP3d4S3OJP8ZDK7cKWNaTlqmgDiiHwl1YsE41w1zT4iRTm3DBqxvOUsbMKKDa/EHxagtnta072ejc3DOIh5ojvh8l3tk1JF/AV6FU6jh3U8HwEazLgdCLYSQ+MYiAI2ltomkzttUb0gGHdSUUgsIYjTzLG3mObX4FBRaYtpDVNZrih9TgTeYOBxsEnN1gOCTM8Bsw/ieMc75w9kuAT6A+/AiHGvN/+Gn4KRkiuzpNNDYhDGFndWRpE6SVfm8U5bxnSgVV2jrg6JCKmneqey8VMFgq2+AM/i4L4RUbfSi27lNXZ7R7W9RTcq/q9fk4Xw3AMQd4I5ifAZz8FcVtm9SAom/dyN4lczJQW/kC42ZrHgcCoIf1oVMKkVItmMBi9cOeNHGLqOZk+QqQmrbc5YmYgxELUUN35z2iohstgfLIFmcMV7s4CFmI74L9+EFmGsi+tGnAOD4Yk9gIpo01Y4cA43BWGygMdr4YZekG3OBIUXXNukvJS8tqa06e+lSDCtnqqMFu6hWHXCF+WaYt64m9QBmNxi7Ioy7D+fa1yHw+FMAcPt7SysFLtoG4PXAk7JOA3aAxBRqUiAdU9Yp5lK3HLSRFtOim0sa8euEt08xvKjYjzeJ2GU7YawexrnKI9tmobInjFXCewpwriY9+RR4aaezFhMhGCppKwom0ChrgFlKzyPKkGlTW1YQrE9HJqu8hKGgMc6hVi5QRq0PZxNfrYNgE64utmRv6KKHRpxf6VDUaOvNP5jCEx5q185My/7RKz69UQu2im5k4/eownpxZxNLwiZ1AZTO2ZjWjkU9uaB2HFn6Q3u0JcsSx/qV9hTEApRzeBLDJQXxYmTnq7bdLa3+uqFrxLJ5w1TehnNHx5ECvCh2g2c3hHH5YsfdaSKddztfjQ6imKFGSyFwlLzxEGPp6r5IevVjk1AMx3wMqi1NxDVjLBiPs9tbsCkIY5we5/ML22zrCScFxnNtzsr9Wcc3CnD+pYO+4VXXiDE0oc/vQQ/fDK3oPESJMYXNmJa/DuloJZkcTpcYE8lIH8Dz8DJMiynNC86Mb2lNaaqP/+L7f2fcE/yP7/Lde8xfgSOdMxvOixZf/9p3+M4hT1+F+zApxg9XfUvYjc8qX2lfOOpK2gNRtB4flpFu9FTKCp2XJRgXnX6olp1zyYjTKJSkGmLE2NjUr1bxFM4AeAAHBUFIeSLqXR+NvH/M9fOnfHzOD2vCSyQJKzfgsCh+yi/Mmc35F2fUrw7miW33W9hBD1vpuUojFphIyvg7aTeoymDkIkeW3XLHmguMzbIAJejN6B5MDrhipE2y6SoFRO/AK/AcHHZHNIfiWrEe/C6cr3f/yOvrQKB+zMM55/GQdLDsR+ifr5Fiuu+/y+M78LzOE5dsNuXC3PYvYWd8NXvphLSkJIasrlD2/HOqQ+RjcRdjKTGWYhhVUm4yxlyiGPuMsZR7sMCHUBeTuNWA7if+ifXgc/hovftHXs/DV+Fvwe+f8shzMiMcweFgBly3//vwJfg5AN4450fn1Hd1Rm1aBLu22Dy3y3H2+OqMemkbGZ4jozcDjJf6596xOLpC0eMTHbKnxLxH27uZ/bMTGs2jOaMOY4m87CfQwF0dw53oa1k80JRuz/XgS+8fX3N9Af4qPIMfzKgCp4H5TDGe9GGeFPzSsZz80SlPTxXjgwJmC45njzgt2vbQ4b4OAdUK4/vWhO8d8v6EE8fMUsfakXbPpFJeLs2ubM/qdm/la3WP91uWhxXHjoWhyRUq2iJ/+5mA73zwIIo+LoZ/SgvIRjAd1IMvvn98PfgOvAJfhhm8scAKVWDuaRaK8aQ9f7vuPDH6Bj47ZXau7rqYJ66mTDwEDU6lLbCjCK0qTXyl5mnDoeNRxanj3FJbaksTk0faXxHxLrssgPkWB9LnA/MFleXcJozzjwsUvUG0X/QCve51qkMDXp9mtcyOy3rwBfdvVJK7D6/ACSzg3RoruIq5UDeESfEmVclDxnniU82vxMLtceD0hGZWzBNPMM/jSPne2OVatiTKUpY5vY7gc0LdUAWeWM5tH+O2I66AOWw9xT2BuyRVLGdoDHUsVRXOo/c+ZdRXvFfnxWyIV4upFLCl9eAL7h8Zv0QH8Ry8pA2cHzQpGesctVA37ZtklBTgHjyvdSeKY/RZw/kJMk0Y25cSNRWSigQtlULPTw+kzuJPeYEkXjQRpoGZobYsLF79pyd1dMRHInbgFTZqNLhDqiIsTNpoex2WLcy0/X6rHcdMMQvFSd5dWA++4P7xv89deACnmr36uGlL69bRCL6BSZsS6c0TU2TKK5gtWCzgAOOwQcurqk9j8whvziZSMLcq5hbuwBEsYjopUBkqw1yYBGpLA97SRElEmx5MCInBY5vgLk94iKqSWmhIGmkJ4Bi9m4L645J68LyY4wsFYBfUg5feP/6gWWm58IEmKQM89hq7KsZNaKtP5TxxrUZZVkNmMJtjbKrGxLNEbHPJxhqy7lAmbC32ZqeF6lTaknRWcYaFpfLUBh/rwaQycCCJmW15Kstv6jRHyJFry2C1ahkkIW0LO75s61+owxK1y3XqweX9m5YLM2DPFeOjn/iiqCKJ+yKXF8t5Yl/kNsqaSCryxPq5xWTFIaP8KSW0RYxqupaUf0RcTNSSdJZGcKYdYA6kdtrtmyBckfKXwqk0pHpUHlwWaffjNRBYFPUDWa8e3Lt/o0R0CdisKDM89cX0pvRHEfM8ca4t0s2Xx4kgo91MPQJ/0c9MQYq0co8MBh7bz1fio0UUHLR4aAIOvOmoYO6kwlEVODSSTliWtOtH6sPkrtctF9ZtJ9GIerBskvhdVS5cFNv9s1BU0AbdUgdK4FG+dRnjFmDTzniRMdZO1QhzMK355vigbdkpz9P6qjUGE5J2qAcXmwJ20cZUiAD0z+pGMx6xkzJkmEf40Hr4qZfVg2XzF9YOyoV5BjzVkUJngKf8lgNYwKECEHrCNDrWZzMlflS3yBhr/InyoUgBc/lKT4pxVrrC6g1YwcceK3BmNxZcAtz3j5EIpqguh9H6wc011YN75cKDLpFDxuwkrPQmUwW4KTbj9mZTwBwLq4aQMUZbHm1rylJ46dzR0dua2n3RYCWZsiHROeywyJGR7mXKlpryyCiouY56sFkBWEnkEB/raeh/Sw4162KeuAxMQpEkzy5alMY5wamMsWKKrtW2WpEWNnReZWONKWjrdsKZarpFjqCslq773PLmEhM448Pc3+FKr1+94vv/rfw4tEcu+lKTBe4kZSdijBrykwv9vbCMPcLQTygBjzVckSLPRVGslqdunwJ4oegtFOYb4SwxNgWLCmD7T9kVjTv5YDgpo0XBmN34Z/rEHp0sgyz7lngsrm4lvMm2Mr1zNOJYJ5cuxuQxwMGJq/TP5emlb8fsQBZviK4t8hFL+zbhtlpwaRSxQRWfeETjuauPsdGxsBVdO7nmP4xvzSoT29pRl7kGqz+k26B3Oy0YNV+SXbbQas1ctC/GarskRdFpKczVAF1ZXnLcpaMuzVe6lZ2g/1ndcvOVgRG3sdUAY1bKD6achijMPdMxV4muKVorSpiDHituH7rSTs7n/4y5DhRXo4FVBN4vO/zbAcxhENzGbHCzU/98Mcx5e7a31kWjw9FCe/zNeYyQjZsWb1uc7U33pN4Mji6hCLhivqfa9Ss6xLg031AgfesA/l99m9fgvnaF9JoE6bYKmkGNK3aPbHB96w3+DnxFm4hs0drLsk7U8kf/N/CvwQNtllna0rjq61sH8L80HAuvwH1tvBy2ChqWSCaYTaGN19sTvlfzFD6n+iKTbvtayfrfe9ueWh6GJFoxLdr7V72a5ZpvHcCPDzma0wTO4EgbLyedxstO81n57LYBOBzyfsOhUKsW1J1BB5vr/tz8RyqOFylQP9Tvst2JALsC5lsH8PyQ40DV4ANzYa4dedNiKNR1s+x2wwbR7q4/4cTxqEk4LWDebfisuo36JXLiWFjOtLrlNWh3K1rRS4xvHcDNlFnNmWBBAl5SWaL3oPOfnvbr5pdjVnEaeBJSYjuLEkyLLsWhKccadmOphZkOPgVdalj2QpSmfOsADhMWE2ZBu4+EEJI4wKTAuCoC4xwQbWXBltpxbjkXJtKxxabo9e7tyhlgb6gNlSbUpMh+l/FaqzVwewGu8BW1Zx7pTpQDJUjb8tsUTW6+GDXbMn3mLbXlXJiGdggxFAoUrtPS3wE4Nk02UZG2OOzlk7fRs7i95QCLo3E0jtrjnM7SR3uS1p4qtS2nJ5OwtQVHgOvArLBFijZUV9QtSl8dAY5d0E0hM0w3HS2DpIeB6m/A1+HfhJcGUq4sOxH+x3f5+VO+Ds9rYNI7zPXOYWPrtf8bYMx6fuOAX5jzNR0PdsuON+X1f7EERxMJJoU6GkTEWBvVolVlb5lh3tKCg6Wx1IbaMDdJ+9sUCc5KC46hKGCk3IVOS4TCqdBNfUs7Kd4iXf2RjnT/LLysJy3XDcHLh/vde3x8DoGvwgsa67vBk91G5Pe/HbOe7xwym0NXbtiuuDkGO2IJDh9oQvJ4cY4vdoqLDuoH9Zl2F/ofsekn8lkuhIlhQcffUtSjytFyp++p6NiE7Rqx/lodgKVoceEp/CP4FfjrquZaTtj2AvH5K/ywpn7M34K/SsoYDAdIN448I1/0/wveW289T1/lX5xBzc8N5IaHr0XMOQdHsIkDuJFifj20pBm5jzwUv9e2FhwRsvhAbalCIuIw3bhJihY3p6nTFFIZgiSYjfTf3aXuOjmeGn4bPoGvwl+CFzTRczBIuHBEeImHc37/lGfwZR0cXzVDOvaKfNHvwe+suZ771K/y/XcBlsoN996JpBhoE2toYxOznNEOS5TJc6Id5GEXLjrWo+LEWGNpPDU4WAwsIRROu+1vM+0oW37z/MBN9kqHnSArwPfgFJ7Cq/Ai3Ie7g7ncmI09v8sjzw9mzOAEXoIHxURueaAce5V80f/DOuuZwHM8vsMb5wBzOFWM7wymTXPAEvm4vcFpZ2ut0VZRjkiP2MlmLd6DIpbGSiHOjdnUHN90hRYmhTnmvhzp1iKDNj+b7t5hi79lWGwQ+HN9RsfFMy0FXbEwhfuczKgCbyxYwBmcFhhvo/7a44v+i3XWcwDP86PzpGQYdWh7csP5dBvZ1jNzdxC8pBGuxqSW5vw40nBpj5JhMwvOzN0RWqERHMr4Lv1kWX84xLR830G3j6yqZ1a8UstTlW+qJPOZ+sZ7xZPKTJLhiNOAFd6tk+jrTH31ncLOxid8+nzRb128HhUcru/y0Wn6iT254YPC6FtVSIMoW2sk727AhvTtrWKZTvgsmckfXYZWeNRXx/3YQ2OUxLDrbHtN11IwrgXT6c8dATDwLniYwxzO4RzuQqTKSC5gAofMZ1QBK3zQ4JWobFbcvJm87FK+6JXrKahLn54m3p+McXzzYtP8VF/QpJuh1OwieElEoI1pRxPS09FBrkq2tWCU59+HdhNtTIqKm8EBrw2RTOEDpG3IKo2Y7mFdLm3ZeVjYwVw11o/oznceMve4CgMfNym/utA/d/ILMR7gpXzRy9eDsgLcgbs8O2Va1L0zzIdwGGemTBuwROHeoMShkUc7P+ISY3KH5ZZeWqO8mFTxQYeXTNuzvvK5FGPdQfuu00DwYFY9dyhctEt+OJDdnucfpmyhzUJzfsJjr29l8S0bXBfwRS9ZT26tmMIdZucch5ZboMz3Nio3nIOsYHCGoDT4kUA9MiXEp9Xsui1S8th/kbWIrMBxDGLodWUQIWcvnXy+9M23xPiSMOiRPqM+YMXkUN3gXFrZJwXGzUaMpJfyRS9ZT0lPe8TpScuRlbMHeUmlaKDoNuy62iWNTWNFYjoxFzuJs8oR+RhRx7O4SVNSXpa0ZJQ0K1LAHDQ+D9IepkMXpcsq5EVCvClBUIzDhDoyKwDw1Lc59GbTeORivugw1IcuaEOaGWdNm+Ps5fQ7/tm0DjMegq3yM3vb5j12qUId5UZD2oxDSEWOZMSqFl/W+5oynWDa/aI04tJRQ2eTXusg86SQVu/nwSYwpW6wLjlqIzwLuxGIvoAvul0PS+ZNz0/akp/pniO/8JDnGyaCkzbhl6YcqmK/69prxPqtpx2+Km9al9sjL+rwMgHw4jE/C8/HQ3m1vBuL1fldbzd8mOueVJ92syqdEY4KJjSCde3mcRw2TA6szxedn+zwhZMps0XrqEsiUjnC1hw0TELC2Ek7uAAdzcheXv1BYLagspxpzSAoZZUsIzIq35MnFQ9DOrlNB30jq3L4pkhccKUAA8/ocvN1Rzx9QyOtERs4CVsJRK/DF71kPYrxYsGsm6RMh4cps5g1DOmM54Ly1ii0Hd3Y/BMk8VWFgBVmhqrkJCPBHAolwZaWzLR9Vb7bcWdX9NyUYE+uB2BKfuaeBUcjDljbYVY4DdtsVWvzRZdWnyUzDpjNl1Du3aloAjVJTNDpcIOVVhrHFF66lLfJL1zJr9PQ2nFJSBaKoDe+sAvLufZVHVzYh7W0h/c6AAZ+7Tvj6q9j68G/cTCS/3n1vLKHZwNi+P+pS0WkZNMBMUl+LDLuiE4omZy71r3UFMwNJV+VJ/GC5ixVUkBStsT4gGKh0Gm4Oy3qvq7Lbmq24nPdDuDR9deR11XzP4vFu3TYzfnIyiSVmgizUYGqkIXNdKTY9pgb9D2Ix5t0+NHkVzCdU03suWkkVZAoCONCn0T35gAeW38de43mf97sMOpSvj4aa1KYUm58USI7Wxxes03bAZdRzk6UtbzMaCQ6IxO0dy7X+XsjoD16hpsBeGz9dfzHj+R/Hp8nCxZRqkEDTaCKCSywjiaoMJ1TITE9eg7Jqnq8HL6gDwiZb0u0V0Rr/rmvqjxKuaLCX7ZWXTvAY+uvm3z8CP7nzVpngqrJpZKwWnCUjIviYVlirlGOzPLI3SMVyp/elvBUjjDkNhrtufFFErQ8pmdSlbK16toBHlt/HV8uHMX/vEGALkV3RJREiSlopxwdMXOZPLZ+ix+kAHpMKIk8UtE1ygtquttwxNhphrIZ1IBzjGF3IIGxGcBj6q8bHJBG8T9vdsoWrTFEuebEZuVxhhClH6P5Zo89OG9fwHNjtNQTpD0TG9PJLEYqvEY6Rlxy+ZZGfL0Aj62/bnQCXp//eeM4KzfQVJbgMQbUjlMFIm6TpcfWlZje7NBSV6IsEVmumWIbjiloUzQX9OzYdo8L1wjw2PrrpimONfmfNyzKklrgnEkSzT5QWYQW40YShyzqsRmMXbvVxKtGuYyMKaU1ugenLDm5Ily4iT14fP11Mx+xJv+zZ3MvnfdFqxU3a1W/FTB4m3Qfsyc1XUcdVhDeUDZXSFHHLQj/Y5jtC7ZqM0CXGwB4bP11i3LhOvzPGygYtiUBiwQV/4wFO0majijGsafHyRLu0yG6q35cL1rOpVxr2s5cM2jJYMCdc10Aj6q/blRpWJ//+dmm5psMl0KA2+AFRx9jMe2WbC4jQxnikd4DU8TwUjRVacgdlhmr3bpddzuJ9zXqr2xnxJfzP29RexdtjDVZqzkqa6PyvcojGrfkXiJ8SEtml/nYskicv0ivlxbqjemwUjMw5evdg8fUX9nOiC/lf94Q2i7MURk9nW1MSj5j8eAyV6y5CN2S6qbnw3vdA1Iwq+XOSCl663udN3IzLnrt+us25cI1+Z83SXQUldqQq0b5XOT17bGpLd6ssN1VMPf8c+jG8L3NeCnMdF+Ra3fRa9dft39/LuZ/3vwHoHrqGmQFafmiQw6eyzMxS05K4bL9uA+SKUQzCnSDkqOGokXyJvbgJ/BHI+qvY69//4rl20NsmK2ou2dTsyIALv/91/8n3P2Aao71WFGi8KKv1fRC5+J67Q/507/E/SOshqN5TsmYIjVt+kcjAx98iz/4SaojbIV1rexE7/C29HcYD/DX4a0rBOF5VTu7omsb11L/AWcVlcVZHSsqGuXLLp9ha8I//w3Mv+T4Ew7nTBsmgapoCrNFObIcN4pf/Ob/mrvHTGqqgAupL8qWjWPS9m/31jAe4DjA+4+uCoQoT/zOzlrNd3qd4SdphFxsUvYwGWbTWtISc3wNOWH+kHBMfc6kpmpwPgHWwqaSUG2ZWWheYOGQGaHB+eQ/kn6b3pOgLV+ODSn94wDvr8Bvb70/LLuiPPEr8OGVWfDmr45PZyccEmsVXZGe1pRNX9SU5+AVQkNTIVPCHF/jGmyDC9j4R9LfWcQvfiETmgMMUCMN1uNCakkweZsowdYobiMSlnKA93u7NzTXlSfe+SVbfnPQXmg9LpYAQxpwEtONyEyaueWM4FPjjyjG3uOaFmBTWDNgBXGEiQpsaWhnAqIijB07Dlsy3fUGeP989xbWkyf+FF2SNEtT1E0f4DYYVlxFlbaSMPIRMk/3iMU5pME2SIWJvjckciebkQuIRRyhUvkHg/iUljG5kzVog5hV7vIlCuBrmlhvgPfNHQM8lCf+FEGsYbMIBC0qC9a0uuy2wLXVbLBaP5kjHokCRxapkQyzI4QEcwgYHRZBp+XEFTqXFuNVzMtjXLJgX4gAid24Hjwc4N3dtVSe+NNiwTrzH4WVUOlDobUqr1FuAgYllc8pmzoVrELRHSIW8ViPxNy4xwjBpyR55I6J220qQTZYR4guvUICJiSpr9gFFle4RcF/OMB7BRiX8sSfhpNSO3lvEZCQfLUVTKT78Ek1LRLhWN+yLyTnp8qWUZ46b6vxdRGXfHVqx3eI75YaLa4iNNiK4NOW7wPW6lhbSOF9/M9qw8e/aoB3d156qTzxp8pXx5BKAsYSTOIIiPkp68GmTq7sZtvyzBQaRLNxIZ+paozHWoLFeExIhRBrWitHCAHrCF7/thhD8JhYz84wg93QRV88wLuLY8zF8sQ36qF1J455bOlgnELfshKVxYOXKVuKx0jaj22sczTQqPqtV/XDgpswmGTWWMSDw3ssyUunLLrVPGjYRsH5ggHeHSWiV8kT33ycFSfMgkoOK8apCye0J6VW6GOYvffgU9RWsukEi2kUV2nl4dOYUzRik9p7bcA4ggdJ53LxKcEe17B1R8eqAd7dOepV8sTXf5lhejoL85hUdhDdknPtKHFhljOT+bdq0hxbm35p2nc8+Ja1Iw+tJykgp0EWuAAZYwMVwac5KzYMslhvgHdHRrxKnvhTYcfKsxTxtTETkjHO7rr3zjoV25lAQHrqpV7bTiy2aXMmUhTBnKS91jhtR3GEoF0oLnWhWNnYgtcc4N0FxlcgT7yz3TgNIKkscx9jtV1ZKpWW+Ub1tc1eOv5ucdgpx+FJy9pgbLE7xDyXb/f+hLHVGeitHOi6A7ybo3sF8sS7w7cgdk0nJaOn3hLj3uyD0Zp5pazFIUXUpuTTU18d1EPkDoX8SkmWTnVIozEdbTcZjoqxhNHf1JrSS/AcvHjZ/SMHhL/7i5z+POsTUh/8BvNfYMTA8n+yU/MlTZxSJDRStqvEuLQKWwDctMTQogUDyQRoTQG5Kc6oQRE1yV1jCA7ri7jdZyK0sYTRjCR0Hnnd+y7nHxNgTULqw+8wj0mQKxpYvhjm9uSUxg+TTy7s2GtLUGcywhXSKZN275GsqlclX90J6bRI1aouxmgL7Q0Nen5ziM80SqMIo8cSOo+8XplT/5DHNWsSUr/6lLN/QQ3rDyzLruEW5enpf7KqZoShEduuSFOV7DLX7Ye+GmXb6/hnNNqKsVXuMDFpb9Y9eH3C6NGEzuOuI3gpMH/I6e+zDiH1fXi15t3vA1czsLws0TGEtmPEJdiiFPwlwKbgLHAFk4P6ZyPdymYYHGE0dutsChQBl2JcBFlrEkY/N5bQeXQ18gjunuMfMfsBlxJSx3niO485fwO4fGD5T/+3fPQqkneWVdwnw/3bMPkW9Wbqg+iC765Zk+xcT98ibKZc2EdgHcLoF8cSOo/Oc8fS+OyEULF4g4sJqXVcmfMfsc7A8v1/yfGXmL9I6Fn5pRwZhsPv0TxFNlAfZCvG+Oohi82UC5f/2IsJo0cTOm9YrDoKhFPEUr/LBYTUNht9zelHXDqwfPCIw4owp3mOcIQcLttWXFe3VZ/j5H3cIc0G6oPbCR+6Y2xF2EC5cGUm6wKC5tGEzhsWqw5hNidUiKX5gFWE1GXh4/Qplw4sVzOmx9QxU78g3EF6wnZlEN4FzJ1QPSLEZz1KfXC7vd8ssGdIbNUYpVx4UapyFUHzJoTOo1McSkeNn1M5MDQfs4qQuhhX5vQZFw8suwWTcyYTgioISk2YdmkhehG4PkE7w51inyAGGaU+uCXADabGzJR1fn3lwkty0asIo8cROm9Vy1g0yDxxtPvHDAmpu+PKnM8Ix1wwsGw91YJqhteaWgjYBmmQiebmSpwKKzE19hx7jkzSWOm66oPbzZ8Yj6kxVSpYjVAuvLzYMCRo3oTQecOOjjgi3NQ4l9K5/hOGhNTdcWVOTrlgYNkEXINbpCkBRyqhp+LdRB3g0OU6rMfW2HPCFFMV9nSp+uB2woepdbLBuJQyaw/ZFysXrlXwHxI0b0LovEkiOpXGA1Ijagf+KUNC6rKNa9bQnLFqYNkEnMc1uJrg2u64ELPBHpkgWbmwKpJoDhMwNbbGzAp7Yg31wS2T5rGtzit59PrKhesWG550CZpHEzpv2NGRaxlNjbMqpmEIzygJqQfjypycs2pg2cS2RY9r8HUqkqdEgKTWtWTKoRvOBPDYBltja2SO0RGjy9UHtxwRjA11ujbKF+ti5cIR9eCnxUg6owidtyoU5tK4NLji5Q3HCtiyF2IqLGYsHViOXTXOYxucDqG0HyttqYAKqYo3KTY1ekyDXRAm2AWh9JmsVh/ccg9WJ2E8YjG201sPq5ULxxX8n3XLXuMInbft2mk80rRGjCGctJ8/GFdmEQ9Ug4FlE1ll1Y7jtiraqm5Fe04VV8lvSVBL8hiPrfFVd8+7QH3Qbu2ipTVi8cvSGivc9cj8yvH11YMHdNSERtuOslM97feYFOPKzGcsI4zW0YGAbTAOaxCnxdfiYUmVWslxiIblCeAYr9VYR1gM7GmoPrilunSxxeT3DN/2eBQ9H11+nk1adn6VK71+5+Jfct4/el10/7KBZfNryUunWSCPxPECk1rdOv1WVSrQmpC+Tl46YD3ikQYcpunSQgzVB2VHFhxHVGKDgMEY5GLlQnP7FMDzw7IacAWnO6sBr12u+XanW2AO0wQ8pknnFhsL7KYIqhkEPmEXFkwaN5KQphbkUmG72wgw7WSm9RiL9QT925hkjiVIIhphFS9HKI6/8QAjlpXqg9W2C0apyaVDwKQwrwLY3j6ADR13ZyUNByQXHQu6RY09Hu6zMqXRaNZGS/KEJs0cJEe9VH1QdvBSJv9h09eiRmy0V2uJcqHcShcdvbSNg5fxkenkVprXM9rDVnX24/y9MVtncvbKY706anNl3ASll9a43UiacVquXGhvq4s2FP62NGKfQLIQYu9q1WmdMfmUrDGt8eDS0cXozH/fjmUH6Jruvm50hBDSaEU/2Ru2LEN/dl006TSc/g7tfJERxGMsgDUEr104pfWH9lQaN+M4KWQjwZbVc2rZVNHsyHal23wZtIs2JJqtIc/WLXXRFCpJkfE9jvWlfFbsNQ9pP5ZBS0zKh4R0aMFj1IjTcTnvi0Zz2rt7NdvQb2mgbju1plsH8MmbnEk7KbK0b+wC2iy3aX3szW8xeZvDwET6hWZYwqTXSSG+wMETKum0Dq/q+x62gt2ua2ppAo309TRk9TPazfV3qL9H8z7uhGqGqxNVg/FKx0HBl9OVUORn8Q8Jx9gFttGQUDr3tzcXX9xGgN0EpzN9mdZ3GATtPhL+CjxFDmkeEU6x56kqZRusLzALXVqkCN7zMEcqwjmywDQ6OhyUe0Xao1Qpyncrg6wKp9XfWDsaZplElvQ/b3sdweeghorwBDlHzgk1JmMc/wiERICVy2VJFdMjFuLQSp3S0W3+sngt2njwNgLssFGVQdJ0tu0KH4ky1LW4yrbkuaA6Iy9oz/qEMMXMMDWyIHhsAyFZc2peV9hc7kiKvfULxCl9iddfRK1f8kk9qvbdOoBtOg7ZkOZ5MsGrSHsokgLXUp9y88smniwWyuFSIRVmjplga3yD8Uij5QS1ZiM4U3Qw5QlSm2bXjFe6jzzBFtpg+/YBbLAWG7OPynNjlCw65fukGNdkJRf7yM1fOxVzbxOJVocFoYIaGwH22mIQkrvu1E2nGuebxIgW9U9TSiukPGU+Lt++c3DJPKhyhEEbXCQLUpae2exiKy6tMPe9mDRBFCEMTWrtwxN8qvuGnt6MoihKWS5NSyBhbH8StXoAz8PLOrRgLtOT/+4vcu+7vDLnqNvztOq7fmd8sMmY9Xzn1zj8Dq8+XVdu2Nv0IIySgEdQo3xVHps3Q5i3fLFsV4aiqzAiBhbgMDEd1uh8qZZ+lwhjkgokkOIv4xNJmyncdfUUzgB4oFMBtiu71Xumpz/P+cfUP+SlwFExwWW62r7b+LSPxqxn/gvMZ5z9C16t15UbNlq+jbGJtco7p8wbYlL4alSyfWdeuu0j7JA3JFNuVAwtst7F7FhWBbPFNKIUORndWtLraFLmMu7KFVDDOzqkeaiN33YAW/r76wR4XDN/yN1z7hejPau06EddkS/6XThfcz1fI/4K736fO48vlxt2PXJYFaeUkFS8U15XE3428xdtn2kc8GQlf1vkIaNRRnOMvLTWrZbElEHeLWi1o0dlKPAh1MVgbbVquPJ5+Cr8LU5/H/+I2QlHIU2ClXM9G8v7Rr7oc/hozfUUgsPnb3D+I+7WF8kNO92GY0SNvuxiE+2Bt8prVJTkzE64sfOstxuwfxUUoyk8VjcTlsqe2qITSFoSj6Epd4KsT6BZOWmtgE3hBfir8IzZDwgV4ZTZvD8VvPHERo8v+vL1DASHTz/i9OlKueHDjK5Rnx/JB1Vb1ioXdBra16dmt7dgik10yA/FwJSVY6XjA3oy4SqM2frqDPPSRMex9qs3XQtoWxMj7/Er8GWYsXgjaVz4OYumP2+9kbxvny/6kvWsEBw+fcb5bInc8APdhpOSs01tEqIkoiZjbAqKMruLbJYddHuHFRIyJcbdEdbl2sVLaySygunutBg96Y2/JjKRCdyHV+AEFtTvIpbKIXOamknYSiB6KV/0JetZITgcjjk5ZdaskBtWO86UF0ap6ozGXJk2WNiRUlCPFir66lzdm/SLSuK7EUdPz8f1z29Skq6F1fXg8+5UVR6bszncP4Tn4KUkkdJ8UFCY1zR1i8RmL/qQL3rlei4THG7OODlnKko4oI01kd3CaM08Ia18kC3GNoVaO9iDh+hWxSyTXFABXoau7Q6q9OxYg/OVEMw6jdbtSrJ9cBcewGmaZmg+bvkUnUUaGr+ZfnMH45Ivevl61hMcXsxYLFTu1hTm2zViCp7u0o5l+2PSUh9bDj6FgYypufBDhqK2+oXkiuHFHR3zfj+9PtA8oR0xnqX8qn+sx3bFODSbbF0X8EUvWQ8jBIcjo5bRmLOljDNtcqNtOe756h3l0VhKa9hDd2l1eqmsnh0MNMT/Cqnx6BInumhLT8luljzQ53RiJeA/0dxe5NK0o2fA1+GLXr6eNQWHNUOJssQaTRlGpLHKL9fD+IrQzTOMZS9fNQD4AnRNVxvTdjC+fJdcDDWQcyB00B0t9BDwTxXgaAfzDZ/DBXzRnfWMFRwuNqocOmX6OKNkY63h5n/fFcB28McVHqnXZVI27K0i4rDLNE9lDKV/rT+udVbD8dFFu2GGZ8mOt0kAXcoX3ZkIWVtw+MNf5NjR2FbivROHmhV1/pj2egv/fMGIOWTIWrV3Av8N9imV9IWml36H6cUjqEWNv9aNc+veb2sH46PRaHSuMBxvtW+twxctq0z+QsHhux8Q7rCY4Ct8lqsx7c6Sy0dl5T89rIeEuZKoVctIk1hNpfavER6yyH1Vvm3MbsUHy4ab4hWr/OZPcsRBphnaV65/ZcdYPNNwsjN/djlf9NqCw9U5ExCPcdhKxUgLSmfROpLp4WSUr8ojdwbncbvCf+a/YzRaEc6QOvXcGO256TXc5Lab9POvB+AWY7PigWYjzhifbovuunzRawsO24ZqQQAqguBtmpmPB7ysXJfyDDaV/aPGillgz1MdQg4u5MYaEtBNNHFjkRlSpd65lp4hd2AVPTfbV7FGpyIOfmNc/XVsPfg7vzaS/3nkvLL593ANLvMuRMGpQIhiF7kUEW9QDpAUbTWYBcbp4WpacHHY1aacqQyjGZS9HI3yCBT9kUZJhVOD+zUDvEH9ddR11fzPcTDQ5TlgB0KwqdXSavk9BC0pKp0WmcuowSw07VXmXC5guzSa4p0UvRw2lbDiYUx0ExJJRzWzi6Gm8cnEkfXXsdcG/M/jAJa0+bmCgdmQ9CYlNlSYZOKixmRsgiFxkrmW4l3KdFKv1DM8tk6WxPYJZhUUzcd8Kdtgrw/gkfXXDT7+avmfVak32qhtkg6NVdUS5wgkru1YzIkSduTW1FDwVWV3JQVJVuieTc0y4iDpFwc7/BvSalvKdQM8sv662cevz/+8sQVnjVAT0W2wLllw1JiMhJRxgDjCjLQsOzSFSgZqx7lAW1JW0e03yAD3asC+GD3NbQhbe+mN5GXH1F83KDOM4n/e5JIuH4NpdQARrFPBVptUNcjj4cVMcFSRTE2NpR1LEYbYMmfWpXgP9KejaPsLUhuvLCsVXznAG9dfx9SR1ud/3hZdCLHb1GMdPqRJgqDmm76mHbvOXDtiO2QPUcKo/TWkQ0i2JFXpBoo7vij1i1Lp3ADAo+qvG3V0rM//vFnnTE4hxd5Ka/Cor5YEdsLVJyKtDgVoHgtW11pWSjolPNMnrlrVj9Fv2Qn60twMwKPqr+N/wvr8z5tZcDsDrv06tkqyzESM85Ycv6XBWA2birlNCXrI6VbD2lx2L0vQO0QVTVVLH4SE67fgsfVXv8n7sz7/85Z7cMtbE6f088wSaR4kCkCm10s6pKbJhfqiUNGLq+0gLWC6eUAZFPnLjwqtKd8EwGvWX59t7iPW4X/eAN1svgRVSY990YZg06BD1ohLMtyFTI4pKTJsS9xREq9EOaPWiO2gpms7397x6nQJkbh+Fz2q/rqRROX6/M8bJrqlVW4l6JEptKeUFuMYUbtCQ7CIttpGc6MY93x1r1vgAnRXvY5cvwWPqb9uWQm+lP95QxdNMeWhOq1x0Db55C7GcUv2ZUuN6n8iKzsvOxibC//Yfs9Na8r2Rlz02vXXDT57FP/zJi66/EJSmsJKa8QxnoqW3VLQ+jZVUtJwJ8PNX1NQCwfNgdhhHD9on7PdRdrdGPF28rJr1F+3LBdeyv+8yYfLoMYet1vX4upNAjVvwOUWnlNXJXlkzk5Il6kqeoiL0C07qno+/CYBXq/+utlnsz7/Mzvy0tmI4zm4ag23PRN3t/CWryoUVJGm+5+K8RJ0V8Hc88/XHUX/HfiAq7t+BH+x6v8t438enWmdJwFA6ZINriLGKv/95f8lT9/FnyA1NMVEvQyaXuu+gz36f/DD73E4pwqpLcvm/o0Vle78n//+L/NPvoefp1pTJye6e4A/D082FERa5/opeH9zpvh13cNm19/4v/LDe5xMWTi8I0Ta0qKlK27AS/v3/r+/x/2GO9K2c7kVMonDpq7//jc5PKCxeNPpFVzaRr01wF8C4Pu76hXuX18H4LduTr79guuFD3n5BHfI+ZRFhY8w29TYhbbLi/bvBdqKE4fUgg1pBKnV3FEaCWOWyA+m3WpORZr/j+9TKJtW8yBTF2/ZEODI9/QavHkVdGFp/Pjn4Q+u5hXapsP5sOH+OXXA1LiKuqJxiMNbhTkbdJTCy4llEt6NnqRT4dhg1V3nbdrm6dYMecA1yTOL4PWTE9L5VzPFlLBCvlG58AhehnN4uHsAYinyJ+AZ/NkVvELbfOBUuOO5syBIEtiqHU1k9XeISX5bsimrkUUhnGDxourN8SgUsCZVtKyGbyGzHXdjOhsAvOAswSRyIBddRdEZWP6GZhNK/yjwew9ehBo+3jEADu7Ay2n8mDc+TS7awUHg0OMzR0LABhqLD4hJEh/BEGyBdGlSJoXYXtr+3HS4ijzVpgi0paWXtdruGTknXBz+11qT1Q2inxaTzQCO46P3lfLpyS4fou2PH/PupwZgCxNhGlj4IvUuWEsTkqMWm6i4xCSMc9N1RDQoCVcuGItJ/MRWefais+3synowi/dESgJjkilnWnBTGvRWmaw8oR15257t7CHmCf8HOn7cwI8+NQBXMBEmAa8PMRemrNCEhLGEhDQKcGZWS319BX9PFBEwGTbRBhLbDcaV3drFcDqk5kCTd2JF1Wp0HraqBx8U0wwBTnbpCadwBA/gTH/CDrcCs93LV8E0YlmmcyQRQnjBa8JESmGUfIjK/7fkaDJpmD2QptFNVJU1bbtIAjjWQizepOKptRjbzR9Kag6xZmMLLjHOtcLT3Tx9o/0EcTT1XN3E45u24AiwEypDJXihKjQxjLprEwcmRKclaDNZCVqr/V8mYWyFADbusiY5hvgFoU2vio49RgJLn5OsReRFN6tabeetiiy0V7KFHT3HyZLx491u95sn4K1QQSPKM9hNT0wMVvAWbzDSVdrKw4zRjZMyJIHkfq1VAVCDl/bUhNKlGq0zGr05+YAceXVPCttVk0oqjVwMPt+BBefx4yPtGVkUsqY3CHDPiCM5ngupUwCdbkpd8kbPrCWHhkmtIKLEetF2499eS1jZlIPGYnlcPXeM2KD9vLS0bW3ktYNqUllpKLn5ZrsxlIzxvDu5eHxzGLctkZLEY4PgSOg2IUVVcUONzUDBEpRaMoXNmUc0tFZrTZquiLyKxrSm3DvIW9Fil+AkhXu5PhEPx9mUNwqypDvZWdKlhIJQY7vn2OsnmBeOWnYZ0m1iwbbw1U60by5om47iHRV6fOgzjMf/DAZrlP40Z7syxpLK0lJ0gqaAK1c2KQKu7tabTXkLFz0sCftuwX++MyNeNn68k5Buq23YQhUh0SNTJa1ioQ0p4nUG2y0XilF1JqODqdImloPS4Bp111DEWT0jJjVv95uX9BBV7eB3bUWcu0acSVM23YZdd8R8UbQUxJ9wdu3oMuhdt929ME+mh6JXJ8di2RxbTi6TbrDquqV4aUKR2iwT6aZbyOwEXN3DUsWr8Hn4EhwNyHuXHh7/pdaUjtR7vnDh/d8c9xD/s5f501eQ1+CuDiCvGhk1AN/4Tf74RfxPwD3toLarR0zNtsnPzmS64KIRk861dMWCU8ArasG9T9H0ZBpsDGnjtAOM2+/LuIb2iIUGXNgl5ZmKD/Tw8TlaAuihaFP5yrw18v4x1898zIdP+DDAX1bM3GAMvPgRP/cJn3zCW013nrhHkrITyvYuwOUkcHuKlRSW5C6rzIdY4ppnF7J8aAJbQepgbJYBjCY9usGXDKQxq7RZfh9eg5d1UHMVATRaD/4BHK93/1iAgYZ/+jqPn8Dn4UExmWrpa3+ZOK6MvM3bjwfzxNWA2dhs8+51XHSPJiaAhGSpWevEs5xHLXcEGFXYiCONySH3fPWq93JIsBiSWvWyc3CAN+EcXoT7rCSANloPPoa31rt/5PUA/gp8Q/jDD3hyrjzlR8VkanfOvB1XPubt17vzxAfdSVbD1pzAnfgyF3ycadOTOTXhpEUoLC1HZyNGW3dtmjeXgr2r56JNmRwdNNWaQVBddd6rh4MhviEB9EFRD/7RGvePvCbwAL4Mx/D6M541hHO4D3e7g6PafdcZVw689z7NGTwo5om7A8sPhccT6qKcl9NJl9aM/9kX+e59Hh1yPqGuCCZxuITcsmNaJ5F7d0q6J3H48TO1/+M57085q2icdu2U+W36Ldllz9Agiv4YGljoEN908EzvDOrBF98/vtJwCC/BF2AG75xxEmjmMIcjxbjoaxqOK3/4hPOZzhMPBpYPG44CM0dTVm1LjLtUWWVz1Bcf8tEx0zs8O2A2YVHRxKYOiy/aOVoAaMu0i7ubu43njjmd4ibMHU1sIDHaQNKrZND/FZYdk54oCXetjq7E7IVl9eAL7t+oHnwXXtLx44czzoRFHBztYVwtH1d+NOMkupZ5MTM+gUmq90X+Bh9zjRlmaQ+m7YMqUL/veemcecAtOJ0yq1JnVlN27di2E0+Klp1tAJ4KRw1eMI7aJjsO3R8kPSI3fUFXnIOfdQe86sIIVtWDL7h//Ok6vj8vwDk08NEcI8zz7OhBy+WwalzZeZ4+0XniRfst9pAJqQHDGLzVQ2pheZnnv1OWhwO43/AgcvAEXEVVpa4db9sGvNK8wjaENHkfFQ4Ci5i7dqnQlPoLQrHXZDvO3BIXZbJOBrOaEbML6sFL798I4FhKihjHMsPjBUZYCMFr6nvaArxqXPn4lCa+cHfSa2cP27g3Z3ziYTRrcbQNGLQmGF3F3cBdzzzX7AILx0IB9rbwn9kx2G1FW3Inic+ZLIsVvKR8Zwfj0l1fkqo8LWY1M3IX14OX3r9RKTIO+d9XzAI8qRPGPn/4NC2n6o4rN8XJ82TOIvuVA8zLKUHRFgBCetlDZlqR1gLKjS39xoE7Bt8UvA6BxuEDjU3tFsEijgA+615tmZkXKqiEENrh41iLDDZNq4pKTWR3LZfnos81LOuNa15cD956vLMsJd1rqYp51gDUQqMYm2XsxnUhD2jg1DM7SeuJxxgrmpfISSXVIJIS5qJJSvJPEQ49DQTVIbYWJ9QWa/E2+c/oPK1drmC7WSfJRNKBO5Yjvcp7Gc3dmmI/Xh1kDTEuiSnWqQf37h+fTMhGnDf6dsS8SQfQWlqqwXXGlc/PEZ/SC5mtzIV0nAshlQdM/LvUtYutrEZ/Y+EAFtq1k28zQhOwLr1AIeANzhF8t9qzTdZf2qRKO6MWE9ohBYwibbOmrFtNmg3mcS+tB28xv2uKd/agYCvOP+GkSc+0lr7RXzyufL7QbkUpjLjEWFLqOIkAGu2B0tNlO9Eau2W1qcOUvVRgKzypKIQZ5KI3q0MLzqTNRYqiZOqmtqloIRlmkBHVpHmRYV6/HixbO6UC47KOFJnoMrVyr7wYz+SlW6GUaghYbY1I6kkxA2W1fSJokUdSh2LQ1GAimRGm0MT+uu57H5l7QgOWxERpO9moLRPgTtquWCfFlGlIjQaRly9odmzMOWY+IBO5tB4sW/0+VWGUh32qYk79EidWKrjWuiLpiVNGFWFRJVktyeXWmbgBBzVl8anPuXyNJlBJOlKLTgAbi/EYHVHxWiDaVR06GnHQNpJcWcK2jJtiCfG2sEHLzuI66sGrMK47nPIInPnu799935aOK2cvmvubrE38ZzZjrELCmXM2hM7UcpXD2oC3+ECVp7xtIuxptJ0jUr3sBmBS47TVxlvJ1Sqb/E0uLdvLj0lLr29ypdd/eMX3f6lrxGlKwKQxEGvw0qHbkbwrF3uHKwVENbIV2wZ13kNEF6zD+x24aLNMfDTCbDPnEikZFyTNttxWBXDaBuM8KtI2rmaMdUY7cXcUPstqTGvBGSrFWIpNMfbdea990bvAOC1YX0qbc6smDS1mPxSJoW4fwEXvjMmhlijDRq6qale6aJEuFGoppYDoBELQzLBuh/mZNx7jkinv0EtnUp50lO9hbNK57lZaMAWuWR5Yo9/kYwcYI0t4gWM47Umnl3YmpeBPqSyNp3K7s2DSAS/39KRuEN2bS4xvowV3dFRMx/VFcp2Yp8w2nTO9hCXtHG1kF1L4KlrJr2wKfyq77R7MKpFKzWlY9UkhYxyHWW6nBWPaudvEAl3CGcNpSXPZ6R9BbBtIl6cHL3gIBi+42CYXqCx1gfGWe7Ap0h3luyXdt1MKy4YUT9xSF01G16YEdWsouW9mgDHd3veyA97H+Ya47ZmEbqMY72oPztCGvK0onL44AvgC49saZKkWRz4veWljE1FHjbRJaWv6ZKKtl875h4CziFCZhG5rx7tefsl0aRT1bMHZjm8dwL/6u7wCRysaQblQoG5yAQN5zpatMNY/+yf8z+GLcH/Qn0iX2W2oEfXP4GvwQHuIL9AYGnaO3zqAX6946nkgqZNnUhx43DIdQtMFeOPrgy/y3Yd85HlJWwjLFkU3kFwq28xPnuPhMWeS+tDLV9Otllq7pQCf3uXJDN9wFDiUTgefHaiYbdfi3b3u8+iY6TnzhgehI1LTe8lcd7s1wJSzKbahCRxKKztTLXstGAiu3a6rPuQs5pk9TWAan5f0BZmGf7Ylxzzk/A7PAs4QPPPAHeFQ2hbFHszlgZuKZsJcUmbDC40sEU403cEjczstOEypa+YxevL4QBC8oRYqWdK6b7sK25tfE+oDZgtOQ2Jg8T41HGcBE6fTWHn4JtHcu9S7uYgU5KSCkl/mcnq+5/YBXOEr6lCUCwOTOM1taOI8mSxx1NsCXBEmLKbMAg5MkwbLmpBaFOPrNSlO2HnLiEqW3tHEwd8AeiQLmn+2gxjC3k6AxREqvKcJbTEzlpLiw4rNZK6oJdidbMMGX9FULKr0AkW+2qDEPBNNm5QAt2Ik2nftNWHetubosHLo2nG4vQA7GkcVCgVCgaDixHqo9UUn1A6OshapaNR/LPRYFV8siT1cCtJE0k/3WtaNSuUZYKPnsVIW0xXWnMUxq5+En4Kvw/MqQmVXnAXj9Z+9zM98zM/Agy7F/qqj2Nh67b8HjFnPP3iBn/tkpdzwEJX/whIcQUXOaikeliCRGUk7tiwF0rItwMEhjkZ309hikFoRAmLTpEXWuHS6y+am/KB/fM50aLEhGnSMwkpxzOov4H0AvgovwJ1iGzDLtJn/9BU+fAINfwUe6FHSLhu83viV/+/HrOePX+STT2B9uWGbrMHHLldRBlhS/CJQmcRxJFqZica01XixAZsYiH1uolZxLrR/SgxVIJjkpQP4PE9sE59LKLr7kltSBogS5tyszzH8Fvw8/AS8rNOg0xUS9fIaHwb+6et8Q/gyvKRjf5OusOzGx8evA/BP4IP11uN/grca5O0lcsPLJ5YjwI4QkJBOHa0WdMZYGxPbh2W2nR9v3WxEWqgp/G3+6VZbRLSAAZ3BhdhAaUL33VUSw9yjEsvbaQ9u4A/gGXwZXoEHOuU1GSj2chf+Mo+f8IcfcAxfIKVmyunRbYQVnoevwgfw3TXXcw++xNuP4fhyueEUNttEduRVaDttddoP0eSxLe2LENk6itYxlrxBNBYrNNKSQmeaLcm9c8UsaB5WyO6675yyQIAWSDpBVoA/gxmcwEvwoDv0m58UE7gHn+fJOa8/Ywan8EKRfjsopF83eCglX/Sfr7OeaRoQfvt1CGvIDccH5BCvw1sWIzRGC/66t0VTcLZQZtm6PlAasbOJ9iwWtUo7biktTSIPxnR24jxP1ZKaqq+2RcXM9OrBAm/AAs7hDJ5bNmGb+KIfwCs8a3jnjBrOFeMjHSCdbKr+2uOLfnOd9eiA8Hvvwwq54VbP2OqwkB48Ytc4YEOiH2vTXqodabfWEOzso4qxdbqD5L6tbtNPECqbhnA708DZH4QOJUXqScmUlks7Ot6FBuZw3n2mEbaUX7kDzxHOOQk8nKWMzAzu6ZZ8sOFw4RK+6PcuXo9tB4SbMz58ApfKDXf3szjNIIbGpD5TKTRxGkEMLjLl+K3wlWXBsCUxIDU+jbOiysESqAy1MGUJpXgwbTWzNOVEziIXZrJ+VIztl1PUBxTSo0dwn2bOmfDRPD3TRTGlfbCJvO9KvuhL1hMHhB9wPuPRLGHcdOWG2xc0U+5bQtAJT0nRTewXL1pgk2+rZAdeWmz3jxAqfNQQdzTlbF8uJ5ecEIWvTkevAHpwz7w78QujlD/Lr491bD8/1vhM2yrUQRrWXNQY4fGilfctMWYjL72UL/qS9eiA8EmN88nbNdour+PBbbAjOjIa4iBhfFg6rxeKdEGcL6p3EWR1Qq2Qkhs2DrnkRnmN9tG2EAqmgPw6hoL7Oza7B+3SCrR9tRftko+Lsf2F/mkTndN2LmzuMcKTuj/mX2+4Va3ki16+nnJY+S7MefpkidxwnV+4wkXH8TKnX0tsYzYp29DOOoSW1nf7nTh2akYiWmcJOuTidSaqESrTYpwjJJNVGQr+rLI7WsqerHW6Kp/oM2pKuV7T1QY9gjqlZp41/WfKpl56FV/0kvXQFRyeQ83xaTu5E8p5dNP3dUF34ihyI3GSpeCsywSh22ZJdWto9winhqifb7VRvgktxp13vyjrS0EjvrRfZ62uyqddSWaWYlwTPAtJZ2oZ3j/Sgi/mi+6vpzesfAcWNA0n8xVyw90GVFGuZjTXEQy+6GfLGLMLL523f5E0OmxVjDoOuRiH91RKU+vtoCtH7TgmvBLvtFXWLW15H9GTdVw8ow4IlRLeHECN9ym1e9K0I+Cbnhgv4Yu+aD2HaQJ80XDqOzSGAV4+4yCqBxrsJAX6ZTIoX36QnvzhhzzMfFW2dZVLOJfo0zbce5OvwXMFaZ81mOnlTVXpDZsQNuoYWveketKb5+6JOOsgX+NTm7H49fUTlx+WLuWL7qxnOFh4BxpmJx0p2gDzA/BUARuS6phR+pUsY7MMboAHx5xNsSVfVZcYSwqCKrqon7zM+8ecCkeS4nm3rINuaWvVNnMRI1IRpxTqx8PZUZ0Br/UEduo3B3hNvmgZfs9gQPj8vIOxd2kndir3awvJ6BLvoUuOfFWNYB0LR1OQJoUySKb9IlOBx74q1+ADC2G6rOdmFdJcD8BkfualA+BdjOOzP9uUhGUEX/TwhZsUduwRr8wNuXKurCixLBgpQI0mDbJr9dIqUuV+92ngkJZ7xduCk2yZKbfWrH1VBiTg9VdzsgRjW3CVXCvAwDd+c1z9dWw9+B+8MJL/eY15ZQ/HqvTwVdsZn5WQsgRRnMaWaecu3jFvMBEmgg+FJFZsnSl0zjB9OqPYaBD7qmoVyImFvzi41usesV0julaAR9dfR15Xzv9sEruRDyk1nb+QaLU67T885GTls6YgcY+UiMa25M/pwGrbCfzkvR3e0jjtuaFtnwuagHTSb5y7boBH119HXhvwP487jJLsLJ4XnUkHX5sLbS61dpiAXRoZSCrFJ+EjpeU3puVfitngYNo6PJrAigKktmwjyQdZpfq30mmtulaAx9Zfx15Xzv+cyeuiBFUs9zq8Kq+XB9a4PVvph3GV4E3y8HENJrN55H1X2p8VyqSKwVusJDKzXOZzplWdzBUFK9e+B4+uv468xvI/b5xtSAkBHQaPvtqWzllVvEOxPbuiE6+j2pvjcKsbvI7txnRErgfH7LdXqjq0IokKzga14GzQ23SSbCQvO6r+Or7SMIr/efOkkqSdMnj9mBx2DRsiY29Uj6+qK9ZrssCKaptR6HKURdwUYeUWA2kPzVKQO8ku2nU3Anhs/XWkBx3F/7wJtCTTTIKftthue1ty9xvNYLY/zo5KSbIuKbXpbEdSyeRyYdAIwKY2neyoc3+k1XUaufYga3T9daMUx/r8z1s10ITknIO0kuoMt+TB8jK0lpayqqjsJ2qtXAYwBU932zinimgmd6mTRDnQfr88q36NAI+tv24E8Pr8zxtasBqx0+xHH9HhlrwsxxNUfKOHQaZBITNf0uccj8GXiVmXAuPEAKSdN/4GLHhs/XWj92dN/uetNuBMnVR+XWDc25JLjo5Mg5IZIq226tmCsip2zZliL213YrTlL2hcFjpCduyim3M7/eB16q/blQsv5X/esDRbtJeabLIosWy3ycavwLhtxdWzbMmHiBTiVjJo6lCLjXZsi7p9PEPnsq6X6wd4bP11i0rD5fzPm/0A6brrIsllenZs0lCJlU4abakR59enZKrKe3BZihbTxlyZ2zl1+g0wvgmA166/bhwDrcn/7Ddz0eWZuJvfSESug6NzZsox3Z04FIxz0mUjMwVOOVTq1CQ0AhdbBGVdjG/CgsfUX7esJl3K/7ytWHRv683praW/8iDOCqWLLhpljDY1ZpzK75QiaZoOTpLKl60auHS/97oBXrv+umU9+FL+5+NtLFgjqVLCdbmj7pY5zPCPLOHNCwXGOcLquOhi8CmCWvbcuO73XmMUPab+ug3A6/A/78Bwe0bcS2+tgHn4J5pyS2WbOck0F51Vq3LcjhLvZ67p1ABbaL2H67bg78BfjKi/jr3+T/ABV3ilLmNXTI2SpvxWBtt6/Z//D0z/FXaGbSBgylzlsEGp+5//xrd4/ae4d8DUUjlslfIYS3t06HZpvfQtvv0N7AHWqtjP2pW08QD/FLy//da38vo8PNlKHf5y37Dxdfe/oj4kVIgFq3koLReSR76W/bx//n9k8jonZxzWTANVwEniDsg87sOSd/z7//PvMp3jQiptGVWFX2caezzAXwfgtzYUvbr0iozs32c3Uge7varH+CNE6cvEYmzbPZ9hMaYDdjK4V2iecf6EcEbdUDVUARda2KzO/JtCuDbNQB/iTeL0EG1JSO1jbXS+nLxtPMDPw1fh5+EPrgSEKE/8Gry5A73ui87AmxwdatyMEBCPNOCSKUeRZ2P6Myb5MRvgCHmA9ywsMifU+AYXcB6Xa5GibUC5TSyerxyh0j6QgLVpdyhfArRTTLqQjwe4HOD9s92D4Ap54odXAPBWLAwB02igG5Kkc+piN4lvODIFGAZgT+EO4Si1s7fjSR7vcQETUkRm9O+MXyo9OYhfe4xt9STQ2pcZRLayCV90b4D3jR0DYAfyxJ+eywg2IL7NTMXna7S/RpQ63JhWEM8U41ZyQGjwsVS0QBrEKLu8xwZsbi4wLcCT+OGidPIOCe1PiSc9Qt+go+vYqB7cG+B9d8cAD+WJPz0Am2gxXgU9IneOqDpAAXOsOltVuMzpdakJXrdPCzXiNVUpCeOos5cxnpQT39G+XVLhs1osQVvJKPZyNq8HDwd4d7pNDuWJPxVX7MSzqUDU6gfadKiNlUFTzLeFHHDlzO4kpa7aiKhBPGKwOqxsBAmYkOIpipyXcQSPlRTf+Tii0U3EJGaZsDER2qoB3h2hu0qe+NNwUooYU8y5mILbJe6OuX+2FTKy7bieTDAemaQyQ0CPthljSWO+xmFDIYiESjM5xKd6Ik5lvLq5GrQ3aCMLvmCA9wowLuWJb9xF59hVVP6O0CrBi3ZjZSNOvRy+I6klNVRJYRBaEzdN+imiUXQ8iVF8fsp+W4JXw7WISW7fDh7lptWkCwZ4d7QTXyBPfJMYK7SijjFppGnlIVJBJBYj7eUwtiP1IBXGI1XCsjNpbjENVpSAJ2hq2LTywEly3hUYazt31J8w2+aiLx3g3fohXixPfOMYm6zCGs9LVo9MoW3MCJE7R5u/WsOIjrqBoHUO0bJE9vxBpbhsd3+Nb4/vtPCZ4oZYCitNeYuC/8UDvDvy0qvkiW/cgqNqRyzqSZa/s0mqNGjtKOoTm14zZpUauiQgVfqtQiZjq7Q27JNaSK5ExRcrGCXO1FJYh6jR6CFqK7bZdQZ4t8g0rSlPfP1RdBtqaa9diqtzJkQ9duSryi2brQXbxDwbRUpFMBHjRj8+Nt7GDKgvph9okW7LX47gu0SpGnnFQ1S1lYldOsC7hYteR574ZuKs7Ei1lBsfdz7IZoxzzCVmmVqaSySzQbBVAWDek+N4jh9E/4VqZrJjPwiv9BC1XcvOWgO8275CVyBPvAtTVlDJfZkaZGU7NpqBogAj/xEHkeAuJihWYCxGN6e8+9JtSegFXF1TrhhLGP1fak3pebgPz192/8gB4d/6WT7+GdYnpH7hH/DJzzFiYPn/vjW0SgNpTNuPIZoAEZv8tlGw4+RLxy+ZjnKa5NdFoC7UaW0aduoYse6+bXg1DLg6UfRYwmhGEjqPvF75U558SANrElK/+MdpXvmqBpaXOa/MTZaa1DOcSiLaw9j0NNNst3c+63c7EKTpkvKHzu6bPbP0RkuHAVcbRY8ijP46MIbQeeT1mhA+5PV/inyDdQipf8LTvMXbwvoDy7IruDNVZKTfV4CTSRUYdybUCnGU7KUTDxLgCknqUm5aAW6/1p6eMsOYsphLzsHrE0Y/P5bQedx1F/4yPHnMB3/IOoTU9+BL8PhtjuFKBpZXnYNJxTuv+2XqolKR2UQgHhS5novuxVySJhBNRF3SoKK1XZbbXjVwWNyOjlqWJjrWJIy+P5bQedyldNScP+HZ61xKSK3jyrz+NiHG1hcOLL/+P+PDF2gOkekKGiNWKgJ+8Z/x8Iv4DdQHzcpZyF4v19I27w9/yPGDFQvmEpKtqv/TLiWMfn4sofMm9eAH8Ao0zzh7h4sJqYtxZd5/D7hkYPneDzl5idlzNHcIB0jVlQ+8ULzw/nc5/ojzl2juE0apD7LRnJxe04dMz2iOCFNtGFpTuXA5AhcTRo8mdN4kz30nVjEC4YTZQy4gpC7GlTlrePKhGsKKgeXpCYeO0MAd/GH7yKQUlXPLOasOH3FnSphjHuDvEu4gB8g66oNbtr6eMbFIA4fIBJkgayoXriw2XEDQPJrQeROAlY6aeYOcMf+IVYTU3XFlZufMHinGywaW3YLpObVBAsbjF4QJMsVUSayjk4voPsHJOQfPWDhCgDnmDl6XIRerD24HsGtw86RMHOLvVSHrKBdeVE26gKB5NKHzaIwLOmrqBWJYZDLhASG16c0Tn+CdRhWDgWXnqRZUTnPIHuMJTfLVpkoYy5CzylHVTGZMTwkGAo2HBlkQplrJX6U+uF1wZz2uwS1SQ12IqWaPuO4baZaEFBdukksJmkcTOm+YJSvoqPFzxFA/YUhIvWxcmSdPWTWwbAKVp6rxTtPFUZfKIwpzm4IoMfaYQLWgmlG5FME2gdBgm+J7J+rtS/XBbaVLsR7bpPQnpMFlo2doWaVceHk9+MkyguZNCJ1He+kuHTWyQAzNM5YSUg/GlTk9ZunAsg1qELVOhUSAK0LABIJHLKbqaEbHZLL1VA3VgqoiOKXYiS+HRyaEKgsfIqX64HYWbLRXy/qWoylIV9gudL1OWBNgBgTNmxA6b4txDT4gi3Ri7xFSLxtXpmmYnzAcWDZgY8d503LFogz5sbonDgkKcxGsWsE1OI+rcQtlgBBCSOKD1mtqYpIU8cTvBmAT0yZe+zUzeY92fYjTtGipXLhuR0ePoHk0ofNWBX+lo8Z7pAZDk8mEw5L7dVyZZoE/pTewbI6SNbiAL5xeygW4xPRuLCGbhcO4RIeTMFYHEJkYyEO9HmJfXMDEj/LaH781wHHZEtqSQ/69UnGpzH7LKIAZEDSPJnTesJTUa+rwTepI9dLJEawYV+ZkRn9g+QirD8vF8Mq0jFQ29js6kCS3E1+jZIhgPNanHdHFqFvPJLHqFwQqbIA4jhDxcNsOCCQLDomaL/dr5lyJaJU6FxPFjO3JOh3kVMcROo8u+C+jo05GjMF3P3/FuDLn5x2M04xXULPwaS6hBYki+MrMdZJSgPHlcB7nCR5bJ9Kr5ACUn9jk5kivdd8tk95SOGrtqu9lr2IhK65ZtEl7ZKrp7DrqwZfRUSN1el7+7NJxZbywOC8neNKTch5vsTEMNsoCCqHBCqIPRjIPkm0BjvFODGtto99rCl+d3wmHkW0FPdpZtC7MMcVtGFQjJLX5bdQ2+x9ypdc313uj8xlsrfuLgWXz1cRhZvJYX0iNVBRcVcmCXZs6aEf3RQF2WI/TcCbKmGU3IOoDJGDdDub0+hYckt6PlGu2BcxmhbTdj/klhccLGJMcqRjMJP1jW2ETqLSWJ/29MAoORluJ+6LPffBZbi5gqi5h6catQpmOT7/OFf5UorRpLzCqcMltBLhwd1are3kztrSzXO0LUbXRQcdLh/RdSZ+swRm819REDrtqzC4es6Gw4JCKlSnjYVpo0xeq33PrADbFLL3RuCmObVmPN+24kfa+AojDuM4umKe2QwCf6EN906HwjujaitDs5o0s1y+k3lgbT2W2i7FJdnwbLXhJUBq/9liTctSmFC/0OqUinb0QddTWamtjbHRFuWJJ6NpqZ8vO3fZJ37Db+2GkaPYLGHs7XTTdiFQJ68SkVJFVmY6McR5UycflNCsccHFaV9FNbR4NttLxw4pQ7wJd066Z0ohVbzihaxHVExd/ay04oxUKWt+AsdiQ9OUyZ2krzN19IZIwafSTFgIBnMV73ADj7V/K8u1MaY2sJp2HWm0f41tqwajEvdHWOJs510MaAqN4aoSiPCXtN2KSi46dUxHdaMquar82O1x5jqhDGvqmoE9LfxcY3zqA7/x3HA67r9ZG4O6Cuxu12/+TP+eLP+I+HErqDDCDVmBDO4larujNe7x8om2rMug0MX0rL1+IWwdwfR+p1TNTyNmVJ85ljWzbWuGv8/C7HD/izjkHNZNYlhZcUOKVzKFUxsxxN/kax+8zPWPSFKw80rJr9Tizyj3o1gEsdwgWGoxPezDdZ1TSENE1dLdNvuKL+I84nxKesZgxXVA1VA1OcL49dFlpFV5yJMhzyCmNQ+a4BqusPJ2bB+xo8V9u3x48VVIEPS/mc3DvAbXyoYr6VgDfh5do5hhHOCXMqBZUPhWYbWZECwVJljLgMUWOCB4MUuMaxGNUQDVI50TQ+S3kFgIcu2qKkNSHVoM0SHsgoZxP2d5HH8B9woOk4x5bPkKtAHucZsdykjxuIpbUrSILgrT8G7G5oCW+K0990o7E3T6AdW4TilH5kDjds+H64kS0mz24grtwlzDHBJqI8YJQExotPvoC4JBq0lEjjQkyBZ8oH2LnRsQ4Hu1QsgDTJbO8fQDnllitkxuVskoiKbRF9VwzMDvxHAdwB7mD9yCplhHFEyUWHx3WtwCbSMMTCUCcEmSGlg4gTXkHpZXWQ7kpznK3EmCHiXInqndkQjunG5kxTKEeGye7jWz9cyMR2mGiFQ15ENRBTbCp+Gh86vAyASdgmJq2MC6hoADQ3GosP0QHbnMHjyBQvQqfhy/BUbeHd5WY/G/9LK/8Ka8Jd7UFeNWEZvzPb458Dn8DGLOe3/wGL/4xP+HXlRt+M1PE2iLhR8t+lfgxsuh7AfO2AOf+owWhSZRYQbd622hbpKWKuU+XuvNzP0OseRDa+mObgDHJUSc/pKx31QdKffQ5OIJpt8GWjlgTwMc/w5MPCR/yl1XC2a2Yut54SvOtMev55Of45BOat9aWG27p2ZVORRvnEk1hqWMVUmqa7S2YtvlIpspuF1pt0syuZS2NV14mUidCSfzQzg+KqvIYCMljIx2YK2AO34fX4GWdu5xcIAb8MzTw+j/lyWM+Dw/gjs4GD6ehNgA48kX/AI7XXM/XAN4WHr+9ntywqoCakCqmKP0rmQrJJEErG2Upg1JObr01lKQy4jskWalKYfJ/EDLMpjNSHFEUAde2fltaDgmrNaWQ9+AAb8I5vKjz3L1n1LriB/BXkG/wwR9y/oRX4LlioHA4LzP2inzRx/DWmutRweFjeP3tNeSGlaE1Fde0OS11yOpmbIp2u/jF1n2RRZviJM0yBT3IZl2HWImKjQOxIyeU325b/qWyU9Moj1o07tS0G7qJDoGHg5m8yeCxMoEH8GU45tnrNM84D2l297DQ9t1YP7jki/7RmutRweEA77/HWXOh3HCxkRgldDQkAjNTMl2Iloc1qN5JfJeeTlyTRzxURTdn1Ixv2uKjs12AbdEWlBtmVdk2k7FFwj07PCZ9XAwW3dG+8xKzNFr4EnwBZpy9Qzhh3jDXebBpYcpuo4fQ44u+fD1dweEnHzI7v0xuuOALRUV8rXpFyfSTQYkhd7IHm07jpyhlkCmI0ALYqPTpUxXS+z4jgDj1Pflvmz5ecuItpIBxyTHpSTGWd9g1ApfD/bvwUhL4nT1EzqgX7cxfCcNmb3mPL/qi9SwTHJ49oj5ZLjccbTG3pRmlYi6JCG0mQrAt1+i2UXTZ2dv9IlQpN5naMYtviaXlTrFpoMsl3bOAFEa8sqPj2WCMrx3Yjx99qFwO59Aw/wgx+HlqNz8oZvA3exRDvuhL1jMQHPaOJ0+XyA3fp1OfM3qObEVdhxjvynxNMXQV4+GJyvOEFqeQBaIbbO7i63rpxCltdZShPFxkjM2FPVkn3TG+Rp9pO3l2RzFegGfxGDHIAh8SteR0C4HopXzRF61nheDw6TFN05Ebvq8M3VKKpGjjO6r7nhudTEGMtYM92HTDaR1FDMXJ1eThsbKfywyoWwrzRSXkc51flG3vIid62h29bIcFbTGhfV+faaB+ohj7dPN0C2e2lC96+XouFByen9AsunLDJZ9z7NExiUc0OuoYW6UZkIyx2YUR2z6/TiRjyKMx5GbbjLHvHuf7YmtKghf34LJfx63Yg8vrvN2zC7lY0x0tvKezo4HmGYDU+Gab6dFL+KI761lDcNifcjLrrr9LWZJctG1FfU1uwhoQE22ObjdfkSzY63CbU5hzs21WeTddH2BaL11Gi7lVdlxP1nkxqhnKhVY6knS3EPgVGg1JpN5cP/hivujOelhXcPj8HC/LyI6MkteVjlolBdMmF3a3DbsuAYhL44dxzthWSN065xxUd55Lmf0wRbOYOqH09/o9WbO2VtFdaMb4qBgtFJoT1SqoN8wPXMoXLb3p1PUEhxfnnLzGzBI0Ku7FxrKsNJj/8bn/H8fPIVOd3rfrklUB/DOeO+nkghgSPzrlPxluCMtOnDL4Yml6dK1r3vsgMxgtPOrMFUZbEUbTdIzii5beq72G4PD0DKnwjmBULUVFmy8t+k7fZ3pKc0Q4UC6jpVRqS9Umv8bxw35flZVOU1X7qkjnhZlsMbk24qQ6Hz7QcuL6sDC0iHHki96Uh2UdvmgZnjIvExy2TeJdMDZNSbdZyAHe/Yd1xsQhHiKzjh7GxQ4yqMPaywPkjMamvqrYpmO7Knad+ZQC5msCuAPWUoxrxVhrGv7a+KLXFhyONdTMrZ7ke23qiO40ZJUyzgYyX5XyL0mV7NiUzEs9mjtbMN0dERqwyAJpigad0B3/zRV7s4PIfXSu6YV/MK7+OrYe/JvfGMn/PHJe2fyUdtnFrKRNpXV0Y2559aWPt/G4BlvjTMtXlVIWCnNyA3YQBDmYIodFz41PvXPSa6rq9lWZawZ4dP115HXV/M/tnFkkrBOdzg6aP4pID+MZnTJ1SuuB6iZlyiox4HT2y3YBtkUKWooacBQUDTpjwaDt5poBHl1/HXltwP887lKKXxNUEyPqpGTyA699UqY/lt9yGdlUKra0fFWS+36iylVWrAyd7Uw0CZM0z7xKTOduznLIjG2Hx8cDPLb+OvK6Bv7n1DYci4CxUuRxrjBc0bb4vD3rN5Zz36ntLb83eVJIB8LiIzCmn6SMPjlX+yNlTjvIGjs+QzHPf60Aj62/jrzG8j9vYMFtm1VoRWCJdmw7z9N0t+c8cxZpPeK4aTRicS25QhrVtUp7U578chk4q04Wx4YoQSjFryUlpcQ1AbxZ/XVMknIU//OGl7Q6z9Zpxi0+3yFhSkjUDpnCIUhLWVX23KQ+L9vKvFKI0ZWFQgkDLvBoylrHNVmaw10zwCPrr5tlodfnf94EWnQ0lFRWy8pW9LbkLsyUVDc2NSTHGDtnD1uMtchjbCeb1mpxFP0YbcClhzdLu6lfO8Bj6q+bdT2sz/+8SZCV7VIxtt0DUn9L7r4cLYWDSXnseEpOGFuty0qbOVlS7NNzs5FOGJUqQpl2Q64/yBpZf90sxbE+//PGdZ02HSipCbmD6NItmQ4Lk5XUrGpDMkhbMm2ZVheNYV+VbUWTcv99+2NyX1VoafSuC+AN6q9bFIMv5X/eagNWXZxEa9JjlMwNWb00akGUkSoepp1/yRuuqHGbUn3UdBSTxBU6SEVklzWRUkPndVvw2PrrpjvxOvzPmwHc0hpmq82npi7GRro8dXp0KXnUQmhZbRL7NEVp1uuZmO45vuzKsHrktS3GLWXODVjw+vXXLYx4Hf7njRPd0i3aoAGX6W29GnaV5YdyDj9TFkakje7GHYzDoObfddHtOSpoi2SmzJHrB3hM/XUDDEbxP2/oosszcRlehWXUvzHv4TpBVktHqwenFo8uLVmy4DKLa5d3RtLrmrM3aMFr1183E4sewf+85VWeg1c5ag276NZrM9IJVNcmLEvDNaV62aq+14IAOGFsBt973Ra8Xv11YzXwNfmft7Jg2oS+XOyoC8/cwzi66Dhmgk38kUmP1CUiYWOX1bpD2zWXt2FCp7uq8703APAa9dfNdscR/M/bZLIyouVxqJfeWvG9Je+JVckHQ9+CI9NWxz+blX/KYYvO5n2tAP/vrlZ7+8/h9y+9qeB/Hnt967e5mevX10rALDWK//FaAT5MXdBXdP0C/BAes792c40H+AiAp1e1oH8HgH94g/Lttx1gp63op1eyoM/Bvw5/G/7xFbqJPcCXnmBiwDPb/YKO4FX4OjyCb289db2/Noqicw4i7N6TVtoz8tNwDH+8x/i6Ae7lmaQVENzJFb3Di/BFeAwz+Is9SjeQySpPqbLFlNmyz47z5a/AF+AYFvDmHqibSXTEzoT4Gc3OALaqAP4KPFUJ6n+1x+rGAM6Zd78bgJ0a8QN4GU614vxwD9e1Amy6CcskNrczLx1JIp6HE5UZD/DBHrFr2oNlgG4Odv226BodoryjGJ9q2T/AR3vQrsOCS0ctXZi3ruLlhpFDJYl4HmYtjQCP9rhdn4suySLKDt6wLcC52h8xPlcjju1fn+yhuw4LZsAGUuo2b4Fx2UwQu77uqRHXGtg92aN3tQCbFexc0uk93vhTXbct6y7MulLycoUljx8ngDMBg1tvJjAazpEmOtxlzclvj1vQf1Tx7QlPDpGpqgtdSKz/d9/hdy1vTfFHSmC9dGDZbLiezz7Ac801HirGZsWjydfZyPvHXL/Y8Mjzg8BxTZiuwKz4Eb8sBE9zznszmjvFwHKPIWUnwhqfVRcd4Ck0K6ate48m1oOfrX3/yOtvAsJ8zsPAM89sjnddmuLuDPjX9Bu/L7x7xpMzFk6nWtyQfPg278Gn4Aekz2ZgOmU9eJ37R14vwE/BL8G3aibCiWMWWDQ0ZtkPMnlcGeAu/Ag+8ZyecU5BPuy2ILD+sQqyZhAKmn7XZd+jIMTN9eBL7x95xVLSX4On8EcNlXDqmBlqS13jG4LpmGbkF/0CnOi3H8ETOIXzmnmtb0a16Tzxj1sUvQCBiXZGDtmB3KAefPH94xcUa/6vwRn80GOFyjEXFpba4A1e8KQfFF+259tx5XS4egYn8fQsLGrqGrHbztr+uByTahWuL1NUGbDpsnrwBfePPwHHIf9X4RnM4Z2ABWdxUBlqQ2PwhuDxoS0vvqB1JzS0P4h2nA/QgTrsJFn+Y3AOjs9JFC07CGWX1oNX3T/yHOzgDjwPn1PM3g9Jk9lZrMEpxnlPmBbjyo2+KFXRU52TJM/2ALcY57RUzjObbjqxVw++4P6RAOf58pcVsw9Daje3htriYrpDOonre3CudSe6bfkTEgHBHuDiyu5MCsc7BHhYDx7ePxLjqigXZsw+ijMHFhuwBmtoTPtOxOrTvYJDnC75dnUbhfwu/ZW9AgYd+peL68HD+0emKquiXHhWjJg/UrkJYzuiaL3E9aI/ytrCvAd4GcYZMCkSQxfUg3v3j8c4e90j5ZTPdvmJJGHnOCI2nHS8081X013pHuBlV1gB2MX1YNmWLHqqGN/TWmG0y6clJWthxNUl48q38Bi8vtMKyzzpFdSDhxZ5WBA5ZLt8Jv3895DduBlgbPYAj8C4B8hO68FDkoh5lydC4FiWvBOVqjYdqjiLv92t8yPDjrDaiHdUD15qkSURSGmXJwOMSxWAXYwr3zaAufJ66l+94vv3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/wHuD9tQd4f+0B3l97gPfXHuD9tQd4f+0B3l97gG8LwP8G/AL8O/A5OCq0Ys2KIdv/qOIXG/4mvFAMF16gZD+2Xvu/B8as5+8bfllWyg0zaNO5bfXj6vfhhwD86/Aq3NfRS9t9WPnhfnvCIw/CT8GLcFTMnpntdF/z9V+PWc/vWoIH+FL3Znv57PitcdGP4R/C34avw5fgRVUInCwbsn1yyA8C8zm/BH8NXoXnVE6wVPjdeCI38kX/3+Ct9dbz1pTmHFRu+Hm4O9Ch3clr99negxfwj+ER/DR8EV6B5+DuQOnTgUw5rnkY+FbNU3gNXh0o/JYTuWOvyBf9FvzX663HH/HejO8LwAl8Hl5YLTd8q7sqA3wbjuExfAFegQdwfyDoSkWY8swzEf6o4Qyewefg+cHNbqMQruSL/u/WWc+E5g7vnnEXgDmcDeSGb/F4cBcCgT+GGRzDU3hZYburAt9TEtHgbM6JoxJ+6NMzzTcf6c2bycv2+KK/f+l6LBzw5IwfqZJhA3M472pWT/ajKxnjv4AFnMEpnBTPND6s2J7qHbPAqcMK74T2mZ4VGB9uJA465It+/eL1WKhYOD7xHOkr1ajK7d0C4+ke4Hy9qXZwpgLr+Znm/uNFw8xQOSy8H9IzjUrd9+BIfenYaylf9FsXr8fBAadnPIEDna8IBcwlxnuA0/Wv6GAWPd7dDIKjMdSWueAsBj4M7TOd06qBbwDwKr7oleuxMOEcTuEZTHWvDYUO7aHqAe0Bbq+HEFRzOz7WVoTDQkVds7A4sIIxfCQdCefFRoIOF/NFL1mPab/nvOakSL/Q1aFtNpUb/nFOVX6gzyg/1nISyDfUhsokIzaBR9Kxm80s5mK+6P56il1jXic7nhQxsxSm3OwBHl4fFdLqi64nDQZvqE2at7cWAp/IVvrN6/BFL1mPhYrGMBfOi4PyjuSGf6wBBh7p/FZTghCNWGgMzlBbrNJoPJX2mW5mwZfyRffXo7OFi5pZcS4qZUrlViptrXtw+GQoyhDPS+ANjcGBNRiLCQDPZPMHuiZfdFpPSTcQwwKYdRNqpkjm7AFeeT0pJzALgo7g8YYGrMHS0iocy+YTm2vyRUvvpXCIpQ5pe666TJrcygnScUf/p0NDs/iAI/nqDHC8TmQT8x3NF91l76oDdQGwu61Z6E0ABv7uO1dbf/37Zlv+Zw/Pbh8f1s4Avur6657/+YYBvur6657/+YYBvur6657/+YYBvur6657/+aYBvuL6657/+VMA8FXWX/f8zzcN8BXXX/f8zzcNMFdbf93zP38KLPiK6697/uebtuArrr/u+Z9vGmCusP6653/+1FjwVdZf9/zPN7oHX339dc//fNMu+irrr3v+50+Bi+Zq6697/uebA/jz8Pudf9ht/fWv517J/XUzAP8C/BAeX9WCDrUpZ3/dEMBxgPcfbtTVvsYV5Yn32u03B3Ac4P3b8I+vxNBKeeL9dRMAlwO83959qGO78sT769oB7g3w/vGVYFzKE++v6wV4OMD7F7tckFkmT7y/rhHgpQO8b+4Y46XyxPvrugBeNcB7BRiX8sT767oAvmCA9woAHsoT76+rBJjLBnh3txOvkifeX1dswZcO8G6N7sXyxPvr6i340gHe3TnqVfLE++uKAb50gHcXLnrX8sR7gNdPRqwzwLu7Y/FO5Yn3AK9jXCMGeHdgxDuVJ75VAI8ljP7PAb3/RfjcZfePHBB+79dpfpH1CanN30d+mT1h9GqAxxJGM5LQeeQ1+Tb+EQJrElLb38VHQ94TRq900aMIo8cSOo+8Dp8QfsB8zpqE1NO3OI9Zrj1h9EV78PqE0WMJnUdeU6E+Jjyk/hbrEFIfeWbvId8H9oTRFwdZaxJGvziW0Hn0gqYB/wyZ0PwRlxJST+BOw9m77Amj14ii1yGM/txYQudN0qDzGe4EqfA/5GJCagsHcPaEPWH0esekSwmjRxM6b5JEcZ4ww50ilvAOFxBSx4yLW+A/YU8YvfY5+ALC6NGEzhtmyZoFZoarwBLeZxUhtY4rc3bKnjB6TKJjFUHzJoTOozF2YBpsjcyxDgzhQ1YRUse8+J4wenwmaylB82hC5w0zoRXUNXaRBmSMQUqiWSWkLsaVqc/ZE0aPTFUuJWgeTei8SfLZQeMxNaZSIzbII4aE1Nmr13P2hNHjc9E9guYNCZ032YlNwESMLcZiLQHkE4aE1BFg0yAR4z1h9AiAGRA0jyZ03tyIxWMajMPWBIsxYJCnlITU5ShiHYdZ94TR4wCmSxg9jtB5KyPGYzymAYexWEMwAPIsAdYdV6aObmNPGD0aYLoEzaMJnTc0Ygs+YDw0GAtqxBjkuP38bMRWCHn73xNGjz75P73WenCEJnhwyVe3AEe8TtKdJcYhBl97wuhNAObK66lvD/9J9NS75v17wuitAN5fe4D31x7g/bUHeH/tAd5fe4D3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/w/toDvAd4f/24ABzZ8o+KLsSLS+Pv/TqTb3P4hKlQrTGh+fbIBT0Axqznnb+L/V2mb3HkN5Mb/nEHeK7d4IcDld6lmDW/iH9E+AH1MdOw/Jlu2T1xNmY98sv4wHnD7D3uNHu54WUuOsBTbQuvBsPT/UfzNxGYzwkP8c+Yz3C+r/i6DcyRL/rZ+utRwWH5PmfvcvYEt9jLDS/bg0/B64DWKrQM8AL8FPwS9beQCe6EMKNZYJol37jBMy35otdaz0Bw2H/C2Smc7+WGB0HWDELBmOByA3r5QONo4V+DpzR/hFS4U8wMW1PXNB4TOqYz9urxRV++ntWCw/U59Ty9ebdWbrgfRS9AYKKN63ZokZVygr8GZ/gfIhZXIXPsAlNjPOLBby5c1eOLvmQ9lwkOy5x6QV1j5TYqpS05JtUgUHUp5toHGsVfn4NX4RnMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="}getSearchTexture(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}}const da={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 cTextureScreen = texture2D( tDiffuse, vUv );","\tfloat dx = rand( vUv + time );","\tvec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","\tvec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","\tcResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","\tcResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","\tif( grayscale ) {","\t\tcResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","\t}","\tgl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")};var pa=Object.defineProperty,fa=(e,t,r)=>(((e,t,r)=>{t in e?pa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class ma extends Ki.w{constructor(e,t,r,i){super(),fa(this,"material"),fa(this,"fsQuad"),fa(this,"uniforms"),void 0===da&&console.error("THREE.FilmPass relies on FilmShader");const a=da;this.uniforms=n.UniformsUtils.clone(a.uniforms),this.material=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader}),void 0!==i&&(this.uniforms.grayscale.value=i),void 0!==e&&(this.uniforms.nIntensity.value=e),void 0!==t&&(this.uniforms.sIntensity.value=t),void 0!==r&&(this.uniforms.sCount.value=r),this.fsQuad=new Ki.T(this.material)}render(e,t,r,n){this.uniforms.tDiffuse.value=r.texture,this.uniforms.time.value+=n,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}}var ga=r(84360),va=Object.defineProperty,Aa=(e,t,r)=>(((e,t,r)=>{t in e?va(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class ya extends Ki.w{constructor(e,t,r,i){super(),Aa(this,"renderScene"),Aa(this,"renderCamera"),Aa(this,"selectedObjects"),Aa(this,"visibleEdgeColor"),Aa(this,"hiddenEdgeColor"),Aa(this,"edgeGlow"),Aa(this,"usePatternTexture"),Aa(this,"edgeThickness"),Aa(this,"edgeStrength"),Aa(this,"downSampleRatio"),Aa(this,"pulsePeriod"),Aa(this,"resolution"),Aa(this,"renderTargetMaskBuffer"),Aa(this,"depthMaterial"),Aa(this,"prepareMaskMaterial"),Aa(this,"renderTargetDepthBuffer"),Aa(this,"renderTargetMaskDownSampleBuffer"),Aa(this,"renderTargetBlurBuffer1"),Aa(this,"renderTargetBlurBuffer2"),Aa(this,"edgeDetectionMaterial"),Aa(this,"renderTargetEdgeBuffer1"),Aa(this,"renderTargetEdgeBuffer2"),Aa(this,"separableBlurMaterial1"),Aa(this,"separableBlurMaterial2"),Aa(this,"overlayMaterial"),Aa(this,"materialCopy"),Aa(this,"oldClearAlpha"),Aa(this,"fsQuad"),Aa(this,"tempPulseColor1"),Aa(this,"tempPulseColor2"),Aa(this,"textureMatrix"),Aa(this,"patternTexture"),Aa(this,"_visibilityCache"),Aa(this,"_oldClearColor"),Aa(this,"copyUniforms"),Aa(this,"BlurDirectionX",new n.Vector2(1,0)),Aa(this,"BlurDirectionY",new n.Vector2(0,1)),this.renderScene=t,this.renderCamera=r,this.selectedObjects=void 0!==i?i:[],this.visibleEdgeColor=new n.Color(1,1,1),this.hiddenEdgeColor=new n.Color(.1,.04,.02),this.edgeGlow=0,this.usePatternTexture=!1,this.edgeThickness=1,this.edgeStrength=3,this.downSampleRatio=2,this.pulsePeriod=0,this._visibilityCache=new Map,this.resolution=void 0!==e?new n.Vector2(e.x,e.y):new n.Vector2(256,256);const a=Math.round(this.resolution.x/this.downSampleRatio),s=Math.round(this.resolution.y/this.downSampleRatio);this.renderTargetMaskBuffer=new n.WebGLRenderTarget(this.resolution.x,this.resolution.y),this.renderTargetMaskBuffer.texture.name="OutlinePass.mask",this.renderTargetMaskBuffer.texture.generateMipmaps=!1,this.depthMaterial=new n.MeshDepthMaterial,this.depthMaterial.side=n.DoubleSide,this.depthMaterial.depthPacking=n.RGBADepthPacking,this.depthMaterial.blending=n.NoBlending,this.prepareMaskMaterial=this.getPrepareMaskMaterial(),this.prepareMaskMaterial.side=n.DoubleSide,this.prepareMaskMaterial.fragmentShader=function(e,t){const r=t.isPerspectiveCamera?"perspective":"orthographic";return e.replace(/DEPTH_TO_VIEW_Z/g,r+"DepthToViewZ")}(this.prepareMaskMaterial.fragmentShader,this.renderCamera),this.renderTargetDepthBuffer=new n.WebGLRenderTarget(this.resolution.x,this.resolution.y),this.renderTargetDepthBuffer.texture.name="OutlinePass.depth",this.renderTargetDepthBuffer.texture.generateMipmaps=!1,this.renderTargetMaskDownSampleBuffer=new n.WebGLRenderTarget(a,s),this.renderTargetMaskDownSampleBuffer.texture.name="OutlinePass.depthDownSample",this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps=!1,this.renderTargetBlurBuffer1=new n.WebGLRenderTarget(a,s),this.renderTargetBlurBuffer1.texture.name="OutlinePass.blur1",this.renderTargetBlurBuffer1.texture.generateMipmaps=!1,this.renderTargetBlurBuffer2=new n.WebGLRenderTarget(Math.round(a/2),Math.round(s/2)),this.renderTargetBlurBuffer2.texture.name="OutlinePass.blur2",this.renderTargetBlurBuffer2.texture.generateMipmaps=!1,this.edgeDetectionMaterial=this.getEdgeDetectionMaterial(),this.renderTargetEdgeBuffer1=new n.WebGLRenderTarget(a,s),this.renderTargetEdgeBuffer1.texture.name="OutlinePass.edge1",this.renderTargetEdgeBuffer1.texture.generateMipmaps=!1,this.renderTargetEdgeBuffer2=new n.WebGLRenderTarget(Math.round(a/2),Math.round(s/2)),this.renderTargetEdgeBuffer2.texture.name="OutlinePass.edge2",this.renderTargetEdgeBuffer2.texture.generateMipmaps=!1;this.separableBlurMaterial1=this.getSeperableBlurMaterial(4),this.separableBlurMaterial1.uniforms.texSize.value.set(a,s),this.separableBlurMaterial1.uniforms.kernelRadius.value=1,this.separableBlurMaterial2=this.getSeperableBlurMaterial(4),this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(a/2),Math.round(s/2)),this.separableBlurMaterial2.uniforms.kernelRadius.value=4,this.overlayMaterial=this.getOverlayMaterial(),void 0===ga.C&&console.error("THREE.OutlinePass relies on CopyShader");const o=ga.C;this.copyUniforms=n.UniformsUtils.clone(o.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new n.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:o.vertexShader,fragmentShader:o.fragmentShader,blending:n.NoBlending,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new n.Color,this.oldClearAlpha=1,this.fsQuad=new Ki.T(this.materialCopy),this.tempPulseColor1=new n.Color,this.tempPulseColor2=new n.Color,this.textureMatrix=new n.Matrix4}dispose(){this.renderTargetMaskBuffer.dispose(),this.renderTargetDepthBuffer.dispose(),this.renderTargetMaskDownSampleBuffer.dispose(),this.renderTargetBlurBuffer1.dispose(),this.renderTargetBlurBuffer2.dispose(),this.renderTargetEdgeBuffer1.dispose(),this.renderTargetEdgeBuffer2.dispose()}setSize(e,t){this.renderTargetMaskBuffer.setSize(e,t),this.renderTargetDepthBuffer.setSize(e,t);let r=Math.round(e/this.downSampleRatio),n=Math.round(t/this.downSampleRatio);this.renderTargetMaskDownSampleBuffer.setSize(r,n),this.renderTargetBlurBuffer1.setSize(r,n),this.renderTargetEdgeBuffer1.setSize(r,n),this.separableBlurMaterial1.uniforms.texSize.value.set(r,n),r=Math.round(r/2),n=Math.round(n/2),this.renderTargetBlurBuffer2.setSize(r,n),this.renderTargetEdgeBuffer2.setSize(r,n),this.separableBlurMaterial2.uniforms.texSize.value.set(r,n)}changeVisibilityOfSelectedObjects(e){const t=this._visibilityCache;function r(r){r.isMesh&&(!0===e?r.visible=t.get(r):(t.set(r,r.visible),r.visible=e))}for(let n=0;n<this.selectedObjects.length;n++){this.selectedObjects[n].traverse(r)}}changeVisibilityOfNonSelectedObjects(e){const t=this._visibilityCache,r=[];function n(e){e.isMesh&&r.push(e)}for(let i=0;i<this.selectedObjects.length;i++){this.selectedObjects[i].traverse(n)}this.renderScene.traverse((function(n){if(n.isMesh||n.isSprite){let i=!1;for(let e=0;e<r.length;e++){if(r[e].id===n.id){i=!0;break}}if(!1===i){const r=n.visible;!1!==e&&!0!==t.get(n)||(n.visible=e),t.set(n,r)}}else(n.isPoints||n.isLine)&&(!0===e?n.visible=t.get(n):(t.set(n,n.visible),n.visible=e))}))}updateTextureMatrix(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.renderCamera.projectionMatrix),this.textureMatrix.multiply(this.renderCamera.matrixWorldInverse)}render(e,t,r,n,i){if(this.selectedObjects.length>0){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const t=e.autoClear;e.autoClear=!1,i&&e.state.buffers.stencil.setTest(!1),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);const n=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.setRenderTarget(this.renderTargetDepthBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.changeVisibilityOfSelectedObjects(!0),this._visibilityCache.clear(),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value.set(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.setRenderTarget(this.renderTargetMaskBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this._visibilityCache.clear(),this.renderScene.background=n,this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.setRenderTarget(this.renderTargetMaskDownSampleBuffer),e.clear(),this.fsQuad.render(e),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){const e=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(e),this.tempPulseColor2.multiplyScalar(e)}this.fsQuad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value.set(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=this.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.setRenderTarget(this.renderTargetBlurBuffer1),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=this.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=this.BlurDirectionX,e.setRenderTarget(this.renderTargetBlurBuffer2),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=this.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer2),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(r),this.fsQuad.render(e),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=t}this.renderToScreen&&(this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=r.texture,e.setRenderTarget(null),this.fsQuad.render(e))}getPrepareMaskMaterial(){return new n.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new n.Vector2(.5,.5)},textureMatrix:{value:null}},vertexShader:"#include <morphtarget_pars_vertex>\n\t\t\t\t#include <skinning_pars_vertex>\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tuniform mat4 textureMatrix;\n\t\t\t\tvoid main() {\n\t\t\t\t\t#include <skinbase_vertex>\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <morphtarget_vertex>\n\t\t\t\t\t#include <skinning_vertex>\n\t\t\t\t\t#include <project_vertex>\n\t\t\t\t\tvPosition = mvPosition;\n\t\t\t\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t\t\t\t\tprojTexCoord = textureMatrix * worldPosition;\n\t\t\t\t}",fragmentShader:"#include <packing>\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tuniform sampler2D depthTexture;\n\t\t\t\tuniform vec2 cameraNearFar;\n\t\t\t\tvoid main() {\n\t\t\t\t\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));\n\t\t\t\t\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );\n\t\t\t\t\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;\n\t\t\t\t\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);\n\t\t\t\t}"})}getEdgeDetectionMaterial(){return new n.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new n.Vector2(.5,.5)},visibleEdgeColor:{value:new n.Vector3(1,1,1)},hiddenEdgeColor:{value:new n.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec3 visibleEdgeColor;\n\t\t\t\tuniform vec3 hiddenEdgeColor;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\n\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\n\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\n\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\n\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\n\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\n\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\n\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\n\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\n\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\n\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\n\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\n\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\n\t\t\t\t}"})}getSeperableBlurMaterial(e){return new n.ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new n.Vector2(.5,.5)},direction:{value:new n.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\t\t\t\tuniform float kernelRadius;\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\n\t\t\t\t\tvec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\n\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\n\t\t\t\t\tvec2 uvOffset = delta;\n\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\n\t\t\t\t\t\tvec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\n\t\t\t\t\t\tvec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\n\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\n\t\t\t\t\t\tweightSum += (2.0 * w);\n\t\t\t\t\t\tuvOffset += delta;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = diffuseSum/weightSum;\n\t\t\t\t}"})}getOverlayMaterial(){return new n.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform sampler2D edgeTexture1;\n\t\t\t\tuniform sampler2D edgeTexture2;\n\t\t\t\tuniform sampler2D patternTexture;\n\t\t\t\tuniform float edgeStrength;\n\t\t\t\tuniform float edgeGlow;\n\t\t\t\tuniform bool usePatternTexture;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\n\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\n\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\n\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\n\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\n\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\n\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\n\t\t\t\t\tif(usePatternTexture)\n\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\n\t\t\t\t\tgl_FragColor = finalColor;\n\t\t\t\t}",blending:n.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}const xa={defines:{PERSPECTIVE_CAMERA:1,KERNEL_SIZE:32},uniforms:{tDiffuse:{value:null},tNormal:{value:null},tDepth:{value:null},tNoise:{value:null},kernel:{value:null},cameraNear:{value:null},cameraFar:{value:null},resolution:{value:new n.Vector2},cameraProjectionMatrix:{value:new n.Matrix4},cameraInverseProjectionMatrix:{value:new n.Matrix4},kernelRadius:{value:8},minDistance:{value:.005},maxDistance:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tNormal;","uniform sampler2D tDepth;","uniform sampler2D tNoise;","uniform vec3 kernel[ KERNEL_SIZE ];","uniform vec2 resolution;","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float kernelRadius;","uniform float minDistance;","uniform float maxDistance;","varying vec2 vUv;","#include <packing>","float getDepth( const in vec2 screenPosition ) {","\treturn texture2D( tDepth, screenPosition ).x;","}","float getLinearDepth( const in vec2 screenPosition ) {","\t#if PERSPECTIVE_CAMERA == 1","\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;","\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );","\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );","\t#else","\t\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec2 screenPosition ) {","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","}","void main() {","\tfloat depth = getDepth( vUv );","\tfloat viewZ = getViewZ( depth );","\tvec3 viewPosition = getViewPosition( vUv, depth, viewZ );","\tvec3 viewNormal = getViewNormal( vUv );"," vec2 noiseScale = vec2( resolution.x / 4.0, resolution.y / 4.0 );","\tvec3 random = texture2D( tNoise, vUv * noiseScale ).xyz;","\tvec3 tangent = normalize( random - viewNormal * dot( random, viewNormal ) );","\tvec3 bitangent = cross( viewNormal, tangent );","\tmat3 kernelMatrix = mat3( tangent, bitangent, viewNormal );"," float occlusion = 0.0;"," for ( int i = 0; i < KERNEL_SIZE; i ++ ) {","\t\tvec3 sampleVector = kernelMatrix * kernel[ i ];","\t\tvec3 samplePoint = viewPosition + ( sampleVector * kernelRadius );","\t\tvec4 samplePointNDC = cameraProjectionMatrix * vec4( samplePoint, 1.0 );","\t\tsamplePointNDC /= samplePointNDC.w;","\t\tvec2 samplePointUv = samplePointNDC.xy * 0.5 + 0.5;","\t\tfloat realDepth = getLinearDepth( samplePointUv );","\t\tfloat sampleDepth = viewZToOrthographicDepth( samplePoint.z, cameraNear, cameraFar );","\t\tfloat delta = sampleDepth - realDepth;","\t\tif ( delta > minDistance && delta < maxDistance ) {","\t\t\tocclusion += 1.0;","\t\t}","\t}","\tocclusion = clamp( occlusion / float( KERNEL_SIZE ), 0.0, 1.0 );","\tgl_FragColor = vec4( vec3( 1.0 - occlusion ), 1.0 );","}"].join("\n")},ba={defines:{PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","varying vec2 vUv;","#include <packing>","float getLinearDepth( const in vec2 screenPosition ) {","\t#if PERSPECTIVE_CAMERA == 1","\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;","\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );","\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );","\t#else","\t\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","void main() {","\tfloat depth = getLinearDepth( vUv );","\tgl_FragColor = vec4( vec3( 1.0 - depth ), 1.0 );","}"].join("\n")},wa={uniforms:{tDiffuse:{value:null},resolution:{value:new n.Vector2}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","\tvec2 texelSize = ( 1.0 / resolution );","\tfloat result = 0.0;","\tfor ( int i = - 2; i <= 2; i ++ ) {","\t\tfor ( int j = - 2; j <= 2; j ++ ) {","\t\t\tvec2 offset = ( vec2( float( i ), float( j ) ) ) * texelSize;","\t\t\tresult += texture2D( tDiffuse, vUv + offset ).r;","\t\t}","\t}","\tgl_FragColor = vec4( vec3( result / ( 5.0 * 5.0 ) ), 1.0 );","}"].join("\n")};var Ea=Object.defineProperty;const Sa=class extends Ki.w{constructor(e,t,r,i){super(),this.width=void 0!==r?r:512,this.height=void 0!==i?i:512,this.clear=!0,this.camera=t,this.scene=e,this.kernelRadius=8,this.kernelSize=32,this.kernel=[],this.noiseTexture=null,this.output=0,this.minDistance=.005,this.maxDistance=.1,this._visibilityCache=new Map,this.generateSampleKernel(),this.generateRandomKernelRotations();const a=new n.DepthTexture;a.format=n.DepthStencilFormat,a.type=n.UnsignedInt248Type,this.beautyRenderTarget=new n.WebGLRenderTarget(this.width,this.height),this.normalRenderTarget=new n.WebGLRenderTarget(this.width,this.height,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,depthTexture:a}),this.ssaoRenderTarget=new n.WebGLRenderTarget(this.width,this.height),this.blurRenderTarget=this.ssaoRenderTarget.clone(),void 0===xa&&console.error("THREE.SSAOPass: The pass relies on SSAOShader."),this.ssaoMaterial=new n.ShaderMaterial({defines:Object.assign({},xa.defines),uniforms:n.UniformsUtils.clone(xa.uniforms),vertexShader:xa.vertexShader,fragmentShader:xa.fragmentShader,blending:n.NoBlending}),this.ssaoMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.ssaoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.ssaoMaterial.uniforms.tDepth.value=this.normalRenderTarget.depthTexture,this.ssaoMaterial.uniforms.tNoise.value=this.noiseTexture,this.ssaoMaterial.uniforms.kernel.value=this.kernel,this.ssaoMaterial.uniforms.cameraNear.value=this.camera.near,this.ssaoMaterial.uniforms.cameraFar.value=this.camera.far,this.ssaoMaterial.uniforms.resolution.value.set(this.width,this.height),this.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.normalMaterial=new n.MeshNormalMaterial,this.normalMaterial.blending=n.NoBlending,this.blurMaterial=new n.ShaderMaterial({defines:Object.assign({},wa.defines),uniforms:n.UniformsUtils.clone(wa.uniforms),vertexShader:wa.vertexShader,fragmentShader:wa.fragmentShader}),this.blurMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.blurMaterial.uniforms.resolution.value.set(this.width,this.height),this.depthRenderMaterial=new n.ShaderMaterial({defines:Object.assign({},ba.defines),uniforms:n.UniformsUtils.clone(ba.uniforms),vertexShader:ba.vertexShader,fragmentShader:ba.fragmentShader,blending:n.NoBlending}),this.depthRenderMaterial.uniforms.tDepth.value=this.normalRenderTarget.depthTexture,this.depthRenderMaterial.uniforms.cameraNear.value=this.camera.near,this.depthRenderMaterial.uniforms.cameraFar.value=this.camera.far,this.copyMaterial=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(ga.C.uniforms),vertexShader:ga.C.vertexShader,fragmentShader:ga.C.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blendSrc:n.DstColorFactor,blendDst:n.ZeroFactor,blendEquation:n.AddEquation,blendSrcAlpha:n.DstAlphaFactor,blendDstAlpha:n.ZeroFactor,blendEquationAlpha:n.AddEquation}),this.fsQuad=new Ki.T(null),this.originalClearColor=new n.Color}dispose(){this.beautyRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.ssaoRenderTarget.dispose(),this.blurRenderTarget.dispose(),this.normalMaterial.dispose(),this.blurMaterial.dispose(),this.copyMaterial.dispose(),this.depthRenderMaterial.dispose(),this.fsQuad.dispose()}render(e,t){switch(!1===e.capabilities.isWebGL2&&(this.noiseTexture.format=n.LuminanceFormat),e.setRenderTarget(this.beautyRenderTarget),e.clear(),e.render(this.scene,this.camera),this.overrideVisibility(),this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.restoreVisibility(),this.ssaoMaterial.uniforms.kernelRadius.value=this.kernelRadius,this.ssaoMaterial.uniforms.minDistance.value=this.minDistance,this.ssaoMaterial.uniforms.maxDistance.value=this.maxDistance,this.renderPass(e,this.ssaoMaterial,this.ssaoRenderTarget),this.renderPass(e,this.blurMaterial,this.blurRenderTarget),this.output){case Sa.OUTPUT.SSAO:this.copyMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.copyMaterial.blending=n.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case Sa.OUTPUT.Blur:this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=n.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case Sa.OUTPUT.Beauty:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=n.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case Sa.OUTPUT.Depth:this.renderPass(e,this.depthRenderMaterial,this.renderToScreen?null:t);break;case Sa.OUTPUT.Normal:this.copyMaterial.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.copyMaterial.blending=n.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case Sa.OUTPUT.Default:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=n.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=n.CustomBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;default:console.warn("THREE.SSAOPass: Unknown output type.")}}renderPass(e,t,r,n,i){e.getClearColor(this.originalClearColor);const a=e.getClearAlpha(),s=e.autoClear;e.setRenderTarget(r),e.autoClear=!1,null!=n&&(e.setClearColor(n),e.setClearAlpha(i||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=s,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)}renderOverride(e,t,r,n,i){e.getClearColor(this.originalClearColor);const a=e.getClearAlpha(),s=e.autoClear;e.setRenderTarget(r),e.autoClear=!1,n=t.clearColor||n,i=t.clearAlpha||i,null!=n&&(e.setClearColor(n),e.setClearAlpha(i||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)}setSize(e,t){this.width=e,this.height=t,this.beautyRenderTarget.setSize(e,t),this.ssaoRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.blurRenderTarget.setSize(e,t),this.ssaoMaterial.uniforms.resolution.value.set(e,t),this.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.blurMaterial.uniforms.resolution.value.set(e,t)}generateSampleKernel(){const e=this.kernelSize,t=this.kernel;for(let r=0;r<e;r++){const i=new n.Vector3;i.x=2*Math.random()-1,i.y=2*Math.random()-1,i.z=Math.random(),i.normalize();let a=r/e;a=n.MathUtils.lerp(.1,1,a*a),i.multiplyScalar(a),t.push(i)}}generateRandomKernelRotations(){void 0===tn.L&&console.error("THREE.SSAOPass: The pass relies on SimplexNoise.");const e=new tn.L,t=new Float32Array(16);for(let r=0;r<16;r++){const n=2*Math.random()-1,i=2*Math.random()-1,a=0;t[r]=e.noise3d(n,i,a)}this.noiseTexture=new n.DataTexture(t,4,4,n.RedFormat,n.FloatType),this.noiseTexture.wrapS=n.RepeatWrapping,this.noiseTexture.wrapT=n.RepeatWrapping,this.noiseTexture.needsUpdate=!0}overrideVisibility(){const e=this.scene,t=this._visibilityCache;e.traverse((function(e){t.set(e,e.visible),(e.isPoints||e.isLine)&&(e.visible=!1)}))}restoreVisibility(){const e=this.scene,t=this._visibilityCache;e.traverse((function(e){const r=t.get(e);e.visible=r})),t.clear()}};let Ma=Sa;((e,t,r)=>{((e,t,r)=>{t in e?Ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r)})(Ma,"OUTPUT",{Default:0,SSAO:1,Blur:2,Beauty:3,Depth:4,Normal:5});class _a extends Ki.w{constructor(e){super(),void 0===ga.C&&console.error("THREE.SavePass relies on CopyShader");const t=ga.C;this.textureID="tDiffuse",this.uniforms=n.UniformsUtils.clone(t.uniforms),this.material=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderTarget=e,void 0===this.renderTarget&&(this.renderTarget=new n.WebGLRenderTarget(window.innerWidth,window.innerHeight),this.renderTarget.texture.name="SavePass.rt"),this.needsSwap=!1,this.fsQuad=new Ki.T(this.material)}render(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),e.setRenderTarget(this.renderTarget),this.clear&&e.clear(),this.fsQuad.render(e)}}const Ta={defines:{DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},aspect:{value:1},aperture:{value:.025},maxblur:{value:.01},nearClip:{value:1},farClip:{value:1e3}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include <packing>","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","\tvec2 aspectcorrect = vec2( 1.0, aspect );","\tfloat viewZ = getViewZ( getDepth( vUv ) );","\tfloat factor = ( focus + viewZ );","\tvec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","\tvec2 dofblur9 = dofblur * 0.9;","\tvec2 dofblur7 = dofblur * 0.7;","\tvec2 dofblur4 = dofblur * 0.4;","\tvec4 col = vec4( 0.0 );","\tcol += texture2D( tColor, vUv.xy );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","\tgl_FragColor = col / 41.0;","\tgl_FragColor.a = 1.0;","}"].join("\n")};var Ca=Object.defineProperty,Ia=(e,t,r)=>(((e,t,r)=>{t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class Ba extends Ki.w{constructor(e,t,r){super(),Ia(this,"scene"),Ia(this,"camera"),Ia(this,"renderTargetDepth"),Ia(this,"materialDepth"),Ia(this,"materialBokeh"),Ia(this,"fsQuad"),Ia(this,"_oldClearColor"),Ia(this,"uniforms"),this.scene=e,this.camera=t;const i=void 0!==r.focus?r.focus:1,a=void 0!==r.aspect?r.aspect:t.aspect,s=void 0!==r.aperture?r.aperture:.025,o=void 0!==r.maxblur?r.maxblur:1,l=r.width||window.innerWidth||1,c=r.height||window.innerHeight||1;this.renderTargetDepth=new n.WebGLRenderTarget(l,c,{minFilter:n.NearestFilter,magFilter:n.NearestFilter}),this.renderTargetDepth.texture.name="BokehPass.depth",this.materialDepth=new n.MeshDepthMaterial,this.materialDepth.depthPacking=n.RGBADepthPacking,this.materialDepth.blending=n.NoBlending,void 0===Ta&&console.error("BokehPass relies on BokehShader");const u=Ta,h=n.UniformsUtils.clone(u.uniforms);h.tDepth.value=this.renderTargetDepth.texture,h.focus.value=i,h.aspect.value=a,h.aperture.value=s,h.maxblur.value=o,h.nearClip.value=t.near,h.farClip.value=t.far,this.materialBokeh=new n.ShaderMaterial({defines:Object.assign({},u.defines),uniforms:h,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}),this.uniforms=h,this.needsSwap=!1,this.fsQuad=new Ki.T(this.materialBokeh),this._oldClearColor=new n.Color}render(e,t,r){this.scene.overrideMaterial=this.materialDepth,e.getClearColor(this._oldClearColor);const n=e.getClearAlpha(),i=e.autoClear;e.autoClear=!1,e.setClearColor(16777215),e.setClearAlpha(1),e.setRenderTarget(this.renderTargetDepth),e.clear(),e.render(this.scene,this.camera),this.uniforms.tColor.value=r.texture,this.uniforms.nearClip.value=this.camera.near,this.uniforms.farClip.value=this.camera.far,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),e.clear(),this.fsQuad.render(e)),this.scene.overrideMaterial=null,e.setClearColor(this._oldClearColor),e.setClearAlpha(n),e.autoClear=i}}class Ra extends Ki.w{constructor(e,t){super();const r=ga.C;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=n.UniformsUtils.clone(r.uniforms),this.material=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,depthTest:!1,depthWrite:!1}),this.needsSwap=!1,this.fsQuad=new Ki.T(null)}render(e,t,r){const n=e.autoClear;e.autoClear=!1,this.fsQuad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.setRenderTarget(this.renderToScreen?null:r),this.clear&&e.clear(),this.fsQuad.render(e),e.autoClear=n}dispose(){this.material.dispose(),this.fsQuad.dispose()}}const Pa={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tfloat l = linearToRelativeLuminance( texel.rgb );","\tgl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")},Fa={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","\tuniform sampler2D luminanceMap;","#else","\tuniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","\t#ifdef ADAPTED_LUMINANCE","\t\tfloat fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","\t#else","\t\tfloat fLumAvg = averageLuminance;","\t#endif","\tfloat fLumPixel = linearToRelativeLuminance( vColor );","\tfloat fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","\tfloat fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","\treturn fLumCompressed * vColor;","}","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};class La extends Ki.w{constructor(e,t){super(),this.resolution=void 0!==t?t:256,this.needsInit=!0,this.adaptive=void 0===e||!!e,this.luminanceRT=null,this.previousLuminanceRT=null,this.currentLuminanceRT=null;const r=ga.C;this.copyUniforms=n.UniformsUtils.clone(r.uniforms),this.materialCopy=new n.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,blending:n.NoBlending,depthTest:!1}),this.materialLuminance=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(Pa.uniforms),vertexShader:Pa.vertexShader,fragmentShader:Pa.fragmentShader,blending:n.NoBlending}),this.adaptLuminanceShader={defines:{MIP_LEVEL_1X1:(Math.log(this.resolution)/Math.log(2)).toFixed(1)},uniforms:{lastLum:{value:null},currentLum:{value:null},minLuminance:{value:.01},delta:{value:.016},tau:{value:1}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\t\tuniform sampler2D lastLum;\n\t\t\t\tuniform sampler2D currentLum;\n\t\t\t\tuniform float minLuminance;\n\t\t\t\tuniform float delta;\n\t\t\t\tuniform float tau;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec4 lastLum = texture2D( lastLum, vUv, MIP_LEVEL_1X1 );\n\t\t\t\t\tvec4 currentLum = texture2D( currentLum, vUv, MIP_LEVEL_1X1 );\n\n\t\t\t\t\tfloat fLastLum = max( minLuminance, lastLum.r );\n\t\t\t\t\tfloat fCurrentLum = max( minLuminance, currentLum.r );\n\n\t\t\t\t\t//The adaption seems to work better in extreme lighting differences\n\t\t\t\t\t//if the input luminance is squared.\n\t\t\t\t\tfCurrentLum *= fCurrentLum;\n\n\t\t\t\t\t// Adapt the luminance using Pattanaik's technique\n\t\t\t\t\tfloat fAdaptedLum = fLastLum + (fCurrentLum - fLastLum) * (1.0 - exp(-delta * tau));\n\t\t\t\t\t// \"fAdaptedLum = sqrt(fAdaptedLum);\n\t\t\t\t\tgl_FragColor.r = fAdaptedLum;\n\t\t\t\t}"},this.materialAdaptiveLum=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(this.adaptLuminanceShader.uniforms),vertexShader:this.adaptLuminanceShader.vertexShader,fragmentShader:this.adaptLuminanceShader.fragmentShader,defines:Object.assign({},this.adaptLuminanceShader.defines),blending:n.NoBlending}),this.materialToneMap=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(Fa.uniforms),vertexShader:Fa.vertexShader,fragmentShader:Fa.fragmentShader,blending:n.NoBlending}),this.fsQuad=new Ki.T(null)}render(e,t,r,n){this.needsInit&&(this.reset(e),this.luminanceRT.texture.type=r.texture.type,this.previousLuminanceRT.texture.type=r.texture.type,this.currentLuminanceRT.texture.type=r.texture.type,this.needsInit=!1),this.adaptive&&(this.fsQuad.material=this.materialLuminance,this.materialLuminance.uniforms.tDiffuse.value=r.texture,e.setRenderTarget(this.currentLuminanceRT),this.fsQuad.render(e),this.fsQuad.material=this.materialAdaptiveLum,this.materialAdaptiveLum.uniforms.delta.value=n,this.materialAdaptiveLum.uniforms.lastLum.value=this.previousLuminanceRT.texture,this.materialAdaptiveLum.uniforms.currentLum.value=this.currentLuminanceRT.texture,e.setRenderTarget(this.luminanceRT),this.fsQuad.render(e),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.luminanceRT.texture,e.setRenderTarget(this.previousLuminanceRT),this.fsQuad.render(e)),this.fsQuad.material=this.materialToneMap,this.materialToneMap.uniforms.tDiffuse.value=r.texture,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}reset(){this.luminanceRT&&this.luminanceRT.dispose(),this.currentLuminanceRT&&this.currentLuminanceRT.dispose(),this.previousLuminanceRT&&this.previousLuminanceRT.dispose(),this.luminanceRT=new n.WebGLRenderTarget(this.resolution,this.resolution),this.luminanceRT.texture.name="AdaptiveToneMappingPass.l",this.luminanceRT.texture.generateMipmaps=!1,this.previousLuminanceRT=new n.WebGLRenderTarget(this.resolution,this.resolution),this.previousLuminanceRT.texture.name="AdaptiveToneMappingPass.pl",this.previousLuminanceRT.texture.generateMipmaps=!1;const e={minFilter:n.LinearMipmapLinearFilter,generateMipmaps:!0};this.currentLuminanceRT=new n.WebGLRenderTarget(this.resolution,this.resolution,e),this.currentLuminanceRT.texture.name="AdaptiveToneMappingPass.cl",this.adaptive&&(this.materialToneMap.defines.ADAPTED_LUMINANCE="",this.materialToneMap.uniforms.luminanceMap.value=this.luminanceRT.texture),this.fsQuad.material=new n.MeshBasicMaterial({color:7829367}),this.materialLuminance.needsUpdate=!0,this.materialAdaptiveLum.needsUpdate=!0,this.materialToneMap.needsUpdate=!0}setAdaptive(e){e?(this.adaptive=!0,this.materialToneMap.defines.ADAPTED_LUMINANCE="",this.materialToneMap.uniforms.luminanceMap.value=this.luminanceRT.texture):(this.adaptive=!1,delete this.materialToneMap.defines.ADAPTED_LUMINANCE,this.materialToneMap.uniforms.luminanceMap.value=null),this.materialToneMap.needsUpdate=!0}setAdaptionRate(e){e&&(this.materialAdaptiveLum.uniforms.tau.value=Math.abs(e))}setMinLuminance(e){e&&(this.materialToneMap.uniforms.minLuminance.value=e,this.materialAdaptiveLum.uniforms.minLuminance.value=e)}setMaxLuminance(e){e&&(this.materialToneMap.uniforms.maxLuminance.value=e)}setAverageLuminance(e){e&&(this.materialToneMap.uniforms.averageLuminance.value=e)}setMiddleGrey(e){e&&(this.materialToneMap.uniforms.middleGrey.value=e)}dispose(){this.luminanceRT&&this.luminanceRT.dispose(),this.previousLuminanceRT&&this.previousLuminanceRT.dispose(),this.currentLuminanceRT&&this.currentLuminanceRT.dispose(),this.materialLuminance&&this.materialLuminance.dispose(),this.materialAdaptiveLum&&this.materialAdaptiveLum.dispose(),this.materialCopy&&this.materialCopy.dispose(),this.materialToneMap&&this.materialToneMap.dispose()}}const Da={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new n.Color(0)},defaultOpacity:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec3 luma = vec3( 0.299, 0.587, 0.114 );","\tfloat v = dot( texel.xyz, luma );","\tvec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","\tfloat alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","\tgl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};var Ua=Object.defineProperty,Na=(e,t,r)=>(((e,t,r)=>{t in e?Ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const ka=class extends Ki.w{constructor(e,t,r,i){super(),this.strength=void 0!==t?t:1,this.radius=r,this.threshold=i,this.resolution=void 0!==e?new n.Vector2(e.x,e.y):new n.Vector2(256,256),this.clearColor=new n.Color(0,0,0),this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let a=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);this.renderTargetBright=new n.WebGLRenderTarget(a,s,{type:n.HalfFloatType}),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let u=0;u<this.nMips;u++){const e=new n.WebGLRenderTarget(a,s,{type:n.HalfFloatType});e.texture.name="UnrealBloomPass.h"+u,e.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(e);const t=new n.WebGLRenderTarget(a,s,{type:n.HalfFloatType});t.texture.name="UnrealBloomPass.v"+u,t.texture.generateMipmaps=!1,this.renderTargetsVertical.push(t),a=Math.round(a/2),s=Math.round(s/2)}const o=Da;this.highPassUniforms=n.UniformsUtils.clone(o.uniforms),this.highPassUniforms.luminosityThreshold.value=i,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new n.ShaderMaterial({uniforms:this.highPassUniforms,vertexShader:o.vertexShader,fragmentShader:o.fragmentShader,defines:{}}),this.separableBlurMaterials=[];const l=[3,5,7,9,11];a=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);for(let u=0;u<this.nMips;u++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(l[u])),this.separableBlurMaterials[u].uniforms.texSize.value=new n.Vector2(a,s),a=Math.round(a/2),s=Math.round(s/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=t,this.compositeMaterial.uniforms.bloomRadius.value=.1,this.compositeMaterial.needsUpdate=!0;this.compositeMaterial.uniforms.bloomFactors.value=[1,.8,.6,.4,.2],this.bloomTintColors=[new n.Vector3(1,1,1),new n.Vector3(1,1,1),new n.Vector3(1,1,1),new n.Vector3(1,1,1),new n.Vector3(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors;const c=ga.C;this.copyUniforms=n.UniformsUtils.clone(c.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new n.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,blending:n.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new n.Color,this.oldClearAlpha=1,this.basic=new n.MeshBasicMaterial,this.fsQuad=new Ki.T(null)}dispose(){for(let e=0;e<this.renderTargetsHorizontal.length;e++)this.renderTargetsHorizontal[e].dispose();for(let e=0;e<this.renderTargetsVertical.length;e++)this.renderTargetsVertical[e].dispose();this.renderTargetBright.dispose();for(let e=0;e<this.separableBlurMaterials.length;e++)this.separableBlurMaterials[e].dispose();this.compositeMaterial.dispose(),this.materialCopy.dispose(),this.basic.dispose(),this.fsQuad.dispose()}setSize(e,t){let r=Math.round(e/2),i=Math.round(t/2);this.renderTargetBright.setSize(r,i);for(let a=0;a<this.nMips;a++)this.renderTargetsHorizontal[a].setSize(r,i),this.renderTargetsVertical[a].setSize(r,i),this.separableBlurMaterials[a].uniforms.texSize.value=new n.Vector2(r,i),r=Math.round(r/2),i=Math.round(i/2)}render(e,t,r,n,i){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const a=e.autoClear;e.autoClear=!1,e.setClearColor(this.clearColor,0),i&&e.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=r.texture,e.setRenderTarget(null),e.clear(),this.fsQuad.render(e)),this.highPassUniforms.tDiffuse.value=r.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,e.setRenderTarget(this.renderTargetBright),e.clear(),this.fsQuad.render(e);let s=this.renderTargetBright;for(let o=0;o<this.nMips;o++)this.fsQuad.material=this.separableBlurMaterials[o],this.separableBlurMaterials[o].uniforms.colorTexture.value=s.texture,this.separableBlurMaterials[o].uniforms.direction.value=ka.BlurDirectionX,e.setRenderTarget(this.renderTargetsHorizontal[o]),e.clear(),this.fsQuad.render(e),this.separableBlurMaterials[o].uniforms.colorTexture.value=this.renderTargetsHorizontal[o].texture,this.separableBlurMaterials[o].uniforms.direction.value=ka.BlurDirectionY,e.setRenderTarget(this.renderTargetsVertical[o]),e.clear(),this.fsQuad.render(e),s=this.renderTargetsVertical[o];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,e.setRenderTarget(this.renderTargetsHorizontal[0]),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,i&&e.state.buffers.stencil.setTest(!0),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(r),this.fsQuad.render(e)),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=a}getSeperableBlurMaterial(e){return new n.ShaderMaterial({defines:{KERNEL_RADIUS:e,SIGMA:e},uniforms:{colorTexture:{value:null},texSize:{value:new n.Vector2(.5,.5)},direction:{value:new n.Vector2(.5,.5)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat fSigma = float(SIGMA);\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\n\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\n\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat x = float(i);\n\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\n\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\n\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\n\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\n\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\n\t\t\t\t\t\tweightSum += 2.0 * w;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})}getCompositeMaterial(e){return new n.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\t\t\t\tuniform sampler2D blurTexture1;\n\t\t\t\tuniform sampler2D blurTexture2;\n\t\t\t\tuniform sampler2D blurTexture3;\n\t\t\t\tuniform sampler2D blurTexture4;\n\t\t\t\tuniform sampler2D blurTexture5;\n\t\t\t\tuniform float bloomStrength;\n\t\t\t\tuniform float bloomRadius;\n\t\t\t\tuniform float bloomFactors[NUM_MIPS];\n\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\n\n\t\t\t\tfloat lerpBloomFactor(const in float factor) {\n\t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\n\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\n\t\t\t\t}"})}};let Oa=ka;Na(Oa,"BlurDirectionX",new n.Vector2(1,0)),Na(Oa,"BlurDirectionY",new n.Vector2(0,1));class Ga extends Ki.w{constructor(e,t,r=1){super(),this.camera=e,this.needsSwap=!1,this.cubeShader=n.ShaderLib.cube,this.cubeMesh=new n.Mesh(new n.BoxGeometry(10,10,10),new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(this.cubeShader.uniforms),vertexShader:this.cubeShader.vertexShader,fragmentShader:this.cubeShader.fragmentShader,depthTest:!1,depthWrite:!1,side:n.BackSide})),Object.defineProperty(this.cubeMesh.material,"envMap",{get:function(){return this.uniforms.tCube.value}}),this.tCube=t,this.opacity=r,this.cubeScene=new n.Scene,this.cubeCamera=new n.PerspectiveCamera,this.cubeScene.add(this.cubeMesh)}render(e,t,r){const n=e.autoClear;e.autoClear=!1,this.cubeCamera.projectionMatrix.copy(this.camera.projectionMatrix),this.cubeCamera.quaternion.setFromRotationMatrix(this.camera.matrixWorld),this.cubeMesh.material.uniforms.tCube.value=this.tCube,this.cubeMesh.material.uniforms.tFlip.value=this.tCube.isCubeTexture&&!1===this.tCube.isRenderTargetTexture?-1:1,this.cubeMesh.material.uniforms.opacity.value=this.opacity,this.cubeMesh.material.transparent=this.opacity<1,e.setRenderTarget(this.renderToScreen?null:r),this.clear&&e.clear(),e.render(this.cubeScene,this.cubeCamera),e.autoClear=n}dispose(){this.cubeMesh.geometry.dispose(),this.cubeMesh.material.dispose()}}const za={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},tDiffuse:{value:null},tNormal:{value:null},size:{value:new n.Vector2(512,512)},cameraNear:{value:1},cameraFar:{value:100},cameraProjectionMatrix:{value:new n.Matrix4},cameraInverseProjectionMatrix:{value:new n.Matrix4},scale:{value:1},intensity:{value:.1},bias:{value:.5},minResolution:{value:0},kernelRadius:{value:100},randomSeed:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include <packing>","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")},Va={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{value:null},size:{value:new n.Vector2(512,512)},sampleUvOffsets:{value:[new n.Vector2(0,0)]},sampleWeights:{value:[1]},tDepth:{value:null},cameraNear:{value:10},cameraFar:{value:1e3},depthCutoff:{value:10}},vertexShader:["#include <common>","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","#include <packing>","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")},Ha={createSampleWeights:(e,t)=>{const r=[];for(let a=0;a<=e;a++)r.push((n=a,i=t,Math.exp(-n*n/(i*i*2))/(Math.sqrt(2*Math.PI)*i)));var n,i;return r},createSampleOffsets:(e,t)=>{const r=[];for(let n=0;n<=e;n++)r.push(t.clone().multiplyScalar(n));return r},configure:(e,t,r,n)=>{e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=Ha.createSampleOffsets(t,n),e.uniforms.sampleWeights.value=Ha.createSampleWeights(t,r),e.needsUpdate=!0}};var Qa=Object.defineProperty;class ja extends Ki.w{constructor(e,t,r=!1,i=!1,a=new n.Vector2(256,256)){let s;super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=r,this.supportsNormalTexture=i,this.originalClearColor=new n.Color,this._oldClearColor=new n.Color,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=new n.Vector2(a.x,a.y),this.saoRenderTarget=new n.WebGLRenderTarget(this.resolution.x,this.resolution.y,{type:n.HalfFloatType}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new n.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,type:n.HalfFloatType}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension&&(s=new n.DepthTexture,s.type=n.UnsignedShortType,this.beautyRenderTarget.depthTexture=s,this.beautyRenderTarget.depthBuffer=!0),this.depthMaterial=new n.MeshDepthMaterial,this.depthMaterial.depthPacking=n.RGBADepthPacking,this.depthMaterial.blending=n.NoBlending,this.normalMaterial=new n.MeshNormalMaterial,this.normalMaterial.blending=n.NoBlending,this.saoMaterial=new n.ShaderMaterial({defines:Object.assign({},za.defines),fragmentShader:za.fragmentShader,vertexShader:za.vertexShader,uniforms:n.UniformsUtils.clone(za.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?s:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=n.NoBlending,this.vBlurMaterial=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(Va.uniforms),defines:Object.assign({},Va.defines),vertexShader:Va.vertexShader,fragmentShader:Va.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?s:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=n.NoBlending,this.hBlurMaterial=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(Va.uniforms),defines:Object.assign({},Va.defines),vertexShader:Va.vertexShader,fragmentShader:Va.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?s:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=n.NoBlending,this.materialCopy=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(ga.C.uniforms),vertexShader:ga.C.vertexShader,fragmentShader:ga.C.fragmentShader,blending:n.NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=n.CustomBlending,this.materialCopy.blendSrc=n.DstColorFactor,this.materialCopy.blendDst=n.ZeroFactor,this.materialCopy.blendEquation=n.AddEquation,this.materialCopy.blendSrcAlpha=n.DstAlphaFactor,this.materialCopy.blendDstAlpha=n.ZeroFactor,this.materialCopy.blendEquationAlpha=n.AddEquation,this.depthCopy=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(Dn.uniforms),vertexShader:Dn.vertexShader,fragmentShader:Dn.fragmentShader,blending:n.NoBlending}),this.fsQuad=new Ki.T(null)}render(e,t,r){if(this.renderToScreen&&(this.materialCopy.blending=n.NoBlending,this.materialCopy.uniforms.tDiffuse.value=r.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1===this.params.output)return;e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const i=e.autoClear;e.autoClear=!1,e.setRenderTarget(this.depthRenderTarget),e.clear(),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;const a=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=a,this.hBlurMaterial.uniforms.depthCutoff.value=a,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(Ha.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new n.Vector2(0,1)),Ha.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new n.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.setRenderTarget(this.beautyRenderTarget),e.clear(),e.render(this.scene,this.camera),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));let s=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,s=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?s.blending=n.CustomBlending:s.blending=n.NoBlending,this.renderPass(e,s,this.renderToScreen?null:r),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=i}renderPass(e,t,r,n,i){e.getClearColor(this.originalClearColor);const a=e.getClearAlpha(),s=e.autoClear;e.setRenderTarget(r),e.autoClear=!1,null!=n&&(e.setClearColor(n),e.setClearAlpha(i||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=s,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)}renderOverride(e,t,r,n,i){e.getClearColor(this.originalClearColor);const a=e.getClearAlpha(),s=e.autoClear;e.setRenderTarget(r),e.autoClear=!1,n=t.clearColor||n,i=t.clearAlpha||i,null!=n&&(e.setClearColor(n),e.setClearAlpha(i||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)}setSize(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}dispose(){this.saoRenderTarget.dispose(),this.blurIntermediateRenderTarget.dispose(),this.beautyRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.depthRenderTarget.dispose(),this.depthMaterial.dispose(),this.normalMaterial.dispose(),this.saoMaterial.dispose(),this.vBlurMaterial.dispose(),this.hBlurMaterial.dispose(),this.materialCopy.dispose(),this.depthCopy.dispose(),this.fsQuad.dispose()}}((e,t,r)=>{((e,t,r)=>{t in e?Qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r)})(ja,"OUTPUT",{Beauty:1,Default:0,SAO:2,Depth:3,Normal:4});const Wa={uniforms:{damp:{value:.96},tOld:{value:null},tNew:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float damp;","uniform sampler2D tOld;","uniform sampler2D tNew;","varying vec2 vUv;","vec4 when_gt( vec4 x, float y ) {","\treturn max( sign( x - y ), 0.0 );","}","void main() {","\tvec4 texelOld = texture2D( tOld, vUv );","\tvec4 texelNew = texture2D( tNew, vUv );","\ttexelOld *= damp * when_gt( texelOld, 0.1 );","\tgl_FragColor = max(texelNew, texelOld);","}"].join("\n")};var Xa=Object.defineProperty,Ya=(e,t,r)=>(((e,t,r)=>{t in e?Xa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class qa extends Ki.w{constructor(e=.96,t=Wa){super(),Ya(this,"shader"),Ya(this,"uniforms"),Ya(this,"textureComp"),Ya(this,"textureOld"),Ya(this,"shaderMaterial"),Ya(this,"compFsQuad"),Ya(this,"copyFsQuad"),this.shader=t,this.uniforms=n.UniformsUtils.clone(t.uniforms),this.uniforms.damp.value=e,this.textureComp=new n.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:n.LinearFilter,magFilter:n.NearestFilter,format:n.RGBAFormat}),this.textureOld=new n.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:n.LinearFilter,magFilter:n.NearestFilter,format:n.RGBAFormat}),this.shaderMaterial=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:this.shader.vertexShader,fragmentShader:this.shader.fragmentShader}),this.compFsQuad=new Ki.T(this.shaderMaterial);let r=new n.MeshBasicMaterial;this.copyFsQuad=new Ki.T(r)}render(e,t,r){this.uniforms.tOld.value=this.textureOld.texture,this.uniforms.tNew.value=r.texture,e.setRenderTarget(this.textureComp),this.compFsQuad.render(e),this.copyFsQuad.material.map=this.textureComp.texture,this.renderToScreen?(e.setRenderTarget(null),this.copyFsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.copyFsQuad.render(e));let n=this.textureOld;this.textureOld=this.textureComp,this.textureComp=n}setSize(e,t){this.textureComp.setSize(e,t),this.textureOld.setSize(e,t)}}var Ka=r(14394),Ja=r(8064);const Za={uniforms:{tDiffuse:{value:null},tSize:{value:new n.Vector2(256,256)},center:{value:new n.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","\tfloat s = sin( angle ), c = cos( angle );","\tvec2 tex = vUv * tSize - center;","\tvec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","\treturn ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","\tvec4 color = texture2D( tDiffuse, vUv );","\tfloat average = ( color.r + color.g + color.b ) / 3.0;","\tgl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")};var $a=Object.defineProperty,es=(e,t,r)=>(((e,t,r)=>{t in e?$a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class ts extends Ki.w{constructor(e,t,r){super(),es(this,"material"),es(this,"fsQuad"),es(this,"uniforms"),void 0===Za&&console.error("THREE.DotScreenPass relies on THREE.DotScreenShader");const i=Za;this.uniforms=n.UniformsUtils.clone(i.uniforms),void 0!==e&&this.uniforms.center.value.copy(e),void 0!==t&&(this.uniforms.angle.value=t),void 0!==r&&(this.uniforms.scale.value=r),this.material=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader}),this.fsQuad=new Ki.T(this.material)}render(e,t,r){this.uniforms.tDiffuse.value=r.texture,this.uniforms.tSize.value.set(r.width,r.height),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}}const rs={defines:{MAX_STEP:0,isPerspectiveCamera:!0,isDistanceAttenuation:!0,isFresnel:!0,isInfiniteThick:!1,isSelective:!1},uniforms:{tDiffuse:{value:null},tNormal:{value:null},tMetalness:{value:null},tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null},resolution:{value:new n.Vector2},cameraProjectionMatrix:{value:new n.Matrix4},cameraInverseProjectionMatrix:{value:new n.Matrix4},opacity:{value:.5},maxDistance:{value:180},cameraRange:{value:0},surfDist:{value:.007},thickTolerance:{value:.03}},vertexShader:"\n\n varying vec2 vUv;\n\n void main() {\n\n\t\t\tvUv = uv;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n\n ",fragmentShader:"\n\t\t// precision highp float;\n\t\tprecision highp sampler2D;\n\t\tvarying vec2 vUv;\n\t\tuniform sampler2D tDepth;\n\t\tuniform sampler2D tNormal;\n\t\tuniform sampler2D tMetalness;\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform float cameraRange;\n\t\tuniform vec2 resolution;\n\t\tuniform float opacity;\n\t\tuniform float cameraNear;\n\t\tuniform float cameraFar;\n\t\tuniform float maxDistance;\n\t\tuniform float surfDist;\n\t\tuniform mat4 cameraProjectionMatrix;\n\t\tuniform mat4 cameraInverseProjectionMatrix;\n\t\tuniform float thickTolerance;\n\t\t#include <packing>\n\t\tfloat pointToLineDistance(vec3 x0, vec3 x1, vec3 x2) {\n\t\t\t//x0: point, x1: linePointA, x2: linePointB\n\t\t\t//https://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html\n\t\t\treturn length(cross(x0-x1,x0-x2))/length(x2-x1);\n\t\t}\n\t\tfloat pointPlaneDistance(vec3 point,vec3 planePoint,vec3 planeNormal){\n\t\t\t// https://mathworld.wolfram.com/Point-PlaneDistance.html\n\t\t\t//// https://en.wikipedia.org/wiki/Plane_(geometry)\n\t\t\t//// http://paulbourke.net/geometry/pointlineplane/\n\t\t\tfloat a=planeNormal.x,b=planeNormal.y,c=planeNormal.z;\n\t\t\tfloat x0=point.x,y0=point.y,z0=point.z;\n\t\t\tfloat x=planePoint.x,y=planePoint.y,z=planePoint.z;\n\t\t\tfloat d=-(a*x+b*y+c*z);\n\t\t\tfloat distance=(a*x0+b*y0+c*z0+d)/sqrt(a*a+b*b+c*c);\n\t\t\treturn distance;\n\t\t}\n\t\tfloat getDepth( const in vec2 uv ) {\n\t\t\treturn texture2D( tDepth, uv ).x;\n\t\t}\n\t\tfloat getViewZ( const in float depth ) {\n\t\t\t#ifdef isPerspectiveCamera\n\t\t\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#else\n\t\t\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#endif\n\t\t}\n\t\tvec3 getViewPosition( const in vec2 uv, const in float depth/*clip space*/, const in float clipW ) {\n\t\t\tvec4 clipPosition = vec4( ( vec3( uv, depth ) - 0.5 ) * 2.0, 1.0 );//ndc\n\t\t\tclipPosition *= clipW; //clip\n\t\t\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;//view\n\t\t}\n\t\tvec3 getViewNormal( const in vec2 uv ) {\n\t\t\treturn unpackRGBToNormal( texture2D( tNormal, uv ).xyz );\n\t\t}\n\t\tvec2 viewPositionToXY(vec3 viewPosition){\n\t\t\tvec2 xy;\n\t\t\tvec4 clip=cameraProjectionMatrix*vec4(viewPosition,1);\n\t\t\txy=clip.xy;//clip\n\t\t\tfloat clipW=clip.w;\n\t\t\txy/=clipW;//NDC\n\t\t\txy=(xy+1.)/2.;//uv\n\t\t\txy*=resolution;//screen\n\t\t\treturn xy;\n\t\t}\n\t\tvoid main(){\n\t\t\t#ifdef isSelective\n\t\t\t\tfloat metalness=texture2D(tMetalness,vUv).r;\n\t\t\t\tif(metalness==0.) return;\n\t\t\t#endif\n\n\t\t\tfloat depth = getDepth( vUv );\n\t\t\tfloat viewZ = getViewZ( depth );\n\t\t\tif(-viewZ>=cameraFar) return;\n\n\t\t\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ+cameraProjectionMatrix[3][3];\n\t\t\tvec3 viewPosition=getViewPosition( vUv, depth, clipW );\n\n\t\t\tvec2 d0=gl_FragCoord.xy;\n\t\t\tvec2 d1;\n\n\t\t\tvec3 viewNormal=getViewNormal( vUv );\n\n\t\t\t#ifdef isPerspectiveCamera\n\t\t\t\tvec3 viewIncidenceDir=normalize(viewPosition);\n\t\t\t\tvec3 viewReflectDir=reflect(viewIncidenceDir,viewNormal);\n\t\t\t#else\n\t\t\t\tvec3 viewIncidenceDir=vec3(0,0,-1);\n\t\t\t\tvec3 viewReflectDir=reflect(viewIncidenceDir,viewNormal);\n\t\t\t#endif\n\n\t\t\tfloat maxReflectRayLen=maxDistance/dot(-viewIncidenceDir,viewNormal);\n\t\t\t// dot(a,b)==length(a)*length(b)*cos(theta) // https://www.mathsisfun.com/algebra/vectors-dot-product.html\n\t\t\t// if(a.isNormalized&&b.isNormalized) dot(a,b)==cos(theta)\n\t\t\t// maxDistance/maxReflectRayLen=cos(theta)\n\t\t\t// maxDistance/maxReflectRayLen==dot(a,b)\n\t\t\t// maxReflectRayLen==maxDistance/dot(a,b)\n\n\t\t\tvec3 d1viewPosition=viewPosition+viewReflectDir*maxReflectRayLen;\n\t\t\t#ifdef isPerspectiveCamera\n\t\t\t\tif(d1viewPosition.z>-cameraNear){\n\t\t\t\t\t//https://tutorial.math.lamar.edu/Classes/CalcIII/EqnsOfLines.aspx\n\t\t\t\t\tfloat t=(-cameraNear-viewPosition.z)/viewReflectDir.z;\n\t\t\t\t\td1viewPosition=viewPosition+viewReflectDir*t;\n\t\t\t\t}\n\t\t\t#endif\n\t\t\td1=viewPositionToXY(d1viewPosition);\n\n\t\t\tfloat totalLen=length(d1-d0);\n\t\t\tfloat xLen=d1.x-d0.x;\n\t\t\tfloat yLen=d1.y-d0.y;\n\t\t\tfloat totalStep=max(abs(xLen),abs(yLen));\n\t\t\tfloat xSpan=xLen/totalStep;\n\t\t\tfloat ySpan=yLen/totalStep;\n\t\t\tfor(float i=0.;i<MAX_STEP;i++){\n\t\t\t\tif(i>=totalStep) break;\n\t\t\t\tvec2 xy=vec2(d0.x+i*xSpan,d0.y+i*ySpan);\n\t\t\t\tif(xy.x<0.||xy.x>resolution.x||xy.y<0.||xy.y>resolution.y) break;\n\t\t\t\tfloat s=length(xy-d0)/totalLen;\n\t\t\t\tvec2 uv=xy/resolution;\n\n\t\t\t\tfloat d = getDepth(uv);\n\t\t\t\tfloat vZ = getViewZ( d );\n\t\t\t\tif(-vZ>=cameraFar) continue;\n\t\t\t\tfloat cW = cameraProjectionMatrix[2][3] * vZ+cameraProjectionMatrix[3][3];\n\t\t\t\tvec3 vP=getViewPosition( uv, d, cW );\n\n\t\t\t\t#ifdef isPerspectiveCamera\n\t\t\t\t\t// https://www.comp.nus.edu.sg/~lowkl/publications/lowk_persp_interp_techrep.pdf\n\t\t\t\t\tfloat recipVPZ=1./viewPosition.z;\n\t\t\t\t\tfloat viewReflectRayZ=1./(recipVPZ+s*(1./d1viewPosition.z-recipVPZ));\n\t\t\t\t\tfloat sD=surfDist*cW;\n\t\t\t\t#else\n\t\t\t\t\tfloat viewReflectRayZ=viewPosition.z+s*(d1viewPosition.z-viewPosition.z);\n\t\t\t\t\tfloat sD=surfDist;\n\t\t\t\t#endif\n\t\t\t\tif(viewReflectRayZ-sD>vZ) continue;\n\n\t\t\t\t#ifdef isInfiniteThick\n\t\t\t\t\tif(viewReflectRayZ+thickTolerance*clipW<vP.z) break;\n\t\t\t\t#endif\n\t\t\t\tfloat away=pointToLineDistance(vP,viewPosition,d1viewPosition);\n\n\t\t\t\tfloat op=opacity;\n\n\t\t\t\tif(away<sD){\n\t\t\t\t\tvec3 vN=getViewNormal( uv );\n\t\t\t\t\tif(dot(viewReflectDir,vN)>=0.) continue;\n\t\t\t\t\tfloat distance=pointPlaneDistance(vP,viewPosition,viewNormal);\n\t\t\t\t\tif(distance>maxDistance) break;\n\t\t\t\t\t#ifdef isDistanceAttenuation\n\t\t\t\t\t\tfloat ratio=1.-(distance/maxDistance);\n\t\t\t\t\t\tfloat attenuation=ratio*ratio;\n\t\t\t\t\t\top=opacity*attenuation;\n\t\t\t\t\t#endif\n\t\t\t\t\t#ifdef isFresnel\n\t\t\t\t\t\tfloat fresnel=(dot(viewIncidenceDir,viewReflectDir)+1.)/2.;\n\t\t\t\t\t\top*=fresnel;\n\t\t\t\t\t#endif\n\t\t\t\t\tvec4 reflectColor=texture2D(tDiffuse,uv);\n\t\t\t\t\tgl_FragColor.xyz=reflectColor.xyz;\n\t\t\t\t\tgl_FragColor.a=op;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t"},ns={defines:{PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null}},vertexShader:"\n\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n\n ",fragmentShader:"\n\n uniform sampler2D tDepth;\n\n uniform float cameraNear;\n uniform float cameraFar;\n\n varying vec2 vUv;\n\n #include <packing>\n\n\t\tfloat getLinearDepth( const in vec2 uv ) {\n\n\t\t\t#if PERSPECTIVE_CAMERA == 1\n\n\t\t\t\tfloat fragCoordZ = texture2D( tDepth, uv ).x;\n\t\t\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );\n\t\t\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );\n\n\t\t\t#else\n\n\t\t\t\treturn texture2D( tDepth, uv ).x;\n\n\t\t\t#endif\n\n\t\t}\n\n void main() {\n\n \tfloat depth = getLinearDepth( vUv );\n\t\t\tfloat d = 1.0 - depth;\n\t\t\t// d=(d-.999)*1000.;\n \tgl_FragColor = vec4( vec3( d ), 1.0 );\n\n }\n\n "},is={uniforms:{tDiffuse:{value:null},resolution:{value:new n.Vector2},opacity:{value:.5}},vertexShader:"\n\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n\n ",fragmentShader:"\n\n uniform sampler2D tDiffuse;\n uniform vec2 resolution;\n varying vec2 vUv;\n void main() {\n\t\t\t//reverse engineering from PhotoShop blur filter, then change coefficient\n\n \tvec2 texelSize = ( 1.0 / resolution );\n\n\t\t\tvec4 c=texture2D(tDiffuse,vUv);\n\n\t\t\tvec2 offset;\n\n\t\t\toffset=(vec2(-1,0))*texelSize;\n\t\t\tvec4 cl=texture2D(tDiffuse,vUv+offset);\n\n\t\t\toffset=(vec2(1,0))*texelSize;\n\t\t\tvec4 cr=texture2D(tDiffuse,vUv+offset);\n\n\t\t\toffset=(vec2(0,-1))*texelSize;\n\t\t\tvec4 cb=texture2D(tDiffuse,vUv+offset);\n\n\t\t\toffset=(vec2(0,1))*texelSize;\n\t\t\tvec4 ct=texture2D(tDiffuse,vUv+offset);\n\n\t\t\t// float coeCenter=.5;\n\t\t\t// float coeSide=.125;\n\t\t\tfloat coeCenter=.2;\n\t\t\tfloat coeSide=.2;\n\t\t\tfloat a=c.a*coeCenter+cl.a*coeSide+cr.a*coeSide+cb.a*coeSide+ct.a*coeSide;\n\t\t\tvec3 rgb=(c.rgb*c.a*coeCenter+cl.rgb*cl.a*coeSide+cr.rgb*cr.a*coeSide+cb.rgb*cb.a*coeSide+ct.rgb*ct.a*coeSide)/a;\n\t\t\tgl_FragColor=vec4(rgb,a);\n\n\t\t}\n\t"};var as=Object.defineProperty;const ss=class extends Ki.w{constructor({renderer:e,scene:t,camera:r,width:i,height:a,selects:s,bouncing:o=!1,groundReflector:l}){super(),this.width=void 0!==i?i:512,this.height=void 0!==a?a:512,this.clear=!0,this.renderer=e,this.scene=t,this.camera=r,this.groundReflector=l,this.opacity=rs.uniforms.opacity.value,this.output=0,this.maxDistance=rs.uniforms.maxDistance.value,this.thickness=rs.uniforms.thickness.value,this.tempColor=new n.Color,this._selects=s,this.selective=Array.isArray(this._selects),Object.defineProperty(this,"selects",{get(){return this._selects},set(e){this._selects!==e&&(this._selects=e,Array.isArray(e)?(this.selective=!0,this.ssrMaterial.defines.SELECTIVE=!0,this.ssrMaterial.needsUpdate=!0):(this.selective=!1,this.ssrMaterial.defines.SELECTIVE=!1,this.ssrMaterial.needsUpdate=!0))}}),this._bouncing=o,Object.defineProperty(this,"bouncing",{get(){return this._bouncing},set(e){this._bouncing!==e&&(this._bouncing=e,this.ssrMaterial.uniforms.tDiffuse.value=e?this.prevRenderTarget.texture:this.beautyRenderTarget.texture)}}),this.blur=!0,this._distanceAttenuation=rs.defines.DISTANCE_ATTENUATION,Object.defineProperty(this,"distanceAttenuation",{get(){return this._distanceAttenuation},set(e){this._distanceAttenuation!==e&&(this._distanceAttenuation=e,this.ssrMaterial.defines.DISTANCE_ATTENUATION=e,this.ssrMaterial.needsUpdate=!0)}}),this._fresnel=rs.defines.FRESNEL,Object.defineProperty(this,"fresnel",{get(){return this._fresnel},set(e){this._fresnel!==e&&(this._fresnel=e,this.ssrMaterial.defines.FRESNEL=e,this.ssrMaterial.needsUpdate=!0)}}),this._infiniteThick=rs.defines.INFINITE_THICK,Object.defineProperty(this,"infiniteThick",{get(){return this._infiniteThick},set(e){this._infiniteThick!==e&&(this._infiniteThick=e,this.ssrMaterial.defines.INFINITE_THICK=e,this.ssrMaterial.needsUpdate=!0)}});const c=new n.DepthTexture;c.type=n.UnsignedShortType,c.minFilter=n.NearestFilter,c.magFilter=n.NearestFilter,this.beautyRenderTarget=new n.WebGLRenderTarget(this.width,this.height,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,type:n.HalfFloatType,depthTexture:c,depthBuffer:!0}),this.prevRenderTarget=new n.WebGLRenderTarget(this.width,this.height,{minFilter:n.NearestFilter,magFilter:n.NearestFilter}),this.normalRenderTarget=new n.WebGLRenderTarget(this.width,this.height,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,type:n.HalfFloatType}),this.metalnessRenderTarget=new n.WebGLRenderTarget(this.width,this.height,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,type:n.HalfFloatType}),this.ssrRenderTarget=new n.WebGLRenderTarget(this.width,this.height,{minFilter:n.NearestFilter,magFilter:n.NearestFilter}),this.blurRenderTarget=this.ssrRenderTarget.clone(),this.blurRenderTarget2=this.ssrRenderTarget.clone(),this.ssrMaterial=new n.ShaderMaterial({defines:Object.assign({},rs.defines,{MAX_STEP:Math.sqrt(this.width*this.width+this.height*this.height)}),uniforms:n.UniformsUtils.clone(rs.uniforms),vertexShader:rs.vertexShader,fragmentShader:rs.fragmentShader,blending:n.NoBlending}),this.ssrMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.ssrMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.ssrMaterial.defines.SELECTIVE=this.selective,this.ssrMaterial.needsUpdate=!0,this.ssrMaterial.uniforms.tMetalness.value=this.metalnessRenderTarget.texture,this.ssrMaterial.uniforms.tDepth.value=this.beautyRenderTarget.depthTexture,this.ssrMaterial.uniforms.cameraNear.value=this.camera.near,this.ssrMaterial.uniforms.cameraFar.value=this.camera.far,this.ssrMaterial.uniforms.thickness.value=this.thickness,this.ssrMaterial.uniforms.resolution.value.set(this.width,this.height),this.ssrMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssrMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.normalMaterial=new n.MeshNormalMaterial,this.normalMaterial.blending=n.NoBlending,this.metalnessOnMaterial=new n.MeshBasicMaterial({color:"white"}),this.metalnessOffMaterial=new n.MeshBasicMaterial({color:"black"}),this.blurMaterial=new n.ShaderMaterial({defines:Object.assign({},is.defines),uniforms:n.UniformsUtils.clone(is.uniforms),vertexShader:is.vertexShader,fragmentShader:is.fragmentShader}),this.blurMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.blurMaterial.uniforms.resolution.value.set(this.width,this.height),this.blurMaterial2=new n.ShaderMaterial({defines:Object.assign({},is.defines),uniforms:n.UniformsUtils.clone(is.uniforms),vertexShader:is.vertexShader,fragmentShader:is.fragmentShader}),this.blurMaterial2.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.blurMaterial2.uniforms.resolution.value.set(this.width,this.height),this.depthRenderMaterial=new n.ShaderMaterial({defines:Object.assign({},ns.defines),uniforms:n.UniformsUtils.clone(ns.uniforms),vertexShader:ns.vertexShader,fragmentShader:ns.fragmentShader,blending:n.NoBlending}),this.depthRenderMaterial.uniforms.tDepth.value=this.beautyRenderTarget.depthTexture,this.depthRenderMaterial.uniforms.cameraNear.value=this.camera.near,this.depthRenderMaterial.uniforms.cameraFar.value=this.camera.far,this.copyMaterial=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(ga.C.uniforms),vertexShader:ga.C.vertexShader,fragmentShader:ga.C.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blendSrc:n.SrcAlphaFactor,blendDst:n.OneMinusSrcAlphaFactor,blendEquation:n.AddEquation,blendSrcAlpha:n.SrcAlphaFactor,blendDstAlpha:n.OneMinusSrcAlphaFactor,blendEquationAlpha:n.AddEquation}),this.fsQuad=new Ki.T(null),this.originalClearColor=new n.Color}dispose(){this.beautyRenderTarget.dispose(),this.prevRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.metalnessRenderTarget.dispose(),this.ssrRenderTarget.dispose(),this.blurRenderTarget.dispose(),this.blurRenderTarget2.dispose(),this.normalMaterial.dispose(),this.metalnessOnMaterial.dispose(),this.metalnessOffMaterial.dispose(),this.blurMaterial.dispose(),this.blurMaterial2.dispose(),this.copyMaterial.dispose(),this.depthRenderMaterial.dispose(),this.fsQuad.dispose()}render(e,t){switch(e.setRenderTarget(this.beautyRenderTarget),e.clear(),this.groundReflector&&(this.groundReflector.visible=!1,this.groundReflector.doRender(this.renderer,this.scene,this.camera),this.groundReflector.visible=!0),e.render(this.scene,this.camera),this.groundReflector&&(this.groundReflector.visible=!1),this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,0,0),this.selective&&this.renderMetalness(e,this.metalnessOnMaterial,this.metalnessRenderTarget,0,0),this.ssrMaterial.uniforms.opacity.value=this.opacity,this.ssrMaterial.uniforms.maxDistance.value=this.maxDistance,this.ssrMaterial.uniforms.thickness.value=this.thickness,this.renderPass(e,this.ssrMaterial,this.ssrRenderTarget),this.blur&&(this.renderPass(e,this.blurMaterial,this.blurRenderTarget),this.renderPass(e,this.blurMaterial2,this.blurRenderTarget2)),this.output){case ss.OUTPUT.Default:this.bouncing?(this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=n.NoBlending,this.renderPass(e,this.copyMaterial,this.prevRenderTarget),this.blur?this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget2.texture:this.copyMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.copyMaterial.blending=n.NormalBlending,this.renderPass(e,this.copyMaterial,this.prevRenderTarget),this.copyMaterial.uniforms.tDiffuse.value=this.prevRenderTarget.texture,this.copyMaterial.blending=n.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t)):(this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=n.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.blur?this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget2.texture:this.copyMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.copyMaterial.blending=n.NormalBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t));break;case ss.OUTPUT.SSR:this.blur?this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget2.texture:this.copyMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.copyMaterial.blending=n.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.bouncing&&(this.blur?this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget2.texture:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=n.NoBlending,this.renderPass(e,this.copyMaterial,this.prevRenderTarget),this.copyMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.copyMaterial.blending=n.NormalBlending,this.renderPass(e,this.copyMaterial,this.prevRenderTarget));break;case ss.OUTPUT.Beauty:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=n.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case ss.OUTPUT.Depth:this.renderPass(e,this.depthRenderMaterial,this.renderToScreen?null:t);break;case ss.OUTPUT.Normal:this.copyMaterial.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.copyMaterial.blending=n.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case ss.OUTPUT.Metalness:this.copyMaterial.uniforms.tDiffuse.value=this.metalnessRenderTarget.texture,this.copyMaterial.blending=n.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;default:console.warn("THREE.SSRPass: Unknown output type.")}}renderPass(e,t,r,n,i){this.originalClearColor.copy(e.getClearColor(this.tempColor));const a=e.getClearAlpha(this.tempColor),s=e.autoClear;e.setRenderTarget(r),e.autoClear=!1,null!=n&&(e.setClearColor(n),e.setClearAlpha(i||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=s,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)}renderOverride(e,t,r,n,i){this.originalClearColor.copy(e.getClearColor(this.tempColor));const a=e.getClearAlpha(this.tempColor),s=e.autoClear;e.setRenderTarget(r),e.autoClear=!1,n=t.clearColor||n,i=t.clearAlpha||i,null!=n&&(e.setClearColor(n),e.setClearAlpha(i||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)}renderMetalness(e,t,r,n,i){this.originalClearColor.copy(e.getClearColor(this.tempColor));const a=e.getClearAlpha(this.tempColor),s=e.autoClear;e.setRenderTarget(r),e.autoClear=!1,n=t.clearColor||n,i=t.clearAlpha||i,null!=n&&(e.setClearColor(n),e.setClearAlpha(i||0),e.clear()),this.scene.traverseVisible((e=>{e._SSRPassBackupMaterial=e.material,this._selects.includes(e)?e.material=this.metalnessOnMaterial:e.material=this.metalnessOffMaterial})),e.render(this.scene,this.camera),this.scene.traverseVisible((e=>{e.material=e._SSRPassBackupMaterial})),e.autoClear=s,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)}setSize(e,t){this.width=e,this.height=t,this.ssrMaterial.defines.MAX_STEP=Math.sqrt(e*e+t*t),this.ssrMaterial.needsUpdate=!0,this.beautyRenderTarget.setSize(e,t),this.prevRenderTarget.setSize(e,t),this.ssrRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.metalnessRenderTarget.setSize(e,t),this.blurRenderTarget.setSize(e,t),this.blurRenderTarget2.setSize(e,t),this.ssrMaterial.uniforms.resolution.value.set(e,t),this.ssrMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssrMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.blurMaterial.uniforms.resolution.value.set(e,t),this.blurMaterial2.uniforms.resolution.value.set(e,t)}};let os=ss;((e,t,r)=>{((e,t,r)=>{t in e?as(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r)})(os,"OUTPUT",{Default:0,SSR:1,Beauty:3,Depth:4,Normal:5,Metalness:7});class ls extends Ki.w{constructor(e,t,r,i){super(),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==r?r:0,this.clearAlpha=void 0!==i?i:0,this._oldClearColor=new n.Color;const a=ga.C;this.copyUniforms=n.UniformsUtils.clone(a.uniforms),this.copyMaterial=new n.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blending:n.CustomBlending,blendEquation:n.AddEquation,blendDst:n.OneFactor,blendDstAlpha:n.OneFactor,blendSrc:n.SrcAlphaFactor,blendSrcAlpha:n.OneFactor}),this.fsQuad=new Ki.T(this.copyMaterial)}dispose(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null),this.copyMaterial.dispose(),this.fsQuad.dispose()}setSize(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)}render(e,t,r){this.sampleRenderTarget||(this.sampleRenderTarget=new n.WebGLRenderTarget(r.width,r.height,{type:n.HalfFloatType}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");const i=cs[Math.max(0,Math.min(this.sampleLevel,5))],a=e.autoClear;e.autoClear=!1,e.getClearColor(this._oldClearColor);const s=e.getClearAlpha(),o=1/i.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;const l={fullWidth:r.width,fullHeight:r.height,offsetX:0,offsetY:0,width:r.width,height:r.height},c=Object.assign({},this.camera.view);c.enabled&&Object.assign(l,c);for(let n=0;n<i.length;n++){const r=i[n];this.camera.setViewOffset&&this.camera.setViewOffset(l.fullWidth,l.fullHeight,l.offsetX+.0625*r[0],l.offsetY+.0625*r[1],l.width,l.height);let a=o;if(this.unbiased){a+=.03125*((n+.5)/i.length-.5)}this.copyUniforms.opacity.value=a,e.setClearColor(this.clearColor,this.clearAlpha),e.setRenderTarget(this.sampleRenderTarget),e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(this.renderToScreen?null:t),0===n&&(e.setClearColor(0,0),e.clear()),this.fsQuad.render(e)}this.camera.setViewOffset&&c.enabled?this.camera.setViewOffset(c.fullWidth,c.fullHeight,c.offsetX,c.offsetY,c.width,c.height):this.camera.clearViewOffset&&this.camera.clearViewOffset(),e.autoClear=a,e.setClearColor(this._oldClearColor,s)}}const cs=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]];class us extends ls{constructor(e,t,r,n){super(e,t,r,n),this.sampleLevel=0,this.accumulate=!1}render(e,t,r,i){if(!1===this.accumulate)return super.render(e,t,r,i),void(this.accumulateIndex=-1);const a=hs[5];void 0===this.sampleRenderTarget&&(this.sampleRenderTarget=new n.WebGLRenderTarget(r.width,r.height,{type:n.HalfFloatType}),this.sampleRenderTarget.texture.name="TAARenderPass.sample"),void 0===this.holdRenderTarget&&(this.holdRenderTarget=new n.WebGLRenderTarget(r.width,r.height,{type:n.HalfFloatType}),this.holdRenderTarget.texture.name="TAARenderPass.hold"),-1===this.accumulateIndex&&(super.render(e,this.holdRenderTarget,r,i),this.accumulateIndex=0);const s=e.autoClear;e.autoClear=!1;const o=1/a.length;if(this.accumulateIndex>=0&&this.accumulateIndex<a.length){this.copyUniforms.opacity.value=o,this.copyUniforms.tDiffuse.value=t.texture;const n=Math.pow(2,this.sampleLevel);for(let i=0;i<n;i++){const n=a[this.accumulateIndex];if(this.camera.setViewOffset&&this.camera.setViewOffset(r.width,r.height,.0625*n[0],.0625*n[1],r.width,r.height),e.setRenderTarget(t),e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(this.sampleRenderTarget),0===this.accumulateIndex&&e.clear(),this.fsQuad.render(e),this.accumulateIndex++,this.accumulateIndex>=a.length)break}this.camera.clearViewOffset&&this.camera.clearViewOffset()}const l=this.accumulateIndex*o;l>0&&(this.copyUniforms.opacity.value=1,this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,e.setRenderTarget(t),e.clear(),this.fsQuad.render(e)),l<1&&(this.copyUniforms.opacity.value=1-l,this.copyUniforms.tDiffuse.value=this.holdRenderTarget.texture,e.setRenderTarget(t),0===l&&e.clear(),this.fsQuad.render(e)),e.autoClear=s}dispose(){super.dispose(),void 0!==this.sampleRenderTarget&&this.sampleRenderTarget.dispose(),void 0!==this.holdRenderTarget&&this.holdRenderTarget.dispose()}}const hs=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]];var ds=r(48197);class ps extends Ki.w{constructor(e,t,r,i,a={}){var s,o;super(),this.pixelSize=t,this.resolution=new n.Vector2,this.renderResolution=new n.Vector2,this.setSize(e.x,e.y),this.fsQuad=new Ki.T(this.material()),this.scene=r,this.camera=i,this.normalEdgeStrength=null!=(s=a.normalEdgeStrength)?s:.3,this.depthEdgeStrength=null!=(o=a.depthEdgeStrength)?o:.4,this.rgbRenderTarget=fs(this.renderResolution,n.RGBAFormat,!0),this.normalRenderTarget=fs(this.renderResolution,n.RGBAFormat,!1),this.normalMaterial=new n.MeshNormalMaterial}dispose(){this.rgbRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.fsQuad.dispose()}setSize(e,t){var r,n,i;this.resolution.set(e,t),this.renderResolution.set(e/this.pixelSize|0,t/this.pixelSize|0);const{x:a,y:s}=this.renderResolution;null==(r=this.rgbRenderTarget)||r.setSize(a,s),null==(n=this.normalRenderTarget)||n.setSize(a,s),null==(i=this.fsQuad)||i.material.uniforms.resolution.value.set(a,s,1/a,1/s)}setPixelSize(e){this.pixelSize=e,this.setSize(this.resolution.x,this.resolution.y)}render(e,t){const r=this.fsQuad.material.uniforms;r.normalEdgeStrength.value=this.normalEdgeStrength,r.depthEdgeStrength.value=this.depthEdgeStrength,e.setRenderTarget(this.rgbRenderTarget),e.render(this.scene,this.camera);const n=this.scene.overrideMaterial;e.setRenderTarget(this.normalRenderTarget),this.scene.overrideMaterial=this.normalMaterial,e.render(this.scene,this.camera),this.scene.overrideMaterial=n,r.tDiffuse.value=this.rgbRenderTarget.texture,r.tDepth.value=this.rgbRenderTarget.depthTexture,r.tNormal.value=this.normalRenderTarget.texture,this.renderToScreen?e.setRenderTarget(null):(e.setRenderTarget(t),this.clear&&e.clear()),this.fsQuad.render(e)}material(){return new n.ShaderMaterial({uniforms:{tDiffuse:{value:null},tDepth:{value:null},tNormal:{value:null},resolution:{value:new n.Vector4(this.renderResolution.x,this.renderResolution.y,1/this.renderResolution.x,1/this.renderResolution.y)},normalEdgeStrength:{value:0},depthEdgeStrength:{value:0}},vertexShader:"\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\t}\n\t\t\t\t",fragmentShader:"\n\t\t\t\tuniform sampler2D tDiffuse;\n\t\t\t\tuniform sampler2D tDepth;\n\t\t\t\tuniform sampler2D tNormal;\n\t\t\t\tuniform vec4 resolution;\n\t\t\t\tuniform float normalEdgeStrength;\n\t\t\t\tuniform float depthEdgeStrength;\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tfloat getDepth(int x, int y) {\n\n\t\t\t\t\treturn texture2D( tDepth, vUv + vec2(x, y) * resolution.zw ).r;\n\n\t\t\t\t}\n\n\t\t\t\tvec3 getNormal(int x, int y) {\n\n\t\t\t\t\treturn texture2D( tNormal, vUv + vec2(x, y) * resolution.zw ).rgb * 2.0 - 1.0;\n\n\t\t\t\t}\n\n\t\t\t\tfloat depthEdgeIndicator(float depth, vec3 normal) {\n\n\t\t\t\t\tfloat diff = 0.0;\n\t\t\t\t\tdiff += clamp(getDepth(1, 0) - depth, 0.0, 1.0);\n\t\t\t\t\tdiff += clamp(getDepth(-1, 0) - depth, 0.0, 1.0);\n\t\t\t\t\tdiff += clamp(getDepth(0, 1) - depth, 0.0, 1.0);\n\t\t\t\t\tdiff += clamp(getDepth(0, -1) - depth, 0.0, 1.0);\n\t\t\t\t\treturn floor(smoothstep(0.01, 0.02, diff) * 2.) / 2.;\n\n\t\t\t\t}\n\n\t\t\t\tfloat neighborNormalEdgeIndicator(int x, int y, float depth, vec3 normal) {\n\n\t\t\t\t\tfloat depthDiff = getDepth(x, y) - depth;\n\t\t\t\t\tvec3 neighborNormal = getNormal(x, y);\n\t\t\t\t\t\n\t\t\t\t\t// Edge pixels should yield to faces who's normals are closer to the bias normal.\n\t\t\t\t\tvec3 normalEdgeBias = vec3(1., 1., 1.); // This should probably be a parameter.\n\t\t\t\t\tfloat normalDiff = dot(normal - neighborNormal, normalEdgeBias);\n\t\t\t\t\tfloat normalIndicator = clamp(smoothstep(-.01, .01, normalDiff), 0.0, 1.0);\n\t\t\t\t\t\n\t\t\t\t\t// Only the shallower pixel should detect the normal edge.\n\t\t\t\t\tfloat depthIndicator = clamp(sign(depthDiff * .25 + .0025), 0.0, 1.0);\n\n\t\t\t\t\treturn (1.0 - dot(normal, neighborNormal)) * depthIndicator * normalIndicator;\n\n\t\t\t\t}\n\n\t\t\t\tfloat normalEdgeIndicator(float depth, vec3 normal) {\n\t\t\t\t\t\n\t\t\t\t\tfloat indicator = 0.0;\n\n\t\t\t\t\tindicator += neighborNormalEdgeIndicator(0, -1, depth, normal);\n\t\t\t\t\tindicator += neighborNormalEdgeIndicator(0, 1, depth, normal);\n\t\t\t\t\tindicator += neighborNormalEdgeIndicator(-1, 0, depth, normal);\n\t\t\t\t\tindicator += neighborNormalEdgeIndicator(1, 0, depth, normal);\n\n\t\t\t\t\treturn step(0.1, indicator);\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\n\t\t\t\t\tfloat depth = 0.0;\n\t\t\t\t\tvec3 normal = vec3(0.0);\n\n\t\t\t\t\tif (depthEdgeStrength > 0.0 || normalEdgeStrength > 0.0) {\n\n\t\t\t\t\t\tdepth = getDepth(0, 0);\n\t\t\t\t\t\tnormal = getNormal(0, 0);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat dei = 0.0;\n\t\t\t\t\tif (depthEdgeStrength > 0.0) \n\t\t\t\t\t\tdei = depthEdgeIndicator(depth, normal);\n\n\t\t\t\t\tfloat nei = 0.0; \n\t\t\t\t\tif (normalEdgeStrength > 0.0) \n\t\t\t\t\t\tnei = normalEdgeIndicator(depth, normal);\n\n\t\t\t\t\tfloat Strength = dei > 0.0 ? (1.0 - depthEdgeStrength * dei) : (1.0 + normalEdgeStrength * nei);\n\n\t\t\t\t\tgl_FragColor = texel * Strength;\n\n\t\t\t\t}\n\t\t\t\t"})}}function fs(e,t,r){const i=new n.WebGLRenderTarget(e.x,e.y,r?{depthTexture:new n.DepthTexture(e.x,e.y),depthBuffer:!0}:void 0);return i.texture.format=t,i.texture.minFilter=n.NearestFilter,i.texture.magFilter=n.NearestFilter,i.texture.generateMipmaps=!1,i.stencilBuffer=!1,i}const ms={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new n.Vector2(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","\tvUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","\tvec2 imageCoord = vUv;","\tvec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","\tfor( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","\t\tsum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","\t\timageCoord += uImageIncrement;","\t}","\tgl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){const t=Math.min(2*Math.ceil(3*e)+1,25),r=.5*(t-1),n=new Array(t);let i=0;for(let o=0;o<t;++o)n[o]=(a=o-r,s=e,Math.exp(-a*a/(2*s*s))),i+=n[o];var a,s;for(let o=0;o<t;++o)n[o]/=i;return n}};var gs=Object.defineProperty,vs=(e,t,r)=>(((e,t,r)=>{t in e?gs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class As extends Ki.w{constructor(e=1,t=25,r=4,i=256){super(),vs(this,"renderTargetX"),vs(this,"renderTargetY"),vs(this,"materialCombine"),vs(this,"materialConvolution"),vs(this,"fsQuad"),vs(this,"combineUniforms"),vs(this,"convolutionUniforms"),vs(this,"blurX",new n.Vector2(.001953125,0)),vs(this,"blurY",new n.Vector2(0,.001953125)),this.renderTargetX=new n.WebGLRenderTarget(i,i),this.renderTargetX.texture.name="BloomPass.x",this.renderTargetY=new n.WebGLRenderTarget(i,i),this.renderTargetY.texture.name="BloomPass.y",this.combineUniforms=n.UniformsUtils.clone(ys.uniforms),this.combineUniforms.strength.value=e,this.materialCombine=new n.ShaderMaterial({uniforms:this.combineUniforms,vertexShader:ys.vertexShader,fragmentShader:ys.fragmentShader,blending:n.AdditiveBlending,transparent:!0}),void 0===ms&&console.error("BloomPass relies on ConvolutionShader");const a=ms;this.convolutionUniforms=n.UniformsUtils.clone(a.uniforms),this.convolutionUniforms.uImageIncrement.value=this.blurX,this.convolutionUniforms.cKernel.value=ms.buildKernel(r),this.materialConvolution=new n.ShaderMaterial({uniforms:this.convolutionUniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,defines:{KERNEL_SIZE_FLOAT:t.toFixed(1),KERNEL_SIZE_INT:t.toFixed(0)}}),this.needsSwap=!1,this.fsQuad=new Ki.T(this.materialConvolution)}render(e,t,r,n,i){i&&e.state.buffers.stencil.setTest(!1),this.fsQuad.material=this.materialConvolution,this.convolutionUniforms.tDiffuse.value=r.texture,this.convolutionUniforms.uImageIncrement.value=this.blurX,e.setRenderTarget(this.renderTargetX),e.clear(),this.fsQuad.render(e),this.convolutionUniforms.tDiffuse.value=this.renderTargetX.texture,this.convolutionUniforms.uImageIncrement.value=this.blurY,e.setRenderTarget(this.renderTargetY),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialCombine,this.combineUniforms.tDiffuse.value=this.renderTargetY.texture,i&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(r),this.clear&&e.clear(),this.fsQuad.render(e)}}const ys={uniforms:{tDiffuse:{value:null},strength:{value:1}},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"\n uniform float strength;\n uniform sampler2D tDiffuse;\n varying vec2 vUv;\n void main() {\n vec4 texel = texture2D( tDiffuse, vUv );\n gl_FragColor = strength * texel;\n }"};var xs=Object.defineProperty,bs=(e,t,r)=>(((e,t,r)=>{t in e?xs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class ws extends Ki.w{constructor(){super(),bs(this,"material"),bs(this,"fsQuad"),bs(this,"factor"),bs(this,"time"),bs(this,"uniforms"),this.uniforms=n.UniformsUtils.clone({tex:{value:null},time:{value:0},factor:{value:0},resolution:{value:new n.Vector2(64,64)}}),this.material=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:"\n varying vec2 vUv;\n void main(){ \n vUv = uv; \n vec4 modelViewPosition = modelViewMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewPosition;\n }",fragmentShader:"\n uniform float time;\n uniform float factor;\n uniform vec2 resolution;\n uniform sampler2D tex;\n varying vec2 vUv;\n void main() { \n vec2 uv1 = vUv;\n vec2 uv = gl_FragCoord.xy/resolution.xy;\n float frequency = 6.0 * factor;\n float amplitude = 0.015 * factor;\n float x = uv1.y * frequency + time * .7; \n float y = uv1.x * frequency + time * .3;\n uv1.x += cos(x+y) * amplitude * cos(y);\n uv1.y += sin(x-y) * amplitude * cos(y);\n vec4 rgba = texture2D(tex, uv1);\n gl_FragColor = rgba;\n }"}),this.fsQuad=new Ki.T(this.material),this.factor=0,this.time=0}render(e,t,r){this.uniforms.tex.value=r.texture,this.uniforms.time.value=this.time,this.uniforms.factor.value=this.factor,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}}class Es{static createButton(e,t={}){const r=document.createElement("button");function n(){r.style.display="",r.style.cursor="auto",r.style.left="calc(50% - 75px)",r.style.width="150px",r.onmouseenter=null,r.onmouseleave=null,r.onclick=null,r.textContent="AR NOT SUPPORTED"}function i(e){e.style.position="absolute",e.style.bottom="20px",e.style.padding="12px 6px",e.style.border="1px solid #fff",e.style.borderRadius="4px",e.style.background="rgba(0,0,0,0.1)",e.style.color="#fff",e.style.font="normal 13px sans-serif",e.style.textAlign="center",e.style.opacity="0.5",e.style.outline="none",e.style.zIndex="999"}if("xr"in navigator)return r.id="ARButton",r.style.display="none",i(r),navigator.xr.isSessionSupported("immersive-ar").then((function(i){i?function(){if(void 0===t.domOverlay){const e=document.createElement("div");e.style.display="none",document.body.appendChild(e);const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("width","38px"),r.setAttribute("height","38px"),r.style.position="absolute",r.style.right="20px",r.style.top="20px",r.addEventListener("click",(function(){null==n||n.end()})),e.appendChild(r);const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d","M 12,12 L 28,28 M 28,12 12,28"),i.setAttribute("stroke","#fff"),i.setAttribute("stroke-width","2px"),r.appendChild(i),void 0===t.optionalFeatures&&(t.optionalFeatures=[]),t.optionalFeatures.push("dom-overlay"),t.domOverlay={root:e}}let n=null;async function i(i){i.addEventListener("end",a),e.xr.setReferenceSpaceType("local"),await e.xr.setSession(i),r.textContent="STOP AR",t.domOverlay.root.style.display="",n=i}function a(){n.removeEventListener("end",a),r.textContent="START AR",t.domOverlay.root.style.display="none",n=null}r.style.display="",r.style.cursor="pointer",r.style.left="calc(50% - 50px)",r.style.width="100px",r.textContent="START AR",r.onmouseenter=()=>{r.style.opacity="1.0"},r.onmouseleave=()=>{r.style.opacity="0.5"},r.onclick=()=>{null===n?navigator.xr.requestSession("immersive-ar",t).then(i):n.end()}}():n()})).catch(n),r;{const e=document.createElement("a");return!1===window.isSecureContext?(e.href=document.location.href.replace(/^http:/,"https:"),e.innerHTML="WEBXR NEEDS HTTPS"):(e.href="https://immersiveweb.dev/",e.innerHTML="WEBXR NOT AVAILABLE"),e.style.left="calc(50% - 90px)",e.style.width="180px",e.style.textDecoration="none",i(e),e}}}var Ss=r(17607),Ms=Object.defineProperty,_s=(e,t,r)=>(((e,t,r)=>{t in e?Ms(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class Ts{constructor(e,t,r="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/",n,i){_s(this,"controller"),_s(this,"handModel"),_s(this,"bones"),this.controller=t,this.handModel=e,this.bones=[];const a=new Ss.E;i||a.setPath(r),a.load(null!=i?i:`${n}.glb`,(e=>{const t=e.scene.children[0];this.handModel.add(t);const r=t.getObjectByProperty("type","SkinnedMesh");r.frustumCulled=!1,r.castShadow=!0,r.receiveShadow=!0;["wrist","thumb-metacarpal","thumb-phalanx-proximal","thumb-phalanx-distal","thumb-tip","index-finger-metacarpal","index-finger-phalanx-proximal","index-finger-phalanx-intermediate","index-finger-phalanx-distal","index-finger-tip","middle-finger-metacarpal","middle-finger-phalanx-proximal","middle-finger-phalanx-intermediate","middle-finger-phalanx-distal","middle-finger-tip","ring-finger-metacarpal","ring-finger-phalanx-proximal","ring-finger-phalanx-intermediate","ring-finger-phalanx-distal","ring-finger-tip","pinky-finger-metacarpal","pinky-finger-phalanx-proximal","pinky-finger-phalanx-intermediate","pinky-finger-phalanx-distal","pinky-finger-tip"].forEach((e=>{const r=t.getObjectByName(e);void 0!==r?r.jointName=e:console.warn(`Couldn't find ${e} in ${n} hand mesh`),this.bones.push(r)}))}))}updateMesh(){const e=this.controller.joints;for(let t=0;t<this.bones.length;t++){const r=this.bones[t];if(r){const t=e[r.jointName];if(t.visible){const e=t.position;r.position.copy(e),r.quaternion.copy(t.quaternion)}}}}}var Cs=Object.defineProperty,Is=(e,t,r)=>(((e,t,r)=>{t in e?Cs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class Bs extends n.Object3D{constructor(e,t,r){super(),Is(this,"controller"),Is(this,"motionController"),Is(this,"envMap"),Is(this,"mesh"),Is(this,"xrInputSource"),this.controller=e,this.motionController=null,this.envMap=null,this.mesh=null,this.xrInputSource=null,e.addEventListener("connected",(n=>{const i=n.data;i.hand&&!this.motionController&&(this.xrInputSource=i,this.motionController=new Ts(this,e,void 0,i.handedness,"left"===i.handedness?t:r))})),e.addEventListener("disconnected",(()=>{this.dispose()}))}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&this.motionController.updateMesh()}getPointerPosition(){const e=this.controller.joints["index-finger-tip"];return e?e.position:null}intersectBoxObject(e){const t=this.getPointerPosition();if(t){const r=new n.Sphere(t,.01),i=(new n.Box3).setFromObject(e);return r.intersectsBox(i)}return!1}checkButton(e){this.intersectBoxObject(e)?e.onPress():e.onClear(),e.isPressed()&&e.whilePressed()}dispose(){this.clear(),this.motionController=null}}const Rs=.01,Ps=.4,Fs=.01,Ls=.003,Ds=16,Us=12,Ns=new n.Vector3(0,1,0),ks=new n.Vector3(0,0,1);class Os extends n.Object3D{constructor(e,t){super(),this.hand=e,this.controller=t,this.motionController=null,this.envMap=null,this.mesh=null,this.pointerGeometry=null,this.pointerMesh=null,this.pointerObject=null,this.pinched=!1,this.attached=!1,this.cursorObject=null,this.raycaster=null,e.addEventListener("connected",(e=>{const t=e.data;t.hand&&(this.visible=!0,this.xrInputSource=t,this.createPointer())}))}_drawVerticesRing(e,t,r){const n=t.clone();for(var i=0;i<Ds;i++){n.applyAxisAngle(ks,2*Math.PI/Ds);const t=r*Ds+i;e[3*t]=n.x,e[3*t+1]=n.y,e[3*t+2]=n.z}}_updatePointerVertices(e){const t=this.pointerGeometry.attributes.position.array,r=new n.Vector3(.002,0,-1*(.035-e));this._drawVerticesRing(t,r,0);const i=new n.Vector3(Math.sin(110*Math.PI/180)*e,Math.cos(110*Math.PI/180)*e,0);for(var a=0;a<Us;a++)this._drawVerticesRing(t,i,a+1),i.applyAxisAngle(Ns,110*Math.PI/180/-24);const s=new n.Vector3(0,0,-1*(.035-e));t[624]=s.x,t[625]=s.y,t[626]=s.z;const o=new n.Vector3(0,0,e);t[627]=o.x,t[628]=o.y,t[629]=o.z,this.pointerGeometry.setAttribute("position",new n.Float32BufferAttribute(t,3))}createPointer(){var e,t;const r=new Array(630).fill(0),i=[];for(this.pointerGeometry=new n.BufferGeometry,this.pointerGeometry.setAttribute("position",new n.Float32BufferAttribute(r,3)),this._updatePointerVertices(Fs),e=0;e<Us;e++){for(t=0;t<15;t++)i.push(e*Ds+t,e*Ds+t+1,(e+1)*Ds+t),i.push(e*Ds+t+1,(e+1)*Ds+t+1,(e+1)*Ds+t);i.push((e+1)*Ds-1,e*Ds,(e+2)*Ds-1),i.push(e*Ds,(e+1)*Ds,(e+2)*Ds-1)}for(e=0;e<15;e++)i.push(208,e+1,e),i.push(209,e+192,e+192+1);i.push(208,0,15),i.push(209,207,192);const a=new n.MeshBasicMaterial;a.transparent=!0,a.opacity=Ps,this.pointerGeometry.setIndex(i),this.pointerMesh=new n.Mesh(this.pointerGeometry,a),this.pointerMesh.position.set(0,0,-.01),this.pointerObject=new n.Object3D,this.pointerObject.add(this.pointerMesh),this.raycaster=new n.Raycaster;const s=new n.SphereGeometry(.02,10,10),o=new n.MeshBasicMaterial;o.transparent=!0,o.opacity=Ps,this.cursorObject=new n.Mesh(s,o),this.pointerObject.add(this.cursorObject),this.add(this.pointerObject)}_updateRaycaster(){if(this.raycaster){const e=this.pointerObject.matrixWorld,t=new n.Matrix4;t.identity().extractRotation(e),this.raycaster.ray.origin.setFromMatrixPosition(e),this.raycaster.ray.direction.set(0,0,-1).applyMatrix4(t)}}_updatePointer(){this.pointerObject.visible=this.controller.visible;const e=this.hand.joints["index-finger-tip"],t=this.hand.joints["thumb-tip"],r=e.position.distanceTo(t.position),n=e.position.clone().add(t.position).multiplyScalar(.5);this.pointerObject.position.copy(n),this.pointerObject.quaternion.copy(this.controller.quaternion),this.pinched=r<=.02;const i=(r-Rs)/.04,a=(r-Rs)/.01;if(i>1)this._updatePointerVertices(Fs),this.pointerMesh.position.set(0,0,-.01),this.pointerMesh.material.opacity=Ps;else if(i>0){const e=.007*i+Ls;this._updatePointerVertices(e),a<1?(this.pointerMesh.position.set(0,0,-1*e-.02*(1-a)),this.pointerMesh.material.opacity=Ps+.6*(1-a)):(this.pointerMesh.position.set(0,0,-1*e),this.pointerMesh.material.opacity=Ps)}else this._updatePointerVertices(Ls),this.pointerMesh.position.set(0,0,-.023),this.pointerMesh.material.opacity=1;this.cursorObject.material.opacity=this.pointerMesh.material.opacity}updateMatrixWorld(e){super.updateMatrixWorld(e),this.pointerGeometry&&(this._updatePointer(),this._updateRaycaster())}isPinched(){return this.pinched}setAttached(e){this.attached=e}isAttached(){return this.attached}intersectObject(e,t=!0){if(this.raycaster)return this.raycaster.intersectObject(e,t)}intersectObjects(e,t=!0){if(this.raycaster)return this.raycaster.intersectObjects(e,t)}checkIntersections(e,t=!1){if(this.raycaster&&!this.attached){const r=this.raycaster.intersectObjects(e,t),i=new n.Vector3(0,0,-1);if(r.length>0){const e=r[0].distance;this.cursorObject.position.copy(i.multiplyScalar(e))}else this.cursorObject.position.copy(i.multiplyScalar(1.5))}}setCursor(e){const t=new n.Vector3(0,0,-1);this.raycaster&&!this.attached&&this.cursorObject.position.copy(t.multiplyScalar(e))}}function Gs(e,t){const r=document.createElement("canvas"),i=r.getContext("2d");let a=null;const s=100;i.font="normal 100px Arial",a=i.measureText(e);const o=a.width;r.width=o,r.height=s,i.font="normal 100px Arial",i.textAlign="center",i.textBaseline="middle",i.fillStyle="#ffffff",i.fillText(e,o/2,50);const l=new n.Texture(r);l.needsUpdate=!0;const c=new n.MeshBasicMaterial({color:16777215,side:n.DoubleSide,map:l,transparent:!0}),u=new n.PlaneGeometry(t*o/s,t);return new n.Mesh(u,c)}var zs=Object.defineProperty;const Vs=class{static createButton(e,t={}){const r=document.createElement("button");function n(){r.style.display="",r.style.cursor="auto",r.style.left="calc(50% - 75px)",r.style.width="150px",r.onmouseenter=null,r.onmouseleave=null,r.onclick=null,r.textContent="VR NOT SUPPORTED"}function i(e){e.style.position="absolute",e.style.bottom="20px",e.style.padding="12px 6px",e.style.border="1px solid #fff",e.style.borderRadius="4px",e.style.background="rgba(0,0,0,0.1)",e.style.color="#fff",e.style.font="normal 13px sans-serif",e.style.textAlign="center",e.style.opacity="0.5",e.style.outline="none",e.style.zIndex="999"}if("xr"in navigator)return i(r),r.id="VRButton",r.style.display="none",navigator.xr.isSessionSupported("immersive-vr").then((i=>{i?function(){let n=null;async function i(t){t.addEventListener("end",a),await e.xr.setSession(t),r.textContent="EXIT VR",n=t}function a(){n.removeEventListener("end",a),r.textContent="ENTER VR",n=null}r.style.display="",r.style.cursor="pointer",r.style.left="calc(50% - 50px)",r.style.width="100px",r.textContent="ENTER VR",r.onmouseenter=()=>{r.style.opacity="1.0"},r.onmouseleave=()=>{r.style.opacity="0.5"},r.onclick=()=>{var e;if(null===n){const r=[t.optionalFeatures,"local-floor","bounded-floor","hand-tracking"].flat().filter(Boolean);null==(e=navigator.xr)||e.requestSession("immersive-vr",{...t,optionalFeatures:r}).then(i)}else n.end()}}():n(),i&&Vs.xrSessionIsGranted&&r.click()})),r;{const e=document.createElement("a");return!1===window.isSecureContext?(e.href=document.location.href.replace(/^http:/,"https:"),e.innerHTML="WEBXR NEEDS HTTPS"):(e.href="https://immersiveweb.dev/",e.innerHTML="WEBXR NOT AVAILABLE"),e.style.left="calc(50% - 90px)",e.style.width="180px",e.style.textDecoration="none",i(e),e}}static registerSessionGrantedListener(){"xr"in navigator&&navigator.xr.addEventListener("sessiongranted",(()=>{Vs.xrSessionIsGranted=!0}))}};let Hs=Vs;((e,t,r)=>{((e,t,r)=>{t in e?zs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r)})(Hs,"xrSessionIsGranted",!1);var Qs=Object.defineProperty,js=(e,t,r)=>(((e,t,r)=>{t in e?Qs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const Ws={Handedness:{NONE:"none",LEFT:"left",RIGHT:"right"},ComponentState:{DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"},ComponentProperty:{BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"},ComponentType:{TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"},ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:{TRANSFORM:"transform",VISIBILITY:"visibility"}};async function Xs(e){const t=await fetch(e);if(t.ok)return t.json();throw new Error(t.statusText)}async function Ys(e){if(!e)throw new Error("No basePath supplied");return await Xs(`${e}/profilesList.json`)}async function qs(e,t,r=null,n=!0){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");const i=await Ys(t);let a;if(e.profiles.some((e=>{const r=i[e];return r&&(a={profileId:e,profilePath:`${t}/${r.path}`,deprecated:!!r.deprecated}),!!a})),!a){if(!r)throw new Error("No matching profile name found");const e=i[r];if(!e)throw new Error(`No matching profile name found and default profile "${r}" missing.`);a={profileId:r,profilePath:`${t}/${e.path}`,deprecated:!!e.deprecated}}const s=await Xs(a.profilePath);let o;if(n){let t;if(t="any"===e.handedness?s.layouts[Object.keys(s.layouts)[0]]:s.layouts[e.handedness],!t)throw new Error(`No matching handedness, ${e.handedness}, in profile ${a.profileId}`);t.assetPath&&(o=a.profilePath.replace("profile.json",t.assetPath))}return{profile:s,assetPath:o}}const Ks={xAxis:0,yAxis:0,button:0,state:Ws.ComponentState.DEFAULT};class Js{constructor(e){js(this,"value"),js(this,"componentProperty"),js(this,"states"),js(this,"valueNodeName"),js(this,"valueNodeProperty"),js(this,"minNodeName"),js(this,"maxNodeName"),js(this,"valueNode"),js(this,"minNode"),js(this,"maxNode"),this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===Ws.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(Ks)}updateFromComponent({xAxis:e,yAxis:t,button:r,state:n}){const{normalizedXAxis:i,normalizedYAxis:a}=function(e=0,t=0){let r=e,n=t;if(Math.sqrt(e*e+t*t)>1){const i=Math.atan2(t,e);r=Math.cos(i),n=Math.sin(i)}return{normalizedXAxis:.5*r+.5,normalizedYAxis:.5*n+.5}}(e,t);switch(this.componentProperty){case Ws.ComponentProperty.X_AXIS:this.value=this.states.includes(n)?i:.5;break;case Ws.ComponentProperty.Y_AXIS:this.value=this.states.includes(n)?a:.5;break;case Ws.ComponentProperty.BUTTON:this.value=this.states.includes(n)&&r?r:0;break;case Ws.ComponentProperty.STATE:this.valueNodeProperty===Ws.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(n):this.value=this.states.includes(n)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class Zs{constructor(e,t){if(js(this,"id"),js(this,"values"),js(this,"type"),js(this,"gamepadIndices"),js(this,"rootNodeName"),js(this,"visualResponses"),js(this,"touchPointNodeName"),js(this,"touchPointNode"),!(e&&t&&t.visualResponses&&t.gamepadIndices&&0!==Object.keys(t.gamepadIndices).length))throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach((e=>{const r=new Js(t.visualResponses[e]);this.visualResponses[e]=r})),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:Ws.ComponentState.DEFAULT,button:void 0!==this.gamepadIndices.button?0:void 0,xAxis:void 0!==this.gamepadIndices.xAxis?0:void 0,yAxis:void 0!==this.gamepadIndices.yAxis?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=Ws.ComponentState.DEFAULT,void 0!==this.gamepadIndices.button&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||1===this.values.button?this.values.state=Ws.ComponentState.PRESSED:(t.touched||this.values.button>Ws.ButtonTouchThreshold)&&(this.values.state=Ws.ComponentState.TOUCHED)}void 0!==this.gamepadIndices.xAxis&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Ws.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Ws.AxisTouchThreshold&&(this.values.state=Ws.ComponentState.TOUCHED)),void 0!==this.gamepadIndices.yAxis&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Ws.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Ws.AxisTouchThreshold&&(this.values.state=Ws.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach((e=>{e.updateFromComponent(this.values)}))}}class $s{constructor(e,t,r){if(js(this,"xrInputSource"),js(this,"assetUrl"),js(this,"layoutDescription"),js(this,"id"),js(this,"components"),!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");if(!t.layouts[e.handedness])throw new Error("No layout for "+e.handedness+" handedness");this.xrInputSource=e,this.assetUrl=r,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach((e=>{const t=this.layoutDescription.components[e];this.components[e]=new Zs(e,t)})),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach((t=>{e.push(t.data)})),e}updateFromGamepad(){Object.values(this.components).forEach((e=>{e.updateFromGamepad(this.xrInputSource.gamepad)}))}}var eo=Object.defineProperty,to=(e,t,r)=>(((e,t,r)=>{t in e?eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const ro=(e,t)=>{t.traverse((t=>{t instanceof n.Mesh&&"envMap"in t.material&&(t.material.envMap=e,t.material.needsUpdate=!0)}))};class no extends n.Object3D{constructor(){super(),to(this,"envMap"),to(this,"motionController"),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e||(this.envMap=e,ro(this.envMap,this)),this}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach((e=>{Object.values(e.visualResponses).forEach((e=>{const{valueNode:t,minNode:r,maxNode:n,value:i,valueNodeProperty:a}=e;t&&(a===Ws.VisualResponseProperty.VISIBILITY&&"boolean"==typeof i?t.visible=i:a===Ws.VisualResponseProperty.TRANSFORM&&r&&n&&"number"==typeof i&&(t.quaternion.slerpQuaternions(r.quaternion,n.quaternion,i),t.position.lerpVectors(r.position,n.position,i)))}))})))}}function io(e,t){!function(e,t){Object.values(e.components).forEach((e=>{const{type:r,touchPointNodeName:i,visualResponses:a}=e;if(r===Ws.ComponentType.TOUCHPAD&&i)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){const t=new n.SphereGeometry(.001),r=new n.MeshBasicMaterial({color:255}),i=new n.Mesh(t,r);e.touchPointNode.add(i)}else console.warn(`Could not find touch dot, ${e.touchPointNodeName}, in touchpad component ${e.id}`);Object.values(a).forEach((e=>{const{valueNodeName:r,minNodeName:n,maxNodeName:i,valueNodeProperty:a}=e;if(a===Ws.VisualResponseProperty.TRANSFORM&&n&&i){if(e.minNode=t.getObjectByName(n),e.maxNode=t.getObjectByName(i),!e.minNode)return void console.warn(`Could not find ${n} in the model`);if(!e.maxNode)return void console.warn(`Could not find ${i} in the model`)}e.valueNode=t.getObjectByName(r),e.valueNode||console.warn(`Could not find ${r} in the model`)}))}))}(e.motionController,t),e.envMap&&ro(e.envMap,t),e.add(t)}class ao{constructor(e=null){to(this,"gltfLoader"),to(this,"path"),to(this,"_assetCache"),this.gltfLoader=e,this.path="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",this._assetCache={},this.gltfLoader||(this.gltfLoader=new Ss.E)}createControllerModel(e){const t=new no;let r=null;const n=e=>{const n=e.data;"tracked-pointer"===n.targetRayMode&&n.gamepad&&qs(n,this.path,"generic-trigger").then((({profile:e,assetPath:i})=>{if(!i)throw new Error("no asset path");t.motionController=new $s(n,e,i);const a=t.motionController.assetUrl,s=this._assetCache[a];if(s)r=s.scene.clone(),io(t,r);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,(e=>{t.motionController?(this._assetCache[a]=e,r=e.scene.clone(),io(t,r)):console.warn("motionController gone while gltf load, bailing...")}),(()=>{}),(()=>{throw new Error(`Asset ${a} missing or malformed.`)}))}})).catch((e=>{console.warn(e)}))};e.addEventListener("connected",n);const i=()=>{e.removeEventListener("connected",n),e.removeEventListener("disconnected",i),t.motionController=null,r&&t.remove(r),r=null};return e.addEventListener("disconnected",i),t}}class so{constructor(e,t,r,i,a){this.xrLight=e,this.renderer=t,this.lightProbe=r,this.xrWebGLBinding=null,this.estimationStartCallback=a,this.frameCallback=this.onXRFrame.bind(this);const s=t.xr.getSession();if(i&&"XRWebGLBinding"in window){const r=new n.WebGLCubeRenderTarget(16);e.environment=r.texture;const i=t.getContext();switch(s.preferredReflectionFormat){case"srgba8":i.getExtension("EXT_sRGB");break;case"rgba16f":i.getExtension("OES_texture_half_float")}this.xrWebGLBinding=new XRWebGLBinding(s,i),this.lightProbe.addEventListener("reflectionchange",(()=>{this.updateReflection()}))}s.requestAnimationFrame(this.frameCallback)}updateReflection(){const e=this.renderer.properties.get(this.xrLight.environment);if(e){const t=this.xrWebGLBinding.getReflectionCubeMap(this.lightProbe);t&&(e.__webglTexture=t,this.xrLight.environment.needsPMREMUpdate=!0)}}onXRFrame(e,t){if(!this.xrLight)return;t.session.requestAnimationFrame(this.frameCallback);const r=t.getLightEstimate(this.lightProbe);if(r){this.xrLight.lightProbe.sh.fromArray(r.sphericalHarmonicsCoefficients),this.xrLight.lightProbe.intensity=1;const e=Math.max(1,Math.max(r.primaryLightIntensity.x,Math.max(r.primaryLightIntensity.y,r.primaryLightIntensity.z)));this.xrLight.directionalLight.color.setRGB(r.primaryLightIntensity.x/e,r.primaryLightIntensity.y/e,r.primaryLightIntensity.z/e),this.xrLight.directionalLight.intensity=e,this.xrLight.directionalLight.position.copy(r.primaryLightDirection),this.estimationStartCallback&&(this.estimationStartCallback(),this.estimationStartCallback=null)}}dispose(){this.xrLight=null,this.renderer=null,this.lightProbe=null,this.xrWebGLBinding=null}}class oo extends n.Group{constructor(e,t=!0){super(),this.lightProbe=new n.LightProbe,this.lightProbe.intensity=0,this.add(this.lightProbe),this.directionalLight=new n.DirectionalLight,this.directionalLight.intensity=0,this.add(this.directionalLight),this.environment=null;let r=null,i=!1;e.xr.addEventListener("sessionstart",(()=>{const n=e.xr.getSession();"requestLightProbe"in n&&n.requestLightProbe({reflectionFormat:n.preferredReflectionFormat}).then((n=>{r=new so(this,e,n,t,(()=>{i=!0,this.dispatchEvent({type:"estimationstart"})}))}))})),e.xr.addEventListener("sessionend",(()=>{r&&(r.dispose(),r=null),i&&this.dispatchEvent({type:"estimationend"})})),this.dispose=()=>{r&&(r.dispose(),r=null),this.remove(this.lightProbe),this.lightProbe=null,this.remove(this.directionalLight),this.directionalLight=null,this.environment=null}}}const lo=new n.Matrix4,co=new n.Vector3;class uo{constructor(e,t,r,i,a){let s;this.controller=t,this.handModel=e,this.envMap=null,a&&a.primitive&&"sphere"!==a.primitive?"box"===a.primitive&&(s=new n.BoxGeometry(1,1,1)):s=new n.SphereGeometry(1,10,10);const o=new n.MeshStandardMaterial;this.handMesh=new n.InstancedMesh(s,o,30),this.handMesh.instanceMatrix.setUsage(n.DynamicDrawUsage),this.handMesh.castShadow=!0,this.handMesh.receiveShadow=!0,this.handModel.add(this.handMesh),this.joints=["wrist","thumb-metacarpal","thumb-phalanx-proximal","thumb-phalanx-distal","thumb-tip","index-finger-metacarpal","index-finger-phalanx-proximal","index-finger-phalanx-intermediate","index-finger-phalanx-distal","index-finger-tip","middle-finger-metacarpal","middle-finger-phalanx-proximal","middle-finger-phalanx-intermediate","middle-finger-phalanx-distal","middle-finger-tip","ring-finger-metacarpal","ring-finger-phalanx-proximal","ring-finger-phalanx-intermediate","ring-finger-phalanx-distal","ring-finger-tip","pinky-finger-metacarpal","pinky-finger-phalanx-proximal","pinky-finger-phalanx-intermediate","pinky-finger-phalanx-distal","pinky-finger-tip"]}updateMesh(){const e=this.controller.joints;let t=0;for(let r=0;r<this.joints.length;r++){const n=e[this.joints[r]];n.visible&&(co.setScalar(n.jointRadius||.008),lo.compose(n.position,n.quaternion,co),this.handMesh.setMatrixAt(r,lo),t++)}this.handMesh.count=t,this.handMesh.instanceMatrix.needsUpdate=!0}}class ho extends n.Object3D{constructor(e){super(),this.controller=e,this.motionController=null,this.envMap=null,this.mesh=null}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&this.motionController.updateMesh()}}class po{constructor(){this.path=null}setPath(e){return this.path=e,this}createHandModel(e,t){const r=new ho(e);return e.addEventListener("connected",(n=>{const i=n.data;i.hand&&!r.motionController&&(r.xrInputSource=i,void 0===t||"spheres"===t?r.motionController=new uo(r,e,this.path,i.handedness,{primitive:"sphere"}):"boxes"===t?r.motionController=new uo(r,e,this.path,i.handedness,{primitive:"box"}):"mesh"===t&&(r.motionController=new Ts(r,e,this.path,i.handedness)))})),e.addEventListener("disconnected",(()=>{})),r}}class fo extends n.BufferGeometry{constructor(e=((e,t,r)=>r.set(e,t,Math.cos(e)*Math.sin(t))),t=8,r=8){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:r};const i=[],a=[],s=[],o=[],l=1e-5,c=new n.Vector3,u=new n.Vector3,h=new n.Vector3,d=new n.Vector3,p=new n.Vector3,f=t+1;for(let n=0;n<=r;n++){const i=n/r;for(let r=0;r<=t;r++){const n=r/t;e(n,i,u),a.push(u.x,u.y,u.z),n-l>=0?(e(n-l,i,h),d.subVectors(u,h)):(e(n+l,i,h),d.subVectors(h,u)),i-l>=0?(e(n,i-l,h),p.subVectors(u,h)):(e(n,i+l,h),p.subVectors(h,u)),c.crossVectors(d,p).normalize(),s.push(c.x,c.y,c.z),o.push(n,i)}}for(let n=0;n<r;n++)for(let e=0;e<t;e++){const t=n*f+e,r=n*f+e+1,a=(n+1)*f+e+1,s=(n+1)*f+e;i.push(t,r,s),i.push(r,a,s)}this.setIndex(i),this.setAttribute("position",new n.Float32BufferAttribute(a,3)),this.setAttribute("normal",new n.Float32BufferAttribute(s,3)),this.setAttribute("uv",new n.Float32BufferAttribute(o,2))}}class mo extends fo{constructor(e,t=64,r=1,i=8,a=!1){const s=t+1,o=e.computeFrenetFrames(t,a),l=o.tangents,c=o.normals,u=o.binormals,h=new n.Vector3;super((function(t,n,i){n*=2*Math.PI;const a=Math.floor(t*(s-1));e.getPointAt(t,h);const o=c[a],l=u[a],d=-r*Math.cos(n),p=r*Math.sin(n);h.x+=d*o.x+p*l.x,h.y+=d*o.y+p*l.y,h.z+=d*o.z+p*l.z,i.copy(h)}),t,i),this.tangents=l,this.normals=c,this.binormals=u,this.path=e,this.segments=t,this.radius=r,this.segmentsRadius=i,this.closed=a}}const go={klein:function(e,t,r){let n,i;t*=Math.PI,e*=2*Math.PI,(t*=2)<Math.PI?(n=3*Math.cos(t)*(1+Math.sin(t))+2*(1-Math.cos(t)/2)*Math.cos(t)*Math.cos(e),i=-8*Math.sin(t)-2*(1-Math.cos(t)/2)*Math.sin(t)*Math.cos(e)):(n=3*Math.cos(t)*(1+Math.sin(t))+2*(1-Math.cos(t)/2)*Math.cos(e+Math.PI),i=-8*Math.sin(t));const a=-2*(1-Math.cos(t)/2)*Math.sin(e);r.set(n,a,i)},plane:function(e,t){return function(r,n,i){const a=r*e,s=n*t;i.set(a,0,s)}},mobius:function(e,t,r){e-=.5;const n=2*Math.PI*t,i=Math.cos(n)*(2+e*Math.cos(n/2)),a=Math.sin(n)*(2+e*Math.cos(n/2)),s=e*Math.sin(n/2);r.set(i,a,s)},mobius3d:function(e,t,r){e*=Math.PI,t*=2*Math.PI;const n=(e*=2)/2;let i=.125*Math.cos(t)*Math.cos(n)-.65*Math.sin(t)*Math.sin(n);const a=.125*Math.cos(t)*Math.sin(n)+.65*Math.sin(t)*Math.cos(n),s=(2.25+i)*Math.sin(e);i=(2.25+i)*Math.cos(e),r.set(i,s,a)},TubeGeometry:mo,TorusKnotGeometry:class extends mo{constructor(e=200,t=40,r=64,i=8,a=2,s=3){class o extends n.Curve{getPoint(t,r=new n.Vector3){const i=r;t*=2*Math.PI;const o=(1+.5*Math.cos(s*t))*Math.cos(a*t),l=(1+.5*Math.cos(s*t))*Math.sin(a*t),c=.5*Math.sin(s*t);return i.set(o,l,c).multiplyScalar(e)}}const l=r,c=i;super(new o,l,t,c,!0,!1),this.radius=e,this.tube=t,this.segmentsT=r,this.segmentsR=i,this.p=a,this.q=s}},SphereGeometry:class extends fo{constructor(e,t,r){super((function(t,r,n){t*=Math.PI,r*=2*Math.PI;const i=e*Math.sin(t)*Math.cos(r),a=e*Math.sin(t)*Math.sin(r),s=e*Math.cos(t);n.set(i,a,s)}),t,r)}},PlaneGeometry:class extends fo{constructor(e,t,r,n){super((function(r,n,i){const a=r*e,s=n*t;i.set(a,0,s)}),r,n)}}},vo=new n.Vector3;function Ao(e,t,r,n,i,a){const s=2*Math.PI*i/4,o=Math.max(a-2*i,0),l=Math.PI/4;vo.copy(t),vo[n]=0,vo.normalize();const c=.5*s/(s+o),u=1-vo.angleTo(e)/l;if(1===Math.sign(vo[r]))return u*c;return o/(s+o)+c+c*(1-u)}class yo extends n.BoxGeometry{constructor(e=1,t=1,r=1,i=2,a=.1){if(i=2*i+1,a=Math.min(e/2,t/2,r/2,a),super(1,1,1,i,i,i),1===i)return;const s=this.toNonIndexed();this.index=null,this.attributes.position=s.attributes.position,this.attributes.normal=s.attributes.normal,this.attributes.uv=s.attributes.uv;const o=new n.Vector3,l=new n.Vector3,c=new n.Vector3(e,t,r).divideScalar(2).subScalar(a),u=this.attributes.position.array,h=this.attributes.normal.array,d=this.attributes.uv.array,p=u.length/6,f=new n.Vector3,m=.5/i;for(let n=0,g=0;n<u.length;n+=3,g+=2){o.fromArray(u,n),l.copy(o),l.x-=Math.sign(l.x)*m,l.y-=Math.sign(l.y)*m,l.z-=Math.sign(l.z)*m,l.normalize(),u[n+0]=c.x*Math.sign(o.x)+l.x*a,u[n+1]=c.y*Math.sign(o.y)+l.y*a,u[n+2]=c.z*Math.sign(o.z)+l.z*a,h[n+0]=l.x,h[n+1]=l.y,h[n+2]=l.z;switch(Math.floor(n/p)){case 0:f.set(1,0,0),d[g+0]=Ao(f,l,"z","y",a,r),d[g+1]=1-Ao(f,l,"y","z",a,t);break;case 1:f.set(-1,0,0),d[g+0]=1-Ao(f,l,"z","y",a,r),d[g+1]=1-Ao(f,l,"y","z",a,t);break;case 2:f.set(0,1,0),d[g+0]=1-Ao(f,l,"x","z",a,e),d[g+1]=Ao(f,l,"z","x",a,r);break;case 3:f.set(0,-1,0),d[g+0]=1-Ao(f,l,"x","z",a,e),d[g+1]=1-Ao(f,l,"z","x",a,r);break;case 4:f.set(0,0,1),d[g+0]=1-Ao(f,l,"x","y",a,e),d[g+1]=1-Ao(f,l,"y","x",a,t);break;case 5:f.set(0,0,-1),d[g+0]=Ao(f,l,"x","y",a,e),d[g+1]=1-Ao(f,l,"y","x",a,t)}}}}class xo extends n.BufferGeometry{constructor(e,t,r,i,a,s){super();const o=(e=e||1)/2,l=(t=t||1)/2,c=(r=r||1)/2,u=e/(i=Math.floor(i)||1),h=t/(a=Math.floor(a)||1),d=r/(s=Math.floor(s)||1),p=[];let f=-o,m=-l,g=-c;for(let n=0;n<=i;n++)p.push(f,-l,-c,f,l,-c),p.push(f,l,-c,f,l,c),p.push(f,l,c,f,-l,c),p.push(f,-l,c,f,-l,-c),f+=u;for(let n=0;n<=a;n++)p.push(-o,m,-c,o,m,-c),p.push(o,m,-c,o,m,c),p.push(o,m,c,-o,m,c),p.push(-o,m,c,-o,m,-c),m+=h;for(let n=0;n<=s;n++)p.push(-o,-l,g,-o,l,g),p.push(-o,l,g,o,l,g),p.push(o,l,g,o,-l,g),p.push(o,-l,g,-o,-l,g),g+=d;this.setAttribute("position",new n.Float32BufferAttribute(p,3))}}class bo extends n.BufferGeometry{constructor(e,t,r,i){super();const a=[],s=[],o=[],l=new n.Vector3,c=new n.Matrix4;c.makeRotationFromEuler(r),c.setPosition(t);const u=new n.Matrix4;function h(t,r,n){r.applyMatrix4(e.matrixWorld),r.applyMatrix4(u),n.transformDirection(e.matrixWorld),t.push(new wo(r.clone(),n.clone()))}function d(e,t){const r=[],n=.5*Math.abs(i.dot(t));for(let i=0;i<e.length;i+=3){let a,s,o,l,c,u,h,d=0;const f=e[i+0].position.dot(t)-n,m=e[i+1].position.dot(t)-n,g=e[i+2].position.dot(t)-n;switch(a=f>0,s=m>0,o=g>0,d=(a?1:0)+(s?1:0)+(o?1:0),d){case 0:r.push(e[i]),r.push(e[i+1]),r.push(e[i+2]);break;case 1:if(a&&(l=e[i+1],c=e[i+2],u=p(e[i],l,t,n),h=p(e[i],c,t,n)),s){l=e[i],c=e[i+2],u=p(e[i+1],l,t,n),h=p(e[i+1],c,t,n),r.push(u),r.push(c.clone()),r.push(l.clone()),r.push(c.clone()),r.push(u.clone()),r.push(h);break}o&&(l=e[i],c=e[i+1],u=p(e[i+2],l,t,n),h=p(e[i+2],c,t,n)),r.push(l.clone()),r.push(c.clone()),r.push(u),r.push(h),r.push(u.clone()),r.push(c.clone());break;case 2:a||(l=e[i].clone(),c=p(l,e[i+1],t,n),u=p(l,e[i+2],t,n),r.push(l),r.push(c),r.push(u)),s||(l=e[i+1].clone(),c=p(l,e[i+2],t,n),u=p(l,e[i],t,n),r.push(l),r.push(c),r.push(u)),o||(l=e[i+2].clone(),c=p(l,e[i],t,n),u=p(l,e[i+1],t,n),r.push(l),r.push(c),r.push(u))}}return r}function p(e,t,r,i){const a=e.position.dot(r)-i,s=a/(a-(t.position.dot(r)-i));return new wo(new n.Vector3(e.position.x+s*(t.position.x-e.position.x),e.position.y+s*(t.position.y-e.position.y),e.position.z+s*(t.position.z-e.position.z)),new n.Vector3(e.normal.x+s*(t.normal.x-e.normal.x),e.normal.y+s*(t.normal.y-e.normal.y),e.normal.z+s*(t.normal.z-e.normal.z)))}u.copy(c).invert(),function(){let t,r=[];const u=new n.Vector3,p=new n.Vector3;if(!0===e.geometry.isGeometry)return void console.error("THREE.DecalGeometry no longer supports THREE.Geometry. Use BufferGeometry instead.");const f=e.geometry,m=f.attributes.position,g=f.attributes.normal;if(null!==f.index){const e=f.index;for(t=0;t<e.count;t++)u.fromBufferAttribute(m,e.getX(t)),p.fromBufferAttribute(g,e.getX(t)),h(r,u,p)}else for(t=0;t<m.count;t++)u.fromBufferAttribute(m,t),p.fromBufferAttribute(g,t),h(r,u,p);for(r=d(r,l.set(1,0,0)),r=d(r,l.set(-1,0,0)),r=d(r,l.set(0,1,0)),r=d(r,l.set(0,-1,0)),r=d(r,l.set(0,0,1)),r=d(r,l.set(0,0,-1)),t=0;t<r.length;t++){const e=r[t];o.push(.5+e.position.x/i.x,.5+e.position.y/i.y),e.position.applyMatrix4(c),a.push(e.position.x,e.position.y,e.position.z),s.push(e.normal.x,e.normal.y,e.normal.z)}}(),this.setAttribute("position",new n.Float32BufferAttribute(a,3)),this.setAttribute("normal",new n.Float32BufferAttribute(s,3)),this.setAttribute("uv",new n.Float32BufferAttribute(o,2))}}class wo{constructor(e,t){this.position=e,this.normal=t}clone(){return new this.constructor(this.position.clone(),this.normal.clone())}}class Eo extends n.BufferGeometry{constructor(e,t,r,i,a,s,o){const l=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,3,16,17,18,7,19,20,21,11,22,23,24,15,25,26,27,18,28,29,30,21,31,32,33,24,34,35,36,27,37,38,39,30,40,41,0,33,42,43,4,36,44,45,8,39,46,47,12,12,13,14,15,48,49,50,51,52,53,54,55,56,57,58,59,15,25,26,27,51,60,61,62,55,63,64,65,59,66,67,68,27,37,38,39,62,69,70,71,65,72,73,74,68,75,76,77,39,46,47,12,71,78,79,48,74,80,81,52,77,82,83,56,56,57,58,59,84,85,86,87,88,89,90,91,92,93,94,95,59,66,67,68,87,96,97,98,91,99,100,101,95,102,103,104,68,75,76,77,98,105,106,107,101,108,109,110,104,111,112,113,77,82,83,56,107,114,115,84,110,116,117,88,113,118,119,92,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,123,136,137,120,127,138,139,124,131,140,141,128,135,142,143,132,132,133,134,135,144,145,146,147,148,149,150,151,68,152,153,154,135,142,143,132,147,155,156,144,151,157,158,148,154,159,160,68,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,164,177,178,161,168,179,180,165,172,181,182,169,176,183,184,173,173,174,175,176,185,186,187,188,189,190,191,192,193,194,195,196,176,183,184,173,188,197,198,185,192,199,200,189,196,201,202,193,203,203,203,203,204,205,206,207,208,208,208,208,209,210,211,212,203,203,203,203,207,213,214,215,208,208,208,208,212,216,217,218,203,203,203,203,215,219,220,221,208,208,208,208,218,222,223,224,203,203,203,203,221,225,226,204,208,208,208,208,224,227,228,209,209,210,211,212,229,230,231,232,233,234,235,236,237,238,239,240,212,216,217,218,232,241,242,243,236,244,245,246,240,247,248,249,218,222,223,224,243,250,251,252,246,253,254,255,249,256,257,258,224,227,228,209,252,259,260,229,255,261,262,233,258,263,264,237,265,265,265,265,266,267,268,269,270,271,272,273,92,119,118,113,265,265,265,265,269,274,275,276,273,277,278,279,113,112,111,104,265,265,265,265,276,280,281,282,279,283,284,285,104,103,102,95,265,265,265,265,282,286,287,266,285,288,289,270,95,94,93,92],c=[1.4,0,2.4,1.4,-.784,2.4,.784,-1.4,2.4,0,-1.4,2.4,1.3375,0,2.53125,1.3375,-.749,2.53125,.749,-1.3375,2.53125,0,-1.3375,2.53125,1.4375,0,2.53125,1.4375,-.805,2.53125,.805,-1.4375,2.53125,0,-1.4375,2.53125,1.5,0,2.4,1.5,-.84,2.4,.84,-1.5,2.4,0,-1.5,2.4,-.784,-1.4,2.4,-1.4,-.784,2.4,-1.4,0,2.4,-.749,-1.3375,2.53125,-1.3375,-.749,2.53125,-1.3375,0,2.53125,-.805,-1.4375,2.53125,-1.4375,-.805,2.53125,-1.4375,0,2.53125,-.84,-1.5,2.4,-1.5,-.84,2.4,-1.5,0,2.4,-1.4,.784,2.4,-.784,1.4,2.4,0,1.4,2.4,-1.3375,.749,2.53125,-.749,1.3375,2.53125,0,1.3375,2.53125,-1.4375,.805,2.53125,-.805,1.4375,2.53125,0,1.4375,2.53125,-1.5,.84,2.4,-.84,1.5,2.4,0,1.5,2.4,.784,1.4,2.4,1.4,.784,2.4,.749,1.3375,2.53125,1.3375,.749,2.53125,.805,1.4375,2.53125,1.4375,.805,2.53125,.84,1.5,2.4,1.5,.84,2.4,1.75,0,1.875,1.75,-.98,1.875,.98,-1.75,1.875,0,-1.75,1.875,2,0,1.35,2,-1.12,1.35,1.12,-2,1.35,0,-2,1.35,2,0,.9,2,-1.12,.9,1.12,-2,.9,0,-2,.9,-.98,-1.75,1.875,-1.75,-.98,1.875,-1.75,0,1.875,-1.12,-2,1.35,-2,-1.12,1.35,-2,0,1.35,-1.12,-2,.9,-2,-1.12,.9,-2,0,.9,-1.75,.98,1.875,-.98,1.75,1.875,0,1.75,1.875,-2,1.12,1.35,-1.12,2,1.35,0,2,1.35,-2,1.12,.9,-1.12,2,.9,0,2,.9,.98,1.75,1.875,1.75,.98,1.875,1.12,2,1.35,2,1.12,1.35,1.12,2,.9,2,1.12,.9,2,0,.45,2,-1.12,.45,1.12,-2,.45,0,-2,.45,1.5,0,.225,1.5,-.84,.225,.84,-1.5,.225,0,-1.5,.225,1.5,0,.15,1.5,-.84,.15,.84,-1.5,.15,0,-1.5,.15,-1.12,-2,.45,-2,-1.12,.45,-2,0,.45,-.84,-1.5,.225,-1.5,-.84,.225,-1.5,0,.225,-.84,-1.5,.15,-1.5,-.84,.15,-1.5,0,.15,-2,1.12,.45,-1.12,2,.45,0,2,.45,-1.5,.84,.225,-.84,1.5,.225,0,1.5,.225,-1.5,.84,.15,-.84,1.5,.15,0,1.5,.15,1.12,2,.45,2,1.12,.45,.84,1.5,.225,1.5,.84,.225,.84,1.5,.15,1.5,.84,.15,-1.6,0,2.025,-1.6,-.3,2.025,-1.5,-.3,2.25,-1.5,0,2.25,-2.3,0,2.025,-2.3,-.3,2.025,-2.5,-.3,2.25,-2.5,0,2.25,-2.7,0,2.025,-2.7,-.3,2.025,-3,-.3,2.25,-3,0,2.25,-2.7,0,1.8,-2.7,-.3,1.8,-3,-.3,1.8,-3,0,1.8,-1.5,.3,2.25,-1.6,.3,2.025,-2.5,.3,2.25,-2.3,.3,2.025,-3,.3,2.25,-2.7,.3,2.025,-3,.3,1.8,-2.7,.3,1.8,-2.7,0,1.575,-2.7,-.3,1.575,-3,-.3,1.35,-3,0,1.35,-2.5,0,1.125,-2.5,-.3,1.125,-2.65,-.3,.9375,-2.65,0,.9375,-2,-.3,.9,-1.9,-.3,.6,-1.9,0,.6,-3,.3,1.35,-2.7,.3,1.575,-2.65,.3,.9375,-2.5,.3,1.125,-1.9,.3,.6,-2,.3,.9,1.7,0,1.425,1.7,-.66,1.425,1.7,-.66,.6,1.7,0,.6,2.6,0,1.425,2.6,-.66,1.425,3.1,-.66,.825,3.1,0,.825,2.3,0,2.1,2.3,-.25,2.1,2.4,-.25,2.025,2.4,0,2.025,2.7,0,2.4,2.7,-.25,2.4,3.3,-.25,2.4,3.3,0,2.4,1.7,.66,.6,1.7,.66,1.425,3.1,.66,.825,2.6,.66,1.425,2.4,.25,2.025,2.3,.25,2.1,3.3,.25,2.4,2.7,.25,2.4,2.8,0,2.475,2.8,-.25,2.475,3.525,-.25,2.49375,3.525,0,2.49375,2.9,0,2.475,2.9,-.15,2.475,3.45,-.15,2.5125,3.45,0,2.5125,2.8,0,2.4,2.8,-.15,2.4,3.2,-.15,2.4,3.2,0,2.4,3.525,.25,2.49375,2.8,.25,2.475,3.45,.15,2.5125,2.9,.15,2.475,3.2,.15,2.4,2.8,.15,2.4,0,0,3.15,.8,0,3.15,.8,-.45,3.15,.45,-.8,3.15,0,-.8,3.15,0,0,2.85,.2,0,2.7,.2,-.112,2.7,.112,-.2,2.7,0,-.2,2.7,-.45,-.8,3.15,-.8,-.45,3.15,-.8,0,3.15,-.112,-.2,2.7,-.2,-.112,2.7,-.2,0,2.7,-.8,.45,3.15,-.45,.8,3.15,0,.8,3.15,-.2,.112,2.7,-.112,.2,2.7,0,.2,2.7,.45,.8,3.15,.8,.45,3.15,.112,.2,2.7,.2,.112,2.7,.4,0,2.55,.4,-.224,2.55,.224,-.4,2.55,0,-.4,2.55,1.3,0,2.55,1.3,-.728,2.55,.728,-1.3,2.55,0,-1.3,2.55,1.3,0,2.4,1.3,-.728,2.4,.728,-1.3,2.4,0,-1.3,2.4,-.224,-.4,2.55,-.4,-.224,2.55,-.4,0,2.55,-.728,-1.3,2.55,-1.3,-.728,2.55,-1.3,0,2.55,-.728,-1.3,2.4,-1.3,-.728,2.4,-1.3,0,2.4,-.4,.224,2.55,-.224,.4,2.55,0,.4,2.55,-1.3,.728,2.55,-.728,1.3,2.55,0,1.3,2.55,-1.3,.728,2.4,-.728,1.3,2.4,0,1.3,2.4,.224,.4,2.55,.4,.224,2.55,.728,1.3,2.55,1.3,.728,2.55,.728,1.3,2.4,1.3,.728,2.4,0,0,0,1.425,0,0,1.425,.798,0,.798,1.425,0,0,1.425,0,1.5,0,.075,1.5,.84,.075,.84,1.5,.075,0,1.5,.075,-.798,1.425,0,-1.425,.798,0,-1.425,0,0,-.84,1.5,.075,-1.5,.84,.075,-1.5,0,.075,-1.425,-.798,0,-.798,-1.425,0,0,-1.425,0,-1.5,-.84,.075,-.84,-1.5,.075,0,-1.5,.075,.798,-1.425,0,1.425,-.798,0,.84,-1.5,.075,1.5,-.84,.075];super(),e=e||50,t=void 0!==t?Math.max(2,Math.floor(t)||10):10,s=void 0===s||s;const u=3.15*((o=void 0===o||o)?1:1.3)/2,h=e/u;let d=(r=void 0===r||r)?(8*t-4)*t:0;d+=(i=void 0===i||i)?(16*t-4)*t:0,d+=(a=void 0===a||a)?40*t*t:0;const p=new Uint32Array(3*d);let f=r?4:0;f+=i?8:0,f+=a?20:0,f*=(t+1)*(t+1);const m=new Float32Array(3*f),g=new Float32Array(3*f),v=new Float32Array(2*f),A=new n.Matrix4;A.set(-1,3,-3,1,3,-6,3,0,-3,3,0,0,1,0,0,0);const y=[];let x,b,w;const E=[],S=[],M=[],_=[],T=[],C=[],I=[],B=[],R=new n.Vector3;let P,F,L,D,U,N,k,O,G,z=0,V=0;const H=new n.Vector3;let Q,j,W,X;const Y=new n.Matrix4,q=new n.Matrix4,K=new n.Vector4,J=new n.Vector4,Z=new n.Vector4,$=new n.Vector4,ee=new n.Vector3,te=new n.Vector3,re=A.clone();re.transpose();const ne=(e,t,r)=>!(m[3*e]===m[3*t]&&m[3*e+1]===m[3*t+1]&&m[3*e+2]===m[3*t+2]||m[3*e]===m[3*r]&&m[3*e+1]===m[3*r+1]&&m[3*e+2]===m[3*r+2]||m[3*t]===m[3*r]&&m[3*t+1]===m[3*r+1]&&m[3*t+2]===m[3*r+2]);for(x=0;x<3;x++)T[x]=new n.Matrix4;const ie=r?32:28;D=t+1;let ae=0,se=0,oe=0,le=0,ce=0;for(let n=a?0:20;n<ie;n++)if(i||n<20||n>=28){for(x=0;x<3;x++){for(b=0;b<4;b++)for(w=0;w<4;w++)y[4*w+b]=c[3*l[16*n+4*b+w]+x],s&&n>=20&&n<28&&2!==x&&(y[4*w+b]*=1.077),o||2!==x||(y[4*w+b]*=1.3);Y.set(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),q.multiplyMatrices(Y,A),T[x].multiplyMatrices(re,q)}for(F=0;F<=t;F++)for(U=F/t,L=0;L<=t;L++){for(N=L/t,G=4,k=O=1;G--;)E[G]=k,S[G]=O,k*=U,O*=N,3===G?(M[G]=_[G]=0,z=V=1):(M[G]=z*(3-G),_[G]=V*(3-G),z*=U,V*=N);for(K.fromArray(E),J.fromArray(S),Z.fromArray(M),$.fromArray(_),x=0;x<3;x++)P=K.clone(),P.applyMatrix4(T[x]),C[x]=P.dot(J),P=Z.clone(),P.applyMatrix4(T[x]),I[x]=P.dot(J),P=K.clone(),P.applyMatrix4(T[x]),B[x]=P.dot($);ee.fromArray(I),te.fromArray(B),R.crossVectors(te,ee),R.normalize(),0===C[0]&&0===C[1]?H.set(0,C[2]>u?1:-1,0):H.set(R.x,R.z,-R.y),m[se++]=h*C[0],m[se++]=h*(C[2]-u),m[se++]=-h*C[1],g[oe++]=H.x,g[oe++]=H.y,g[oe++]=H.z,v[le++]=1-N,v[le++]=1-U}for(F=0;F<t;F++)for(L=0;L<t;L++)Q=ae*D*D+F*D+L,j=Q+1,W=j+D,X=Q+D,ne(Q,j,W)&&(p[ce++]=Q,p[ce++]=j,p[ce++]=W),ne(Q,W,X)&&(p[ce++]=Q,p[ce++]=W,p[ce++]=X);ae++}this.setIndex(new n.BufferAttribute(p,1)),this.setAttribute("position",new n.BufferAttribute(m,3)),this.setAttribute("normal",new n.BufferAttribute(g,3)),this.setAttribute("uv",new n.BufferAttribute(v,2)),this.computeBoundingSphere()}}class So extends n.ExtrudeGeometry{constructor(e,t={}){const{bevelEnabled:r=!1,bevelSize:n=8,bevelThickness:i=10,font:a,height:s=50,size:o=100,lineHeight:l=1,letterSpacing:c=0,...u}=t;if(void 0===a)super();else{super(a.generateShapes(e,o,{lineHeight:l,letterSpacing:c}),{...u,bevelEnabled:r,bevelSize:n,bevelThickness:i,depth:s})}this.type="TextGeometry"}}const Mo=new n.Matrix4;class _o{constructor(e){e=e||{},this.vertices={near:[new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3],far:[new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3]},void 0!==e.projectionMatrix&&this.setFromProjectionMatrix(e.projectionMatrix,e.maxFar||1e4)}setFromProjectionMatrix(e,t){const r=0===e.elements[11];return Mo.copy(e).invert(),this.vertices.near[0].set(1,1,-1),this.vertices.near[1].set(1,-1,-1),this.vertices.near[2].set(-1,-1,-1),this.vertices.near[3].set(-1,1,-1),this.vertices.near.forEach((function(e){e.applyMatrix4(Mo)})),this.vertices.far[0].set(1,1,1),this.vertices.far[1].set(1,-1,1),this.vertices.far[2].set(-1,-1,1),this.vertices.far[3].set(-1,1,1),this.vertices.far.forEach((function(e){e.applyMatrix4(Mo);const n=Math.abs(e.z);r?e.z*=Math.min(t/n,1):e.multiplyScalar(Math.min(t/n,1))})),this.vertices}split(e,t){for(;e.length>t.length;)t.push(new _o);t.length=e.length;for(let r=0;r<e.length;r++){const n=t[r];if(0===r)for(let e=0;e<4;e++)n.vertices.near[e].copy(this.vertices.near[e]);else for(let t=0;t<4;t++)n.vertices.near[t].lerpVectors(this.vertices.near[t],this.vertices.far[t],e[r-1]);if(r===e.length-1)for(let e=0;e<4;e++)n.vertices.far[e].copy(this.vertices.far[e]);else for(let t=0;t<4;t++)n.vertices.far[t].lerpVectors(this.vertices.near[t],this.vertices.far[t],e[r])}}toSpace(e,t){for(let r=0;r<4;r++)t.vertices.near[r].copy(this.vertices.near[r]).applyMatrix4(e),t.vertices.far[r].copy(this.vertices.far[r]).applyMatrix4(e)}}const To={lights_fragment_begin:"\nGeometricContext geometry;\n\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n#ifdef CLEARCOAT\n\n\tgeometry.clearcoatNormal = clearcoatNormal;\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\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\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\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\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0) && defined( RE_Direct ) && defined( USE_CSM ) && defined( CSM_CASCADES )\n\n\tDirectionalLight directionalLight;\n\tfloat linearDepth = (vViewPosition.z) / (shadowFar - cameraNear);\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#if defined( USE_SHADOWMAP ) && defined( CSM_FADE )\n\tvec2 cascade;\n\tfloat cascadeCenter;\n\tfloat closestEdge;\n\tfloat margin;\n\tfloat csmx;\n\tfloat csmy;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t \t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\t\t// NOTE: Depth gets larger away from the camera.\n\t\t\t// cascade.x is closer, cascade.y is further\n\t\t\tcascade = CSM_cascades[ i ];\n\t\t\tcascadeCenter = ( cascade.x + cascade.y ) / 2.0;\n\t\t\tclosestEdge = linearDepth < cascadeCenter ? cascade.x : cascade.y;\n\t\t\tmargin = 0.25 * pow( closestEdge, 2.0 );\n\t\t\tcsmx = cascade.x - margin / 2.0;\n\t\t\tcsmy = cascade.y + margin / 2.0;\n\t\t\tif( linearDepth >= csmx && ( linearDepth < csmy || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 ) ) {\n\n\t\t\t\tfloat dist = min( linearDepth - csmx, csmy - linearDepth );\n\t\t\t\tfloat ratio = clamp( dist / margin, 0.0, 1.0 );\n\n\t\t\t\tvec3 prevColor = directLight.color;\n\t\t\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\t\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t\t\t\tbool shouldFadeLastCascade = UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth > cascadeCenter;\n\t\t\t\tdirectLight.color = mix( prevColor, directLight.color, shouldFadeLastCascade ? ratio : 1.0 );\n\n\t\t\t\tReflectedLight prevLight = reflectedLight;\n\t\t\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t\t\tbool shouldBlend = UNROLLED_LOOP_INDEX != CSM_CASCADES - 1 || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth < cascadeCenter;\n\t\t\t\tfloat blendRatio = shouldBlend ? ratio : 1.0;\n\n\t\t\t\treflectedLight.directDiffuse = mix( prevLight.directDiffuse, reflectedLight.directDiffuse, blendRatio );\n\t\t\t\treflectedLight.directSpecular = mix( prevLight.directSpecular, reflectedLight.directSpecular, blendRatio );\n\t\t\t\treflectedLight.indirectDiffuse = mix( prevLight.indirectDiffuse, reflectedLight.indirectDiffuse, blendRatio );\n\t\t\t\treflectedLight.indirectSpecular = mix( prevLight.indirectSpecular, reflectedLight.indirectSpecular, blendRatio );\n\n\t\t\t}\n\t \t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\t#else\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\t\tdirectionalLight = directionalLights[ i ];\n\t\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\n\t\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\t\tif(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y) directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t\t\tif(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && (linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1)) RE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t\t#endif\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if ( NUM_DIR_LIGHTS > NUM_DIR_LIGHT_SHADOWS)\n\t\t// compute the lights not casting shadows (if any)\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = NUM_DIR_LIGHT_SHADOWS; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\t\tdirectionalLight = directionalLights[ i ];\n\n\t\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) && !defined( USE_CSM ) && !defined( CSM_CASCADES )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\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\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",getlights_pars_begin:()=>`\n\t\t\t#if defined( USE_CSM ) && defined( CSM_CASCADES )\n\t\t\tuniform vec2 CSM_cascades[CSM_CASCADES];\n\t\t\tuniform float cameraNear;\n\t\t\tuniform float shadowFar;\n\t\t\t#endif\n\n\t\t\t${n.ShaderChunk.lights_pars_begin}\n\t\t`},Co=new n.Matrix4,Io=new _o,Bo=new n.Vector3,Ro=new n.Box3,Po=[],Fo=[];class Lo{constructor(e){e=e||{},this.camera=e.camera,this.parent=e.parent,this.cascades=e.cascades||3,this.maxFar=e.maxFar||1e5,this.mode=e.mode||"practical",this.shadowMapSize=e.shadowMapSize||2048,this.shadowBias=e.shadowBias||1e-6,this.lightDirection=e.lightDirection||new n.Vector3(1,-1,1).normalize(),this.lightIntensity=e.lightIntensity||1,this.lightNear=e.lightNear||1,this.lightFar=e.lightFar||2e3,this.lightMargin=e.lightMargin||200,this.customSplitsCallback=e.customSplitsCallback,this.fade=!1,this.mainFrustum=new _o,this.frustums=[],this.breaks=[],this.lights=[],this.shaders=new Map,this.createLights(),this.updateFrustums(),this.injectInclude()}createLights(){for(let e=0;e<this.cascades;e++){const e=new n.DirectionalLight(16777215,this.lightIntensity);e.castShadow=!0,e.shadow.mapSize.width=this.shadowMapSize,e.shadow.mapSize.height=this.shadowMapSize,e.shadow.camera.near=this.lightNear,e.shadow.camera.far=this.lightFar,e.shadow.bias=this.shadowBias,this.parent.add(e),this.parent.add(e.target),this.lights.push(e)}}initCascades(){const e=this.camera;e.updateProjectionMatrix(),this.mainFrustum.setFromProjectionMatrix(e.projectionMatrix,this.maxFar),this.mainFrustum.split(this.breaks,this.frustums)}updateShadowBounds(){const e=this.frustums;for(let t=0;t<e.length;t++){const e=this.lights[t].shadow.camera,r=this.frustums[t],n=r.vertices.near,i=r.vertices.far,a=i[0];let s;s=a.distanceTo(i[2])>a.distanceTo(n[2])?i[2]:n[2];let o=a.distanceTo(s);if(this.fade){const e=this.camera,t=Math.max(e.far,this.maxFar),n=r.vertices.far[0].z/(t-e.near);o+=.25*Math.pow(n,2)*(t-e.near)}e.left=-o/2,e.right=o/2,e.top=o/2,e.bottom=-o/2,e.updateProjectionMatrix()}}getBreaks(){const e=this.camera,t=Math.min(e.far,this.maxFar);switch(this.breaks.length=0,this.mode){case"uniform":r(this.cascades,e.near,t,this.breaks);break;case"logarithmic":i(this.cascades,e.near,t,this.breaks);break;case"practical":!function(e,t,a,s,o){Po.length=0,Fo.length=0,i(e,t,a,Fo),r(e,t,a,Po);for(let r=1;r<e;r++)o.push(n.MathUtils.lerp(Po[r-1],Fo[r-1],s));o.push(1)}(this.cascades,e.near,t,.5,this.breaks);break;case"custom":void 0===this.customSplitsCallback&&console.error("CSM: Custom split scheme callback not defined."),this.customSplitsCallback(this.cascades,e.near,t,this.breaks)}function r(e,t,r,n){for(let i=1;i<e;i++)n.push((t+(r-t)*i/e)/r);n.push(1)}function i(e,t,r,n){for(let i=1;i<e;i++)n.push(t*(r/t)**(i/e)/r);n.push(1)}}update(){const e=this.camera,t=this.frustums;for(let r=0;r<t.length;r++){const n=this.lights[r],i=n.shadow.camera,a=(i.right-i.left)/this.shadowMapSize,s=(i.top-i.bottom)/this.shadowMapSize;n.shadow.camera.updateMatrixWorld(!0),Co.multiplyMatrices(n.shadow.camera.matrixWorldInverse,e.matrixWorld),t[r].toSpace(Co,Io);const o=Io.vertices.near,l=Io.vertices.far;Ro.makeEmpty();for(let e=0;e<4;e++)Ro.expandByPoint(o[e]),Ro.expandByPoint(l[e]);Ro.getCenter(Bo),Bo.z=Ro.max.z+this.lightMargin,Bo.x=Math.floor(Bo.x/a)*a,Bo.y=Math.floor(Bo.y/s)*s,Bo.applyMatrix4(n.shadow.camera.matrixWorld),n.position.copy(Bo),n.target.position.copy(Bo),n.target.position.x+=this.lightDirection.x,n.target.position.y+=this.lightDirection.y,n.target.position.z+=this.lightDirection.z}}injectInclude(){n.ShaderChunk.lights_fragment_begin=To.lights_fragment_begin,n.ShaderChunk.lights_pars_begin=To.lights_pars_begin}setupMaterial(e){e.defines=e.defines||{},e.defines.USE_CSM=1,e.defines.CSM_CASCADES=this.cascades,this.fade&&(e.defines.CSM_FADE="");const t=[],r=this,n=this.shaders;e.onBeforeCompile=function(i){const a=Math.min(r.camera.far,r.maxFar);r.getExtendedBreaks(t),i.uniforms.CSM_cascades={value:t},i.uniforms.cameraNear={value:r.camera.near},i.uniforms.shadowFar={value:a},n.set(e,i)},n.set(e,null)}updateUniforms(){const e=Math.min(this.camera.far,this.maxFar);this.shaders.forEach((function(t,r){if(null!==t){const r=t.uniforms;this.getExtendedBreaks(r.CSM_cascades.value),r.cameraNear.value=this.camera.near,r.shadowFar.value=e}!this.fade&&"CSM_FADE"in r.defines?(delete r.defines.CSM_FADE,r.needsUpdate=!0):this.fade&&!("CSM_FADE"in r.defines)&&(r.defines.CSM_FADE="",r.needsUpdate=!0)}),this)}getExtendedBreaks(e){for(;e.length<this.breaks.length;)e.push(new n.Vector2);e.length=this.breaks.length;for(let t=0;t<this.cascades;t++){const r=this.breaks[t],n=this.breaks[t-1]||0;e[t].x=n,e[t].y=r}}updateFrustums(){this.getBreaks(),this.initCascades(),this.updateShadowBounds(),this.updateUniforms()}remove(){for(let e=0;e<this.lights.length;e++)this.parent.remove(this.lights[e])}dispose(){const e=this.shaders;e.forEach((function(e,t){delete t.onBeforeCompile,delete t.defines.USE_CSM,delete t.defines.CSM_CASCADES,delete t.defines.CSM_FADE,null!==e&&(delete e.uniforms.CSM_cascades,delete e.uniforms.cameraNear,delete e.uniforms.shadowFar),t.needsUpdate=!0})),e.clear()}}class Do extends n.Group{constructor(e){super(),this.csm=e,this.displayFrustum=!0,this.displayPlanes=!0,this.displayShadowBounds=!0;const t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new n.BufferGeometry;i.setIndex(new n.BufferAttribute(t,1)),i.setAttribute("position",new n.BufferAttribute(r,3,!1));const a=new n.LineSegments(i,new n.LineBasicMaterial);this.add(a),this.frustumLines=a,this.cascadeLines=[],this.cascadePlanes=[],this.shadowLines=[]}updateVisibility(){const e=this.displayFrustum,t=this.displayPlanes,r=this.displayShadowBounds,n=this.frustumLines,i=this.cascadeLines,a=this.cascadePlanes,s=this.shadowLines;for(let o=0,l=i.length;o<l;o++){const n=i[o],l=a[o],c=s[o];n.visible=e,l.visible=e&&t,c.visible=r}n.visible=e}update(){const e=this.csm,t=e.camera,r=e.cascades,i=e.mainFrustum,a=e.frustums,s=e.lights,o=this.frustumLines.geometry.getAttribute("position"),l=this.cascadeLines,c=this.cascadePlanes,u=this.shadowLines;for(this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.updateMatrixWorld(!0);l.length>r;)this.remove(l.pop()),this.remove(c.pop()),this.remove(u.pop());for(;l.length<r;){const e=new n.Box3Helper(new n.Box3,16777215),t=new n.MeshBasicMaterial({transparent:!0,opacity:.1,depthWrite:!1,side:n.DoubleSide}),r=new n.Mesh(new n.PlaneGeometry,t),i=new n.Group,a=new n.Box3Helper(new n.Box3,16776960);i.add(a),this.add(e),this.add(r),this.add(i),l.push(e),c.push(r),u.push(i)}for(let n=0;n<r;n++){const e=a[n],t=s[n].shadow.camera,r=e.vertices.far,i=l[n],o=c[n],h=u[n],d=h.children[0];i.box.min.copy(r[2]),i.box.max.copy(r[0]),i.box.max.z+=1e-4,o.position.addVectors(r[0],r[2]),o.position.multiplyScalar(.5),o.scale.subVectors(r[0],r[2]),o.scale.z=1e-4,this.remove(h),h.position.copy(t.position),h.quaternion.copy(t.quaternion),h.scale.copy(t.scale),h.updateMatrixWorld(!0),this.attach(h),d.box.min.set(t.bottom,t.left,-t.far),d.box.max.set(t.top,t.right,-t.near)}const h=i.vertices.near,d=i.vertices.far;o.setXYZ(0,d[0].x,d[0].y,d[0].z),o.setXYZ(1,d[3].x,d[3].y,d[3].z),o.setXYZ(2,d[2].x,d[2].y,d[2].z),o.setXYZ(3,d[1].x,d[1].y,d[1].z),o.setXYZ(4,h[0].x,h[0].y,h[0].z),o.setXYZ(5,h[3].x,h[3].y,h[3].z),o.setXYZ(6,h[2].x,h[2].y,h[2].z),o.setXYZ(7,h[1].x,h[1].y,h[1].z),o.needsUpdate=!0}}const Uo={uniforms:{tDiffuse:{value:null},exposure:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define saturate(a) clamp( a, 0.0, 1.0 )","uniform sampler2D tDiffuse;","uniform float exposure;","varying vec2 vUv;","vec3 RRTAndODTFit( vec3 v ) {","\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;","\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;","\treturn a / b;","}","vec3 ACESFilmicToneMapping( vec3 color ) {","\tconst mat3 ACESInputMat = mat3(","\t\tvec3( 0.59719, 0.07600, 0.02840 ),","\t\tvec3( 0.35458, 0.90834, 0.13383 ),","\t\tvec3( 0.04823, 0.01566, 0.83777 )","\t);","\tconst mat3 ACESOutputMat = mat3(","\t\tvec3( 1.60475, -0.10208, -0.00327 ),","\t\tvec3( -0.53108, 1.10813, -0.07276 ),","\t\tvec3( -0.07367, -0.00605, 1.07602 )","\t);","\tcolor = ACESInputMat * color;","\tcolor = RRTAndODTFit( color );","\tcolor = ACESOutputMat * color;","\treturn saturate( color );","}","void main() {","\tvec4 tex = texture2D( tDiffuse, vUv );","\ttex.rgb *= exposure / 0.6;","\tgl_FragColor = vec4( ACESFilmicToneMapping( tex.rgb ), tex.a );","}"].join("\n")},No={uniforms:{},vertexShader:["void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")},ko={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 base = texture2D( tDiffuse, vUv );","\tvec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","\tfloat lum = dot( lumCoeff, base.rgb );","\tvec3 blend = vec3( lum );","\tfloat L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","\tvec3 result1 = 2.0 * base.rgb * blend;","\tvec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","\tvec3 newColor = mix( result1, result2, L );","\tfloat A2 = opacity * base.a;","\tvec3 mixRGB = A2 * newColor.rgb;","\tmixRGB += ( ( 1.0 - A2 ) * base.rgb );","\tgl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")},Oo={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","\tvec4 texel1 = texture2D( tDiffuse1, vUv );","\tvec4 texel2 = texture2D( tDiffuse2, vUv );","\tgl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")},Go={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","\tgl_FragColor = texture2D( tDiffuse, vUv );","\tgl_FragColor.rgb += brightness;","\tif (contrast > 0.0) {","\t\tgl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","\t} else {","\t\tgl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","\t}","}"].join("\n")},zo={uniforms:{tDiffuse:{value:null},powRGB:{value:new n.Vector3(2,2,2)},mulRGB:{value:new n.Vector3(1,1,1)},addRGB:{value:new n.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","\tgl_FragColor = texture2D( tDiffuse, vUv );","\tgl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")},Vo={uniforms:{tDiffuse:{value:null},color:{value:new n.Color(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec3 luma = vec3( 0.299, 0.587, 0.114 );","\tfloat v = dot( texel.xyz, luma );","\tgl_FragColor = vec4( v * color, texel.w );","}"].join("\n")},Ho={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","\tvec4 depth = texture2D( tDepth, vUv );","\tfloat factor = depth.x - focus;","\tvec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","\tgl_FragColor = col;","\tgl_FragColor.a = 1.0;","}"].join("\n")},Qo={uniforms:{tDiffuse:{value:null},resolution:{value:new n.Vector2(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immediates."," // Immediates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")},jo={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 color, org, tmp, add;","\tfloat sample_dist, f;","\tvec2 vin;","\tvec2 uv = vUv;","\tadd = color = org = texture2D( tDiffuse, uv );","\tvin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","\tsample_dist = dot( vin, vin ) * 2.0;","\tf = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","\tvec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","\tadd += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tcolor = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","\tcolor = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","\tgl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")},Wo={uniforms:{tDiffuse:{value:null},aspect:{value:new n.Vector2(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","\tG[0] = g0,","\tG[1] = g1,","\tG[2] = g2,","\tG[3] = g3,","\tG[4] = g4,","\tG[5] = g5,","\tG[6] = g6,","\tG[7] = g7,","\tG[8] = g8;","\tmat3 I;","\tfloat cnv[9];","\tvec3 sample;","\tfor (float i=0.0; i<3.0; i++) {","\t\tfor (float j=0.0; j<3.0; j++) {","\t\t\tsample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","\t\t\tI[int(i)][int(j)] = length(sample);","\t\t}","\t}","\tfor (int i=0; i<9; i++) {","\t\tfloat dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","\t\tcnv[i] = dp3 * dp3;","\t}","\tfloat M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","\tfloat S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","\tgl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")},Xo={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tvec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","\tvec3 I = worldPosition.xyz - cameraPosition;","\tvReflect = reflect( I, worldNormal );","\tvRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","\tvRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","\tvRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","\tvReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","\tgl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","\tvec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","\tvec4 refractedColor = vec4( 1.0 );","\trefractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","\trefractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","\trefractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","\tgl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")};var Yo=r(60809);const qo={uniforms:{tInput:{value:null}},vertexShader:["varying vec2 vUv;","void main() {"," vUv = uv;"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["varying vec2 vUv;","uniform sampler2D tInput;","void main() {","\tgl_FragColor = vec4( 1.0 ) - texture2D( tInput, vUv );","}"].join("\n")},Ko={uniforms:{tInput:{value:null},fStepSize:{value:1},vSunPositionScreenSpace:{value:new n.Vector3}},vertexShader:["varying vec2 vUv;","void main() {"," vUv = uv;"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define TAPS_PER_PASS 6.0","varying vec2 vUv;","uniform sampler2D tInput;","uniform vec3 vSunPositionScreenSpace;","uniform float fStepSize;","void main() {","\tvec2 delta = vSunPositionScreenSpace.xy - vUv;","\tfloat dist = length( delta );","\tvec2 stepv = fStepSize * delta / dist;","\tfloat iters = dist/fStepSize;","\tvec2 uv = vUv.xy;","\tfloat col = 0.0;","\tfloat f = min( 1.0, max( vSunPositionScreenSpace.z / 1000.0, 0.0 ) );","\tif ( 0.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 1.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 2.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 3.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 4.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 5.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tgl_FragColor = vec4( col/TAPS_PER_PASS );","\tgl_FragColor.a = 1.0;","}"].join("\n")},Jo={uniforms:{tColors:{value:null},tGodRays:{value:null},fGodRayIntensity:{value:.69}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["varying vec2 vUv;","uniform sampler2D tColors;","uniform sampler2D tGodRays;","uniform float fGodRayIntensity;","void main() {","\tgl_FragColor = texture2D( tColors, vUv ) + fGodRayIntensity * vec4( 1.0 - texture2D( tGodRays, vUv ).r );","\tgl_FragColor.a = 1.0;","}"].join("\n")},Zo={uniforms:{vSunPositionScreenSpace:{value:new n.Vector3},fAspect:{value:1},sunColor:{value:new n.Color(16772608)},bgColor:{value:new n.Color(0)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["varying vec2 vUv;","uniform vec3 vSunPositionScreenSpace;","uniform float fAspect;","uniform vec3 sunColor;","uniform vec3 bgColor;","void main() {","\tvec2 diff = vUv - vSunPositionScreenSpace.xy;","\tdiff.x *= fAspect;","\tfloat prop = clamp( length( diff ) / 0.5, 0.0, 1.0 );","\tprop = 0.35 * pow( 1.0 - prop, 3.0 );","\tgl_FragColor.xyz = ( vSunPositionScreenSpace.z > 0.0 ) ? mix( sunColor, bgColor, 1.0 - prop ) : bgColor;","\tgl_FragColor.w = 1.0;","}"].join("\n")};var $o=r(78466);const el={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","\tvec4 sum = vec4( 0.0 );","\tfloat hh = h * abs( r - vUv.y );","\tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","\tgl_FragColor = sum;","}"].join("\n")},tl={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","\tgl_FragColor = texture2D( tDiffuse, vUv );","\tfloat angle = hue * 3.14159265;","\tfloat s = sin(angle), c = cos(angle);","\tvec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","\tfloat len = length(gl_FragColor.rgb);","\tgl_FragColor.rgb = vec3(","\t\tdot(gl_FragColor.rgb, weights.xyz),","\t\tdot(gl_FragColor.rgb, weights.zxy),","\t\tdot(gl_FragColor.rgb, weights.yzx)","\t);","\tfloat average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","\tif (saturation > 0.0) {","\t\tgl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","\t} else {","\t\tgl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","\t}","}"].join("\n")},rl={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","\tvec2 p = vUv - 0.5;","\tfloat r = length(p);","\tfloat a = atan(p.y, p.x) + angle;","\tfloat tau = 2. * 3.1416 ;","\ta = mod(a, tau/sides);","\ta = abs(a - tau/sides/2.) ;","\tp = r * vec2(cos(a), sin(a));","\tvec4 color = texture2D(tDiffuse, p + 0.5);","\tgl_FragColor = color;","}"].join("\n")},nl={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","\tvec2 p = vUv;","\tif (side == 0){","\t\tif (p.x > 0.5) p.x = 1.0 - p.x;","\t}else if (side == 1){","\t\tif (p.x < 0.5) p.x = 1.0 - p.x;","\t}else if (side == 2){","\t\tif (p.y < 0.5) p.y = 1.0 - p.y;","\t}else if (side == 3){","\t\tif (p.y > 0.5) p.y = 1.0 - p.y;","\t} ","\tvec4 color = texture2D(tDiffuse, p);","\tgl_FragColor = color;","}"].join("\n")},il={uniforms:{heightMap:{value:null},resolution:{value:new n.Vector2(512,512)},scale:{value:new n.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","\tfloat val = texture2D( heightMap, vUv ).x;","\tfloat valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","\tfloat valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","\tgl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")},al={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","\tvUv = uv;","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvViewPosition = -mvPosition.xyz;","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","\tvec2 parallaxMap( in vec3 V ) {","\t\tfloat initialHeight = texture2D( bumpMap, vUv ).r;","\t\tvec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","\t\treturn vUv - texCoordOffset;","\t}","#else","\tvec2 parallaxMap( in vec3 V ) {","\t\tfloat numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","\t\tfloat layerHeight = 1.0 / numLayers;","\t\tfloat currentLayerHeight = 0.0;","\t\tvec2 dtex = parallaxScale * V.xy / V.z / numLayers;","\t\tvec2 currentTextureCoords = vUv;","\t\tfloat heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","\t\tfor ( int i = 0; i < 30; i += 1 ) {","\t\t\tif ( heightFromTexture <= currentLayerHeight ) {","\t\t\t\tbreak;","\t\t\t}","\t\t\tcurrentLayerHeight += layerHeight;","\t\t\tcurrentTextureCoords -= dtex;","\t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","\t\t}","\t\t#ifdef USE_STEEP_PARALLAX","\t\t\treturn currentTextureCoords;","\t\t#elif defined( USE_RELIEF_PARALLAX )","\t\t\tvec2 deltaTexCoord = dtex / 2.0;","\t\t\tfloat deltaHeight = layerHeight / 2.0;","\t\t\tcurrentTextureCoords += deltaTexCoord;","\t\t\tcurrentLayerHeight -= deltaHeight;","\t\t\tconst int numSearches = 5;","\t\t\tfor ( int i = 0; i < numSearches; i += 1 ) {","\t\t\t\tdeltaTexCoord /= 2.0;","\t\t\t\tdeltaHeight /= 2.0;","\t\t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","\t\t\t\tif( heightFromTexture > currentLayerHeight ) {","\t\t\t\t\tcurrentTextureCoords -= deltaTexCoord;","\t\t\t\t\tcurrentLayerHeight += deltaHeight;","\t\t\t\t} else {","\t\t\t\t\tcurrentTextureCoords += deltaTexCoord;","\t\t\t\t\tcurrentLayerHeight -= deltaHeight;","\t\t\t\t}","\t\t\t}","\t\t\treturn currentTextureCoords;","\t\t#elif defined( USE_OCLUSION_PARALLAX )","\t\t\tvec2 prevTCoords = currentTextureCoords + dtex;","\t\t\tfloat nextH = heightFromTexture - currentLayerHeight;","\t\t\tfloat prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","\t\t\tfloat weight = nextH / ( nextH - prevH );","\t\t\treturn prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","\t\t#else","\t\t\treturn vUv;","\t\t#endif","\t}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","\tvec2 texDx = dFdx( vUv );","\tvec2 texDy = dFdy( vUv );","\tvec3 vSigmaX = dFdx( surfPosition );","\tvec3 vSigmaY = dFdy( surfPosition );","\tvec3 vR1 = cross( vSigmaY, surfNormal );","\tvec3 vR2 = cross( surfNormal, vSigmaX );","\tfloat fDet = dot( vSigmaX, vR1 );","\tvec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","\tvec3 vProjVtex;","\tvProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","\tvProjVtex.z = dot( surfNormal, viewPosition );","\treturn parallaxMap( vProjVtex );","}","void main() {","\tvec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","\tgl_FragColor = texture2D( map, mapUv );","}"].join("\n")},sl={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")},ol={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","\tvec2 offset = amount * vec2( cos(angle), sin(angle));","\tvec4 cr = texture2D(tDiffuse, vUv + offset);","\tvec4 cga = texture2D(tDiffuse, vUv);","\tvec4 cb = texture2D(tDiffuse, vUv - offset);","\tgl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")},ll={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 color = texture2D( tDiffuse, vUv );","\tvec3 c = color.rgb;","\tcolor.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","\tcolor.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","\tcolor.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","\tgl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")},cl={uniforms:{tDiffuse:{value:null},resolution:{value:new n.Vector2}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","\tvec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","\tconst mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","\tconst mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","\tfloat tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","\tfloat tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","\tfloat tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","\tfloat tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","\tfloat tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","\tfloat tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","\tfloat tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","\tfloat tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","\tfloat tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","\tfloat valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","\t\tGx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","\t\tGx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","\tfloat valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","\t\tGy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","\t\tGy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","\tfloat G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","\tgl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};let ul;function hl(){if(ul)return ul;const e=n.ShaderChunk.meshphong_frag.slice(0,n.ShaderChunk.meshphong_frag.indexOf("void main() {")),t=n.ShaderChunk.meshphong_frag.slice(n.ShaderChunk.meshphong_frag.indexOf("void main() {"));return ul={uniforms:n.UniformsUtils.merge([n.ShaderLib.phong.uniforms,{thicknessMap:{value:null},thicknessColor:{value:new n.Color(16777215)},thicknessDistortion:{value:.1},thicknessAmbient:{value:0},thicknessAttenuation:{value:.1},thicknessPower:{value:2},thicknessScale:{value:10}}]),vertexShader:`\n #define USE_UV\n ${n.ShaderChunk.meshphong_vert}\n `,fragmentShader:`\n #define USE_UV',\n #define SUBSURFACE',\n\n ${e}\n\n uniform sampler2D thicknessMap;\n uniform float thicknessPower;\n uniform float thicknessScale;\n uniform float thicknessDistortion;\n uniform float thicknessAmbient;\n uniform float thicknessAttenuation;\n uniform vec3 thicknessColor;\n\n void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {\n \tvec3 thickness = thicknessColor * texture2D(thicknessMap, uv).r;\n \tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));\n \tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;\n \tvec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;\n \treflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;\n }\n\n ${t.replace("#include <lights_fragment_begin>",n.ShaderChunk.lights_fragment_begin.replace(/RE_Direct\( directLight, geometry, material, reflectedLight \);/g,"\n RE_Direct( directLight, geometry, material, reflectedLight );\n\n #if defined( SUBSURFACE ) && defined( USE_UV )\n RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);\n #endif\n "))}\n `},ul}const dl={get uniforms(){return hl().uniforms},set uniforms(e){hl().uniforms=e},get vertexShader(){return hl().vertexShader},set vertexShader(e){hl().vertexShader=e},get fragmentShader(){return hl().vertexShader},set fragmentShader(e){hl().vertexShader=e}},pl={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","\tvec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","\tgl_FragColor = newTex;","}"].join("\n")},fl={uniforms:{uDirLightPos:{value:new n.Vector3},uDirLightColor:{value:new n.Color(15658734)},uAmbientLightColor:{value:new n.Color(328965)},uBaseColor:{value:new n.Color(16777215)}},vertexShader:["varying vec3 vNormal;","varying vec3 vRefract;","void main() {","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec3 worldNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","\tvNormal = normalize( normalMatrix * normal );","\tvec3 I = worldPosition.xyz - cameraPosition;","\tvRefract = refract( normalize( I ), worldNormal, 1.02 );","\tgl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","varying vec3 vRefract;","void main() {","\tfloat directionalLightWeighting = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);","\tvec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;","\tfloat intensity = smoothstep( - 0.5, 1.0, pow( length(lightWeighting), 20.0 ) );","\tintensity += length(lightWeighting) * 0.2;","\tfloat cameraWeighting = dot( normalize( vNormal ), vRefract );","\tintensity += pow( 1.0 - length( cameraWeighting ), 6.0 );","\tintensity = intensity * 0.2 + 0.3;","\tif ( intensity < 0.50 ) {","\t\tgl_FragColor = vec4( 2.0 * intensity * uBaseColor, 1.0 );","\t} else {","\t\tgl_FragColor = vec4( 1.0 - 2.0 * ( 1.0 - intensity ) * ( 1.0 - uBaseColor ), 1.0 );","}","}"].join("\n")},ml={uniforms:{uDirLightPos:{value:new n.Vector3},uDirLightColor:{value:new n.Color(15658734)},uAmbientLightColor:{value:new n.Color(328965)},uBaseColor:{value:new n.Color(15658734)},uLineColor1:{value:new n.Color(8421504)},uLineColor2:{value:new n.Color(0)},uLineColor3:{value:new n.Color(0)},uLineColor4:{value:new n.Color(0)}},vertexShader:["varying vec3 vNormal;","void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","\tvNormal = normalize( normalMatrix * normal );","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uLineColor1;","uniform vec3 uLineColor2;","uniform vec3 uLineColor3;","uniform vec3 uLineColor4;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","void main() {","\tfloat camera = max( dot( normalize( vNormal ), vec3( 0.0, 0.0, 1.0 ) ), 0.4);","\tfloat light = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);","\tgl_FragColor = vec4( uBaseColor, 1.0 );","\tif ( length(uAmbientLightColor + uDirLightColor * light) < 1.00 ) {","\t\tgl_FragColor *= vec4( uLineColor1, 1.0 );","\t}","\tif ( length(uAmbientLightColor + uDirLightColor * camera) < 0.50 ) {","\t\tgl_FragColor *= vec4( uLineColor2, 1.0 );","\t}","}"].join("\n")},gl={uniforms:{uDirLightPos:{value:new n.Vector3},uDirLightColor:{value:new n.Color(15658734)},uAmbientLightColor:{value:new n.Color(328965)},uBaseColor:{value:new n.Color(16777215)},uLineColor1:{value:new n.Color(0)},uLineColor2:{value:new n.Color(0)},uLineColor3:{value:new n.Color(0)},uLineColor4:{value:new n.Color(0)}},vertexShader:["varying vec3 vNormal;","void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","\tvNormal = normalize( normalMatrix * normal );","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uLineColor1;","uniform vec3 uLineColor2;","uniform vec3 uLineColor3;","uniform vec3 uLineColor4;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","void main() {","\tfloat directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);","\tvec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;","\tgl_FragColor = vec4( uBaseColor, 1.0 );","\tif ( length(lightWeighting) < 1.00 ) {","\t\tif ( mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor1, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.75 ) {","\t\tif (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor2, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.50 ) {","\t\tif (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor3, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.3465 ) {","\t\tif (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor4, 1.0 );","\t}","\t}","}"].join("\n")},vl={uniforms:{uDirLightPos:{value:new n.Vector3},uDirLightColor:{value:new n.Color(15658734)},uAmbientLightColor:{value:new n.Color(328965)},uBaseColor:{value:new n.Color(16777215)},uLineColor1:{value:new n.Color(0)}},vertexShader:["varying vec3 vNormal;","void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","\tvNormal = normalize( normalMatrix * normal );","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uLineColor1;","uniform vec3 uLineColor2;","uniform vec3 uLineColor3;","uniform vec3 uLineColor4;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","void main() {","float directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);","vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;","gl_FragColor = vec4( uBaseColor, 1.0 );","if ( length(lightWeighting) < 1.00 ) {","\t\tif ( ( mod(gl_FragCoord.x, 4.001) + mod(gl_FragCoord.y, 4.0) ) > 6.00 ) {","\t\t\tgl_FragColor = vec4( uLineColor1, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.50 ) {","\t\tif ( ( mod(gl_FragCoord.x + 2.0, 4.001) + mod(gl_FragCoord.y + 2.0, 4.0) ) > 6.00 ) {","\t\t\tgl_FragColor = vec4( uLineColor1, 1.0 );","\t\t}","\t}","}"].join("\n")},Al={uniforms:{texture:{value:null},delta:{value:new n.Vector2(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","\tvec4 color = vec4( 0.0 );","\tfloat total = 0.0;","\tfloat offset = rand( vUv );","\tfor ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","\t\tfloat percent = ( t + offset - 0.5 ) / ITERATIONS;","\t\tfloat weight = 1.0 - abs( percent );","\t\tcolor += texture2D( texture, vUv + delta * percent ) * weight;","\t\ttotal += weight;","\t}","\tgl_FragColor = color / total;","}"].join("\n")};var yl=r(37312);const xl={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","\tvec4 sum = vec4( 0.0 );","\tfloat vv = v * abs( r - vUv.y );","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","\tgl_FragColor = sum;","}"].join("\n")},bl={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","\tgl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")},wl={uniforms:{u_size:{value:new n.Vector3(1,1,1)},u_renderstyle:{value:0},u_renderthreshold:{value:.5},u_clim:{value:new n.Vector2(1,1)},u_data:{value:null},u_cmdata:{value:null}},vertexShader:["\t\tvarying vec4 v_nearpos;","\t\tvarying vec4 v_farpos;","\t\tvarying vec3 v_position;","\t\tvoid main() {","\t\t\t\tmat4 viewtransformf = modelViewMatrix;","\t\t\t\tmat4 viewtransformi = inverse(modelViewMatrix);","\t\t\t\tvec4 position4 = vec4(position, 1.0);","\t\t\t\tvec4 pos_in_cam = viewtransformf * position4;","\t\t\t\tpos_in_cam.z = -pos_in_cam.w;","\t\t\t\tv_nearpos = viewtransformi * pos_in_cam;","\t\t\t\tpos_in_cam.z = pos_in_cam.w;","\t\t\t\tv_farpos = viewtransformi * pos_in_cam;","\t\t\t\tv_position = position;","\t\t\t\tgl_Position = projectionMatrix * viewMatrix * modelMatrix * position4;","\t\t}"].join("\n"),fragmentShader:["\t\tprecision highp float;","\t\tprecision mediump sampler3D;","\t\tuniform vec3 u_size;","\t\tuniform int u_renderstyle;","\t\tuniform float u_renderthreshold;","\t\tuniform vec2 u_clim;","\t\tuniform sampler3D u_data;","\t\tuniform sampler2D u_cmdata;","\t\tvarying vec3 v_position;","\t\tvarying vec4 v_nearpos;","\t\tvarying vec4 v_farpos;","\t\tconst int MAX_STEPS = 887;\t// 887 for 512^3, 1774 for 1024^3","\t\tconst int REFINEMENT_STEPS = 4;","\t\tconst float relative_step_size = 1.0;","\t\tconst vec4 ambient_color = vec4(0.2, 0.4, 0.2, 1.0);","\t\tconst vec4 diffuse_color = vec4(0.8, 0.2, 0.2, 1.0);","\t\tconst vec4 specular_color = vec4(1.0, 1.0, 1.0, 1.0);","\t\tconst float shininess = 40.0;","\t\tvoid cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);","\t\tvoid cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);","\t\tfloat sample1(vec3 texcoords);","\t\tvec4 apply_colormap(float val);","\t\tvec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray);","\t\tvoid main() {","\t\t\t\tvec3 farpos = v_farpos.xyz / v_farpos.w;","\t\t\t\tvec3 nearpos = v_nearpos.xyz / v_nearpos.w;","\t\t\t\tvec3 view_ray = normalize(nearpos.xyz - farpos.xyz);","\t\t\t\tfloat distance = dot(nearpos - v_position, view_ray);","\t\t\t\tdistance = max(distance, min((-0.5 - v_position.x) / view_ray.x,","\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(u_size.x - 0.5 - v_position.x) / view_ray.x));","\t\t\t\tdistance = max(distance, min((-0.5 - v_position.y) / view_ray.y,","\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(u_size.y - 0.5 - v_position.y) / view_ray.y));","\t\t\t\tdistance = max(distance, min((-0.5 - v_position.z) / view_ray.z,","\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(u_size.z - 0.5 - v_position.z) / view_ray.z));","\t\t\t\tvec3 front = v_position + view_ray * distance;","\t\t\t\tint nsteps = int(-distance / relative_step_size + 0.5);","\t\t\t\tif ( nsteps < 1 )","\t\t\t\t\t\tdiscard;","\t\t\t\tvec3 step = ((v_position - front) / u_size) / float(nsteps);","\t\t\t\tvec3 start_loc = front / u_size;","\t\t\t\tif (u_renderstyle == 0)","\t\t\t\t\t\tcast_mip(start_loc, step, nsteps, view_ray);","\t\t\t\telse if (u_renderstyle == 1)","\t\t\t\t\t\tcast_iso(start_loc, step, nsteps, view_ray);","\t\t\t\tif (gl_FragColor.a < 0.05)","\t\t\t\t\t\tdiscard;","\t\t}","\t\tfloat sample1(vec3 texcoords) {","\t\t\t\t/* Sample float value from a 3D texture. Assumes intensity data. */","\t\t\t\treturn texture(u_data, texcoords.xyz).r;","\t\t}","\t\tvec4 apply_colormap(float val) {","\t\t\t\tval = (val - u_clim[0]) / (u_clim[1] - u_clim[0]);","\t\t\t\treturn texture2D(u_cmdata, vec2(val, 0.5));","\t\t}","\t\tvoid cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {","\t\t\t\tfloat max_val = -1e6;","\t\t\t\tint max_i = 100;","\t\t\t\tvec3 loc = start_loc;","\t\t\t\tfor (int iter=0; iter<MAX_STEPS; iter++) {","\t\t\t\t\t\tif (iter >= nsteps)","\t\t\t\t\t\t\t\tbreak;","\t\t\t\t\t\tfloat val = sample1(loc);","\t\t\t\t\t\tif (val > max_val) {","\t\t\t\t\t\t\t\tmax_val = val;","\t\t\t\t\t\t\t\tmax_i = iter;","\t\t\t\t\t\t}","\t\t\t\t\t\tloc += step;","\t\t\t\t}","\t\t\t\tvec3 iloc = start_loc + step * (float(max_i) - 0.5);","\t\t\t\tvec3 istep = step / float(REFINEMENT_STEPS);","\t\t\t\tfor (int i=0; i<REFINEMENT_STEPS; i++) {","\t\t\t\t\t\tmax_val = max(max_val, sample1(iloc));","\t\t\t\t\t\tiloc += istep;","\t\t\t\t}","\t\t\t\tgl_FragColor = apply_colormap(max_val);","\t\t}","\t\tvoid cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {","\t\t\t\tgl_FragColor = vec4(0.0);\t// init transparent","\t\t\t\tvec4 color3 = vec4(0.0);\t// final color","\t\t\t\tvec3 dstep = 1.5 / u_size;\t// step to sample derivative","\t\t\t\tvec3 loc = start_loc;","\t\t\t\tfloat low_threshold = u_renderthreshold - 0.02 * (u_clim[1] - u_clim[0]);","\t\t\t\tfor (int iter=0; iter<MAX_STEPS; iter++) {","\t\t\t\t\t\tif (iter >= nsteps)","\t\t\t\t\t\t\t\tbreak;","\t\t\t\t\t\tfloat val = sample1(loc);","\t\t\t\t\t\tif (val > low_threshold) {","\t\t\t\t\t\t\t\tvec3 iloc = loc - 0.5 * step;","\t\t\t\t\t\t\t\tvec3 istep = step / float(REFINEMENT_STEPS);","\t\t\t\t\t\t\t\tfor (int i=0; i<REFINEMENT_STEPS; i++) {","\t\t\t\t\t\t\t\t\t\tval = sample1(iloc);","\t\t\t\t\t\t\t\t\t\tif (val > u_renderthreshold) {","\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor = add_lighting(val, iloc, dstep, view_ray);","\t\t\t\t\t\t\t\t\t\t\t\treturn;","\t\t\t\t\t\t\t\t\t\t}","\t\t\t\t\t\t\t\t\t\tiloc += istep;","\t\t\t\t\t\t\t\t}","\t\t\t\t\t\t}","\t\t\t\t\t\tloc += step;","\t\t\t\t}","\t\t}","\t\tvec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray)","\t\t{","\t\t\t\tvec3 V = normalize(view_ray);","\t\t\t\tvec3 N;","\t\t\t\tfloat val1, val2;","\t\t\t\tval1 = sample1(loc + vec3(-step[0], 0.0, 0.0));","\t\t\t\tval2 = sample1(loc + vec3(+step[0], 0.0, 0.0));","\t\t\t\tN[0] = val1 - val2;","\t\t\t\tval = max(max(val1, val2), val);","\t\t\t\tval1 = sample1(loc + vec3(0.0, -step[1], 0.0));","\t\t\t\tval2 = sample1(loc + vec3(0.0, +step[1], 0.0));","\t\t\t\tN[1] = val1 - val2;","\t\t\t\tval = max(max(val1, val2), val);","\t\t\t\tval1 = sample1(loc + vec3(0.0, 0.0, -step[2]));","\t\t\t\tval2 = sample1(loc + vec3(0.0, 0.0, +step[2]));","\t\t\t\tN[2] = val1 - val2;","\t\t\t\tval = max(max(val1, val2), val);","\t\t\t\tfloat gm = length(N); // gradient magnitude","\t\t\t\tN = normalize(N);","\t\t\t\tfloat Nselect = float(dot(N, V) > 0.0);","\t\t\t\tN = (2.0 * Nselect - 1.0) * N;\t// ==\tNselect * N - (1.0-Nselect)*N;","\t\t\t\tvec4 ambient_color = vec4(0.0, 0.0, 0.0, 0.0);","\t\t\t\tvec4 diffuse_color = vec4(0.0, 0.0, 0.0, 0.0);","\t\t\t\tvec4 specular_color = vec4(0.0, 0.0, 0.0, 0.0);","\t\t\t\tfor (int i=0; i<1; i++)","\t\t\t\t{","\t\t\t\t\t\tvec3 L = normalize(view_ray);\t//lightDirs[i];","\t\t\t\t\t\tfloat lightEnabled = float( length(L) > 0.0 );","\t\t\t\t\t\tL = normalize(L + (1.0 - lightEnabled));","\t\t\t\t\t\tfloat lambertTerm = clamp(dot(N, L), 0.0, 1.0);","\t\t\t\t\t\tvec3 H = normalize(L+V); // Halfway vector","\t\t\t\t\t\tfloat specularTerm = pow(max(dot(H, N), 0.0), shininess);","\t\t\t\t\t\tfloat mask1 = lightEnabled;","\t\t\t\t\t\tambient_color +=\tmask1 * ambient_color;\t// * gl_LightSource[i].ambient;","\t\t\t\t\t\tdiffuse_color +=\tmask1 * lambertTerm;","\t\t\t\t\t\tspecular_color += mask1 * specularTerm * specular_color;","\t\t\t\t}","\t\t\t\tvec4 final_color;","\t\t\t\tvec4 color = apply_colormap(val);","\t\t\t\tfinal_color = color * (ambient_color + diffuse_color) + specular_color;","\t\t\t\tfinal_color.a = color.a;","\t\t\t\treturn final_color;","\t\t}"].join("\n")},El={uniforms:{color:{value:null},time:{value:0},tDiffuse:{value:null},tDudv:{value:null},textureMatrix:{value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};class Sl extends n.Mesh{constructor(e){const t=new Ml(e),r=new n.PlaneGeometry(.001*t.image.width,.001*t.image.height),i=new n.MeshBasicMaterial({map:t,toneMapped:!1,transparent:!0});function a(e){i.map.dispatchDOMEvent(e)}super(r,i),this.addEventListener("mousedown",a),this.addEventListener("mousemove",a),this.addEventListener("mouseup",a),this.addEventListener("click",a),this.dispose=function(){r.dispose(),i.dispose(),i.map.dispose(),_l.delete(e),this.removeEventListener("mousedown",a),this.removeEventListener("mousemove",a),this.removeEventListener("mouseup",a),this.removeEventListener("click",a)}}}class Ml extends n.CanvasTexture{constructor(e){super(Tl(e)),this.dom=e,this.anisotropy=16,"colorSpace"in this?this.colorSpace="srgb":this.encoding=3001,this.minFilter=n.LinearFilter,this.magFilter=n.LinearFilter;const t=new MutationObserver((()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout((()=>this.update()),16))}));t.observe(e,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),this.observer=t}dispatchDOMEvent(e){e.data&&function(e,t,r,n){const i={clientX:r*e.offsetWidth+e.offsetLeft,clientY:n*e.offsetHeight+e.offsetTop,view:e.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(t,i));const a=e.getBoundingClientRect();function s(e){if(e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE){const a=e.getBoundingClientRect();if(r>a.left&&r<a.right&&n>a.top&&n<a.bottom&&(e.dispatchEvent(new MouseEvent(t,i)),e instanceof HTMLInputElement&&"range"===e.type&&("mousedown"===t||"click"===t))){const[t,n]=["min","max"].map((t=>parseFloat(e[t]))),i=a.width,s=(r-a.x)/i;e.value=t+(n-t)*s,e.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let t=0;t<e.childNodes.length;t++)s(e.childNodes[t])}}r=r*a.width+a.left,n=n*a.height+a.top,s(e)}(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=Tl(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const _l=new WeakMap;function Tl(e){const t=document.createRange(),r=new n.Color;function i(e,t,r,n){""!==n&&("uppercase"===e.textTransform&&(n=n.toUpperCase()),c.font=e.fontWeight+" "+e.fontSize+" "+e.fontFamily,c.textBaseline="top",c.fillStyle=e.color,c.fillText(n,t,r+.1*parseFloat(e.fontSize)))}function a(e,t,r,n,i){r<2*i&&(i=r/2),n<2*i&&(i=n/2),c.beginPath(),c.moveTo(e+i,t),c.arcTo(e+r,t,e+r,t+n,i),c.arcTo(e+r,t+n,e,t+n,i),c.arcTo(e,t+n,e,t,i),c.arcTo(e,t,e+r,t,i),c.closePath()}function s(e,t,r,n,i,a){const s=e[t+"Width"],o=e[t+"Style"],l=e[t+"Color"];"0px"!==s&&"none"!==o&&"transparent"!==l&&"rgba(0, 0, 0, 0)"!==l&&(c.strokeStyle=l,c.lineWidth=parseFloat(s),c.beginPath(),c.moveTo(r,n),c.lineTo(r+i,n+a),c.stroke())}const o=e.getBoundingClientRect();let l=_l.get(e);void 0===l&&(l=document.createElement("canvas"),l.width=o.width,l.height=o.height,_l.set(e,l));const c=l.getContext("2d"),u=new function(e){const t=[];let r=!1;function n(){if(r&&(r=!1,e.restore()),0===t.length)return;let n=-1/0,i=-1/0,a=1/0,s=1/0;for(let e=0;e<t.length;e++){const r=t[e];n=Math.max(n,r.x),i=Math.max(i,r.y),a=Math.min(a,r.x+r.width),s=Math.min(s,r.y+r.height)}e.save(),e.beginPath(),e.rect(n,i,a-n,s-i),e.clip(),r=!0}return{add:function(e){t.push(e),n()},remove:function(){t.pop(),n()}}}(c);return function e(n,l){let h=0,d=0,p=0,f=0;if(n.nodeType===Node.TEXT_NODE){t.selectNode(n);const e=t.getBoundingClientRect();h=e.left-o.left-.5,d=e.top-o.top-.5,p=e.width,f=e.height,i(l,h,d,n.nodeValue.trim())}else{if(n.nodeType===Node.COMMENT_NODE)return;if(n instanceof HTMLCanvasElement){if("none"===n.style.display)return;c.save();const e=window.devicePixelRatio;c.scale(1/e,1/e),c.drawImage(n,0,0),c.restore()}else{if("none"===n.style.display)return;const e=n.getBoundingClientRect();h=e.left-o.left-.5,d=e.top-o.top-.5,p=e.width,f=e.height,l=window.getComputedStyle(n),a(h,d,p,f,parseFloat(l.borderRadius));const t=l.backgroundColor;"transparent"!==t&&"rgba(0, 0, 0, 0)"!==t&&(c.fillStyle=t,c.fill());const m=["borderTop","borderLeft","borderBottom","borderRight"];let g=!0,v=null;for(const r of m){if(null!==v&&(g=l[r+"Width"]===l[v+"Width"]&&l[r+"Color"]===l[v+"Color"]&&l[r+"Style"]===l[v+"Style"]),!1===g)break;v=r}if(!0===g){const e=parseFloat(l.borderTopWidth);"0px"!==l.borderTopWidth&&"none"!==l.borderTopStyle&&"transparent"!==l.borderTopColor&&"rgba(0, 0, 0, 0)"!==l.borderTopColor&&(c.strokeStyle=l.borderTopColor,c.lineWidth=e,c.stroke())}else s(l,"borderTop",h,d,p,0),s(l,"borderLeft",h,d,0,f),s(l,"borderBottom",h,d+f,p,0),s(l,"borderRight",h+p,d,0,f);if(n instanceof HTMLInputElement){let e=l.accentColor;void 0!==e&&"auto"!==e||(e=l.color),r.set(e);const t=Math.sqrt(.299*r.r**2+.587*r.g**2+.114*r.b**2)<.5?"white":"#111111";if("radio"===n.type&&(a(h,d,p,f,f),c.fillStyle="white",c.strokeStyle=e,c.lineWidth=1,c.fill(),c.stroke(),n.checked&&(a(h+2,d+2,p-4,f-4,f),c.fillStyle=e,c.strokeStyle=t,c.lineWidth=2,c.fill(),c.stroke())),"checkbox"===n.type&&(a(h,d,p,f,2),c.fillStyle=n.checked?e:"white",c.strokeStyle=n.checked?t:e,c.lineWidth=1,c.stroke(),c.fill(),n.checked)){const e=c.textAlign;c.textAlign="center";i({color:t,fontFamily:l.fontFamily,fontSize:f+"px",fontWeight:"bold"},h+p/2,d,"\u2714"),c.textAlign=e}if("range"===n.type){const[r,i,s]=["min","max","value"].map((e=>parseFloat(n[e]))),o=(s-r)/(i-r)*(p-f);a(h,d+f/4,p,f/2,f/4),c.fillStyle=t,c.strokeStyle=e,c.lineWidth=1,c.fill(),c.stroke(),a(h,d+f/4,o+f/2,f/2,f/4),c.fillStyle=e,c.fill(),a(h+o,d,f,f,f/2),c.fillStyle=e,c.fill()}"color"!==n.type&&"text"!==n.type&&"number"!==n.type||(u.add({x:h,y:d,width:p,height:f}),i(l,h+parseInt(l.paddingLeft),d+parseInt(l.paddingTop),n.value),u.remove())}}}const m="auto"===l.overflow||"hidden"===l.overflow;m&&u.add({x:h,y:d,width:p,height:f});for(let t=0;t<n.childNodes.length;t++)e(n.childNodes[t],l);m&&u.remove()}(e),l}const Cl=new n.Vector2,Il={type:"",data:Cl};class Bl extends n.Group{constructor(e,t){super();const r=this,i=new n.Raycaster,a=new n.Matrix4,s=e.domElement;function o(e){e.stopPropagation(),Cl.x=e.clientX/s.clientWidth*2-1,Cl.y=-e.clientY/s.clientHeight*2+1,i.setFromCamera(Cl,t);const n=i.intersectObjects(r.children,!1);if(n.length>0){const t=n[0],r=t.object,i=t.uv;Il.type=e.type,Il.data.set(i.x,1-i.y),r.dispatchEvent(Il)}}s.addEventListener("pointerdown",o),s.addEventListener("pointerup",o),s.addEventListener("pointermove",o),s.addEventListener("mousedown",o),s.addEventListener("mouseup",o),s.addEventListener("mousemove",o),s.addEventListener("click",o);const l={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function c(e){const t=e.target;a.identity().extractRotation(t.matrixWorld),i.ray.origin.setFromMatrixPosition(t.matrixWorld),i.ray.direction.set(0,0,-1).applyMatrix4(a);const n=i.intersectObjects(r.children,!1);if(n.length>0){const t=n[0],r=t.object,i=t.uv;Il.type=l[e.type],Il.data.set(i.x,1-i.y),r.dispatchEvent(Il)}}const u=e.xr.getController(0);u.addEventListener("move",c),u.addEventListener("select",c),u.addEventListener("selectstart",c),u.addEventListener("selectend",c);const h=e.xr.getController(1);h.addEventListener("move",c),h.addEventListener("select",c),h.addEventListener("selectstart",c),h.addEventListener("selectend",c)}}class Rl{constructor(e,t,r){this.element=document.createElement("div"),this.element.classList.add(r),this.element.style.pointerEvents="none",this.renderer=t,this.startPoint=new n.Vector2,this.pointTopLeft=new n.Vector2,this.pointBottomRight=new n.Vector2,this.isDown=!1,this.renderer.domElement.addEventListener("pointerdown",(e=>{this.isDown=!0,this.onSelectStart(e)})),this.renderer.domElement.addEventListener("pointermove",(e=>{this.isDown&&this.onSelectMove(e)})),this.renderer.domElement.addEventListener("pointerup",(e=>{this.isDown=!1,this.onSelectOver(e)}))}onSelectStart(e){this.renderer.domElement.parentElement.appendChild(this.element),this.element.style.left=`${e.clientX}px`,this.element.style.top=`${e.clientY}px`,this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=e.clientX,this.startPoint.y=e.clientY}onSelectMove(e){this.pointBottomRight.x=Math.max(this.startPoint.x,e.clientX),this.pointBottomRight.y=Math.max(this.startPoint.y,e.clientY),this.pointTopLeft.x=Math.min(this.startPoint.x,e.clientX),this.pointTopLeft.y=Math.min(this.startPoint.y,e.clientY),this.element.style.left=`${this.pointTopLeft.x}px`,this.element.style.top=`${this.pointTopLeft.y}px`,this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}onSelectOver(){this.element.parentElement.removeChild(this.element)}}var Pl=r(31480);async function Fl(){if("Ammo"in window==!1)return void console.error("AmmoPhysics: Couldn't find Ammo.js");const e=await Ammo(),t=new e.btDefaultCollisionConfiguration,r=new e.btCollisionDispatcher(t),n=new e.btDbvtBroadphase,i=new e.btSequentialImpulseConstraintSolver,a=new e.btDiscreteDynamicsWorld(r,n,i,t);a.setGravity(new e.btVector3(0,-9.8,0));const s=new e.btTransform;const o=[],l=new WeakMap;let c=0;return setInterval((function(){const e=performance.now();if(c>0){const t=(e-c)/1e3;a.stepSimulation(t,10)}c=e;for(let t=0,r=o.length;t<r;t++){const e=o[t];if(e.isInstancedMesh){const t=e.instanceMatrix.array,r=l.get(e);for(let e=0;e<r.length;e++){r[e].getMotionState().getWorldTransform(s);Ll(s.getOrigin(),s.getRotation(),t,16*e)}e.instanceMatrix.needsUpdate=!0}else if(e.isMesh){l.get(e).getMotionState().getWorldTransform(s);const t=s.getOrigin(),r=s.getRotation();e.position.set(t.x(),t.y(),t.z()),e.quaternion.set(r.x(),r.y(),r.z(),r.w())}}}),1e3/60),{addMesh:function(t,r=0){const n=function(t){const r=t.parameters;if("BoxGeometry"===t.type){const t=void 0!==r.width?r.width/2:.5,n=void 0!==r.height?r.height/2:.5,i=void 0!==r.depth?r.depth/2:.5,a=new e.btBoxShape(new e.btVector3(t,n,i));return a.setMargin(.05),a}if("SphereGeometry"===t.type||"IcosahedronGeometry"===t.type){const t=void 0!==r.radius?r.radius:1,n=new e.btSphereShape(t);return n.setMargin(.05),n}return null}(t.geometry);null!==n&&(t.isInstancedMesh?function(t,r,n){const i=t.instanceMatrix.array,s=[];for(let o=0;o<t.count;o++){const t=16*o,l=new e.btTransform;l.setFromOpenGLMatrix(i.slice(t,t+16));const c=new e.btDefaultMotionState(l),u=new e.btVector3(0,0,0);n.calculateLocalInertia(r,u);const h=new e.btRigidBodyConstructionInfo(r,c,n,u),d=new e.btRigidBody(h);a.addRigidBody(d),s.push(d)}r>0&&(t.instanceMatrix.setUsage(35048),o.push(t),l.set(t,s))}(t,r,n):t.isMesh&&function(t,r,n){const i=t.position,s=t.quaternion,c=new e.btTransform;c.setIdentity(),c.setOrigin(new e.btVector3(i.x,i.y,i.z)),c.setRotation(new e.btQuaternion(s.x,s.y,s.z,s.w));const u=new e.btDefaultMotionState(c),h=new e.btVector3(0,0,0);n.calculateLocalInertia(r,h);const d=new e.btRigidBodyConstructionInfo(r,u,n,h),p=new e.btRigidBody(d);a.addRigidBody(p),r>0&&(o.push(t),l.set(t,p))}(t,r,n))},setMeshPosition:function(t,r,n=0){if(t.isInstancedMesh){const i=l.get(t)[n];i.setAngularVelocity(new e.btVector3(0,0,0)),i.setLinearVelocity(new e.btVector3(0,0,0)),s.setIdentity(),s.setOrigin(new e.btVector3(r.x,r.y,r.z)),i.setWorldTransform(s)}else if(t.isMesh){const n=l.get(t);n.setAngularVelocity(new e.btVector3(0,0,0)),n.setLinearVelocity(new e.btVector3(0,0,0)),s.setIdentity(),s.setOrigin(new e.btVector3(r.x,r.y,r.z)),n.setWorldTransform(s)}}}}function Ll(e,t,r,n){const i=t.x(),a=t.y(),s=t.z(),o=t.w(),l=i+i,c=a+a,u=s+s,h=i*l,d=i*c,p=i*u,f=a*c,m=a*u,g=s*u,v=o*l,A=o*c,y=o*u;r[n+0]=1-(f+g),r[n+1]=d+y,r[n+2]=p-A,r[n+3]=0,r[n+4]=d-y,r[n+5]=1-(h+g),r[n+6]=m+v,r[n+7]=0,r[n+8]=p+A,r[n+9]=m-v,r[n+10]=1-(h+f),r[n+11]=0,r[n+12]=e.x(),r[n+13]=e.y(),r[n+14]=e.z(),r[n+15]=1}class Dl{constructor(e){const t=new n.OrthographicCamera(-1,1,1,-1,0,1),r=new n.Scene,i=new n.StereoCamera,a={minFilter:n.LinearFilter,magFilter:n.NearestFilter,format:n.RGBAFormat},s=new n.WebGLRenderTarget(512,512,a),o=new n.WebGLRenderTarget(512,512,a),l=new n.ShaderMaterial({uniforms:{mapLeft:{value:s.texture},mapRight:{value:o.texture}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = vec2( uv.x, uv.y );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D mapLeft;","uniform sampler2D mapRight;","varying vec2 vUv;","void main() {","\tvec2 uv = vUv;","\tif ( ( mod( gl_FragCoord.y, 2.0 ) ) > 1.00 ) {","\t\tgl_FragColor = texture2D( mapLeft, uv );","\t} else {","\t\tgl_FragColor = texture2D( mapRight, uv );","\t}","\t#include <tonemapping_fragment>","\t#include <encodings_fragment>","}"].join("\n")}),c=new n.Mesh(new n.PlaneGeometry(2,2),l);r.add(c),this.setSize=function(t,r){e.setSize(t,r);const n=e.getPixelRatio();s.setSize(t*n,r*n),o.setSize(t*n,r*n)},this.render=function(n,a){!0===n.matrixWorldAutoUpdate&&n.updateMatrixWorld(),null===a.parent&&!0===a.matrixWorldAutoUpdate&&a.updateMatrixWorld(),i.update(a),e.setRenderTarget(s),e.clear(),e.render(n,i.cameraL),e.setRenderTarget(o),e.clear(),e.render(n,i.cameraR),e.setRenderTarget(null),e.render(r,t)}}}class Ul{constructor(e){const t=this;let r,i,a;t.cameraDistance=15,t.reflectFromAbove=!1;const s=new n.PerspectiveCamera,o=new n.PerspectiveCamera,l=new n.PerspectiveCamera,c=new n.PerspectiveCamera,u=new n.Vector3,h=new n.Quaternion,d=new n.Vector3;e.autoClear=!1,this.setSize=function(t,n){r=t/2,t<n?(i=t/3,a=t/3):(i=n/3,a=n/3),e.setSize(t,n)},this.render=function(n,p){!0===n.matrixWorldAutoUpdate&&n.updateMatrixWorld(),null===p.parent&&!0===p.matrixWorldAutoUpdate&&p.updateMatrixWorld(),p.matrixWorld.decompose(u,h,d),s.position.copy(u),s.quaternion.copy(h),s.translateZ(t.cameraDistance),s.lookAt(n.position),o.position.copy(u),o.quaternion.copy(h),o.translateZ(-t.cameraDistance),o.lookAt(n.position),o.rotation.z+=Math.PI/180*180,l.position.copy(u),l.quaternion.copy(h),l.translateX(-t.cameraDistance),l.lookAt(n.position),l.rotation.x+=Math.PI/180*90,c.position.copy(u),c.quaternion.copy(h),c.translateX(t.cameraDistance),c.lookAt(n.position),c.rotation.x+=Math.PI/180*90,e.clear(),e.setScissorTest(!0),e.setScissor(r-i/2,2*a,i,a),e.setViewport(r-i/2,2*a,i,a),t.reflectFromAbove?e.render(n,o):e.render(n,s),e.setScissor(r-i/2,0,i,a),e.setViewport(r-i/2,0,i,a),t.reflectFromAbove?e.render(n,s):e.render(n,o),e.setScissor(r-i/2-i,a,i,a),e.setViewport(r-i/2-i,a,i,a),t.reflectFromAbove?e.render(n,c):e.render(n,l),e.setScissor(r+i/2,a,i,a),e.setViewport(r+i/2,a,i,a),t.reflectFromAbove?e.render(n,l):e.render(n,c),e.setScissorTest(!1)}}}class Nl{constructor(e,t={}){this.enabled=!0;const r=void 0!==t.defaultThickness?t.defaultThickness:.003,i=(new n.Color).fromArray(void 0!==t.defaultColor?t.defaultColor:[0,0,0]),a=void 0!==t.defaultAlpha?t.defaultAlpha:1,s=void 0!==t.defaultKeepAlive&&t.defaultKeepAlive,o={},l={},c={},u={outlineThickness:{value:r},outlineColor:{value:i},outlineAlpha:{value:a}},h=["#include <common>","#include <uv_pars_vertex>","#include <displacementmap_pars_vertex>","#include <fog_pars_vertex>","#include <morphtarget_pars_vertex>","#include <skinning_pars_vertex>","#include <logdepthbuf_pars_vertex>","#include <clipping_planes_pars_vertex>","uniform float outlineThickness;","vec4 calculateOutline( vec4 pos, vec3 normal, vec4 skinned ) {","\tfloat thickness = outlineThickness;","\tconst float ratio = 1.0;","\tvec4 pos2 = projectionMatrix * modelViewMatrix * vec4( skinned.xyz + normal, 1.0 );","\tvec4 norm = normalize( pos - pos2 );","\treturn pos + norm * thickness * pos.w * ratio;","}","void main() {","\t#include <uv_vertex>","\t#include <beginnormal_vertex>","\t#include <morphnormal_vertex>","\t#include <skinbase_vertex>","\t#include <skinnormal_vertex>","\t#include <begin_vertex>","\t#include <morphtarget_vertex>","\t#include <skinning_vertex>","\t#include <displacementmap_vertex>","\t#include <project_vertex>","\tvec3 outlineNormal = - objectNormal;","\tgl_Position = calculateOutline( gl_Position, outlineNormal, vec4( transformed, 1.0 ) );","\t#include <logdepthbuf_vertex>","\t#include <clipping_planes_vertex>","\t#include <fog_vertex>","}"].join("\n"),d=["#include <common>","#include <fog_pars_fragment>","#include <logdepthbuf_pars_fragment>","#include <clipping_planes_pars_fragment>","uniform vec3 outlineColor;","uniform float outlineAlpha;","void main() {","\t#include <clipping_planes_fragment>","\t#include <logdepthbuf_fragment>","\tgl_FragColor = vec4( outlineColor, outlineAlpha );","\t#include <tonemapping_fragment>","\t#include <encodings_fragment>","\t#include <fog_fragment>","\t#include <premultiplied_alpha_fragment>","}"].join("\n");function p(e){const t=function(e){let t=o[e.uuid];return void 0===t&&(t={material:new n.ShaderMaterial({type:"OutlineEffect",uniforms:n.UniformsUtils.merge([n.UniformsLib.fog,n.UniformsLib.displacementmap,u]),vertexShader:h,fragmentShader:d,side:n.BackSide}),used:!0,keepAlive:s,count:0},o[e.uuid]=t),t.used=!0,t.material}(e);return l[t.uuid]=e,function(e,t){if("invisible"===e.name)return;const r=t.userData.outlineParameters;e.fog=t.fog,e.toneMapped=t.toneMapped,e.premultipliedAlpha=t.premultipliedAlpha,e.displacementMap=t.displacementMap,void 0!==r?(!1===t.visible?e.visible=!1:e.visible=void 0===r.visible||r.visible,e.transparent=void 0!==r.alpha&&r.alpha<1||t.transparent,void 0!==r.keepAlive&&(o[t.uuid].keepAlive=r.keepAlive)):(e.transparent=t.transparent,e.visible=t.visible);!0!==t.wireframe&&!1!==t.depthTest||(e.visible=!1);t.clippingPlanes&&(e.clipping=!0,e.clippingPlanes=t.clippingPlanes,e.clipIntersection=t.clipIntersection,e.clipShadows=t.clipShadows);e.version=t.version}(t,e),t}function f(e){const t=e.geometry,r=void 0!==t&&void 0!==t.attributes.normal;return!0===e.isMesh&&void 0!==e.material&&!0===r}function m(e){if(!1!==f(e)){if(Array.isArray(e.material))for(let t=0,r=e.material.length;t<r;t++)e.material[t]=p(e.material[t]);else e.material=p(e.material);c[e.uuid]=e.onBeforeRender,e.onBeforeRender=v}}function g(e){if(!1!==f(e)){if(Array.isArray(e.material))for(let t=0,r=e.material.length;t<r;t++)e.material[t]=l[e.material[t].uuid];else e.material=l[e.material.uuid];e.onBeforeRender=c[e.uuid]}}function v(e,t,r,n,i){const a=l[i.uuid];void 0!==a&&function(e,t){const r=t.userData.outlineParameters;e.uniforms.outlineAlpha.value=t.opacity,void 0!==r&&(void 0!==r.thickness&&(e.uniforms.outlineThickness.value=r.thickness),void 0!==r.color&&e.uniforms.outlineColor.value.fromArray(r.color),void 0!==r.alpha&&(e.uniforms.outlineAlpha.value=r.alpha));t.displacementMap&&(e.uniforms.displacementMap.value=t.displacementMap,e.uniforms.displacementScale.value=t.displacementScale,e.uniforms.displacementBias.value=t.displacementBias)}(i,a)}this.render=function(t,r){if(!1===this.enabled)return void e.render(t,r);const n=e.autoClear;e.autoClear=this.autoClear,e.render(t,r),e.autoClear=n,this.renderOutline(t,r)},this.renderOutline=function(t,r){const n=e.autoClear,i=t.matrixWorldAutoUpdate,a=t.background,s=e.shadowMap.enabled;t.matrixWorldAutoUpdate=!1,t.background=null,e.autoClear=!1,e.shadowMap.enabled=!1,t.traverse(m),e.render(t,r),t.traverse(g),function(){let e;e=Object.keys(l);for(let t=0,r=e.length;t<r;t++)l[e[t]]=void 0;e=Object.keys(c);for(let t=0,r=e.length;t<r;t++)c[e[t]]=void 0;e=Object.keys(o);for(let t=0,r=e.length;t<r;t++){const r=e[t];!1===o[r].used?(o[r].count++,!1===o[r].keepAlive&&o[r].count>60&&delete o[r]):(o[r].used=!1,o[r].count=0)}}(),t.matrixWorldAutoUpdate=i,t.background=a,e.autoClear=n,e.shadowMap.enabled=s},this.autoClear=e.autoClear,this.domElement=e.domElement,this.shadowMap=e.shadowMap,this.clear=function(t,r,n){e.clear(t,r,n)},this.getPixelRatio=function(){return e.getPixelRatio()},this.setPixelRatio=function(t){e.setPixelRatio(t)},this.getSize=function(t){return e.getSize(t)},this.setSize=function(t,r,n){e.setSize(t,r,n)},this.setViewport=function(t,r,n,i){e.setViewport(t,r,n,i)},this.setScissor=function(t,r,n,i){e.setScissor(t,r,n,i)},this.setScissorTest=function(t){e.setScissorTest(t)},this.setRenderTarget=function(t){e.setRenderTarget(t)}}}class kl{constructor(e,t=512,r=512){this.colorMatrixLeft=(new n.Matrix3).fromArray([.4561,-.0400822,-.0152161,.500484,-.0378246,-.0205971,.176381,-.0157589,-.00546856]),this.colorMatrixRight=(new n.Matrix3).fromArray([-.0434706,.378476,-.0721527,-.0879388,.73364,-.112961,-.00155529,-.0184503,1.2264]);const i=new n.OrthographicCamera(-1,1,1,-1,0,1),a=new n.Scene,s=new n.StereoCamera,o={minFilter:n.LinearFilter,magFilter:n.NearestFilter,format:n.RGBAFormat},l=new n.WebGLRenderTarget(t,r,o),c=new n.WebGLRenderTarget(t,r,o),u=new n.ShaderMaterial({uniforms:{mapLeft:{value:l.texture},mapRight:{value:c.texture},colorMatrixLeft:{value:this.colorMatrixLeft},colorMatrixRight:{value:this.colorMatrixRight}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = vec2( uv.x, uv.y );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D mapLeft;","uniform sampler2D mapRight;","varying vec2 vUv;","uniform mat3 colorMatrixLeft;","uniform mat3 colorMatrixRight;","void main() {","\tvec2 uv = vUv;","\tvec4 colorL = texture2D( mapLeft, uv );","\tvec4 colorR = texture2D( mapRight, uv );","\tvec3 color = clamp(","\t\t\tcolorMatrixLeft * colorL.rgb +","\t\t\tcolorMatrixRight * colorR.rgb, 0., 1. );","\tgl_FragColor = vec4(","\t\t\tcolor.r, color.g, color.b,","\t\t\tmax( colorL.a, colorR.a ) );","\t#include <tonemapping_fragment>","\t#include <encodings_fragment>","}"].join("\n")}),h=new n.Mesh(new n.PlaneGeometry(2,2),u);a.add(h),this.setSize=function(t,r){e.setSize(t,r);const n=e.getPixelRatio();l.setSize(t*n,r*n),c.setSize(t*n,r*n)},this.render=function(t,r){const n=e.getRenderTarget();!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===r.parent&&!0===r.matrixWorldAutoUpdate&&r.updateMatrixWorld(),s.update(r),e.setRenderTarget(l),e.clear(),e.render(t,s.cameraL),e.setRenderTarget(c),e.clear(),e.render(t,s.cameraR),e.setRenderTarget(null),e.render(a,i),e.setRenderTarget(n)},this.dispose=function(){l.dispose(),c.dispose(),h.geometry.dispose(),h.material.dispose()}}}class Ol{constructor(e,t=" .:-=+*#%@",r={}){const n=r.resolution||.15,i=r.scale||1,a=r.color||!1,s=r.alpha||!1,o=r.block||!1,l=r.invert||!1,c=r.strResolution||"low";let u,h;const d=document.createElement("div");d.style.cursor="default";const p=document.createElement("table");let f,m,g;d.appendChild(p),this.setSize=function(t,r){u=t,h=r,e.setSize(t,r),function(){f=Math.floor(u*n),m=Math.floor(h*n),b.width=f,b.height=m,g=e.domElement,g.style.backgroundColor&&(p.rows[0].cells[0].style.backgroundColor=g.style.backgroundColor,p.rows[0].cells[0].style.color=g.style.color);p.cellSpacing=0,p.cellPadding=0;const t=p.style;t.whiteSpace="pre",t.margin="0px",t.padding="0px",t.letterSpacing=_+"px",t.fontFamily=y,t.fontSize=S+"px",t.lineHeight=M+"px",t.textAlign="left",t.textDecoration="none"}()},this.render=function(t,r){e.render(t,r),function(e){w.clearRect(0,0,f,m),w.drawImage(x,0,0,f,m);const t=w.getImageData(0,0,f,m).data;let r="";for(let n=0;n<m;n+=2){for(let e=0;e<f;e++){const i=4*(n*f+e),c=t[i],u=t[i+1],h=t[i+2],d=t[i+3];let p,m;m=(.3*c+.59*u+.11*h)/255,0==d&&(m=1),p=Math.floor((1-m)*(E.length-1)),l&&(p=E.length-p-1);let g=E[p];void 0!==g&&" "!=g||(g="&nbsp;"),r+=a?"<span style='color:rgb("+c+","+u+","+h+");"+(o?"background-color:rgb("+c+","+u+","+h+");":"")+(s?"opacity:"+d/255+";":"")+"'>"+g+"</span>":g}r+="<br/>"}e.innerHTML=`<tr><td style="display:block;width:${u}px;height:${h}px;overflow:hidden">${r}</td></tr>`}(p)},this.domElement=d;const v=" .,:;i1tfLCG08@".split(""),A=" CGO08@".split(""),y="courier new, monospace",x=e.domElement,b=document.createElement("canvas");if(!b.getContext)return;const w=b.getContext("2d");if(!w.getImageData)return;let E=a?A:v;t&&(E=t);const S=2/n*i,M=2/n*i;let _=0;if("low"==c)switch(i){case 1:_=-1;break;case 2:case 3:_=-2.1;break;case 4:_=-3.1;break;case 5:_=-4.15}if("medium"==c)switch(i){case 1:_=0;break;case 2:_=-1;break;case 3:_=-1.04;break;case 4:case 5:_=-2.1}if("high"==c)switch(i){case 1:case 2:_=0;break;case 3:case 4:case 5:_=-1}}}class Gl{constructor(e){const t=new n.StereoCamera;t.aspect=.5;const r=new n.Vector2;this.setEyeSeparation=function(e){t.eyeSep=e},this.setSize=function(t,r){e.setSize(t,r)},this.render=function(n,i){!0===n.matrixWorldAutoUpdate&&n.updateMatrixWorld(),null===i.parent&&!0===i.matrixWorldAutoUpdate&&i.updateMatrixWorld(),t.update(i),e.getSize(r),e.autoClear&&e.clear(),e.setScissorTest(!0),e.setScissor(0,0,r.width/2,r.height),e.setViewport(0,0,r.width/2,r.height),e.render(n,t.cameraL),e.setScissor(r.width/2,0,r.width/2,r.height),e.setViewport(r.width/2,0,r.width/2,r.height),e.render(n,t.cameraR),e.setScissorTest(!1)}}}var zl=r(43953),Vl=Object.defineProperty,Hl=(e,t,r)=>(((e,t,r)=>{t in e?Vl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class Ql extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=new n.FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(e=>{if("string"!=typeof e)throw new Error("unsupported data type");const r=JSON.parse(e),n=this.parse(r);t&&t(n)}),r,i)}loadAsync(e,t){return super.loadAsync(e,t)}parse(e){return new jl(e)}}class jl{constructor(e){Hl(this,"data"),this.data=e}generateShapes(e,t=100,r){const n=[],i={letterSpacing:0,lineHeight:1,...r},a=function(e,t,r,n){const i=Array.from(e),a=t/r.resolution,s=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*a,o=[];let l=0,c=0;for(let u=0;u<i.length;u++){const e=i[u];if("\n"===e)l=0,c-=s*n.lineHeight;else{const t=Wl(e,a,l,c,r);t&&(l+=t.offsetX+n.letterSpacing,o.push(t.path))}}return o}(e,t,this.data,i);for(let s=0,o=a.length;s<o;s++)Array.prototype.push.apply(n,a[s].toShapes(!1));return n}}function Wl(e,t,r,i,a){const s=a.glyphs[e]||a.glyphs["?"];if(!s)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+a.familyName+".");const o=new n.ShapePath;let l,c,u,h,d,p,f,m;if(s.o){const e=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let n=0,a=e.length;n<a;){switch(e[n++]){case"m":l=parseInt(e[n++])*t+r,c=parseInt(e[n++])*t+i,o.moveTo(l,c);break;case"l":l=parseInt(e[n++])*t+r,c=parseInt(e[n++])*t+i,o.lineTo(l,c);break;case"q":u=parseInt(e[n++])*t+r,h=parseInt(e[n++])*t+i,d=parseInt(e[n++])*t+r,p=parseInt(e[n++])*t+i,o.quadraticCurveTo(d,p,u,h);break;case"b":u=parseInt(e[n++])*t+r,h=parseInt(e[n++])*t+i,d=parseInt(e[n++])*t+r,p=parseInt(e[n++])*t+i,f=parseInt(e[n++])*t+r,m=parseInt(e[n++])*t+i,o.bezierCurveTo(d,p,f,m,u,h)}}}return{offsetX:s.ha*t,path:o}}Hl(jl,"isFont"),Hl(jl,"type");class Xl extends n.DataTextureLoader{constructor(e){super(e)}parse(e){const t=0,r=1,i=2,a=3,s=9,o=10,l=11,c=48,u=4,h=0,d=1,p=2,f=3;e.length<19&&console.error("THREE.TGALoader: Not enough data to contain header.");let m=0;const g=new Uint8Array(e),v={id_length:g[m++],colormap_type:g[m++],image_type:g[m++],colormap_index:g[m++]|g[m++]<<8,colormap_length:g[m++]|g[m++]<<8,colormap_size:g[m++],origin:[g[m++]|g[m++]<<8,g[m++]|g[m++]<<8],width:g[m++]|g[m++]<<8,height:g[m++]|g[m++]<<8,pixel_size:g[m++],flags:g[m++]};!function(e){switch(e.image_type){case r:case s:(e.colormap_length>256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case i:case a:case o:case l:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(v),v.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=v.id_length;let A=!1,y=!1,x=!1;switch(v.image_type){case s:A=!0,y=!0;break;case r:y=!0;break;case o:A=!0;break;case i:break;case l:A=!0,x=!0;break;case a:x=!0}const b=new Uint8Array(v.width*v.height*4),w=function(e,t,r,n,i){let a,s;const o=r.pixel_size>>3,l=r.width*r.height*o;if(t&&(s=i.subarray(n,n+=r.colormap_length*(r.colormap_size>>3))),e){let e,t,r;a=new Uint8Array(l);let s=0;const c=new Uint8Array(o);for(;s<l;)if(e=i[n++],t=1+(127&e),128&e){for(r=0;r<o;++r)c[r]=i[n++];for(r=0;r<t;++r)a.set(c,s+r*o);s+=o*t}else{for(t*=o,r=0;r<t;++r)a[s+r]=i[n++];s+=t}}else a=i.subarray(n,n+=t?r.width*r.height:l);return{pixel_data:a,palettes:s}}(A,y,v,m,g);return function(e,t,r,n,i){let a,s,o,l,m,g;switch((v.flags&c)>>u){default:case p:a=0,o=1,m=t,s=0,l=1,g=r;break;case h:a=0,o=1,m=t,s=r-1,l=-1,g=-1;break;case f:a=t-1,o=-1,m=-1,s=0,l=1,g=r;break;case d:a=t-1,o=-1,m=-1,s=r-1,l=-1,g=-1}if(x)switch(v.pixel_size){case 8:!function(e,t,r,n,i,a,s,o){let l,c,u,h=0;const d=v.width;for(u=t;u!==n;u+=r)for(c=i;c!==s;c+=a,h++)l=o[h],e[4*(c+d*u)+0]=l,e[4*(c+d*u)+1]=l,e[4*(c+d*u)+2]=l,e[4*(c+d*u)+3]=255}(e,s,l,g,a,o,m,n);break;case 16:!function(e,t,r,n,i,a,s,o){let l,c,u=0;const h=v.width;for(c=t;c!==n;c+=r)for(l=i;l!==s;l+=a,u+=2)e[4*(l+h*c)+0]=o[u+0],e[4*(l+h*c)+1]=o[u+0],e[4*(l+h*c)+2]=o[u+0],e[4*(l+h*c)+3]=o[u+1]}(e,s,l,g,a,o,m,n);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(v.pixel_size){case 8:!function(e,t,r,n,i,a,s,o,l){const c=l;let u,h,d,p=0;const f=v.width;for(d=t;d!==n;d+=r)for(h=i;h!==s;h+=a,p++)u=o[p],e[4*(h+f*d)+3]=255,e[4*(h+f*d)+2]=c[3*u+0],e[4*(h+f*d)+1]=c[3*u+1],e[4*(h+f*d)+0]=c[3*u+2]}(e,s,l,g,a,o,m,n,i);break;case 16:!function(e,t,r,n,i,a,s,o){let l,c,u,h=0;const d=v.width;for(u=t;u!==n;u+=r)for(c=i;c!==s;c+=a,h+=2)l=o[h+0]+(o[h+1]<<8),e[4*(c+d*u)+0]=(31744&l)>>7,e[4*(c+d*u)+1]=(992&l)>>2,e[4*(c+d*u)+2]=(31&l)>>3,e[4*(c+d*u)+3]=32768&l?0:255}(e,s,l,g,a,o,m,n);break;case 24:!function(e,t,r,n,i,a,s,o){let l,c,u=0;const h=v.width;for(c=t;c!==n;c+=r)for(l=i;l!==s;l+=a,u+=3)e[4*(l+h*c)+3]=255,e[4*(l+h*c)+2]=o[u+0],e[4*(l+h*c)+1]=o[u+1],e[4*(l+h*c)+0]=o[u+2]}(e,s,l,g,a,o,m,n);break;case 32:!function(e,t,r,n,i,a,s,o){let l,c,u=0;const h=v.width;for(c=t;c!==n;c+=r)for(l=i;l!==s;l+=a,u+=4)e[4*(l+h*c)+2]=o[u+0],e[4*(l+h*c)+1]=o[u+1],e[4*(l+h*c)+0]=o[u+2],e[4*(l+h*c)+3]=o[u+3]}(e,s,l,g,a,o,m,n);break;default:console.error("THREE.TGALoader: Format not supported.")}}(b,v.width,v.height,w.pixel_data,w.palettes),{data:b,width:v.width,height:v.height,flipY:!0,generateMipmaps:!0,minFilter:n.LinearMipmapLinearFilter}}}var Yl=r(81111);class ql extends n.Loader{load(e,t,r,i){const a=new n.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("text"),a.load(e,(r=>{try{t(this.parse(r))}catch(n){i?i(n):console.error(n),this.manager.itemError(e)}}),r,i)}parse(e){e=e.replace(/^#.*?(\n|\r)/gm,"").replace(/^\s*?(\n|\r)/gm,"").trim();let t=null,r=null;const i=new n.Vector3(0,0,0),a=new n.Vector3(1,1,1),s=e.split(/[\n\r]+/g);let o=null,l=0;for(let n=0,h=s.length;n<h;n++){const e=s[n].trim(),c=e.split(/\s/g);switch(c[0]){case"TITLE":t=e.substring(7,e.length-1);break;case"LUT_3D_SIZE":const n=c[1];r=parseFloat(n),o=new Uint8Array(r*r*r*4);break;case"DOMAIN_MIN":i.x=parseFloat(c[1]),i.y=parseFloat(c[2]),i.z=parseFloat(c[3]);break;case"DOMAIN_MAX":a.x=parseFloat(c[1]),a.y=parseFloat(c[2]),a.z=parseFloat(c[3]);break;default:const s=parseFloat(c[0]),u=parseFloat(c[1]),h=parseFloat(c[2]);if(s>1||s<0||u>1||u<0||h>1||h<0)throw new Error("LUTCubeLoader : Non normalized values not supported.");o[l+0]=255*s,o[l+1]=255*u,o[l+2]=255*h,o[l+3]=255,l+=4}}const c=new n.DataTexture;c.image.data=o,c.image.width=r,c.image.height=r*r,c.type=n.UnsignedByteType,c.magFilter=n.LinearFilter,c.minFilter=n.LinearFilter,c.wrapS=n.ClampToEdgeWrapping,c.wrapT=n.ClampToEdgeWrapping,c.generateMipmaps=!1,c.needsUpdate=!0;const u=new Yl.J;return u.image.data=o,u.image.width=r,u.image.height=r,u.image.depth=r,u.type=n.UnsignedByteType,u.magFilter=n.LinearFilter,u.minFilter=n.LinearFilter,u.wrapS=n.ClampToEdgeWrapping,u.wrapT=n.ClampToEdgeWrapping,u.wrapR=n.ClampToEdgeWrapping,u.generateMipmaps=!1,u.needsUpdate=!0,{title:t,size:r,domainMin:i,domainMax:a,texture:c,texture3D:u}}}class Kl extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=this,s=new n.FileLoader(a.manager);s.setPath(a.path),s.setResponseType("arraybuffer"),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){let t=e,r=0;const i=new Int8Array(new Int16Array([1]).buffer)[0]>0,a={};const s=function(e,n){null==n&&(n=1);let a=1,s=Uint8Array;switch(e){case"uchar":break;case"schar":s=Int8Array;break;case"ushort":s=Uint16Array,a=2;break;case"sshort":s=Int16Array,a=2;break;case"uint":s=Uint32Array,a=4;break;case"sint":s=Int32Array,a=4;break;case"float":s=Float32Array,a=4;break;case"complex":case"double":s=Float64Array,a=8}let o=new s(t.slice(r,r+=n*a));return true!=i&&(o=function(e,t){const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(let n=0;n<e.byteLength;n+=t)for(let e=n+t-1,i=n;e>i;e--,i++){const t=r[i];r[i]=r[e],r[e]=t}return e}(o,a)),1==n?o[0]:o}("uchar",e.byteLength),o=s.length;let l,c=null,u=0;for(l=1;l<o;l++)if(10==s[l-1]&&10==s[l]){c=this.parseChars(s,0,l-2),u=l+1;break}if(function(e){let t,r,i,s,o,l,c,u;const h=e.split(/\r?\n/);for(c=0,u=h.length;c<u;c++)o=h[c],o.match(/NRRD\d+/)?a.isNrrd=!0:o.match(/^#/)||(l=o.match(/(.*):(.*)/))&&(r=l[1].trim(),t=l[2].trim(),i=Jl[r],i?i.call(a,t):a[r]=t);if(!a.isNrrd)throw new Error("Not an NRRD file");if("bz2"===a.encoding||"bzip2"===a.encoding)throw new Error("Bzip is not supported");if(!a.vectors&&(a.vectors=[new n.Vector3(1,0,0),new n.Vector3(0,1,0),new n.Vector3(0,0,1)],a.spacings))for(s=0;s<=2;s++)isNaN(a.spacings[s])||a.vectors[s].multiplyScalar(a.spacings[s])}(c),t=s.subarray(u),"gz"===a.encoding.substring(0,2))t=(0,Lt._Z)(new Uint8Array(t));else if("ascii"===a.encoding||"text"===a.encoding||"txt"===a.encoding||"hex"===a.encoding)t=function(e,t,r){let n,i="";t=t||0,r=r||e.length;const s=a.sizes.reduce((function(e,t){return e*t}),1);let o=10;"hex"===a.encoding&&(o=16);const l=new a.__array(s);let c=0,u=parseInt;a.__array!==Float32Array&&a.__array!==Float64Array||(u=parseFloat);for(let a=t;a<r;a++)n=e[a],(n<9||n>13)&&32!==n?i+=String.fromCharCode(n):(""!==i&&(l[c]=u(i,o),c++),i="");return""!==i&&(l[c]=u(i,o),c++),l}(t);else if("raw"===a.encoding){const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t[r];t=e}t=t.buffer;const h=new K;h.header=a,h.data=new a.__array(t);const d=h.computeMinMax(),p=d[0],f=d[1];h.windowLow=p,h.windowHigh=f,h.dimensions=[a.sizes[0],a.sizes[1],a.sizes[2]],h.xLength=h.dimensions[0],h.yLength=h.dimensions[1],h.zLength=h.dimensions[2];const m=new n.Vector3(a.vectors[0][0],a.vectors[0][1],a.vectors[0][2]).length(),g=new n.Vector3(a.vectors[1][0],a.vectors[1][1],a.vectors[1][2]).length(),v=new n.Vector3(a.vectors[2][0],a.vectors[2][1],a.vectors[2][2]).length();h.spacing=[m,g,v],h.matrix=new n.Matrix4;let A=1,y=1;if("left-posterior-superior"==a.space?(A=-1,y=-1):"left-anterior-superior"===a.space&&(A=-1),a.vectors){const e=a.vectors;h.matrix.set(A*e[0][0],A*e[1][0],A*e[2][0],0,y*e[0][1],y*e[1][1],y*e[2][1],0,1*e[0][2],1*e[1][2],1*e[2][2],0,0,0,0,1)}else h.matrix.set(A,0,0,0,0,y,0,0,0,0,1,0,0,0,0,1);return h.inverseMatrix=new n.Matrix4,h.inverseMatrix.copy(h.matrix).invert(),h.RASDimensions=new n.Vector3(h.xLength,h.yLength,h.zLength).applyMatrix4(h.matrix).round().toArray().map(Math.abs),h.lowerThreshold===-1/0&&(h.lowerThreshold=p),h.upperThreshold===1/0&&(h.upperThreshold=f),h}parseChars(e,t,r){void 0===t&&(t=0),void 0===r&&(r=e.length);let n="",i=0;for(i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}}const Jl={type:function(e){switch(e){case"uchar":case"unsigned char":case"uint8":case"uint8_t":this.__array=Uint8Array;break;case"signed char":case"int8":case"int8_t":this.__array=Int8Array;break;case"short":case"short int":case"signed short":case"signed short int":case"int16":case"int16_t":this.__array=Int16Array;break;case"ushort":case"unsigned short":case"unsigned short int":case"uint16":case"uint16_t":this.__array=Uint16Array;break;case"int":case"signed int":case"int32":case"int32_t":this.__array=Int32Array;break;case"uint":case"unsigned int":case"uint32":case"uint32_t":this.__array=Uint32Array;break;case"float":this.__array=Float32Array;break;case"double":this.__array=Float64Array;break;default:throw new Error("Unsupported NRRD data type: "+e)}return this.type=e},endian:function(e){return this.endian=e},encoding:function(e){return this.encoding=e},dimension:function(e){return this.dim=parseInt(e,10)},sizes:function(e){let t;return this.sizes=function(){const r=e.split(/\s+/),n=[];for(let e=0,i=r.length;e<i;e++)t=r[e],n.push(parseInt(t,10));return n}()},space:function(e){return this.space=e},"space origin":function(e){return this.space_origin=e.split("(")[1].split(")")[0].split(",")},"space directions":function(e){let t,r;const n=e.match(/\(.*?\)/g);return this.vectors=function(){const e=[];for(let i=0,a=n.length;i<a;i++)r=n[i],e.push(function(){const e=r.slice(1,-1).split(/,/),n=[];for(let r=0,i=e.length;r<i;r++)t=e[r],n.push(parseFloat(t));return n}());return e}()},spacings:function(e){let t;const r=e.split(/\s+/);return this.spacings=function(){const e=[];for(let n=0,i=r.length;n<i;n++)t=r[n],e.push(parseFloat(t));return e}()}};class Zl extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=this,s=new n.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){function t(e,t,r){for(let n=0,i=e.length;n<i;n++)if(e[n]!==t.getUint8(r+n,!1))return!1;return!0}const r=function(e){if("string"==typeof e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=255&e.charCodeAt(r);return t.buffer||t}return e}(e);return function(e){const r=new DataView(e);if(84+50*r.getUint32(80,!0)===r.byteLength)return!0;const n=[115,111,108,105,100];for(let i=0;i<5;i++)if(t(n,r,i))return!1;return!0}(r)?function(e){const t=new DataView(e),r=t.getUint32(80,!0);let i,a,s,o,l,c,u,h,d=!1;for(let n=0;n<70;n++)1129270351==t.getUint32(n,!1)&&82==t.getUint8(n+4)&&61==t.getUint8(n+5)&&(d=!0,o=new Float32Array(3*r*3),l=t.getUint8(n+6)/255,c=t.getUint8(n+7)/255,u=t.getUint8(n+8)/255,h=t.getUint8(n+9)/255);const p=new n.BufferGeometry,f=new Float32Array(3*r*3),m=new Float32Array(3*r*3);for(let n=0;n<r;n++){const e=84+50*n,r=t.getFloat32(e,!0),h=t.getFloat32(e+4,!0),p=t.getFloat32(e+8,!0);if(d){const r=t.getUint16(e+48,!0);0==(32768&r)?(i=(31&r)/31,a=(r>>5&31)/31,s=(r>>10&31)/31):(i=l,a=c,s=u)}for(let l=1;l<=3;l++){const c=e+12*l,u=3*n*3+3*(l-1);f[u]=t.getFloat32(c,!0),f[u+1]=t.getFloat32(c+4,!0),f[u+2]=t.getFloat32(c+8,!0),m[u]=r,m[u+1]=h,m[u+2]=p,d&&(o[u]=i,o[u+1]=a,o[u+2]=s)}}return p.setAttribute("position",new n.BufferAttribute(f,3)),p.setAttribute("normal",new n.BufferAttribute(m,3)),d&&(p.setAttribute("color",new n.BufferAttribute(o,3)),p.hasColors=!0,p.alpha=h),p}(r):function(e){const t=new n.BufferGeometry,r=/solid([\s\S]*?)endsolid/g,i=/facet([\s\S]*?)endfacet/g;let a=0;const s=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,o=new RegExp("vertex"+s+s+s,"g"),l=new RegExp("normal"+s+s+s,"g"),c=[],u=[],h=new n.Vector3;let d,p=0,f=0,m=0;for(;null!==(d=r.exec(e));){f=m;const e=d[0];for(;null!==(d=i.exec(e));){let e=0,t=0;const r=d[0];for(;null!==(d=l.exec(r));)h.x=parseFloat(d[1]),h.y=parseFloat(d[2]),h.z=parseFloat(d[3]),t++;for(;null!==(d=o.exec(r));)c.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])),u.push(h.x,h.y,h.z),e++,m++;1!==t&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+a),3!==e&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+a),a++}const r=f,n=m-f;t.addGroup(r,n,p),p++}return t.setAttribute("position",new n.Float32BufferAttribute(c,3)),t.setAttribute("normal",new n.Float32BufferAttribute(u,3)),t}("string"!=typeof(i=e)?n.LoaderUtils.decodeText(new Uint8Array(i)):i);var i}}class $l extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=this,s=""===this.path?n.LoaderUtils.extractUrlBase(e):this.path,o=new n.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(r){try{t(a.parse(r,s))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const r=e.split("\n");let n={};const i=/\s+/,a={};for(let o=0;o<r.length;o++){let e=r[o];if(e=e.trim(),0===e.length||"#"===e.charAt(0))continue;const t=e.indexOf(" ");let s=t>=0?e.substring(0,t):e;s=s.toLowerCase();let l=t>=0?e.substring(t+1):"";if(l=l.trim(),"newmtl"===s)n={name:l},a[l]=n;else if("ka"===s||"kd"===s||"ks"===s||"ke"===s){const e=l.split(i,3);n[s]=[parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2])]}else n[s]=l}const s=new ec(this.resourcePath||t,this.materialOptions);return s.setCrossOrigin(this.crossOrigin),s.setManager(this.manager),s.setMaterials(a),s}}class ec{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=void 0!==this.options.side?this.options.side:n.FrontSide,this.wrap=void 0!==this.options.wrap?this.options.wrap:n.RepeatWrapping}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const r in e){const n=e[r],i={};t[r]=i;for(const e in n){let t=!0,r=n[e];const a=e.toLowerCase();switch(a){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(r=[r[0]/255,r[1]/255,r[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===r[0]&&0===r[1]&&0===r[2]&&(t=!1)}t&&(i[a]=r)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,r=this.materialsInfo[e],i={name:e,side:this.side};function a(e,r){if(i[e])return;const n=t.getTextureParams(r,i),a=t.loadTexture((s=t.baseUrl,"string"!=typeof(o=n.url)||""===o?"":/^https?:\/\//i.test(o)?o:s+o));var s,o;a.repeat.copy(n.scale),a.offset.copy(n.offset),a.wrapS=t.wrap,a.wrapT=t.wrap,i[e]=a}for(const s in r){const e=r[s];let t;if(""!==e)switch(s.toLowerCase()){case"kd":i.color=(new n.Color).fromArray(e);break;case"ks":i.specular=(new n.Color).fromArray(e);break;case"ke":i.emissive=(new n.Color).fromArray(e);break;case"map_kd":a("map",e);break;case"map_ks":a("specularMap",e);break;case"map_ke":a("emissiveMap",e);break;case"norm":a("normalMap",e);break;case"map_bump":case"bump":a("bumpMap",e);break;case"map_d":a("alphaMap",e),i.transparent=!0;break;case"ns":i.shininess=parseFloat(e);break;case"d":t=parseFloat(e),t<1&&(i.opacity=t,i.transparent=!0);break;case"tr":t=parseFloat(e),this.options&&this.options.invertTrProperty&&(t=1-t),t>0&&(i.opacity=1-t,i.transparent=!0)}}return this.materials[e]=new n.MeshPhongMaterial(i),this.materials[e]}getTextureParams(e,t){const r={scale:new n.Vector2(1,1),offset:new n.Vector2(0,0)},i=e.split(/\s+/);let a;return a=i.indexOf("-bm"),a>=0&&(t.bumpScale=parseFloat(i[a+1]),i.splice(a,2)),a=i.indexOf("-s"),a>=0&&(r.scale.set(parseFloat(i[a+1]),parseFloat(i[a+2])),i.splice(a,4)),a=i.indexOf("-o"),a>=0&&(r.offset.set(parseFloat(i[a+1]),parseFloat(i[a+2])),i.splice(a,4)),r.url=i.join(" ").trim(),r}loadTexture(e,t,r,i,a){const s=void 0!==this.manager?this.manager:n.DefaultLoadingManager;let o=s.getHandler(e);null===o&&(o=new n.TextureLoader(s)),o.setCrossOrigin&&o.setCrossOrigin(this.crossOrigin);const l=o.load(e,r,i,a);return void 0!==t&&(l.mapping=t),l}}var tc=function(){var e=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t=function(){function e(e,t){for(let n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),r=function t(){e(this,t),this.boneName="",this.BoneIndex=0,this.Indeces=[],this.Weights=[],this.initMatrix=null,this.OffsetMatrix=null},a=function t(){e(this,t),this.animeName="",this.boneName="",this.targetBone=null,this.keyType=4,this.frameStartLv=0,this.keyFrames=[],this.InverseMx=null},s=function(){function r(t){e(this,r),this.fps=30,this.name="xanimation",this.length=0,this.hierarchy=[],this.putFlags=t,void 0===this.putFlags.putPos&&(this.putFlags.putPos=!0),void 0===this.putFlags.putRot&&(this.putFlags.putRot=!0),void 0===this.putFlags.putScl&&(this.putFlags.putScl=!0)}return t(r,[{key:"make",value:function(e){for(let t=0;t<e.length;t++)this.hierarchy.push(this.makeBonekeys(e[t]));this.length=this.hierarchy[0].keys[this.hierarchy[0].keys.length-1].time}},{key:"clone",value:function(){return Object.assign({},this)}},{key:"makeBonekeys",value:function(e){var t={};return t.name=e.boneName,t.parent="",t.keys=this.keyFrameRefactor(e),t.copy=function(){return Object.assign({},this)},t}},{key:"keyFrameRefactor",value:function(e){var t=[];for(let i=0;i<e.keyFrames.length;i++){var r={};r.time=e.keyFrames[i].time*this.fps,e.keyFrames[i].pos&&this.putFlags.putPos&&(r.pos=e.keyFrames[i].pos),e.keyFrames[i].rot&&this.putFlags.putRot&&(r.rot=e.keyFrames[i].rot),e.keyFrames[i].scl&&this.putFlags.putScl&&(r.scl=e.keyFrames[i].scl),e.keyFrames[i].matrix&&(r.matrix=e.keyFrames[i].matrix,this.putFlags.putPos&&(r.pos=(new n.Vector3).setFromMatrixPosition(r.matrix)),this.putFlags.putRot&&(r.rot=(new n.Quaternion).setFromRotationMatrix(r.matrix)),this.putFlags.putScl&&(r.scl=(new n.Vector3).setFromMatrixScale(r.matrix))),t.push(r)}return t}}]),r}(),o=function t(){e(this,t),this.index=0,this.Frame=0,this.time=0,this.matrix=null},l=function(){function l(t){n.Loader.call(this,t),e(this,l),this.debug=!1,this.texloader=new n.TextureLoader(this.manager),this.url="",this._putMatLength=0,this._nowMat=null,this._nowFrameName="",this.frameHierarchie=[],this.Hierarchies={},this.HieStack=[],this._currentObject={},this._currentFrame={},this._data=null,this.onLoad=null,this.IsUvYReverse=!0,this.Meshes=[],this.animations=[],this.animTicksPerSecond=30,this._currentGeo=null,this._currentAnime=null,this._currentAnimeFrames=null}return t(l,[{key:"_setArgOption",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e){for(let r=t;r<e.length;r++)switch(r){case 0:this.url=e[r];break;case 1:this.options=e[r]}void 0===this.options&&(this.options={})}}},{key:"load",value:function(e,t,r,i){var a=this;this._setArgOption(e);var s=new n.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(this.url,(function(e){try{a.parse(e,t)}catch(r){i?i(r):console.error(r),a.manager.itemError(a.url)}}),r,i)}},{key:"_readLine",value:function(e){for(var t=0;;){var r=-1;if(-1===(r=e.indexOf("//",t))&&(r=e.indexOf("#",t)),!(r>-1&&r<2))break;var n=-1;t=(n=e.indexOf("\r\n",t))>0?n+2:(n=e.indexOf("\r",t))>0?n+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_readLine",value:function(e){for(var t=0;;){var r=-1;if(-1===(r=e.indexOf("//",t))&&(r=e.indexOf("#",t)),!(r>-1&&r<2))break;var n=-1;t=(n=e.indexOf("\r\n",t))>0?n+2:(n=e.indexOf("\r",t))>0?n+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_isBinary",value:function(e){var t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;var r=t.byteLength;for(let n=0;n<r;n++)if(t.getUint8(n,!1)>127)return!0;return!1}},{key:"_ensureBinary",value:function(e){if("string"==typeof e){var t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=255&e.charCodeAt(r);return t.buffer||t}return e}},{key:"_ensureString",value:function(e){return"string"!=typeof e?n.LoaderUtils.decodeText(new Uint8Array(e)):e}},{key:"parse",value:function(e,t){var r=this._ensureBinary(e);return this._data=this._ensureString(e),this.onLoad=t,this._isBinary(r)?this._parseBinary(r):this._parseASCII()}},{key:"_parseBinary",value:function(e){return this._parseASCII(n.LoaderUtils.decodeText(new Uint8Array(e)))}},{key:"_parseASCII",value:function(){var e;e=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:n.LoaderUtils.extractUrlBase(this.url),this.texloader.setPath(e).setCrossOrigin(this.crossOrigin);this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,16),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this._mainloop()}},{key:"_hierarchieParse",value:function(e,t){for(var r=t;;){var n=this._data.indexOf("{",r)+1,i=this._data.indexOf("}",r),a=this._data.indexOf("{",n)+1;if(!(n>0&&i>n)){r=-1===n?this._data.length:i+1;break}var s={children:[]},o=this._readLine(this._data.substr(r,n-r-1)).trim(),l=o.split(/ /g);if(l.length>0?(s.type=l[0],l.length>=2?s.name=l[1]:s.name=l[0]+this.Hierarchies.children.length):(s.name=o,s.type=""),"Animation"===s.type){s.data=this._data.substr(a,i-a).trim();var c=this._hierarchieParse(s,i+1);r=c.end,s.children=c.parent.children}else{var u=this._data.lastIndexOf(";",a>0?Math.min(a,i):i);if(s.data=this._data.substr(n,u-n).trim(),a<=0||i<a)r=i+1;else{var h=Math.max(u+1,n),d=this._hierarchieParse(s,h);r=d.end,s.children=d.parent.children}}s.parent=e,"template"!=s.type&&e.children.push(s)}return{parent:e,end:r}}},{key:"_mainloop",value:function(){var e=this;this._mainProc(),this._currentObject.parent||this._currentObject.children.length>0||!this._currentObject.worked?setTimeout((function(){e._mainloop()}),1):setTimeout((function(){e.onLoad({models:e.Meshes,animations:e.animations})}),1)}},{key:"_mainProc",value:function(){for(var e=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":case"VertexDuplicationIndices":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.GeometryData={vertices:[],normals:[],uvs:[],skinIndices:[],skinWeights:[],indices:[],materialIndices:[]},this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),e=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new a,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),e=!0}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),e)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:e=!0,e)break}}},{key:"_changeRoot",value:function(){null!=this._currentGeo&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},null!=this._currentAnime&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(e){return e.parent?e.parent.name?e.parent.name:this._getParentName(e.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new n.Matrix4;var e=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,e),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var e=new n.Bone;if(e.name=this._currentFrame.name,e.applyMatrix4(this._currentFrame.FrameTransformMatrix),e.matrixWorld=e.matrix,e.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=e,this._currentFrame.parentName)for(let e in this.HieStack)this.HieStack[e].name===this._currentFrame.parentName&&this.HieStack[e].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var e=0,t=0,r=0,n=0;;){var i=!1;if(0===r){e=this._readInt1(e).endRead,r=1,(n=this._currentObject.data.indexOf(";;",e)+1)<=0&&(n=this._currentObject.data.length)}else{var a=0;switch(t){case 0:a=this._currentObject.data.indexOf(",",e)+1;break;case 1:a=this._currentObject.data.indexOf(";,",e)+1}switch((0===a||a>n)&&(a=n,r=0,i=!0),this._currentObject.type){case"Mesh":switch(t){case 0:this._readVertex1(this._currentObject.data.substr(e,a-e));break;case 1:this._readFace1(this._currentObject.data.substr(e,a-e))}break;case"MeshNormals":if(0===t)this._readNormalVector1(this._currentObject.data.substr(e,a-e))}e=a+1,i&&t++}if(e>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(e){var t=this._currentObject.data.indexOf(";",e);return{refI:parseInt(this._currentObject.data.substr(e,t-e)),endRead:t+1}}},{key:"_readVertex1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.GeometryData.vertices.push(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])),this._currentGeo.GeometryData.skinIndices.push(0,0,0,0),this._currentGeo.GeometryData.skinWeights.push(1,0,0,0),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(e){var t=this._readLine(e.trim()).substr(2,e.length-4).split(",");this._currentGeo.GeometryData.indices.push(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}},{key:"_readNormalVector1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.GeometryData.normals.push(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))}},{key:"_buildGeometry",value:function(){var e=new n.BufferGeometry,t=[],r=[],i=[],a=[],s=[],o=this._currentGeo.GeometryData;for(let n=0,h=o.indices.length;n<h;n++){var l=2*o.indices[n],c=3*o.indices[n],u=4*o.indices[n];t.push(o.vertices[c],o.vertices[c+1],o.vertices[c+2]),r.push(o.normals[c],o.normals[c+1],o.normals[c+2]),a.push(o.skinIndices[u],o.skinIndices[u+1],o.skinIndices[u+2],o.skinIndices[u+3]),s.push(o.skinWeights[u],o.skinWeights[u+1],o.skinWeights[u+2],o.skinWeights[u+3]),i.push(o.uvs[l],o.uvs[l+1])}return e.setAttribute("position",new n.Float32BufferAttribute(t,3)),e.setAttribute("normal",new n.Float32BufferAttribute(r,3)),e.setAttribute("uv",new n.Float32BufferAttribute(i,2)),e.setAttribute("skinIndex",new n.Uint16BufferAttribute(a,4)),e.setAttribute("skinWeight",new n.Float32BufferAttribute(s,4)),this._computeGroups(e,o.materialIndices),e}},{key:"_computeGroups",value:function(e,t){var r,n=[],a=void 0;for(let i=0;i<t.length;i++){var s=t[i];s!==a&&(a=s,void 0!==r&&(r.count=3*i-r.start,n.push(r)),r={start:3*i,materialIndex:a})}void 0!==r&&(r.count=3*i-r.start,n.push(r)),e.groups=n}},{key:"_setMeshTextureCoords",value:function(){for(var e=0,t=0,r=0;;){if(0===t)if(0===r){e=this._readInt1(0).endRead,r=1}else{var n=this._currentObject.data.indexOf(",",e)+1;0===n&&(n=this._currentObject.data.length,t=2,r=0);var i=this._currentObject.data.substr(e,n-e),a=this._readLine(i.trim()).split(";");this.IsUvYReverse?this._currentGeo.GeometryData.uvs.push(parseFloat(a[0]),1-parseFloat(a[1])):this._currentGeo.GeometryData.uvs.push(parseFloat(a[0]),parseFloat(a[1])),e=n+1}if(e>=this._currentObject.data.length)break}}},{key:"_setMeshMaterialList",value:function(){for(var e=0,t=0,r=0;;){if(r<2){e=this._readInt1(e).endRead,r++}else{var n=this._currentObject.data.indexOf(";",e);-1===n&&(n=this._currentObject.data.length,t=3,r=0);var i=this._currentObject.data.substr(e,n-e),a=this._readLine(i.trim()).split(",");for(let e=0;e<a.length;e++)this._currentGeo.GeometryData.materialIndices[e]=parseInt(a[e]);e=this._currentObject.data.length}if(e>=this._currentObject.data.length||t>=3)break}}},{key:"_setMaterial",value:function(){var e=new n.MeshPhongMaterial({color:16777215*Math.random()});e.side=n.FrontSide,e.name=this._currentObject.name;var t=0,r=this._currentObject.data.indexOf(";;",t),i=this._currentObject.data.substr(t,r-t),a=this._readLine(i.trim()).split(";");e.color.r=parseFloat(a[0]),e.color.g=parseFloat(a[1]),e.color.b=parseFloat(a[2]),t=r+2,r=this._currentObject.data.indexOf(";",t),i=this._currentObject.data.substr(t,r-t),e.shininess=parseFloat(this._readLine(i)),t=r+1,r=this._currentObject.data.indexOf(";;",t),i=this._currentObject.data.substr(t,r-t);var s=this._readLine(i.trim()).split(";");e.specular.r=parseFloat(s[0]),e.specular.g=parseFloat(s[1]),e.specular.b=parseFloat(s[2]),t=r+2,-1===(r=this._currentObject.data.indexOf(";;",t))&&(r=this._currentObject.data.length),i=this._currentObject.data.substr(t,r-t);var o=this._readLine(i.trim()).split(";");e.emissive.r=parseFloat(o[0]),e.emissive.g=parseFloat(o[1]),e.emissive.b=parseFloat(o[2]);for(var l=null;this._currentObject.children.length>0;){l=this._currentObject.children.shift(),this.debug&&console.log("processing "+l.name);var c=l.data.substr(1,l.data.length-2);switch(l.type){case"TextureFilename":e.map=this.texloader.load(c);break;case"BumpMapFilename":e.bumpMap=this.texloader.load(c),e.bumpScale=.05;break;case"NormalMapFilename":e.normalMap=this.texloader.load(c),e.normalScale=new n.Vector2(2,2);break;case"EmissiveMapFilename":e.emissiveMap=this.texloader.load(c);break;case"LightMapFilename":e.lightMap=this.texloader.load(c)}}this._currentGeo.Materials.push(e)}},{key:"_setSkinWeights",value:function(){var e=new r,t=0,i=this._currentObject.data.indexOf(";",t),a=this._currentObject.data.substr(t,i-t);t=i+1,e.boneName=a.substr(1,a.length-2),e.BoneIndex=this._currentGeo.BoneInfs.length,t=(i=this._currentObject.data.indexOf(";",t))+1,i=this._currentObject.data.indexOf(";",t),a=this._currentObject.data.substr(t,i-t);var s=this._readLine(a.trim()).split(",");for(let r=0;r<s.length;r++)e.Indeces.push(parseInt(s[r]));t=i+1,i=this._currentObject.data.indexOf(";",t),a=this._currentObject.data.substr(t,i-t);var o=this._readLine(a.trim()).split(",");for(let r=0;r<o.length;r++)e.Weights.push(parseFloat(o[r]));t=i+1,(i=this._currentObject.data.indexOf(";",t))<=0&&(i=this._currentObject.data.length),a=this._currentObject.data.substr(t,i-t);var l=this._readLine(a.trim()).split(",");e.OffsetMatrix=new n.Matrix4,this._ParseMatrixData(e.OffsetMatrix,l),this._currentGeo.BoneInfs.push(e)}},{key:"_makePutBoneList",value:function(e,t){var r=!1;for(let a in this.HieStack)if(this.HieStack[a].name===e||r){r=!0;var i=new n.Bone;if(i.name=this.HieStack[a].name,i.applyMatrix4(this.HieStack[a].FrameTransformMatrix),i.matrixWorld=i.matrix,i.FrameTransformMatrix=this.HieStack[a].FrameTransformMatrix,i.pos=(new n.Vector3).setFromMatrixPosition(i.FrameTransformMatrix).toArray(),i.rotq=(new n.Quaternion).setFromRotationMatrix(i.FrameTransformMatrix).toArray(),i.scl=(new n.Vector3).setFromMatrixScale(i.FrameTransformMatrix).toArray(),this.HieStack[a].parentName&&this.HieStack[a].parentName.length>0)for(let e=0;e<t.length;e++)if(this.HieStack[a].parentName===t[e].name){t[e].add(i),i.parent=e;break}t.push(i)}}},{key:"_makeOutputGeometry",value:function(){var e=null;if(this._currentGeo.BoneInfs.length>0){var t=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,t);for(let e=0;e<this._currentGeo.BoneInfs.length;e++){var r=0;for(let i=0;i<t.length;i++)if(t[i].name===this._currentGeo.BoneInfs[e].boneName){r=i,t[i].OffsetMatrix=new n.Matrix4,t[i].OffsetMatrix.copy(this._currentGeo.BoneInfs[e].OffsetMatrix);break}for(let t=0;t<this._currentGeo.BoneInfs[e].Indeces.length;t++){var i=this._currentGeo.BoneInfs[e].Indeces[t],a=this._currentGeo.BoneInfs[e].Weights[t],s=4*i;switch(this._currentGeo.VertexSetedBoneCount[i]){case 0:this._currentGeo.GeometryData.skinIndices[s]=r,this._currentGeo.GeometryData.skinWeights[s]=a;break;case 1:this._currentGeo.GeometryData.skinIndices[s+1]=r,this._currentGeo.GeometryData.skinWeights[s+1]=a;break;case 2:this._currentGeo.GeometryData.skinIndices[s+2]=r,this._currentGeo.GeometryData.skinWeights[s+2]=a;break;case 3:this._currentGeo.GeometryData.skinIndices[s+3]=r,this._currentGeo.GeometryData.skinWeights[s+3]=a}this._currentGeo.VertexSetedBoneCount[i]++,this._currentGeo.VertexSetedBoneCount[i]>4&&console.log("warn! over 4 bone weight! :"+i)}}for(let e=0;e<this._currentGeo.Materials.length;e++)this._currentGeo.Materials[e].skinning=!0;var o=[];for(let e=0;e<t.length;e++)t[e].OffsetMatrix?o.push(t[e].OffsetMatrix):o.push(new n.Matrix4);var l=this._buildGeometry();e=new n.SkinnedMesh(l,1===this._currentGeo.Materials.length?this._currentGeo.Materials[0]:this._currentGeo.Materials),this._initSkeleton(e,t,o)}else{var c=this._buildGeometry();e=new n.Mesh(c,1===this._currentGeo.Materials.length?this._currentGeo.Materials[0]:this._currentGeo.Materials)}e.name=this._currentGeo.name;var u=new n.Matrix4,h=this._currentGeo.baseFrame.putBone;if(h&&h.parent){for(;h=h.parent;)u.multiply(h.FrameTransformMatrix);e.applyMatrix4(u)}this.Meshes.push(e)}},{key:"_initSkeleton",value:function(e,t,r){var i,a,s,o,l=[];for(s=0,o=t.length;s<o;s++)a=t[s],i=new n.Bone,l.push(i),i.name=a.name,i.position.fromArray(a.pos),i.quaternion.fromArray(a.rotq),void 0!==a.scl&&i.scale.fromArray(a.scl);for(s=0,o=t.length;s<o;s++)-1!==(a=t[s]).parent&&null!==a.parent&&void 0!==l[a.parent]?l[a.parent].add(l[s]):e.add(l[s]);e.updateMatrixWorld(!0);var c=new n.Skeleton(l,r);e.bind(c,e.matrixWorld)}},{key:"_readAnimationKey",value:function(){var e=0,t=this._currentObject.data.indexOf(";",e),r=this._currentObject.data.substr(e,t-e);e=t+1;var i=parseInt(this._readLine(r));e=(t=this._currentObject.data.indexOf(";",e))+1,r=this._currentObject.data.substr(e);var a=this._readLine(r.trim()).split(";;,");for(let h=0;h<a.length;h++){var s=a[h].split(";"),l=new o;if(l.type=i,l.Frame=parseInt(s[0]),l.index=this._currentAnimeFrames.keyFrames.length,l.time=l.Frame,4!=i){var c=!1;for(let e=0;e<this._currentAnimeFrames.keyFrames.length;e++)if(this._currentAnimeFrames.keyFrames[e].Frame===l.Frame){l=this._currentAnimeFrames.keyFrames[e],c=!0;break}var u=s[2].split(",");switch(i){case 0:l.rot=new n.Quaternion(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]),-1*parseFloat(u[0]));break;case 1:l.scl=new n.Vector3(parseFloat(u[0]),parseFloat(u[1]),parseFloat(u[2]));break;case 2:l.pos=new n.Vector3(parseFloat(u[0]),parseFloat(u[1]),parseFloat(u[2]))}c||this._currentAnimeFrames.keyFrames.push(l)}else l.matrix=new n.Matrix4,this._ParseMatrixData(l.matrix,s[2].split(",")),this._currentAnimeFrames.keyFrames.push(l)}}},{key:"_makeOutputAnimation",value:function(){var e=new s(this.options);e.fps=this.animTicksPerSecond,e.name=this._currentAnime.name,e.make(this._currentAnime.AnimeFrames),this.animations.push(e)}},{key:"assignAnimation",value:function(e,t){var r=e,i=t;if(r||(r=this.Meshes[0]),i||(i=this.animations[0]),!r||!i)return null;var a={};a.fps=i.fps,a.name=i.name,a.length=i.length,a.hierarchy=[];for(let n=0;n<r.skeleton.bones.length;n++){var s=!1;for(let e=0;e<i.hierarchy.length;e++)if(r.skeleton.bones[n].name===i.hierarchy[e].name){s=!0;var o=i.hierarchy[e].copy();if(o.parent=-1,r.skeleton.bones[n].parent&&"Bone"===r.skeleton.bones[n].parent.type)for(let e=0;e<a.hierarchy.length;e++)a.hierarchy[e].name===r.skeleton.bones[n].parent.name&&(o.parent=e,o.parentName=r.skeleton.bones[n].parent.name);a.hierarchy.push(o);break}if(!s){var l=i.hierarchy[0].copy();l.name=r.skeleton.bones[n].name,l.parent=-1;for(let e=0;e<l.keys.length;e++)l.keys[e].pos&&l.keys[e].pos.set(0,0,0),l.keys[e].scl&&l.keys[e].scl.set(1,1,1),l.keys[e].rot&&l.keys[e].rot.set(0,0,0,1);a.hierarchy.push(l)}}return r.geometry.animations||(r.geometry.animations=[]),r.geometry.animations.push(n.AnimationClip.parseAnimation(a,r.skeleton.bones)),r.animationMixer||(r.animationMixer=new n.AnimationMixer(r)),a}},{key:"_ParseMatrixData",value:function(e,t){e.set(parseFloat(t[0]),parseFloat(t[4]),parseFloat(t[8]),parseFloat(t[12]),parseFloat(t[1]),parseFloat(t[5]),parseFloat(t[9]),parseFloat(t[13]),parseFloat(t[2]),parseFloat(t[6]),parseFloat(t[10]),parseFloat(t[14]),parseFloat(t[3]),parseFloat(t[7]),parseFloat(t[11]),parseFloat(t[15]))}}]),l}();return l}();class rc extends n.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0}load(e,t,r,i){const a=this,s=new n.FileLoader(a.manager);s.setPath(a.path),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){function t(e,r,i){if("ENDSITE"===i.type)return;const a={time:r,position:new n.Vector3,rotation:new n.Quaternion};i.frames.push(a);const s=new n.Quaternion,o=new n.Vector3(1,0,0),l=new n.Vector3(0,1,0),c=new n.Vector3(0,0,1);for(let t=0;t<i.channels.length;t++)switch(i.channels[t]){case"Xposition":a.position.x=parseFloat(e.shift().trim());break;case"Yposition":a.position.y=parseFloat(e.shift().trim());break;case"Zposition":a.position.z=parseFloat(e.shift().trim());break;case"Xrotation":s.setFromAxisAngle(o,parseFloat(e.shift().trim())*Math.PI/180),a.rotation.multiply(s);break;case"Yrotation":s.setFromAxisAngle(l,parseFloat(e.shift().trim())*Math.PI/180),a.rotation.multiply(s);break;case"Zrotation":s.setFromAxisAngle(c,parseFloat(e.shift().trim())*Math.PI/180),a.rotation.multiply(s);break;default:console.warn("THREE.BVHLoader: Invalid channel type.")}for(let n=0;n<i.children.length;n++)t(e,r,i.children[n])}function r(e,t,a){const s={name:"",type:"",frames:[]};a.push(s);let o=t.split(/[\s]+/);"END"===o[0].toUpperCase()&&"SITE"===o[1].toUpperCase()?(s.type="ENDSITE",s.name="ENDSITE"):(s.name=o[1],s.type=o[0].toUpperCase()),"{"!==i(e)&&console.error("THREE.BVHLoader: Expected opening { after type & name"),o=i(e).split(/[\s]+/),"OFFSET"!==o[0]&&console.error("THREE.BVHLoader: Expected OFFSET but got: "+o[0]),4!==o.length&&console.error("THREE.BVHLoader: Invalid number of values for OFFSET.");const l=new n.Vector3(parseFloat(o[1]),parseFloat(o[2]),parseFloat(o[3]));if((isNaN(l.x)||isNaN(l.y)||isNaN(l.z))&&console.error("THREE.BVHLoader: Invalid values of OFFSET."),s.offset=l,"ENDSITE"!==s.type){o=i(e).split(/[\s]+/),"CHANNELS"!==o[0]&&console.error("THREE.BVHLoader: Expected CHANNELS definition.");const t=parseInt(o[1]);s.channels=o.splice(2,t),s.children=[]}for(;;){const t=i(e);if("}"===t)return s;s.children.push(r(e,t,a))}}function i(e){let t;for(;0===(t=e.shift().trim()).length;);return t}const a=this,s=function(e){"HIERARCHY"!==i(e)&&console.error("THREE.BVHLoader: HIERARCHY expected.");const n=[],a=r(e,i(e),n);"MOTION"!==i(e)&&console.error("THREE.BVHLoader: MOTION expected.");let s=i(e).split(/[\s]+/);const o=parseInt(s[1]);isNaN(o)&&console.error("THREE.BVHLoader: Failed to read number of frames."),s=i(e).split(/[\s]+/);const l=parseFloat(s[2]);isNaN(l)&&console.error("THREE.BVHLoader: Failed to read frame time.");for(let r=0;r<o;r++)s=i(e).split(/[\s]+/),t(s,r*l,a);return n}(e.split(/[\r\n]+/g)),o=[];!function e(t,r){const i=new n.Bone;if(r.push(i),i.position.add(t.offset),i.name=t.name,"ENDSITE"!==t.type)for(let n=0;n<t.children.length;n++)i.add(e(t.children[n],r));return i}(s[0],o);const l=function(e){const t=[];for(let r=0;r<e.length;r++){const i=e[r];if("ENDSITE"===i.type)continue;const s=[],o=[],l=[];for(let e=0;e<i.frames.length;e++){const t=i.frames[e];s.push(t.time),o.push(t.position.x+i.offset.x),o.push(t.position.y+i.offset.y),o.push(t.position.z+i.offset.z),l.push(t.rotation.x),l.push(t.rotation.y),l.push(t.rotation.z),l.push(t.rotation.w)}a.animateBonePositions&&t.push(new n.VectorKeyframeTrack(".bones["+i.name+"].position",s,o)),a.animateBoneRotations&&t.push(new n.QuaternionKeyframeTrack(".bones["+i.name+"].quaternion",s,l))}return new n.AnimationClip("animation",-1,t)}(s);return{skeleton:new n.Skeleton(o),clip:l}}}class nc extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=this,s=""===a.path?n.LoaderUtils.extractUrlBase(e):a.path,o=new n.FileLoader(a.manager);o.setPath(a.path),o.setRequestHeader(a.requestHeader),o.setWithCredentials(a.withCredentials),o.load(e,(function(r){try{t(a.parse(r,s))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e,t){function r(e,t){const r=[],n=e.childNodes;for(let i=0,a=n.length;i<a;i++){const e=n[i];e.nodeName===t&&r.push(e)}return r}function i(e){if(0===e.length)return[];const t=e.trim().split(/\s+/),r=new Array(t.length);for(let n=0,i=t.length;n<i;n++)r[n]=t[n];return r}function a(e){if(0===e.length)return[];const t=e.trim().split(/\s+/),r=new Array(t.length);for(let n=0,i=t.length;n<i;n++)r[n]=parseFloat(t[n]);return r}function s(e){if(0===e.length)return[];const t=e.trim().split(/\s+/),r=new Array(t.length);for(let n=0,i=t.length;n<i;n++)r[n]=parseInt(t[n]);return r}function o(e){return e.substring(1)}function l(e){return 0===Object.keys(e).length}function c(e){return void 0!==e&&!0===e.hasAttribute("meter")?parseFloat(e.getAttribute("meter")):1}function u(e){return void 0!==e?e.textContent:"Y_UP"}function h(e,t,n,i){const a=r(e,t)[0];if(void 0!==a){const e=r(a,n);for(let t=0;t<e.length;t++)i(e[t])}}function d(e,t){for(const r in e){e[r].build=t(e[r])}}function p(e,t){return void 0!==e.build||(e.build=t(e)),e.build}function f(e){const t={inputs:{}};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType&&"input"===n.nodeName){const e=o(n.getAttribute("source")),r=n.getAttribute("semantic");t.inputs[r]=e}}return t}function m(e){const t={};let r=e.getAttribute("target").split("/");const n=r.shift();let i=r.shift();const a=-1!==i.indexOf("("),s=-1!==i.indexOf(".");if(s)r=i.split("."),i=r.shift(),t.member=r.shift();else if(a){const e=i.split("(");i=e.shift();for(let t=0;t<e.length;t++)e[t]=parseInt(e[t].replace(/\)/,""));t.indices=e}return t.id=n,t.sid=i,t.arraySyntax=a,t.memberSyntax=s,t.sampler=o(e.getAttribute("source")),t}function g(e){const t=[],r=e.channels,n=e.samplers,i=e.sources;for(const a in r)if(r.hasOwnProperty(a)){const e=r[a],s=n[e.sampler],o=s.inputs.INPUT,l=s.inputs.OUTPUT;w(A(e,i[o],i[l]),t)}return t}function v(e){return p(Je.animations[e],g)}function A(e,t,r){const n=Je.nodes[e.id],i=Ne(n.id),a=n.transforms[e.sid],s=n.matrix.clone().transpose();let o,l,c,u,h,d;const p={};switch(a){case"matrix":for(c=0,u=t.array.length;c<u;c++)if(o=t.array[c],l=c*r.stride,void 0===p[o]&&(p[o]={}),!0===e.arraySyntax){const t=r.array[l],n=e.indices[0]+4*e.indices[1];p[o][n]=t}else for(h=0,d=r.stride;h<d;h++)p[o][h]=r.array[l+h];break;case"translate":case"rotate":case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',a)}const f=function(e,t){const r=[];for(const i in e)r.push({time:parseFloat(i),value:e[i]});r.sort(n);for(let i=0;i<16;i++)E(r,i,t.elements[i]);return r;function n(e,t){return e.time-t.time}}(p,s);return{name:i.uuid,keyframes:f}}const y=new n.Vector3,x=new n.Vector3,b=new n.Quaternion;function w(e,t){const r=e.keyframes,i=e.name,a=[],s=[],o=[],l=[];for(let n=0,c=r.length;n<c;n++){const e=r[n],t=e.time,i=e.value;_e.fromArray(i).transpose(),_e.decompose(y,b,x),a.push(t),s.push(y.x,y.y,y.z),o.push(b.x,b.y,b.z,b.w),l.push(x.x,x.y,x.z)}return s.length>0&&t.push(new n.VectorKeyframeTrack(i+".position",a,s)),o.length>0&&t.push(new n.QuaternionKeyframeTrack(i+".quaternion",a,o)),l.length>0&&t.push(new n.VectorKeyframeTrack(i+".scale",a,l)),t}function E(e,t,r){let n,i,a,s=!0;for(i=0,a=e.length;i<a;i++)n=e[i],void 0===n.value[t]?n.value[t]=null:s=!1;if(!0===s)for(i=0,a=e.length;i<a;i++)n=e[i],n.value[t]=r;else!function(e,t){let r,n;for(let i=0,a=e.length;i<a;i++){const a=e[i];if(null===a.value[t]){if(r=S(e,i,t),n=M(e,i,t),null===r){a.value[t]=n.value[t];continue}if(null===n){a.value[t]=r.value[t];continue}_(a,r,n,t)}}}(e,t)}function S(e,t,r){for(;t>=0;){const n=e[t];if(null!==n.value[r])return n;t--}return null}function M(e,t,r){for(;t<e.length;){const n=e[t];if(null!==n.value[r])return n;t++}return null}function _(e,t,r,n){r.time-t.time!=0?e.value[n]=(e.time-t.time)*(r.value[n]-t.value[n])/(r.time-t.time)+t.value[n]:e.value[n]=t.value[n]}function T(e){const t=[],r=e.name,i=e.end-e.start||-1,a=e.animations;for(let n=0,s=a.length;n<s;n++){const e=v(a[n]);for(let r=0,n=e.length;r<n;r++)t.push(e[r])}return new n.AnimationClip(r,i,t)}function C(e){return p(Je.clips[e],T)}function I(e){const t={sources:{}};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"bind_shape_matrix":t.bindShapeMatrix=a(n.textContent);break;case"source":const e=n.getAttribute("id");t.sources[e]=se(n);break;case"joints":t.joints=B(n);break;case"vertex_weights":t.vertexWeights=R(n)}}return t}function B(e){const t={inputs:{}};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType&&"input"===n.nodeName){const e=n.getAttribute("semantic"),r=o(n.getAttribute("source"));t.inputs[e]=r}}return t}function R(e){const t={inputs:{}};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"input":const e=n.getAttribute("semantic"),r=o(n.getAttribute("source")),i=parseInt(n.getAttribute("offset"));t.inputs[e]={id:r,offset:i};break;case"vcount":t.vcount=s(n.textContent);break;case"v":t.v=s(n.textContent)}}return t}function P(e){const t={id:e.id},r=Je.geometries[t.id];return void 0!==e.skin&&(t.skin=function(e){const t=4,r={joints:[],indices:{array:[],stride:t},weights:{array:[],stride:t}},i=e.sources,a=e.vertexWeights,s=a.vcount,o=a.v,l=a.inputs.JOINT.offset,c=a.inputs.WEIGHT.offset,u=e.sources[e.joints.inputs.JOINT],h=e.sources[e.joints.inputs.INV_BIND_MATRIX],d=i[a.inputs.WEIGHT.id].array;let p,f,m,g=0;for(p=0,m=s.length;p<m;p++){const e=s[p],n=[];for(f=0;f<e;f++){const e=o[g+l],t=d[o[g+c]];n.push({index:e,weight:t}),g+=2}for(n.sort(v),f=0;f<t;f++){const e=n[f];void 0!==e?(r.indices.array.push(e.index),r.weights.array.push(e.weight)):(r.indices.array.push(0),r.weights.array.push(0))}}e.bindShapeMatrix?r.bindMatrix=(new n.Matrix4).fromArray(e.bindShapeMatrix).transpose():r.bindMatrix=(new n.Matrix4).identity();for(p=0,m=u.array.length;p<m;p++){const e=u.array[p],t=(new n.Matrix4).fromArray(h.array,p*h.stride).transpose();r.joints.push({name:e,boneInverse:t})}return r;function v(e,t){return t.weight-e.weight}}(e.skin),r.sources.skinIndices=t.skin.indices,r.sources.skinWeights=t.skin.weights),t}function F(e){return void 0!==e.build?e.build:e.init_from}function L(e){const t=Je.images[e];return void 0!==t?p(t,F):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",e),null)}function D(e){const t={surfaces:{},samplers:{}};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"newparam":U(n,t);break;case"technique":t.technique=O(n);break;case"extra":t.extra=j(n)}}return t}function U(e,t){const r=e.getAttribute("sid");for(let n=0,i=e.childNodes.length;n<i;n++){const i=e.childNodes[n];if(1===i.nodeType)switch(i.nodeName){case"surface":t.surfaces[r]=N(i);break;case"sampler2D":t.samplers[r]=k(i)}}}function N(e){const t={};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType&&"init_from"===n.nodeName)t.init_from=n.textContent}return t}function k(e){const t={};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType&&"source"===n.nodeName)t.source=n.textContent}return t}function O(e){const t={};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"constant":case"lambert":case"blinn":case"phong":t.type=n.nodeName,t.parameters=G(n);break;case"extra":t.extra=j(n)}}return t}function G(e){const t={};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":t[n.nodeName]=z(n);break;case"transparent":t[n.nodeName]={opaque:n.hasAttribute("opaque")?n.getAttribute("opaque"):"A_ONE",data:z(n)}}}return t}function z(e){const t={};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"color":t[n.nodeName]=a(n.textContent);break;case"float":t[n.nodeName]=parseFloat(n.textContent);break;case"texture":t[n.nodeName]={id:n.getAttribute("texture"),extra:V(n)}}}return t}function V(e){const t={technique:{}};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType&&"extra"===n.nodeName)H(n,t)}return t}function H(e,t){for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType&&"technique"===n.nodeName)Q(n,t)}}function Q(e,t){for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":t.technique[n.nodeName]=parseFloat(n.textContent);break;case"wrapU":case"wrapV":"TRUE"===n.textContent.toUpperCase()?t.technique[n.nodeName]=1:"FALSE"===n.textContent.toUpperCase()?t.technique[n.nodeName]=0:t.technique[n.nodeName]=parseInt(n.textContent);break;case"bump":t[n.nodeName]=X(n)}}}function j(e){const t={};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType&&"technique"===n.nodeName)t.technique=W(n)}return t}function W(e){const t={};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"double_sided":t[n.nodeName]=parseInt(n.textContent);break;case"bump":t[n.nodeName]=X(n)}}return t}function X(e){for(var t={},r=0,n=e.childNodes.length;r<n;r++){var i=e.childNodes[r];if(1===i.nodeType&&"texture"===i.nodeName)t[i.nodeName]={id:i.getAttribute("texture"),texcoord:i.getAttribute("texcoord"),extra:V(i)}}return t}function Y(e){return e}function q(e){const t=(r=e.url,p(Je.effects[r],Y));var r;const i=t.profile.technique;let a;switch(i.type){case"phong":case"blinn":a=new n.MeshPhongMaterial;break;case"lambert":a=new n.MeshLambertMaterial;break;default:a=new n.MeshBasicMaterial}function s(e){const r=t.profile.samplers[e.id];let i=null;if(void 0!==r){i=L(t.profile.surfaces[r.source].init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),i=L(e.id);if(null!==i){const t=function(e){let t,r=e.slice(2+(e.lastIndexOf(".")-1>>>0));r=r.toLowerCase(),t="tga"===r?Xe:We;return t}(i);if(void 0!==t){const r=t.load(i),a=e.extra;if(void 0!==a&&void 0!==a.technique&&!1===l(a.technique)){const e=a.technique;r.wrapS=e.wrapU?n.RepeatWrapping:n.ClampToEdgeWrapping,r.wrapT=e.wrapV?n.RepeatWrapping:n.ClampToEdgeWrapping,r.offset.set(e.offsetU||0,e.offsetV||0),r.repeat.set(e.repeatU||1,e.repeatV||1)}else r.wrapS=n.RepeatWrapping,r.wrapT=n.RepeatWrapping;return r}return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",i),null}return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",e.id),null}a.name=e.name||"";const o=i.parameters;for(const n in o){const e=o[n];switch(n){case"diffuse":e.color&&a.color.fromArray(e.color),e.texture&&(a.map=s(e.texture));break;case"specular":e.color&&a.specular&&a.specular.fromArray(e.color),e.texture&&(a.specularMap=s(e.texture));break;case"bump":e.texture&&(a.normalMap=s(e.texture));break;case"ambient":e.texture&&(a.lightMap=s(e.texture));break;case"shininess":e.float&&a.shininess&&(a.shininess=e.float);break;case"emission":e.color&&a.emissive&&a.emissive.fromArray(e.color),e.texture&&(a.emissiveMap=s(e.texture))}}let c=o.transparent,u=o.transparency;if(void 0===u&&c&&(u={float:1}),void 0===c&&u&&(c={opaque:"A_ONE",data:{color:[1,1,1,1]}}),c&&u)if(c.data.texture)a.transparent=!0;else{const e=c.data.color;switch(c.opaque){case"A_ONE":a.opacity=e[3]*u.float;break;case"RGB_ZERO":a.opacity=1-e[0]*u.float;break;case"A_ZERO":a.opacity=1-e[3]*u.float;break;case"RGB_ONE":a.opacity=e[0]*u.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',c.opaque)}a.opacity<1&&(a.transparent=!0)}if(void 0!==i.extra&&void 0!==i.extra.technique){const e=i.extra.technique;for(const t in e){const r=e[t];switch(t){case"double_sided":a.side=1===r?n.DoubleSide:n.FrontSide;break;case"bump":a.normalMap=s(r.texture),a.normalScale=new n.Vector2(1,1)}}}return a}function K(e){return p(Je.materials[e],q)}function J(e){for(let t=0;t<e.childNodes.length;t++){const r=e.childNodes[t];if("technique_common"===r.nodeName)return Z(r)}return{}}function Z(e){const t={};for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];switch(n.nodeName){case"perspective":case"orthographic":t.technique=n.nodeName,t.parameters=$(n)}}return t}function $(e){const t={};for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];switch(n.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":t[n.nodeName]=parseFloat(n.textContent)}}return t}function ee(e){let t;switch(e.optics.technique){case"perspective":t=new n.PerspectiveCamera(e.optics.parameters.yfov,e.optics.parameters.aspect_ratio,e.optics.parameters.znear,e.optics.parameters.zfar);break;case"orthographic":let r=e.optics.parameters.ymag,i=e.optics.parameters.xmag;const a=e.optics.parameters.aspect_ratio;i=void 0===i?r*a:i,r=void 0===r?i/a:r,i*=.5,r*=.5,t=new n.OrthographicCamera(-i,i,r,-r,e.optics.parameters.znear,e.optics.parameters.zfar);break;default:t=new n.PerspectiveCamera}return t.name=e.name||"",t}function te(e){const t=Je.cameras[e];return void 0!==t?p(t,ee):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",e),null)}function re(e){const t={};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"directional":case"point":case"spot":case"ambient":t.technique=n.nodeName,t.parameters=ne(n)}}return t}function ne(e){const t={};for(let r=0,i=e.childNodes.length;r<i;r++){const i=e.childNodes[r];if(1===i.nodeType)switch(i.nodeName){case"color":const e=a(i.textContent);t.color=(new n.Color).fromArray(e);break;case"falloff_angle":t.falloffAngle=parseFloat(i.textContent);break;case"quadratic_attenuation":const r=parseFloat(i.textContent);t.distance=r?Math.sqrt(1/r):0}}return t}function ie(e){let t;switch(e.technique){case"directional":t=new n.DirectionalLight;break;case"point":t=new n.PointLight;break;case"spot":t=new n.SpotLight;break;case"ambient":t=new n.AmbientLight}return e.parameters.color&&t.color.copy(e.parameters.color),e.parameters.distance&&(t.distance=e.parameters.distance),t}function ae(e){const t=Je.lights[e];return void 0!==t?p(t,ie):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",e),null)}function se(e){const t={array:[],stride:3};for(let n=0;n<e.childNodes.length;n++){const s=e.childNodes[n];if(1===s.nodeType)switch(s.nodeName){case"float_array":t.array=a(s.textContent);break;case"Name_array":t.array=i(s.textContent);break;case"technique_common":const e=r(s,"accessor")[0];void 0!==e&&(t.stride=parseInt(e.getAttribute("stride")))}}return t}function oe(e){const t={};for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];1===n.nodeType&&(t[n.getAttribute("semantic")]=o(n.getAttribute("source")))}return t}function le(e){const t={type:e.nodeName,material:e.getAttribute("material"),count:parseInt(e.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"input":const e=o(n.getAttribute("source")),r=n.getAttribute("semantic"),i=parseInt(n.getAttribute("offset")),a=parseInt(n.getAttribute("set")),l=a>0?r+a:r;t.inputs[l]={id:e,offset:i},t.stride=Math.max(t.stride,i+1),"TEXCOORD"===r&&(t.hasUV=!0);break;case"vcount":t.vcount=s(n.textContent);break;case"p":t.p=s(n.textContent)}}return t}function ce(e){let t=0;for(let r=0,n=e.length;r<n;r++){!0===e[r].hasUV&&t++}t>0&&t<e.length&&(e.uvsNeedsFix=!0)}function ue(e){const t={},r=e.sources,n=e.vertices,i=e.primitives;if(0===i.length)return{};const a=function(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];void 0===t[n.type]&&(t[n.type]=[]),t[n.type].push(n)}return t}(i);for(const s in a){const e=a[s];ce(e),t[s]=he(e,r,n)}return t}function he(e,t,r){const i={},a={array:[],stride:0},s={array:[],stride:0},o={array:[],stride:0},l={array:[],stride:0},c={array:[],stride:0},u=[],h=4,d=[],p=4,f=new n.BufferGeometry,m=[];let g=0;for(let n=0;n<e.length;n++){const i=e[n],h=i.inputs;let p=0;switch(i.type){case"lines":case"linestrips":p=2*i.count;break;case"triangles":p=3*i.count;break;case"polylist":for(let e=0;e<i.count;e++){const t=i.vcount[e];switch(t){case 3:p+=3;break;case 4:p+=6;break;default:p+=3*(t-2)}}break;default:console.warn("THREE.ColladaLoader: Unknow primitive type:",i.type)}f.addGroup(g,p,n),g+=p,i.material&&m.push(i.material);for(const n in h){const p=h[n];switch(n){case"VERTEX":for(const n in r){const h=r[n];switch(n){case"POSITION":const r=a.array.length;if(de(i,t[h],p.offset,a.array),a.stride=t[h].stride,t.skinWeights&&t.skinIndices&&(de(i,t.skinIndices,p.offset,u),de(i,t.skinWeights,p.offset,d)),!1===i.hasUV&&!0===e.uvsNeedsFix){const e=(a.array.length-r)/a.stride;for(let t=0;t<e;t++)o.array.push(0,0)}break;case"NORMAL":de(i,t[h],p.offset,s.array),s.stride=t[h].stride;break;case"COLOR":de(i,t[h],p.offset,c.array),c.stride=t[h].stride;break;case"TEXCOORD":de(i,t[h],p.offset,o.array),o.stride=t[h].stride;break;case"TEXCOORD1":de(i,t[h],p.offset,l.array),o.stride=t[h].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',n)}}break;case"NORMAL":de(i,t[p.id],p.offset,s.array),s.stride=t[p.id].stride;break;case"COLOR":de(i,t[p.id],p.offset,c.array),c.stride=t[p.id].stride;break;case"TEXCOORD":de(i,t[p.id],p.offset,o.array),o.stride=t[p.id].stride;break;case"TEXCOORD1":de(i,t[p.id],p.offset,l.array),l.stride=t[p.id].stride}}}return a.array.length>0&&f.setAttribute("position",new n.Float32BufferAttribute(a.array,a.stride)),s.array.length>0&&f.setAttribute("normal",new n.Float32BufferAttribute(s.array,s.stride)),c.array.length>0&&f.setAttribute("color",new n.Float32BufferAttribute(c.array,c.stride)),o.array.length>0&&f.setAttribute("uv",new n.Float32BufferAttribute(o.array,o.stride)),l.array.length>0&&f.setAttribute("uv2",new n.Float32BufferAttribute(l.array,l.stride)),u.length>0&&f.setAttribute("skinIndex",new n.Float32BufferAttribute(u,h)),d.length>0&&f.setAttribute("skinWeight",new n.Float32BufferAttribute(d,p)),i.data=f,i.type=e[0].type,i.materialKeys=m,i}function de(e,t,r,n){const i=e.p,a=e.stride,s=e.vcount;function o(e){let t=i[e+r]*c;const a=t+c;for(;t<a;t++)n.push(l[t])}const l=t.array,c=t.stride;if(void 0!==e.vcount){let e=0;for(let t=0,r=s.length;t<r;t++){const r=s[t];if(4===r){const t=e+1*a,r=e+2*a,n=e+3*a;o(e+0*a),o(t),o(n),o(t),o(r),o(n)}else if(3===r){const t=e+1*a,r=e+2*a;o(e+0*a),o(t),o(r)}else if(r>4)for(let t=1,n=r-2;t<=n;t++){const r=e+a*t,n=e+a*(t+1);o(e+0*a),o(r),o(n)}e+=a*r}}else for(let u=0,h=i.length;u<h;u+=a)o(u)}function pe(e){return p(Je.geometries[e],ue)}function fe(e){return void 0!==e.build?e.build:e}function me(e,t){for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"joint":t.joints[n.getAttribute("sid")]=ge(n);break;case"link":t.links.push(Ae(n))}}}function ge(e){let t;for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"prismatic":case"revolute":t=ve(n)}}return t}function ve(e){const t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",axis:new n.Vector3,limits:{min:0,max:0},type:e.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"axis":const e=a(n.textContent);t.axis.fromArray(e);break;case"limits":const r=n.getElementsByTagName("max")[0],i=n.getElementsByTagName("min")[0];t.limits.max=parseFloat(r.textContent),t.limits.min=parseFloat(i.textContent)}}return t.limits.min>=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function Ae(e){const t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]};for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"attachment_full":t.attachments.push(ye(n));break;case"matrix":case"translate":case"rotate":t.transforms.push(xe(n))}}return t}function ye(e){const t={joint:e.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"link":t.links.push(Ae(n));break;case"matrix":case"translate":case"rotate":t.transforms.push(xe(n))}}return t}function xe(e){const t={type:e.nodeName},r=a(e.textContent);switch(t.type){case"matrix":t.obj=new n.Matrix4,t.obj.fromArray(r).transpose();break;case"translate":t.obj=new n.Vector3,t.obj.fromArray(r);break;case"rotate":t.obj=new n.Vector3,t.obj.fromArray(r),t.angle=n.MathUtils.degToRad(r[3])}return t}function be(e,t){for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];if(1===n.nodeType&&"technique_common"===n.nodeName)we(n,t)}}function we(e,t){for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"inertia":t.inertia=a(n.textContent);break;case"mass":t.mass=a(n.textContent)[0]}}}function Ee(e){const t={target:e.getAttribute("target").split("/").pop()};for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];if(1===n.nodeType&&"axis"===n.nodeName){const e=n.getElementsByTagName("param")[0];t.axis=e.textContent;const r=t.axis.split("inst_").pop().split("axis")[0];t.jointIndex=r.substr(0,r.length-1)}}return t}function Se(e){return void 0!==e.build?e.build:e}function Me(e){const t=[],r=ze.querySelector('[id="'+e.id+'"]');for(let i=0;i<r.childNodes.length;i++){const e=r.childNodes[i];if(1!==e.nodeType)continue;let s,o;switch(e.nodeName){case"matrix":s=a(e.textContent);const r=(new n.Matrix4).fromArray(s).transpose();t.push({sid:e.getAttribute("sid"),type:e.nodeName,obj:r});break;case"translate":case"scale":s=a(e.textContent),o=(new n.Vector3).fromArray(s),t.push({sid:e.getAttribute("sid"),type:e.nodeName,obj:o});break;case"rotate":s=a(e.textContent),o=(new n.Vector3).fromArray(s);const i=n.MathUtils.degToRad(s[3]);t.push({sid:e.getAttribute("sid"),type:e.nodeName,obj:o,angle:i})}}return t}const _e=new n.Matrix4,Te=new n.Vector3;function Ce(e){const t={name:e.getAttribute("name")||"",type:e.getAttribute("type"),id:e.getAttribute("id"),sid:e.getAttribute("sid"),matrix:new n.Matrix4,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];if(1!==i.nodeType)continue;let s;switch(i.nodeName){case"node":t.nodes.push(i.getAttribute("id")),Ce(i);break;case"instance_camera":t.instanceCameras.push(o(i.getAttribute("url")));break;case"instance_controller":t.instanceControllers.push(Ie(i));break;case"instance_light":t.instanceLights.push(o(i.getAttribute("url")));break;case"instance_geometry":t.instanceGeometries.push(Ie(i));break;case"instance_node":t.instanceNodes.push(o(i.getAttribute("url")));break;case"matrix":s=a(i.textContent),t.matrix.multiply(_e.fromArray(s).transpose()),t.transforms[i.getAttribute("sid")]=i.nodeName;break;case"translate":s=a(i.textContent),Te.fromArray(s),t.matrix.multiply(_e.makeTranslation(Te.x,Te.y,Te.z)),t.transforms[i.getAttribute("sid")]=i.nodeName;break;case"rotate":s=a(i.textContent);const e=n.MathUtils.degToRad(s[3]);t.matrix.multiply(_e.makeRotationAxis(Te.fromArray(s),e)),t.transforms[i.getAttribute("sid")]=i.nodeName;break;case"scale":s=a(i.textContent),t.matrix.scale(Te.fromArray(s)),t.transforms[i.getAttribute("sid")]=i.nodeName;break;case"extra":break;default:console.log(i)}}return Ue(t.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",t.id):Je.nodes[t.id]=t,t}function Ie(e){const t={id:o(e.getAttribute("url")),materials:{},skeletons:[]};for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];switch(n.nodeName){case"bind_material":const e=n.getElementsByTagName("instance_material");for(let r=0;r<e.length;r++){const n=e[r],i=n.getAttribute("symbol"),a=n.getAttribute("target");t.materials[i]=o(a)}break;case"skeleton":t.skeletons.push(o(n.textContent))}}return t}function Be(e,t){const r=[],i=[];let a,s,o;for(a=0;a<e.length;a++){const n=e[a];let i;if(Ue(n))i=Ne(n),Re(i,t,r);else if(l=n,void 0!==Je.visualScenes[l]){const e=Je.visualScenes[n].children;for(let n=0;n<e.length;n++){const i=e[n];if("JOINT"===i.type){Re(Ne(i.id),t,r)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",n)}var l;for(a=0;a<t.length;a++)for(s=0;s<r.length;s++)if(o=r[s],o.bone.name===t[a].name){i[a]=o,o.processed=!0;break}for(a=0;a<r.length;a++)o=r[a],!1===o.processed&&(i.push(o),o.processed=!0);const c=[],u=[];for(a=0;a<i.length;a++)o=i[a],c.push(o.bone),u.push(o.boneInverse);return new n.Skeleton(c,u)}function Re(e,t,r){e.traverse((function(e){if(!0===e.isBone){let i;for(let r=0;r<t.length;r++){const n=t[r];if(n.name===e.name){i=n.boneInverse;break}}void 0===i&&(i=new n.Matrix4),r.push({bone:e,boneInverse:i,processed:!1})}}))}function Pe(e){const t=[],r=e.matrix,i=e.nodes,a=e.type,s=e.instanceCameras,o=e.instanceControllers,l=e.instanceLights,c=e.instanceGeometries,u=e.instanceNodes;for(let n=0,p=i.length;n<p;n++)t.push(Ne(i[n]));for(let n=0,p=s.length;n<p;n++){const e=te(s[n]);null!==e&&t.push(e.clone())}for(let n=0,f=o.length;n<f;n++){const e=o[n],r=(h=e.id,p(Je.controllers[h],P)),i=De(pe(r.id),e.materials),a=Be(e.skeletons,r.skin.joints);for(let n=0,s=i.length;n<s;n++){const e=i[n];e.isSkinnedMesh&&(e.bind(a,r.skin.bindMatrix),e.normalizeSkinWeights()),t.push(e)}}var h;for(let n=0,p=l.length;n<p;n++){const e=ae(l[n]);null!==e&&t.push(e.clone())}for(let n=0,p=c.length;n<p;n++){const e=c[n],r=De(pe(e.id),e.materials);for(let n=0,i=r.length;n<i;n++)t.push(r[n])}for(let n=0,p=u.length;n<p;n++)t.push(Ne(u[n]).clone());let d;if(0===i.length&&1===t.length)d=t[0];else{d="JOINT"===a?new n.Bone:new n.Group;for(let e=0;e<t.length;e++)d.add(t[e])}return d.name="JOINT"===a?e.sid:e.name,d.matrix.copy(r),d.matrix.decompose(d.position,d.quaternion,d.scale),d}const Fe=new n.MeshBasicMaterial({color:16711935});function Le(e,t){const r=[];for(let n=0,i=e.length;n<i;n++){const i=t[e[n]];void 0===i?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",e[n]),r.push(Fe)):r.push(K(i))}return r}function De(e,t){const r=[];for(const i in e){const a=e[i],s=Le(a.materialKeys,t);0===s.length&&("lines"===i||"linestrips"===i?s.push(new n.LineBasicMaterial):s.push(new n.MeshPhongMaterial));const o=void 0!==a.data.attributes.skinIndex,l=1===s.length?s[0]:s;let c;switch(i){case"lines":c=new n.LineSegments(a.data,l);break;case"linestrips":c=new n.Line(a.data,l);break;case"triangles":case"polylist":c=o?new n.SkinnedMesh(a.data,l):new n.Mesh(a.data,l)}r.push(c)}return r}function Ue(e){return void 0!==Je.nodes[e]}function Ne(e){return p(Je.nodes[e],Pe)}function ke(e){const t=new n.Group;t.name=e.name;const r=e.children;for(let n=0;n<r.length;n++){const e=r[n];t.add(Ne(e.id))}return t}function Oe(e){return p(Je.visualScenes[e],ke)}if(0===e.length)return{scene:new n.Scene};const Ge=(new DOMParser).parseFromString(e,"application/xml"),ze=r(Ge,"COLLADA")[0],Ve=Ge.getElementsByTagName("parsererror")[0];if(void 0!==Ve){const e=r(Ve,"div")[0];let t;return t=e?e.textContent:function(e){let t="";const r=[e];for(;r.length;){const e=r.shift();e.nodeType===Node.TEXT_NODE?t+=e.textContent:(t+="\n",r.push.apply(r,e.childNodes))}return t.trim()}(Ve),console.error("THREE.ColladaLoader: Failed to parse collada file.\n",t),null}const He=ze.getAttribute("version");console.log("THREE.ColladaLoader: File version",He);const Qe=(je=r(ze,"asset")[0],{unit:c(r(je,"unit")[0]),upAxis:u(r(je,"up_axis")[0])});var je;const We=new n.TextureLoader(this.manager);let Xe;We.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),Xl&&(Xe=new Xl(this.manager),Xe.setPath(this.resourcePath||t));const Ye=[];let qe={},Ke=0;const Je={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};h(ze,"library_animations","animation",(function e(t){const r={sources:{},samplers:{},channels:{}};let i=!1;for(let n=0,a=t.childNodes.length;n<a;n++){const a=t.childNodes[n];if(1!==a.nodeType)continue;let s;switch(a.nodeName){case"source":s=a.getAttribute("id"),r.sources[s]=se(a);break;case"sampler":s=a.getAttribute("id"),r.samplers[s]=f(a);break;case"channel":s=a.getAttribute("target"),r.channels[s]=m(a);break;case"animation":e(a),i=!0;break;default:console.log(a)}}!1===i&&(Je.animations[t.getAttribute("id")||n.MathUtils.generateUUID()]=r)})),h(ze,"library_animation_clips","animation_clip",(function(e){const t={name:e.getAttribute("id")||"default",start:parseFloat(e.getAttribute("start")||0),end:parseFloat(e.getAttribute("end")||0),animations:[]};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType&&"instance_animation"===n.nodeName)t.animations.push(o(n.getAttribute("url")))}Je.clips[e.getAttribute("id")]=t})),h(ze,"library_controllers","controller",(function(e){const t={};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"skin":t.id=o(n.getAttribute("source")),t.skin=I(n);break;case"morph":t.id=o(n.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.")}}Je.controllers[e.getAttribute("id")]=t})),h(ze,"library_images","image",(function(e){const t={init_from:r(e,"init_from")[0].textContent};Je.images[e.getAttribute("id")]=t})),h(ze,"library_effects","effect",(function(e){const t={};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType&&"profile_COMMON"===n.nodeName)t.profile=D(n)}Je.effects[e.getAttribute("id")]=t})),h(ze,"library_materials","material",(function(e){const t={name:e.getAttribute("name")};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType&&"instance_effect"===n.nodeName)t.url=o(n.getAttribute("url"))}Je.materials[e.getAttribute("id")]=t})),h(ze,"library_cameras","camera",(function(e){const t={name:e.getAttribute("name")};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType&&"optics"===n.nodeName)t.optics=J(n)}Je.cameras[e.getAttribute("id")]=t})),h(ze,"library_lights","light",(function(e){let t={};for(let r=0,n=e.childNodes.length;r<n;r++){const n=e.childNodes[r];if(1===n.nodeType&&"technique_common"===n.nodeName)t=re(n)}Je.lights[e.getAttribute("id")]=t})),h(ze,"library_geometries","geometry",(function(e){const t={name:e.getAttribute("name"),sources:{},vertices:{},primitives:[]},n=r(e,"mesh")[0];if(void 0!==n){for(let e=0;e<n.childNodes.length;e++){const r=n.childNodes[e];if(1!==r.nodeType)continue;const i=r.getAttribute("id");switch(r.nodeName){case"source":t.sources[i]=se(r);break;case"vertices":t.vertices=oe(r);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",r.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":t.primitives.push(le(r));break;default:console.log(r)}}Je.geometries[e.getAttribute("id")]=t}})),h(ze,"library_nodes","node",Ce),h(ze,"library_visual_scenes","visual_scene",(function(e){const t={name:e.getAttribute("name"),children:[]};!function(e){const t=e.getElementsByTagName("node");for(let r=0;r<t.length;r++){const e=t[r];!1===e.hasAttribute("id")&&e.setAttribute("id","three_default_"+Ke++)}}(e);const n=r(e,"node");for(let r=0;r<n.length;r++)t.children.push(Ce(n[r]));Je.visualScenes[e.getAttribute("id")]=t})),h(ze,"library_kinematics_models","kinematics_model",(function(e){const t={name:e.getAttribute("name")||"",joints:{},links:[]};for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];if(1===n.nodeType&&"technique_common"===n.nodeName)me(n,t)}Je.kinematicsModels[e.getAttribute("id")]=t})),h(ze,"library_physics_models","physics_model",(function(e){const t={name:e.getAttribute("name")||"",rigidBodies:{}};for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];if(1===n.nodeType&&"rigid_body"===n.nodeName)t.rigidBodies[n.getAttribute("name")]={},be(n,t.rigidBodies[n.getAttribute("name")])}Je.physicsModels[e.getAttribute("id")]=t})),h(ze,"scene","instance_kinematics_scene",(function(e){const t={bindJointAxis:[]};for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];if(1===n.nodeType&&"bind_joint_axis"===n.nodeName)t.bindJointAxis.push(Ee(n))}Je.kinematicsScenes[o(e.getAttribute("url"))]=t})),d(Je.animations,g),d(Je.clips,T),d(Je.controllers,P),d(Je.images,F),d(Je.effects,Y),d(Je.materials,q),d(Je.cameras,ee),d(Je.lights,ie),d(Je.geometries,ue),d(Je.visualScenes,ke),function(){const e=Je.clips;if(!0===l(e)){if(!1===l(Je.animations)){const e=[];for(const t in Je.animations){const r=v(t);for(let t=0,n=r.length;t<n;t++)e.push(r[t])}Ye.push(new n.AnimationClip("default",-1,e))}}else for(const t in e)Ye.push(C(t))}(),function(){const e=Object.keys(Je.kinematicsModels)[0],t=Object.keys(Je.kinematicsScenes)[0],r=Object.keys(Je.visualScenes)[0];if(void 0===e||void 0===t)return;const i=(a=e,p(Je.kinematicsModels[a],fe));var a;const s=function(e){return p(Je.kinematicsScenes[e],Se)}(t),o=Oe(r),l=s.bindJointAxis,c={};for(let n=0,d=l.length;n<d;n++){const e=l[n],t=ze.querySelector('[sid="'+e.target+'"]');if(t){const r=t.parentElement;u(e.jointIndex,r)}}function u(e,t){const r=t.getAttribute("name"),n=i.joints[e];o.traverse((function(i){i.name===r&&(c[e]={object:i,transforms:Me(t),joint:n,position:n.zeroPosition})}))}const h=new n.Matrix4;qe={joints:i&&i.joints,getJointValue:function(e){const t=c[e];if(t)return t.position;console.warn("THREE.ColladaLoader: Joint "+e+" doesn't exist.")},setJointValue:function(e,t){const r=c[e];if(r){const i=r.joint;if(t>i.limits.max||t<i.limits.min)console.warn("THREE.ColladaLoader: Joint "+e+" value "+t+" outside of limits (min: "+i.limits.min+", max: "+i.limits.max+").");else if(i.static)console.warn("THREE.ColladaLoader: Joint "+e+" is static.");else{const a=r.object,s=i.axis,o=r.transforms;_e.identity();for(let r=0;r<o.length;r++){const a=o[r];if(a.sid&&-1!==a.sid.indexOf(e))switch(i.type){case"revolute":_e.multiply(h.makeRotationAxis(s,n.MathUtils.degToRad(t)));break;case"prismatic":_e.multiply(h.makeTranslation(s.x*t,s.y*t,s.z*t));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+i.type)}else switch(a.type){case"matrix":_e.multiply(a.obj);break;case"translate":_e.multiply(h.makeTranslation(a.obj.x,a.obj.y,a.obj.z));break;case"scale":_e.scale(a.obj);break;case"rotate":_e.multiply(h.makeRotationAxis(a.obj,a.angle))}}a.matrix.copy(_e),a.matrix.decompose(a.position,a.quaternion,a.scale),c[e].position=t}}else console.log("THREE.ColladaLoader: "+e+" does not exist.")}}}();const Ze=function(e){return Oe(o(r(e,"instance_visual_scene")[0].getAttribute("url")))}(r(ze,"scene")[0]);return Ze.animations=Ye,"Z_UP"===Qe.upAxis&&Ze.quaternion.setFromEuler(new n.Euler(-Math.PI/2,0,0)),Ze.scale.multiplyScalar(Qe.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),Ye},kinematics:qe,library:Je,scene:Ze}}}class ic extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=this,s=new n.FileLoader(a.manager);s.setPath(a.path),s.setResponseType("arraybuffer"),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){const t=new n.LoadingManager;t.setURLModifier((function(e){const t=function(e){for(const t in r)if(t.substr(-e.length)===e)return r[t]}(e);if(t){console.log("Loading",e);const r=new Blob([t.buffer],{type:"application/octet-stream"});return URL.createObjectURL(r)}return e}));const r=(0,Lt.GZ)(new Uint8Array(e));if(r["doc.kml"]){const e=(new DOMParser).parseFromString(fflate.strFromU8(r["doc.kml"]),"application/xml").querySelector("Placemark Model Link href");if(e){return new nc(t).parse(fflate.strFromU8(r[e.textContent]))}}else{console.warn("KMZLoader: Missing doc.kml file.");for(const e in r){if("dae"===e.split(".").pop().toLowerCase()){return new nc(t).parse(fflate.strFromU8(r[e]))}}}return console.error("KMZLoader: Couldn't find .dae file."),{scene:new n.Group}}}class ac extends n.Loader{constructor(e){super(e),this.gltfLoader=new Ss.E(e)}load(e,t,r,n){const i=this;this.gltfLoader.load(e,(function(r){try{i.parse(r,t)}catch(a){n?n(a):console.error(a),i.manager.itemError(e)}}),r,n)}setDRACOLoader(e){return this.gltfLoader.setDRACOLoader(e),this}parse(e,t){t(e)}}var sc=r(40417);sc.ue,sc.r3;const oc=sc.wd,lc=(sc._o,sc.sd,sc.N7,sc.nu,sc.Mf,sc.dV,sc.hW),cc=(sc.Bw,sc.P7,sc.z5,sc.Sj,sc.Oq,sc.Wx,sc._b,sc.b4,sc.hI,sc.ej,sc.fK,sc.pT,sc.$9,sc.oI,sc.q4,sc.LK,sc.H7,sc.V3);sc.dK,sc.ZW,sc.Hs,sc.Kv,sc.oC,sc.bS,sc.N$,sc.SE,sc.l$,sc.ol,sc.vA;class uc extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=this,s=""===a.path?n.LoaderUtils.extractUrlBase(e):a.path,o=new n.FileLoader(a.manager);o.setPath(a.path),o.setRequestHeader(a.requestHeader),o.setWithCredentials(a.withCredentials),o.load(e,(function(r){try{t(a.parse(r,s))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e,t){const r={};function i(e){e.DEF&&(r[e.DEF]=e);const t=e.fields;for(let r=0,n=t.length;r<n;r++){const e=t[r];if("node"===e.type){const t=e.values;for(let e=0,r=t.length;e<r;e++)i(t[e])}}}function a(e){return e.USE?function(e){const t=a(r[e]);return t.isObject3D||t.isMaterial?t.clone():t}(e.USE):(void 0!==e.build||(e.build=function(e){const t=e.name;let r;switch(t){case"Group":case"Transform":case"Collision":r=function(e){const t=new n.Group,r=e.fields;for(let i=0,a=r.length;i<a;i++){const e=r[i],a=e.name,s=e.values;switch(a){case"bboxCenter":case"bboxSize":case"center":case"collide":case"scaleOrientation":case"proxy":break;case"children":l(s,t);break;case"rotation":const e=new n.Vector3(s[0],s[1],s[2]),r=s[3];t.quaternion.setFromAxisAngle(e,r);break;case"scale":t.scale.set(s[0],s[1],s[2]);break;case"translation":t.position.set(s[0],s[1],s[2]);break;default:console.warn("THREE.VRMLLoader: Unknown field:",a)}}return t}(e);break;case"Background":r=function(e){const t=new n.Group;let r,i,a,s;const o=e.fields;for(let n=0,c=o.length;n<c;n++){const e=o[n],t=e.name,l=e.values;switch(t){case"groundAngle":r=l;break;case"groundColor":i=l;break;case"backUrl":case"bottomUrl":case"frontUrl":case"leftUrl":case"rightUrl":case"topUrl":break;case"skyAngle":a=l;break;case"skyColor":s=l;break;default:console.warn("THREE.VRMLLoader: Unknown field:",t)}}const l=1e4;if(s){const e=new n.SphereGeometry(l,32,16),r=new n.MeshBasicMaterial({fog:!1,side:n.BackSide,depthWrite:!1,depthTest:!1});s.length>3?(I(e,l,a,C(s),!0),r.vertexColors=!0):r.color.setRGB(s[0],s[1],s[2]);const i=new n.Mesh(e,r);t.add(i)}if(i&&i.length>0){const e=new n.SphereGeometry(l,32,16,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),a=new n.MeshBasicMaterial({fog:!1,side:n.BackSide,vertexColors:!0,depthWrite:!1,depthTest:!1});I(e,l,r,C(i),!1);const s=new n.Mesh(e,a);t.add(s)}return t.renderOrder=-1/0,t}(e);break;case"Shape":r=function(e){const t=e.fields;let r,i,s=new n.MeshBasicMaterial({color:0});for(let n=0,o=t.length;n<o;n++){const e=t[n],i=e.name,o=e.values;switch(i){case"appearance":null!==o[0]&&(s=a(o[0]));break;case"geometry":null!==o[0]&&(r=a(o[0]));break;default:console.warn("THREE.VRMLLoader: Unknown field:",i)}}if(r&&r.attributes.position){const e=r._type;if("points"===e){const e=new n.PointsMaterial({color:16777215});void 0!==r.attributes.color?e.vertexColors=!0:s.isMeshPhongMaterial&&e.color.copy(s.emissive),i=new n.Points(r,e)}else if("line"===e){const e=new n.LineBasicMaterial({color:16777215});void 0!==r.attributes.color?e.vertexColors=!0:s.isMeshPhongMaterial&&e.color.copy(s.emissive),i=new n.LineSegments(r,e)}else void 0!==r._solid&&(s.side=r._solid?n.FrontSide:n.DoubleSide),void 0!==r.attributes.color&&(s.vertexColors=!0),i=new n.Mesh(r,s)}else i=new n.Object3D,i.visible=!1;return i}(e);break;case"Appearance":r=function(e){let t,r=new n.MeshPhongMaterial;const i=e.fields;for(let s=0,o=i.length;s<o;s++){const e=i[s],o=e.name,l=e.values;switch(o){case"material":if(null!==l[0]){const e=a(l[0]);e.diffuseColor&&r.color.copy(e.diffuseColor),e.emissiveColor&&r.emissive.copy(e.emissiveColor),e.shininess&&(r.shininess=e.shininess),e.specularColor&&r.specular.copy(e.specularColor),e.transparency&&(r.opacity=1-e.transparency),e.transparency>0&&(r.transparent=!0)}else r=new n.MeshBasicMaterial({color:0});break;case"texture":const e=l[0];null!==e&&("ImageTexture"!==e.name&&"PixelTexture"!==e.name||(r.map=a(e)));break;case"textureTransform":null!==l[0]&&(t=a(l[0]));break;default:console.warn("THREE.VRMLLoader: Unknown field:",o)}}if(r.map){if(r.map.__type){switch(r.map.__type){case fc.INTENSITY_ALPHA:r.opacity=1;break;case fc.RGB:r.color.set(16777215);break;case fc.RGBA:r.color.set(16777215),r.opacity=1}delete r.map.__type}t&&(r.map.center.copy(t.center),r.map.rotation=t.rotation,r.map.repeat.copy(t.scale),r.map.offset.copy(t.translation))}return r}(e);break;case"Material":r=function(e){const t={},r=e.fields;for(let i=0,a=r.length;i<a;i++){const e=r[i],a=e.name,s=e.values;switch(a){case"ambientIntensity":break;case"diffuseColor":t.diffuseColor=new n.Color(s[0],s[1],s[2]);break;case"emissiveColor":case"specularColor":t.emissiveColor=new n.Color(s[0],s[1],s[2]);break;case"shininess":t.shininess=s[0];break;case"transparency":t.transparency=s[0];break;default:console.warn("THREE.VRMLLoader: Unknown field:",a)}}return t}(e);break;case"ImageTexture":r=function(e){let t,r=n.RepeatWrapping,i=n.RepeatWrapping;const a=e.fields;for(let s=0,o=a.length;s<o;s++){const e=a[s],o=e.name,l=e.values;switch(o){case"url":const e=l[0];e&&(t=B.load(e));break;case"repeatS":!1===l[0]&&(r=n.ClampToEdgeWrapping);break;case"repeatT":!1===l[0]&&(i=n.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader: Unknown field:",o)}}t&&(t.wrapS=r,t.wrapT=i);return t}(e);break;case"PixelTexture":r=function(e){let t,r=n.RepeatWrapping,i=n.RepeatWrapping;const a=e.fields;for(let l=0,c=a.length;l<c;l++){const e=a[l],c=e.name,u=e.values;switch(c){case"image":const e=u[0],a=u[1],l=o(u[2]),h=new Uint8Array(4*e*a),d={r:0,g:0,b:0,a:0};for(let t=3,r=0,n=u.length;t<n;t++,r++){s(u[t],l,d);const e=4*r;h[e+0]=d.r,h[e+1]=d.g,h[e+2]=d.b,h[e+3]=d.a}t=new n.DataTexture(h,e,a),t.needsUpdate=!0,t.__type=l;break;case"repeatS":!1===u[0]&&(r=n.ClampToEdgeWrapping);break;case"repeatT":!1===u[0]&&(i=n.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader: Unknown field:",c)}}t&&(t.wrapS=r,t.wrapT=i);return t}(e);break;case"TextureTransform":r=function(e){const t={center:new n.Vector2,rotation:new n.Vector2,scale:new n.Vector2,translation:new n.Vector2},r=e.fields;for(let n=0,i=r.length;n<i;n++){const e=r[n],i=e.name,a=e.values;switch(i){case"center":t.center.set(a[0],a[1]);break;case"rotation":t.rotation=a[0];break;case"scale":t.scale.set(a[0],a[1]);break;case"translation":t.translation.set(a[0],a[1]);break;default:console.warn("THREE.VRMLLoader: Unknown field:",i)}}return t}(e);break;case"IndexedFaceSet":r=function(e){let t,r,i,s,o,l,d,p,f=!0,m=!0,g=0,v=!0,A=!0;const y=e.fields;for(let n=0,c=y.length;n<c;n++){const e=y[n],c=e.name,u=e.values;switch(c){case"color":const e=u[0];null!==e&&(t=a(e));break;case"coord":const n=u[0];null!==n&&(r=a(n));break;case"normal":const h=u[0];null!==h&&(i=a(h));break;case"texCoord":const y=u[0];null!==y&&(s=a(y));break;case"ccw":f=u[0];break;case"colorIndex":o=u;break;case"colorPerVertex":v=u[0];break;case"convex":break;case"coordIndex":l=u;break;case"creaseAngle":g=u[0];break;case"normalIndex":d=u;break;case"normalPerVertex":A=u[0];break;case"solid":m=u[0];break;case"texCoordIndex":p=u;break;default:console.warn("THREE.VRMLLoader: Unknown field:",c)}}if(void 0===l)return console.warn("THREE.VRMLLoader: Missing coordIndex."),new n.BufferGeometry;const w=c(l,f);let S,M,T;if(t)if(!0===v)if(o&&o.length>0){S=x(w,c(o,f),t,3)}else S=E(w,new n.Float32BufferAttribute(t,3));else if(o&&o.length>0){S=b(w,u(h(t,o),l))}else{S=b(w,u(t,l))}if(i)if(!0===A)if(d&&d.length>0){M=x(w,c(d,f),i,3)}else M=E(w,new n.Float32BufferAttribute(i,3));else if(d&&d.length>0){M=b(w,u(h(i,d),l))}else{M=b(w,u(i,l))}else M=_(w,r,g);if(s)if(p&&p.length>0){T=x(w,c(p,f),s,2)}else T=E(w,new n.Float32BufferAttribute(s,2));const C=new n.BufferGeometry,I=E(w,new n.Float32BufferAttribute(r,3));C.setAttribute("position",I),C.setAttribute("normal",M),S&&C.setAttribute("color",S);T&&C.setAttribute("uv",T);return C._solid=m,C._type="mesh",C}(e);break;case"IndexedLineSet":r=function(e){let t,r,i,s,o=!0;const l=e.fields;for(let n=0,h=l.length;n<h;n++){const e=l[n],c=e.name,u=e.values;switch(c){case"color":const e=u[0];null!==e&&(t=a(e));break;case"coord":const n=u[0];null!==n&&(r=a(n));break;case"colorIndex":i=u;break;case"colorPerVertex":o=u[0];break;case"coordIndex":s=u;break;default:console.warn("THREE.VRMLLoader: Unknown field:",c)}}let c;const u=d(s);if(t)if(!0===o)if(i.length>0){c=x(u,d(i),t,3)}else c=E(u,new n.Float32BufferAttribute(t,3));else if(i.length>0){c=w(u,p(h(t,i),s))}else{c=w(u,p(t,s))}const f=new n.BufferGeometry,m=E(u,new n.Float32BufferAttribute(r,3));f.setAttribute("position",m),c&&f.setAttribute("color",c);return f._type="line",f}(e);break;case"PointSet":r=function(e){let t,r;const i=e.fields;for(let n=0,o=i.length;n<o;n++){const e=i[n],s=e.name,o=e.values;switch(s){case"color":const e=o[0];null!==e&&(t=a(e));break;case"coord":const n=o[0];null!==n&&(r=a(n));break;default:console.warn("THREE.VRMLLoader: Unknown field:",s)}}const s=new n.BufferGeometry;s.setAttribute("position",new n.Float32BufferAttribute(r,3)),t&&s.setAttribute("color",new n.Float32BufferAttribute(t,3));return s._type="points",s}(e);break;case"Box":r=function(e){const t=new n.Vector3(2,2,2),r=e.fields;for(let n=0,i=r.length;n<i;n++){const e=r[n],i=e.name,a=e.values;if("size"===i)t.x=a[0],t.y=a[1],t.z=a[2];else console.warn("THREE.VRMLLoader: Unknown field:",i)}return new n.BoxGeometry(t.x,t.y,t.z)}(e);break;case"Cone":r=function(e){let t=1,r=2,i=!1;const a=e.fields;for(let n=0,s=a.length;n<s;n++){const e=a[n],s=e.name,o=e.values;switch(s){case"bottom":i=!o[0];break;case"bottomRadius":t=o[0];break;case"height":r=o[0];break;case"side":break;default:console.warn("THREE.VRMLLoader: Unknown field:",s)}}return new n.ConeGeometry(t,r,16,1,i)}(e);break;case"Cylinder":r=function(e){let t=1,r=2;const i=e.fields;for(let n=0,a=i.length;n<a;n++){const e=i[n],a=e.name,s=e.values;switch(a){case"bottom":case"side":case"top":break;case"radius":t=s[0];break;case"height":r=s[0];break;default:console.warn("THREE.VRMLLoader: Unknown field:",a)}}return new n.CylinderGeometry(t,t,r,16,1)}(e);break;case"Sphere":r=function(e){let t=1;const r=e.fields;for(let n=0,i=r.length;n<i;n++){const e=r[n],i=e.name,a=e.values;if("radius"===i)t=a[0];else console.warn("THREE.VRMLLoader: Unknown field:",i)}return new n.SphereGeometry(t,16,16)}(e);break;case"ElevationGrid":r=function(e){let t,r,i,s,o=!0,l=!0,c=!0,u=!0,h=0,d=2,p=2,f=1,m=1;const g=e.fields;for(let n=0,E=g.length;n<E;n++){const e=g[n],v=e.name,A=e.values;switch(v){case"color":const e=A[0];null!==e&&(t=a(e));break;case"normal":const n=A[0];null!==n&&(r=a(n));break;case"texCoord":const g=A[0];null!==g&&(i=a(g));break;case"height":s=A;break;case"ccw":u=A[0];break;case"colorPerVertex":o=A[0];break;case"creaseAngle":h=A[0];break;case"normalPerVertex":l=A[0];break;case"solid":c=A[0];break;case"xDimension":d=A[0];break;case"xSpacing":f=A[0];break;case"zDimension":p=A[0];break;case"zSpacing":m=A[0];break;default:console.warn("THREE.VRMLLoader: Unknown field:",v)}}const v=[],A=[],y=[],x=[];for(let n=0;n<p;n++)for(let e=0;e<d;e++){const a=n*d+e,c=f*n,u=s[a],h=m*e;if(v.push(c,u,h),t&&!0===o){const e=t[3*a+0],r=t[3*a+1],n=t[3*a+2];y.push(e,r,n)}if(r&&!0===l){const e=r[3*a+0],t=r[3*a+1],n=r[3*a+2];A.push(e,t,n)}if(i){const e=i[2*a+0],t=i[2*a+1];x.push(e,t)}else x.push(n/(d-1),e/(p-1))}const b=[];for(let n=0;n<d-1;n++)for(let e=0;e<p-1;e++){const t=n+e*d,r=n+(e+1)*d,i=n+1+(e+1)*d,a=n+1+e*d;!0===u?(b.push(t,i,r),b.push(i,t,a)):(b.push(t,r,i),b.push(i,a,t))}const w=E(b,new n.Float32BufferAttribute(v,3)),S=E(b,new n.Float32BufferAttribute(x,2));let M,T;if(t)if(!1===o){for(let e=0;e<d-1;e++)for(let r=0;r<p-1;r++){const n=e+r*(d-1),i=t[3*n+0],a=t[3*n+1],s=t[3*n+2];y.push(i,a,s),y.push(i,a,s),y.push(i,a,s),y.push(i,a,s),y.push(i,a,s),y.push(i,a,s)}M=new n.Float32BufferAttribute(y,3)}else M=E(b,new n.Float32BufferAttribute(y,3));if(r)if(!1===l){for(let e=0;e<d-1;e++)for(let t=0;t<p-1;t++){const n=e+t*(d-1),i=r[3*n+0],a=r[3*n+1],s=r[3*n+2];A.push(i,a,s),A.push(i,a,s),A.push(i,a,s),A.push(i,a,s),A.push(i,a,s),A.push(i,a,s)}T=new n.Float32BufferAttribute(A,3)}else T=E(b,new n.Float32BufferAttribute(A,3));else T=_(b,v,h);const C=new n.BufferGeometry;C.setAttribute("position",w),C.setAttribute("normal",T),C.setAttribute("uv",S),M&&C.setAttribute("color",M);return C._solid=c,C._type="mesh",C}(e);break;case"Extrusion":r=function(e){let t,r,i=[1,1,1,-1,-1,-1,-1,1,1,1],a=[0,0,0,0,1,0],s=!0,o=!0,l=0,c=!0,u=!0;const h=e.fields;for(let n=0,E=h.length;n<E;n++){const e=h[n],d=e.name,p=e.values;switch(d){case"beginCap":s=p[0];break;case"ccw":o=p[0];break;case"convex":break;case"creaseAngle":l=p[0];break;case"crossSection":i=p;break;case"endCap":c=p[0];break;case"orientation":r=p;break;case"scale":t=p;break;case"solid":u=p[0];break;case"spine":a=p;break;default:console.warn("THREE.VRMLLoader: Unknown field:",d)}}const d=i[0]===i[i.length-2]&&i[1]===i[i.length-1],p=[],f=new n.Vector3,m=new n.Vector3,g=new n.Vector3,v=new n.Vector3,A=new n.Quaternion;for(let n=0,E=0,_=0,T=a.length;n<T;n+=3,E+=2,_+=4){f.fromArray(a,n),m.x=t?t[E+0]:1,m.y=1,m.z=t?t[E+1]:1,g.x=r?r[_+0]:0,g.y=r?r[_+1]:0,g.z=r?r[_+2]:1;const e=r?r[_+3]:0;for(let t=0,r=i.length;t<r;t+=2)v.x=i[t+0],v.y=0,v.z=i[t+1],v.multiply(m),A.setFromAxisAngle(g,e),v.applyQuaternion(A),v.add(f),p.push(v.x,v.y,v.z)}const y=[],x=a.length/3,b=i.length/2;for(let n=0;n<x-1;n++)for(let e=0;e<b-1;e++){const t=e+n*b;let r=e+1+n*b;const i=e+(n+1)*b;let a=e+1+(n+1)*b;e===b-2&&!0===d&&(r=n*b,a=(n+1)*b),!0===o?(y.push(t,r,i),y.push(i,r,a)):(y.push(t,i,r),y.push(i,a,r))}if(!0===s||!0===c){const e=[];for(let a=0,s=i.length;a<s;a+=2)e.push(new n.Vector2(i[a],i[a+1]));const t=n.ShapeUtils.triangulateShape(e,[]),r=[];for(let n=0,i=t.length;n<i;n++){const e=t[n];r.push(e[0],e[1],e[2])}if(!0===s)for(let n=0,i=r.length;n<i;n+=3)!0===o?y.push(r[n+0],r[n+1],r[n+2]):y.push(r[n+0],r[n+2],r[n+1]);if(!0===c){const e=b*(x-1);for(let t=0,n=r.length;t<n;t+=3)!0===o?y.push(e+r[t+0],e+r[t+2],e+r[t+1]):y.push(e+r[t+0],e+r[t+1],e+r[t+2])}}const w=E(y,new n.Float32BufferAttribute(p,3)),S=_(y,p,l),M=new n.BufferGeometry;return M.setAttribute("position",w),M.setAttribute("normal",S),M._solid=u,M._type="mesh",M}(e);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":r=function(e){return e.fields[0].values}(e);break;case"WorldInfo":r=function(e){const t={},r=e.fields;for(let n=0,i=r.length;n<i;n++){const e=r[n],i=e.name,a=e.values;switch(i){case"title":t.title=a[0];break;case"info":t.info=a;break;default:console.warn("THREE.VRMLLoader: Unknown field:",i)}}return t}(e);break;case"Anchor":case"Billboard":case"Inline":case"LOD":case"Switch":case"AudioClip":case"DirectionalLight":case"PointLight":case"Script":case"Sound":case"SpotLight":case"CylinderSensor":case"PlaneSensor":case"ProximitySensor":case"SphereSensor":case"TimeSensor":case"TouchSensor":case"VisibilitySensor":case"Text":case"FontStyle":case"MovieTexture":case"ColorInterpolator":case"CoordinateInterpolator":case"NormalInterpolator":case"OrientationInterpolator":case"PositionInterpolator":case"ScalarInterpolator":case"Fog":case"NavigationInfo":case"Viewpoint":break;default:console.warn("THREE.VRMLLoader: Unknown node:",t)}void 0!==r&&void 0!==e.DEF&&!0===r.hasOwnProperty("name")&&(r.name=e.DEF);return r}(e)),e.build)}function s(e,t,r){let n;switch(t){case fc.INTENSITY:n=parseInt(e),r.r=n,r.g=n,r.b=n,r.a=1;break;case fc.INTENSITY_ALPHA:n=parseInt("0x"+e.substring(2,4)),r.r=n,r.g=n,r.b=n,r.a=parseInt("0x"+e.substring(4,6));break;case fc.RGB:r.r=parseInt("0x"+e.substring(2,4)),r.g=parseInt("0x"+e.substring(4,6)),r.b=parseInt("0x"+e.substring(6,8)),r.a=1;break;case fc.RGBA:r.r=parseInt("0x"+e.substring(2,4)),r.g=parseInt("0x"+e.substring(4,6)),r.b=parseInt("0x"+e.substring(6,8)),r.a=parseInt("0x"+e.substring(8,10))}}function o(e){let t;switch(e){case 1:t=fc.INTENSITY;break;case 2:t=fc.INTENSITY_ALPHA;break;case 3:t=fc.RGB;break;case 4:t=fc.RGBA}return t}function l(e,t){for(let r=0,i=e.length;r<i;r++){const i=a(e[r]);i instanceof n.Object3D&&t.add(i)}}function c(e,t){const r=[];let n=0;for(let i=0,a=e.length;i<a;i++){const s=e[n],o=e[i+(t?1:2)],l=e[i+(t?2:1)];r.push(s,o,l),(-1===e[i+3]||i+3>=a)&&(i+=3,n=i+1)}return r}function u(e,t){const r=[];let n=0;for(let i=0,a=t.length;i<a;i++){const s=3*n,o=e[s],l=e[s+1],c=e[s+2];r.push(o,l,c),(-1===t[i+3]||i+3>=a)&&(i+=3,n++)}return r}function h(e,t){const r=[];for(let n=0,i=t.length;n<i;n++){const i=3*t[n],a=e[i],s=e[i+1],o=e[i+2];r.push(a,s,o)}return r}function d(e){const t=[];for(let r=0,n=e.length;r<n;r++){const i=e[r],a=e[r+1];t.push(i,a),(-1===e[r+2]||r+2>=n)&&(r+=2)}return t}function p(e,t){const r=[];let n=0;for(let i=0,a=t.length;i<a;i++){const s=3*n,o=e[s],l=e[s+1],c=e[s+2];r.push(o,l,c),(-1===t[i+2]||i+2>=a)&&(i+=2,n++)}return r}const f=new n.Vector3,m=new n.Vector3,g=new n.Vector3,v=new n.Vector2,A=new n.Vector2,y=new n.Vector2;function x(e,t,r,i){const a=[];for(let n=0,s=e.length;n<s;n+=3){const e=t[n],s=t[n+1],o=t[n+2];2===i?(v.fromArray(r,e*i),A.fromArray(r,s*i),y.fromArray(r,o*i),a.push(v.x,v.y),a.push(A.x,A.y),a.push(y.x,y.y)):(f.fromArray(r,e*i),m.fromArray(r,s*i),g.fromArray(r,o*i),a.push(f.x,f.y,f.z),a.push(m.x,m.y,m.z),a.push(g.x,g.y,g.z))}return new n.Float32BufferAttribute(a,i)}function b(e,t){const r=[];for(let n=0,i=0,a=e.length;n<a;n+=3,i++)f.fromArray(t,3*i),r.push(f.x,f.y,f.z),r.push(f.x,f.y,f.z),r.push(f.x,f.y,f.z);return new n.Float32BufferAttribute(r,3)}function w(e,t){const r=[];for(let n=0,i=0,a=e.length;n<a;n+=2,i++)f.fromArray(t,3*i),r.push(f.x,f.y,f.z),r.push(f.x,f.y,f.z);return new n.Float32BufferAttribute(r,3)}function E(e,t){const r=t.array,i=t.itemSize,a=new r.constructor(e.length*i);let s=0,o=0;for(let n=0,l=e.length;n<l;n++){s=e[n]*i;for(let e=0;e<i;e++)a[o++]=r[s++]}return new n.Float32BufferAttribute(a,i)}const S=new n.Vector3,M=new n.Vector3;function _(e,t,r){const i=[],a={};for(let n=0,o=e.length;n<o;n+=3){const r=e[n],s=e[n+1],o=e[n+2],l=new pc(r,s,o);f.fromArray(t,3*r),m.fromArray(t,3*s),g.fromArray(t,3*o),M.subVectors(g,m),S.subVectors(f,m),M.cross(S),M.normalize(),l.normal.copy(M),void 0===a[r]&&(a[r]=[]),void 0===a[s]&&(a[s]=[]),void 0===a[o]&&(a[o]=[]),a[r].push(l.normal),a[s].push(l.normal),a[o].push(l.normal),i.push(l)}const s=[];for(let n=0,o=i.length;n<o;n++){const e=i[n],o=T(a[e.a],e.normal,r),l=T(a[e.b],e.normal,r),c=T(a[e.c],e.normal,r);f.fromArray(t,3*e.a),m.fromArray(t,3*e.b),g.fromArray(t,3*e.c),s.push(o.x,o.y,o.z),s.push(l.x,l.y,l.z),s.push(c.x,c.y,c.z)}return new n.Float32BufferAttribute(s,3)}function T(e,t,r){const i=new n.Vector3;if(0===r)i.copy(t);else for(let n=0,a=e.length;n<a;n++)e[n].angleTo(t)<r&&i.add(e[n]);return i.normalize()}function C(e){const t=[];for(let r=0,i=e.length;r<i;r+=3)t.push(new n.Color(e[r],e[r+1],e[r+2]));return t}function I(e,t,r,i,a){const s=[],o=!0===a?0:Math.PI;for(let p=0,f=i.length;p<f;p++){let e=0===p?0:r[p-1];e=!0===a?e:o-e;const i=new n.Vector3;i.setFromSphericalCoords(t,e,0),s.push(i)}const l=e.index,c=e.attributes.position,u=new n.BufferAttribute(new Float32Array(3*e.attributes.position.count),3),h=new n.Vector3,d=new n.Color;for(let n=0;n<l.count;n++){const e=l.getX(n);let t,r;h.fromBufferAttribute(c,e);let o=1;for(let n=1;n<s.length;n++){t=n-1,r=n;const e=s[t],i=s[r];if(!0===a){if(h.y<=e.y&&h.y>i.y){o=Math.abs(e.y-h.y)/Math.abs(e.y-i.y);break}}else if(h.y>=e.y&&h.y<i.y){o=Math.abs(e.y-h.y)/Math.abs(e.y-i.y);break}}const p=i[t],f=i[r];d.copy(p).lerp(f,o),u.setXYZ(e,d.r,d.g,d.b)}e.setAttribute("color",u)}const B=new n.TextureLoader(this.manager);if(B.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),-1===e.indexOf("#VRML V2.0"))throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");return function(e){const t=e.nodes,r=new n.Scene;for(let n=0,a=t.length;n<a;n++){i(t[n])}for(let i=0,s=t.length;i<s;i++){const e=t[i],s=a(e);s instanceof n.Object3D&&r.add(s),"WorldInfo"===e.name&&(r.userData.worldInfo=s)}return r}(function(e){const t=function(){const e=cc({name:"RouteIdentifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*[\.][^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/}),t=cc({name:"Identifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/,longer_alt:e}),r=["Anchor","Billboard","Collision","Group","Transform","Inline","LOD","Switch","AudioClip","DirectionalLight","PointLight","Script","Shape","Sound","SpotLight","WorldInfo","CylinderSensor","PlaneSensor","ProximitySensor","SphereSensor","TimeSensor","TouchSensor","VisibilitySensor","Box","Cone","Cylinder","ElevationGrid","Extrusion","IndexedFaceSet","IndexedLineSet","PointSet","Sphere","Color","Coordinate","Normal","TextureCoordinate","Appearance","FontStyle","ImageTexture","Material","MovieTexture","PixelTexture","TextureTransform","ColorInterpolator","CoordinateInterpolator","NormalInterpolator","OrientationInterpolator","PositionInterpolator","ScalarInterpolator","Background","Fog","NavigationInfo","Viewpoint","Text"],n=cc({name:"Version",pattern:/#VRML.*/,longer_alt:t}),i=cc({name:"NodeName",pattern:new RegExp(r.join("|")),longer_alt:t}),a=cc({name:"DEF",pattern:/DEF/,longer_alt:t}),s=cc({name:"USE",pattern:/USE/,longer_alt:t}),o=cc({name:"ROUTE",pattern:/ROUTE/,longer_alt:t}),l=cc({name:"TO",pattern:/TO/,longer_alt:t}),c=cc({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),u=cc({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),h=cc({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),d=cc({name:"TrueLiteral",pattern:/TRUE/}),p=cc({name:"FalseLiteral",pattern:/FALSE/}),f=cc({name:"NullLiteral",pattern:/NULL/}),m=cc({name:"LSquare",pattern:/\[/}),g=cc({name:"RSquare",pattern:/]/}),v=cc({name:"LCurly",pattern:/{/}),A=cc({name:"RCurly",pattern:/}/}),y=cc({name:"Comment",pattern:/#.*/,group:lc.SKIPPED}),x=[cc({name:"WhiteSpace",pattern:/[ ,\s]/,group:lc.SKIPPED}),i,a,s,o,l,d,p,f,n,t,e,c,u,h,m,g,v,A,y],b={};for(let w=0,E=x.length;w<E;w++){const e=x[w];b[e.name]=e}return{tokens:x,tokenVocabulary:b}}(),r=new hc(t.tokens),n=new dc(t.tokenVocabulary),i=function(e){function t(){e.call(this),this.validateVisitor()}function r(e,t){const r={type:null,values:[]};if(t.node){r.type="node";for(let n=0,i=t.node.length;n<i;n++){const i=t.node[n];r.values.push(e.visit(i))}}if(t.use){r.type="use";for(let n=0,i=t.use.length;n<i;n++){const i=t.use[n];r.values.push(e.visit(i))}}if(t.StringLiteral){r.type="string";for(let e=0,n=t.StringLiteral.length;e<n;e++){const n=t.StringLiteral[e];r.values.push(n.image.replace(/'|"/g,""))}}if(t.NumberLiteral){r.type="number";for(let e=0,n=t.NumberLiteral.length;e<n;e++){const n=t.NumberLiteral[e];r.values.push(parseFloat(n.image))}}if(t.HexLiteral){r.type="hex";for(let e=0,n=t.HexLiteral.length;e<n;e++){const n=t.HexLiteral[e];r.values.push(n.image)}}if(t.TrueLiteral){r.type="boolean";for(let e=0,n=t.TrueLiteral.length;e<n;e++){"TRUE"===t.TrueLiteral[e].image&&r.values.push(!0)}}if(t.FalseLiteral){r.type="boolean";for(let e=0,n=t.FalseLiteral.length;e<n;e++){"FALSE"===t.FalseLiteral[e].image&&r.values.push(!1)}}return t.NullLiteral&&(r.type="null",t.NullLiteral.forEach((function(){r.values.push(null)}))),r}return t.prototype=Object.assign(Object.create(e.prototype),{constructor:t,vrml:function(e){const t={version:this.visit(e.version),nodes:[],routes:[]};for(let r=0,n=e.node.length;r<n;r++){const n=e.node[r];t.nodes.push(this.visit(n))}if(e.route)for(let r=0,n=e.route.length;r<n;r++){const n=e.route[r];t.routes.push(this.visit(n))}return t},version:function(e){return e.Version[0].image},node:function(e){const t={name:e.NodeName[0].image,fields:[]};if(e.field)for(let r=0,n=e.field.length;r<n;r++){const n=e.field[r];t.fields.push(this.visit(n))}return e.def&&(t.DEF=this.visit(e.def[0])),t},field:function(e){const t={name:e.Identifier[0].image,type:null,values:null};let r;return e.singleFieldValue&&(r=this.visit(e.singleFieldValue[0])),e.multiFieldValue&&(r=this.visit(e.multiFieldValue[0])),t.type=r.type,t.values=r.values,t},def:function(e){return(e.Identifier||e.NodeName)[0].image},use:function(e){return{USE:(e.Identifier||e.NodeName)[0].image}},singleFieldValue:function(e){return r(this,e)},multiFieldValue:function(e){return r(this,e)},route:function(e){return{FROM:e.RouteIdentifier[0].image,TO:e.RouteIdentifier[1].image}}}),new t}(n.getBaseCstVisitorConstructor()),a=r.lex(e);n.input=a.tokens;const s=n.vrml();if(n.errors.length>0)throw console.error(n.errors),Error("THREE.VRMLLoader: Parsing errors detected.");return i.visit(s)}(e))}}class hc{constructor(e){this.lexer=new lc(e)}lex(e){const t=this.lexer.tokenize(e);if(t.errors.length>0)throw console.error(t.errors),Error("THREE.VRMLLexer: Lexing errors detected.");return t}}class dc extends oc{constructor(e){super(e);const t=this,r=e.Version,n=e.LCurly,i=e.RCurly,a=e.LSquare,s=e.RSquare,o=e.Identifier,l=e.RouteIdentifier,c=e.StringLiteral,u=e.HexLiteral,h=e.NumberLiteral,d=e.TrueLiteral,p=e.FalseLiteral,f=e.NullLiteral,m=e.DEF,g=e.USE,v=e.ROUTE,A=e.TO,y=e.NodeName;t.RULE("vrml",(function(){t.SUBRULE(t.version),t.AT_LEAST_ONE((function(){t.SUBRULE(t.node)})),t.MANY((function(){t.SUBRULE(t.route)}))})),t.RULE("version",(function(){t.CONSUME(r)})),t.RULE("node",(function(){t.OPTION((function(){t.SUBRULE(t.def)})),t.CONSUME(y),t.CONSUME(n),t.MANY((function(){t.SUBRULE(t.field)})),t.CONSUME(i)})),t.RULE("field",(function(){t.CONSUME(o),t.OR2([{ALT:function(){t.SUBRULE(t.singleFieldValue)}},{ALT:function(){t.SUBRULE(t.multiFieldValue)}}])})),t.RULE("def",(function(){t.CONSUME(m),t.OR([{ALT:function(){t.CONSUME(o)}},{ALT:function(){t.CONSUME(y)}}])})),t.RULE("use",(function(){t.CONSUME(g),t.OR([{ALT:function(){t.CONSUME(o)}},{ALT:function(){t.CONSUME(y)}}])})),t.RULE("singleFieldValue",(function(){t.AT_LEAST_ONE((function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(c)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(d)}},{ALT:function(){t.CONSUME(p)}},{ALT:function(){t.CONSUME(f)}}])}))})),t.RULE("multiFieldValue",(function(){t.CONSUME(a),t.MANY((function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(c)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(f)}}])})),t.CONSUME(s)})),t.RULE("route",(function(){t.CONSUME(v),t.CONSUME(l),t.CONSUME(A),t.CONSUME2(l)})),this.performSelfAnalysis()}}class pc{constructor(e,t,r){this.a=e,this.b=t,this.c=r,this.normal=new n.Vector3}}const fc={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};var mc,gc,vc=r(28934);class Ac extends n.Loader{setQuality(e){this._quality=e}load(e,t,r,i){const a=this._quality||1,s=new n.CanvasTexture;s.minFilter=n.NearestFilter;const o=new n.FileLoader(this.manager);return o.setPath(this.path),o.setWithCredentials(this.withCredentials),o.load(e,(function(e){const r=JSON.parse(e),n=document.createElement("div");n.style.width=r.w+"px",n.style.height=r.h+"px",document.body.appendChild(n);const i=bodymovin.loadAnimation({container:n,animType:"canvas",loop:!0,autoplay:!0,animationData:r,rendererSettings:{dpr:a}});s.animation=i,s.image=i.container,i.addEventListener("enterFrame",(function(){s.needsUpdate=!0})),n.style.display="none",void 0!==t&&t(s)}),r,i),s}}String.prototype.codePointAt||(mc=function(){try{var e={},t=Object.defineProperty,r=t(e,e,e)&&t}catch(n){}return r}(),gc=function(e){if(null==this)throw TypeError();var t=String(this),r=t.length,n=e?Number(e):0;if(n!=n&&(n=0),!(n<0||n>=r)){var i,a=t.charCodeAt(n);return a>=55296&&a<=56319&&r>n+1&&(i=t.charCodeAt(n+1))>=56320&&i<=57343?1024*(a-55296)+i-56320+65536:a}},mc?mc(String.prototype,"codePointAt",{value:gc,configurable:!0,writable:!0}):String.prototype.codePointAt=gc);function yc(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function xc(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new yc,this.dtree=new yc}var bc=new yc,wc=new yc,Ec=new Uint8Array(30),Sc=new Uint16Array(30),Mc=new Uint8Array(30),_c=new Uint16Array(30),Tc=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Cc=new yc,Ic=new Uint8Array(320);function Bc(e,t,r,n){var i,a;for(i=0;i<r;++i)e[i]=0;for(i=0;i<30-r;++i)e[i+r]=i/r|0;for(a=n,i=0;i<30;++i)t[i]=a,a+=1<<e[i]}var Rc=new Uint16Array(16);function Pc(e,t,r,n){var i,a;for(i=0;i<16;++i)e.table[i]=0;for(i=0;i<n;++i)e.table[t[r+i]]++;for(e.table[0]=0,a=0,i=0;i<16;++i)Rc[i]=a,a+=e.table[i];for(i=0;i<n;++i)t[r+i]&&(e.trans[Rc[t[r+i]]++]=i)}function Fc(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=1&e.tag;return e.tag>>>=1,t}function Lc(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,n+r}function Dc(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var r=0,n=0,i=0,a=e.tag;do{n=2*n+(1&a),a>>>=1,++i,r+=t.table[i],n-=t.table[i]}while(n>=0);return e.tag=a,e.bitcount-=i,t.trans[r+n]}function Uc(e,t,r){var n,i,a,s,o,l;for(n=Lc(e,5,257),i=Lc(e,5,1),a=Lc(e,4,4),s=0;s<19;++s)Ic[s]=0;for(s=0;s<a;++s){var c=Lc(e,3,0);Ic[Tc[s]]=c}for(Pc(Cc,Ic,0,19),o=0;o<n+i;){var u=Dc(e,Cc);switch(u){case 16:var h=Ic[o-1];for(l=Lc(e,2,3);l;--l)Ic[o++]=h;break;case 17:for(l=Lc(e,3,3);l;--l)Ic[o++]=0;break;case 18:for(l=Lc(e,7,11);l;--l)Ic[o++]=0;break;default:Ic[o++]=u}}Pc(t,Ic,0,n),Pc(r,Ic,n,i)}function Nc(e,t,r){for(;;){var n,i,a,s,o=Dc(e,t);if(256===o)return 0;if(o<256)e.dest[e.destLen++]=o;else for(n=Lc(e,Ec[o-=257],Sc[o]),i=Dc(e,r),s=a=e.destLen-Lc(e,Mc[i],_c[i]);s<a+n;++s)e.dest[e.destLen++]=e.dest[s]}}function kc(e){for(var t,r;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if((t=256*(t=e.source[e.sourceIndex+1])+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return-3;for(e.sourceIndex+=4,r=t;r;--r)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,0}!function(e,t){var r;for(r=0;r<7;++r)e.table[r]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,r=0;r<24;++r)e.trans[r]=256+r;for(r=0;r<144;++r)e.trans[24+r]=r;for(r=0;r<8;++r)e.trans[168+r]=280+r;for(r=0;r<112;++r)e.trans[176+r]=144+r;for(r=0;r<5;++r)t.table[r]=0;for(t.table[5]=32,r=0;r<32;++r)t.trans[r]=r}(bc,wc),Bc(Ec,Sc,4,3),Bc(Mc,_c,2,1),Ec[28]=0,Sc[28]=258;var Oc=function(e,t){var r,n,i=new xc(e,t);do{switch(r=Fc(i),Lc(i,2,0)){case 0:n=kc(i);break;case 1:n=Nc(i,bc,wc);break;case 2:Uc(i,i.ltree,i.dtree),n=Nc(i,i.ltree,i.dtree);break;default:n=-3}if(0!==n)throw new Error("Data error")}while(!r);return i.destLen<i.dest.length?"function"==typeof i.dest.slice?i.dest.slice(0,i.destLen):i.dest.subarray(0,i.destLen):i.dest};function Gc(e,t,r,n,i){return Math.pow(1-i,3)*e+3*Math.pow(1-i,2)*i*t+3*(1-i)*Math.pow(i,2)*r+Math.pow(i,3)*n}function zc(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}function Vc(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}function Hc(e){throw new Error(e)}function Qc(e,t){e||Hc(t)}zc.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},zc.prototype.addPoint=function(e,t){"number"==typeof e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},zc.prototype.addX=function(e){this.addPoint(e,null)},zc.prototype.addY=function(e){this.addPoint(null,e)},zc.prototype.addBezier=function(e,t,r,n,i,a,s,o){var l=[e,t],c=[r,n],u=[i,a],h=[s,o];this.addPoint(e,t),this.addPoint(s,o);for(var d=0;d<=1;d++){var p=6*l[d]-12*c[d]+6*u[d],f=-3*l[d]+9*c[d]-9*u[d]+3*h[d],m=3*c[d]-3*l[d];if(0!==f){var g=Math.pow(p,2)-4*m*f;if(!(g<0)){var v=(-p+Math.sqrt(g))/(2*f);0<v&&v<1&&(0===d&&this.addX(Gc(l[d],c[d],u[d],h[d],v)),1===d&&this.addY(Gc(l[d],c[d],u[d],h[d],v)));var A=(-p-Math.sqrt(g))/(2*f);0<A&&A<1&&(0===d&&this.addX(Gc(l[d],c[d],u[d],h[d],A)),1===d&&this.addY(Gc(l[d],c[d],u[d],h[d],A)))}}else{if(0===p)continue;var y=-m/p;0<y&&y<1&&(0===d&&this.addX(Gc(l[d],c[d],u[d],h[d],y)),1===d&&this.addY(Gc(l[d],c[d],u[d],h[d],y)))}}},zc.prototype.addQuad=function(e,t,r,n,i,a){var s=e+2/3*(r-e),o=t+2/3*(n-t),l=s+1/3*(i-e),c=o+1/3*(a-t);this.addBezier(e,t,s,o,l,c,i,a)},Vc.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},Vc.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},Vc.prototype.curveTo=Vc.prototype.bezierCurveTo=function(e,t,r,n,i,a){this.commands.push({type:"C",x1:e,y1:t,x2:r,y2:n,x:i,y:a})},Vc.prototype.quadTo=Vc.prototype.quadraticCurveTo=function(e,t,r,n){this.commands.push({type:"Q",x1:e,y1:t,x:r,y:n})},Vc.prototype.close=Vc.prototype.closePath=function(){this.commands.push({type:"Z"})},Vc.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof zc){var t=e;return this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close()}Array.prototype.push.apply(this.commands,e)},Vc.prototype.getBoundingBox=function(){for(var e=new zc,t=0,r=0,n=0,i=0,a=0;a<this.commands.length;a++){var s=this.commands[a];switch(s.type){case"M":e.addPoint(s.x,s.y),t=n=s.x,r=i=s.y;break;case"L":e.addPoint(s.x,s.y),n=s.x,i=s.y;break;case"Q":e.addQuad(n,i,s.x1,s.y1,s.x,s.y),n=s.x,i=s.y;break;case"C":e.addBezier(n,i,s.x1,s.y1,s.x2,s.y2,s.x,s.y),n=s.x,i=s.y;break;case"Z":n=t,i=r;break;default:throw new Error("Unexpected path command "+s.type)}}return e.isEmpty()&&e.addPoint(0,0),e},Vc.prototype.draw=function(e){e.beginPath();for(var t=0;t<this.commands.length;t+=1){var r=this.commands[t];"M"===r.type?e.moveTo(r.x,r.y):"L"===r.type?e.lineTo(r.x,r.y):"C"===r.type?e.bezierCurveTo(r.x1,r.y1,r.x2,r.y2,r.x,r.y):"Q"===r.type?e.quadraticCurveTo(r.x1,r.y1,r.x,r.y):"Z"===r.type&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},Vc.prototype.toPathData=function(e){function t(t){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function r(){for(var e=arguments,r="",n=0;n<arguments.length;n+=1){var i=e[n];i>=0&&n>0&&(r+=" "),r+=t(i)}return r}e=void 0!==e?e:2;for(var n="",i=0;i<this.commands.length;i+=1){var a=this.commands[i];"M"===a.type?n+="M"+r(a.x,a.y):"L"===a.type?n+="L"+r(a.x,a.y):"C"===a.type?n+="C"+r(a.x1,a.y1,a.x2,a.y2,a.x,a.y):"Q"===a.type?n+="Q"+r(a.x1,a.y1,a.x,a.y):"Z"===a.type&&(n+="Z")}return n},Vc.prototype.toSVG=function(e){var t='<path d="';return t+=this.toPathData(e),t+='"',this.fill&&"black"!==this.fill&&(null===this.fill?t+=' fill="none"':t+=' fill="'+this.fill+'"'),this.stroke&&(t+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),t+="/>"},Vc.prototype.toDOMElement=function(e){var t=this.toPathData(e),r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",t),r};var jc={fail:Hc,argument:Qc,assert:Qc},Wc=2147483648,Xc={},Yc={},qc={};function Kc(e){return function(){return e}}Yc.BYTE=function(e){return jc.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},qc.BYTE=Kc(1),Yc.CHAR=function(e){return[e.charCodeAt(0)]},qc.CHAR=Kc(1),Yc.CHARARRAY=function(e){void 0===e&&(e="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var t=[],r=0;r<e.length;r+=1)t[r]=e.charCodeAt(r);return t},qc.CHARARRAY=function(e){return void 0===e?0:e.length},Yc.USHORT=function(e){return[e>>8&255,255&e]},qc.USHORT=Kc(2),Yc.SHORT=function(e){return e>=32768&&(e=-(65536-e)),[e>>8&255,255&e]},qc.SHORT=Kc(2),Yc.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},qc.UINT24=Kc(3),Yc.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},qc.ULONG=Kc(4),Yc.LONG=function(e){return e>=Wc&&(e=-(2*Wc-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},qc.LONG=Kc(4),Yc.FIXED=Yc.ULONG,qc.FIXED=qc.ULONG,Yc.FWORD=Yc.SHORT,qc.FWORD=qc.SHORT,Yc.UFWORD=Yc.USHORT,qc.UFWORD=qc.USHORT,Yc.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},qc.LONGDATETIME=Kc(8),Yc.TAG=function(e){return jc.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},qc.TAG=Kc(4),Yc.Card8=Yc.BYTE,qc.Card8=qc.BYTE,Yc.Card16=Yc.USHORT,qc.Card16=qc.USHORT,Yc.OffSize=Yc.BYTE,qc.OffSize=qc.BYTE,Yc.SID=Yc.USHORT,qc.SID=qc.USHORT,Yc.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?Yc.NUMBER16(e):Yc.NUMBER32(e)},qc.NUMBER=function(e){return Yc.NUMBER(e).length},Yc.NUMBER16=function(e){return[28,e>>8&255,255&e]},qc.NUMBER16=Kc(3),Yc.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},qc.NUMBER32=Kc(5),Yc.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var n=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*n)/n).toString()}for(var i="",a=0,s=t.length;a<s;a+=1){var o=t[a];i+="e"===o?"-"===t[++a]?"c":"b":"."===o?"a":"-"===o?"e":o}for(var l=[30],c=0,u=(i+=1&i.length?"f":"ff").length;c<u;c+=2)l.push(parseInt(i.substr(c,2),16));return l},qc.REAL=function(e){return Yc.REAL(e).length},Yc.NAME=Yc.CHARARRAY,qc.NAME=qc.CHARARRAY,Yc.STRING=Yc.CHARARRAY,qc.STRING=qc.CHARARRAY,Xc.UTF8=function(e,t,r){for(var n=[],i=r,a=0;a<i;a++,t+=1)n[a]=e.getUint8(t);return String.fromCharCode.apply(null,n)},Xc.UTF16=function(e,t,r){for(var n=[],i=r/2,a=0;a<i;a++,t+=2)n[a]=e.getUint16(t);return String.fromCharCode.apply(null,n)},Yc.UTF16=function(e){for(var t=[],r=0;r<e.length;r+=1){var n=e.charCodeAt(r);t[t.length]=n>>8&255,t[t.length]=255&n}return t},qc.UTF16=function(e){return 2*e.length};var Jc={"x-mac-croatian":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\u0160\u2122\xb4\xa8\u2260\u017d\xd8\u221e\xb1\u2264\u2265\u2206\xb5\u2202\u2211\u220f\u0161\u222b\xaa\xba\u03a9\u017e\xf8\xbf\xa1\xac\u221a\u0192\u2248\u0106\xab\u010c\u2026\xa0\xc0\xc3\xd5\u0152\u0153\u0110\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\uf8ff\xa9\u2044\u20ac\u2039\u203a\xc6\xbb\u2013\xb7\u201a\u201e\u2030\xc2\u0107\xc1\u010d\xc8\xcd\xce\xcf\xcc\xd3\xd4\u0111\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u03c0\xcb\u02da\xb8\xca\xe6\u02c7","x-mac-cyrillic":"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u2020\xb0\u0490\xa3\xa7\u2022\xb6\u0406\xae\xa9\u2122\u0402\u0452\u2260\u0403\u0453\u221e\xb1\u2264\u2265\u0456\xb5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040a\u045a\u0458\u0405\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026\xa0\u040b\u045b\u040c\u045c\u0455\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u201e\u040e\u045e\u040f\u045f\u2116\u0401\u0451\u044f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e","x-mac-gaelic":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u1e02\xb1\u2264\u2265\u1e03\u010a\u010b\u1e0a\u1e0b\u1e1e\u1e1f\u0120\u0121\u1e40\xe6\xf8\u1e41\u1e56\u1e57\u027c\u0192\u017f\u1e60\xab\xbb\u2026\xa0\xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u1e61\u1e9b\xff\u0178\u1e6a\u20ac\u2039\u203a\u0176\u0177\u1e6b\xb7\u1ef2\u1ef3\u204a\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\u2663\xd2\xda\xdb\xd9\u0131\xdd\xfd\u0174\u0175\u1e84\u1e85\u1e80\u1e81\u1e82\u1e83","x-mac-greek":"\xc4\xb9\xb2\xc9\xb3\xd6\xdc\u0385\xe0\xe2\xe4\u0384\xa8\xe7\xe9\xe8\xea\xeb\xa3\u2122\xee\xef\u2022\xbd\u2030\xf4\xf6\xa6\u20ac\xf9\xfb\xfc\u2020\u0393\u0394\u0398\u039b\u039e\u03a0\xdf\xae\xa9\u03a3\u03aa\xa7\u2260\xb0\xb7\u0391\xb1\u2264\u2265\xa5\u0392\u0395\u0396\u0397\u0399\u039a\u039c\u03a6\u03ab\u03a8\u03a9\u03ac\u039d\xac\u039f\u03a1\u2248\u03a4\xab\xbb\u2026\xa0\u03a5\u03a7\u0386\u0388\u0153\u2013\u2015\u201c\u201d\u2018\u2019\xf7\u0389\u038a\u038c\u038e\u03ad\u03ae\u03af\u03cc\u038f\u03cd\u03b1\u03b2\u03c8\u03b4\u03b5\u03c6\u03b3\u03b7\u03b9\u03be\u03ba\u03bb\u03bc\u03bd\u03bf\u03c0\u03ce\u03c1\u03c3\u03c4\u03b8\u03c9\u03c2\u03c7\u03c5\u03b6\u03ca\u03cb\u0390\u03b0\xad","x-mac-icelandic":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\xdd\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\xe6\xf8\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026\xa0\xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u2044\u20ac\xd0\xf0\xde\xfe\xfd\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7","x-mac-inuit":"\u1403\u1404\u1405\u1406\u140a\u140b\u1431\u1432\u1433\u1434\u1438\u1439\u1449\u144e\u144f\u1450\u1451\u1455\u1456\u1466\u146d\u146e\u146f\u1470\u1472\u1473\u1483\u148b\u148c\u148d\u148e\u1490\u1491\xb0\u14a1\u14a5\u14a6\u2022\xb6\u14a7\xae\xa9\u2122\u14a8\u14aa\u14ab\u14bb\u14c2\u14c3\u14c4\u14c5\u14c7\u14c8\u14d0\u14ef\u14f0\u14f1\u14f2\u14f4\u14f5\u1505\u14d5\u14d6\u14d7\u14d8\u14da\u14db\u14ea\u1528\u1529\u152a\u152b\u152d\u2026\xa0\u152e\u153e\u1555\u1556\u1557\u2013\u2014\u201c\u201d\u2018\u2019\u1558\u1559\u155a\u155d\u1546\u1547\u1548\u1549\u154b\u154c\u1550\u157f\u1580\u1581\u1582\u1583\u1584\u1585\u158f\u1590\u1591\u1592\u1593\u1594\u1595\u1671\u1672\u1673\u1674\u1675\u1676\u1596\u15a0\u15a1\u15a2\u15a3\u15a4\u15a5\u15a6\u157c\u0141\u0142","x-mac-ce":"\xc4\u0100\u0101\xc9\u0104\xd6\xdc\xe1\u0105\u010c\xe4\u010d\u0106\u0107\xe9\u0179\u017a\u010e\xed\u010f\u0112\u0113\u0116\xf3\u0117\xf4\xf6\xf5\xfa\u011a\u011b\xfc\u2020\xb0\u0118\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\u0119\xa8\u2260\u0123\u012e\u012f\u012a\u2264\u2265\u012b\u0136\u2202\u2211\u0142\u013b\u013c\u013d\u013e\u0139\u013a\u0145\u0146\u0143\xac\u221a\u0144\u0147\u2206\xab\xbb\u2026\xa0\u0148\u0150\xd5\u0151\u014c\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\u014d\u0154\u0155\u0158\u2039\u203a\u0159\u0156\u0157\u0160\u201a\u201e\u0161\u015a\u015b\xc1\u0164\u0165\xcd\u017d\u017e\u016a\xd3\xd4\u016b\u016e\xda\u016f\u0170\u0171\u0172\u0173\xdd\xfd\u0137\u017b\u0141\u017c\u0122\u02c7",macintosh:"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\xe6\xf8\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026\xa0\xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u2044\u20ac\u2039\u203a\ufb01\ufb02\u2021\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7","x-mac-romanian":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\u0102\u0218\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\u0103\u0219\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026\xa0\xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u2044\u20ac\u2039\u203a\u021a\u021b\u2021\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7","x-mac-turkish":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\xe6\xf8\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026\xa0\xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u011e\u011f\u0130\u0131\u015e\u015f\u2021\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\uf8a0\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7"};Xc.MACSTRING=function(e,t,r,n){var i=Jc[n];if(void 0!==i){for(var a="",s=0;s<r;s++){var o=e.getUint8(t+s);a+=o<=127?String.fromCharCode(o):i[127&o]}return a}};var Zc,$c="function"==typeof WeakMap&&new WeakMap;function eu(e){return e>=-128&&e<=127}function tu(e,t,r){for(var n=0,i=e.length;t<i&&n<64&&0===e[t];)++t,++n;return r.push(128|n-1),t}function ru(e,t,r){for(var n=0,i=e.length,a=t;a<i&&n<64;){var s=e[a];if(!eu(s))break;if(0===s&&a+1<i&&0===e[a+1])break;++a,++n}r.push(n-1);for(var o=t;o<a;++o)r.push(e[o]+256&255);return a}function nu(e,t,r){for(var n=0,i=e.length,a=t;a<i&&n<64;){var s=e[a];if(0===s)break;if(eu(s)&&a+1<i&&eu(e[a+1]))break;++a,++n}r.push(64|n-1);for(var o=t;o<a;++o){var l=e[o];r.push(l+65536>>8&255,l+256&255)}return a}Yc.MACSTRING=function(e,t){var r=function(e){if(!Zc)for(var t in Zc={},Jc)Zc[t]=new String(t);var r=Zc[e];if(void 0!==r){if($c){var n=$c.get(r);if(void 0!==n)return n}var i=Jc[e];if(void 0!==i){for(var a={},s=0;s<i.length;s++)a[i.charCodeAt(s)]=s+128;return $c&&$c.set(r,a),a}}}(t);if(void 0!==r){for(var n=[],i=0;i<e.length;i++){var a=e.charCodeAt(i);if(a>=128&&void 0===(a=r[a]))return;n[i]=a}return n}},qc.MACSTRING=function(e,t){var r=Yc.MACSTRING(e,t);return void 0!==r?r.length:0},Yc.VARDELTAS=function(e){for(var t=0,r=[];t<e.length;){var n=e[t];t=0===n?tu(e,t,r):n>=-128&&n<=127?ru(e,t,r):nu(e,t,r)}return r},Yc.INDEX=function(e){for(var t=1,r=[t],n=[],i=0;i<e.length;i+=1){var a=Yc.OBJECT(e[i]);Array.prototype.push.apply(n,a),t+=a.length,r.push(t)}if(0===n.length)return[0,0];for(var s=[],o=1+Math.floor(Math.log(t)/Math.log(2))/8|0,l=[void 0,Yc.BYTE,Yc.USHORT,Yc.UINT24,Yc.ULONG][o],c=0;c<r.length;c+=1){var u=l(r[c]);Array.prototype.push.apply(s,u)}return Array.prototype.concat(Yc.Card16(e.length),Yc.OffSize(o),s,n)},qc.INDEX=function(e){return Yc.INDEX(e).length},Yc.DICT=function(e){for(var t=[],r=Object.keys(e),n=r.length,i=0;i<n;i+=1){var a=parseInt(r[i],0),s=e[a];t=(t=t.concat(Yc.OPERAND(s.value,s.type))).concat(Yc.OPERATOR(a))}return t},qc.DICT=function(e){return Yc.DICT(e).length},Yc.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},Yc.OPERAND=function(e,t){var r=[];if(Array.isArray(t))for(var n=0;n<t.length;n+=1)jc.argument(e.length===t.length,"Not enough arguments given for type"+t),r=r.concat(Yc.OPERAND(e[n],t[n]));else if("SID"===t)r=r.concat(Yc.NUMBER(e));else if("offset"===t)r=r.concat(Yc.NUMBER32(e));else if("number"===t)r=r.concat(Yc.NUMBER(e));else{if("real"!==t)throw new Error("Unknown operand type "+t);r=r.concat(Yc.REAL(e))}return r},Yc.OP=Yc.BYTE,qc.OP=qc.BYTE;var iu="function"==typeof WeakMap&&new WeakMap;function au(e,t,r){if(t.length&&("coverageFormat"!==t[0].name||1===t[0].value))for(var n=0;n<t.length;n+=1){var i=t[n];this[i.name]=i.value}if(this.tableName=e,this.fields=t,r)for(var a=Object.keys(r),s=0;s<a.length;s+=1){var o=a[s],l=r[o];void 0!==this[o]&&(this[o]=l)}}function su(e,t,r){void 0===r&&(r=t.length);var n=new Array(t.length+1);n[0]={name:e+"Count",type:"USHORT",value:r};for(var i=0;i<t.length;i++)n[i+1]={name:e+i,type:"USHORT",value:t[i]};return n}function ou(e,t,r){var n=t.length,i=new Array(n+1);i[0]={name:e+"Count",type:"USHORT",value:n};for(var a=0;a<n;a++)i[a+1]={name:e+a,type:"TABLE",value:r(t[a],a)};return i}function lu(e,t,r){var n=t.length,i=[];i[0]={name:e+"Count",type:"USHORT",value:n};for(var a=0;a<n;a++)i=i.concat(r(t[a],a));return i}function cu(e){1===e.format?au.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(su("glyph",e.glyphs))):2===e.format?au.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(lu("rangeRecord",e.ranges,(function(e){return[{name:"startGlyphID",type:"USHORT",value:e.start},{name:"endGlyphID",type:"USHORT",value:e.end},{name:"startCoverageIndex",type:"USHORT",value:e.index}]})))):jc.assert(!1,"Coverage format must be 1 or 2.")}function uu(e){au.call(this,"scriptListTable",lu("scriptRecord",e,(function(e,t){var r=e.script,n=r.defaultLangSys;return jc.assert(!!n,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new au("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new au("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:n.reqFeatureIndex}].concat(su("featureIndex",n.featureIndexes)))}].concat(lu("langSys",r.langSysRecords,(function(e,t){var r=e.langSys;return[{name:"langSysTag"+t,type:"TAG",value:e.tag},{name:"langSys"+t,type:"TABLE",value:new au("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:r.reqFeatureIndex}].concat(su("featureIndex",r.featureIndexes)))}]}))))}]})))}function hu(e){au.call(this,"featureListTable",lu("featureRecord",e,(function(e,t){var r=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new au("featureTable",[{name:"featureParams",type:"USHORT",value:r.featureParams}].concat(su("lookupListIndex",r.lookupListIndexes)))}]})))}function du(e,t){au.call(this,"lookupListTable",ou("lookup",e,(function(e){var r=t[e.lookupType];return jc.assert(!!r,"Unable to write GSUB lookup type "+e.lookupType+" tables."),new au("lookupTable",[{name:"lookupType",type:"USHORT",value:e.lookupType},{name:"lookupFlag",type:"USHORT",value:e.lookupFlag}].concat(ou("subtable",e.subtables,r)))})))}Yc.CHARSTRING=function(e){if(iu){var t=iu.get(e);if(void 0!==t)return t}for(var r=[],n=e.length,i=0;i<n;i+=1){var a=e[i];r=r.concat(Yc[a.type](a.value))}return iu&&iu.set(e,r),r},qc.CHARSTRING=function(e){return Yc.CHARSTRING(e).length},Yc.OBJECT=function(e){var t=Yc[e.type];return jc.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},qc.OBJECT=function(e){var t=qc[e.type];return jc.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},Yc.TABLE=function(e){for(var t=[],r=e.fields.length,n=[],i=[],a=0;a<r;a+=1){var s=e.fields[a],o=Yc[s.type];jc.argument(void 0!==o,"No encoding function for field type "+s.type+" ("+s.name+")");var l=e[s.name];void 0===l&&(l=s.value);var c=o(l);"TABLE"===s.type?(i.push(t.length),t=t.concat([0,0]),n.push(c)):t=t.concat(c)}for(var u=0;u<n.length;u+=1){var h=i[u],d=t.length;jc.argument(d<65536,"Table "+e.tableName+" too big."),t[h]=d>>8,t[h+1]=255&d,t=t.concat(n[u])}return t},qc.TABLE=function(e){for(var t=0,r=e.fields.length,n=0;n<r;n+=1){var i=e.fields[n],a=qc[i.type];jc.argument(void 0!==a,"No sizeOf function for field type "+i.type+" ("+i.name+")");var s=e[i.name];void 0===s&&(s=i.value),t+=a(s),"TABLE"===i.type&&(t+=2)}return t},Yc.RECORD=Yc.TABLE,qc.RECORD=qc.TABLE,Yc.LITERAL=function(e){return e},qc.LITERAL=function(e){return e.length},au.prototype.encode=function(){return Yc.TABLE(this)},au.prototype.sizeOf=function(){return qc.TABLE(this)},cu.prototype=Object.create(au.prototype),cu.prototype.constructor=cu,uu.prototype=Object.create(au.prototype),uu.prototype.constructor=uu,hu.prototype=Object.create(au.prototype),hu.prototype.constructor=hu,du.prototype=Object.create(au.prototype),du.prototype.constructor=du;var pu={Table:au,Record:au,Coverage:cu,ScriptList:uu,FeatureList:hu,LookupList:du,ushortList:su,tableList:ou,recordList:lu};function fu(e,t){return e.getUint8(t)}function mu(e,t){return e.getUint16(t,!1)}function gu(e,t){return e.getUint32(t,!1)}function vu(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}var Au={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function yu(e,t){this.data=e,this.offset=t,this.relativeOffset=0}yu.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},yu.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},yu.prototype.parseCard8=yu.prototype.parseByte,yu.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},yu.prototype.parseCard16=yu.prototype.parseUShort,yu.prototype.parseSID=yu.prototype.parseUShort,yu.prototype.parseOffset16=yu.prototype.parseUShort,yu.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},yu.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},yu.prototype.parseULong=function(){var e=gu(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},yu.prototype.parseOffset32=yu.prototype.parseULong,yu.prototype.parseFixed=function(){var e=vu(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},yu.prototype.parseString=function(e){var t=this.data,r=this.offset+this.relativeOffset,n="";this.relativeOffset+=e;for(var i=0;i<e;i++)n+=String.fromCharCode(t.getUint8(r+i));return n},yu.prototype.parseTag=function(){return this.parseString(4)},yu.prototype.parseLongDateTime=function(){var e=gu(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},yu.prototype.parseVersion=function(e){var t=mu(this.data,this.offset+this.relativeOffset),r=mu(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,void 0===e&&(e=4096),t+r/e/10},yu.prototype.skip=function(e,t){void 0===t&&(t=1),this.relativeOffset+=Au[e]*t},yu.prototype.parseULongList=function(e){void 0===e&&(e=this.parseULong());for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=r.getUint32(n),n+=4;return this.relativeOffset+=4*e,t},yu.prototype.parseOffset16List=yu.prototype.parseUShortList=function(e){void 0===e&&(e=this.parseUShort());for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=r.getUint16(n),n+=2;return this.relativeOffset+=2*e,t},yu.prototype.parseShortList=function(e){for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=r.getInt16(n),n+=2;return this.relativeOffset+=2*e,t},yu.prototype.parseByteList=function(e){for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=r.getUint8(n++);return this.relativeOffset+=e,t},yu.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());for(var r=new Array(e),n=0;n<e;n++)r[n]=t.call(this);return r},yu.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());for(var r=new Array(e),n=0;n<e;n++)r[n]=t.call(this);return r},yu.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());for(var r=new Array(e),n=Object.keys(t),i=0;i<e;i++){for(var a={},s=0;s<n.length;s++){var o=n[s],l=t[o];a[o]=l.call(this)}r[i]=a}return r},yu.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());for(var r=new Array(e),n=Object.keys(t),i=0;i<e;i++){for(var a={},s=0;s<n.length;s++){var o=n[s],l=t[o];a[o]=l.call(this)}r[i]=a}return r},yu.prototype.parseStruct=function(e){if("function"==typeof e)return e.call(this);for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var i=t[n],a=e[i];r[i]=a.call(this)}return r},yu.prototype.parseValueRecord=function(e){if(void 0===e&&(e=this.parseUShort()),0!==e){var t={};return 1&e&&(t.xPlacement=this.parseShort()),2&e&&(t.yPlacement=this.parseShort()),4&e&&(t.xAdvance=this.parseShort()),8&e&&(t.yAdvance=this.parseShort()),16&e&&(t.xPlaDevice=void 0,this.parseShort()),32&e&&(t.yPlaDevice=void 0,this.parseShort()),64&e&&(t.xAdvDevice=void 0,this.parseShort()),128&e&&(t.yAdvDevice=void 0,this.parseShort()),t}},yu.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),t=this.parseUShort(),r=new Array(t),n=0;n<t;n++)r[n]=this.parseValueRecord(e);return r},yu.prototype.parsePointer=function(e){var t=this.parseOffset16();if(t>0)return new yu(this.data,this.offset+t).parseStruct(e)},yu.prototype.parsePointer32=function(e){var t=this.parseOffset32();if(t>0)return new yu(this.data,this.offset+t).parseStruct(e)},yu.prototype.parseListOfLists=function(e){for(var t=this.parseOffset16List(),r=t.length,n=this.relativeOffset,i=new Array(r),a=0;a<r;a++){var s=t[a];if(0!==s)if(this.relativeOffset=s,e){for(var o=this.parseOffset16List(),l=new Array(o.length),c=0;c<o.length;c++)this.relativeOffset=s+o[c],l[c]=e.call(this);i[a]=l}else i[a]=this.parseUShortList();else i[a]=void 0}return this.relativeOffset=n,i},yu.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort(),r=this.parseUShort();if(1===t)return{format:1,glyphs:this.parseUShortList(r)};if(2===t){for(var n=new Array(r),i=0;i<r;i++)n[i]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.")},yu.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(2===t)return{format:2,ranges:this.parseRecordList({start:yu.uShort,end:yu.uShort,classId:yu.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")},yu.list=function(e,t){return function(){return this.parseList(e,t)}},yu.list32=function(e,t){return function(){return this.parseList32(e,t)}},yu.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},yu.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},yu.pointer=function(e){return function(){return this.parsePointer(e)}},yu.pointer32=function(e){return function(){return this.parsePointer32(e)}},yu.tag=yu.prototype.parseTag,yu.byte=yu.prototype.parseByte,yu.uShort=yu.offset16=yu.prototype.parseUShort,yu.uShortList=yu.prototype.parseUShortList,yu.uLong=yu.offset32=yu.prototype.parseULong,yu.uLongList=yu.prototype.parseULongList,yu.struct=yu.prototype.parseStruct,yu.coverage=yu.prototype.parseCoverage,yu.classDef=yu.prototype.parseClassDef;var xu={reserved:yu.uShort,reqFeatureIndex:yu.uShort,featureIndexes:yu.uShortList};yu.prototype.parseScriptList=function(){return this.parsePointer(yu.recordList({tag:yu.tag,script:yu.pointer({defaultLangSys:yu.pointer(xu),langSysRecords:yu.recordList({tag:yu.tag,langSys:yu.pointer(xu)})})}))||[]},yu.prototype.parseFeatureList=function(){return this.parsePointer(yu.recordList({tag:yu.tag,feature:yu.pointer({featureParams:yu.offset16,lookupListIndexes:yu.uShortList})}))||[]},yu.prototype.parseLookupList=function(e){return this.parsePointer(yu.list(yu.pointer((function(){var t=this.parseUShort();jc.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown.");var r=this.parseUShort(),n=16&r;return{lookupType:t,lookupFlag:r,subtables:this.parseList(yu.pointer(e[t])),markFilteringSet:n?this.parseUShort():void 0}}))))||[]},yu.prototype.parseFeatureVariationsList=function(){return this.parsePointer32((function(){var e=this.parseUShort(),t=this.parseUShort();return jc.argument(1===e&&t<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:yu.offset32,featureTableSubstitutionOffset:yu.offset32})}))||[]};var bu={getByte:fu,getCard8:fu,getUShort:mu,getCard16:mu,getShort:function(e,t){return e.getInt16(t,!1)},getULong:gu,getFixed:vu,getTag:function(e,t){for(var r="",n=t;n<t+4;n+=1)r+=String.fromCharCode(e.getInt8(n));return r},getOffset:function(e,t,r){for(var n=0,i=0;i<r;i+=1)n<<=8,n+=e.getUint8(t+i);return n},getBytes:function(e,t,r){for(var n=[],i=t;i<r;i+=1)n.push(e.getUint8(i));return n},bytesToString:function(e){for(var t="",r=0;r<e.length;r+=1)t+=String.fromCharCode(e[r]);return t},Parser:yu};function wu(e,t,r){e.segments.push({end:t,start:t,delta:-(t-r),offset:0,glyphIndex:r})}var Eu={parse:function(e,t){var r={};r.version=bu.getUShort(e,t),jc.argument(0===r.version,"cmap table version should be 0."),r.numTables=bu.getUShort(e,t+2);for(var n=-1,i=r.numTables-1;i>=0;i-=1){var a=bu.getUShort(e,t+4+8*i),s=bu.getUShort(e,t+4+8*i+2);if(3===a&&(0===s||1===s||10===s)||0===a&&(0===s||1===s||2===s||3===s||4===s)){n=bu.getULong(e,t+4+8*i+4);break}}if(-1===n)throw new Error("No valid cmap sub-tables found.");var o=new bu.Parser(e,t+n);if(r.format=o.parseUShort(),12===r.format)!function(e,t){var r;t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong(),e.groupCount=r=t.parseULong(),e.glyphIndexMap={};for(var n=0;n<r;n+=1)for(var i=t.parseULong(),a=t.parseULong(),s=t.parseULong(),o=i;o<=a;o+=1)e.glyphIndexMap[o]=s,s++}(r,o);else{if(4!==r.format)throw new Error("Only format 4 and 12 cmap tables are supported (found format "+r.format+").");!function(e,t,r,n,i){var a;e.length=t.parseUShort(),e.language=t.parseUShort(),e.segCount=a=t.parseUShort()>>1,t.skip("uShort",3),e.glyphIndexMap={};for(var s=new bu.Parser(r,n+i+14),o=new bu.Parser(r,n+i+16+2*a),l=new bu.Parser(r,n+i+16+4*a),c=new bu.Parser(r,n+i+16+6*a),u=n+i+16+8*a,h=0;h<a-1;h+=1)for(var d=void 0,p=s.parseUShort(),f=o.parseUShort(),m=l.parseShort(),g=c.parseUShort(),v=f;v<=p;v+=1)0!==g?(u=c.offset+c.relativeOffset-2,u+=g,u+=2*(v-f),0!==(d=bu.getUShort(r,u))&&(d=d+m&65535)):d=v+m&65535,e.glyphIndexMap[v]=d}(r,o,e,t,n)}return r},make:function(e){var t,r=!0;for(t=e.length-1;t>0;t-=1){if(e.get(t).unicode>65535){console.log("Adding CMAP format 12 (needed!)"),r=!1;break}}var n=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:r?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:r?12:20}];r||(n=n.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),n=n.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var i=new pu.Table("cmap",n);for(i.segments=[],t=0;t<e.length;t+=1){for(var a=e.get(t),s=0;s<a.unicodes.length;s+=1)wu(i,a.unicodes[s],t);i.segments=i.segments.sort((function(e,t){return e.start-t.start}))}!function(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}(i);var o=i.segments.length,l=0,c=[],u=[],h=[],d=[],p=[],f=[];for(t=0;t<o;t+=1){var m=i.segments[t];m.end<=65535&&m.start<=65535?(c=c.concat({name:"end_"+t,type:"USHORT",value:m.end}),u=u.concat({name:"start_"+t,type:"USHORT",value:m.start}),h=h.concat({name:"idDelta_"+t,type:"SHORT",value:m.delta}),d=d.concat({name:"idRangeOffset_"+t,type:"USHORT",value:m.offset}),void 0!==m.glyphId&&(p=p.concat({name:"glyph_"+t,type:"USHORT",value:m.glyphId}))):l+=1,r||void 0===m.glyphIndex||(f=(f=(f=f.concat({name:"cmap12Start_"+t,type:"ULONG",value:m.start})).concat({name:"cmap12End_"+t,type:"ULONG",value:m.end})).concat({name:"cmap12Glyph_"+t,type:"ULONG",value:m.glyphIndex}))}if(i.segCountX2=2*(o-l),i.searchRange=2*Math.pow(2,Math.floor(Math.log(o-l)/Math.log(2))),i.entrySelector=Math.log(i.searchRange/2)/Math.log(2),i.rangeShift=i.segCountX2-i.searchRange,i.fields=i.fields.concat(c),i.fields.push({name:"reservedPad",type:"USHORT",value:0}),i.fields=i.fields.concat(u),i.fields=i.fields.concat(h),i.fields=i.fields.concat(d),i.fields=i.fields.concat(p),i.cmap4Length=14+2*c.length+2+2*u.length+2*h.length+2*d.length+2*p.length,!r){var g=16+4*f.length;i.cmap12Offset=20+i.cmap4Length,i.fields=i.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:g},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:f.length/3}]),i.fields=i.fields.concat(f)}return i}},Su=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],Mu=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],_u=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Tu=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function Cu(e){this.font=e}function Iu(e){this.cmap=e}function Bu(e,t){this.encoding=e,this.charset=t}function Ru(e){switch(e.version){case 1:this.names=Tu.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<Tu.length?this.names[t]=Tu[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-Tu.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(var r=0;r<e.numberOfGlyphs;r++)this.names[r]=Tu[r+e.glyphNameIndex[r]];break;default:this.names=[]}}function Pu(e,t){t.lowMemory?function(e){e._IndexToUnicodeMap={};for(var t=e.tables.cmap.glyphIndexMap,r=Object.keys(t),n=0;n<r.length;n+=1){var i=r[n],a=t[i];void 0===e._IndexToUnicodeMap[a]?e._IndexToUnicodeMap[a]={unicodes:[parseInt(i)]}:e._IndexToUnicodeMap[a].unicodes.push(parseInt(i))}}(e):function(e){for(var t,r=e.tables.cmap.glyphIndexMap,n=Object.keys(r),i=0;i<n.length;i+=1){var a=n[i],s=r[a];(t=e.glyphs.get(s)).addUnicode(parseInt(a))}for(var o=0;o<e.glyphs.length;o+=1)t=e.glyphs.get(o),e.cffEncoding?e.isCIDFont?t.name="gid"+o:t.name=e.cffEncoding.charset[o]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(o))}(e)}Cu.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),r=this.font.glyphs;if(r)for(var n=0;n<r.length;n+=1)for(var i=r.get(n),a=0;a<i.unicodes.length;a+=1)if(i.unicodes[a]===t)return n;return null},Iu.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0},Bu.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),r=this.encoding[t];return this.charset.indexOf(r)},Ru.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},Ru.prototype.glyphIndexToName=function(e){return this.names[e]};var Fu={line:function(e,t,r,n,i){e.beginPath(),e.moveTo(t,r),e.lineTo(n,i),e.stroke()}};function Lu(e){this.bindConstructorValues(e)}function Du(e,t,r){Object.defineProperty(e,t,{get:function(){return e.path,e[r]},set:function(t){e[r]=t},enumerable:!0,configurable:!0})}function Uu(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(var r=0;r<t.length;r++){var n=t[r];n.path.unitsPerEm=e.unitsPerEm,this.glyphs[r]=n}this.length=t&&t.length||0}Lu.prototype.bindConstructorValues=function(e){var t,r;this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||void 0!==e.unicode?[e.unicode]:[],"xMin"in e&&(this.xMin=e.xMin),"yMin"in e&&(this.yMin=e.yMin),"xMax"in e&&(this.xMax=e.xMax),"yMax"in e&&(this.yMax=e.yMax),"advanceWidth"in e&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",(t=e.path,r=t||new Vc,{configurable:!0,get:function(){return"function"==typeof r&&(r=r()),r},set:function(e){r=e}}))},Lu.prototype.addUnicode=function(e){0===this.unicodes.length&&(this.unicode=e),this.unicodes.push(e)},Lu.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},Lu.prototype.getPath=function(e,t,r,n,i){var a,s;e=void 0!==e?e:0,t=void 0!==t?t:0,r=void 0!==r?r:72,n||(n={});var o=n.xScale,l=n.yScale;if(n.hinting&&i&&i.hinting&&(s=this.path&&i.hinting.exec(this,r)),s)a=i.hinting.getCommands(s),e=Math.round(e),t=Math.round(t),o=l=1;else{a=this.path.commands;var c=1/(this.path.unitsPerEm||1e3)*r;void 0===o&&(o=c),void 0===l&&(l=c)}for(var u=new Vc,h=0;h<a.length;h+=1){var d=a[h];"M"===d.type?u.moveTo(e+d.x*o,t+-d.y*l):"L"===d.type?u.lineTo(e+d.x*o,t+-d.y*l):"Q"===d.type?u.quadraticCurveTo(e+d.x1*o,t+-d.y1*l,e+d.x*o,t+-d.y*l):"C"===d.type?u.curveTo(e+d.x1*o,t+-d.y1*l,e+d.x2*o,t+-d.y2*l,e+d.x*o,t+-d.y*l):"Z"===d.type&&u.closePath()}return u},Lu.prototype.getContours=function(){if(void 0===this.points)return[];for(var e=[],t=[],r=0;r<this.points.length;r+=1){var n=this.points[r];t.push(n),n.lastPointOfContour&&(e.push(t),t=[])}return jc.argument(0===t.length,"There are still points left in the current contour."),e},Lu.prototype.getMetrics=function(){for(var e=this.path.commands,t=[],r=[],n=0;n<e.length;n+=1){var i=e[n];"Z"!==i.type&&(t.push(i.x),r.push(i.y)),"Q"!==i.type&&"C"!==i.type||(t.push(i.x1),r.push(i.y1)),"C"===i.type&&(t.push(i.x2),r.push(i.y2))}var a={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,r),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,r),leftSideBearing:this.leftSideBearing};return isFinite(a.xMin)||(a.xMin=0),isFinite(a.xMax)||(a.xMax=this.advanceWidth),isFinite(a.yMin)||(a.yMin=0),isFinite(a.yMax)||(a.yMax=0),a.rightSideBearing=this.advanceWidth-a.leftSideBearing-(a.xMax-a.xMin),a},Lu.prototype.draw=function(e,t,r,n,i){this.getPath(t,r,n,i).draw(e)},Lu.prototype.drawPoints=function(e,t,r,n){function i(t,r,n,i){e.beginPath();for(var a=0;a<t.length;a+=1)e.moveTo(r+t[a].x*i,n+t[a].y*i),e.arc(r+t[a].x*i,n+t[a].y*i,2,0,2*Math.PI,!1);e.closePath(),e.fill()}t=void 0!==t?t:0,r=void 0!==r?r:0,n=void 0!==n?n:24;for(var a=1/this.path.unitsPerEm*n,s=[],o=[],l=this.path,c=0;c<l.commands.length;c+=1){var u=l.commands[c];void 0!==u.x&&s.push({x:u.x,y:-u.y}),void 0!==u.x1&&o.push({x:u.x1,y:-u.y1}),void 0!==u.x2&&o.push({x:u.x2,y:-u.y2})}e.fillStyle="blue",i(s,t,r,a),e.fillStyle="red",i(o,t,r,a)},Lu.prototype.drawMetrics=function(e,t,r,n){var i;t=void 0!==t?t:0,r=void 0!==r?r:0,n=void 0!==n?n:24,i=1/this.path.unitsPerEm*n,e.lineWidth=1,e.strokeStyle="black",Fu.line(e,t,-1e4,t,1e4),Fu.line(e,-1e4,r,1e4,r);var a=this.xMin||0,s=this.yMin||0,o=this.xMax||0,l=this.yMax||0,c=this.advanceWidth||0;e.strokeStyle="blue",Fu.line(e,t+a*i,-1e4,t+a*i,1e4),Fu.line(e,t+o*i,-1e4,t+o*i,1e4),Fu.line(e,-1e4,r+-s*i,1e4,r+-s*i),Fu.line(e,-1e4,r+-l*i,1e4,r+-l*i),e.strokeStyle="green",Fu.line(e,t+c*i,-1e4,t+c*i,1e4)},Uu.prototype.get=function(e){if(void 0===this.glyphs[e]){this.font._push(e),"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]());var t=this.glyphs[e],r=this.font._IndexToUnicodeMap[e];if(r)for(var n=0;n<r.unicodes.length;n++)t.addUnicode(r.unicodes[n]);this.font.cffEncoding?this.font.isCIDFont?t.name="gid"+e:t.name=this.font.cffEncoding.charset[e]:this.font.glyphNames.names&&(t.name=this.font.glyphNames.glyphIndexToName(e)),this.glyphs[e].advanceWidth=this.font._hmtxTableData[e].advanceWidth,this.glyphs[e].leftSideBearing=this.font._hmtxTableData[e].leftSideBearing}else"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]());return this.glyphs[e]},Uu.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};var Nu={GlyphSet:Uu,glyphLoader:function(e,t){return new Lu({index:t,font:e})},ttfGlyphLoader:function(e,t,r,n,i,a){return function(){var s=new Lu({index:t,font:e});return s.path=function(){r(s,n,i);var t=a(e.glyphs,s);return t.unitsPerEm=e.unitsPerEm,t},Du(s,"xMin","_xMin"),Du(s,"xMax","_xMax"),Du(s,"yMin","_yMin"),Du(s,"yMax","_yMax"),s}},cffGlyphLoader:function(e,t,r,n){return function(){var i=new Lu({index:t,font:e});return i.path=function(){var t=r(e,i,n);return t.unitsPerEm=e.unitsPerEm,t},i}}};function ku(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r+=1)if(!ku(e[r],t[r]))return!1;return!0}return!1}function Ou(e){return e.length<1240?107:e.length<33900?1131:32768}function Gu(e,t,r){var n,i,a=[],s=[],o=bu.getCard16(e,t);if(0!==o){var l=bu.getByte(e,t+2);n=t+(o+1)*l+2;for(var c=t+3,u=0;u<o+1;u+=1)a.push(bu.getOffset(e,c,l)),c+=l;i=n+a[o]}else i=t+2;for(var h=0;h<a.length-1;h+=1){var d=bu.getBytes(e,n+a[h],n+a[h+1]);r&&(d=r(d)),s.push(d)}return{objects:s,startOffset:t,endOffset:i}}function zu(e,t){if(28===t)return e.parseByte()<<8|e.parseByte();if(29===t)return e.parseByte()<<24|e.parseByte()<<16|e.parseByte()<<8|e.parseByte();if(30===t)return function(e){for(var t="",r=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var n=e.parseByte(),i=n>>4,a=15&n;if(15===i)break;if(t+=r[i],15===a)break;t+=r[a]}return parseFloat(t)}(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return 256*(t-247)+e.parseByte()+108;if(t>=251&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Vu(e,t,r){t=void 0!==t?t:0;var n=new bu.Parser(e,t),i=[],a=[];for(r=void 0!==r?r:e.length;n.relativeOffset<r;){var s=n.parseByte();s<=21?(12===s&&(s=1200+n.parseByte()),i.push([s,a]),a=[]):a.push(zu(n,s))}return function(e){for(var t={},r=0;r<e.length;r+=1){var n=e[r][0],i=e[r][1],a=void 0;if(a=1===i.length?i[0]:i,t.hasOwnProperty(n)&&!isNaN(t[n]))throw new Error("Object "+t+" already has key "+n);t[n]=a}return t}(i)}function Hu(e,t){return t=t<=390?Su[t]:e[t-391]}function Qu(e,t,r){for(var n,i={},a=0;a<t.length;a+=1){var s=t[a];if(Array.isArray(s.type)){var o=[];o.length=s.type.length;for(var l=0;l<s.type.length;l++)void 0===(n=void 0!==e[s.op]?e[s.op][l]:void 0)&&(n=void 0!==s.value&&void 0!==s.value[l]?s.value[l]:null),"SID"===s.type[l]&&(n=Hu(r,n)),o[l]=n;i[s.name]=o}else void 0===(n=e[s.op])&&(n=void 0!==s.value?s.value:null),"SID"===s.type&&(n=Hu(r,n)),i[s.name]=n}return i}var ju=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],Wu=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function Xu(e,t){return Qu(Vu(e,0,e.byteLength),ju,t)}function Yu(e,t,r,n){return Qu(Vu(e,t,r),Wu,n)}function qu(e,t,r,n){for(var i=[],a=0;a<r.length;a+=1){var s=Xu(new DataView(new Uint8Array(r[a]).buffer),n);s._subrs=[],s._subrsBias=0,s._defaultWidthX=0,s._nominalWidthX=0;var o=s.private[0],l=s.private[1];if(0!==o&&0!==l){var c=Yu(e,l+t,o,n);if(s._defaultWidthX=c.defaultWidthX,s._nominalWidthX=c.nominalWidthX,0!==c.subrs){var u=Gu(e,l+c.subrs+t);s._subrs=u.objects,s._subrsBias=Ou(s._subrs)}s._privateDict=c}i.push(s)}return i}function Ku(e,t,r){var n,i,a,s,o,l,c,u,h=new Vc,d=[],p=0,f=!1,m=!1,g=0,v=0;if(e.isCIDFont){var A=e.tables.cff.topDict._fdSelect[t.index],y=e.tables.cff.topDict._fdArray[A];o=y._subrs,l=y._subrsBias,c=y._defaultWidthX,u=y._nominalWidthX}else o=e.tables.cff.topDict._subrs,l=e.tables.cff.topDict._subrsBias,c=e.tables.cff.topDict._defaultWidthX,u=e.tables.cff.topDict._nominalWidthX;var x=c;function b(e,t){m&&h.closePath(),h.moveTo(e,t),m=!0}function w(){d.length%2!=0&&!f&&(x=d.shift()+u),p+=d.length>>1,d.length=0,f=!0}return function r(c){for(var A,y,E,S,M,_,T,C,I,B,R,P,F=0;F<c.length;){var L=c[F];switch(F+=1,L){case 1:case 3:case 18:case 23:w();break;case 4:d.length>1&&!f&&(x=d.shift()+u,f=!0),v+=d.pop(),b(g,v);break;case 5:for(;d.length>0;)g+=d.shift(),v+=d.shift(),h.lineTo(g,v);break;case 6:for(;d.length>0&&(g+=d.shift(),h.lineTo(g,v),0!==d.length);)v+=d.shift(),h.lineTo(g,v);break;case 7:for(;d.length>0&&(v+=d.shift(),h.lineTo(g,v),0!==d.length);)g+=d.shift(),h.lineTo(g,v);break;case 8:for(;d.length>0;)n=g+d.shift(),i=v+d.shift(),a=n+d.shift(),s=i+d.shift(),g=a+d.shift(),v=s+d.shift(),h.curveTo(n,i,a,s,g,v);break;case 10:M=d.pop()+l,(_=o[M])&&r(_);break;case 11:return;case 12:switch(L=c[F],F+=1,L){case 35:n=g+d.shift(),i=v+d.shift(),a=n+d.shift(),s=i+d.shift(),T=a+d.shift(),C=s+d.shift(),I=T+d.shift(),B=C+d.shift(),R=I+d.shift(),P=B+d.shift(),g=R+d.shift(),v=P+d.shift(),d.shift(),h.curveTo(n,i,a,s,T,C),h.curveTo(I,B,R,P,g,v);break;case 34:n=g+d.shift(),i=v,a=n+d.shift(),s=i+d.shift(),T=a+d.shift(),C=s,I=T+d.shift(),B=s,R=I+d.shift(),P=v,g=R+d.shift(),h.curveTo(n,i,a,s,T,C),h.curveTo(I,B,R,P,g,v);break;case 36:n=g+d.shift(),i=v+d.shift(),a=n+d.shift(),s=i+d.shift(),T=a+d.shift(),C=s,I=T+d.shift(),B=s,R=I+d.shift(),P=B+d.shift(),g=R+d.shift(),h.curveTo(n,i,a,s,T,C),h.curveTo(I,B,R,P,g,v);break;case 37:n=g+d.shift(),i=v+d.shift(),a=n+d.shift(),s=i+d.shift(),T=a+d.shift(),C=s+d.shift(),I=T+d.shift(),B=C+d.shift(),R=I+d.shift(),P=B+d.shift(),Math.abs(R-g)>Math.abs(P-v)?g=R+d.shift():v=P+d.shift(),h.curveTo(n,i,a,s,T,C),h.curveTo(I,B,R,P,g,v);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+L),d.length=0}break;case 14:d.length>0&&!f&&(x=d.shift()+u,f=!0),m&&(h.closePath(),m=!1);break;case 19:case 20:w(),F+=p+7>>3;break;case 21:d.length>2&&!f&&(x=d.shift()+u,f=!0),v+=d.pop(),b(g+=d.pop(),v);break;case 22:d.length>1&&!f&&(x=d.shift()+u,f=!0),b(g+=d.pop(),v);break;case 24:for(;d.length>2;)n=g+d.shift(),i=v+d.shift(),a=n+d.shift(),s=i+d.shift(),g=a+d.shift(),v=s+d.shift(),h.curveTo(n,i,a,s,g,v);g+=d.shift(),v+=d.shift(),h.lineTo(g,v);break;case 25:for(;d.length>6;)g+=d.shift(),v+=d.shift(),h.lineTo(g,v);n=g+d.shift(),i=v+d.shift(),a=n+d.shift(),s=i+d.shift(),g=a+d.shift(),v=s+d.shift(),h.curveTo(n,i,a,s,g,v);break;case 26:for(d.length%2&&(g+=d.shift());d.length>0;)n=g,i=v+d.shift(),a=n+d.shift(),s=i+d.shift(),g=a,v=s+d.shift(),h.curveTo(n,i,a,s,g,v);break;case 27:for(d.length%2&&(v+=d.shift());d.length>0;)n=g+d.shift(),i=v,a=n+d.shift(),s=i+d.shift(),g=a+d.shift(),v=s,h.curveTo(n,i,a,s,g,v);break;case 28:A=c[F],y=c[F+1],d.push((A<<24|y<<16)>>16),F+=2;break;case 29:M=d.pop()+e.gsubrsBias,(_=e.gsubrs[M])&&r(_);break;case 30:for(;d.length>0&&(n=g,i=v+d.shift(),a=n+d.shift(),s=i+d.shift(),g=a+d.shift(),v=s+(1===d.length?d.shift():0),h.curveTo(n,i,a,s,g,v),0!==d.length);)n=g+d.shift(),i=v,a=n+d.shift(),s=i+d.shift(),v=s+d.shift(),g=a+(1===d.length?d.shift():0),h.curveTo(n,i,a,s,g,v);break;case 31:for(;d.length>0&&(n=g+d.shift(),i=v,a=n+d.shift(),s=i+d.shift(),v=s+d.shift(),g=a+(1===d.length?d.shift():0),h.curveTo(n,i,a,s,g,v),0!==d.length);)n=g,i=v+d.shift(),a=n+d.shift(),s=i+d.shift(),g=a+d.shift(),v=s+(1===d.length?d.shift():0),h.curveTo(n,i,a,s,g,v);break;default:L<32?console.log("Glyph "+t.index+": unknown operator "+L):L<247?d.push(L-139):L<251?(A=c[F],F+=1,d.push(256*(L-247)+A+108)):L<255?(A=c[F],F+=1,d.push(256*-(L-251)-A-108)):(A=c[F],y=c[F+1],E=c[F+2],S=c[F+3],F+=4,d.push((A<<24|y<<16|E<<8|S)/65536))}}}(r),t.advanceWidth=x,h}function Ju(e,t){var r,n=Su.indexOf(e);return n>=0&&(r=n),(n=t.indexOf(e))>=0?r=n+Su.length:(r=Su.length+t.length,t.push(e)),r}function Zu(e,t,r){for(var n={},i=0;i<e.length;i+=1){var a=e[i],s=t[a.name];void 0===s||ku(s,a.value)||("SID"===a.type&&(s=Ju(s,r)),n[a.op]={name:a.name,type:a.type,value:s})}return n}function $u(e,t){var r=new pu.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return r.dict=Zu(ju,e,t),r}function eh(e){var t=new pu.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function th(e){var t=[],r=e.path;t.push({name:"width",type:"NUMBER",value:e.advanceWidth});for(var n=0,i=0,a=0;a<r.commands.length;a+=1){var s=void 0,o=void 0,l=r.commands[a];if("Q"===l.type){var c=1/3,u=2/3;l={type:"C",x:l.x,y:l.y,x1:Math.round(c*n+u*l.x1),y1:Math.round(c*i+u*l.y1),x2:Math.round(c*l.x+u*l.x1),y2:Math.round(c*l.y+u*l.y1)}}if("M"===l.type)s=Math.round(l.x-n),o=Math.round(l.y-i),t.push({name:"dx",type:"NUMBER",value:s}),t.push({name:"dy",type:"NUMBER",value:o}),t.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(l.x),i=Math.round(l.y);else if("L"===l.type)s=Math.round(l.x-n),o=Math.round(l.y-i),t.push({name:"dx",type:"NUMBER",value:s}),t.push({name:"dy",type:"NUMBER",value:o}),t.push({name:"rlineto",type:"OP",value:5}),n=Math.round(l.x),i=Math.round(l.y);else if("C"===l.type){var h=Math.round(l.x1-n),d=Math.round(l.y1-i),p=Math.round(l.x2-l.x1),f=Math.round(l.y2-l.y1);s=Math.round(l.x-l.x2),o=Math.round(l.y-l.y2),t.push({name:"dx1",type:"NUMBER",value:h}),t.push({name:"dy1",type:"NUMBER",value:d}),t.push({name:"dx2",type:"NUMBER",value:p}),t.push({name:"dy2",type:"NUMBER",value:f}),t.push({name:"dx",type:"NUMBER",value:s}),t.push({name:"dy",type:"NUMBER",value:o}),t.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(l.x),i=Math.round(l.y)}}return t.push({name:"endchar",type:"OP",value:14}),t}var rh={parse:function(e,t,r,n){r.tables.cff={};var i=function(e,t){var r={};return r.formatMajor=bu.getCard8(e,t),r.formatMinor=bu.getCard8(e,t+1),r.size=bu.getCard8(e,t+2),r.offsetSize=bu.getCard8(e,t+3),r.startOffset=t,r.endOffset=t+4,r}(e,t),a=Gu(e,i.endOffset,bu.bytesToString),s=Gu(e,a.endOffset),o=Gu(e,s.endOffset,bu.bytesToString),l=Gu(e,o.endOffset);r.gsubrs=l.objects,r.gsubrsBias=Ou(r.gsubrs);var c=qu(e,t,s.objects,o.objects);if(1!==c.length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+c.length);var u=c[0];if(r.tables.cff.topDict=u,u._privateDict&&(r.defaultWidthX=u._privateDict.defaultWidthX,r.nominalWidthX=u._privateDict.nominalWidthX),void 0!==u.ros[0]&&void 0!==u.ros[1]&&(r.isCIDFont=!0),r.isCIDFont){var h=u.fdArray,d=u.fdSelect;if(0===h||0===d)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");var p=Gu(e,h+=t),f=qu(e,t,p.objects,o.objects);u._fdArray=f,d+=t,u._fdSelect=function(e,t,r,n){var i,a=[],s=new bu.Parser(e,t),o=s.parseCard8();if(0===o)for(var l=0;l<r;l++){if((i=s.parseCard8())>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+n+")");a.push(i)}else{if(3!==o)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+o);var c,u=s.parseCard16(),h=s.parseCard16();if(0!==h)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+h);for(var d=0;d<u;d++){if(i=s.parseCard8(),c=s.parseCard16(),i>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+n+")");if(c>r)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+c);for(;h<c;h++)a.push(i);h=c}if(c!==r)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+c)}return a}(e,d,r.numGlyphs,f.length)}var m,g=t+u.private[1],v=Yu(e,g,u.private[0],o.objects);if(r.defaultWidthX=v.defaultWidthX,r.nominalWidthX=v.nominalWidthX,0!==v.subrs){var A=g+v.subrs,y=Gu(e,A);r.subrs=y.objects,r.subrsBias=Ou(r.subrs)}else r.subrs=[],r.subrsBias=0;n.lowMemory?(m=function(e,t){var r,n,i=[],a=bu.getCard16(e,t);if(0!==a){var s=bu.getByte(e,t+2);r=t+(a+1)*s+2;for(var o=t+3,l=0;l<a+1;l+=1)i.push(bu.getOffset(e,o,s)),o+=s;n=r+i[a]}else n=t+2;return{offsets:i,startOffset:t,endOffset:n}}(e,t+u.charStrings),r.nGlyphs=m.offsets.length):(m=Gu(e,t+u.charStrings),r.nGlyphs=m.objects.length);var x=function(e,t,r,n){var i,a,s=new bu.Parser(e,t);r-=1;var o=[".notdef"],l=s.parseCard8();if(0===l)for(var c=0;c<r;c+=1)i=s.parseSID(),o.push(Hu(n,i));else if(1===l)for(;o.length<=r;){i=s.parseSID(),a=s.parseCard8();for(var u=0;u<=a;u+=1)o.push(Hu(n,i)),i+=1}else{if(2!==l)throw new Error("Unknown charset format "+l);for(;o.length<=r;){i=s.parseSID(),a=s.parseCard16();for(var h=0;h<=a;h+=1)o.push(Hu(n,i)),i+=1}}return o}(e,t+u.charset,r.nGlyphs,o.objects);if(0===u.encoding?r.cffEncoding=new Bu(Mu,x):1===u.encoding?r.cffEncoding=new Bu(_u,x):r.cffEncoding=function(e,t,r){var n,i={},a=new bu.Parser(e,t),s=a.parseCard8();if(0===s)for(var o=a.parseCard8(),l=0;l<o;l+=1)i[n=a.parseCard8()]=l;else{if(1!==s)throw new Error("Unknown encoding format "+s);var c=a.parseCard8();n=1;for(var u=0;u<c;u+=1)for(var h=a.parseCard8(),d=a.parseCard8(),p=h;p<=h+d;p+=1)i[p]=n,n+=1}return new Bu(i,r)}(e,t+u.encoding,x),r.encoding=r.encoding||r.cffEncoding,r.glyphs=new Nu.GlyphSet(r),n.lowMemory)r._push=function(n){var i=function(e,t,r,n,i){var a=bu.getCard16(r,n),s=0;0!==a&&(s=n+(a+1)*bu.getByte(r,n+2)+2);var o=bu.getBytes(r,s+t[e],s+t[e+1]);return i&&(o=i(o)),o}(n,m.offsets,e,t+u.charStrings);r.glyphs.push(n,Nu.cffGlyphLoader(r,n,Ku,i))};else for(var b=0;b<r.nGlyphs;b+=1){var w=m.objects[b];r.glyphs.push(b,Nu.cffGlyphLoader(r,b,Ku,w))}},make:function(e,t){for(var r,n=new pu.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),i=1/t.unitsPerEm,a={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[i,0,0,i,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},s=[],o=1;o<e.length;o+=1)r=e.get(o),s.push(r.name);var l=[];n.header=new pu.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}]),n.nameIndex=function(e){var t=new pu.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(var r=0;r<e.length;r+=1)t.names.push({name:"name_"+r,type:"NAME",value:e[r]});return t}([t.postScriptName]);var c=$u(a,l);n.topDictIndex=eh(c),n.globalSubrIndex=new pu.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}]),n.charsets=function(e,t){for(var r=new pu.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<e.length;n+=1){var i=Ju(e[n],t);r.fields.push({name:"glyph_"+n,type:"SID",value:i})}return r}(s,l),n.charStringsIndex=function(e){for(var t=new pu.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),r=0;r<e.length;r+=1){var n=e.get(r),i=th(n);t.charStrings.push({name:n.name,type:"CHARSTRING",value:i})}return t}(e),n.privateDict=function(e,t){var r=new pu.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return r.dict=Zu(Wu,e,t),r}({},l),n.stringIndex=function(e){var t=new pu.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(var r=0;r<e.length;r+=1)t.strings.push({name:"string_"+r,type:"STRING",value:e[r]});return t}(l);var u=n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf();return a.charset=u,a.encoding=0,a.charStrings=a.charset+n.charsets.sizeOf(),a.private[1]=a.charStrings+n.charStringsIndex.sizeOf(),c=$u(a,l),n.topDictIndex=eh(c),n}};var nh={parse:function(e,t){var r={},n=new bu.Parser(e,t);return r.version=n.parseVersion(),r.fontRevision=Math.round(1e3*n.parseFixed())/1e3,r.checkSumAdjustment=n.parseULong(),r.magicNumber=n.parseULong(),jc.argument(1594834165===r.magicNumber,"Font header has wrong magic number."),r.flags=n.parseUShort(),r.unitsPerEm=n.parseUShort(),r.created=n.parseLongDateTime(),r.modified=n.parseLongDateTime(),r.xMin=n.parseShort(),r.yMin=n.parseShort(),r.xMax=n.parseShort(),r.yMax=n.parseShort(),r.macStyle=n.parseUShort(),r.lowestRecPPEM=n.parseUShort(),r.fontDirectionHint=n.parseShort(),r.indexToLocFormat=n.parseShort(),r.glyphDataFormat=n.parseShort(),r},make:function(e){var t=Math.round((new Date).getTime()/1e3)+2082844800,r=t;return e.createdTimestamp&&(r=e.createdTimestamp+2082844800),new pu.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:r},{name:"modified",type:"LONGDATETIME",value:t},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)}};var ih={parse:function(e,t){var r={},n=new bu.Parser(e,t);return r.version=n.parseVersion(),r.ascender=n.parseShort(),r.descender=n.parseShort(),r.lineGap=n.parseShort(),r.advanceWidthMax=n.parseUShort(),r.minLeftSideBearing=n.parseShort(),r.minRightSideBearing=n.parseShort(),r.xMaxExtent=n.parseShort(),r.caretSlopeRise=n.parseShort(),r.caretSlopeRun=n.parseShort(),r.caretOffset=n.parseShort(),n.relativeOffset+=8,r.metricDataFormat=n.parseShort(),r.numberOfHMetrics=n.parseUShort(),r},make:function(e){return new pu.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],e)}};var ah={parse:function(e,t,r,n,i,a,s){s.lowMemory?function(e,t,r,n,i){var a,s;e._hmtxTableData={};for(var o=new bu.Parser(t,r),l=0;l<i;l+=1)l<n&&(a=o.parseUShort(),s=o.parseShort()),e._hmtxTableData[l]={advanceWidth:a,leftSideBearing:s}}(e,t,r,n,i):function(e,t,r,n,i){for(var a,s,o=new bu.Parser(e,t),l=0;l<n;l+=1){l<r&&(a=o.parseUShort(),s=o.parseShort());var c=i.get(l);c.advanceWidth=a,c.leftSideBearing=s}}(t,r,n,i,a)},make:function(e){for(var t=new pu.Table("hmtx",[]),r=0;r<e.length;r+=1){var n=e.get(r),i=n.advanceWidth||0,a=n.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+r,type:"USHORT",value:i}),t.fields.push({name:"leftSideBearing_"+r,type:"SHORT",value:a})}return t}};var sh={make:function(e){for(var t=new pu.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]),r="",n=12+4*e.length,i=0;i<e.length;++i){var a=r.indexOf(e[i]);a<0&&(a=r.length,r+=e[i]),t.fields.push({name:"offset "+i,type:"USHORT",value:n+a}),t.fields.push({name:"length "+i,type:"USHORT",value:e[i].length})}return t.fields.push({name:"stringPool",type:"CHARARRAY",value:r}),t},parse:function(e,t){var r=new bu.Parser(e,t),n=r.parseULong();jc.argument(1===n,"Unsupported ltag table version."),r.skip("uLong",1);for(var i=r.parseULong(),a=[],s=0;s<i;s++){for(var o="",l=t+r.parseUShort(),c=r.parseUShort(),u=l;u<l+c;++u)o+=String.fromCharCode(e.getInt8(u));a.push(o)}return a}};var oh={parse:function(e,t){var r={},n=new bu.Parser(e,t);return r.version=n.parseVersion(),r.numGlyphs=n.parseUShort(),1===r.version&&(r.maxPoints=n.parseUShort(),r.maxContours=n.parseUShort(),r.maxCompositePoints=n.parseUShort(),r.maxCompositeContours=n.parseUShort(),r.maxZones=n.parseUShort(),r.maxTwilightPoints=n.parseUShort(),r.maxStorage=n.parseUShort(),r.maxFunctionDefs=n.parseUShort(),r.maxInstructionDefs=n.parseUShort(),r.maxStackElements=n.parseUShort(),r.maxSizeOfInstructions=n.parseUShort(),r.maxComponentElements=n.parseUShort(),r.maxComponentDepth=n.parseUShort()),r},make:function(e){return new pu.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}},lh=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],ch={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},uh={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},hh={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"};function dh(e,t,r){switch(e){case 0:if(65535===t)return"und";if(r)return r[t];break;case 1:return ch[t];case 3:return hh[t]}}var ph="utf-16",fh={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},mh={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function gh(e,t,r){switch(e){case 0:return ph;case 1:return mh[r]||fh[t];case 3:if(1===t||10===t)return ph}}function vh(e){var t={};for(var r in e)t[e[r]]=parseInt(r);return t}function Ah(e,t,r,n,i,a){return new pu.Record("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:t},{name:"languageID",type:"USHORT",value:r},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:i},{name:"offset",type:"USHORT",value:a}])}function yh(e,t){var r=function(e,t){var r=e.length,n=t.length-r+1;e:for(var i=0;i<n;i++)for(;i<n;i++){for(var a=0;a<r;a++)if(t[i+a]!==e[a])continue e;return i}return-1}(e,t);if(r<0){r=t.length;for(var n=0,i=e.length;n<i;++n)t.push(e[n])}return r}var xh={parse:function(e,t,r){for(var n={},i=new bu.Parser(e,t),a=i.parseUShort(),s=i.parseUShort(),o=i.offset+i.parseUShort(),l=0;l<s;l++){var c=i.parseUShort(),u=i.parseUShort(),h=i.parseUShort(),d=i.parseUShort(),p=lh[d]||d,f=i.parseUShort(),m=i.parseUShort(),g=dh(c,h,r),v=gh(c,u,h);if(void 0!==v&&void 0!==g){var A=void 0;if(A=v===ph?Xc.UTF16(e,o+m,f):Xc.MACSTRING(e,o+m,f,v)){var y=n[p];void 0===y&&(y=n[p]={}),y[g]=A}}}return 1===a&&i.parseUShort(),n},make:function(e,t){var r,n=[],i={},a=vh(lh);for(var s in e){var o=a[s];if(void 0===o&&(o=s),r=parseInt(o),isNaN(r))throw new Error('Name table entry "'+s+'" does not exist, see nameTableNames for complete list.');i[r]=e[s],n.push(r)}for(var l=vh(ch),c=vh(hh),u=[],h=[],d=0;d<n.length;d++){var p=i[r=n[d]];for(var f in p){var m=p[f],g=1,v=l[f],A=uh[v],y=gh(g,A,v),x=Yc.MACSTRING(m,y);void 0===x&&(g=0,(v=t.indexOf(f))<0&&(v=t.length,t.push(f)),A=4,x=Yc.UTF16(m));var b=yh(x,h);u.push(Ah(g,A,v,r,x.length,b));var w=c[f];if(void 0!==w){var E=Yc.UTF16(m),S=yh(E,h);u.push(Ah(3,1,w,r,E.length,S))}}}u.sort((function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID}));for(var M=new pu.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:u.length},{name:"stringOffset",type:"USHORT",value:6+12*u.length}]),_=0;_<u.length;_++)M.fields.push({name:"record_"+_,type:"RECORD",value:u[_]});return M.fields.push({name:"strings",type:"LITERAL",value:h}),M}},bh=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];var wh={parse:function(e,t){var r={},n=new bu.Parser(e,t);r.version=n.parseUShort(),r.xAvgCharWidth=n.parseShort(),r.usWeightClass=n.parseUShort(),r.usWidthClass=n.parseUShort(),r.fsType=n.parseUShort(),r.ySubscriptXSize=n.parseShort(),r.ySubscriptYSize=n.parseShort(),r.ySubscriptXOffset=n.parseShort(),r.ySubscriptYOffset=n.parseShort(),r.ySuperscriptXSize=n.parseShort(),r.ySuperscriptYSize=n.parseShort(),r.ySuperscriptXOffset=n.parseShort(),r.ySuperscriptYOffset=n.parseShort(),r.yStrikeoutSize=n.parseShort(),r.yStrikeoutPosition=n.parseShort(),r.sFamilyClass=n.parseShort(),r.panose=[];for(var i=0;i<10;i++)r.panose[i]=n.parseByte();return r.ulUnicodeRange1=n.parseULong(),r.ulUnicodeRange2=n.parseULong(),r.ulUnicodeRange3=n.parseULong(),r.ulUnicodeRange4=n.parseULong(),r.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),r.fsSelection=n.parseUShort(),r.usFirstCharIndex=n.parseUShort(),r.usLastCharIndex=n.parseUShort(),r.sTypoAscender=n.parseShort(),r.sTypoDescender=n.parseShort(),r.sTypoLineGap=n.parseShort(),r.usWinAscent=n.parseUShort(),r.usWinDescent=n.parseUShort(),r.version>=1&&(r.ulCodePageRange1=n.parseULong(),r.ulCodePageRange2=n.parseULong()),r.version>=2&&(r.sxHeight=n.parseShort(),r.sCapHeight=n.parseShort(),r.usDefaultChar=n.parseUShort(),r.usBreakChar=n.parseUShort(),r.usMaxContent=n.parseUShort()),r},make:function(e){return new pu.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)},unicodeRanges:bh,getUnicodeRange:function(e){for(var t=0;t<bh.length;t+=1){var r=bh[t];if(e>=r.begin&&e<r.end)return t}return-1}};var Eh={parse:function(e,t){var r={},n=new bu.Parser(e,t);switch(r.version=n.parseVersion(),r.italicAngle=n.parseFixed(),r.underlinePosition=n.parseShort(),r.underlineThickness=n.parseShort(),r.isFixedPitch=n.parseULong(),r.minMemType42=n.parseULong(),r.maxMemType42=n.parseULong(),r.minMemType1=n.parseULong(),r.maxMemType1=n.parseULong(),r.version){case 1:r.names=Tu.slice();break;case 2:r.numberOfGlyphs=n.parseUShort(),r.glyphNameIndex=new Array(r.numberOfGlyphs);for(var i=0;i<r.numberOfGlyphs;i++)r.glyphNameIndex[i]=n.parseUShort();r.names=[];for(var a=0;a<r.numberOfGlyphs;a++)if(r.glyphNameIndex[a]>=Tu.length){var s=n.parseChar();r.names.push(n.parseString(s))}break;case 2.5:r.numberOfGlyphs=n.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var o=0;o<r.numberOfGlyphs;o++)r.offset[o]=n.parseChar()}return r},make:function(){return new pu.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}},Sh=new Array(9);Sh[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(yu.coverage),deltaGlyphId:this.parseUShort()}:2===t?{substFormat:2,coverage:this.parsePointer(yu.coverage),substitute:this.parseOffset16List()}:void jc.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},Sh[2]=function(){var e=this.parseUShort();return jc.argument(1===e,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(yu.coverage),sequences:this.parseListOfLists()}},Sh[3]=function(){var e=this.parseUShort();return jc.argument(1===e,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(yu.coverage),alternateSets:this.parseListOfLists()}},Sh[4]=function(){var e=this.parseUShort();return jc.argument(1===e,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(yu.coverage),ligatureSets:this.parseListOfLists((function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}}))}};var Mh={sequenceIndex:yu.uShort,lookupListIndex:yu.uShort};Sh[5]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{substFormat:t,coverage:this.parsePointer(yu.coverage),ruleSets:this.parseListOfLists((function(){var e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,Mh)}}))};if(2===t)return{substFormat:t,coverage:this.parsePointer(yu.coverage),classDef:this.parsePointer(yu.classDef),classSets:this.parseListOfLists((function(){var e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,Mh)}}))};if(3===t){var r=this.parseUShort(),n=this.parseUShort();return{substFormat:t,coverages:this.parseList(r,yu.pointer(yu.coverage)),lookupRecords:this.parseRecordList(n,Mh)}}jc.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},Sh[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(yu.coverage),chainRuleSets:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Mh)}}))}:2===t?{substFormat:2,coverage:this.parsePointer(yu.coverage),backtrackClassDef:this.parsePointer(yu.classDef),inputClassDef:this.parsePointer(yu.classDef),lookaheadClassDef:this.parsePointer(yu.classDef),chainClassSet:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Mh)}}))}:3===t?{substFormat:3,backtrackCoverage:this.parseList(yu.pointer(yu.coverage)),inputCoverage:this.parseList(yu.pointer(yu.coverage)),lookaheadCoverage:this.parseList(yu.pointer(yu.coverage)),lookupRecords:this.parseRecordList(Mh)}:void jc.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},Sh[7]=function(){var e=this.parseUShort();jc.argument(1===e,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),r=new yu(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:Sh[t].call(r)}},Sh[8]=function(){var e=this.parseUShort();return jc.argument(1===e,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(yu.coverage),backtrackCoverage:this.parseList(yu.pointer(yu.coverage)),lookaheadCoverage:this.parseList(yu.pointer(yu.coverage)),substitutes:this.parseUShortList()}};var _h=new Array(9);_h[1]=function(e){return 1===e.substFormat?new pu.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new pu.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new pu.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new pu.Coverage(e.coverage)}].concat(pu.ushortList("substitute",e.substitute)))},_h[2]=function(e){return jc.assert(1===e.substFormat,"Lookup type 2 substFormat must be 1."),new pu.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new pu.Coverage(e.coverage)}].concat(pu.tableList("seqSet",e.sequences,(function(e){return new pu.Table("sequenceSetTable",pu.ushortList("sequence",e))}))))},_h[3]=function(e){return jc.assert(1===e.substFormat,"Lookup type 3 substFormat must be 1."),new pu.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new pu.Coverage(e.coverage)}].concat(pu.tableList("altSet",e.alternateSets,(function(e){return new pu.Table("alternateSetTable",pu.ushortList("alternate",e))}))))},_h[4]=function(e){return jc.assert(1===e.substFormat,"Lookup type 4 substFormat must be 1."),new pu.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new pu.Coverage(e.coverage)}].concat(pu.tableList("ligSet",e.ligatureSets,(function(e){return new pu.Table("ligatureSetTable",pu.tableList("ligature",e,(function(e){return new pu.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:e.ligGlyph}].concat(pu.ushortList("component",e.components,e.components.length+1)))})))}))))},_h[6]=function(e){if(1===e.substFormat){var t=new pu.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new pu.Coverage(e.coverage)}].concat(pu.tableList("chainRuleSet",e.chainRuleSets,(function(e){return new pu.Table("chainRuleSetTable",pu.tableList("chainRule",e,(function(e){var t=pu.ushortList("backtrackGlyph",e.backtrack,e.backtrack.length).concat(pu.ushortList("inputGlyph",e.input,e.input.length+1)).concat(pu.ushortList("lookaheadGlyph",e.lookahead,e.lookahead.length)).concat(pu.ushortList("substitution",[],e.lookupRecords.length));return e.lookupRecords.forEach((function(e,r){t=t.concat({name:"sequenceIndex"+r,type:"USHORT",value:e.sequenceIndex}).concat({name:"lookupListIndex"+r,type:"USHORT",value:e.lookupListIndex})})),new pu.Table("chainRuleTable",t)})))}))));return t}if(2===e.substFormat)jc.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(3===e.substFormat){var r=[{name:"substFormat",type:"USHORT",value:e.substFormat}];return r.push({name:"backtrackGlyphCount",type:"USHORT",value:e.backtrackCoverage.length}),e.backtrackCoverage.forEach((function(e,t){r.push({name:"backtrackCoverage"+t,type:"TABLE",value:new pu.Coverage(e)})})),r.push({name:"inputGlyphCount",type:"USHORT",value:e.inputCoverage.length}),e.inputCoverage.forEach((function(e,t){r.push({name:"inputCoverage"+t,type:"TABLE",value:new pu.Coverage(e)})})),r.push({name:"lookaheadGlyphCount",type:"USHORT",value:e.lookaheadCoverage.length}),e.lookaheadCoverage.forEach((function(e,t){r.push({name:"lookaheadCoverage"+t,type:"TABLE",value:new pu.Coverage(e)})})),r.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length}),e.lookupRecords.forEach((function(e,t){r=r.concat({name:"sequenceIndex"+t,type:"USHORT",value:e.sequenceIndex}).concat({name:"lookupListIndex"+t,type:"USHORT",value:e.lookupListIndex})})),new pu.Table("chainContextTable",r)}jc.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};var Th={parse:function(e,t){var r=new yu(e,t=t||0),n=r.parseVersion(1);return jc.argument(1===n||1.1===n,"Unsupported GSUB table version."),1===n?{version:n,scripts:r.parseScriptList(),features:r.parseFeatureList(),lookups:r.parseLookupList(Sh)}:{version:n,scripts:r.parseScriptList(),features:r.parseFeatureList(),lookups:r.parseLookupList(Sh),variations:r.parseFeatureVariationsList()}},make:function(e){return new pu.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new pu.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new pu.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new pu.LookupList(e.lookups,_h)}])}};var Ch={parse:function(e,t){var r=new bu.Parser(e,t),n=r.parseULong();jc.argument(1===n,"Unsupported META table version."),r.parseULong(),r.parseULong();for(var i=r.parseULong(),a={},s=0;s<i;s++){var o=r.parseTag(),l=r.parseULong(),c=r.parseULong(),u=Xc.UTF8(e,t+l,c);a[o]=u}return a},make:function(e){var t=Object.keys(e).length,r="",n=16+12*t,i=new pu.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:t}]);for(var a in e){var s=r.length;r+=e[a],i.fields.push({name:"tag "+a,type:"TAG",value:a}),i.fields.push({name:"offset "+a,type:"ULONG",value:n+s}),i.fields.push({name:"length "+a,type:"ULONG",value:e[a].length})}return i.fields.push({name:"stringPool",type:"CHARARRAY",value:r}),i}};function Ih(e){return Math.log(e)/Math.log(2)|0}function Bh(e){for(;e.length%4!=0;)e.push(0);for(var t=0,r=0;r<e.length;r+=4)t+=(e[r]<<24)+(e[r+1]<<16)+(e[r+2]<<8)+e[r+3];return t%=Math.pow(2,32)}function Rh(e,t,r,n){return new pu.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==e?e:""},{name:"checkSum",type:"ULONG",value:void 0!==t?t:0},{name:"offset",type:"ULONG",value:void 0!==r?r:0},{name:"length",type:"ULONG",value:void 0!==n?n:0}])}function Ph(e){var t=new pu.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);t.tables=e,t.numTables=e.length;var r=Math.pow(2,Ih(t.numTables));t.searchRange=16*r,t.entrySelector=Ih(r),t.rangeShift=16*t.numTables-t.searchRange;for(var n=[],i=[],a=t.sizeOf()+Rh().sizeOf()*t.numTables;a%4!=0;)a+=1,i.push({name:"padding",type:"BYTE",value:0});for(var s=0;s<e.length;s+=1){var o=e[s];jc.argument(4===o.tableName.length,"Table name"+o.tableName+" is invalid.");var l=o.sizeOf(),c=Rh(o.tableName,Bh(o.encode()),a,l);for(n.push({name:c.tag+" Table Record",type:"RECORD",value:c}),i.push({name:o.tableName+" table",type:"RECORD",value:o}),a+=l,jc.argument(!isNaN(a),"Something went wrong calculating the offset.");a%4!=0;)a+=1,i.push({name:"padding",type:"BYTE",value:0})}return n.sort((function(e,t){return e.value.tag>t.value.tag?1:-1})),t.fields=t.fields.concat(n),t.fields=t.fields.concat(i),t}function Fh(e,t,r){for(var n=0;n<t.length;n+=1){var i=e.charToGlyphIndex(t[n]);if(i>0)return e.glyphs.get(i).getMetrics()}return r}function Lh(e){for(var t=0,r=0;r<e.length;r+=1)t+=e[r];return t/e.length}var Dh={make:Ph,fontToTable:function(e){for(var t,r=[],n=[],i=[],a=[],s=[],o=[],l=[],c=0,u=0,h=0,d=0,p=0,f=0;f<e.glyphs.length;f+=1){var m=e.glyphs.get(f),g=0|m.unicode;if(isNaN(m.advanceWidth))throw new Error("Glyph "+m.name+" ("+f+"): advanceWidth is not a number.");(t>g||void 0===t)&&g>0&&(t=g),c<g&&(c=g);var v=wh.getUnicodeRange(g);if(v<32)u|=1<<v;else if(v<64)h|=1<<v-32;else if(v<96)d|=1<<v-64;else{if(!(v<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");p|=1<<v-96}if(".notdef"!==m.name){var A=m.getMetrics();r.push(A.xMin),n.push(A.yMin),i.push(A.xMax),a.push(A.yMax),o.push(A.leftSideBearing),l.push(A.rightSideBearing),s.push(m.advanceWidth)}}var y={xMin:Math.min.apply(null,r),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,i),yMax:Math.max.apply(null,a),advanceWidthMax:Math.max.apply(null,s),advanceWidthAvg:Lh(s),minLeftSideBearing:Math.min.apply(null,o),maxLeftSideBearing:Math.max.apply(null,o),minRightSideBearing:Math.min.apply(null,l)};y.ascender=e.ascender,y.descender=e.descender;var x=nh.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:y.xMin,yMin:y.yMin,xMax:y.xMax,yMax:y.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),b=ih.make({ascender:y.ascender,descender:y.descender,advanceWidthMax:y.advanceWidthMax,minLeftSideBearing:y.minLeftSideBearing,minRightSideBearing:y.minRightSideBearing,xMaxExtent:y.maxLeftSideBearing+(y.xMax-y.xMin),numberOfHMetrics:e.glyphs.length}),w=oh.make(e.glyphs.length),E=wh.make(Object.assign({xAvgCharWidth:Math.round(y.advanceWidthAvg),usFirstCharIndex:t,usLastCharIndex:c,ulUnicodeRange1:u,ulUnicodeRange2:h,ulUnicodeRange3:d,ulUnicodeRange4:p,sTypoAscender:y.ascender,sTypoDescender:y.descender,sTypoLineGap:0,usWinAscent:y.yMax,usWinDescent:Math.abs(y.yMin),ulCodePageRange1:1,sxHeight:Fh(e,"xyvw",{yMax:Math.round(y.ascender/2)}).yMax,sCapHeight:Fh(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",y).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),S=ah.make(e.glyphs),M=Eu.make(e.glyphs),_=e.getEnglishName("fontFamily"),T=e.getEnglishName("fontSubfamily"),C=_+" "+T,I=e.getEnglishName("postScriptName");I||(I=_.replace(/\s/g,"")+"-"+T);var B={};for(var R in e.names)B[R]=e.names[R];B.uniqueID||(B.uniqueID={en:e.getEnglishName("manufacturer")+":"+C}),B.postScriptName||(B.postScriptName={en:I}),B.preferredFamily||(B.preferredFamily=e.names.fontFamily),B.preferredSubfamily||(B.preferredSubfamily=e.names.fontSubfamily);var P=[],F=xh.make(B,P),L=P.length>0?sh.make(P):void 0,D=Eh.make(),U=rh.make(e.glyphs,{version:e.getEnglishName("version"),fullName:C,familyName:_,weightName:T,postScriptName:I,unitsPerEm:e.unitsPerEm,fontBBox:[0,y.yMin,y.ascender,y.advanceWidthMax]}),N=e.metas&&Object.keys(e.metas).length>0?Ch.make(e.metas):void 0,k=[x,b,w,E,F,M,D,U,S];L&&k.push(L),e.tables.gsub&&k.push(Th.make(e.tables.gsub)),N&&k.push(N);for(var O=Ph(k),G=Bh(O.encode()),z=O.fields,V=!1,H=0;H<z.length;H+=1)if("head table"===z[H].name){z[H].value.checkSumAdjustment=2981146554-G,V=!0;break}if(!V)throw new Error("Could not find head table with checkSum to adjust.");return O},computeCheckSum:Bh};function Uh(e,t){for(var r=0,n=e.length-1;r<=n;){var i=r+n>>>1,a=e[i].tag;if(a===t)return i;a<t?r=i+1:n=i-1}return-r-1}function Nh(e,t){for(var r=0,n=e.length-1;r<=n;){var i=r+n>>>1,a=e[i];if(a===t)return i;a<t?r=i+1:n=i-1}return-r-1}function kh(e,t){for(var r,n=0,i=e.length-1;n<=i;){var a=n+i>>>1,s=(r=e[a]).start;if(s===t)return r;s<t?n=a+1:i=a-1}if(n>0)return t>(r=e[n-1]).end?0:r}function Oh(e,t){this.font=e,this.tableName=t}function Gh(e){Oh.call(this,e,"gpos")}function zh(e){Oh.call(this,e,"gsub")}function Vh(e,t){var r=e.length;if(r!==t.length)return!1;for(var n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}function Hh(e,t,r){for(var n=e.subtables,i=0;i<n.length;i++){var a=n[i];if(a.substFormat===t)return a}if(r)return n.push(r),r}function Qh(e,t){if(!e)throw t}function jh(e,t,r,n,i){var a;return(t&n)>0?(a=e.parseByte(),0==(t&i)&&(a=-a),a=r+a):a=(t&i)>0?r:r+e.parseShort(),a}function Wh(e,t,r){var n,i,a=new bu.Parser(t,r);if(e.numberOfContours=a.parseShort(),e._xMin=a.parseShort(),e._yMin=a.parseShort(),e._xMax=a.parseShort(),e._yMax=a.parseShort(),e.numberOfContours>0){for(var s=e.endPointIndices=[],o=0;o<e.numberOfContours;o+=1)s.push(a.parseUShort());e.instructionLength=a.parseUShort(),e.instructions=[];for(var l=0;l<e.instructionLength;l+=1)e.instructions.push(a.parseByte());var c=s[s.length-1]+1;n=[];for(var u=0;u<c;u+=1)if(i=a.parseByte(),n.push(i),(8&i)>0)for(var h=a.parseByte(),d=0;d<h;d+=1)n.push(i),u+=1;if(jc.argument(n.length===c,"Bad flags."),s.length>0){var p,f=[];if(c>0){for(var m=0;m<c;m+=1)i=n[m],(p={}).onCurve=!!(1&i),p.lastPointOfContour=s.indexOf(m)>=0,f.push(p);for(var g=0,v=0;v<c;v+=1)i=n[v],(p=f[v]).x=jh(a,i,g,2,16),g=p.x;for(var A=0,y=0;y<c;y+=1)i=n[y],(p=f[y]).y=jh(a,i,A,4,32),A=p.y}e.points=f}else e.points=[]}else if(0===e.numberOfContours)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var x=!0;x;){n=a.parseUShort();var b={glyphIndex:a.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(1&n)>0?(2&n)>0?(b.dx=a.parseShort(),b.dy=a.parseShort()):b.matchedPoints=[a.parseUShort(),a.parseUShort()]:(2&n)>0?(b.dx=a.parseChar(),b.dy=a.parseChar()):b.matchedPoints=[a.parseByte(),a.parseByte()],(8&n)>0?b.xScale=b.yScale=a.parseF2Dot14():(64&n)>0?(b.xScale=a.parseF2Dot14(),b.yScale=a.parseF2Dot14()):(128&n)>0&&(b.xScale=a.parseF2Dot14(),b.scale01=a.parseF2Dot14(),b.scale10=a.parseF2Dot14(),b.yScale=a.parseF2Dot14()),e.components.push(b),x=!!(32&n)}if(256&n){e.instructionLength=a.parseUShort(),e.instructions=[];for(var w=0;w<e.instructionLength;w+=1)e.instructions.push(a.parseByte())}}}function Xh(e,t){for(var r=[],n=0;n<e.length;n+=1){var i=e[n],a={x:t.xScale*i.x+t.scale01*i.y+t.dx,y:t.scale10*i.x+t.yScale*i.y+t.dy,onCurve:i.onCurve,lastPointOfContour:i.lastPointOfContour};r.push(a)}return r}function Yh(e){var t=new Vc;if(!e)return t;for(var r=function(e){for(var t=[],r=[],n=0;n<e.length;n+=1){var i=e[n];r.push(i),i.lastPointOfContour&&(t.push(r),r=[])}return jc.argument(0===r.length,"There are still points left in the current contour."),t}(e),n=0;n<r.length;++n){var i=r[n],a=null,s=i[i.length-1],o=i[0];if(s.onCurve)t.moveTo(s.x,s.y);else if(o.onCurve)t.moveTo(o.x,o.y);else{var l={x:.5*(s.x+o.x),y:.5*(s.y+o.y)};t.moveTo(l.x,l.y)}for(var c=0;c<i.length;++c)if(a=s,s=o,o=i[(c+1)%i.length],s.onCurve)t.lineTo(s.x,s.y);else{var u=o;a.onCurve||{x:.5*(s.x+a.x),y:.5*(s.y+a.y)},o.onCurve||(u={x:.5*(s.x+o.x),y:.5*(s.y+o.y)}),t.quadraticCurveTo(s.x,s.y,u.x,u.y)}t.closePath()}return t}function qh(e,t){if(t.isComposite)for(var r=0;r<t.components.length;r+=1){var n=t.components[r],i=e.get(n.glyphIndex);if(i.getPath(),i.points){var a=void 0;if(void 0===n.matchedPoints)a=Xh(i.points,n);else{if(n.matchedPoints[0]>t.points.length-1||n.matchedPoints[1]>i.points.length-1)throw Error("Matched points out of range in "+t.name);var s=t.points[n.matchedPoints[0]],o=i.points[n.matchedPoints[1]],l={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};o=Xh([o],l)[0],l.dx=s.x-o.x,l.dy=s.y-o.y,a=Xh(i.points,l)}t.points=t.points.concat(a)}}return Yh(t.points)}Oh.prototype={searchTag:Uh,binSearch:Nh,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map((function(e){return e.tag})):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r<e.scripts.length;r++){var n=e.scripts[r].tag;if("DFLT"===n)return n;"latn"===n&&(t=!0)}return t?"latn":void 0}},getScriptTable:function(e,t){var r=this.getTable(t);if(r){e=e||"DFLT";var n=r.scripts,i=Uh(r.scripts,e);if(i>=0)return n[i].script;if(t){var a={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-i,0,a),a.script}}},getLangSysTable:function(e,t,r){var n=this.getScriptTable(e,r);if(n){if(!t||"dflt"===t||"DFLT"===t)return n.defaultLangSys;var i=Uh(n.langSysRecords,t);if(i>=0)return n.langSysRecords[i].langSys;if(r){var a={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-i,0,a),a.langSys}}},getFeatureTable:function(e,t,r,n){var i=this.getLangSysTable(e,t,n);if(i){for(var a,s=i.featureIndexes,o=this.font.tables[this.tableName].features,l=0;l<s.length;l++)if((a=o[s[l]]).tag===r)return a.feature;if(n){var c=o.length;return jc.assert(0===c||r>=o[c-1].tag,"Features must be added in alphabetical order."),a={tag:r,feature:{params:0,lookupListIndexes:[]}},o.push(a),s.push(c),a.feature}}},getLookupTables:function(e,t,r,n,i){var a=this.getFeatureTable(e,t,r,i),s=[];if(a){for(var o,l=a.lookupListIndexes,c=this.font.tables[this.tableName].lookups,u=0;u<l.length;u++)(o=c[l[u]]).lookupType===n&&s.push(o);if(0===s.length&&i){o={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var h=c.length;return c.push(o),l.push(h),[o]}}return s},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:var r=kh(e.ranges,t);return r?r.classId:0}},getCoverageIndex:function(e,t){switch(e.format){case 1:var r=Nh(e.glyphs,t);return r>=0?r:-1;case 2:var n=kh(e.ranges,t);return n?n.index+t-n.start:-1}},expandCoverage:function(e){if(1===e.format)return e.glyphs;for(var t=[],r=e.ranges,n=0;n<r.length;n++)for(var i=r[n],a=i.start,s=i.end,o=a;o<=s;o++)t.push(o);return t}},Gh.prototype=Oh.prototype,Gh.prototype.init=function(){var e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},Gh.prototype.getKerningValue=function(e,t,r){for(var n=0;n<e.length;n++)for(var i=e[n].subtables,a=0;a<i.length;a++){var s=i[a],o=this.getCoverageIndex(s.coverage,t);if(!(o<0))switch(s.posFormat){case 1:for(var l=s.pairSets[o],c=0;c<l.length;c++){var u=l[c];if(u.secondGlyph===r)return u.value1&&u.value1.xAdvance||0}break;case 2:var h=this.getGlyphClass(s.classDef1,t),d=this.getGlyphClass(s.classDef2,r),p=s.classRecords[h][d];return p.value1&&p.value1.xAdvance||0}}return 0},Gh.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)},zh.prototype=Oh.prototype,zh.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},zh.prototype.getSingle=function(e,t,r){for(var n=[],i=this.getLookupTables(t,r,e,1),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++){var l=s[o],c=this.expandCoverage(l.coverage),u=void 0;if(1===l.substFormat){var h=l.deltaGlyphId;for(u=0;u<c.length;u++){var d=c[u];n.push({sub:d,by:d+h})}}else{var p=l.substitute;for(u=0;u<c.length;u++)n.push({sub:c[u],by:p[u]})}}return n},zh.prototype.getMultiple=function(e,t,r){for(var n=[],i=this.getLookupTables(t,r,e,2),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++){var l=s[o],c=this.expandCoverage(l.coverage),u=void 0;for(u=0;u<c.length;u++){var h=c[u],d=l.sequences[u];n.push({sub:h,by:d})}}return n},zh.prototype.getAlternates=function(e,t,r){for(var n=[],i=this.getLookupTables(t,r,e,3),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++)for(var l=s[o],c=this.expandCoverage(l.coverage),u=l.alternateSets,h=0;h<c.length;h++)n.push({sub:c[h],by:u[h]});return n},zh.prototype.getLigatures=function(e,t,r){for(var n=[],i=this.getLookupTables(t,r,e,4),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++)for(var l=s[o],c=this.expandCoverage(l.coverage),u=l.ligatureSets,h=0;h<c.length;h++)for(var d=c[h],p=u[h],f=0;f<p.length;f++){var m=p[f];n.push({sub:[d].concat(m.components),by:m.ligGlyph})}return n},zh.prototype.addSingle=function(e,t,r,n){var i=Hh(this.getLookupTables(r,n,e,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});jc.assert(1===i.coverage.format,"Single: unable to modify coverage table format "+i.coverage.format);var a=t.sub,s=this.binSearch(i.coverage.glyphs,a);s<0&&(s=-1-s,i.coverage.glyphs.splice(s,0,a),i.substitute.splice(s,0,0)),i.substitute[s]=t.by},zh.prototype.addMultiple=function(e,t,r,n){jc.assert(t.by instanceof Array&&t.by.length>1,'Multiple: "by" must be an array of two or more ids');var i=Hh(this.getLookupTables(r,n,e,2,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});jc.assert(1===i.coverage.format,"Multiple: unable to modify coverage table format "+i.coverage.format);var a=t.sub,s=this.binSearch(i.coverage.glyphs,a);s<0&&(s=-1-s,i.coverage.glyphs.splice(s,0,a),i.sequences.splice(s,0,0)),i.sequences[s]=t.by},zh.prototype.addAlternate=function(e,t,r,n){var i=Hh(this.getLookupTables(r,n,e,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});jc.assert(1===i.coverage.format,"Alternate: unable to modify coverage table format "+i.coverage.format);var a=t.sub,s=this.binSearch(i.coverage.glyphs,a);s<0&&(s=-1-s,i.coverage.glyphs.splice(s,0,a),i.alternateSets.splice(s,0,0)),i.alternateSets[s]=t.by},zh.prototype.addLigature=function(e,t,r,n){var i=this.getLookupTables(r,n,e,4,!0)[0],a=i.subtables[0];a||(a={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},i.subtables[0]=a),jc.assert(1===a.coverage.format,"Ligature: unable to modify coverage table format "+a.coverage.format);var s=t.sub[0],o=t.sub.slice(1),l={ligGlyph:t.by,components:o},c=this.binSearch(a.coverage.glyphs,s);if(c>=0){for(var u=a.ligatureSets[c],h=0;h<u.length;h++)if(Vh(u[h].components,o))return;u.push(l)}else c=-1-c,a.coverage.glyphs.splice(c,0,s),a.ligatureSets.splice(c,0,[l])},zh.prototype.getFeature=function(e,t,r){if(/ss\d\d/.test(e))return this.getSingle(e,t,r);switch(e){case"aalt":case"salt":return this.getSingle(e,t,r).concat(this.getAlternates(e,t,r));case"dlig":case"liga":case"rlig":return this.getLigatures(e,t,r);case"ccmp":return this.getMultiple(e,t,r).concat(this.getLigatures(e,t,r));case"stch":return this.getMultiple(e,t,r)}},zh.prototype.add=function(e,t,r,n){if(/ss\d\d/.test(e))return this.addSingle(e,t,r,n);switch(e){case"aalt":case"salt":return"number"==typeof t.by?this.addSingle(e,t,r,n):this.addAlternate(e,t,r,n);case"dlig":case"liga":case"rlig":return this.addLigature(e,t,r,n);case"ccmp":return t.by instanceof Array?this.addMultiple(e,t,r,n):this.addLigature(e,t,r,n)}};var Kh,Jh,Zh,$h,ed={getPath:Yh,parse:function(e,t,r,n,i){return i.lowMemory?function(e,t,r,n){var i=new Nu.GlyphSet(n);return n._push=function(a){var s=r[a];s!==r[a+1]?i.push(a,Nu.ttfGlyphLoader(n,a,Wh,e,t+s,qh)):i.push(a,Nu.glyphLoader(n,a))},i}(e,t,r,n):function(e,t,r,n){for(var i=new Nu.GlyphSet(n),a=0;a<r.length-1;a+=1){var s=r[a];s!==r[a+1]?i.push(a,Nu.ttfGlyphLoader(n,a,Wh,e,t+s,qh)):i.push(a,Nu.glyphLoader(n,a))}return i}(e,t,r,n)}};function td(e){this.font=e,this.getCommands=function(e){return ed.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function rd(e){return e}function nd(e){return Math.sign(e)*Math.round(Math.abs(e))}function id(e){return Math.sign(e)*Math.round(Math.abs(2*e))/2}function ad(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function sd(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function od(e){return Math.sign(e)*Math.floor(Math.abs(e))}var ld=function(e){var t=this.srPeriod,r=this.srPhase,n=1;return e<0&&(e=-e,n=-1),e+=this.srThreshold-r,e=Math.trunc(e/t)*t,(e+=r)<0?r*n:e*n},cd={x:1,y:0,axis:"x",distance:function(e,t,r,n){return(r?e.xo:e.x)-(n?t.xo:t.x)},interpolate:function(e,t,r,n){var i,a,s,o,l,c,u;if(!n||n===this)return i=e.xo-t.xo,a=e.xo-r.xo,l=t.x-t.xo,c=r.x-r.xo,0===(u=(s=Math.abs(i))+(o=Math.abs(a)))?void(e.x=e.xo+(l+c)/2):void(e.x=e.xo+(l*o+c*s)/u);i=n.distance(e,t,!0,!0),a=n.distance(e,r,!0,!0),l=n.distance(t,t,!1,!0),c=n.distance(r,r,!1,!0),0!==(u=(s=Math.abs(i))+(o=Math.abs(a)))?cd.setRelative(e,e,(l*o+c*s)/u,n,!0):cd.setRelative(e,e,(l+c)/2,n,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,r,n,i){if(n&&n!==this){var a=i?t.xo:t.x,s=i?t.yo:t.y,o=a+r*n.x,l=s+r*n.y;e.x=o+(e.y-l)/n.normalSlope}else e.x=(i?t.xo:t.x)+r},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},ud={x:0,y:1,axis:"y",distance:function(e,t,r,n){return(r?e.yo:e.y)-(n?t.yo:t.y)},interpolate:function(e,t,r,n){var i,a,s,o,l,c,u;if(!n||n===this)return i=e.yo-t.yo,a=e.yo-r.yo,l=t.y-t.yo,c=r.y-r.yo,0===(u=(s=Math.abs(i))+(o=Math.abs(a)))?void(e.y=e.yo+(l+c)/2):void(e.y=e.yo+(l*o+c*s)/u);i=n.distance(e,t,!0,!0),a=n.distance(e,r,!0,!0),l=n.distance(t,t,!1,!0),c=n.distance(r,r,!1,!0),0!==(u=(s=Math.abs(i))+(o=Math.abs(a)))?ud.setRelative(e,e,(l*o+c*s)/u,n,!0):ud.setRelative(e,e,(l+c)/2,n,!0)},normalSlope:0,setRelative:function(e,t,r,n,i){if(n&&n!==this){var a=i?t.xo:t.x,s=i?t.yo:t.y,o=a+r*n.x,l=s+r*n.y;e.y=l+n.normalSlope*(e.x-o)}else e.y=(i?t.yo:t.y)+r},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function hd(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function dd(e,t){var r=Math.sqrt(e*e+t*t);return t/=r,1===(e/=r)&&0===t?cd:0===e&&1===t?ud:new hd(e,t)}function pd(e,t,r,n){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=r,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(cd),Object.freeze(ud),hd.prototype.distance=function(e,t,r,n){return this.x*cd.distance(e,t,r,n)+this.y*ud.distance(e,t,r,n)},hd.prototype.interpolate=function(e,t,r,n){var i,a,s,o,l,c,u;s=n.distance(e,t,!0,!0),o=n.distance(e,r,!0,!0),i=n.distance(t,t,!1,!0),a=n.distance(r,r,!1,!0),0!==(u=(l=Math.abs(s))+(c=Math.abs(o)))?this.setRelative(e,e,(i*c+a*l)/u,n,!0):this.setRelative(e,e,(i+a)/2,n,!0)},hd.prototype.setRelative=function(e,t,r,n,i){n=n||this;var a=i?t.xo:t.x,s=i?t.yo:t.y,o=a+r*n.x,l=s+r*n.y,c=n.normalSlope,u=this.slope,h=e.x,d=e.y;e.x=(u*h-c*o+l-d)/(u-c),e.y=u*(e.x-h)+d},hd.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},pd.prototype.nextTouched=function(e){for(var t=this.nextPointOnContour;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},pd.prototype.prevTouched=function(e){for(var t=this.prevPointOnContour;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var fd=Object.freeze(new pd(0,0)),md={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function gd(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=cd,this.round=nd}}function vd(e){for(var t=e.tZone=new Array(e.gZone.length),r=0;r<t.length;r++)t[r]=new pd(0,0)}function Ad(e,t){var r,n=e.prog,i=e.ip,a=1;do{if(88===(r=n[++i]))a++;else if(89===r)a--;else if(64===r)i+=n[i+1]+1;else if(65===r)i+=2*n[i+1]+1;else if(r>=176&&r<=183)i+=r-176+1;else if(r>=184&&r<=191)i+=2*(r-184+1);else if(t&&1===a&&27===r)break}while(a>0);e.ip=i}function yd(e,t){exports.DEBUG&&console.log(t.step,"SVTCA["+e.axis+"]"),t.fv=t.pv=t.dpv=e}function xd(e,t){exports.DEBUG&&console.log(t.step,"SPVTCA["+e.axis+"]"),t.pv=t.dpv=e}function bd(e,t){exports.DEBUG&&console.log(t.step,"SFVTCA["+e.axis+"]"),t.fv=e}function wd(e,t){var r,n,i=t.stack,a=i.pop(),s=i.pop(),o=t.z2[a],l=t.z1[s];exports.DEBUG&&console.log("SPVTL["+e+"]",a,s),e?(r=o.y-l.y,n=l.x-o.x):(r=l.x-o.x,n=l.y-o.y),t.pv=t.dpv=dd(r,n)}function Ed(e,t){var r,n,i=t.stack,a=i.pop(),s=i.pop(),o=t.z2[a],l=t.z1[s];exports.DEBUG&&console.log("SFVTL["+e+"]",a,s),e?(r=o.y-l.y,n=l.x-o.x):(r=l.x-o.x,n=l.y-o.y),t.fv=dd(r,n)}function Sd(e){exports.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function Md(e,t){var r=t.stack.pop(),n=t.z0[r],i=t.fv,a=t.pv;exports.DEBUG&&console.log(t.step,"MDAP["+e+"]",r);var s=a.distance(n,fd);e&&(s=t.round(s)),i.setRelative(n,fd,s,a),i.touch(n),t.rp0=t.rp1=r}function _d(e,t){var r,n,i,a=t.z2,s=a.length-2;exports.DEBUG&&console.log(t.step,"IUP["+e.axis+"]");for(var o=0;o<s;o++)r=a[o],e.touched(r)||(n=r.prevTouched(e))!==r&&(n===(i=r.nextTouched(e))&&e.setRelative(r,r,e.distance(n,n,!1,!0),e,!0),e.interpolate(r,n,i,e))}function Td(e,t){for(var r=t.stack,n=e?t.rp1:t.rp2,i=(e?t.z0:t.z1)[n],a=t.fv,s=t.pv,o=t.loop,l=t.z2;o--;){var c=r.pop(),u=l[c],h=s.distance(i,i,!1,!0);a.setRelative(u,u,h,s),a.touch(u),exports.DEBUG&&console.log(t.step,(t.loop>1?"loop "+(t.loop-o)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",c)}t.loop=1}function Cd(e,t){var r=t.stack,n=e?t.rp1:t.rp2,i=(e?t.z0:t.z1)[n],a=t.fv,s=t.pv,o=r.pop(),l=t.z2[t.contours[o]],c=l;exports.DEBUG&&console.log(t.step,"SHC["+e+"]",o);var u=s.distance(i,i,!1,!0);do{c!==i&&a.setRelative(c,c,u,s),c=c.nextPointOnContour}while(c!==l)}function Id(e,t){var r,n,i=t.stack,a=e?t.rp1:t.rp2,s=(e?t.z0:t.z1)[a],o=t.fv,l=t.pv,c=i.pop();switch(exports.DEBUG&&console.log(t.step,"SHZ["+e+"]",c),c){case 0:r=t.tZone;break;case 1:r=t.gZone;break;default:throw new Error("Invalid zone")}for(var u=l.distance(s,s,!1,!0),h=r.length-2,d=0;d<h;d++)n=r[d],o.setRelative(n,n,u,l)}function Bd(e,t){var r=t.stack,n=r.pop()/64,i=r.pop(),a=t.z1[i],s=t.z0[t.rp0],o=t.fv,l=t.pv;o.setRelative(a,s,n,l),o.touch(a),exports.DEBUG&&console.log(t.step,"MSIRP["+e+"]",n,i),t.rp1=t.rp0,t.rp2=i,e&&(t.rp0=i)}function Rd(e,t){var r=t.stack,n=r.pop(),i=r.pop(),a=t.z0[i],s=t.fv,o=t.pv,l=t.cvt[n];exports.DEBUG&&console.log(t.step,"MIAP["+e+"]",n,"(",l,")",i);var c=o.distance(a,fd);e&&(Math.abs(c-l)<t.cvCutIn&&(c=l),c=t.round(c)),s.setRelative(a,fd,c,o),0===t.zp0&&(a.xo=a.x,a.yo=a.y),s.touch(a),t.rp0=t.rp1=i}function Pd(e,t){var r=t.stack,n=r.pop(),i=t.z2[n];exports.DEBUG&&console.log(t.step,"GC["+e+"]",n),r.push(64*t.dpv.distance(i,fd,e,!1))}function Fd(e,t){var r=t.stack,n=r.pop(),i=r.pop(),a=t.z1[n],s=t.z0[i],o=t.dpv.distance(s,a,e,e);exports.DEBUG&&console.log(t.step,"MD["+e+"]",n,i,"->",o),t.stack.push(Math.round(64*o))}function Ld(e,t){var r=t.stack,n=r.pop(),i=t.fv,a=t.pv,s=t.ppem,o=t.deltaBase+16*(e-1),l=t.deltaShift,c=t.z0;exports.DEBUG&&console.log(t.step,"DELTAP["+e+"]",n,r);for(var u=0;u<n;u++){var h=r.pop(),d=r.pop();if(o+((240&d)>>4)===s){var p=(15&d)-8;p>=0&&p++,exports.DEBUG&&console.log(t.step,"DELTAPFIX",h,"by",p*l);var f=c[h];i.setRelative(f,f,p*l,a)}}}function Dd(e,t){var r=t.stack,n=r.pop();exports.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(n/64))}function Ud(e,t){var r=t.stack,n=r.pop(),i=t.ppem,a=t.deltaBase+16*(e-1),s=t.deltaShift;exports.DEBUG&&console.log(t.step,"DELTAC["+e+"]",n,r);for(var o=0;o<n;o++){var l=r.pop(),c=r.pop();if(a+((240&c)>>4)===i){var u=(15&c)-8;u>=0&&u++;var h=u*s;exports.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",h),t.cvt[l]+=h}}}function Nd(e,t){var r,n,i=t.stack,a=i.pop(),s=i.pop(),o=t.z2[a],l=t.z1[s];exports.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",a,s),e?(r=o.y-l.y,n=l.x-o.x):(r=l.x-o.x,n=l.y-o.y),t.dpv=dd(r,n)}function kd(e,t){var r=t.stack,n=t.prog,i=t.ip;exports.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var a=0;a<e;a++)r.push(n[++i]);t.ip=i}function Od(e,t){var r=t.ip,n=t.prog,i=t.stack;exports.DEBUG&&console.log(t.ip,"PUSHW["+e+"]");for(var a=0;a<e;a++){var s=n[++r]<<8|n[++r];32768&s&&(s=-(1+(65535^s))),i.push(s)}t.ip=r}function Gd(e,t,r,n,i,a){var s,o,l,c,u=a.stack,h=e&&u.pop(),d=u.pop(),p=a.rp0,f=a.z0[p],m=a.z1[d],g=a.minDis,v=a.fv,A=a.dpv;l=(o=s=A.distance(m,f,!0,!0))>=0?1:-1,o=Math.abs(o),e&&(c=a.cvt[h],n&&Math.abs(o-c)<a.cvCutIn&&(o=c)),r&&o<g&&(o=g),n&&(o=a.round(o)),v.setRelative(m,f,l*o,A),v.touch(m),exports.DEBUG&&console.log(a.step,(e?"MIRP[":"MDRP[")+(t?"M":"m")+(r?">":"_")+(n?"R":"_")+(0===i?"Gr":1===i?"Bl":2===i?"Wh":"")+"]",e?h+"("+a.cvt[h]+","+c+")":"",d,"(d =",s,"->",l*o,")"),a.rp1=a.rp0,a.rp2=d,t&&(a.rp0=d)}function zd(e){this.char=e,this.state={},this.activeState=null}function Vd(e,t,r){this.contextName=r,this.startIndex=e,this.endOffset=t}function Hd(e,t,r){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=r}function Qd(e,t){this.context=e,this.index=t,this.length=e.length,this.current=e[t],this.backtrack=e.slice(0,t),this.lookahead=e.slice(t+1)}function jd(e){this.eventId=e,this.subscribers=[]}function Wd(e){var t=this,r=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];r.forEach((function(e){Object.defineProperty(t.events,e,{value:new jd(e)})})),e&&r.forEach((function(r){var n=e[r];"function"==typeof n&&t.events[r].subscribe(n)}));["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"].forEach((function(e){t.events[e].subscribe(t.updateContextsRanges)}))}function Xd(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],Wd.call(this,e)}function Yd(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function qd(e){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(e)}function Kd(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function Jd(e){return/[A-z]/.test(e)}function Zd(e){this.font=e,this.features={}}function $d(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function ep(e,t){if(!e)return-1;switch(t.format){case 1:return t.glyphs.indexOf(e);case 2:for(var r=t.ranges,n=0;n<r.length;n++){var i=r[n];if(e>=i.start&&e<=i.end){var a=e-i.start;return i.index+a}}break;default:return-1}return-1}function tp(e,t){return-1===ep(e,t.coverage)?null:e+t.deltaGlyphId}function rp(e,t){var r=ep(e,t.coverage);return-1===r?null:t.substitute[r]}function np(e,t){for(var r=[],n=0;n<e.length;n++){var i=e[n],a=t.current,s=ep(a=Array.isArray(a)?a[0]:a,i);-1!==s&&r.push(s)}return r.length!==e.length?-1:r}function ip(e,t){var r=t.inputCoverage.length+t.lookaheadCoverage.length+t.backtrackCoverage.length;if(e.context.length<r)return[];var n=np(t.inputCoverage,e);if(-1===n)return[];var i=t.inputCoverage.length-1;if(e.lookahead.length<t.lookaheadCoverage.length)return[];for(var a=e.lookahead.slice(i);a.length&&Kd(a[0].char);)a.shift();var s=new Qd(a,0),o=np(t.lookaheadCoverage,s),l=[].concat(e.backtrack);for(l.reverse();l.length&&Kd(l[0].char);)l.shift();if(l.length<t.backtrackCoverage.length)return[];var c=new Qd(l,0),u=np(t.backtrackCoverage,c),h=[];if(n.length===t.inputCoverage.length&&o.length===t.lookaheadCoverage.length&&u.length===t.backtrackCoverage.length)for(var d=0;d<t.lookupRecords.length;d++)for(var p=t.lookupRecords[d].lookupListIndex,f=this.getLookupByIndex(p),m=0;m<f.subtables.length;m++){var g=f.subtables[m],v=this.getLookupMethod(f,g);if("12"===this.getSubstitutionType(f,g))for(var A=0;A<n.length;A++){var y=v(e.get(A));y&&h.push(y)}}return h}function ap(e,t){var r,n=ep(e.current,t.coverage);if(-1===n)return null;for(var i=t.ligatureSets[n],a=0;a<i.length;a++){r=i[a];for(var s=0;s<r.components.length;s++){if(e.lookahead[s]!==r.components[s])break;if(s===r.components.length-1)return r}}return null}function sp(e,t){var r=ep(e,t.coverage);return-1===r?null:t.sequences[r]}td.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(this._errorState>2)){var r=this.font,n=this._prepState;if(!n||n.ppem!==t){var i=this._fpgmState;if(!i){gd.prototype=md,(i=this._fpgmState=new gd("fpgm",r.tables.fpgm)).funcs=[],i.font=r,exports.DEBUG&&(console.log("---EXEC FPGM---"),i.step=-1);try{Jh(i)}catch(c){return console.log("Hinting error in FPGM:"+c),void(this._errorState=3)}}gd.prototype=i,(n=this._prepState=new gd("prep",r.tables.prep)).ppem=t;var a=r.tables.cvt;if(a)for(var s=n.cvt=new Array(a.length),o=t/r.unitsPerEm,l=0;l<a.length;l++)s[l]=a[l]*o;else n.cvt=[];exports.DEBUG&&(console.log("---EXEC PREP---"),n.step=-1);try{Jh(n)}catch(c){this._errorState<2&&console.log("Hinting error in PREP:"+c),this._errorState=2}}if(!(this._errorState>1))try{return Zh(e,n)}catch(c){return this._errorState<1&&(console.log("Hinting error:"+c),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}}},Zh=function(e,t){var r,n,i,a=t.ppem/t.font.unitsPerEm,s=a,o=e.components;if(gd.prototype=t,o){var l=t.font;n=[],r=[];for(var c=0;c<o.length;c++){var u=o[c],h=l.glyphs.get(u.glyphIndex);i=new gd("glyf",h.instructions),exports.DEBUG&&(console.log("---EXEC COMP "+c+"---"),i.step=-1),$h(h,i,a,s);for(var d=Math.round(u.dx*a),p=Math.round(u.dy*s),f=i.gZone,m=i.contours,g=0;g<f.length;g++){var v=f[g];v.xTouched=v.yTouched=!1,v.xo=v.x=v.x+d,v.yo=v.y=v.y+p}var A=n.length;n.push.apply(n,f);for(var y=0;y<m.length;y++)r.push(m[y]+A)}e.instructions&&!i.inhibitGridFit&&((i=new gd("glyf",e.instructions)).gZone=i.z0=i.z1=i.z2=n,i.contours=r,n.push(new pd(0,0),new pd(Math.round(e.advanceWidth*a),0)),exports.DEBUG&&(console.log("---EXEC COMPOSITE---"),i.step=-1),Jh(i),n.length-=2)}else i=new gd("glyf",e.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),i.step=-1),$h(e,i,a,s),n=i.gZone;return n},$h=function(e,t,r,n){for(var i,a,s,o=e.points||[],l=o.length,c=t.gZone=t.z0=t.z1=t.z2=[],u=t.contours=[],h=0;h<l;h++)i=o[h],c[h]=new pd(i.x*r,i.y*n,i.lastPointOfContour,i.onCurve);for(var d=0;d<l;d++)i=c[d],a||(a=i,u.push(d)),i.lastPointOfContour?(i.nextPointOnContour=a,a.prevPointOnContour=i,a=void 0):(s=c[d+1],i.nextPointOnContour=s,s.prevPointOnContour=i);if(!t.inhibitGridFit){if(exports.DEBUG){console.log("PROCESSING GLYPH",t.stack);for(var p=0;p<l;p++)console.log(p,c[p].x,c[p].y)}if(c.push(new pd(0,0),new pd(Math.round(e.advanceWidth*r),0)),Jh(t),c.length-=2,exports.DEBUG){console.log("FINISHED GLYPH",t.stack);for(var f=0;f<l;f++)console.log(f,c[f].x,c[f].y)}}},Jh=function(e){var t=e.prog;if(t){var r,n=t.length;for(e.ip=0;e.ip<n;e.ip++){if(exports.DEBUG&&e.step++,!(r=Kh[t[e.ip]]))throw new Error("unknown instruction: 0x"+Number(t[e.ip]).toString(16));r(e)}}},Kh=[yd.bind(void 0,ud),yd.bind(void 0,cd),xd.bind(void 0,ud),xd.bind(void 0,cd),bd.bind(void 0,ud),bd.bind(void 0,cd),wd.bind(void 0,0),wd.bind(void 0,1),Ed.bind(void 0,0),Ed.bind(void 0,1),function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"SPVFS[]",r,n),e.pv=e.dpv=dd(n,r)},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"SPVFS[]",r,n),e.fv=dd(n,r)},function(e){var t=e.stack,r=e.pv;exports.DEBUG&&console.log(e.step,"GPV[]"),t.push(16384*r.x),t.push(16384*r.y)},function(e){var t=e.stack,r=e.fv;exports.DEBUG&&console.log(e.step,"GFV[]"),t.push(16384*r.x),t.push(16384*r.y)},function(e){e.fv=e.pv,exports.DEBUG&&console.log(e.step,"SFVTPV[]")},function(e){var t=e.stack,r=t.pop(),n=t.pop(),i=t.pop(),a=t.pop(),s=t.pop(),o=e.z0,l=e.z1,c=o[r],u=o[n],h=l[i],d=l[a],p=e.z2[s];exports.DEBUG&&console.log("ISECT[], ",r,n,i,a,s);var f=c.x,m=c.y,g=u.x,v=u.y,A=h.x,y=h.y,x=d.x,b=d.y,w=(f-g)*(y-b)-(m-v)*(A-x),E=f*v-m*g,S=A*b-y*x;p.x=(E*(A-x)-S*(f-g))/w,p.y=(E*(y-b)-S*(m-v))/w},function(e){e.rp0=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)},function(e){e.rp1=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)},function(e){e.rp2=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)},function(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP0[]",t),e.zp0=t,t){case 0:e.tZone||vd(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP1[]",t),e.zp1=t,t){case 0:e.tZone||vd(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP2[]",t),e.zp2=t,t){case 0:e.tZone||vd(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZPS[]",t),e.zp0=e.zp1=e.zp2=t,t){case 0:e.tZone||vd(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){e.loop=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)},function(e){exports.DEBUG&&console.log(e.step,"RTG[]"),e.round=nd},function(e){exports.DEBUG&&console.log(e.step,"RTHG[]"),e.round=ad},function(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SMD[]",t),e.minDis=t/64},function(e){exports.DEBUG&&console.log(e.step,"ELSE[]"),Ad(e,!1)},function(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,"JMPR[]",t),e.ip+=t-1},function(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCVTCI[]",t),e.cvCutIn=t/64},void 0,void 0,function(e){var t=e.stack;exports.DEBUG&&console.log(e.step,"DUP[]"),t.push(t[t.length-1])},Sd,function(e){exports.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"SWAP[]"),t.push(r),t.push(n)},function(e){var t=e.stack;exports.DEBUG&&console.log(e.step,"DEPTH[]"),t.push(t.length)},function(e){var t=e.stack,r=t.pop();exports.DEBUG&&console.log(e.step,"CINDEX[]",r),t.push(t[t.length-r])},function(e){var t=e.stack,r=t.pop();exports.DEBUG&&console.log(e.step,"MINDEX[]",r),t.push(t.splice(t.length-r,1)[0])},void 0,void 0,void 0,function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"LOOPCALL[]",r,n);var i=e.ip,a=e.prog;e.prog=e.funcs[r];for(var s=0;s<n;s++)Jh(e),exports.DEBUG&&console.log(++e.step,s+1<n?"next loopcall":"done loopcall",s);e.ip=i,e.prog=a},function(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,"CALL[]",t);var r=e.ip,n=e.prog;e.prog=e.funcs[t],Jh(e),e.ip=r,e.prog=n,exports.DEBUG&&console.log(++e.step,"returning from",t)},function(e){if("fpgm"!==e.env)throw new Error("FDEF not allowed here");var t=e.stack,r=e.prog,n=e.ip,i=t.pop(),a=n;for(exports.DEBUG&&console.log(e.step,"FDEF[]",i);45!==r[++n];);e.ip=n,e.funcs[i]=r.slice(a+1,n)},void 0,Md.bind(void 0,0),Md.bind(void 0,1),_d.bind(void 0,ud),_d.bind(void 0,cd),Td.bind(void 0,0),Td.bind(void 0,1),Cd.bind(void 0,0),Cd.bind(void 0,1),Id.bind(void 0,0),Id.bind(void 0,1),function(e){for(var t=e.stack,r=e.loop,n=e.fv,i=t.pop()/64,a=e.z2;r--;){var s=t.pop(),o=a[s];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-r)+": ":"")+"SHPIX[]",s,i),n.setRelative(o,o,i),n.touch(o)}e.loop=1},function(e){for(var t=e.stack,r=e.rp1,n=e.rp2,i=e.loop,a=e.z0[r],s=e.z1[n],o=e.fv,l=e.dpv,c=e.z2;i--;){var u=t.pop(),h=c[u];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-i)+": ":"")+"IP[]",u,r,"<->",n),o.interpolate(h,a,s,l),o.touch(h)}e.loop=1},Bd.bind(void 0,0),Bd.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,n=e.z0[r],i=e.loop,a=e.fv,s=e.pv,o=e.z1;i--;){var l=t.pop(),c=o[l];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-i)+": ":"")+"ALIGNRP[]",l),a.setRelative(c,n,0,s),a.touch(c)}e.loop=1},function(e){exports.DEBUG&&console.log(e.step,"RTDG[]"),e.round=id},Rd.bind(void 0,0),Rd.bind(void 0,1),function(e){var t=e.prog,r=e.ip,n=e.stack,i=t[++r];exports.DEBUG&&console.log(e.step,"NPUSHB[]",i);for(var a=0;a<i;a++)n.push(t[++r]);e.ip=r},function(e){var t=e.ip,r=e.prog,n=e.stack,i=r[++t];exports.DEBUG&&console.log(e.step,"NPUSHW[]",i);for(var a=0;a<i;a++){var s=r[++t]<<8|r[++t];32768&s&&(s=-(1+(65535^s))),n.push(s)}e.ip=t},function(e){var t=e.stack,r=e.store;r||(r=e.store=[]);var n=t.pop(),i=t.pop();exports.DEBUG&&console.log(e.step,"WS",n,i),r[i]=n},function(e){var t=e.stack,r=e.store,n=t.pop();exports.DEBUG&&console.log(e.step,"RS",n);var i=r&&r[n]||0;t.push(i)},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"WCVTP",r,n),e.cvt[n]=r/64},function(e){var t=e.stack,r=t.pop();exports.DEBUG&&console.log(e.step,"RCVT",r),t.push(64*e.cvt[r])},Pd.bind(void 0,0),Pd.bind(void 0,1),void 0,Fd.bind(void 0,0),Fd.bind(void 0,1),function(e){exports.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)},void 0,function(e){exports.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0},void 0,void 0,function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"LT[]",r,n),t.push(n<r?1:0)},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"LTEQ[]",r,n),t.push(n<=r?1:0)},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"GT[]",r,n),t.push(n>r?1:0)},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"GTEQ[]",r,n),t.push(n>=r?1:0)},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"EQ[]",r,n),t.push(r===n?1:0)},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"NEQ[]",r,n),t.push(r!==n?1:0)},function(e){var t=e.stack,r=t.pop();exports.DEBUG&&console.log(e.step,"ODD[]",r),t.push(Math.trunc(r)%2?1:0)},function(e){var t=e.stack,r=t.pop();exports.DEBUG&&console.log(e.step,"EVEN[]",r),t.push(Math.trunc(r)%2?0:1)},function(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,"IF[]",t),t||(Ad(e,!0),exports.DEBUG&&console.log(e.step,"EIF[]"))},function(e){exports.DEBUG&&console.log(e.step,"EIF[]")},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"AND[]",r,n),t.push(r&&n?1:0)},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"OR[]",r,n),t.push(r||n?1:0)},function(e){var t=e.stack,r=t.pop();exports.DEBUG&&console.log(e.step,"NOT[]",r),t.push(r?0:1)},Ld.bind(void 0,1),function(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SDB[]",t),e.deltaBase=t},function(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SDS[]",t),e.deltaShift=Math.pow(.5,t)},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"ADD[]",r,n),t.push(n+r)},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"SUB[]",r,n),t.push(n-r)},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"DIV[]",r,n),t.push(64*n/r)},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"MUL[]",r,n),t.push(n*r/64)},function(e){var t=e.stack,r=t.pop();exports.DEBUG&&console.log(e.step,"ABS[]",r),t.push(Math.abs(r))},function(e){var t=e.stack,r=t.pop();exports.DEBUG&&console.log(e.step,"NEG[]",r),t.push(-r)},function(e){var t=e.stack,r=t.pop();exports.DEBUG&&console.log(e.step,"FLOOR[]",r),t.push(64*Math.floor(r/64))},function(e){var t=e.stack,r=t.pop();exports.DEBUG&&console.log(e.step,"CEILING[]",r),t.push(64*Math.ceil(r/64))},Dd.bind(void 0,0),Dd.bind(void 0,1),Dd.bind(void 0,2),Dd.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"WCVTF[]",r,n),e.cvt[n]=r*e.ppem/e.font.unitsPerEm},Ld.bind(void 0,2),Ld.bind(void 0,3),Ud.bind(void 0,1),Ud.bind(void 0,2),Ud.bind(void 0,3),function(e){var t,r=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SROUND[]",r),e.round=ld,192&r){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=t,48&r){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}r&=15,e.srThreshold=0===r?0:(r/8-.5)*t},function(e){var t,r=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"S45ROUND[]",r),e.round=ld,192&r){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=t,48&r){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}r&=15,e.srThreshold=0===r?0:(r/8-.5)*t},void 0,void 0,function(e){exports.DEBUG&&console.log(e.step,"ROFF[]"),e.round=rd},void 0,function(e){exports.DEBUG&&console.log(e.step,"RUTG[]"),e.round=sd},function(e){exports.DEBUG&&console.log(e.step,"RDTG[]"),e.round=od},Sd,Sd,void 0,void 0,void 0,void 0,void 0,function(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANCTRL[]",t)},Nd.bind(void 0,0),Nd.bind(void 0,1),function(e){var t=e.stack,r=t.pop(),n=0;exports.DEBUG&&console.log(e.step,"GETINFO[]",r),1&r&&(n=35),32&r&&(n|=4096),t.push(n)},void 0,function(e){var t=e.stack,r=t.pop(),n=t.pop(),i=t.pop();exports.DEBUG&&console.log(e.step,"ROLL[]"),t.push(n),t.push(r),t.push(i)},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"MAX[]",r,n),t.push(Math.max(n,r))},function(e){var t=e.stack,r=t.pop(),n=t.pop();exports.DEBUG&&console.log(e.step,"MIN[]",r,n),t.push(Math.min(n,r))},function(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANTYPE[]",t)},function(e){var t=e.stack.pop(),r=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"INSTCTRL[]",t,r),t){case 1:return void(e.inhibitGridFit=!!r);case 2:return void(e.ignoreCvt=!!r);default:throw new Error("invalid INSTCTRL[] selector")}},void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,kd.bind(void 0,1),kd.bind(void 0,2),kd.bind(void 0,3),kd.bind(void 0,4),kd.bind(void 0,5),kd.bind(void 0,6),kd.bind(void 0,7),kd.bind(void 0,8),Od.bind(void 0,1),Od.bind(void 0,2),Od.bind(void 0,3),Od.bind(void 0,4),Od.bind(void 0,5),Od.bind(void 0,6),Od.bind(void 0,7),Od.bind(void 0,8),Gd.bind(void 0,0,0,0,0,0),Gd.bind(void 0,0,0,0,0,1),Gd.bind(void 0,0,0,0,0,2),Gd.bind(void 0,0,0,0,0,3),Gd.bind(void 0,0,0,0,1,0),Gd.bind(void 0,0,0,0,1,1),Gd.bind(void 0,0,0,0,1,2),Gd.bind(void 0,0,0,0,1,3),Gd.bind(void 0,0,0,1,0,0),Gd.bind(void 0,0,0,1,0,1),Gd.bind(void 0,0,0,1,0,2),Gd.bind(void 0,0,0,1,0,3),Gd.bind(void 0,0,0,1,1,0),Gd.bind(void 0,0,0,1,1,1),Gd.bind(void 0,0,0,1,1,2),Gd.bind(void 0,0,0,1,1,3),Gd.bind(void 0,0,1,0,0,0),Gd.bind(void 0,0,1,0,0,1),Gd.bind(void 0,0,1,0,0,2),Gd.bind(void 0,0,1,0,0,3),Gd.bind(void 0,0,1,0,1,0),Gd.bind(void 0,0,1,0,1,1),Gd.bind(void 0,0,1,0,1,2),Gd.bind(void 0,0,1,0,1,3),Gd.bind(void 0,0,1,1,0,0),Gd.bind(void 0,0,1,1,0,1),Gd.bind(void 0,0,1,1,0,2),Gd.bind(void 0,0,1,1,0,3),Gd.bind(void 0,0,1,1,1,0),Gd.bind(void 0,0,1,1,1,1),Gd.bind(void 0,0,1,1,1,2),Gd.bind(void 0,0,1,1,1,3),Gd.bind(void 0,1,0,0,0,0),Gd.bind(void 0,1,0,0,0,1),Gd.bind(void 0,1,0,0,0,2),Gd.bind(void 0,1,0,0,0,3),Gd.bind(void 0,1,0,0,1,0),Gd.bind(void 0,1,0,0,1,1),Gd.bind(void 0,1,0,0,1,2),Gd.bind(void 0,1,0,0,1,3),Gd.bind(void 0,1,0,1,0,0),Gd.bind(void 0,1,0,1,0,1),Gd.bind(void 0,1,0,1,0,2),Gd.bind(void 0,1,0,1,0,3),Gd.bind(void 0,1,0,1,1,0),Gd.bind(void 0,1,0,1,1,1),Gd.bind(void 0,1,0,1,1,2),Gd.bind(void 0,1,0,1,1,3),Gd.bind(void 0,1,1,0,0,0),Gd.bind(void 0,1,1,0,0,1),Gd.bind(void 0,1,1,0,0,2),Gd.bind(void 0,1,1,0,0,3),Gd.bind(void 0,1,1,0,1,0),Gd.bind(void 0,1,1,0,1,1),Gd.bind(void 0,1,1,0,1,2),Gd.bind(void 0,1,1,0,1,3),Gd.bind(void 0,1,1,1,0,0),Gd.bind(void 0,1,1,1,0,1),Gd.bind(void 0,1,1,1,0,2),Gd.bind(void 0,1,1,1,0,3),Gd.bind(void 0,1,1,1,1,0),Gd.bind(void 0,1,1,1,1,1),Gd.bind(void 0,1,1,1,1,2),Gd.bind(void 0,1,1,1,1,3)],zd.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},zd.prototype.getState=function(e){return this.state[e]||null},Xd.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length},Xd.prototype.composeRUD=function(e){var t=this,r=e.map((function(e){return t[e[0]].apply(t,e.slice(1).concat(true))})),n=function(e){return"object"==typeof e&&e.hasOwnProperty("FAIL")};if(r.every(n))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:r.filter(n)};this.dispatch("composeRUD",[r.filter((function(e){return!n(e)}))])},Xd.prototype.replaceRange=function(e,t,r,n){t=null!==t?t:this.tokens.length;var i=r.every((function(e){return e instanceof zd}));if(!isNaN(e)&&this.inboundIndex(e)&&i){var a=this.tokens.splice.apply(this.tokens,[e,t].concat(r));return n||this.dispatch("replaceToken",[e,t,r]),[a,r]}return{FAIL:"replaceRange: invalid tokens or startIndex."}},Xd.prototype.replaceToken=function(e,t,r){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof zd){var n=this.tokens.splice(e,1,t);return r||this.dispatch("replaceToken",[e,t]),[n[0],t]}return{FAIL:"replaceToken: invalid token or index."}},Xd.prototype.removeRange=function(e,t,r){t=isNaN(t)?this.tokens.length:t;var n=this.tokens.splice(e,t);return r||this.dispatch("removeRange",[n,e,t]),n},Xd.prototype.removeToken=function(e,t){if(!isNaN(e)&&this.inboundIndex(e)){var r=this.tokens.splice(e,1);return t||this.dispatch("removeToken",[r,e]),r}return{FAIL:"removeToken: invalid token index."}},Xd.prototype.insertToken=function(e,t,r){return e.every((function(e){return e instanceof zd}))?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),r||this.dispatch("insertToken",[e,t]),e):{FAIL:"insertToken: invalid token(s)."}},Xd.prototype.registerModifier=function(e,t,r){this.events.newToken.subscribe((function(n,i){var a=[n,i],s=[n,i];if(null===t||!0===t.apply(this,a)){var o=r.apply(this,s);n.setState(e,o)}})),this.registeredModifiers.push(e)},jd.prototype.subscribe=function(e){return"function"==typeof e?this.subscribers.push(e)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}},jd.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},Qd.prototype.setCurrentIndex=function(e){this.index=e,this.current=this.context[e],this.backtrack=this.context.slice(0,e),this.lookahead=this.context.slice(e+1)},Qd.prototype.get=function(e){switch(!0){case 0===e:return this.current;case e<0&&Math.abs(e)<=this.backtrack.length:return this.backtrack.slice(e)[0];case e>0&&e<=this.lookahead.length:return this.lookahead[e-1];default:return null}},Xd.prototype.rangeToText=function(e){if(e instanceof Vd)return this.getRangeTokens(e).map((function(e){return e.char})).join("")},Xd.prototype.getText=function(){return this.tokens.map((function(e){return e.char})).join("")},Xd.prototype.getContext=function(e){var t=this.registeredContexts[e];return t||null},Xd.prototype.on=function(e,t){var r=this.events[e];return r?r.subscribe(t):null},Xd.prototype.dispatch=function(e,t){var r=this,n=this.events[e];n instanceof jd&&n.subscribers.forEach((function(e){e.apply(r,t||[])}))},Xd.prototype.registerContextChecker=function(e,t,r){if(this.getContext(e))return{FAIL:"context name '"+e+"' is already registered."};if("function"!=typeof t)return{FAIL:"missing context start check."};if("function"!=typeof r)return{FAIL:"missing context end check."};var n=new Hd(e,t,r);return this.registeredContexts[e]=n,this.contextCheckers.push(n),n},Xd.prototype.getRangeTokens=function(e){var t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},Xd.prototype.getContextRanges=function(e){var t=this.getContext(e);return t?t.ranges:{FAIL:"context checker '"+e+"' is not registered."}},Xd.prototype.resetContextsRanges=function(){var e=this.registeredContexts;for(var t in e){if(e.hasOwnProperty(t))e[t].ranges=[]}},Xd.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var e=this.tokens.map((function(e){return e.char})),t=0;t<e.length;t++){var r=new Qd(e,t);this.runContextCheck(r)}this.dispatch("updateContextsRanges",[this.registeredContexts])},Xd.prototype.setEndOffset=function(e,t){var r=new Vd(this.getContext(t).openRange.startIndex,e,t),n=this.getContext(t).ranges;return r.rangeId=t+"."+n.length,n.push(r),this.getContext(t).openRange=null,r},Xd.prototype.runContextCheck=function(e){var t=this,r=e.index;this.contextCheckers.forEach((function(n){var i=n.contextName,a=t.getContext(i).openRange;if(!a&&n.checkStart(e)&&(a=new Vd(r,null,i),t.getContext(i).openRange=a,t.dispatch("contextStart",[i,r])),a&&n.checkEnd(e)){var s=r-a.startIndex+1,o=t.setEndOffset(s,i);t.dispatch("contextEnd",[i,o])}}))},Xd.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();var t=Array.from(e);this.dispatch("start");for(var r=0;r<t.length;r++){var n=t[r],i=new Qd(t,r);this.dispatch("next",[i]),this.runContextCheck(i);var a=new zd(n);this.tokens.push(a),this.dispatch("newToken",[a,i])}return this.dispatch("end",[this.tokens]),this.tokens},Zd.prototype.getDefaultScriptFeaturesIndexes=function(){for(var e=this.font.tables.gsub.scripts,t=0;t<e.length;t++){var r=e[t];if("DFLT"===r.tag)return r.script.defaultLangSys.featureIndexes}return[]},Zd.prototype.getScriptFeaturesIndexes=function(e){if(!this.font.tables.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();for(var t=this.font.tables.gsub.scripts,r=0;r<t.length;r++){var n=t[r];if(n.tag===e&&n.script.defaultLangSys)return n.script.defaultLangSys.featureIndexes;var i=n.langSysRecords;if(i)for(var a=0;a<i.length;a++){var s=i[a];if(s.tag===e)return s.langSys.featureIndexes}}return this.getDefaultScriptFeaturesIndexes()},Zd.prototype.mapTagsToFeatures=function(e,t){for(var r={},n=0;n<e.length;n++){var i=e[n].tag,a=e[n].feature;r[i]=a}this.features[t].tags=r},Zd.prototype.getScriptFeatures=function(e){var t=this.features[e];if(this.features.hasOwnProperty(e))return t;var r=this.getScriptFeaturesIndexes(e);if(!r)return null;var n=this.font.tables.gsub;return t=r.map((function(e){return n.features[e]})),this.features[e]=t,this.mapTagsToFeatures(t,e),t},Zd.prototype.getSubstitutionType=function(e,t){return e.lookupType.toString()+t.substFormat.toString()},Zd.prototype.getLookupMethod=function(e,t){var r=this;switch(this.getSubstitutionType(e,t)){case"11":return function(e){return tp.apply(r,[e,t])};case"12":return function(e){return rp.apply(r,[e,t])};case"63":return function(e){return ip.apply(r,[e,t])};case"41":return function(e){return ap.apply(r,[e,t])};case"21":return function(e){return sp.apply(r,[e,t])};default:throw new Error("lookupType: "+e.lookupType+" - substFormat: "+t.substFormat+" is not yet supported")}},Zd.prototype.lookupFeature=function(e){var t=e.contextParams,r=t.index,n=this.getFeature({tag:e.tag,script:e.script});if(!n)return new Error("font '"+this.font.names.fullName.en+"' doesn't support feature '"+e.tag+"' for script '"+e.script+"'.");for(var i=this.getFeatureLookups(n),a=[].concat(t.context),s=0;s<i.length;s++)for(var o=i[s],l=this.getLookupSubtables(o),c=0;c<l.length;c++){var u=l[c],h=this.getSubstitutionType(o,u),d=this.getLookupMethod(o,u),p=void 0;switch(h){case"11":(p=d(t.current))&&a.splice(r,1,new $d({id:11,tag:e.tag,substitution:p}));break;case"12":(p=d(t.current))&&a.splice(r,1,new $d({id:12,tag:e.tag,substitution:p}));break;case"63":p=d(t),Array.isArray(p)&&p.length&&a.splice(r,1,new $d({id:63,tag:e.tag,substitution:p}));break;case"41":(p=d(t))&&a.splice(r,1,new $d({id:41,tag:e.tag,substitution:p}));break;case"21":(p=d(t.current))&&a.splice(r,1,new $d({id:21,tag:e.tag,substitution:p}))}t=new Qd(a,r),Array.isArray(p)&&!p.length||(p=null)}return a.length?a:null},Zd.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);var t=this.features.hasOwnProperty(e.script);if(!e.tag)return t;var r=this.features[e.script].some((function(t){return t.tag===e.tag}));return t&&r},Zd.prototype.getLookupSubtables=function(e){return e.subtables||null},Zd.prototype.getLookupByIndex=function(e){return this.font.tables.gsub.lookups[e]||null},Zd.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))},Zd.prototype.getFeature=function(e){if(!this.font)return{FAIL:"No font was found"};this.features.hasOwnProperty(e.script)||this.getScriptFeatures(e.script);var t=this.features[e.script];return t?t.tags[e.tag]?this.features[e.script].tags[e.tag]:null:{FAIL:"No feature for script "+e.script}};var op={startCheck:function(e){var t=e.current,r=e.get(-1);return null===r&&Yd(t)||!Yd(r)&&Yd(t)},endCheck:function(e){var t=e.get(1);return null===t||!Yd(t)}};var lp={startCheck:function(e){var t=e.current,r=e.get(-1);return(Yd(t)||Kd(t))&&!Yd(r)},endCheck:function(e){var t=e.get(1);switch(!0){case null===t:return!0;case!Yd(t)&&!Kd(t):var r=/\s/.test(t);if(!r)return!0;if(r){var n;if(n=e.lookahead.some((function(e){return Yd(e)||Kd(e)})),!n)return!0}break;default:return!1}}};var cp={11:function(e,t,r){t[r].setState(e.tag,e.substitution)},12:function(e,t,r){t[r].setState(e.tag,e.substitution)},63:function(e,t,r){e.substitution.forEach((function(n,i){t[r+i].setState(e.tag,n)}))},41:function(e,t,r){var n=t[r];n.setState(e.tag,e.substitution.ligGlyph);for(var i=e.substitution.components.length,a=0;a<i;a++)(n=t[r+a+1]).setState("deleted",!0)}};function up(e,t,r){e instanceof $d&&cp[e.id]&&cp[e.id](e,t,r)}function hp(e){var t=this,r="arab",n=this.featuresTags.arab,i=this.tokenizer.getRangeTokens(e);if(1!==i.length){var a=new Qd(i.map((function(e){return e.getState("glyphIndex")})),0),s=new Qd(i.map((function(e){return e.char})),0);i.forEach((function(e,o){if(!Kd(e.char)){a.setCurrentIndex(o),s.setCurrentIndex(o);var l,c=0;switch(function(e){for(var t=[].concat(e.backtrack),r=t.length-1;r>=0;r--){var n=t[r],i=qd(n),a=Kd(n);if(!i&&!a)return!0;if(i)return!1}return!1}(s)&&(c|=1),function(e){if(qd(e.current))return!1;for(var t=0;t<e.lookahead.length;t++)if(!Kd(e.lookahead[t]))return!0;return!1}(s)&&(c|=2),c){case 1:l="fina";break;case 2:l="init";break;case 3:l="medi"}if(-1!==n.indexOf(l)){var u=t.query.lookupFeature({tag:l,script:r,contextParams:a});if(u instanceof Error)return console.info(u.message);u.forEach((function(e,t){e instanceof $d&&(up(e,i,t),a.context[t]=e.substitution)}))}}}))}}function dp(e,t){return new Qd(e.map((function(e){return e.activeState.value})),t||0)}function pp(e){var t=this,r=this.tokenizer.getRangeTokens(e),n=dp(r);n.context.forEach((function(e,i){n.setCurrentIndex(i);var a=t.query.lookupFeature({tag:"rlig",script:"arab",contextParams:n});a.length&&(a.forEach((function(e){return up(e,r,i)})),n=dp(r))}))}var fp={startCheck:function(e){var t=e.current,r=e.get(-1);return null===r&&Jd(t)||!Jd(r)&&Jd(t)},endCheck:function(e){var t=e.get(1);return null===t||!Jd(t)}};function mp(e,t){return new Qd(e.map((function(e){return e.activeState.value})),t||0)}function gp(e){var t=this,r=this.tokenizer.getRangeTokens(e),n=mp(r);n.context.forEach((function(e,i){n.setCurrentIndex(i);var a=t.query.lookupFeature({tag:"liga",script:"latn",contextParams:n});a.length&&(a.forEach((function(e){return up(e,r,i)})),n=mp(r))}))}function vp(e){this.baseDir=e||"ltr",this.tokenizer=new Xd,this.featuresTags={}}function Ap(e){var t=this.contextChecks[e+"Check"];return this.tokenizer.registerContextChecker(e,t.startCheck,t.endCheck)}function yp(){return Ap.call(this,"latinWord"),Ap.call(this,"arabicWord"),Ap.call(this,"arabicSentence"),this.tokenizer.tokenize(this.text)}function xp(){var e=this;this.tokenizer.getContextRanges("arabicSentence").forEach((function(t){var r=e.tokenizer.getRangeTokens(t);e.tokenizer.replaceRange(t.startIndex,t.endOffset,r.reverse())}))}function bp(){if(-1===this.tokenizer.registeredModifiers.indexOf("glyphIndex"))throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function wp(){var e=this;this.featuresTags.hasOwnProperty("arab")&&(bp.call(this),this.tokenizer.getContextRanges("arabicWord").forEach((function(t){hp.call(e,t)})))}function Ep(){var e=this,t="arab";this.featuresTags.hasOwnProperty(t)&&(-1!==this.featuresTags.arab.indexOf("rlig")&&(bp.call(this),this.tokenizer.getContextRanges("arabicWord").forEach((function(t){pp.call(e,t)}))))}function Sp(){var e=this,t="latn";this.featuresTags.hasOwnProperty(t)&&(-1!==this.featuresTags.latn.indexOf("liga")&&(bp.call(this),this.tokenizer.getContextRanges("latinWord").forEach((function(t){gp.call(e,t)}))))}function Mp(e){(e=e||{}).tables=e.tables||{},e.empty||(Qh(e.familyName,"When creating a new Font object, familyName is required."),Qh(e.styleName,"When creating a new Font object, styleName is required."),Qh(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Qh(e.ascender,"When creating a new Font object, ascender is required."),Qh(e.descender<=0,"When creating a new Font object, negative descender value is required."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,"")},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables=Object.assign(e.tables,{os2:Object.assign({usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR},e.tables.os2)})),this.supported=!0,this.glyphs=new Nu.GlyphSet(this,e.glyphs||[]),this.encoding=new Cu(this),this.position=new Gh(this),this.substitution=new zh(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new td(this):void 0}})}function _p(e,t){var r=JSON.stringify(e),n=256;for(var i in t){var a=parseInt(i);if(a&&!(a<256)){if(JSON.stringify(t[i])===r)return a;n<=a&&(n=a+1)}}return t[n]=e,n}function Tp(e,t,r){var n=_p(t.name,r);return[{name:"tag_"+e,type:"TAG",value:t.tag},{name:"minValue_"+e,type:"FIXED",value:t.minValue<<16},{name:"defaultValue_"+e,type:"FIXED",value:t.defaultValue<<16},{name:"maxValue_"+e,type:"FIXED",value:t.maxValue<<16},{name:"flags_"+e,type:"USHORT",value:0},{name:"nameID_"+e,type:"USHORT",value:n}]}function Cp(e,t,r){var n={},i=new bu.Parser(e,t);return n.tag=i.parseTag(),n.minValue=i.parseFixed(),n.defaultValue=i.parseFixed(),n.maxValue=i.parseFixed(),i.skip("uShort",1),n.name=r[i.parseUShort()]||{},n}function Ip(e,t,r,n){for(var i=[{name:"nameID_"+e,type:"USHORT",value:_p(t.name,n)},{name:"flags_"+e,type:"USHORT",value:0}],a=0;a<r.length;++a){var s=r[a].tag;i.push({name:"axis_"+e+" "+s,type:"FIXED",value:t.coordinates[s]<<16})}return i}function Bp(e,t,r,n){var i={},a=new bu.Parser(e,t);i.name=n[a.parseUShort()]||{},a.skip("uShort",1),i.coordinates={};for(var s=0;s<r.length;++s)i.coordinates[r[s].tag]=a.parseFixed();return i}vp.prototype.setText=function(e){this.text=e},vp.prototype.contextChecks={latinWordCheck:fp,arabicWordCheck:op,arabicSentenceCheck:lp},vp.prototype.registerFeatures=function(e,t){var r=this,n=t.filter((function(t){return r.query.supports({script:e,tag:t})}));this.featuresTags.hasOwnProperty(e)?this.featuresTags[e]=this.featuresTags[e].concat(n):this.featuresTags[e]=n},vp.prototype.applyFeatures=function(e,t){if(!e)throw new Error("No valid font was provided to apply features");this.query||(this.query=new Zd(e));for(var r=0;r<t.length;r++){var n=t[r];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}},vp.prototype.registerModifier=function(e,t,r){this.tokenizer.registerModifier(e,t,r)},vp.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)},vp.prototype.applyFeaturesToContexts=function(){this.checkContextReady("arabicWord")&&(wp.call(this),Ep.call(this)),this.checkContextReady("latinWord")&&Sp.call(this),this.checkContextReady("arabicSentence")&&xp.call(this)},vp.prototype.processText=function(e){this.text&&this.text===e||(this.setText(e),yp.call(this),this.applyFeaturesToContexts())},vp.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},vp.prototype.getTextGlyphs=function(e){this.processText(e);for(var t=[],r=0;r<this.tokenizer.tokens.length;r++){var n=this.tokenizer.tokens[r];if(!n.state.deleted){var i=n.activeState.value;t.push(Array.isArray(i)?i[0]:i)}}return t},Mp.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},Mp.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},Mp.prototype.charToGlyph=function(e){var t=this.charToGlyphIndex(e),r=this.glyphs.get(t);return r||(r=this.glyphs.get(0)),r},Mp.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map((function(t){return"latn"===t.script?{script:"latn",tags:t.tags.filter((function(t){return e[t]}))}:t}))},Mp.prototype.stringToGlyphs=function(e,t){var r=this,n=new vp;n.registerModifier("glyphIndex",null,(function(e){return r.charToGlyphIndex(e.char)}));var i=t?this.updateFeatures(t.features):this.defaultRenderOptions.features;n.applyFeatures(this,i);for(var a=n.getTextGlyphs(e),s=a.length,o=new Array(s),l=this.glyphs.get(0),c=0;c<s;c+=1)o[c]=this.glyphs.get(a[c])||l;return o},Mp.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},Mp.prototype.nameToGlyph=function(e){var t=this.nameToGlyphIndex(e),r=this.glyphs.get(t);return r||(r=this.glyphs.get(0)),r},Mp.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},Mp.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;var r=this.position.defaultKerningTables;return r?this.position.getKerningValue(r,e,t):this.kerningPairs[e+","+t]||0},Mp.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]}]},Mp.prototype.forEachGlyph=function(e,t,r,n,i,a){t=void 0!==t?t:0,r=void 0!==r?r:0,n=void 0!==n?n:72,i=Object.assign({},this.defaultRenderOptions,i);var s,o=1/this.unitsPerEm*n,l=this.stringToGlyphs(e,i);if(i.kerning){var c=i.script||this.position.getDefaultScriptName();s=this.position.getKerningTables(c,i.language)}for(var u=0;u<l.length;u+=1){var h=l[u];if(a.call(this,h,t,r,n,i),h.advanceWidth&&(t+=h.advanceWidth*o),i.kerning&&u<l.length-1)t+=(s?this.position.getKerningValue(s,h.index,l[u+1].index):this.getKerningValue(h,l[u+1]))*o;i.letterSpacing?t+=i.letterSpacing*n:i.tracking&&(t+=i.tracking/1e3*n)}return t},Mp.prototype.getPath=function(e,t,r,n,i){var a=new Vc;return this.forEachGlyph(e,t,r,n,i,(function(e,t,r,n){var s=e.getPath(t,r,n,i,this);a.extend(s)})),a},Mp.prototype.getPaths=function(e,t,r,n,i){var a=[];return this.forEachGlyph(e,t,r,n,i,(function(e,t,r,n){var s=e.getPath(t,r,n,i,this);a.push(s)})),a},Mp.prototype.getAdvanceWidth=function(e,t,r){return this.forEachGlyph(e,0,0,t,r,(function(){}))},Mp.prototype.draw=function(e,t,r,n,i,a){this.getPath(t,r,n,i,a).draw(e)},Mp.prototype.drawPoints=function(e,t,r,n,i,a){this.forEachGlyph(t,r,n,i,a,(function(t,r,n,i){t.drawPoints(e,r,n,i)}))},Mp.prototype.drawMetrics=function(e,t,r,n,i,a){this.forEachGlyph(t,r,n,i,a,(function(t,r,n,i){t.drawMetrics(e,r,n,i)}))},Mp.prototype.getEnglishName=function(e){var t=this.names[e];if(t)return t.en},Mp.prototype.validate=function(){var e=this;function t(t){var r=e.getEnglishName(t);r&&r.trim().length}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm},Mp.prototype.toTables=function(){return Dh.fontToTable(this)},Mp.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},Mp.prototype.toArrayBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n<e.length;n++)r[n]=e[n];return t},Mp.prototype.download=function(e){var t=this.getEnglishName("fontFamily"),n=this.getEnglishName("fontSubfamily");e=e||t.replace(/\s/g,"")+"-"+n+".otf";var i=this.toArrayBuffer();if("undefined"!=typeof window)if(window.URL=window.URL||window.webkitURL,window.URL){var a=new DataView(i),s=new Blob([a],{type:"font/opentype"}),o=document.createElement("a");o.href=window.URL.createObjectURL(s),o.download=e;var l=document.createEvent("MouseEvents");l.initEvent("click",!0,!1),o.dispatchEvent(l)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{var c=r(46102),u=function(e){for(var t=new Buffer(e.byteLength),r=new Uint8Array(e),n=0;n<t.length;++n)t[n]=r[n];return t}(i);c.writeFileSync(e,u)}},Mp.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},Mp.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},Mp.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var Rp={make:function(e,t){var r=new pu.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:e.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:e.instances.length},{name:"instanceSize",type:"USHORT",value:4+4*e.axes.length}]);r.offsetToData=r.sizeOf();for(var n=0;n<e.axes.length;n++)r.fields=r.fields.concat(Tp(n,e.axes[n],t));for(var i=0;i<e.instances.length;i++)r.fields=r.fields.concat(Ip(i,e.instances[i],e.axes,t));return r},parse:function(e,t,r){var n=new bu.Parser(e,t),i=n.parseULong();jc.argument(65536===i,"Unsupported fvar table version.");var a=n.parseOffset16();n.skip("uShort",1);for(var s=n.parseUShort(),o=n.parseUShort(),l=n.parseUShort(),c=n.parseUShort(),u=[],h=0;h<s;h++)u.push(Cp(e,t+a+h*o,r));for(var d=[],p=t+a+s*o,f=0;f<l;f++)d.push(Bp(e,p+f*c,u,r));return{axes:u,instances:d}}},Pp=function(){return{coverage:this.parsePointer(yu.coverage),attachPoints:this.parseList(yu.pointer(yu.uShortList))}},Fp=function(){var e=this.parseUShort();return jc.argument(1===e||2===e||3===e,"Unsupported CaretValue table version."),1===e?{coordinate:this.parseShort()}:2===e?{pointindex:this.parseShort()}:3===e?{coordinate:this.parseShort()}:void 0},Lp=function(){return this.parseList(yu.pointer(Fp))},Dp=function(){return{coverage:this.parsePointer(yu.coverage),ligGlyphs:this.parseList(yu.pointer(Lp))}},Up=function(){return this.parseUShort(),this.parseList(yu.pointer(yu.coverage))};var Np={parse:function(e,t){var r=new yu(e,t=t||0),n=r.parseVersion(1);jc.argument(1===n||1.2===n||1.3===n,"Unsupported GDEF table version.");var i={version:n,classDef:r.parsePointer(yu.classDef),attachList:r.parsePointer(Pp),ligCaretList:r.parsePointer(Dp),markAttachClassDef:r.parsePointer(yu.classDef)};return n>=1.2&&(i.markGlyphSets=r.parsePointer(Up)),i}},kp=new Array(10);kp[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{posFormat:1,coverage:this.parsePointer(yu.coverage),value:this.parseValueRecord()}:2===t?{posFormat:2,coverage:this.parsePointer(yu.coverage),values:this.parseValueRecordList()}:void jc.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},kp[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();jc.assert(1===t||2===t,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var r=this.parsePointer(yu.coverage),n=this.parseUShort(),i=this.parseUShort();if(1===t)return{posFormat:t,coverage:r,valueFormat1:n,valueFormat2:i,pairSets:this.parseList(yu.pointer(yu.list((function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(n),value2:this.parseValueRecord(i)}}))))};if(2===t){var a=this.parsePointer(yu.classDef),s=this.parsePointer(yu.classDef),o=this.parseUShort(),l=this.parseUShort();return{posFormat:t,coverage:r,valueFormat1:n,valueFormat2:i,classDef1:a,classDef2:s,class1Count:o,class2Count:l,classRecords:this.parseList(o,yu.list(l,(function(){return{value1:this.parseValueRecord(n),value2:this.parseValueRecord(i)}})))}}},kp[3]=function(){return{error:"GPOS Lookup 3 not supported"}},kp[4]=function(){return{error:"GPOS Lookup 4 not supported"}},kp[5]=function(){return{error:"GPOS Lookup 5 not supported"}},kp[6]=function(){return{error:"GPOS Lookup 6 not supported"}},kp[7]=function(){return{error:"GPOS Lookup 7 not supported"}},kp[8]=function(){return{error:"GPOS Lookup 8 not supported"}},kp[9]=function(){return{error:"GPOS Lookup 9 not supported"}};var Op=new Array(10);var Gp={parse:function(e,t){var r=new yu(e,t=t||0),n=r.parseVersion(1);return jc.argument(1===n||1.1===n,"Unsupported GPOS table version "+n),1===n?{version:n,scripts:r.parseScriptList(),features:r.parseFeatureList(),lookups:r.parseLookupList(kp)}:{version:n,scripts:r.parseScriptList(),features:r.parseFeatureList(),lookups:r.parseLookupList(kp),variations:r.parseFeatureVariationsList()}},make:function(e){return new pu.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new pu.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new pu.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new pu.LookupList(e.lookups,Op)}])}};var zp={parse:function(e,t){var r=new bu.Parser(e,t),n=r.parseUShort();if(0===n)return function(e){var t={};e.skip("uShort");var r=e.parseUShort();jc.argument(0===r,"Unsupported kern sub-table version."),e.skip("uShort",2);var n=e.parseUShort();e.skip("uShort",3);for(var i=0;i<n;i+=1){var a=e.parseUShort(),s=e.parseUShort(),o=e.parseShort();t[a+","+s]=o}return t}(r);if(1===n)return function(e){var t={};e.skip("uShort"),e.parseULong()>1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");var r=255&e.parseUShort();if(e.skip("uShort"),0===r){var n=e.parseUShort();e.skip("uShort",3);for(var i=0;i<n;i+=1){var a=e.parseUShort(),s=e.parseUShort(),o=e.parseShort();t[a+","+s]=o}}return t}(r);throw new Error("Unsupported kern table version ("+n+").")}};var Vp={parse:function(e,t,r,n){for(var i=new bu.Parser(e,t),a=n?i.parseUShort:i.parseULong,s=[],o=0;o<r+1;o+=1){var l=a.call(i);n&&(l*=2),s.push(l)}return s}};function Hp(e,t){for(var r=[],n=12,i=0;i<t;i+=1){var a=bu.getTag(e,n),s=bu.getULong(e,n+4),o=bu.getULong(e,n+8),l=bu.getULong(e,n+12);r.push({tag:a,checksum:s,offset:o,length:l,compression:!1}),n+=16}return r}function Qp(e,t){if("WOFF"===t.compression){var r=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),n=new Uint8Array(t.length);if(Oc(r,n),n.byteLength!==t.length)throw new Error("Decompression error: "+t.tag+" decompressed length doesn't match recorded length");return{data:new DataView(n.buffer,0),offset:0}}return{data:e,offset:t.offset}}function jp(e,t){var r,n;t=null==t?{}:t;var i,a,s,o,l,c,u,h,d,p,f,m,g,v=new Mp({empty:!0}),A=new DataView(e,0),y=[],x=bu.getTag(A,0);if(x===String.fromCharCode(0,1,0,0)||"true"===x||"typ1"===x)v.outlinesFormat="truetype",y=Hp(A,i=bu.getUShort(A,4));else if("OTTO"===x)v.outlinesFormat="cff",y=Hp(A,i=bu.getUShort(A,4));else{if("wOFF"!==x)throw new Error("Unsupported OpenType signature "+x);var b=bu.getTag(A,4);if(b===String.fromCharCode(0,1,0,0))v.outlinesFormat="truetype";else{if("OTTO"!==b)throw new Error("Unsupported OpenType flavor "+x);v.outlinesFormat="cff"}y=function(e,t){for(var r=[],n=44,i=0;i<t;i+=1){var a=bu.getTag(e,n),s=bu.getULong(e,n+4),o=bu.getULong(e,n+8),l=bu.getULong(e,n+12),c=void 0;c=o<l&&"WOFF",r.push({tag:a,offset:s,compression:c,compressedLength:o,length:l}),n+=20}return r}(A,i=bu.getUShort(A,12))}for(var w=0;w<i;w+=1){var E=y[w],S=void 0;switch(E.tag){case"cmap":S=Qp(A,E),v.tables.cmap=Eu.parse(S.data,S.offset),v.encoding=new Iu(v.tables.cmap);break;case"cvt ":S=Qp(A,E),g=new bu.Parser(S.data,S.offset),v.tables.cvt=g.parseShortList(E.length/2);break;case"fvar":s=E;break;case"fpgm":S=Qp(A,E),g=new bu.Parser(S.data,S.offset),v.tables.fpgm=g.parseByteList(E.length);break;case"head":S=Qp(A,E),v.tables.head=nh.parse(S.data,S.offset),v.unitsPerEm=v.tables.head.unitsPerEm,r=v.tables.head.indexToLocFormat;break;case"hhea":S=Qp(A,E),v.tables.hhea=ih.parse(S.data,S.offset),v.ascender=v.tables.hhea.ascender,v.descender=v.tables.hhea.descender,v.numberOfHMetrics=v.tables.hhea.numberOfHMetrics;break;case"hmtx":h=E;break;case"ltag":S=Qp(A,E),n=sh.parse(S.data,S.offset);break;case"maxp":S=Qp(A,E),v.tables.maxp=oh.parse(S.data,S.offset),v.numGlyphs=v.tables.maxp.numGlyphs;break;case"name":f=E;break;case"OS/2":S=Qp(A,E),v.tables.os2=wh.parse(S.data,S.offset);break;case"post":S=Qp(A,E),v.tables.post=Eh.parse(S.data,S.offset),v.glyphNames=new Ru(v.tables.post);break;case"prep":S=Qp(A,E),g=new bu.Parser(S.data,S.offset),v.tables.prep=g.parseByteList(E.length);break;case"glyf":o=E;break;case"loca":p=E;break;case"CFF ":a=E;break;case"kern":d=E;break;case"GDEF":l=E;break;case"GPOS":c=E;break;case"GSUB":u=E;break;case"meta":m=E}}var M=Qp(A,f);if(v.tables.name=xh.parse(M.data,M.offset,n),v.names=v.tables.name,o&&p){var _=0===r,T=Qp(A,p),C=Vp.parse(T.data,T.offset,v.numGlyphs,_),I=Qp(A,o);v.glyphs=ed.parse(I.data,I.offset,C,v,t)}else{if(!a)throw new Error("Font doesn't contain TrueType or CFF outlines.");var B=Qp(A,a);rh.parse(B.data,B.offset,v,t)}var R=Qp(A,h);if(ah.parse(v,R.data,R.offset,v.numberOfHMetrics,v.numGlyphs,v.glyphs,t),Pu(v,t),d){var P=Qp(A,d);v.kerningPairs=zp.parse(P.data,P.offset)}else v.kerningPairs={};if(l){var F=Qp(A,l);v.tables.gdef=Np.parse(F.data,F.offset)}if(c){var L=Qp(A,c);v.tables.gpos=Gp.parse(L.data,L.offset),v.position.init()}if(u){var D=Qp(A,u);v.tables.gsub=Th.parse(D.data,D.offset)}if(s){var U=Qp(A,s);v.tables.fvar=Rp.parse(U.data,U.offset,v.names)}if(m){var N=Qp(A,m);v.tables.meta=Ch.parse(N.data,N.offset),v.metas=v.tables.meta}return v}class Wp extends n.Loader{constructor(e){super(e),this.reversed=!1}load(e,t,r,i){const a=this,s=new n.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(r){try{t(jp(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){function t(e){const t=[];let r;e.forEach((function(e){"m"===e.type.toLowerCase()?(r=[e],t.push(r)):"z"!==e.type.toLowerCase()&&r.push(e)}));const n=[];return t.forEach((function(e){const t={type:"m",x:e[e.length-1].x,y:e[e.length-1].y};n.push(t);for(let r=e.length-1;r>0;r--){const t=e[r],i={type:t.type};void 0!==t.x2&&void 0!==t.y2?(i.x1=t.x2,i.y1=t.y2,i.x2=t.x1,i.y2=t.y1):void 0!==t.x1&&void 0!==t.y1&&(i.x1=t.x1,i.y1=t.y1),i.x=e[r-1].x,i.y=e[r-1].y,n.push(i)}})),n}return function(e,r){const n=Math.round,i={},a=1e5/(72*(e.unitsPerEm||2048)),s=e.encoding.cmap.glyphIndexMap,o=Object.keys(s);for(let l=0;l<o.length;l++){const c=o[l],u=e.glyphs.glyphs[s[c]];if(void 0!==c){const e={ha:n(u.advanceWidth*a),x_min:n(u.xMin*a),x_max:n(u.xMax*a),o:""};r&&(u.path.commands=t(u.path.commands)),u.path.commands.forEach((function(t){"c"===t.type.toLowerCase()&&(t.type="b"),e.o+=t.type.toLowerCase()+" ",void 0!==t.x&&void 0!==t.y&&(e.o+=n(t.x*a)+" "+n(t.y*a)+" "),void 0!==t.x1&&void 0!==t.y1&&(e.o+=n(t.x1*a)+" "+n(t.y1*a)+" "),void 0!==t.x2&&void 0!==t.y2&&(e.o+=n(t.x2*a)+" "+n(t.y2*a)+" ")})),i[String.fromCodePoint(u.unicode)]=e}}return{glyphs:i,familyName:e.getEnglishName("fullName"),ascender:n(e.ascender*a),descender:n(e.descender*a),underlinePosition:e.tables.post.underlinePosition,underlineThickness:e.tables.post.underlineThickness,boundingBox:{xMin:e.tables.head.xMin,xMax:e.tables.head.xMax,yMin:e.tables.head.yMin,yMax:e.tables.head.yMax},resolution:1e3,original_font_information:e.tables.name}}(jp(e),this.reversed)}}var Xp=r(8197);class Yp extends n.Loader{load(e,t,r,i){var a=this,s=""===a.path?n.LoaderUtils.extractUrlBase(e):a.path,o=new n.FileLoader(a.manager);o.setPath(a.path),o.setResponseType("arraybuffer"),o.setRequestHeader(a.requestHeader),o.setWithCredentials(a.withCredentials),o.load(e,(function(r){try{t(a.parse(r,s))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e,t){var r=new n.TextureLoader(this.manager);r.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);var i={KeyFrame:class{constructor(e,t){this.time=e,this.matrix=t.clone(),this.position=new n.Vector3,this.quaternion=new n.Quaternion,this.scale=new n.Vector3(1,1,1),this.matrix.decompose(this.position,this.quaternion,this.scale),this.clone=function(){return new i.KeyFrame(this.time,this.matrix)},this.lerp=function(e,t){var r=(t-=this.time)/(e.time-this.time),n=1-r,a=this.position,s=this.quaternion,o=e.position,l=e.quaternion;return i.KeyFrame.tempAniPos.x=a.x*n+o.x*r,i.KeyFrame.tempAniPos.y=a.y*n+o.y*r,i.KeyFrame.tempAniPos.z=a.z*n+o.z*r,i.KeyFrame.tempAniQuat.set(s.x,s.y,s.z,s.w),i.KeyFrame.tempAniQuat.slerp(l,r),i.KeyFrame.tempAniMatrix.compose(i.KeyFrame.tempAniPos,i.KeyFrame.tempAniQuat,i.KeyFrame.tempAniScale)}}}};i.KeyFrame.tempAniPos=new n.Vector3,i.KeyFrame.tempAniQuat=new n.Quaternion,i.KeyFrame.tempAniScale=new n.Vector3(1,1,1),i.KeyFrame.tempAniMatrix=new n.Matrix4,i.KeyFrameTrack=function(){this.keys=[],this.target=null,this.time=0,this.length=0,this._accelTable={},this.fps=20,this.addKey=function(e){this.keys.push(e)},this.init=function(){if(this.sortKeys(),this.keys.length>0?this.length=this.keys[this.keys.length-1].time:this.length=0,this.fps)for(let e=0;e<this.length*this.fps;e++)for(let t=0;t<this.keys.length;t++){if(this.keys[t].time==e){this._accelTable[e]=t;break}if(this.keys[t].time<e/this.fps&&this.keys[t+1]&&this.keys[t+1].time>=e/this.fps){this._accelTable[e]=t;break}}},this.parseFromThree=function(e){var t=e.fps;this.target=e.node;var r=e.hierarchy[0].keys;for(let n=0;n<r.length;n++)this.addKey(new i.KeyFrame(n/t||r[n].time,r[n].targets[0].data));this.init()},this.parseFromCollada=function(e){var t=e.keys,r=this.fps;for(let n=0;n<t.length;n++)this.addKey(new i.KeyFrame(n/r||t[n].time,t[n].matrix));this.init()},this.sortKeys=function(){this.keys.sort(this.keySortFunc)},this.keySortFunc=function(e,t){return e.time-t.time},this.clone=function(){var e=new i.KeyFrameTrack;e.target=this.target,e.time=this.time,e.length=this.length;for(let t=0;t<this.keys.length;t++)e.addKey(this.keys[t].clone());return e.init(),e},this.reTarget=function(e,t){t||(t=i.TrackTargetNodeNameCompare),this.target=t(e,this.target)},this.keySearchAccel=function(e){return e*=this.fps,e=Math.floor(e),this._accelTable[e]||0},this.setTime=function(e){e=Math.abs(e),this.length&&(e=e%this.length+.05);var t=null,r=null;for(let n=this.keySearchAccel(e);n<this.keys.length;n++){if(this.keys[n].time==e){t=this.keys[n],r=this.keys[n];break}if(this.keys[n].time<e&&this.keys[n+1]&&this.keys[n+1].time>e){t=this.keys[n],r=this.keys[n+1];break}if(this.keys[n].time<e&&n==this.keys.length-1){t=this.keys[n],(r=this.keys[0].clone()).time+=this.length+.05;break}}return t&&r&&t!==r?(this.target.matrixAutoUpdate=!1,this.target.matrix.copy(t.lerp(r,e)),void(this.target.matrixWorldNeedsUpdate=!0)):t&&r&&t==r?(this.target.matrixAutoUpdate=!1,this.target.matrix.copy(t.matrix),void(this.target.matrixWorldNeedsUpdate=!0)):void 0}},i.TrackTargetNodeNameCompare=function(e,t){return function e(t,r){if(t.name==r)return t;for(let i=0;i<t.children.length;i++){var n=e(t.children[i],r);if(n)return n}return null}(e,t.name)},i.Animation=function(){this.tracks=[],this.length=0,this.addTrack=function(e){this.tracks.push(e),this.length=Math.max(e.length,this.length)},this.setTime=function(e){this.time=e;for(let t=0;t<this.tracks.length;t++)this.tracks[t].setTime(e)},this.clone=function(e,t){t||(t=i.TrackTargetNodeNameCompare);var r=new i.Animation;r.target=e;for(let i=0;i<this.tracks.length;i++){var n=this.tracks[i].clone();n.reTarget(e,t),r.addTrack(n)}return r}};function a(e){return 256<<e}function s(e){return 65536<<e}function o(e,t){var r=new n.Bone;r.matrix.copy(e.matrix),r.matrixWorld.copy(e.matrixWorld),r.position.copy(e.position),r.quaternion.copy(e.quaternion),r.scale.copy(e.scale),t.nodeCount++,r.name="bone_"+e.name+t.nodeCount.toString(),t.nodeToBoneMap[e.name]||(t.nodeToBoneMap[e.name]=[]),t.nodeToBoneMap[e.name].push(r);for(let n in e.children){var i=o(e.children[n],t);r.add(i)}return r}function l(e,t){var r=[];for(let i=0;i<e.length;i++)r.push({i:e[i],w:t[i]});for(r.sort((function(e,t){return t.w-e.w}));r.length<4;)r.push({i:0,w:0});r.length>4&&(r.length=4);var n=0;for(let i=0;i<4;i++)n+=r[i].w*r[i].w;n=Math.sqrt(n);for(let i=0;i<4;i++)r[i].w=r[i].w/n,e[i]=r[i].i,t[i]=r[i].w}function c(e,t){if(0==e.name.indexOf("bone_"+t))return e;for(let n in e.children){var r=c(e.children[n],t);if(r)return r}}class u{constructor(){this.mPrimitiveTypes=0,this.mNumVertices=0,this.mNumFaces=0,this.mNumBones=0,this.mMaterialIndex=0,this.mVertices=[],this.mNormals=[],this.mTangents=[],this.mBitangents=[],this.mColors=[[]],this.mTextureCoords=[[]],this.mFaces=[],this.mBones=[],this.hookupSkeletons=function(e){if(0!=this.mBones.length){for(var t=[],r=[],i=e.findNode(this.mBones[0].mName);i.mParent&&i.mParent.isBone;)i=i.mParent;var a=o(i.toTHREE(e),e);this.threeNode.add(a);for(let n=0;n<this.mBones.length;n++){if(l=c(a,this.mBones[n].mName)){var s=l;t.push(s),r.push(this.mBones[n].mOffsetMatrix.toTHREE())}else{if(!(i=e.findNode(this.mBones[n].mName)))return;a=o(i.toTHREE(e),e);this.threeNode.add(a);var l;s=l=c(a,this.mBones[n].mName);t.push(s),r.push(this.mBones[n].mOffsetMatrix.toTHREE())}}var u=new n.Skeleton(t,r);this.threeNode.bind(u,new n.Matrix4),this.threeNode.material.skinning=!0}},this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t,r,i=new n.BufferGeometry;if(t=e.mMaterials[this.mMaterialIndex]?e.mMaterials[this.mMaterialIndex].toTHREE(e):new n.MeshLambertMaterial,i.setIndex(new n.BufferAttribute(new Uint32Array(this.mIndexArray),1)),i.setAttribute("position",new n.BufferAttribute(this.mVertexBuffer,3)),this.mNormalBuffer&&this.mNormalBuffer.length>0&&i.setAttribute("normal",new n.BufferAttribute(this.mNormalBuffer,3)),this.mColorBuffer&&this.mColorBuffer.length>0&&i.setAttribute("color",new n.BufferAttribute(this.mColorBuffer,4)),this.mTexCoordsBuffers[0]&&this.mTexCoordsBuffers[0].length>0&&i.setAttribute("uv",new n.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]),2)),this.mTexCoordsBuffers[1]&&this.mTexCoordsBuffers[1].length>0&&i.setAttribute("uv1",new n.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]),2)),this.mTangentBuffer&&this.mTangentBuffer.length>0&&i.setAttribute("tangents",new n.BufferAttribute(this.mTangentBuffer,3)),this.mBitangentBuffer&&this.mBitangentBuffer.length>0&&i.setAttribute("bitangents",new n.BufferAttribute(this.mBitangentBuffer,3)),this.mBones.length>0){var a=[],s=[];for(let e=0;e<this.mBones.length;e++)for(let t=0;t<this.mBones[e].mWeights.length;t++){var o=this.mBones[e].mWeights[t];o&&(a[o.mVertexId]||(a[o.mVertexId]=[]),s[o.mVertexId]||(s[o.mVertexId]=[]),a[o.mVertexId].push(o.mWeight),s[o.mVertexId].push(parseInt(e)))}for(let e in s)l(s[e],a[e]);var c=[],u=[];for(let e=0;e<a.length;e++)for(let t=0;t<4;t++)a[e]&&s[e]?(c.push(a[e][t]),u.push(s[e][t])):(c.push(0),u.push(0));i.setAttribute("skinWeight",new n.BufferAttribute(new Float32Array(c),4)),i.setAttribute("skinIndex",new n.BufferAttribute(new Float32Array(u),4))}return 0==this.mBones.length&&(r=new n.Mesh(i,t)),this.mBones.length>0&&(r=new n.SkinnedMesh(i,t)).normalizeSkinWeights(),this.threeNode=r,r}}}class h{constructor(){this.mNumIndices=0,this.mIndices=[]}}class d{constructor(){this.x=0,this.y=0,this.z=0,this.toTHREE=function(){return new n.Vector3(this.x,this.y,this.z)}}}class p{constructor(){this.r=0,this.g=0,this.b=0,this.a=0,this.toTHREE=function(){return new n.Color(this.r,this.g,this.b)}}}class f{constructor(){this.x=0,this.y=0,this.z=0,this.w=0,this.toTHREE=function(){return new n.Quaternion(this.x,this.y,this.z,this.w)}}}class m{constructor(){this.mVertexId=0,this.mWeight=0}}class g{constructor(){this.data=[],this.toString=function(){var e="";return this.data.forEach((function(t){e+=String.fromCharCode(t)})),e.replace(/[^\x20-\x7E]+/g,"")}}}class v{constructor(){this.mTime=0,this.mValue=null}}class A{constructor(){this.mTime=0,this.mValue=null}}class y{constructor(){this.mName="",this.mTransformation=[],this.mNumChildren=0,this.mNumMeshes=0,this.mMeshes=[],this.mChildren=[],this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t=new n.Object3D;t.name=this.mName,t.matrix=this.mTransformation.toTHREE();for(let r=0;r<this.mChildren.length;r++)t.add(this.mChildren[r].toTHREE(e));for(let r=0;r<this.mMeshes.length;r++)t.add(e.mMeshes[this.mMeshes[r]].toTHREE(e));return this.threeNode=t,t.matrix.decompose(t.position,t.quaternion,t.scale),t}}}class x{constructor(){this.mName="",this.mNumWeights=0,this.mOffsetMatrix=0}}class b{constructor(){this.mKey="",this.mSemantic=0,this.mIndex=0,this.mData=[],this.mDataLength=0,this.mType=0,this.dataAsColor=function(){var e=new Uint8Array(this.mData).buffer,t=new DataView(e),r=t.getFloat32(0,!0),i=t.getFloat32(4,!0),a=t.getFloat32(8,!0);return new n.Color(r,i,a)},this.dataAsFloat=function(){var e=new Uint8Array(this.mData).buffer;return new DataView(e).getFloat32(0,!0)},this.dataAsBool=function(){var e=new Uint8Array(this.mData).buffer;return!!new DataView(e).getFloat32(0,!0)},this.dataAsString=function(){var e=new g;return e.data=this.mData,e.toString()},this.dataAsMap=function(){var e=new g;e.data=this.mData;var t=e.toString();return-1!=(t=t.replace(/\\/g,"/")).indexOf("/")&&(t=t.substr(t.lastIndexOf("/")+1)),r.load(t)}}}var w={"?mat.name":"name","$mat.shadingm":"shading","$mat.twosided":"twoSided","$mat.wireframe":"wireframe","$clr.ambient":"ambient","$clr.diffuse":"color","$clr.specular":"specular","$clr.emissive":"emissive","$clr.transparent":"transparent","$clr.reflective":"reflect","$mat.shininess":"shininess","$mat.reflectivity":"reflectivity","$mat.refracti":"refraction","$tex.file":"map"},E={"?mat.name":"string","$mat.shadingm":"bool","$mat.twosided":"bool","$mat.wireframe":"bool","$clr.ambient":"color","$clr.diffuse":"color","$clr.specular":"color","$clr.emissive":"color","$clr.transparent":"color","$clr.reflective":"color","$mat.shininess":"float","$mat.reflectivity":"float","$mat.refracti":"float","$tex.file":"map"};class S{constructor(){this.mNumAllocated=0,this.mNumProperties=0,this.mProperties=[],this.toTHREE=function(){var e=new n.MeshPhongMaterial;for(let r=0;r<this.mProperties.length;r++)if("float"==E[this.mProperties[r].mKey]&&(e[w[this.mProperties[r].mKey]]=this.mProperties[r].dataAsFloat()),"color"==E[this.mProperties[r].mKey]&&(e[w[this.mProperties[r].mKey]]=this.mProperties[r].dataAsColor()),"bool"==E[this.mProperties[r].mKey]&&(e[w[this.mProperties[r].mKey]]=this.mProperties[r].dataAsBool()),"string"==E[this.mProperties[r].mKey]&&(e[w[this.mProperties[r].mKey]]=this.mProperties[r].dataAsString()),"map"==E[this.mProperties[r].mKey]){var t=this.mProperties[r];1==t.mSemantic&&(e.map=this.mProperties[r].dataAsMap()),6==t.mSemantic&&(e.normalMap=this.mProperties[r].dataAsMap()),10==t.mSemantic&&(e.lightMap=this.mProperties[r].dataAsMap()),8==t.mSemantic&&(e.alphaMap=this.mProperties[r].dataAsMap())}return e.ambient.r=.53,e.ambient.g=.53,e.ambient.b=.53,e.color.r=1,e.color.g=1,e.color.b=1,e}}}function M(e,t,r){var i=new n.Vector3,a=1-r;return i.x=e.x*r+t.x*a,i.y=e.y*r+t.y*a,i.z=e.z*r+t.z*a,i}function _(e,t,r){return e.clone().slerp(t,1-r)}function T(e,t,r,n){if(1==e.length)return e[0].mValue.toTHREE();var i=1/0,a=null,s=null;for(let u=0;u<e.length;u++){var o=Math.abs(e[u].mTime-t);o<i&&e[u].mTime<=t&&(i=o,a=e[u],s=e[u+1])}if(a){if(s){var l=s.mTime-a.mTime,c=(a.mTime-t)/l;return n(a.mValue.toTHREE(),s.mValue.toTHREE(),c)}(s=e[0].clone()).mTime+=r;l=s.mTime-a.mTime,c=(a.mTime-t)/l;return n(a.mValue.toTHREE(),s.mValue.toTHREE(),c)}return null}class C{constructor(){this.mNodeName="",this.mNumPositionKeys=0,this.mNumRotationKeys=0,this.mNumScalingKeys=0,this.mPositionKeys=[],this.mRotationKeys=[],this.mScalingKeys=[],this.mPreState="",this.mPostState="",this.init=function(e){function t(t){t.mTime/=e}e||(e=1),this.mPositionKeys.forEach(t),this.mRotationKeys.forEach(t),this.mScalingKeys.forEach(t)},this.sortKeys=function(){function e(e,t){return e.mTime-t.mTime}this.mPositionKeys.sort(e),this.mRotationKeys.sort(e),this.mScalingKeys.sort(e)},this.getLength=function(){return Math.max(Math.max.apply(null,this.mPositionKeys.map((function(e){return e.mTime}))),Math.max.apply(null,this.mRotationKeys.map((function(e){return e.mTime}))),Math.max.apply(null,this.mScalingKeys.map((function(e){return e.mTime}))))},this.toTHREE=function(e){this.sortKeys();var t=this.getLength(),r=new i.KeyFrameTrack;for(let p=0;p<t;p+=.05){var a=new n.Matrix4,s=p,o=T(this.mPositionKeys,s,t,M),l=T(this.mScalingKeys,s,t,M),c=T(this.mRotationKeys,s,t,_);a.compose(o,c,l);var u=new i.KeyFrame(s,a);r.addKey(u)}r.target=e.findNode(this.mNodeName).toTHREE();var h=[r];if(e.nodeToBoneMap[this.mNodeName])for(let n=0;n<e.nodeToBoneMap[this.mNodeName].length;n++){var d=r.clone();d.target=e.nodeToBoneMap[this.mNodeName][n],h.push(d)}return h}}}class I{constructor(){this.mName="",this.mDuration=0,this.mTicksPerSecond=0,this.mNumChannels=0,this.mChannels=[],this.toTHREE=function(e){var t=new i.Animation;for(let n in this.mChannels){this.mChannels[n].init(this.mTicksPerSecond);var r=this.mChannels[n].toTHREE(e);for(let e in r)r[e].init(),t.addTrack(r[e])}return t.length=Math.max.apply(null,t.tracks.map((function(e){return e.length}))),t}}}class B{constructor(){this.mWidth=0,this.mHeight=0,this.texAchFormatHint=[],this.pcData=[]}}class R{constructor(){this.mName="",this.mType=0,this.mAttenuationConstant=0,this.mAttenuationLinear=0,this.mAttenuationQuadratic=0,this.mAngleInnerCone=0,this.mAngleOuterCone=0,this.mColorDiffuse=null,this.mColorSpecular=null,this.mColorAmbient=null}}class P{constructor(){this.mName="",this.mPosition=null,this.mLookAt=null,this.mUp=null,this.mHorizontalFOV=0,this.mClipPlaneNear=0,this.mClipPlaneFar=0,this.mAspect=0}}class F{constructor(){this.versionMajor=0,this.versionMinor=0,this.versionRevision=0,this.compileFlags=0,this.mFlags=0,this.mNumMeshes=0,this.mNumMaterials=0,this.mNumAnimations=0,this.mNumTextures=0,this.mNumLights=0,this.mNumCameras=0,this.mRootNode=null,this.mMeshes=[],this.mMaterials=[],this.mAnimations=[],this.mLights=[],this.mCameras=[],this.nodeToBoneMap={},this.findNode=function(e,t){if(t||(t=this.mRootNode),t.mName==e)return t;for(let n=0;n<t.mChildren.length;n++){var r=this.findNode(e,t.mChildren[n]);if(r)return r}return null},this.toTHREE=function(){this.nodeCount=0,function(e){for(let n in e.mMeshes){var t=e.mMeshes[n];for(let n in t.mBones){var r=e.findNode(t.mBones[n].mName);r&&(r.isBone=!0)}}}(this);var e=this.mRootNode.toTHREE(this);for(let r in this.mMeshes)this.mMeshes[r].hookupSkeletons(this);if(this.mAnimations.length>0)var t=this.mAnimations[0].toTHREE(this);return{object:e,animation:t}}}}class L{constructor(){this.elements=[[],[],[],[]],this.toTHREE=function(){var e=new n.Matrix4;for(let t=0;t<4;++t)for(let r=0;r<4;++r)e.elements[4*t+r]=this.elements[r][t];return e}}}var D=!0;function U(e){var t=e.getFloat32(e.readOffset,D);return e.readOffset+=4,t}function N(e){var t=e.getFloat64(e.readOffset,D);return e.readOffset+=8,t}function k(e){var t=e.getUint16(e.readOffset,D);return e.readOffset+=2,t}function O(e){var t=e.getUint32(e.readOffset,D);return e.readOffset+=4,t}function G(e){var t=e.getUint32(e.readOffset,D);return e.readOffset+=4,t}function z(e){var t=new d;return t.x=U(e),t.y=U(e),t.z=U(e),t}function V(e){var t=new p;return t.r=U(e),t.g=U(e),t.b=U(e),t}function H(e){var t=new g,r=O(e);return e.ReadBytes(t.data,1,r),t.toString()}function Q(e){var t=new m;return t.mVertexId=O(e),t.mWeight=U(e),t}function j(e){var t=new L;for(let r=0;r<4;++r)for(let n=0;n<4;++n)t.elements[r][n]=U(e);return t}function W(e){var t=new v;return t.mTime=N(e),t.mValue=z(e),t}function X(e){var t=new A;return t.mTime=N(e),t.mValue=function(e){var t=new f;return t.w=U(e),t.x=U(e),t.y=U(e),t.z=U(e),t}(e),t}function Y(e,t,r){for(let n=0;n<r;n++)t[n]=W(e)}function q(e,t,r){return e.Seek(sizeof(t)*r,ue)}function K(e){if(!e)throw"asset failed"}function J(e,t,r){K(4668==G(e)),G(e);var n=new y;if(n.mParent=t,n.mDepth=r,n.mName=H(e),n.mTransformation=j(e),n.mNumChildren=O(e),n.mNumMeshes=O(e),n.mNumMeshes){n.mMeshes=[];for(let t=0;t<n.mNumMeshes;++t)n.mMeshes[t]=O(e)}if(n.mNumChildren){n.mChildren=[];for(let t=0;t<n.mNumChildren;++t){var i=J(e,n,r++);n.mChildren[t]=i}}return n}function Z(e,t){return K(4666==G(e)),G(e),t.mName=H(e),t.mNumWeights=O(e),t.mOffsetMatrix=j(e),le?q(e,t.mWeights,t.mNumWeights):(t.mWeights=[],function(e,t,r){for(let n=0;n<r;n++)t[n]=Q(e)}(e,t.mWeights,t.mNumWeights)),t}function $(e,t){K(4663==G(e)),G(e),t.mPrimitiveTypes=O(e),t.mNumVertices=O(e),t.mNumFaces=O(e),t.mNumBones=O(e),t.mMaterialIndex=O(e),t.mNumUVComponents=[];var r=O(e);1&r&&(le?q(e,t.mVertices,t.mNumVertices):(t.mVertices=[],t.mVertexBuffer=e.subArray32(e.readOffset,e.readOffset+3*t.mNumVertices*4),e.Seek(3*t.mNumVertices*4,ue))),2&r&&(le?q(e,t.mNormals,t.mNumVertices):(t.mNormals=[],t.mNormalBuffer=e.subArray32(e.readOffset,e.readOffset+3*t.mNumVertices*4),e.Seek(3*t.mNumVertices*4,ue))),4&r&&(le?(q(e,t.mTangents,t.mNumVertices),q(e,t.mBitangents,t.mNumVertices)):(t.mTangents=[],t.mTangentBuffer=e.subArray32(e.readOffset,e.readOffset+3*t.mNumVertices*4),e.Seek(3*t.mNumVertices*4,ue),t.mBitangents=[],t.mBitangentBuffer=e.subArray32(e.readOffset,e.readOffset+3*t.mNumVertices*4),e.Seek(3*t.mNumVertices*4,ue)));for(let i=0;i<1&&r&s(i);++i)le?q(e,t.mColors[i],t.mNumVertices):(t.mColors[i]=[],t.mColorBuffer=e.subArray32(e.readOffset,e.readOffset+4*t.mNumVertices*4),e.Seek(4*t.mNumVertices*4,ue));t.mTexCoordsBuffers=[];for(let i=0;i<4&&r&a(i);++i)if(t.mNumUVComponents[i]=O(e),le)q(e,t.mTextureCoords[i],t.mNumVertices);else{t.mTextureCoords[i]=[],t.mTexCoordsBuffers[i]=[];for(let r=0;r<t.mNumVertices;r++)t.mTexCoordsBuffers[i].push(U(e)),t.mTexCoordsBuffers[i].push(U(e)),U(e)}if(le)O(e);else{t.mFaces=[],t.mIndexArray=[];for(let r=0;r<t.mNumFaces;++r){var n=t.mFaces[r]=new h;n.mNumIndices=k(e),n.mIndices=[];for(let r=0;r<n.mNumIndices;++r)t.mNumVertices<65536?n.mIndices[r]=k(e):n.mIndices[r]=O(e);if(3===n.mNumIndices)t.mIndexArray.push(n.mIndices[0]),t.mIndexArray.push(n.mIndices[1]),t.mIndexArray.push(n.mIndices[2]);else{if(4!==n.mNumIndices)throw new Error("Sorry, can't currently triangulate polys. Use the triangulate preprocessor in Assimp.");t.mIndexArray.push(n.mIndices[0]),t.mIndexArray.push(n.mIndices[1]),t.mIndexArray.push(n.mIndices[2]),t.mIndexArray.push(n.mIndices[2]),t.mIndexArray.push(n.mIndices[3]),t.mIndexArray.push(n.mIndices[0])}}}if(t.mNumBones){t.mBones=[];for(let r=0;r<t.mNumBones;++r)t.mBones[r]=new x,Z(e,t.mBones[r])}}function ee(e,t){K(4670==G(e)),G(e),t.mKey=H(e),t.mSemantic=O(e),t.mIndex=O(e),t.mDataLength=O(e),t.mType=O(e),t.mData=[],e.ReadBytes(t.mData,1,t.mDataLength)}function te(e,t){if(K(4669==G(e)),G(e),t.mNumAllocated=t.mNumProperties=O(e),t.mNumProperties){t.mProperties&&delete t.mProperties,t.mProperties=[];for(let r=0;r<t.mNumProperties;++r)t.mProperties[r]=new b,ee(e,t.mProperties[r])}}function re(e,t){K(4664==G(e)),G(e),t.mNodeName=H(e),t.mNumPositionKeys=O(e),t.mNumRotationKeys=O(e),t.mNumScalingKeys=O(e),t.mPreState=O(e),t.mPostState=O(e),t.mNumPositionKeys&&(le?q(e,t.mPositionKeys,t.mNumPositionKeys):(t.mPositionKeys=[],Y(e,t.mPositionKeys,t.mNumPositionKeys))),t.mNumRotationKeys&&(le?q(e,t.mRotationKeys,t.mNumRotationKeys):(t.mRotationKeys=[],function(e,t,r){for(let n=0;n<r;n++)t[n]=X(e)}(e,t.mRotationKeys,t.mNumRotationKeys))),t.mNumScalingKeys&&(le?q(e,t.mScalingKeys,t.mNumScalingKeys):(t.mScalingKeys=[],Y(e,t.mScalingKeys,t.mNumScalingKeys)))}function ne(e,t){if(K(4667==G(e)),G(e),t.mName=H(e),t.mDuration=N(e),t.mTicksPerSecond=N(e),t.mNumChannels=O(e),t.mNumChannels){t.mChannels=[];for(let r=0;r<t.mNumChannels;++r)t.mChannels[r]=new C,re(e,t.mChannels[r])}}function ie(e,t){K(4662==G(e)),G(e),t.mWidth=O(e),t.mHeight=O(e),e.ReadBytes(t.achFormatHint,1,4),le||(t.mHeight?(t.pcData=[],e.ReadBytes(t.pcData,1,t.mWidth*t.mHeight*4)):(t.pcData=[],e.ReadBytes(t.pcData,1,t.mWidth)))}function ae(e,t){K(4661==G(e)),G(e),t.mName=H(e),t.mType=O(e),1!=t.mType&&(t.mAttenuationConstant=U(e),t.mAttenuationLinear=U(e),t.mAttenuationQuadratic=U(e)),t.mColorDiffuse=V(e),t.mColorSpecular=V(e),t.mColorAmbient=V(e),3==t.mType&&(t.mAngleInnerCone=U(e),t.mAngleOuterCone=U(e))}function se(e,t){K(4660==G(e)),G(e),t.mName=H(e),t.mPosition=z(e),t.mLookAt=z(e),t.mUp=z(e),t.mHorizontalFOV=U(e),t.mClipPlaneNear=U(e),t.mClipPlaneFar=U(e),t.mAspect=U(e)}function oe(e,t){if(K(4665==G(e)),G(e),t.mFlags=O(e),t.mNumMeshes=O(e),t.mNumMaterials=O(e),t.mNumAnimations=O(e),t.mNumTextures=O(e),t.mNumLights=O(e),t.mNumCameras=O(e),t.mRootNode=new y,t.mRootNode=J(e,null,0),t.mNumMeshes){t.mMeshes=[];for(let r=0;r<t.mNumMeshes;++r)t.mMeshes[r]=new u,$(e,t.mMeshes[r])}if(t.mNumMaterials){t.mMaterials=[];for(let r=0;r<t.mNumMaterials;++r)t.mMaterials[r]=new S,te(e,t.mMaterials[r])}if(t.mNumAnimations){t.mAnimations=[];for(let r=0;r<t.mNumAnimations;++r)t.mAnimations[r]=new I,ne(e,t.mAnimations[r])}if(t.mNumTextures){t.mTextures=[];for(let r=0;r<t.mNumTextures;++r)t.mTextures[r]=new B,ie(e,t.mTextures[r])}if(t.mNumLights){t.mLights=[];for(let r=0;r<t.mNumLights;++r)t.mLights[r]=new R,ae(e,t.mLights[r])}if(t.mNumCameras){t.mCameras=[];for(let r=0;r<t.mNumCameras;++r)t.mCameras[r]=new P,se(e,t.mCameras[r])}}var le,ce,ue=0;return function(e){var t=new F,r=new DataView(e);if(function(e){e.readOffset=0,e.Seek=function(t,r){r==ue&&(e.readOffset+=t),1==r&&(e.readOffset=t)},e.ReadBytes=function(e,t,r){var n,i,a=t*r;for(let s=0;s<a;s++)e[s]=(i=void 0,i=(n=this).getUint8(n.readOffset),n.readOffset+=1,i)},e.subArray32=function(e,t){var r=this.buffer.slice(e,t);return new Float32Array(r)},e.subArrayUint16=function(e,t){var r=this.buffer.slice(e,t);return new Uint16Array(r)},e.subArrayUint8=function(e,t){var r=this.buffer.slice(e,t);return new Uint8Array(r)},e.subArrayUint32=function(e,t){var r=this.buffer.slice(e,t);return new Uint32Array(r)}}(r),r.Seek(44,ue),t.versionMajor=O(r),t.versionMinor=O(r),t.versionRevision=O(r),t.compileFlags=O(r),le=k(r)>0,ce=k(r)>0,le)throw"Shortened binaries are not supported!";if(r.Seek(256,ue),r.Seek(128,ue),r.Seek(64,ue),ce){var n=G(r),i=r.FileSize()-r.Tell(),a=[];r.Read(a,1,i);var s=[];uncompress(s,n,a,i),oe(new ArrayBuffer(s),t)}else oe(r,t);return t.toTHREE()}(e)}}class qp extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=this,s=new n.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.load(e,(function(e){t(a.parse(e))}),r,i)}parse(e){const t=new DataView(e),r=t.getUint32(0),i=t.getUint32(4);let a=8;const s=new Float32Array(r),o=new Float32Array(r*r).fill(0);for(let n=0;n<r;n++)s[n]=t.getFloat32(a),a+=4,o[r*n+n]=1;const l=new n.NumberKeyframeTrack(".morphTargetInfluences",s,o),c=new n.AnimationClip("default",s[s.length-1],[l]),u=[];for(let h=0;h<r;h++){const e=new Float32Array(3*i);for(let n=0;n<i;n++){const r=3*n;e[r+0]=t.getFloat32(a),a+=4,e[r+1]=t.getFloat32(a),a+=4,e[r+2]=t.getFloat32(a),a+=4}const r=new n.BufferAttribute(e,3);r.name="morph_"+h,u.push(r)}return{morphTargets:u,clip:c}}}class Kp extends n.DataTextureLoader{constructor(e){super(e),this.type=n.HalfFloatType}parse(e){const t=65536,r=14,i=65537,a=16384,s=Math.pow(2.7182818,2.2);const o={l:0,c:0,lc:0};function l(e,t,r,n,i){for(;r<e;)t=t<<8|V(n,i),r+=8;r-=e,o.l=t>>r&(1<<e)-1,o.c=t,o.lc=r}const c=new Array(59);function u(e,t,r,n,a,s,u){for(var h=r,d=0,p=0;a<=s;a++){if(h.value-r.value>n)return!1;l(6,d,p,e,h);var f=o.l;if(d=o.c,p=o.lc,u[a]=f,63==f){if(h.value-r.value>n)throw"Something wrong with hufUnpackEncTable";l(8,d,p,e,h);var m=o.l+6;if(d=o.c,p=o.lc,a+m>s+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)u[a++]=0;a--}else if(f>=59){if(a+(m=f-59+2)>s+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)u[a++]=0;a--}}!function(e){for(var t=0;t<=58;++t)c[t]=0;for(t=0;t<i;++t)c[e[t]]+=1;var r=0;for(t=58;t>0;--t){var n=r+c[t]>>1;c[t]=r,r=n}for(t=0;t<i;++t){var a=e[t];a>0&&(e[t]=a|c[a]++<<6)}}(u)}function h(e){return 63&e}function d(e){return e>>6}const p={c:0,lc:0};function f(e,t,r,n){e=e<<8|V(r,n),t+=8,p.c=e,p.lc=t}const m={c:0,lc:0};function g(e,t,r,n,i,a,s,o,l,c){if(e==t){n<8&&(f(r,n,i,s),r=p.c,n=p.lc);var u=r>>(n-=8);u=new Uint8Array([u])[0];if(l.value+u>c)return!1;for(var h=o[l.value-1];u-- >0;)o[l.value++]=h}else{if(!(l.value<c))return!1;o[l.value++]=e}m.c=r,m.lc=n}function v(e){return 65535&e}function A(e){var t=v(e);return t>32767?t-65536:t}const y={a:0,b:0};function x(e,t){var r=A(e),n=A(t),i=r+(1&n)+(n>>1),a=i,s=i-n;y.a=a,y.b=s}function b(e,t){var r=v(e),n=v(t),i=r-(n>>1)&65535,a=n+i-32768&65535;y.a=a,y.b=i}function w(e,t,r,n,i,a,s){for(var o,l=s<16384,c=r>i?i:r,u=1;u<=c;)u<<=1;for(o=u>>=1,u>>=1;u>=1;){for(var h,d,p,f,m=0,g=m+a*(i-o),v=a*u,A=a*o,w=n*u,E=n*o;m<=g;m+=A){for(var S=m,M=m+n*(r-o);S<=M;S+=E){var _=S+w,T=(C=S+v)+w;l?(x(e[S+t],e[C+t]),h=y.a,p=y.b,x(e[_+t],e[T+t]),d=y.a,f=y.b,x(h,d),e[S+t]=y.a,e[_+t]=y.b,x(p,f),e[C+t]=y.a,e[T+t]=y.b):(b(e[S+t],e[C+t]),h=y.a,p=y.b,b(e[_+t],e[T+t]),d=y.a,f=y.b,b(h,d),e[S+t]=y.a,e[_+t]=y.b,b(p,f),e[C+t]=y.a,e[T+t]=y.b)}if(r&u){var C=S+v;l?x(e[S+t],e[C+t]):b(e[S+t],e[C+t]),h=y.a,e[C+t]=y.b,e[S+t]=h}}if(i&u)for(S=m,M=m+n*(r-o);S<=M;S+=E){_=S+w;l?x(e[S+t],e[_+t]):b(e[S+t],e[_+t]),h=y.a,e[_+t]=y.b,e[S+t]=h}o=u,u>>=1}return m}function E(e,t,n,s,o,l){var c=n.value,v=z(t,n),A=z(t,n);n.value+=4;var y=z(t,n);if(n.value+=4,v<0||v>=i||A<0||A>=i)throw"Something wrong with HUF_ENCSIZE";var x=new Array(i),b=new Array(a);if(function(e){for(var t=0;t<a;t++)e[t]={},e[t].len=0,e[t].lit=0,e[t].p=null}(b),u(e,0,n,s-(n.value-c),v,A,x),y>8*(s-(n.value-c)))throw"Something wrong with hufUncompress";!function(e,t,n,i){for(;t<=n;t++){var a=d(e[t]),s=h(e[t]);if(a>>s)throw"Invalid table entry";if(s>r){if((u=i[a>>s-r]).len)throw"Invalid table entry";if(u.lit++,u.p){var o=u.p;u.p=new Array(u.lit);for(var l=0;l<u.lit-1;++l)u.p[l]=o[l]}else u.p=new Array(1);u.p[u.lit-1]=t}else if(s){var c=0;for(l=1<<r-s;l>0;l--){var u;if((u=i[(a<<r-s)+c]).len||u.p)throw"Invalid table entry";u.len=s,u.lit=t,c++}}}}(x,v,A,b),function(e,t,n,i,a,s,o,l,c,u){for(var v=0,A=0,y=l,x=Math.trunc(a.value+(s+7)/8);a.value<x;)for(f(v,A,n,a),v=p.c,A=p.lc;A>=r;)if((S=t[v>>A-r&16383]).len)A-=S.len,g(S.lit,o,v,A,n,0,a,c,u,y),v=m.c,A=m.lc;else{if(!S.p)throw"hufDecode issues";var b;for(b=0;b<S.lit;b++){for(var w=h(e[S.p[b]]);A<w&&a.value<x;)f(v,A,n,a),v=p.c,A=p.lc;if(A>=w&&d(e[S.p[b]])==(v>>A-w&(1<<w)-1)){A-=w,g(S.p[b],o,v,A,n,0,a,c,u,y),v=m.c,A=m.lc;break}}if(b==S.lit)throw"hufDecode issues"}var E=8-s&7;for(v>>=E,A-=E;A>0;){var S;if(!(S=t[v<<r-A&16383]).len)throw"hufDecode issues";A-=S.len,g(S.lit,o,v,A,n,0,a,c,u,y),v=m.c,A=m.lc}}(x,b,e,0,n,y,A,l,o,{value:0})}function S(e){for(var t=1;t<e.length;t++){var r=e[t-1]+e[t]-128;e[t]=r}}function M(e,t){for(var r=0,n=Math.floor((e.length+1)/2),i=0,a=e.length-1;!(i>a||(t[i++]=e[r++],i>a));)t[i++]=e[n++]}function _(e){for(var t=e.byteLength,r=new Array,n=0,i=new DataView(e);t>0;){var a=i.getInt8(n++);if(a<0){t-=(o=-a)+1;for(var s=0;s<o;s++)r.push(i.getUint8(n++))}else{var o=a;t-=2;var l=i.getUint8(n++);for(s=0;s<o+1;s++)r.push(l)}}return r}function T(e,t,r){for(var n,i=1;i<64;)65280==(n=t[e.value])?i=64:n>>8==255?i+=255&n:(r[i]=n,i++),e.value++}function C(e,t){t[0]=X(e[0]),t[1]=X(e[1]),t[2]=X(e[5]),t[3]=X(e[6]),t[4]=X(e[14]),t[5]=X(e[15]),t[6]=X(e[27]),t[7]=X(e[28]),t[8]=X(e[2]),t[9]=X(e[4]),t[10]=X(e[7]),t[11]=X(e[13]),t[12]=X(e[16]),t[13]=X(e[26]),t[14]=X(e[29]),t[15]=X(e[42]),t[16]=X(e[3]),t[17]=X(e[8]),t[18]=X(e[12]),t[19]=X(e[17]),t[20]=X(e[25]),t[21]=X(e[30]),t[22]=X(e[41]),t[23]=X(e[43]),t[24]=X(e[9]),t[25]=X(e[11]),t[26]=X(e[18]),t[27]=X(e[24]),t[28]=X(e[31]),t[29]=X(e[40]),t[30]=X(e[44]),t[31]=X(e[53]),t[32]=X(e[10]),t[33]=X(e[19]),t[34]=X(e[23]),t[35]=X(e[32]),t[36]=X(e[39]),t[37]=X(e[45]),t[38]=X(e[52]),t[39]=X(e[54]),t[40]=X(e[20]),t[41]=X(e[22]),t[42]=X(e[33]),t[43]=X(e[38]),t[44]=X(e[46]),t[45]=X(e[51]),t[46]=X(e[55]),t[47]=X(e[60]),t[48]=X(e[21]),t[49]=X(e[34]),t[50]=X(e[37]),t[51]=X(e[47]),t[52]=X(e[50]),t[53]=X(e[56]),t[54]=X(e[59]),t[55]=X(e[61]),t[56]=X(e[35]),t[57]=X(e[36]),t[58]=X(e[48]),t[59]=X(e[49]),t[60]=X(e[57]),t[61]=X(e[58]),t[62]=X(e[62]),t[63]=X(e[63])}function I(e){const t=.5*Math.cos(.7853975),r=.5*Math.cos(3.14159/16),n=.5*Math.cos(3.14159/8),i=.5*Math.cos(3*3.14159/16),a=.5*Math.cos(.981746875),s=.5*Math.cos(3*3.14159/8),o=.5*Math.cos(1.374445625);for(var l=new Array(4),c=new Array(4),u=new Array(4),h=new Array(4),d=0;d<8;++d){var p=8*d;l[0]=n*e[p+2],l[1]=s*e[p+2],l[2]=n*e[p+6],l[3]=s*e[p+6],c[0]=r*e[p+1]+i*e[p+3]+a*e[p+5]+o*e[p+7],c[1]=i*e[p+1]-o*e[p+3]-r*e[p+5]-a*e[p+7],c[2]=a*e[p+1]-r*e[p+3]+o*e[p+5]+i*e[p+7],c[3]=o*e[p+1]-a*e[p+3]+i*e[p+5]-r*e[p+7],u[0]=t*(e[p+0]+e[p+4]),u[3]=t*(e[p+0]-e[p+4]),u[1]=l[0]+l[3],u[2]=l[1]-l[2],h[0]=u[0]+u[1],h[1]=u[3]+u[2],h[2]=u[3]-u[2],h[3]=u[0]-u[1],e[p+0]=h[0]+c[0],e[p+1]=h[1]+c[1],e[p+2]=h[2]+c[2],e[p+3]=h[3]+c[3],e[p+4]=h[3]-c[3],e[p+5]=h[2]-c[2],e[p+6]=h[1]-c[1],e[p+7]=h[0]-c[0]}for(var f=0;f<8;++f)l[0]=n*e[16+f],l[1]=s*e[16+f],l[2]=n*e[48+f],l[3]=s*e[48+f],c[0]=r*e[8+f]+i*e[24+f]+a*e[40+f]+o*e[56+f],c[1]=i*e[8+f]-o*e[24+f]-r*e[40+f]-a*e[56+f],c[2]=a*e[8+f]-r*e[24+f]+o*e[40+f]+i*e[56+f],c[3]=o*e[8+f]-a*e[24+f]+i*e[40+f]-r*e[56+f],u[0]=t*(e[f]+e[32+f]),u[3]=t*(e[f]-e[32+f]),u[1]=l[0]+l[3],u[2]=l[1]-l[2],h[0]=u[0]+u[1],h[1]=u[3]+u[2],h[2]=u[3]-u[2],h[3]=u[0]-u[1],e[0+f]=h[0]+c[0],e[8+f]=h[1]+c[1],e[16+f]=h[2]+c[2],e[24+f]=h[3]+c[3],e[32+f]=h[3]-c[3],e[40+f]=h[2]-c[2],e[48+f]=h[1]-c[1],e[56+f]=h[0]-c[0]}function B(e){for(var t=0;t<64;++t){var r=e[0][t],n=e[1][t],i=e[2][t];e[0][t]=r+1.5747*i,e[1][t]=r-.1873*n-.4682*i,e[2][t]=r+1.8556*n}}function R(e,t,r){for(var i=0;i<64;++i)t[r+i]=n.DataUtils.toHalfFloat(P(e[i]))}function P(e){return e<=1?Math.sign(e)*Math.pow(Math.abs(e),2.2):Math.sign(e)*Math.pow(s,Math.abs(e)-1)}function F(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function L(e){var t=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),r=new Uint8Array(_(t)),n=new Uint8Array(r.length);return S(r),M(r,n),new DataView(n.buffer)}function D(e){var t=e.array.slice(e.offset.value,e.offset.value+e.size),r=(0,Lt.HT)(t),n=new Uint8Array(r.length);return S(r),M(r,n),new DataView(n.buffer)}function U(e){for(var r=e.viewer,n={value:e.offset.value},i=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),a=new Uint8Array(8192),s=0,o=new Array(e.channels),l=0;l<e.channels;l++)o[l]={},o[l].start=s,o[l].end=o[l].start,o[l].nx=e.width,o[l].ny=e.lines,o[l].size=e.type,s+=o[l].nx*o[l].ny*o[l].size;var c=Y(r,n),u=Y(r,n);if(u>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(c<=u)for(l=0;l<u-c+1;l++)a[l+c]=H(r,n);var h=new Uint16Array(t),d=function(e,r){for(var n=0,i=0;i<t;++i)(0==i||e[i>>3]&1<<(7&i))&&(r[n++]=i);for(var a=n-1;n<t;)r[n++]=0;return a}(a,h),p=z(r,n);E(e.array,r,n,p,i,s);for(l=0;l<e.channels;++l)for(var f=o[l],m=0;m<o[l].size;++m)w(i,f.start+m,f.nx,f.size,f.ny,f.nx*f.size,d);!function(e,t,r){for(var n=0;n<r;++n)t[n]=e[t[n]]}(h,i,s);for(var g=0,v=new Uint8Array(i.buffer.byteLength),A=0;A<e.lines;A++)for(var y=0;y<e.channels;y++){var x=(f=o[y]).nx*f.size,b=new Uint8Array(i.buffer,2*f.end,2*x);v.set(b,g),g+=2*x,f.end+=x}return new DataView(v.buffer)}function N(e){var t=e.array.slice(e.offset.value,e.offset.value+e.size),r=(0,Lt.HT)(t);const n=e.lines*e.channels*e.width,i=1==e.type?new Uint16Array(n):new Uint32Array(n);let a=0,s=0;const o=new Array(4);for(let l=0;l<e.lines;l++)for(let t=0;t<e.channels;t++){let t=0;switch(e.type){case 1:o[0]=a,o[1]=o[0]+e.width,a=o[1]+e.width;for(let n=0;n<e.width;++n){t+=r[o[0]++]<<8|r[o[1]++],i[s]=t,s++}break;case 2:o[0]=a,o[1]=o[0]+e.width,o[2]=o[1]+e.width,a=o[2]+e.width;for(let n=0;n<e.width;++n){t+=r[o[0]++]<<24|r[o[1]++]<<16|r[o[2]++]<<8,i[s]=t,s++}}}return new DataView(i.buffer)}function k(e){var t=e.viewer,r={value:e.offset.value},n=new Uint8Array(e.width*e.lines*(e.channels*e.type*2)),i={version:Q(t,r),unknownUncompressedSize:Q(t,r),unknownCompressedSize:Q(t,r),acCompressedSize:Q(t,r),dcCompressedSize:Q(t,r),rleCompressedSize:Q(t,r),rleUncompressedSize:Q(t,r),rleRawSize:Q(t,r),totalAcUncompressedCount:Q(t,r),totalDcUncompressedCount:Q(t,r),acCompression:Q(t,r)};if(i.version<2)throw"EXRLoader.parse: "+ee.compression+" version "+i.version+" is unsupported";for(var a=new Array,s=Y(t,r)-2;s>0;){var o=O(t.buffer,r),l=H(t,r),c=l>>2&3,u=new Int8Array([(l>>4)-1])[0],h=H(t,r);a.push({name:o,index:u,type:h,compression:c}),s-=o.length+3}for(var d=ee.channels,p=new Array(e.channels),f=0;f<e.channels;++f){var m=p[f]={},g=d[f];m.name=g.name,m.compression=0,m.decoded=!1,m.type=g.pixelType,m.pLinear=g.pLinear,m.width=e.width,m.height=e.lines}for(var v={idx:new Array(3)},A=0;A<e.channels;++A)for(m=p[A],f=0;f<a.length;++f){var y=a[f];m.name==y.name&&(m.compression=y.compression,y.index>=0&&(v.idx[y.index]=A),m.offset=A)}if(i.acCompressedSize>0)switch(i.acCompression){case 0:var x=new Uint16Array(i.totalAcUncompressedCount);E(e.array,t,r,i.acCompressedSize,x,i.totalAcUncompressedCount);break;case 1:var b=e.array.slice(r.value,r.value+i.totalAcUncompressedCount),w=(0,Lt.HT)(b);x=new Uint16Array(w.buffer);r.value+=i.totalAcUncompressedCount}if(i.dcCompressedSize>0){var S={array:e.array,offset:r,size:i.dcCompressedSize},M=new Uint16Array(D(S).buffer);r.value+=i.dcCompressedSize}if(i.rleRawSize>0){b=e.array.slice(r.value,r.value+i.rleCompressedSize);var P=_((w=(0,Lt.HT)(b)).buffer);r.value+=i.rleCompressedSize}var F=0,L=new Array(p.length);for(f=0;f<L.length;++f)L[f]=new Array;for(var U=0;U<e.lines;++U)for(var N=0;N<p.length;++N)L[N].push(F),F+=p[N].width*e.type*2;!function(e,t,r,n,i,a){var s=new DataView(a.buffer),o=r[e.idx[0]].width,l=r[e.idx[0]].height,c=Math.floor(o/8),u=Math.ceil(o/8),h=Math.ceil(l/8),d=o-8*(u-1),p=l-8*(h-1),f={value:0},m=new Array(3),g=new Array(3),v=new Array(3),A=new Array(3),y=new Array(3);for(let T=0;T<3;++T)y[T]=t[e.idx[T]],m[T]=T<1?0:m[T-1]+u*h,g[T]=new Float32Array(64),v[T]=new Uint16Array(64),A[T]=new Uint16Array(64*u);for(let P=0;P<h;++P){var x=8;P==h-1&&(x=p);var b=8;for(let e=0;e<u;++e){e==u-1&&(b=d);for(let e=0;e<3;++e)v[e].fill(0),v[e][0]=i[m[e]++],T(f,n,v[e]),C(v[e],g[e]),I(g[e]);B(g);for(let t=0;t<3;++t)R(g[t],A[t],64*e)}let t=0;for(let n=0;n<3;++n){const i=r[e.idx[n]].type;for(let e=8*P;e<8*P+x;++e){t=y[n][e];for(let r=0;r<c;++r){const a=64*r+8*(7&e);s.setUint16(t+0*i,A[n][a+0],!0),s.setUint16(t+2*i,A[n][a+1],!0),s.setUint16(t+4*i,A[n][a+2],!0),s.setUint16(t+6*i,A[n][a+3],!0),s.setUint16(t+8*i,A[n][a+4],!0),s.setUint16(t+10*i,A[n][a+5],!0),s.setUint16(t+12*i,A[n][a+6],!0),s.setUint16(t+14*i,A[n][a+7],!0),t+=16*i}}if(c!=u)for(let e=8*P;e<8*P+x;++e){const t=y[n][e]+8*c*2*i,r=64*c+8*(7&e);for(let e=0;e<b;++e)s.setUint16(t+2*e*i,A[n][r+e],!0)}}}for(var w=new Uint16Array(o),E=(s=new DataView(a.buffer),0);E<3;++E){r[e.idx[E]].decoded=!0;var S=r[e.idx[E]].type;if(2==r[E].type)for(var M=0;M<l;++M){const e=y[E][M];for(var _=0;_<o;++_)w[_]=s.getUint16(e+2*_*S,!0);for(_=0;_<o;++_)s.setFloat32(e+2*_*S,X(w[_]),!0)}}}(v,L,p,x,M,n);for(f=0;f<p.length;++f){if(!(m=p[f]).decoded){if(2!==m.compression)throw"EXRLoader.parse: unsupported channel compression";var k=0,G=0;for(U=0;U<e.lines;++U){for(var z=L[f][k],V=0;V<m.width;++V){for(var j=0;j<2*m.type;++j)n[z++]=P[G+j*m.width*m.height];G++}k++}}}return new DataView(n.buffer)}function O(e,t){for(var r=new Uint8Array(e),n=0;0!=r[t.value+n];)n+=1;var i=(new TextDecoder).decode(r.slice(t.value,t.value+n));return t.value=t.value+n+1,i}function G(e,t){var r=e.getInt32(t.value,!0);return t.value=t.value+4,r}function z(e,t){var r=e.getUint32(t.value,!0);return t.value=t.value+4,r}function V(e,t){var r=e[t.value];return t.value=t.value+1,r}function H(e,t){var r=e.getUint8(t.value);return t.value=t.value+1,r}const Q=function(e,t){let r;return r="getBigInt64"in DataView.prototype?Number(e.getBigInt64(t.value,!0)):e.getUint32(t.value+4,!0)+Number(e.getUint32(t.value,!0)<<32),t.value+=8,r};function j(e,t){var r=e.getFloat32(t.value,!0);return t.value+=4,r}function W(e,t){return n.DataUtils.toHalfFloat(j(e,t))}function X(e){var t=(31744&e)>>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function Y(e,t){var r=e.getUint16(t.value,!0);return t.value+=2,r}function q(e,t){return X(Y(e,t))}function K(e,t,r,n,i){return"string"===n||"stringvector"===n||"iccProfile"===n?function(e,t,r){var n=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+r));return t.value=t.value+r,n}(t,r,i):"chlist"===n?function(e,t,r,n){for(var i=r.value,a=[];r.value<i+n-1;){var s=O(t,r),o=G(e,r),l=H(e,r);r.value+=3;var c=G(e,r),u=G(e,r);a.push({name:s,pixelType:o,pLinear:l,xSampling:c,ySampling:u})}return r.value+=1,a}(e,t,r,i):"chromaticities"===n?function(e,t){return{redX:j(e,t),redY:j(e,t),greenX:j(e,t),greenY:j(e,t),blueX:j(e,t),blueY:j(e,t),whiteX:j(e,t),whiteY:j(e,t)}}(e,r):"compression"===n?function(e,t){return["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"][H(e,t)]}(e,r):"box2i"===n?function(e,t){return{xMin:z(e,t),yMin:z(e,t),xMax:z(e,t),yMax:z(e,t)}}(e,r):"lineOrder"===n?function(e,t){return["INCREASING_Y"][H(e,t)]}(e,r):"float"===n?j(e,r):"v2f"===n?function(e,t){return[j(e,t),j(e,t)]}(e,r):"v3f"===n?function(e,t){return[j(e,t),j(e,t),j(e,t)]}(e,r):"int"===n?G(e,r):"rational"===n?function(e,t){return[G(e,t),z(e,t)]}(e,r):"timecode"===n?function(e,t){return[z(e,t),z(e,t)]}(e,r):"preview"===n?(r.value+=i,"skipped"):void(r.value+=i)}const J=new DataView(e),Z=new Uint8Array(e),$={value:0},ee=function(e,t,r){const n={};if(20000630!=e.getUint32(0,!0))throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";n.version=e.getUint8(4);const i=e.getUint8(5);n.spec={singleTile:!!(2&i),longName:!!(4&i),deepFormat:!!(8&i),multiPart:!!(16&i)},r.value=8;for(var a=!0;a;){var s=O(t,r);if(0==s)a=!1;else{var o=O(t,r),l=K(e,t,r,o,z(e,r));void 0===l?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${o}'.`):n[s]=l}}if(0!=i)throw console.error("EXRHeader:",n),"THREE.EXRLoader: provided file is currently unsupported.";return n}(J,e,$),te=function(e,t,r,i,a){const s={size:0,viewer:t,array:r,offset:i,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,channels:e.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:e.channels[0].pixelType,uncompress:null,getter:null,format:null,encoding:null};switch(e.compression){case"NO_COMPRESSION":s.lines=1,s.uncompress=F;break;case"RLE_COMPRESSION":s.lines=1,s.uncompress=L;break;case"ZIPS_COMPRESSION":s.lines=1,s.uncompress=D;break;case"ZIP_COMPRESSION":s.lines=16,s.uncompress=D;break;case"PIZ_COMPRESSION":s.lines=32,s.uncompress=U;break;case"PXR24_COMPRESSION":s.lines=16,s.uncompress=N;break;case"DWAA_COMPRESSION":s.lines=32,s.uncompress=k;break;case"DWAB_COMPRESSION":s.lines=256,s.uncompress=k;break;default:throw"EXRLoader.parse: "+e.compression+" is unsupported"}if(s.scanlineBlockSize=s.lines,1==s.type)switch(a){case n.FloatType:s.getter=q,s.inputSize=2;break;case n.HalfFloatType:s.getter=Y,s.inputSize=2}else{if(2!=s.type)throw"EXRLoader.parse: unsupported pixelType "+s.type+" for "+e.compression+".";switch(a){case n.FloatType:s.getter=j,s.inputSize=4;break;case n.HalfFloatType:s.getter=W,s.inputSize=4}}s.blockCount=(e.dataWindow.yMax+1)/s.scanlineBlockSize;for(var o=0;o<s.blockCount;o++)Q(t,i);s.outputChannels=3==s.channels?4:s.channels;const l=s.width*s.height*s.outputChannels;switch(a){case n.FloatType:s.byteArray=new Float32Array(l),s.channels<s.outputChannels&&s.byteArray.fill(1,0,l);break;case n.HalfFloatType:s.byteArray=new Uint16Array(l),s.channels<s.outputChannels&&s.byteArray.fill(15360,0,l);break;default:console.error("THREE.EXRLoader: unsupported type: ",a)}return s.bytesPerLine=s.width*s.inputSize*s.channels,4==s.outputChannels?(s.format=n.RGBAFormat,s.encoding=3e3):(s.format=n.RedFormat,s.encoding=3e3),s}(ee,J,Z,$,this.type),re={value:0},ne={R:0,G:1,B:2,A:3,Y:0};for(let n=0;n<te.height/te.scanlineBlockSize;n++){const e=z(J,$);te.size=z(J,$),te.lines=e+te.scanlineBlockSize>te.height?te.height-e:te.scanlineBlockSize;const t=te.size<te.lines*te.bytesPerLine?te.uncompress(te):F(te);$.value+=te.size;for(let r=0;r<te.scanlineBlockSize;r++){const e=r+n*te.scanlineBlockSize;if(e>=te.height)break;for(let n=0;n<te.channels;n++){const i=ne[ee.channels[n].name];for(let a=0;a<te.width;a++){re.value=(r*(te.channels*te.width)+n*te.width+a)*te.inputSize;const s=(te.height-1-e)*(te.width*te.outputChannels)+a*te.outputChannels+i;te.byteArray[s]=te.getter(t,re)}}}}return{header:ee,width:te.width,height:te.height,data:te.byteArray,format:te.format,encoding:te.encoding,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,r,i){return super.load(e,(function(e,r){"colorSpace"in e?e.colorSpace=3001===r.encoding?"srgb":"srgb-linear":e.encoding=r.encoding,e.minFilter=n.LinearFilter,e.magFilter=n.LinearFilter,e.generateMipmaps=!1,e.flipY=!1,t&&t(e,r)}),r,i)}}class Jp extends n.Loader{constructor(e){super(e),this.availableExtensions=[]}load(e,t,r,i){const a=this,s=new n.FileLoader(a.manager);s.setPath(a.path),s.setResponseType("arraybuffer"),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){const t=this,r=new n.TextureLoader(this.manager);function i(e){const t=[],r=(new DOMParser).parseFromString(e,"application/xml").querySelectorAll("Relationship");for(let n=0;n<r.length;n++){const e=r[n],i={target:e.getAttribute("Target"),id:e.getAttribute("Id"),type:e.getAttribute("Type")};t.push(i)}return t}function a(e){const t={id:e.getAttribute("id"),basematerials:[]},r=e.querySelectorAll("base");for(let n=0;n<r.length;n++){const e=c(r[n]);e.index=n,t.basematerials.push(e)}return t}function s(e){const t={id:e.getAttribute("id"),texid:e.getAttribute("texid"),displaypropertiesid:e.getAttribute("displaypropertiesid")},r=e.querySelectorAll("tex2coord"),n=[];for(let i=0;i<r.length;i++){const e=r[i],t=e.getAttribute("u"),a=e.getAttribute("v");n.push(parseFloat(t),parseFloat(a))}return t.uvs=new Float32Array(n),t}function o(e){const t={id:e.getAttribute("id"),displaypropertiesid:e.getAttribute("displaypropertiesid")},r=e.querySelectorAll("color"),i=[],a=new n.Color;for(let n=0;n<r.length;n++){const e=r[n].getAttribute("color");a.setStyle(e.substring(0,7)),a.convertSRGBToLinear(),i.push(a.r,a.g,a.b)}return t.colors=new Float32Array(i),t}function l(e){const t={id:e.getAttribute("id")},r=e.querySelectorAll("pbmetallic"),n=[];for(let i=0;i<r.length;i++){const e=r[i];n.push({name:e.getAttribute("name"),metallicness:parseFloat(e.getAttribute("metallicness")),roughness:parseFloat(e.getAttribute("roughness"))})}return t.data=n,t}function c(e){const t={};return t.name=e.getAttribute("name"),t.displaycolor=e.getAttribute("displaycolor"),t.displaypropertiesid=e.getAttribute("displaypropertiesid"),t}function u(e){const t={};t.objectId=e.getAttribute("objectid");const r=e.getAttribute("transform");return r&&(t.transform=h(r)),t}function h(e){const t=[];e.split(" ").forEach((function(e){t.push(parseFloat(e))}));const r=new n.Matrix4;return r.set(t[0],t[3],t[6],t[9],t[1],t[4],t[7],t[10],t[2],t[5],t[8],t[11],0,0,0,1),r}function d(e){const t={type:e.getAttribute("type")},r=e.getAttribute("id");r&&(t.id=r);const n=e.getAttribute("pid");n&&(t.pid=n);const i=e.getAttribute("pindex");i&&(t.pindex=i);const a=e.getAttribute("thumbnail");a&&(t.thumbnail=a);const s=e.getAttribute("partnumber");s&&(t.partnumber=s);const o=e.getAttribute("name");o&&(t.name=o);const l=e.querySelector("mesh");l&&(t.mesh=function(e){const t={},r=[],n=e.querySelectorAll("vertices vertex");for(let o=0;o<n.length;o++){const e=n[o],t=e.getAttribute("x"),i=e.getAttribute("y"),a=e.getAttribute("z");r.push(parseFloat(t),parseFloat(i),parseFloat(a))}t.vertices=new Float32Array(r);const i=[],a=[],s=e.querySelectorAll("triangles triangle");for(let o=0;o<s.length;o++){const e=s[o],t=e.getAttribute("v1"),r=e.getAttribute("v2"),n=e.getAttribute("v3"),l=e.getAttribute("p1"),c=e.getAttribute("p2"),u=e.getAttribute("p3"),h=e.getAttribute("pid"),d={};d.v1=parseInt(t,10),d.v2=parseInt(r,10),d.v3=parseInt(n,10),a.push(d.v1,d.v2,d.v3),l&&(d.p1=parseInt(l,10)),c&&(d.p2=parseInt(c,10)),u&&(d.p3=parseInt(u,10)),h&&(d.pid=h),0<Object.keys(d).length&&i.push(d)}return t.triangleProperties=i,t.triangles=new Uint32Array(a),t}(l));const c=e.querySelector("components");return c&&(t.components=function(e){const t=[],r=e.querySelectorAll("component");for(let n=0;n<r.length;n++){const e=u(r[n]);t.push(e)}return t}(c)),t}function p(e){const t={unit:e.getAttribute("unit")||"millimeter"},r=e.querySelectorAll("metadata");r&&(t.metadata=function(e){const t={};for(let r=0;r<e.length;r++){const n=e[r],i=n.getAttribute("name");0<=["Title","Designer","Description","Copyright","LicenseTerms","Rating","CreationDate","ModificationDate"].indexOf(i)&&(t[i]=n.textContent)}return t}(r));const n=e.querySelector("resources");n&&(t.resources=function(e){const t={basematerials:{}},r=e.querySelectorAll("basematerials");for(let s=0;s<r.length;s++){const e=a(r[s]);t.basematerials[e.id]=e}t.texture2d={};const n=e.querySelectorAll("texture2d");for(let a=0;a<n.length;a++){const e={id:(i=n[a]).getAttribute("id"),path:i.getAttribute("path"),contenttype:i.getAttribute("contenttype"),tilestyleu:i.getAttribute("tilestyleu"),tilestylev:i.getAttribute("tilestylev"),filter:i.getAttribute("filter")};t.texture2d[e.id]=e}var i;t.colorgroup={};const c=e.querySelectorAll("colorgroup");for(let a=0;a<c.length;a++){const e=o(c[a]);t.colorgroup[e.id]=e}t.pbmetallicdisplayproperties={};const u=e.querySelectorAll("pbmetallicdisplayproperties");for(let a=0;a<u.length;a++){const e=l(u[a]);t.pbmetallicdisplayproperties[e.id]=e}t.texture2dgroup={};const h=e.querySelectorAll("texture2dgroup");for(let a=0;a<h.length;a++){const e=s(h[a]);t.texture2dgroup[e.id]=e}t.object={};const p=e.querySelectorAll("object");for(let a=0;a<p.length;a++){const e=d(p[a]);t.object[e.id]=e}return t}(n));const i=e.querySelector("build");return i&&(t.build=function(e){const t=[],r=e.querySelectorAll("item");for(let n=0;n<r.length;n++){const e=r[n],i={objectId:e.getAttribute("objectid")},a=e.getAttribute("transform");a&&(i.transform=h(a)),t.push(i)}return t}(i)),t}function f(e,t,i,a){const s=e.texid,o=i.resources.texture2d[s];if(o){const e=a[o.path],t=o.contenttype,i=new Blob([e],{type:t}),s=URL.createObjectURL(i),l=r.load(s,(function(){URL.revokeObjectURL(s)}));switch("colorSpace"in l?l.colorSpace="srgb":l.encoding=3001,o.tilestyleu){case"wrap":default:l.wrapS=n.RepeatWrapping;break;case"mirror":l.wrapS=n.MirroredRepeatWrapping;break;case"none":case"clamp":l.wrapS=n.ClampToEdgeWrapping}switch(o.tilestylev){case"wrap":default:l.wrapT=n.RepeatWrapping;break;case"mirror":l.wrapT=n.MirroredRepeatWrapping;break;case"none":case"clamp":l.wrapT=n.ClampToEdgeWrapping}switch(o.filter){case"auto":default:l.magFilter=n.LinearFilter,l.minFilter=n.LinearMipmapLinearFilter;break;case"linear":l.magFilter=n.LinearFilter,l.minFilter=n.LinearFilter;break;case"nearest":l.magFilter=n.NearestFilter,l.minFilter=n.NearestFilter}return l}return null}function m(e,t,r,i,a,s,o){const l=o.pindex,c={};for(let n=0,d=t.length;n<d;n++){const e=t[n],r=void 0!==e.p1?e.p1:l;void 0===c[r]&&(c[r]=[]),c[r].push(e)}const u=Object.keys(c),h=[];for(let d=0,p=u.length;d<p;d++){const t=u[d],l=c[t],p=b(e.basematerials[t],i,a,s,o,w),f=new n.BufferGeometry,m=[],g=r.vertices;for(let e=0,r=l.length;e<r;e++){const t=l[e];m.push(g[3*t.v1+0]),m.push(g[3*t.v1+1]),m.push(g[3*t.v1+2]),m.push(g[3*t.v2+0]),m.push(g[3*t.v2+1]),m.push(g[3*t.v2+2]),m.push(g[3*t.v3+0]),m.push(g[3*t.v3+1]),m.push(g[3*t.v3+2])}f.setAttribute("position",new n.Float32BufferAttribute(m,3));const v=new n.Mesh(f,p);h.push(v)}return h}function g(e,t,r,i,a,s,o){const l=new n.BufferGeometry,c=[],u=[],h=r.vertices,d=e.uvs;for(let n=0,f=t.length;n<f;n++){const e=t[n];c.push(h[3*e.v1+0]),c.push(h[3*e.v1+1]),c.push(h[3*e.v1+2]),c.push(h[3*e.v2+0]),c.push(h[3*e.v2+1]),c.push(h[3*e.v2+2]),c.push(h[3*e.v3+0]),c.push(h[3*e.v3+1]),c.push(h[3*e.v3+2]),u.push(d[2*e.p1+0]),u.push(d[2*e.p1+1]),u.push(d[2*e.p2+0]),u.push(d[2*e.p2+1]),u.push(d[2*e.p3+0]),u.push(d[2*e.p3+1])}l.setAttribute("position",new n.Float32BufferAttribute(c,3)),l.setAttribute("uv",new n.Float32BufferAttribute(u,2));const p=b(e,i,a,s,o,f),m=new n.MeshPhongMaterial({map:p,flatShading:!0});return new n.Mesh(l,m)}function v(e,t,r,i,a,s){const o=new n.BufferGeometry,l=[],c=[],u=r.vertices,h=e.colors;for(let n=0,p=t.length;n<p;n++){const e=t[n],r=e.v1,i=e.v2,a=e.v3;l.push(u[3*r+0]),l.push(u[3*r+1]),l.push(u[3*r+2]),l.push(u[3*i+0]),l.push(u[3*i+1]),l.push(u[3*i+2]),l.push(u[3*a+0]),l.push(u[3*a+1]),l.push(u[3*a+2]);const o=void 0!==e.p1?e.p1:s.pindex,d=void 0!==e.p2?e.p2:o,p=void 0!==e.p3?e.p3:o;c.push(h[3*o+0]),c.push(h[3*o+1]),c.push(h[3*o+2]),c.push(h[3*d+0]),c.push(h[3*d+1]),c.push(h[3*d+2]),c.push(h[3*p+0]),c.push(h[3*p+1]),c.push(h[3*p+2])}o.setAttribute("position",new n.Float32BufferAttribute(l,3)),o.setAttribute("color",new n.Float32BufferAttribute(c,3));const d=new n.MeshPhongMaterial({vertexColors:!0,flatShading:!0});return new n.Mesh(o,d)}function A(e){const t=new n.BufferGeometry;t.setIndex(new n.BufferAttribute(e.triangles,1)),t.setAttribute("position",new n.BufferAttribute(e.vertices,3));const r=new n.MeshPhongMaterial({color:11184895,flatShading:!0});return new n.Mesh(t,r)}function y(e,t){return void 0!==t.resources.texture2dgroup[e]?"texture":void 0!==t.resources.basematerials[e]?"material":void 0!==t.resources.colorgroup[e]?"vertexColors":"default"===e?"default":void 0}function x(e,t,r,i,a){const s=new n.Group,o=function(e,t,r){const n={},i=t.triangleProperties,a=r.pid;for(let s=0,o=i.length;s<o;s++){const e=i[s];let t=void 0!==e.pid?e.pid:a;void 0===t&&(t="default"),void 0===n[t]&&(n[t]=[]),n[t].push(e)}return n}(0,e,a),l=function(e,t,r,n,i,a){const s=Object.keys(e),o=[];for(let l=0,c=s.length;l<c;l++){const c=s[l],u=e[c];switch(y(c,n)){case"material":const e=m(n.resources.basematerials[c],u,t,r,n,i,a);for(let t=0,r=e.length;t<r;t++)o.push(e[t]);break;case"texture":const s=n.resources.texture2dgroup[c];o.push(g(s,u,t,r,n,i,a));break;case"vertexColors":const l=n.resources.colorgroup[c];o.push(v(l,u,t,0,0,a));break;case"default":o.push(A(t));break;default:console.error("THREE.3MFLoader: Unsupported resource type.")}}return o}(o,e,t,r,i,a);for(let n=0,c=l.length;n<c;n++)s.add(l[n]);return s}function b(e,t,r,n,i,a){return void 0!==e.build||(e.build=a(e,t,r,n,i)),e.build}function w(e,t,r){let i;const a=e.displaypropertiesid,s=r.resources.pbmetallicdisplayproperties;if(null!==a&&void 0!==s[a]){const t=s[a].data[e.index];i=new n.MeshStandardMaterial({flatShading:!0,roughness:t.roughness,metalness:t.metallicness})}else i=new n.MeshPhongMaterial({flatShading:!0});i.name=e.name;const o=e.displaycolor,l=o.substring(0,7);return i.color.setStyle(l),i.color.convertSRGBToLinear(),9===o.length&&(i.opacity=parseInt(o.charAt(7)+o.charAt(8),16)/255),i}function E(e,t,r,i){const a=new n.Group;for(let n=0;n<e.length;n++){const s=e[n];let o=t[s.objectId];void 0===o&&(S(s.objectId,t,r,i),o=t[s.objectId]);const l=o.clone(),c=s.transform;c&&l.applyMatrix4(c),a.add(l)}return a}function S(e,r,n,i){const a=n.resources.object[e];if(a.mesh){const e=a.mesh;!function(e,r,n){if(!e)return;const i=[],a=Object.keys(e);for(let s=0;s<a.length;s++){const e=a[s];for(let r=0;r<t.availableExtensions.length;r++){const n=t.availableExtensions[r];n.ns===e&&i.push(n)}}for(let t=0;t<i.length;t++){const a=i[t];a.apply(n,e[a.ns],r)}}(n.extensions,e,n.xml),r[a.id]=b(e,r,n,i,a,x)}else{const e=a.components;r[a.id]=b(e,r,n,i,a,E)}}const M=function(e){let t,r,a=null,s=null;const o=[],l=[],c=[],u=[];let h;const d={},f={};try{a=(0,Lt.GZ)(new Uint8Array(e))}catch(v){if(v instanceof ReferenceError)return console.error("THREE.3MFLoader: fflate missing and file is compressed."),null}for(s in a)s.match(/\_rels\/.rels$/)?t=s:s.match(/3D\/_rels\/.*\.model\.rels$/)?r=s:s.match(/^3D\/.*\.model$/)?o.push(s):s.match(/^3D\/Metadata\/.*\.xml$/)?l.push(s):s.match(/^3D\/Textures?\/.*/)?c.push(s):s.match(/^3D\/Other\/.*/)&&u.push(s);const m=a[t],g=i(n.LoaderUtils.decodeText(m));if(r){const e=a[r];h=i(n.LoaderUtils.decodeText(e))}for(let i=0;i<o.length;i++){const e=o[i],t=a[e],r=n.LoaderUtils.decodeText(t),s=(new DOMParser).parseFromString(r,"application/xml");"model"!==s.documentElement.nodeName.toLowerCase()&&console.error("THREE.3MFLoader: Error loading 3MF - no 3MF document found: ",e);const l=s.querySelector("model"),c={};for(let n=0;n<l.attributes.length;n++){const e=l.attributes[n];e.name.match(/^xmlns:(.+)$/)&&(c[e.value]=RegExp.$1)}const u=p(l);u.xml=l,0<Object.keys(c).length&&(u.extensions=c),d[e]=u}for(let n=0;n<c.length;n++){const e=c[n];f[e]=a[e].buffer}return{rels:g,modelRels:h,model:d,printTicket:{},texture:f,other:{}}}(e);return function(e,t){const r=new n.Group,i=function(e){for(let t=0;t<e.length;t++){const r=e[t];if("model"===r.target.split(".").pop().toLowerCase())return r}}(t.rels),a=t.model[i.target.substring(1)].build;for(let n=0;n<a.length;n++){const t=a[n],i=e[t.objectId],s=t.transform;s&&i.applyMatrix4(s),r.add(i)}return r}(function(e){const t=e.model,r=e.modelRels,n={},i=Object.keys(t),a={};if(r)for(let s=0,o=r.length;s<o;s++){const t=r[s],n=t.target.substring(1);e.texture[n]&&(a[t.target]=e.texture[n])}for(let s=0;s<i.length;s++){const e=t[i[s]],r=Object.keys(e.resources.object);for(let t=0;t<r.length;t++){S(r[t],n,e,a)}}return n}(M),M)}addExtension(e){this.availableExtensions.push(e)}}class Zp extends n.Loader{load(e,t,r,i){const a=this,s=new n.FileLoader(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){const t=e.split("\n"),r=[],i=[];for(let n of t){if(n=n.trim(),"#"===n.charAt(0))continue;const e=n.split(/\s+/);3===e.length&&(r.push(parseFloat(e[0])),r.push(parseFloat(e[1])),r.push(parseFloat(e[2]))),6===e.length&&(r.push(parseFloat(e[0])),r.push(parseFloat(e[1])),r.push(parseFloat(e[2])),i.push(parseFloat(e[3])/255),i.push(parseFloat(e[4])/255),i.push(parseFloat(e[5])/255))}const a=new n.BufferGeometry;return a.setAttribute("position",new n.Float32BufferAttribute(r,3)),i.length>0&&a.setAttribute("color",new n.Float32BufferAttribute(i,3)),a}}class $p extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=this,s=new n.FileLoader(a.manager);s.setPath(a.path),s.setResponseType("arraybuffer"),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){function t(e,t){const r=e.length,n=new Float32Array(r+t.length);return n.set(e),n.set(t,r),n}var r=n.LoaderUtils.decodeText(new Uint8Array(e,0,250)).split("\n");return-1!==r[0].indexOf("xml")?function(e){function r(e){var t,r,n,i,a,s,o="undefined"!=typeof Uint8Array?Uint8Array:Array,l=[],c=[],u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=u.length;for(t=0;t<h;t++)l[t]=u[t];for(t=0;t<h;++t)c[u.charCodeAt(t)]=t;if(c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63,(h=e.length)%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=new o(3*h/4-(a="="===e[h-2]?2:"="===e[h-1]?1:0)),n=a>0?h-4:h;var d=0;for(t=0,r=0;t<n;t+=4,r+=3)i=c[e.charCodeAt(t)]<<18|c[e.charCodeAt(t+1)]<<12|c[e.charCodeAt(t+2)]<<6|c[e.charCodeAt(t+3)],s[d++]=(16711680&i)>>16,s[d++]=(65280&i)>>8,s[d++]=255&i;return 2===a?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,s[d++]=255&i):1===a&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,s[d++]=i>>8&255,s[d++]=255&i),s}function i(e,n){var i,a,o,l,c=0;if("UInt64"===s.attributes.header_type?c=8:"UInt32"===s.attributes.header_type&&(c=4),"binary"===e.attributes.format&&n){var u,h,d,p,f,m;if("Float32"===e.attributes.type)var g=new Float32Array;else"Int64"===e.attributes.type&&(g=new Int32Array);h=(u=r(e["#text"]))[0];for(var v=1;v<c-1;v++)h|=u[v]<<v*c;for(p=(h+3)*c,m=p+=p%3>0?3-p%3:0,(f=[]).push(m),d=3*c,v=0;v<h;v++){for(var A=u[v*c+d],y=1;y<c-1;y++)A|=u[v*c+d+y]<<8*y;m+=A,f.push(m)}for(v=0;v<f.length-1;v++)x=(0,Lt.HT)(u.slice(f[v],f[v+1])).buffer,"Float32"===e.attributes.type?g=t(g,x=new Float32Array(x)):"Int64"===e.attributes.type&&(a=x=new Int32Array(x),o=void 0,l=void 0,o=(i=g).length,(l=new Int32Array(o+a.length)).set(i),l.set(a,o),g=l);delete e["#text"],"Int64"===e.attributes.type&&"binary"===e.attributes.format&&(g=g.filter((function(e,t){if(t%2!=1)return!0})))}else{if("binary"!==e.attributes.format||n)if(e["#text"])var x=e["#text"].split(/\s+/).filter((function(e){if(""!==e)return e}));else x=new Int32Array(0).buffer;else x=(x=r(e["#text"])).slice(c).buffer;delete e["#text"],"Float32"===e.attributes.type?g=new Float32Array(x):"Int32"===e.attributes.type?g=new Int32Array(x):"Int64"===e.attributes.type&&(g=new Int32Array(x),"binary"===e.attributes.format&&(g=g.filter((function(e,t){if(t%2!=1)return!0}))))}return g}var a=null;if(window.DOMParser)try{a=(new DOMParser).parseFromString(e,"text/xml")}catch(k){a=null}else{if(!window.ActiveXObject)throw new Error("Cannot parse xml string!");try{if((a=new ActiveXObject("Microsoft.XMLDOM")).async=!1,!a.loadXML())throw new Error(a.parseError.reason+a.parseError.srcText)}catch(k){a=null}}var s=function e(t){var r={};if(1===t.nodeType){if(t.attributes&&t.attributes.length>0){r.attributes={};for(var n=0;n<t.attributes.length;n++){var i=t.attributes.item(n);r.attributes[i.nodeName]=i.nodeValue.trim()}}}else 3===t.nodeType&&(r=t.nodeValue.trim());if(t.hasChildNodes())for(var a=0;a<t.childNodes.length;a++){var s=t.childNodes.item(a),o=s.nodeName;if(void 0===r[o])""!==(c=e(s))&&(r[o]=c);else{if(void 0===r[o].push){var l=r[o];r[o]=[l]}var c;""!==(c=e(s))&&r[o].push(c)}}return r}(a.documentElement),o=[],l=[],c=[];if(s.PolyData){for(var u=s.PolyData.Piece,h=s.attributes.hasOwnProperty("compressor"),d=["PointData","Points","Strips","Polys"],p=0,f=d.length;p<f;){var m=u[d[p]];if(m&&m.DataArray){if("[object Array]"===Object.prototype.toString.call(m.DataArray))var g=m.DataArray;else g=[m.DataArray];for(var v=0,A=g.length;v<A;)"#text"in g[v]&&g[v]["#text"].length>0&&(g[v].text=i(g[v],h)),v++;switch(d[p]){case"PointData":var y=parseInt(u.attributes.NumberOfPoints),x=m.attributes.Normals;if(y>0)for(var b=0,w=g.length;b<w;b++)if(x===g[b].attributes.Name){var E=g[b].attributes.NumberOfComponents;(l=new Float32Array(y*E)).set(g[b].text,0)}break;case"Points":(y=parseInt(u.attributes.NumberOfPoints))>0&&(E=m.DataArray.attributes.NumberOfComponents,(o=new Float32Array(y*E)).set(m.DataArray.text,0));break;case"Strips":var S=parseInt(u.attributes.NumberOfStrips);if(S>0){var M=new Int32Array(m.DataArray[0].text.length),_=new Int32Array(m.DataArray[1].text.length);M.set(m.DataArray[0].text,0),_.set(m.DataArray[1].text,0);var T=S+M.length;c=new Uint32Array(3*T-9*S);var C=0;for(b=0,w=S;b<w;b++){for(var I=[],B=0,R=_[b],P=0;B<R-P;B++)I.push(M[B]),b>0&&(P=_[b-1]);var F=0;for(R=_[b],P=0;F<R-P-2;F++)F%2?(c[C++]=I[F],c[C++]=I[F+2],c[C++]=I[F+1]):(c[C++]=I[F],c[C++]=I[F+1],c[C++]=I[F+2]),b>0&&(P=_[b-1])}}break;case"Polys":var L=parseInt(u.attributes.NumberOfPolys);if(L>0){M=new Int32Array(m.DataArray[0].text.length),_=new Int32Array(m.DataArray[1].text.length),M.set(m.DataArray[0].text,0),_.set(m.DataArray[1].text,0),T=L+M.length,c=new Uint32Array(3*T-9*L),C=0;var D=0;for(b=0,w=L,P=0;b<w;){var U=[];for(B=0,R=_[b];B<R-P;)U.push(M[D++]),B++;for(F=1;F<R-P-1;)c[C++]=U[0],c[C++]=U[F],c[C++]=U[F+1],F++;P=_[++b-1]}}}}p++}var N=new n.BufferGeometry;return N.setIndex(new n.BufferAttribute(c,1)),N.setAttribute("position",new n.BufferAttribute(o,3)),l.length===o.length&&N.setAttribute("normal",new n.BufferAttribute(l,3)),N}throw new Error("Unsupported DATASET type")}(n.LoaderUtils.decodeText(e)):r[2].includes("ASCII")?function(e){var t,r=[],i=[],a=[],s=[],o=/^[^\d.\s-]+/,l=/(\-?\d+\.?[\d\-\+e]*)\s+(\-?\d+\.?[\d\-\+e]*)\s+(\-?\d+\.?[\d\-\+e]*)/g,c=/^(\d+)\s+([\s\d]*)/,u=/^POINTS /,h=/^POLYGONS /,d=/^TRIANGLE_STRIPS /,p=/^POINT_DATA[ ]+(\d+)/,f=/^CELL_DATA[ ]+(\d+)/,m=/^COLOR_SCALARS[ ]+(\w+)[ ]+3/,g=/^NORMALS[ ]+(\w+)[ ]+(\w+)/,v=!1,A=!1,y=!1,x=!1,b=!1,w=!1,E=!1,S=e.split("\n");for(var M in S){var _=S[M].trim();if(0===_.indexOf("DATASET")){var T=_.split(" ")[1];if("POLYDATA"!==T)throw new Error("Unsupported DATASET type: "+T)}else if(v)for(;null!==(t=l.exec(_))&&null===o.exec(_);){var C=parseFloat(t[1]),I=parseFloat(t[2]),B=parseFloat(t[3]);i.push(C,I,B)}else if(A){if(null!==(t=c.exec(_))){var R=parseInt(t[1]),P=t[2].split(/\s+/);if(R>=3)for(var F=parseInt(P[0]),L=1,D=0;D<R-2;++D)U=parseInt(P[L]),N=parseInt(P[L+1]),r.push(F,U,N),L++}}else if(y){if(null!==(t=c.exec(_))){var U,N;if(R=parseInt(t[1]),P=t[2].split(/\s+/),R>=3)for(D=0;D<R-2;D++)D%2==1?(F=parseInt(P[D]),U=parseInt(P[D+2]),N=parseInt(P[D+1]),r.push(F,U,N)):(F=parseInt(P[D]),U=parseInt(P[D+1]),N=parseInt(P[D+2]),r.push(F,U,N))}}else if(x||b)if(w)for(;null!==(t=l.exec(_))&&null===o.exec(_);){var k=parseFloat(t[1]),O=parseFloat(t[2]),G=parseFloat(t[3]);a.push(k,O,G)}else if(E)for(;null!==(t=l.exec(_))&&null===o.exec(_);){var z=parseFloat(t[1]),V=parseFloat(t[2]),H=parseFloat(t[3]);s.push(z,V,H)}null!==h.exec(_)?(A=!0,v=!1,y=!1):null!==u.exec(_)?(A=!1,v=!0,y=!1):null!==d.exec(_)?(A=!1,v=!1,y=!0):null!==p.exec(_)?(x=!0,v=!1,A=!1,y=!1):null!==f.exec(_)?(b=!0,v=!1,A=!1,y=!1):null!==m.exec(_)?(w=!0,E=!1,v=!1,A=!1,y=!1):null!==g.exec(_)&&(E=!0,w=!1,v=!1,A=!1,y=!1)}var Q=new n.BufferGeometry;if(Q.setIndex(r),Q.setAttribute("position",new n.Float32BufferAttribute(i,3)),s.length===i.length&&Q.setAttribute("normal",new n.Float32BufferAttribute(s,3)),a.length!==r.length)a.length===i.length&&Q.setAttribute("color",new n.Float32BufferAttribute(a,3));else{var j=(Q=Q.toNonIndexed()).attributes.position.count/3;if(a.length===3*j){var W=[];for(M=0;M<j;M++)k=a[3*M+0],O=a[3*M+1],G=a[3*M+2],W.push(k,O,G),W.push(k,O,G),W.push(k,O,G);Q.setAttribute("color",new n.Float32BufferAttribute(W,3))}}return Q}(n.LoaderUtils.decodeText(e)):function(e){var t,r,i,a,s,o,l,c=new Uint8Array(e),u=new DataView(e),h=[],d=[],p=[],f=[],m=0;function g(e,t){for(var r=t,n=e[r],i=[];10!==n;)i.push(String.fromCharCode(n)),n=e[++r];return{start:t,end:r,next:r+1,parsedString:i.join("")}}for(;;){if(0===(l=(o=g(c,m)).parsedString).indexOf("DATASET")){var v=l.split(" ")[1];if("POLYDATA"!==v)throw new Error("Unsupported DATASET type: "+v)}else if(0===l.indexOf("POINTS")){for(f.push(l),t=4*(a=parseInt(l.split(" ")[1],10))*3,h=new Float32Array(3*a),r=o.next,i=0;i<a;i++)h[3*i]=u.getFloat32(r,!1),h[3*i+1]=u.getFloat32(r+4,!1),h[3*i+2]=u.getFloat32(r+8,!1),r+=12;o.next=o.next+t+1}else if(0===l.indexOf("TRIANGLE_STRIPS")){var A=parseInt(l.split(" ")[1],10);t=4*(E=parseInt(l.split(" ")[2],10)),p=new Uint32Array(3*E-9*A);var y=0;for(r=o.next,i=0;i<A;i++){var x=u.getInt32(r,!1),b=[];for(r+=4,s=0;s<x;s++)b.push(u.getInt32(r,!1)),r+=4;for(var w=0;w<x-2;w++)w%2?(p[y++]=b[w],p[y++]=b[w+2],p[y++]=b[w+1]):(p[y++]=b[w],p[y++]=b[w+1],p[y++]=b[w+2])}o.next=o.next+t+1}else if(0===l.indexOf("POLYGONS")){var E;for(A=parseInt(l.split(" ")[1],10),t=4*(E=parseInt(l.split(" ")[2],10)),p=new Uint32Array(3*E-9*A),y=0,r=o.next,i=0;i<A;i++){for(x=u.getInt32(r,!1),b=[],r+=4,s=0;s<x;s++)b.push(u.getInt32(r,!1)),r+=4;for(w=1;w<x-1;w++)p[y++]=b[0],p[y++]=b[w],p[y++]=b[w+1]}o.next=o.next+t+1}else if(0===l.indexOf("POINT_DATA")){for(a=parseInt(l.split(" ")[1],10),o=g(c,o.next),t=4*a*3,d=new Float32Array(3*a),r=o.next,i=0;i<a;i++)d[3*i]=u.getFloat32(r,!1),d[3*i+1]=u.getFloat32(r+4,!1),d[3*i+2]=u.getFloat32(r+8,!1),r+=12;o.next=o.next+t}if((m=o.next)>=c.byteLength)break}var S=new n.BufferGeometry;return S.setIndex(new n.BufferAttribute(p,1)),S.setAttribute("position",new n.BufferAttribute(h,3)),d.length===h.length&&S.setAttribute("normal",new n.BufferAttribute(d,3)),S}(e)}}class ef extends n.Loader{load(e,t,r,i){const a=new n.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("text"),a.load(e,(r=>{try{t(this.parse(r))}catch(n){i?i(n):console.error(n),this.manager.itemError(e)}}),r,i)}parse(e){const t=(e=e.replace(/^#.*?(\n|\r)/gm,"").replace(/^\s*?(\n|\r)/gm,"").trim()).split(/[\n\r]+/g),r=t[0].trim().split(/\s+/g).map((e=>parseFloat(e))),i=r[1]-r[0],a=r.length;for(let n=1,f=r.length;n<f;n++)if(i!==r[n]-r[n-1])throw new Error("LUT3dlLoader: Inconsistent grid size not supported.");const s=new Array(a*a*a*4);let o=0,l=0;for(let n=1,f=t.length;n<f;n++){const e=t[n].trim().split(/\s/g),r=parseFloat(e[0]),i=parseFloat(e[1]),c=parseFloat(e[2]);l=Math.max(l,r,i,c);const u=o%a*a*a+Math.floor(o/a)%a*a+Math.floor(o/(a*a))%a;s[4*u+0]=r,s[4*u+1]=i,s[4*u+2]=c,s[4*u+3]=1,o+=1}const c=Math.ceil(Math.log2(l)),u=Math.pow(2,c);for(let n=0,f=s.length;n<f;n+=4){const e=s[n+0],t=s[n+1],r=s[n+2];s[n+0]=255*e/u,s[n+1]=255*t/u,s[n+2]=255*r/u}const h=new Uint8Array(s),d=new n.DataTexture;d.image.data=h,d.image.width=a,d.image.height=a*a,d.format=n.RGBAFormat,d.type=n.UnsignedByteType,d.magFilter=n.LinearFilter,d.minFilter=n.LinearFilter,d.wrapS=n.ClampToEdgeWrapping,d.wrapT=n.ClampToEdgeWrapping,d.generateMipmaps=!1,d.needsUpdate=!0;const p=new Yl.J;return p.image.data=h,p.image.width=a,p.image.height=a,p.image.depth=a,p.format=n.RGBAFormat,p.type=n.UnsignedByteType,p.magFilter=n.LinearFilter,p.minFilter=n.LinearFilter,p.wrapS=n.ClampToEdgeWrapping,p.wrapT=n.ClampToEdgeWrapping,p.wrapR=n.ClampToEdgeWrapping,p.generateMipmaps=!1,p.needsUpdate=!0,{size:a,texture:d,texture3D:p}}}class tf extends n.CompressedTextureLoader{constructor(e){super(e)}parse(e,t){const r={mipmaps:[],width:0,height:0,format:null,mipmapCount:1};function i(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function a(e,t,r,n){const i=r*n*4,a=new Uint8Array(e,t,i),s=new Uint8Array(i);let o=0,l=0;for(let c=0;c<n;c++)for(let e=0;e<r;e++){const e=a[l];l++;const t=a[l];l++;const r=a[l];l++;const n=a[l];l++,s[o]=r,o++,s[o]=t,o++,s[o]=e,o++,s[o]=n,o++}return s}const s=i("DXT1"),o=i("DXT3"),l=i("DXT5"),c=i("ETC1"),u=new Int32Array(e,0,31);if(542327876!==u[0])return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),r;if(4&!u[20])return console.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."),r;let h;const d=u[21];let p=!1;switch(d){case s:h=8,r.format=n.RGB_S3TC_DXT1_Format;break;case o:h=16,r.format=n.RGBA_S3TC_DXT3_Format;break;case l:h=16,r.format=n.RGBA_S3TC_DXT5_Format;break;case c:h=8,r.format=n.RGB_ETC1_Format;break;default:if(!(32===u[22]&&16711680&u[23]&&65280&u[24]&&255&u[25]&&4278190080&u[26]))return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(d)),r;p=!0,h=64,r.format=n.RGBAFormat}r.mipmapCount=1,131072&u[2]&&!1!==t&&(r.mipmapCount=Math.max(1,u[7]));const f=u[28];if(r.isCubemap=!!(512&f),r.isCubemap&&(!(1024&f)||!(2048&f)||!(4096&f)||!(8192&f)||!(16384&f)||!(32768&f)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=u[4],r.height=u[3];let m=u[1]+4;const g=r.isCubemap?6:1;for(let n=0;n<g;n++){let t=r.width,n=r.height;for(let i=0;i<r.mipmapCount;i++){let i,s;p?(i=a(e,m,t,n),s=i.length):(s=Math.max(4,t)/4*Math.max(4,n)/4*h,i=new Uint8Array(e,m,s));const o={data:i,width:t,height:n};r.mipmaps.push(o),m+=s,t=Math.max(t>>1,1),n=Math.max(n>>1,1)}}return r}}class rf extends n.CompressedTextureLoader{constructor(e){super(e)}parse(e,t){const r=new Uint32Array(e,0,13),i={buffer:e,header:r,loadMipmaps:t};return 55727696===r[0]?function(e){const t=e.header;let r,i;const a=t[12],s=t[2],o=t[6],l=t[7],c=t[10],u=t[11];switch(s){case 0:r=2,i=n.RGB_PVRTC_2BPPV1_Format;break;case 1:r=2,i=n.RGBA_PVRTC_2BPPV1_Format;break;case 2:r=4,i=n.RGB_PVRTC_4BPPV1_Format;break;case 3:r=4,i=n.RGBA_PVRTC_4BPPV1_Format;break;default:console.error("THREE.PVRLoader: Unsupported PVR format:",s)}return e.dataPtr=52+a,e.bpp=r,e.format=i,e.width=l,e.height=o,e.numSurfaces=c,e.numMipmaps=u,e.isCubemap=6===c,nf(e)}(i):559044176===r[11]?function(e){const t=e.header,r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[10],c=t[12],u=24,h=255&o;let d,p;const f=l>0;25===h?(p=f?n.RGBA_PVRTC_4BPPV1_Format:n.RGB_PVRTC_4BPPV1_Format,d=4):h===u?(p=f?n.RGBA_PVRTC_2BPPV1_Format:n.RGB_PVRTC_2BPPV1_Format,d=2):console.error("THREE.PVRLoader: Unknown PVR format:",h);return e.dataPtr=r,e.bpp=d,e.format=p,e.width=a,e.height=i,e.numSurfaces=c,e.numMipmaps=s+1,e.isCubemap=6===c,nf(e)}(i):void console.error("THREE.PVRLoader: Unknown PVR format.")}}function nf(e){const t={mipmaps:[],width:e.width,height:e.height,format:e.format,mipmapCount:e.numMipmaps,isCubemap:e.isCubemap},r=e.buffer;let n=e.dataPtr,i=0,a=0,s=0,o=0,l=0,c=0;const u=e.bpp,h=e.numSurfaces;2===u?(s=8,o=4):(s=4,o=4),a=s*o*u/8,t.mipmaps.length=e.numMipmaps*h;let d=0;for(;d<e.numMipmaps;){const u=e.width>>d,p=e.height>>d;l=u/s,c=p/o,l<2&&(l=2),c<2&&(c=2),i=l*c*a;for(let a=0;a<h;a++){const s={data:new Uint8Array(r,n,i),width:u,height:p};t.mipmaps[a*e.numMipmaps+d]=s,n+=i}d++}return t}class af extends n.Loader{constructor(e){super(e),this.splitLayer=!1}load(e,t,r,i){const a=this,s=new n.FileLoader(a.manager);s.setPath(a.path),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){let t,r={x:0,y:0,z:0,e:0,f:0,extruding:!1,relative:!1},i=[];const a=new n.LineBasicMaterial({color:16711680});a.name="path";const s=new n.LineBasicMaterial({color:65280});function o(e){t={vertex:[],pathVertex:[],z:e.z},i.push(t)}function l(e,t){return r.relative?t:t-e}function c(e,t){return r.relative?e+t:t}s.name="extruded";let u=e.replace(/;.+/g,"").split("\n");for(let n=0;n<u.length;n++){let e=u[n].split(" "),i=e[0].toUpperCase(),a={};if(e.splice(1).forEach((function(e){if(void 0!==e[0]){let t=e[0].toLowerCase(),r=parseFloat(e.substring(1));a[t]=r}})),"G0"===i||"G1"===i){let e={x:void 0!==a.x?c(r.x,a.x):r.x,y:void 0!==a.y?c(r.y,a.y):r.y,z:void 0!==a.z?c(r.z,a.z):r.z,e:void 0!==a.e?c(r.e,a.e):r.e,f:void 0!==a.f?c(r.f,a.f):r.f};l(r.e,e.e)>0&&(e.extruding=l(r.e,e.e)>0,null!=t&&e.z==t.z||o(e)),h=r,d=e,void 0===t&&o(h),r.extruding?(t.vertex.push(h.x,h.y,h.z),t.vertex.push(d.x,d.y,d.z)):(t.pathVertex.push(h.x,h.y,h.z),t.pathVertex.push(d.x,d.y,d.z)),r=e}else if("G2"===i||"G3"===i);else if("G90"===i)r.relative=!1;else if("G91"===i)r.relative=!0;else if("G92"===i){let e=r;e.x=void 0!==a.x?a.x:e.x,e.y=void 0!==a.y?a.y:e.y,e.z=void 0!==a.z?a.z:e.z,e.e=void 0!==a.e?a.e:e.e,r=e}}var h,d;function p(e,t,r){let i=new n.BufferGeometry;i.setAttribute("position",new n.Float32BufferAttribute(e,3));let o=new n.LineSegments(i,t?s:a);o.name="layer"+r,f.add(o)}const f=new n.Group;if(f.name="gcode",this.splitLayer)for(let n=0;n<i.length;n++){let e=i[n];p(e.vertex,!0,n),p(e.pathVertex,!1,n)}else{const e=[],t=[];for(let r=0;r<i.length;r++){let n=i[r],a=n.vertex,s=n.pathVertex;for(let t=0;t<a.length;t++)e.push(a[t]);for(let e=0;e<s.length;e++)t.push(s[e])}p(e,!0,i.length),p(t,!1,i.length)}return f.quaternion.setFromEuler(new n.Euler(-Math.PI/2,0,0)),f}}var sf=Object.defineProperty,of=(e,t,r)=>(((e,t,r)=>{t in e?sf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const lf=new WeakMap,cf=class extends n.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.workerConfig=null}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerLimit=e,this}detectSupport(e){return this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}load(e,t,r,i){const a=new n.FileLoader(this.manager);a.setResponseType("arraybuffer"),a.setWithCredentials(this.withCredentials);const s=new n.CompressedTexture;return a.load(e,(e=>{if(lf.has(e)){return lf.get(e).promise.then(t).catch(i)}this._createTexture([e]).then((function(e){s.copy(e),s.needsUpdate=!0,t&&t(s)})).catch(i)}),r,i),s}parseInternalAsync(e){const{levels:t}=e,r=new Set;for(let n=0;n<t.length;n++)r.add(t[n].data.buffer);return this._createTexture(Array.from(r),{...e,lowLevel:!0})}_createTexture(e,t={}){let r,i;const a=t;let s=0;for(let n=0;n<e.length;n++)s+=e[n].byteLength;const o=this._allocateWorker(s).then((t=>(r=t,i=this.workerNextTaskID++,new Promise(((t,n)=>{r._callbacks[i]={resolve:t,reject:n},r.postMessage({type:"transcode",id:i,buffers:e,taskConfig:a},e)}))))).then((e=>{const{mipmaps:t,width:r,height:i,format:a}=e,s=new n.CompressedTexture(t,r,i,a,n.UnsignedByteType);return s.minFilter=1===t.length?n.LinearFilter:n.LinearMipmapLinearFilter,s.magFilter=n.LinearFilter,s.generateMipmaps=!1,s.needsUpdate=!0,s}));return o.catch((()=>!0)).then((()=>{r&&i&&(r._taskLoad-=s,delete r._callbacks[i])})),lf.set(e[0],{promise:o}),o}_initTranscoder(){if(!this.transcoderPending){const e=new n.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=new Promise(((t,r)=>{e.load("basis_transcoder.js",t,void 0,r)})),r=new n.FileLoader(this.manager);r.setPath(this.transcoderPath),r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials);const i=new Promise(((e,t)=>{r.load("basis_transcoder.wasm",e,void 0,t)}));this.transcoderPending=Promise.all([t,i]).then((([e,t])=>{const r=cf.BasisWorker.toString(),n=["/* constants */","let _EngineFormat = "+JSON.stringify(cf.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(cf.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(cf.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n])),this.transcoderBinary=t}))}return this.transcoderPending}_allocateWorker(e){return this._initTranscoder().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskLoad=0,e.postMessage({type:"init",config:this.workerConfig,transcoderBinary:this.transcoderBinary}),e.onmessage=function(t){const r=t.data;switch(r.type){case"transcode":e._callbacks[r.id].resolve(r);break;case"error":e._callbacks[r.id].reject(r);break;default:console.error('THREE.BasisTextureLoader: Unexpected message, "'+r.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const t=this.workerPool[this.workerPool.length-1];return t._taskLoad+=e,t}))}dispose(){for(let e=0;e<this.workerPool.length;e++)this.workerPool[e].terminate();return this.workerPool.length=0,this}};let uf=cf;of(uf,"BasisFormat",{ETC1S:0,UASTC_4x4:1}),of(uf,"TranscoderFormat",{ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16}),of(uf,"EngineFormat",{RGBAFormat:n.RGBAFormat,RGBA_ASTC_4x4_Format:n.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:n.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:n.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:n.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:n.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:n.RGB_ETC1_Format,RGB_ETC2_Format:n.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:n.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:n.RGB_S3TC_DXT1_Format}),of(uf,"BasisWorker",(function(){let e,t,r;const n=_EngineFormat,i=_TranscoderFormat,a=_BasisFormat;onmessage=function(n){const i=n.data;switch(i.type){case"init":e=i.config,s=i.transcoderBinary,t=new Promise((e=>{r={wasmBinary:s,onRuntimeInitialized:e},BASIS(r)})).then((()=>{r.initializeBasis()}));break;case"transcode":t.then((()=>{try{const{width:e,height:t,hasAlpha:n,mipmaps:s,format:o}=i.taskConfig.lowLevel?function(e){const{basisFormat:t,width:n,height:i,hasAlpha:s}=e,{transcoderFormat:o,engineFormat:l}=c(t,n,i,s),f=r.getBytesPerBlockOrPixel(o);u(r.isFormatSupported(o),"THREE.BasisTextureLoader: Unsupported format.");const m=[];if(t===a.ETC1S){const t=new r.LowLevelETC1SImageTranscoder,{endpointCount:n,endpointsData:i,selectorCount:a,selectorsData:l,tablesData:c}=e.globalData;try{let r;r=t.decodePalettes(n,i,a,l),u(r,"THREE.BasisTextureLoader: decodePalettes() failed."),r=t.decodeTables(c),u(r,"THREE.BasisTextureLoader: decodeTables() failed.");for(let n=0;n<e.levels.length;n++){const i=e.levels[n],a=e.globalData.imageDescs[n],l=p(o,i.width,i.height),c=new Uint8Array(l);r=t.transcodeImage(o,c,l/f,i.data,h(o,i.width),d(o,i.height),i.width,i.height,i.index,a.rgbSliceByteOffset,a.rgbSliceByteLength,a.alphaSliceByteOffset,a.alphaSliceByteLength,a.imageFlags,s,!1,0,0),u(r,"THREE.BasisTextureLoader: transcodeImage() failed for level "+i.index+"."),m.push({data:c,width:i.width,height:i.height})}}finally{t.delete()}}else for(let a=0;a<e.levels.length;a++){const t=e.levels[a],n=p(o,t.width,t.height),i=new Uint8Array(n);u(r.transcodeUASTCImage(o,i,n/f,t.data,h(o,t.width),d(o,t.height),t.width,t.height,t.index,0,t.data.byteLength,0,s,!1,0,0,-1,-1),"THREE.BasisTextureLoader: transcodeUASTCImage() failed for level "+t.index+"."),m.push({data:i,width:t.width,height:t.height})}return{width:n,height:i,hasAlpha:s,mipmaps:m,format:l}}(i.taskConfig):function(e){const t=new r.BasisFile(new Uint8Array(e)),n=t.isUASTC()?a.UASTC_4x4:a.ETC1S,i=t.getImageWidth(0,0),s=t.getImageHeight(0,0),o=t.getNumLevels(0),l=t.getHasAlpha();function u(){t.close(),t.delete()}const{transcoderFormat:h,engineFormat:d}=c(n,i,s,l);if(!i||!s||!o)throw u(),new Error("THREE.BasisTextureLoader:\tInvalid texture");if(!t.startTranscoding())throw u(),new Error("THREE.BasisTextureLoader: .startTranscoding failed");const p=[];for(let r=0;r<o;r++){const e=t.getImageWidth(0,r),n=t.getImageHeight(0,r),i=new Uint8Array(t.getImageTranscodedSizeInBytes(0,r,h));if(!t.transcodeImage(i,0,r,h,0,l))throw u(),new Error("THREE.BasisTextureLoader: .transcodeImage failed.");p.push({data:i,width:e,height:n})}return u(),{width:i,height:s,hasAlpha:l,mipmaps:p,format:d}}(i.buffers[0]),l=[];for(let r=0;r<s.length;++r)l.push(s[r].data.buffer);self.postMessage({type:"transcode",id:i.id,width:e,height:t,hasAlpha:n,mipmaps:s,format:o},l)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}}))}var s};const s=[{if:"astcSupported",basisFormat:[a.UASTC_4x4],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[i.BC1,i.BC3],engineFormat:[n.RGB_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC1],engineFormat:[n.RGB_ETC1_Format,n.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],o=s.sort((function(e,t){return e.priorityETC1S-t.priorityETC1S})),l=s.sort((function(e,t){return e.priorityUASTC-t.priorityUASTC}));function c(t,r,s,c){let u,h;const d=t===a.ETC1S?o:l;for(let n=0;n<d.length;n++){const i=d[n];if(e[i.if]&&(i.basisFormat.includes(t)&&(!i.needsPowerOfTwo||f(r)&&f(s))))return u=i.transcoderFormat[c?1:0],h=i.engineFormat[c?1:0],{transcoderFormat:u,engineFormat:h}}return console.warn("THREE.BasisTextureLoader: No suitable compressed texture format found. Decoding to RGBA32."),u=i.RGBA32,h=n.RGBAFormat,{transcoderFormat:u,engineFormat:h}}function u(e,t){if(!e)throw new Error(t)}function h(e,t){return Math.ceil(t/r.getFormatBlockWidth(e))}function d(e,t){return Math.ceil(t/r.getFormatBlockHeight(e))}function p(e,t,n){const a=r.getBytesPerBlockOrPixel(e);if(r.formatIsUncompressed(e))return t*n*a;if(e===i.PVRTC1_4_RGB||e===i.PVRTC1_4_RGBA){const e=t+3&-4,r=n+3&-4;return(Math.max(8,e)*Math.max(8,r)*4+7)/8}return h(e,t)*d(e,n)*a}function f(e){return e<=2||0==(e&e-1)&&0!==e}}));class hf extends n.Loader{constructor(e){super(e),this.debug=!1,this.group=null,this.position=0,this.materials=[],this.meshes=[]}load(e,t,r,i){const a=this,s=""===this.path?n.LoaderUtils.extractUrlBase(e):this.path,o=new n.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(r){try{t(a.parse(r,s))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e,t){this.group=new n.Group,this.position=0,this.materials=[],this.meshes=[],this.readFile(e,t);for(let r=0;r<this.meshes.length;r++)this.group.add(this.meshes[r]);return this.group}readFile(e,t){const r=new DataView(e),n=this.readChunk(r);if(n.id===pf||n.id===ff||n.id===df){let e=this.nextChunk(r,n);for(;0!==e;){if(e===mf){const e=this.readDWord(r);this.debugMessage("3DS file version: "+e)}else e===wf?(this.resetPosition(r),this.readMeshData(r,t)):this.debugMessage("Unknown main chunk: "+e.toString(16));e=this.nextChunk(r,n)}}this.debugMessage("Parsed "+this.meshes.length+" meshes")}readMeshData(e,t){const r=this.readChunk(e);let n=this.nextChunk(e,r);for(;0!==n;){if(n===Ef){const t=+this.readDWord(e);this.debugMessage("Mesh Version: "+t)}else if(n===Sf){const t=this.readFloat(e);this.debugMessage("Master scale: "+t),this.group.scale.set(t,t,t)}else n===jf?(this.debugMessage("Named Object"),this.resetPosition(e),this.readNamedObject(e)):n===Mf?(this.debugMessage("Material"),this.resetPosition(e),this.readMaterialEntry(e,t)):this.debugMessage("Unknown MDATA chunk: "+n.toString(16));n=this.nextChunk(e,r)}}readNamedObject(e){const t=this.readChunk(e),r=this.readString(e,64);t.cur=this.position;let n=this.nextChunk(e,t);for(;0!==n;){if(n===Wf){this.resetPosition(e);const t=this.readMesh(e);t.name=r,this.meshes.push(t)}else this.debugMessage("Unknown named object chunk: "+n.toString(16));n=this.nextChunk(e,t)}this.endChunk(t)}readMaterialEntry(e,t){const r=this.readChunk(e);let i=this.nextChunk(e,r);const a=new n.MeshPhongMaterial;for(;0!==i;){if(i===_f)a.name=this.readString(e,64),this.debugMessage(" Name: "+a.name);else if(i===Lf)this.debugMessage(" Wireframe"),a.wireframe=!0;else if(i===Df){const t=this.readByte(e);a.wireframeLinewidth=t,this.debugMessage(" Wireframe Thickness: "+t)}else if(i===Pf)a.side=n.DoubleSide,this.debugMessage(" DoubleSided");else if(i===Ff)this.debugMessage(" Additive Blending"),a.blending=n.AdditiveBlending;else if(i===Cf)this.debugMessage(" Diffuse Color"),a.color=this.readColor(e);else if(i===If)this.debugMessage(" Specular Color"),a.specular=this.readColor(e);else if(i===Tf)this.debugMessage(" Ambient color"),a.color=this.readColor(e);else if(i===Bf){const t=this.readPercentage(e);a.shininess=100*t,this.debugMessage(" Shininess : "+t)}else if(i===Rf){const t=this.readPercentage(e);a.opacity=1-t,this.debugMessage(" Transparency : "+t),a.transparent=a.opacity<1}else i===Uf?(this.debugMessage(" ColorMap"),this.resetPosition(e),a.map=this.readMap(e,t)):i===kf?(this.debugMessage(" BumpMap"),this.resetPosition(e),a.bumpMap=this.readMap(e,t)):i===Nf?(this.debugMessage(" OpacityMap"),this.resetPosition(e),a.alphaMap=this.readMap(e,t)):i===Of?(this.debugMessage(" SpecularMap"),this.resetPosition(e),a.specularMap=this.readMap(e,t)):this.debugMessage(" Unknown material chunk: "+i.toString(16));i=this.nextChunk(e,r)}this.endChunk(r),this.materials[a.name]=a}readMesh(e){const t=this.readChunk(e);let r=this.nextChunk(e,t);const i=new n.BufferGeometry,a=new n.MeshPhongMaterial,s=new n.Mesh(i,a);for(s.name="mesh";0!==r;){if(r===Xf){const t=this.readWord(e);this.debugMessage(" Vertex: "+t);const r=[];for(let n=0;n<t;n++)r.push(this.readFloat(e)),r.push(this.readFloat(e)),r.push(this.readFloat(e));i.setAttribute("position",new n.Float32BufferAttribute(r,3))}else if(r===Yf)this.resetPosition(e),this.readFaceArray(e,s);else if(r===Kf){const t=this.readWord(e);this.debugMessage(" UV: "+t);const r=[];for(let n=0;n<t;n++)r.push(this.readFloat(e)),r.push(this.readFloat(e));i.setAttribute("uv",new n.Float32BufferAttribute(r,2))}else if(r===Jf){this.debugMessage(" Tranformation Matrix (TODO)");const t=[];for(let n=0;n<12;n++)t[n]=this.readFloat(e);const r=new n.Matrix4;r.elements[0]=t[0],r.elements[1]=t[6],r.elements[2]=t[3],r.elements[3]=t[9],r.elements[4]=t[2],r.elements[5]=t[8],r.elements[6]=t[5],r.elements[7]=t[11],r.elements[8]=t[1],r.elements[9]=t[7],r.elements[10]=t[4],r.elements[11]=t[10],r.elements[12]=0,r.elements[13]=0,r.elements[14]=0,r.elements[15]=1,r.transpose();const a=new n.Matrix4;a.copy(r).invert(),i.applyMatrix4(a),r.decompose(s.position,s.quaternion,s.scale)}else this.debugMessage(" Unknown mesh chunk: "+r.toString(16));r=this.nextChunk(e,t)}return this.endChunk(t),i.computeVertexNormals(),s}readFaceArray(e,t){const r=this.readChunk(e),n=this.readWord(e);this.debugMessage(" Faces: "+n);const i=[];for(let o=0;o<n;++o)i.push(this.readWord(e),this.readWord(e),this.readWord(e)),this.readWord(e);t.geometry.setIndex(i);let a=0,s=0;for(;this.position<r.end;){const r=this.readChunk(e);if(r.id===qf){this.debugMessage(" Material Group"),this.resetPosition(e);const r=this.readMaterialGroup(e),n=3*r.index.length;t.geometry.addGroup(s,n,a),s+=n,a++;const i=this.materials[r.name];!1===Array.isArray(t.material)&&(t.material=[]),void 0!==i&&t.material.push(i)}else this.debugMessage(" Unknown face array chunk: "+r.toString(16));this.endChunk(r)}1===t.material.length&&(t.material=t.material[0]),this.endChunk(r)}readMap(e,t){const r=this.readChunk(e);let i=this.nextChunk(e,r),a={};const s=new n.TextureLoader(this.manager);for(s.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);0!==i;){if(i===Gf){const r=this.readString(e,128);a=s.load(r),this.debugMessage(" File: "+t+r)}else i===Hf?(a.offset.x=this.readFloat(e),this.debugMessage(" OffsetX: "+a.offset.x)):i===Qf?(a.offset.y=this.readFloat(e),this.debugMessage(" OffsetY: "+a.offset.y)):i===zf?(a.repeat.x=this.readFloat(e),this.debugMessage(" RepeatX: "+a.repeat.x)):i===Vf?(a.repeat.y=this.readFloat(e),this.debugMessage(" RepeatY: "+a.repeat.y)):this.debugMessage(" Unknown map chunk: "+i.toString(16));i=this.nextChunk(e,r)}return this.endChunk(r),a}readMaterialGroup(e){this.readChunk(e);const t=this.readString(e,64),r=this.readWord(e);this.debugMessage(" Name: "+t),this.debugMessage(" Faces: "+r);const n=[];for(let i=0;i<r;++i)n.push(this.readWord(e));return{name:t,index:n}}readColor(e){const t=this.readChunk(e),r=new n.Color;if(t.id===vf||t.id===Af){const t=this.readByte(e),n=this.readByte(e),i=this.readByte(e);r.setRGB(t/255,n/255,i/255),this.debugMessage(" Color: "+r.r+", "+r.g+", "+r.b)}else if(t.id===gf||t.id===yf){const t=this.readFloat(e),n=this.readFloat(e),i=this.readFloat(e);r.setRGB(t,n,i),this.debugMessage(" Color: "+r.r+", "+r.g+", "+r.b)}else this.debugMessage(" Unknown color chunk: "+t.toString(16));return this.endChunk(t),r}readChunk(e){const t={};return t.cur=this.position,t.id=this.readWord(e),t.size=this.readDWord(e),t.end=t.cur+t.size,t.cur+=6,t}endChunk(e){this.position=e.end}nextChunk(e,t){if(t.cur>=t.end)return 0;this.position=t.cur;try{const r=this.readChunk(e);return t.cur+=r.size,r.id}catch(r){return this.debugMessage("Unable to read chunk at "+this.position),0}}resetPosition(){this.position-=6}readByte(e){const t=e.getUint8(this.position,!0);return this.position+=1,t}readFloat(e){try{const t=e.getFloat32(this.position,!0);return this.position+=4,t}catch(t){this.debugMessage(t+" "+this.position+" "+e.byteLength)}}readInt(e){const t=e.getInt32(this.position,!0);return this.position+=4,t}readShort(e){const t=e.getInt16(this.position,!0);return this.position+=2,t}readDWord(e){const t=e.getUint32(this.position,!0);return this.position+=4,t}readWord(e){const t=e.getUint16(this.position,!0);return this.position+=2,t}readString(e,t){let r="";for(let n=0;n<t;n++){const t=this.readByte(e);if(!t)break;r+=String.fromCharCode(t)}return r}readPercentage(e){const t=this.readChunk(e);let r;switch(t.id){case xf:r=this.readShort(e)/100;break;case bf:r=this.readFloat(e);break;default:this.debugMessage(" Unknown percentage chunk: "+t.toString(16))}return this.endChunk(t),r}debugMessage(e){this.debug&&console.log(e)}}const df=19789,pf=15786,ff=49725,mf=2,gf=16,vf=17,Af=18,yf=19,xf=48,bf=49,wf=15677,Ef=15678,Sf=256,Mf=45055,_f=40960,Tf=40976,Cf=40992,If=41008,Bf=41024,Rf=41040,Pf=41089,Ff=41091,Lf=41093,Df=41095,Uf=41472,Nf=41488,kf=41520,Of=41476,Gf=41728,zf=41812,Vf=41814,Hf=41816,Qf=41818,jf=16384,Wf=16640,Xf=16656,Yf=16672,qf=16688,Kf=16704,Jf=16736,Zf="16",$f="24",em=new n.Vector3,tm=new n.Vector3;class rm extends n.ShaderMaterial{constructor(e){super({uniforms:n.UniformsUtils.merge([n.UniformsLib.fog,{diffuse:{value:new n.Color},opacity:{value:1}}]),vertexShader:"\n attribute vec3 control0;\n attribute vec3 control1;\n attribute vec3 direction;\n varying float discardFlag;\n\n #include <common>\n #include <color_pars_vertex>\n #include <fog_pars_vertex>\n #include <logdepthbuf_pars_vertex>\n #include <clipping_planes_pars_vertex>\n\n void main() {\n #include <color_vertex>\n\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n // Transform the line segment ends and control points into camera clip space\n vec4 c0 = projectionMatrix * modelViewMatrix * vec4(control0, 1.0);\n vec4 c1 = projectionMatrix * modelViewMatrix * vec4(control1, 1.0);\n vec4 p0 = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n vec4 p1 = projectionMatrix * modelViewMatrix * vec4(position + direction, 1.0);\n\n c0.xy /= c0.w;\n c1.xy /= c1.w;\n p0.xy /= p0.w;\n p1.xy /= p1.w;\n\n // Get the direction of the segment and an orthogonal vector\n vec2 dir = p1.xy - p0.xy;\n vec2 norm = vec2(-dir.y, dir.x);\n\n // Get control point directions from the line\n vec2 c0dir = c0.xy - p1.xy;\n vec2 c1dir = c1.xy - p1.xy;\n\n // If the vectors to the controls points are pointed in different directions away\n // from the line segment then the line should not be drawn.\n float d0 = dot(normalize(norm), normalize(c0dir));\n float d1 = dot(normalize(norm), normalize(c1dir));\n discardFlag = float(sign(d0) != sign(d1));\n\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n }\n ",fragmentShader:"\n uniform vec3 diffuse;\n uniform float opacity;\n varying float discardFlag;\n\n #include <common>\n #include <color_pars_fragment>\n #include <fog_pars_fragment>\n #include <logdepthbuf_pars_fragment>\n #include <clipping_planes_pars_fragment>\n\n void main() {\n if (discardFlag > 0.5) discard;\n\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3(0.0);\n vec4 diffuseColor = vec4(diffuse, opacity);\n #include <logdepthbuf_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb; // simple shader\n gl_FragColor = vec4(outgoingLight, diffuseColor.a);\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n }\n "}),Object.defineProperties(this,{opacity:{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},color:{get:function(){return this.uniforms.diffuse.value}}}),this.setValues(e),this.isLDrawConditionalLineMaterial=!0}}class nm extends n.LineSegments{constructor(e,t){super(e,t),this.isConditionalLine=!0}}const im=new n.Ray;function am(e){return"Part"===e||"Unofficial_Part"===e}class sm{constructor(e,t){this.line=e,this.lineLength=e.length,this.currentCharIndex=0,this.currentChar=" ",this.lineNumber=t}seekNonSpace(){for(;this.currentCharIndex<this.lineLength;){if(this.currentChar=this.line.charAt(this.currentCharIndex)," "!==this.currentChar&&"\t"!==this.currentChar)return;this.currentCharIndex++}}getToken(){const e=this.currentCharIndex++;for(;this.currentCharIndex<this.lineLength&&(this.currentChar=this.line.charAt(this.currentCharIndex)," "!==this.currentChar&&"\t"!==this.currentChar);)this.currentCharIndex++;const t=this.currentCharIndex;return this.seekNonSpace(),this.line.substring(e,t)}getVector(){return new n.Vector3(parseFloat(this.getToken()),parseFloat(this.getToken()),parseFloat(this.getToken()))}getRemainingString(){return this.line.substring(this.currentCharIndex,this.lineLength)}isAtTheEnd(){return this.currentCharIndex>=this.lineLength}setToEnd(){this.currentCharIndex=this.lineLength}getLineNumberString(){return this.lineNumber>=0?" at line "+this.lineNumber:""}}class om{constructor(e){this.loader=e,this._cache={}}cloneResult(e){const t={};return t.faces=e.faces.map((e=>({colorCode:e.colorCode,material:e.material,vertices:e.vertices.map((e=>e.clone())),normals:e.normals.map((()=>null)),faceNormal:null}))),t.conditionalSegments=e.conditionalSegments.map((e=>({colorCode:e.colorCode,material:e.material,vertices:e.vertices.map((e=>e.clone())),controlPoints:e.controlPoints.map((e=>e.clone()))}))),t.lineSegments=e.lineSegments.map((e=>({colorCode:e.colorCode,material:e.material,vertices:e.vertices.map((e=>e.clone()))}))),t.type=e.type,t.category=e.category,t.keywords=e.keywords,t.subobjects=e.subobjects,t.totalFaces=e.totalFaces,t.startingConstructionStep=e.startingConstructionStep,t.materials=e.materials,t.group=null,t}async fetchData(e){let t=!1,r=0;for(;6!==r;){let a=e;switch(r){case 0:r+=1;break;case 1:a="parts/"+a,r+=1;break;case 2:a="p/"+a,r+=1;break;case 3:a="models/"+a,r+=1;break;case 4:a=e.substring(0,e.lastIndexOf("/")+1)+a,r+=1;break;case 5:t?r=6:(a=e=e.toLowerCase(),t=!0,r=0)}const s=this.loader,o=new n.FileLoader(s.manager);o.setPath(s.partsLibraryPath),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials);try{return await o.loadAsync(a)}catch(i){continue}}throw new Error('LDrawLoader: Subobject "'+e+'" could not be loaded.')}parse(e,t=null){const r=this.loader,i=[],a=[],s=[],o=[],l={},c=e=>l[e]||null;let u="Model",h=null,d=null,p=0;-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n"));const f=e.split("\n"),m=f.length;let g=!1,v=null,A=null,y=!1,x=!0,b=!1,w=!0,E=!1;for(let S=0;S<m;S++){const e=f[S];if(0===e.length)continue;if(g){e.startsWith("0 FILE ")?(this.setData(v,A),v=e.substring(7),A=""):A+=e+"\n";continue}const t=new sm(e,S+1);if(t.seekNonSpace(),t.isAtTheEnd())continue;const m=t.getToken();let M,_,T,C,I,B,R,P,F,L,D;switch(m){case"0":const e=t.getToken();if(e)switch(e){case"!LDRAW_ORG":u=t.getToken();break;case"!COLOUR":M=r.parseColorMetaDirective(t),M?l[M.userData.code]=M:console.warn("LDrawLoader: Error parsing material"+t.getLineNumberString());break;case"!CATEGORY":h=t.getToken();break;case"!KEYWORDS":const e=t.getRemainingString().split(",");e.length>0&&(d||(d=[]),e.forEach((function(e){d.push(e.trim())})));break;case"FILE":S>0&&(g=!0,v=t.getRemainingString(),A="",y=!1,x=!0);break;case"BFC":for(;!t.isAtTheEnd();){const e=t.getToken();switch(e){case"CERTIFY":case"NOCERTIFY":y="CERTIFY"===e,x=!0;break;case"CW":case"CCW":x="CCW"===e;break;case"INVERTNEXT":b=!0;break;case"CLIP":case"NOCLIP":w="CLIP"===e;break;default:console.warn('THREE.LDrawLoader: BFC directive "'+e+'" is unknown.')}}break;case"STEP":E=!0}break;case"1":_=t.getToken(),M=c(_);const f=parseFloat(t.getToken()),U=parseFloat(t.getToken()),N=parseFloat(t.getToken()),k=parseFloat(t.getToken()),O=parseFloat(t.getToken()),G=parseFloat(t.getToken()),z=parseFloat(t.getToken()),V=parseFloat(t.getToken()),H=parseFloat(t.getToken()),Q=parseFloat(t.getToken()),j=parseFloat(t.getToken()),W=parseFloat(t.getToken()),X=(new n.Matrix4).set(k,O,G,f,z,V,H,U,Q,j,W,N,0,0,0,1);let Y=t.getRemainingString().trim().replace(/\\/g,"/");r.fileMap[Y]?Y=r.fileMap[Y]:Y.startsWith("s/")?Y="parts/"+Y:Y.startsWith("48/")&&(Y="p/"+Y),o.push({material:M,colorCode:_,matrix:X,fileName:Y,inverted:b,startingConstructionStep:E}),b=!1;break;case"2":_=t.getToken(),M=c(_),B=t.getVector(),R=t.getVector(),T={material:M,colorCode:_,vertices:[B,R]},a.push(T);break;case"5":_=t.getToken(),M=c(_),B=t.getVector(),R=t.getVector(),L=t.getVector(),D=t.getVector(),T={material:M,colorCode:_,vertices:[B,R],controlPoints:[L,D]},s.push(T);break;case"3":_=t.getToken(),M=c(_),C=x,I=!y||!w,!0===C?(B=t.getVector(),R=t.getVector(),P=t.getVector()):(P=t.getVector(),R=t.getVector(),B=t.getVector()),i.push({material:M,colorCode:_,faceNormal:null,vertices:[B,R,P],normals:[null,null,null]}),p++,!0===I&&(i.push({material:M,colorCode:_,faceNormal:null,vertices:[P,R,B],normals:[null,null,null]}),p++);break;case"4":_=t.getToken(),M=c(_),C=x,I=!y||!w,!0===C?(B=t.getVector(),R=t.getVector(),P=t.getVector(),F=t.getVector()):(F=t.getVector(),P=t.getVector(),R=t.getVector(),B=t.getVector()),i.push({material:M,colorCode:_,faceNormal:null,vertices:[B,R,P,F],normals:[null,null,null,null]}),p+=2,!0===I&&(i.push({material:M,colorCode:_,faceNormal:null,vertices:[F,P,R,B],normals:[null,null,null,null]}),p+=2);break;default:throw new Error('LDrawLoader: Unknown line type "'+m+'"'+t.getLineNumberString()+".")}}return g&&this.setData(v,A),{faces:i,conditionalSegments:s,lineSegments:a,type:u,category:h,keywords:d,subobjects:o,totalFaces:p,startingConstructionStep:E,materials:l,fileName:t,group:null}}getData(e,t=!0){const r=e.toLowerCase(),n=this._cache[r];return null===n||n instanceof Promise?null:t?this.cloneResult(n):n}async ensureDataLoaded(e){const t=e.toLowerCase();t in this._cache||(this._cache[t]=this.fetchData(e).then((r=>{const n=this.parse(r,e);return this._cache[t]=n,n}))),await this._cache[t]}setData(e,t){const r=e.toLowerCase();this._cache[r]=this.parse(t,e)}}function lm(e,t,r,n){return(!n&&e===Zf||n&&e===$f)&&(e=t),r[e]||null}class cm{constructor(e){this.loader=e,this.parseCache=new om(e),this._cache={}}async processIntoMesh(e){const t=this.loader,r=this.parseCache,i=new Set,a=async(e,s=null)=>{const o=e.subobjects,l=[];for(let t=0,n=o.length;t<n;t++){const e=o[t],n=r.ensureDataLoaded(e.fileName).then((()=>{const t=r.getData(e.fileName,!1);return n=t.type,/primitive/i.test(n)||"Subpart"===n?a(r.getData(e.fileName),e):this.loadModel(e.fileName).catch((e=>(console.warn(e),null)));var n}));l.push(n)}const c=new n.Group;c.userData.category=e.category,c.userData.keywords=e.keywords,e.group=c;const u=await Promise.all(l);for(let r=0,n=u.length;r<n;r++){const n=e.subobjects[r],a=u[r];if(null===a)continue;if(a.isGroup){const r=a;n.matrix.decompose(r.position,r.quaternion,r.scale),r.userData.startingConstructionStep=n.startingConstructionStep,r.name=n.fileName,t.applyMaterialsToMesh(r,n.colorCode,e.materials),c.add(r);continue}a.group.children.length&&c.add(a.group);const s=e.lineSegments,o=e.conditionalSegments,l=e.faces,h=a.lineSegments,d=a.conditionalSegments,p=a.faces,f=n.matrix,m=n.inverted,g=f.determinant()<0,v=n.colorCode,A=v===Zf?$f:v;for(let t=0,r=h.length;t<r;t++){const r=h[t],n=r.vertices;n[0].applyMatrix4(f),n[1].applyMatrix4(f),r.colorCode=r.colorCode===$f?A:r.colorCode,r.material=r.material||lm(r.colorCode,r.colorCode,e.materials,!0),s.push(r)}for(let t=0,r=d.length;t<r;t++){const r=d[t],n=r.vertices,i=r.controlPoints;n[0].applyMatrix4(f),n[1].applyMatrix4(f),i[0].applyMatrix4(f),i[1].applyMatrix4(f),r.colorCode=r.colorCode===$f?A:r.colorCode,r.material=r.material||lm(r.colorCode,r.colorCode,e.materials,!0),o.push(r)}for(let t=0,r=p.length;t<r;t++){const r=p[t],n=r.vertices;for(let e=0,t=n.length;e<t;e++)n[e].applyMatrix4(f);r.colorCode=r.colorCode===Zf?v:r.colorCode,r.material=r.material||lm(r.colorCode,v,e.materials,!1),i.add(r.colorCode),g!==m&&n.reverse(),l.push(r)}e.totalFaces+=a.totalFaces}return s&&t.applyMaterialsToMesh(c,s.colorCode,e.materials),e};for(let n=0,o=e.faces;n<o;n++)i.add(e.faces[n].colorCode);if(await a(e),t.smoothNormals){const t=i.size>1;!function(e){for(let t=0,r=e.length;t<r;t++){const r=e[t],i=r.vertices,a=i[0],s=i[1],o=i[2];em.subVectors(s,a),tm.subVectors(o,s),r.faceNormal=(new n.Vector3).crossVectors(em,tm).normalize()}}(e.faces),function(e,t,r=!1){const i=100*(1+1e-10);function a(e){return`${~~(e.x*i)},${~~(e.y*i)},${~~(e.z*i)}`}function s(e,t){return`${a(e)}_${a(t)}`}function o(e,t,r){r.direction.subVectors(t,e).normalize();const n=e.dot(r.direction);return r.origin.copy(e).addScaledVector(r.direction,-n),r}function l(e){return s(e.origin,e.direction)}const c=new Set,u=new Map,h={},d=[];for(let p=0,f=t.length;p<f;p++){const e=t[p].vertices,i=e[0],a=e[1];if(c.add(s(i,a)),c.add(s(a,i)),r){const e=o(i,a,new n.Ray),t=l(e);if(!u.has(t)){o(a,i,e);const r=l(e),n={ray:e,distances:[]};u.set(t,n),u.set(r,n)}const r=u.get(t);let s=r.ray.direction.dot(i),c=r.ray.direction.dot(a);s>c&&([s,c]=[c,s]),r.distances.push(s,c)}}for(let n=0,p=e.length;n<p;n++){const t=e[n],i=t.vertices,a=i.length;for(let e=0;e<a;e++){const n=e,d=(e+1)%a,p=i[n],f=i[d],m=s(p,f);if(c.has(m))continue;if(r){o(p,f,im);const e=l(im);if(u.has(e)){const t=u.get(e),{ray:r,distances:n}=t;let i=r.direction.dot(p),a=r.direction.dot(f);i>a&&([i,a]=[a,i]);let s=!1;for(let e=0,o=n.length;e<o;e+=2)if(i>=n[e]&&a<=n[e+1]){s=!0;break}if(s)continue}}const g={index:n,tri:t};h[m]=g}}for(;;){let e=null;for(const r in h){e=h[r];break}if(null===e)break;const t=[e];for(;t.length>0;){const e=t.pop().tri,r=e.vertices,i=e.normals,a=e.faceNormal,o=r.length;for(let l=0;l<o;l++){const c=l,u=(l+1)%o,p=r[c],f=r[u];delete h[s(p,f)];const m=s(f,p),g=h[m];if(g){const r=g.tri,s=g.index,o=r.normals,l=o.length,p=r.faceNormal;if(Math.abs(r.faceNormal.dot(e.faceNormal))<.25)continue;m in h&&(t.push(g),delete h[m]);const f=(s+1)%l;i[c]&&o[f]&&i[c]!==o[f]&&(o[f].norm.add(i[c].norm),i[c].norm=o[f].norm);let v=i[c]||o[f];null===v&&(v={norm:new n.Vector3},d.push(v.norm)),null===i[c]&&(i[c]=v,v.norm.add(a)),null===o[f]&&(o[f]=v,v.norm.add(p)),i[u]&&o[s]&&i[u]!==o[s]&&(o[s].norm.add(i[u].norm),i[u].norm=o[s].norm);let A=i[u]||o[s];null===A&&(A={norm:new n.Vector3},d.push(A.norm)),null===i[u]&&(i[u]=A,A.norm.add(a)),null===o[s]&&(o[s]=A,A.norm.add(p))}}}}for(let n=0,p=d.length;n<p;n++)d[n].normalize()}(e.faces,e.lineSegments,t)}const s=e.group;return e.faces.length>0&&s.add(hm(e.faces,3,!1,e.totalFaces)),e.lineSegments.length>0&&s.add(hm(e.lineSegments,2)),e.conditionalSegments.length>0&&s.add(hm(e.conditionalSegments,2,!0)),s}hasCachedModel(e){return null!==e&&e.toLowerCase()in this._cache}async getCachedModel(e){if(null!==e&&this.hasCachedModel(e)){const t=e.toLowerCase();return(await this._cache[t]).clone()}return null}async loadModel(e){const t=this.parseCache,r=e.toLowerCase();if(this.hasCachedModel(e))return this.getCachedModel(e);{await t.ensureDataLoaded(e);const n=t.getData(e),i=this.processIntoMesh(n);if(this.hasCachedModel(e))return this.getCachedModel(e);am(n.type)&&(this._cache[r]=i);return(await i).clone()}}async parseModel(e){const t=this.parseCache.parse(e);return am(t.type)&&this.hasCachedModel(t.fileName)?this.getCachedModel(t.fileName):this.processIntoMesh(t)}}function um(e,t){return e.colorCode===t.colorCode?0:e.colorCode<t.colorCode?-1:1}function hm(e,t,r=!1,i=null){e.sort(um),null===i&&(i=e.length);const a=new Float32Array(t*i*3),s=3===t?new Float32Array(t*i*3):null,o=[],l=new Array(6),c=new n.BufferGeometry;let u=null,h=0,d=0,p=0;for(let m=0,g=e.length;m<g;m++){const i=e[m];let f=i.vertices;4===f.length&&(l[0]=f[0],l[1]=f[1],l[2]=f[2],l[3]=f[0],l[4]=f[2],l[5]=f[3],f=l);for(let e=0,t=f.length;e<t;e++){const t=f[e],r=p+3*e;a[r+0]=t.x,a[r+1]=t.y,a[r+2]=t.z}if(3===t){if(!i.faceNormal){const e=f[0],t=f[1],r=f[2];em.subVectors(t,e),tm.subVectors(r,t),i.faceNormal=(new n.Vector3).crossVectors(em,tm).normalize()}let e=i.normals;4===e.length&&(l[0]=e[0],l[1]=e[1],l[2]=e[2],l[3]=e[0],l[4]=e[2],l[5]=e[3],e=l);for(let t=0,r=e.length;t<r;t++){let r=i.faceNormal;e[t]&&(r=e[t].norm);const n=p+3*t;s[n+0]=r.x,s[n+1]=r.y,s[n+2]=r.z}}if(u!==i.colorCode){null!==u&&c.addGroup(h,d,o.length-1);const e=i.material;null!==e?3===t?o.push(e):2===t&&(null!==e?r?o.push(e.userData.edgeMaterial.userData.conditionalEdgeMaterial):o.push(e.userData.edgeMaterial):o.push(null)):o.push(i.colorCode),u=i.colorCode,h=p/3,d=f.length}else d+=f.length;p+=3*f.length}d>0&&c.addGroup(h,1/0,o.length-1),c.setAttribute("position",new n.BufferAttribute(a,3)),null!==s&&c.setAttribute("normal",new n.BufferAttribute(s,3));let f=null;if(2===t?f=r?new nm(c,1===o.length?o[0]:o):new n.LineSegments(c,1===o.length?o[0]:o):3===t&&(f=new n.Mesh(c,1===o.length?o[0]:o)),r){f.isConditionalLine=!0;const t=new Float32Array(3*e.length*2),r=new Float32Array(3*e.length*2),i=new Float32Array(3*e.length*2);for(let n=0,a=e.length;n<a;n++){const a=e[n],s=a.vertices,o=a.controlPoints,l=o[0],c=o[1],u=s[0],h=s[1],d=3*n*2;t[d+0]=l.x,t[d+1]=l.y,t[d+2]=l.z,t[d+3]=l.x,t[d+4]=l.y,t[d+5]=l.z,r[d+0]=c.x,r[d+1]=c.y,r[d+2]=c.z,r[d+3]=c.x,r[d+4]=c.y,r[d+5]=c.z,i[d+0]=h.x-u.x,i[d+1]=h.y-u.y,i[d+2]=h.z-u.z,i[d+3]=h.x-u.x,i[d+4]=h.y-u.y,i[d+5]=h.z-u.z}c.setAttribute("control0",new n.BufferAttribute(t,3,!1)),c.setAttribute("control1",new n.BufferAttribute(r,3,!1)),c.setAttribute("direction",new n.BufferAttribute(i,3,!1))}return f}class dm extends n.Loader{constructor(e){super(e),this.materials=[],this.materialLibrary={},this.partsCache=new cm(this),this.fileMap={},this.setMaterials([]),this.smoothNormals=!0,this.partsLibraryPath=""}setPartsLibraryPath(e){return this.partsLibraryPath=e,this}async preloadMaterials(e){const t=new n.FileLoader(this.manager);t.setPath(this.path),t.setRequestHeader(this.requestHeader),t.setWithCredentials(this.withCredentials);const r=/^0 !COLOUR/,i=(await t.loadAsync(e)).split(/[\n\r]/g),a=[];for(let n=0,s=i.length;n<s;n++){const e=i[n];if(r.test(e)){const t=e.replace(r,""),n=this.parseColorMetaDirective(new sm(t));a.push(n)}}this.setMaterials(a)}load(e,t,r,i){const a=new n.FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(e=>{this.partsCache.parseModel(e,this.materialLibrary).then((e=>{this.applyMaterialsToMesh(e,Zf,this.materialLibrary,!0),this.computeConstructionSteps(e),t(e)})).catch(i)}),r,i)}parse(e,t){this.partsCache.parseModel(e,this.materialLibrary).then((e=>{this.computeConstructionSteps(e),t(e)}))}setMaterials(e){this.materialLibrary={},this.materials=[];for(let t=0,r=e.length;t<r;t++)this.addMaterial(e[t]);return this.addMaterial(this.parseColorMetaDirective(new sm("Main_Colour CODE 16 VALUE #FF8080 EDGE #333333"))),this.addMaterial(this.parseColorMetaDirective(new sm("Edge_Colour CODE 24 VALUE #A0A0A0 EDGE #333333"))),this}setFileMap(e){return this.fileMap=e,this}addMaterial(e){const t=this.materialLibrary;return t[e.userData.code]||(this.materials.push(e),t[e.userData.code]=e),this}getMaterial(e){if(e.startsWith("0x2")){const t=e.substring(3);return this.parseColorMetaDirective(new sm("Direct_Color_"+t+" CODE -1 VALUE #"+t+" EDGE #"+t))}return this.materialLibrary[e]||null}applyMaterialsToMesh(e,t,r,n=!1){const i=this,a=t===Zf;function s(e,s){if(a&&!(s in r)&&!n)return s;const o=e.isLineSegments||e.isConditionalLine;(!o&&s===Zf||o&&s===$f)&&(s=t);let l=null;if(s in r)l=r[s];else{if(!n)return s;if(l=i.getMaterial(s),null===l)throw new Error(`LDrawLoader: Material properties for code ${s} not available.`)}return e.isLineSegments&&(l=l.userData.edgeMaterial,e.isConditionalLine&&(l=l.userData.conditionalEdgeMaterial)),l}e.traverse((e=>{if(e.isMesh||e.isLineSegments)if(Array.isArray(e.material))for(let t=0,r=e.material.length;t<r;t++)e.material[t].isMaterial||(e.material[t]=s(e,e.material[t]));else e.material.isMaterial||(e.material=s(e,e.material))}))}getMainMaterial(){return this.getMaterial(Zf)}getMainEdgeMaterial(){return this.getMaterial($f)}parseColorMetaDirective(e){let t=null,r=16711935,i=16711935,a=1,s=!1,o=0,l=0,c=null;const u=e.getToken();if(!u)throw new Error('LDrawLoader: Material name was expected after "!COLOUR tag'+e.getLineNumberString()+".");let h=null;for(;h=e.getToken(),h;)switch(h.toUpperCase()){case"CODE":t=e.getToken();break;case"VALUE":if(r=e.getToken(),r.startsWith("0x"))r="#"+r.substring(2);else if(!r.startsWith("#"))throw new Error("LDrawLoader: Invalid color while parsing material"+e.getLineNumberString()+".");break;case"EDGE":if(i=e.getToken(),i.startsWith("0x"))i="#"+i.substring(2);else if(!i.startsWith("#")){if(c=this.getMaterial(i),!c)throw new Error("LDrawLoader: Invalid edge color while parsing material"+e.getLineNumberString()+".");c=c.userData.edgeMaterial}break;case"ALPHA":if(a=parseInt(e.getToken()),isNaN(a))throw new Error("LDrawLoader: Invalid alpha value in material definition"+e.getLineNumberString()+".");a=Math.max(0,Math.min(1,a/255)),a<1&&(s=!0);break;case"LUMINANCE":if(o=parseInt(e.getToken()),isNaN(o))throw new Error("LDrawLoader: Invalid luminance value in material definition"+sm.getLineNumberString()+".");o=Math.max(0,Math.min(1,o/255));break;case"CHROME":l=1;break;case"PEARLESCENT":l=2;break;case"RUBBER":l=3;break;case"MATTE_METALLIC":l=4;break;case"METAL":l=5;break;case"MATERIAL":e.setToEnd();break;default:throw new Error('LDrawLoader: Unknown token "'+h+'" while parsing material'+e.getLineNumberString()+".")}let d=null;switch(l){case 0:d=new n.MeshStandardMaterial({color:r,roughness:.3,metalness:0});break;case 2:d=new n.MeshStandardMaterial({color:r,roughness:.3,metalness:.25});break;case 1:d=new n.MeshStandardMaterial({color:r,roughness:0,metalness:1});break;case 3:d=new n.MeshStandardMaterial({color:r,roughness:.9,metalness:0});break;case 4:d=new n.MeshStandardMaterial({color:r,roughness:.8,metalness:.4});break;case 5:d=new n.MeshStandardMaterial({color:r,roughness:.2,metalness:.85})}return d.transparent=s,d.premultipliedAlpha=!0,d.opacity=a,d.depthWrite=!s,d.polygonOffset=!0,d.polygonOffsetFactor=1,0!==o&&d.emissive.set(d.color).multiplyScalar(o),c||(c=new n.LineBasicMaterial({color:i,transparent:s,opacity:a,depthWrite:!s}),c.userData.code=t,c.name=u+" - Edge",c.userData.conditionalEdgeMaterial=new rm({fog:!0,transparent:s,depthWrite:!s,color:i,opacity:a})),d.userData.code=t,d.name=u,d.userData.edgeMaterial=c,this.addMaterial(d),d}computeConstructionSteps(e){let t=0;e.traverse((e=>{e.isGroup&&(e.userData.startingConstructionStep&&t++,e.userData.constructionStep=t)})),e.userData.numConstructionSteps=t+1}}class pm extends n.Loader{constructor(e){super(e),this.defaultDPI=90,this.defaultUnit="px"}load(e,t,r,i){const a=this,s=new n.FileLoader(a.manager);s.setPath(a.path),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){const t=this;function r(e,t,r,n,a,s,o,l){if(0==t||0==r)return void e.lineTo(l.x,l.y);n=n*Math.PI/180,t=Math.abs(t),r=Math.abs(r);const c=(o.x-l.x)/2,u=(o.y-l.y)/2,h=Math.cos(n)*c+Math.sin(n)*u,d=-Math.sin(n)*c+Math.cos(n)*u;let p=t*t,f=r*r;const m=h*h,g=d*d,v=m/p+g/f;if(v>1){const e=Math.sqrt(v);p=(t*=e)*t,f=(r*=e)*r}const A=p*g+f*m,y=(p*f-A)/A;let x=Math.sqrt(Math.max(0,y));a===s&&(x=-x);const b=x*t*d/r,w=-x*r*h/t,E=Math.cos(n)*b-Math.sin(n)*w+(o.x+l.x)/2,S=Math.sin(n)*b+Math.cos(n)*w+(o.y+l.y)/2,M=i(1,0,(h-b)/t,(d-w)/r),_=i((h-b)/t,(d-w)/r,(-h-b)/t,(-d-w)/r)%(2*Math.PI);e.currentPath.absellipse(E,S,t,r,M,M+_,0===s,n)}function i(e,t,r,n){const i=e*r+t*n,a=Math.sqrt(e*e+t*t)*Math.sqrt(r*r+n*n);let s=Math.acos(Math.max(-1,Math.min(1,i/a)));return e*n-t*r<0&&(s=-s),s}function a(e,t){t=Object.assign({},t);let r={};if(e.hasAttribute("class")){const t=e.getAttribute("class").split(/\s/).filter(Boolean).map((e=>e.trim()));for(let e=0;e<t.length;e++)r=Object.assign(r,f["."+t[e]])}function n(n,i,a){void 0===a&&(a=function(e){return e.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),e}),e.hasAttribute(n)&&(t[i]=a(e.getAttribute(n))),r[n]&&(t[i]=a(r[n])),e.style&&""!==e.style[n]&&(t[i]=a(e.style[n]))}function i(e){return Math.max(0,Math.min(1,u(e)))}function a(e){return Math.max(0,u(e))}return e.hasAttribute("id")&&(r=Object.assign(r,f["#"+e.getAttribute("id")])),n("fill","fill"),n("fill-opacity","fillOpacity",i),n("fill-rule","fillRule"),n("opacity","opacity",i),n("stroke","stroke"),n("stroke-opacity","strokeOpacity",i),n("stroke-width","strokeWidth",a),n("stroke-linejoin","strokeLineJoin"),n("stroke-linecap","strokeLineCap"),n("stroke-miterlimit","strokeMiterLimit",a),n("visibility","visibility"),t}function s(e,t){return e-(t-e)}function o(e,t,r){if("string"!=typeof e)throw new TypeError("Invalid input: "+typeof e);const n={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};let i=0,a=!0,s="",o="";const l=[];function c(e,t,r){const n=new SyntaxError('Unexpected character "'+e+'" at index '+t+".");throw n.partial=r,n}function u(){""!==s&&(""===o?l.push(Number(s)):l.push(Number(s)*Math.pow(10,Number(o)))),s="",o=""}let h;const d=e.length;for(let p=0;p<d;p++)if(h=e[p],Array.isArray(t)&&t.includes(l.length%r)&&n.FLAGS.test(h))i=1,s=h,u();else{if(0===i){if(n.WHITESPACE.test(h))continue;if(n.DIGIT.test(h)||n.SIGN.test(h)){i=1,s=h;continue}if(n.POINT.test(h)){i=2,s=h;continue}n.COMMA.test(h)&&(a&&c(h,p,l),a=!0)}if(1===i){if(n.DIGIT.test(h)){s+=h;continue}if(n.POINT.test(h)){s+=h,i=2;continue}if(n.EXP.test(h)){i=3;continue}n.SIGN.test(h)&&1===s.length&&n.SIGN.test(s[0])&&c(h,p,l)}if(2===i){if(n.DIGIT.test(h)){s+=h;continue}if(n.EXP.test(h)){i=3;continue}n.POINT.test(h)&&"."===s[s.length-1]&&c(h,p,l)}if(3===i){if(n.DIGIT.test(h)){o+=h;continue}if(n.SIGN.test(h)){if(""===o){o+=h;continue}1===o.length&&n.SIGN.test(o)&&c(h,p,l)}}n.WHITESPACE.test(h)?(u(),i=0,a=!1):n.COMMA.test(h)?(u(),i=0,a=!0):n.SIGN.test(h)?(u(),i=1,s=h):n.POINT.test(h)?(u(),i=2,s=h):c(h,p,l)}return u(),l}const l=["mm","cm","in","pt","pc","px"],c={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1}};function u(e){let r,n="px";if("string"==typeof e||e instanceof String)for(let t=0,i=l.length;t<i;t++){const r=l[t];if(e.endsWith(r)){n=r,e=e.substring(0,e.length-r.length);break}}return"px"===n&&"px"!==t.defaultUnit?r=c.in[t.defaultUnit]/t.defaultDPI:(r=c[n][t.defaultUnit],r<0&&(r=c[n].in*t.defaultDPI)),r*parseFloat(e)}function h(e){const t=e.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function d(e){const t=e.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}const p=[],f={},m=[],g=new n.Matrix3,v=new n.Matrix3,A=new n.Matrix3,y=new n.Matrix3,x=new n.Vector2,b=new n.Vector3,w=new n.Matrix3,E=(new DOMParser).parseFromString(e,"image/svg+xml");!function e(t,i){if(1!==t.nodeType)return;const l=function(e){if(!(e.hasAttribute("transform")||"use"===e.nodeName&&(e.hasAttribute("x")||e.hasAttribute("y"))))return null;const t=function(e){const t=new n.Matrix3,r=g;if("use"===e.nodeName&&(e.hasAttribute("x")||e.hasAttribute("y"))){const r=u(e.getAttribute("x")),n=u(e.getAttribute("y"));t.translate(r,n)}if(e.hasAttribute("transform")){const n=e.getAttribute("transform").split(")");for(let e=n.length-1;e>=0;e--){const i=n[e].trim();if(""===i)continue;const a=i.indexOf("("),s=i.length;if(a>0&&a<s){const e=i.substr(0,a),t=o(i.substr(a+1,s-a-1));switch(r.identity(),e){case"translate":if(t.length>=1){const e=t[0];let n=e;t.length>=2&&(n=t[1]),r.translate(e,n)}break;case"rotate":if(t.length>=1){let e=0,n=0,i=0;e=-t[0]*Math.PI/180,t.length>=3&&(n=t[1],i=t[2]),v.identity().translate(-n,-i),A.identity().rotate(e),y.multiplyMatrices(A,v),v.identity().translate(n,i),r.multiplyMatrices(v,y)}break;case"scale":if(t.length>=1){const e=t[0];let n=e;t.length>=2&&(n=t[1]),r.scale(e,n)}break;case"skewX":1===t.length&&r.set(1,Math.tan(t[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===t.length&&r.set(1,0,0,Math.tan(t[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===t.length&&r.set(t[0],t[2],t[4],t[1],t[3],t[5],0,0,1)}}t.premultiply(r)}}return t}(e);m.length>0&&t.premultiply(m[m.length-1]);return w.copy(t),m.push(t),t}(t);let c=!0,E=null;switch(t.nodeName){case"svg":break;case"style":!function(e){if(!e.sheet||!e.sheet.cssRules||!e.sheet.cssRules.length)return;for(let t=0;t<e.sheet.cssRules.length;t++){const r=e.sheet.cssRules[t];if(1!==r.type)continue;const n=r.selectorText.split(/,/gm).filter(Boolean).map((e=>e.trim()));for(let e=0;e<n.length;e++)f[n[e]]=Object.assign(f[n[e]]||{},r.style)}}(t);break;case"g":i=a(t,i);break;case"path":i=a(t,i),t.hasAttribute("d")&&(E=function(e){const t=new n.ShapePath,i=new n.Vector2,a=new n.Vector2,l=new n.Vector2;let c=!0,u=!1;const h=e.getAttribute("d").match(/[a-df-z][^a-df-z]*/gi);for(let n=0,d=h.length;n<d;n++){const e=h[n],d=e.charAt(0),p=e.substr(1).trim();let f;switch(!0===c&&(u=!0,c=!1),d){case"M":f=o(p);for(let e=0,r=f.length;e<r;e+=2)i.x=f[e+0],i.y=f[e+1],a.x=i.x,a.y=i.y,0===e?t.moveTo(i.x,i.y):t.lineTo(i.x,i.y),0===e&&l.copy(i);break;case"H":f=o(p);for(let e=0,r=f.length;e<r;e++)i.x=f[e],a.x=i.x,a.y=i.y,t.lineTo(i.x,i.y),0===e&&!0===u&&l.copy(i);break;case"V":f=o(p);for(let e=0,r=f.length;e<r;e++)i.y=f[e],a.x=i.x,a.y=i.y,t.lineTo(i.x,i.y),0===e&&!0===u&&l.copy(i);break;case"L":f=o(p);for(let e=0,r=f.length;e<r;e+=2)i.x=f[e+0],i.y=f[e+1],a.x=i.x,a.y=i.y,t.lineTo(i.x,i.y),0===e&&!0===u&&l.copy(i);break;case"C":f=o(p);for(let e=0,r=f.length;e<r;e+=6)t.bezierCurveTo(f[e+0],f[e+1],f[e+2],f[e+3],f[e+4],f[e+5]),a.x=f[e+2],a.y=f[e+3],i.x=f[e+4],i.y=f[e+5],0===e&&!0===u&&l.copy(i);break;case"S":f=o(p);for(let e=0,r=f.length;e<r;e+=4)t.bezierCurveTo(s(i.x,a.x),s(i.y,a.y),f[e+0],f[e+1],f[e+2],f[e+3]),a.x=f[e+0],a.y=f[e+1],i.x=f[e+2],i.y=f[e+3],0===e&&!0===u&&l.copy(i);break;case"Q":f=o(p);for(let e=0,r=f.length;e<r;e+=4)t.quadraticCurveTo(f[e+0],f[e+1],f[e+2],f[e+3]),a.x=f[e+0],a.y=f[e+1],i.x=f[e+2],i.y=f[e+3],0===e&&!0===u&&l.copy(i);break;case"T":f=o(p);for(let e=0,r=f.length;e<r;e+=2){const r=s(i.x,a.x),n=s(i.y,a.y);t.quadraticCurveTo(r,n,f[e+0],f[e+1]),a.x=r,a.y=n,i.x=f[e+0],i.y=f[e+1],0===e&&!0===u&&l.copy(i)}break;case"A":f=o(p,[3,4],7);for(let e=0,n=f.length;e<n;e+=7){if(f[e+5]==i.x&&f[e+6]==i.y)continue;const n=i.clone();i.x=f[e+5],i.y=f[e+6],a.x=i.x,a.y=i.y,r(t,f[e],f[e+1],f[e+2],f[e+3],f[e+4],n,i),0===e&&!0===u&&l.copy(i)}break;case"m":f=o(p);for(let e=0,r=f.length;e<r;e+=2)i.x+=f[e+0],i.y+=f[e+1],a.x=i.x,a.y=i.y,0===e?t.moveTo(i.x,i.y):t.lineTo(i.x,i.y),0===e&&l.copy(i);break;case"h":f=o(p);for(let e=0,r=f.length;e<r;e++)i.x+=f[e],a.x=i.x,a.y=i.y,t.lineTo(i.x,i.y),0===e&&!0===u&&l.copy(i);break;case"v":f=o(p);for(let e=0,r=f.length;e<r;e++)i.y+=f[e],a.x=i.x,a.y=i.y,t.lineTo(i.x,i.y),0===e&&!0===u&&l.copy(i);break;case"l":f=o(p);for(let e=0,r=f.length;e<r;e+=2)i.x+=f[e+0],i.y+=f[e+1],a.x=i.x,a.y=i.y,t.lineTo(i.x,i.y),0===e&&!0===u&&l.copy(i);break;case"c":f=o(p);for(let e=0,r=f.length;e<r;e+=6)t.bezierCurveTo(i.x+f[e+0],i.y+f[e+1],i.x+f[e+2],i.y+f[e+3],i.x+f[e+4],i.y+f[e+5]),a.x=i.x+f[e+2],a.y=i.y+f[e+3],i.x+=f[e+4],i.y+=f[e+5],0===e&&!0===u&&l.copy(i);break;case"s":f=o(p);for(let e=0,r=f.length;e<r;e+=4)t.bezierCurveTo(s(i.x,a.x),s(i.y,a.y),i.x+f[e+0],i.y+f[e+1],i.x+f[e+2],i.y+f[e+3]),a.x=i.x+f[e+0],a.y=i.y+f[e+1],i.x+=f[e+2],i.y+=f[e+3],0===e&&!0===u&&l.copy(i);break;case"q":f=o(p);for(let e=0,r=f.length;e<r;e+=4)t.quadraticCurveTo(i.x+f[e+0],i.y+f[e+1],i.x+f[e+2],i.y+f[e+3]),a.x=i.x+f[e+0],a.y=i.y+f[e+1],i.x+=f[e+2],i.y+=f[e+3],0===e&&!0===u&&l.copy(i);break;case"t":f=o(p);for(let e=0,r=f.length;e<r;e+=2){const r=s(i.x,a.x),n=s(i.y,a.y);t.quadraticCurveTo(r,n,i.x+f[e+0],i.y+f[e+1]),a.x=r,a.y=n,i.x=i.x+f[e+0],i.y=i.y+f[e+1],0===e&&!0===u&&l.copy(i)}break;case"a":f=o(p,[3,4],7);for(let e=0,n=f.length;e<n;e+=7){if(0==f[e+5]&&0==f[e+6])continue;const n=i.clone();i.x+=f[e+5],i.y+=f[e+6],a.x=i.x,a.y=i.y,r(t,f[e],f[e+1],f[e+2],f[e+3],f[e+4],n,i),0===e&&!0===u&&l.copy(i)}break;case"Z":case"z":t.currentPath.autoClose=!0,t.currentPath.curves.length>0&&(i.copy(l),t.currentPath.currentPoint.copy(i),c=!0);break;default:console.warn(e)}u=!1}return t}(t));break;case"rect":i=a(t,i),E=function(e){const t=u(e.getAttribute("x")||0),r=u(e.getAttribute("y")||0),i=u(e.getAttribute("rx")||e.getAttribute("ry")||0),a=u(e.getAttribute("ry")||e.getAttribute("rx")||0),s=u(e.getAttribute("width")),o=u(e.getAttribute("height")),l=.448084975506,c=new n.ShapePath;c.moveTo(t+i,r),c.lineTo(t+s-i,r),(0!==i||0!==a)&&c.bezierCurveTo(t+s-i*l,r,t+s,r+a*l,t+s,r+a);c.lineTo(t+s,r+o-a),(0!==i||0!==a)&&c.bezierCurveTo(t+s,r+o-a*l,t+s-i*l,r+o,t+s-i,r+o);c.lineTo(t+i,r+o),(0!==i||0!==a)&&c.bezierCurveTo(t+i*l,r+o,t,r+o-a*l,t,r+o-a);c.lineTo(t,r+a),(0!==i||0!==a)&&c.bezierCurveTo(t,r+a*l,t+i*l,r,t+i,r);return c}(t);break;case"polygon":i=a(t,i),E=function(e){function t(e,t,r){const n=u(t),s=u(r);0===a?i.moveTo(n,s):i.lineTo(n,s),a++}const r=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,i=new n.ShapePath;let a=0;return e.getAttribute("points").replace(r,t),i.currentPath.autoClose=!0,i}(t);break;case"polyline":i=a(t,i),E=function(e){function t(e,t,r){const n=u(t),s=u(r);0===a?i.moveTo(n,s):i.lineTo(n,s),a++}const r=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,i=new n.ShapePath;let a=0;return e.getAttribute("points").replace(r,t),i.currentPath.autoClose=!1,i}(t);break;case"circle":i=a(t,i),E=function(e){const t=u(e.getAttribute("cx")||0),r=u(e.getAttribute("cy")||0),i=u(e.getAttribute("r")||0),a=new n.Path;a.absarc(t,r,i,0,2*Math.PI);const s=new n.ShapePath;return s.subPaths.push(a),s}(t);break;case"ellipse":i=a(t,i),E=function(e){const t=u(e.getAttribute("cx")||0),r=u(e.getAttribute("cy")||0),i=u(e.getAttribute("rx")||0),a=u(e.getAttribute("ry")||0),s=new n.Path;s.absellipse(t,r,i,a,0,2*Math.PI);const o=new n.ShapePath;return o.subPaths.push(s),o}(t);break;case"line":i=a(t,i),E=function(e){const t=u(e.getAttribute("x1")||0),r=u(e.getAttribute("y1")||0),i=u(e.getAttribute("x2")||0),a=u(e.getAttribute("y2")||0),s=new n.ShapePath;return s.moveTo(t,r),s.lineTo(i,a),s.currentPath.autoClose=!1,s}(t);break;case"defs":case"mask":c=!1;break;case"use":i=a(t,i);const l=t.href.baseVal.substring(1),h=t.viewportElement.getElementById(l);h?e(h,i):console.warn("SVGLoader: 'use node' references non-existent node id: "+l)}if(E&&(void 0!==i.fill&&"none"!==i.fill&&E.color.setStyle(i.fill),function(e,t){function r(e){b.set(e.x,e.y,1).applyMatrix3(t),e.set(b.x,b.y)}const n=function(e){return 0!==e.elements[1]||0!==e.elements[3]}(t),i=e.subPaths;for(let a=0,s=i.length;a<s;a++){const e=i[a].curves;for(let i=0;i<e.length;i++){const a=e[i];a.isLineCurve?(r(a.v1),r(a.v2)):a.isCubicBezierCurve?(r(a.v0),r(a.v1),r(a.v2),r(a.v3)):a.isQuadraticBezierCurve?(r(a.v0),r(a.v1),r(a.v2)):a.isEllipseCurve&&(n&&console.warn("SVGLoader: Elliptic arc or ellipse rotation or skewing is not implemented."),x.set(a.aX,a.aY),r(x),a.aX=x.x,a.aY=x.y,a.xRadius*=h(t),a.yRadius*=d(t))}}}(E,w),p.push(E),E.userData={node:t,style:i}),c){const r=t.childNodes;for(let t=0;t<r.length;t++)e(r[t],i)}l&&(m.pop(),m.length>0?w.copy(m[m.length-1]):w.identity())}(E.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4});return{paths:p,xml:E.documentElement}}static createShapes(e){const t=999999999,r=0,i=1,a=2,s=3,o=4,l=5,c=6,u={loc:r,t:0};function h(e,t,n,i){const s=e.x,o=t.x,l=n.x,c=i.x,h=e.y,p=t.y,f=n.y,m=i.y,g=(c-l)*(h-f)-(m-f)*(s-l),v=(m-f)*(o-s)-(c-l)*(p-h),A=g/v,y=((o-s)*(h-f)-(p-h)*(s-l))/v;if(0===v&&0!==g||A<=0||A>=1||y<0||y>1)return null;if(0===g&&0===v){for(let l=0;l<2;l++){if(d(0===l?n:i,e,t),u.loc==r){const e=0===l?n:i;return{x:e.x,y:e.y,t:u.t}}if(u.loc==a){return{x:+(s+u.t*(o-s)).toPrecision(10),y:+(h+u.t*(p-h)).toPrecision(10),t:u.t}}}return null}for(let a=0;a<2;a++)if(d(0===a?n:i,e,t),u.loc==r){const e=0===a?n:i;return{x:e.x,y:e.y,t:u.t}}return{x:+(s+A*(o-s)).toPrecision(10),y:+(h+A*(p-h)).toPrecision(10),t:A}}function d(e,t,n){const h=n.x-t.x,d=n.y-t.y,p=e.x-t.x,f=e.y-t.y,m=h*f-p*d;if(e.x===t.x&&e.y===t.y)return u.loc=r,void(u.t=0);if(e.x===n.x&&e.y===n.y)return u.loc=i,void(u.t=1);if(m<-Number.EPSILON)return void(u.loc=s);if(m>Number.EPSILON)return void(u.loc=o);if(h*p<0||d*f<0)return void(u.loc=l);if(Math.sqrt(h*h+d*d)<Math.sqrt(p*p+f*f))return void(u.loc=c);let g;g=0!==h?p/h:f/d,u.loc=a,u.t=g}function p(e,t,r){const i=new n.Vector2;t.getCenter(i);const a=[];return r.forEach((t=>{if(t.boundingBox.containsPoint(i)){(function(e,t){const r=[],i=[];for(let a=1;a<e.length;a++){const s=e[a-1],o=e[a];for(let e=1;e<t.length;e++){const a=h(s,o,t[e-1],t[e]);null!==a&&void 0===r.find((e=>e.t<=a.t+Number.EPSILON&&e.t>=a.t-Number.EPSILON))&&(r.push(a),i.push(new n.Vector2(a.x,a.y)))}}return i})(e,t.points).forEach((e=>{a.push({identifier:t.identifier,isCW:t.isCW,point:e})}))}})),a.sort(((e,t)=>e.point.x-t.point.x)),a}let f=0,m=t,g=-999999999,v=e.subPaths.map((e=>{const r=e.getPoints();let i=-999999999,a=t,s=-999999999,o=t;for(let t=0;t<r.length;t++){const e=r[t];e.y>i&&(i=e.y),e.y<a&&(a=e.y),e.x>s&&(s=e.x),e.x<o&&(o=e.x)}return g<=s&&(g=s+1),m>=o&&(m=o-1),{curves:e.curves,points:r,isCW:n.ShapeUtils.isClockWise(r),identifier:f++,boundingBox:new n.Box2(new n.Vector2(o,a),new n.Vector2(s,i))}}));v=v.filter((e=>e.points.length>1));const A=v.map((t=>function(e,t,r,i,a){null!=a&&""!==a||(a="nonzero");const s=new n.Vector2;e.boundingBox.getCenter(s);const o=p([new n.Vector2(r,s.y),new n.Vector2(i,s.y)],e.boundingBox,t);o.sort(((e,t)=>e.point.x-t.point.x));const l=[],c=[];o.forEach((t=>{t.identifier===e.identifier?l.push(t):c.push(t)}));const u=l[0].point.x,h=[];let d=0;for(;d<c.length&&c[d].point.x<u;)h.length>0&&h[h.length-1]===c[d].identifier?h.pop():h.push(c[d].identifier),d++;if(h.push(e.identifier),"evenodd"===a){const t=h.length%2==0,r=h[h.length-2];return{identifier:e.identifier,isHole:t,for:r}}if("nonzero"===a){let r=!0,n=null,i=null;for(let e=0;e<h.length;e++){const a=h[e];r?(i=t[a].isCW,r=!1,n=a):i!==t[a].isCW&&(i=t[a].isCW,r=!0)}return{identifier:e.identifier,isHole:r,for:n}}console.warn('fill-rule: "'+a+'" is currently not implemented.')}(t,v,m,g,e.userData.style.fillRule))),y=[];return v.forEach((e=>{if(!A[e.identifier].isHole){const t=new n.Shape;t.curves=e.curves;A.filter((t=>t.isHole&&t.for===e.identifier)).forEach((e=>{const r=v[e.identifier],i=new n.Path;i.curves=r.curves,t.holes.push(i)})),y.push(t)}})),y}static getStrokeStyle(e,t,r,n,i){return{strokeColor:t=void 0!==t?t:"#000",strokeWidth:e=void 0!==e?e:1,strokeLineJoin:r=void 0!==r?r:"miter",strokeLineCap:n=void 0!==n?n:"butt",strokeMiterLimit:i=void 0!==i?i:4}}static pointsToStroke(e,t,r,i){const a=[],s=[],o=[];if(0===pm.pointsToStrokeWithBuffers(e,t,r,i,a,s,o))return null;const l=new n.BufferGeometry;return l.setAttribute("position",new n.Float32BufferAttribute(a,3)),l.setAttribute("normal",new n.Float32BufferAttribute(s,3)),l.setAttribute("uv",new n.Float32BufferAttribute(o,2)),l}static pointsToStrokeWithBuffers(e,t,r,i,a,s,o,l){const c=new n.Vector2,u=new n.Vector2,h=new n.Vector2,d=new n.Vector2,p=new n.Vector2,f=new n.Vector2,m=new n.Vector2,g=new n.Vector2,v=new n.Vector2,A=new n.Vector2,y=new n.Vector2,x=new n.Vector2,b=new n.Vector2,w=new n.Vector2,E=new n.Vector2,S=new n.Vector2,M=new n.Vector2;r=void 0!==r?r:12,i=void 0!==i?i:.001,l=void 0!==l?l:0;const _=(e=function(e){let t=!1;for(let n=1,a=e.length-1;n<a;n++)if(e[n].distanceTo(e[n+1])<i){t=!0;break}if(!t)return e;const r=[];r.push(e[0]);for(let n=1,a=e.length-1;n<a;n++)e[n].distanceTo(e[n+1])>=i&&r.push(e[n]);return r.push(e[e.length-1]),r}(e)).length;if(_<2)return 0;const T=e[0].equals(e[_-1]);let C,I,B=e[0];const R=t.strokeWidth/2,P=1/(_-1);let F,L,D,U,N=0,k=!1,O=0,G=3*l,z=2*l;V(e[0],e[1],c).multiplyScalar(R),g.copy(e[0]).sub(c),v.copy(e[0]).add(c),A.copy(g),y.copy(v);for(let n=1;n<_;n++){C=e[n],I=n===_-1?T?e[1]:void 0:e[n+1];const r=c;if(V(B,C,r),h.copy(r).multiplyScalar(R),x.copy(C).sub(h),b.copy(C).add(h),F=N+P,L=!1,void 0!==I){V(C,I,u),h.copy(u).multiplyScalar(R),w.copy(C).sub(h),E.copy(C).add(h),D=!0,h.subVectors(I,B),r.dot(h)<0&&(D=!1),1===n&&(k=D),h.subVectors(I,C),h.normalize();const e=Math.abs(r.dot(h));if(0!==e){const r=R/e;h.multiplyScalar(-r),d.subVectors(C,B),p.copy(d).setLength(r).add(h),S.copy(p).negate();const n=p.length(),i=d.length();d.divideScalar(i),f.subVectors(I,C);const a=f.length();switch(f.divideScalar(a),d.dot(S)<i&&f.dot(S)<a&&(L=!0),M.copy(p).add(C),S.add(C),U=!1,L?D?(E.copy(S),b.copy(S)):(w.copy(S),x.copy(S)):j(),t.strokeLineJoin){case"bevel":W(D,L,F);break;case"round":X(D,L),D?Q(C,x,w,F,0):Q(C,E,b,F,1);break;default:const e=R*t.strokeMiterLimit/n;if(e<1){if("miter-clip"!==t.strokeLineJoin){W(D,L,F);break}X(D,L),D?(f.subVectors(M,x).multiplyScalar(e).add(x),m.subVectors(M,w).multiplyScalar(e).add(w),H(x,F,0),H(f,F,0),H(C,F,.5),H(C,F,.5),H(f,F,0),H(m,F,0),H(C,F,.5),H(m,F,0),H(w,F,0)):(f.subVectors(M,b).multiplyScalar(e).add(b),m.subVectors(M,E).multiplyScalar(e).add(E),H(b,F,1),H(f,F,1),H(C,F,.5),H(C,F,.5),H(f,F,1),H(m,F,1),H(C,F,.5),H(m,F,1),H(E,F,1))}else L?(D?(H(v,N,1),H(g,N,0),H(M,F,0),H(v,N,1),H(M,F,0),H(S,F,1)):(H(v,N,1),H(g,N,0),H(M,F,1),H(g,N,0),H(S,F,0),H(M,F,1)),D?w.copy(M):E.copy(M)):D?(H(x,F,0),H(M,F,0),H(C,F,.5),H(C,F,.5),H(M,F,0),H(w,F,0)):(H(b,F,1),H(M,F,1),H(C,F,.5),H(C,F,.5),H(M,F,1),H(E,F,1)),U=!0}}else j()}else j();T||n!==_-1||Y(e[0],A,y,D,!0,N),N=F,B=C,g.copy(w),v.copy(E)}if(T){if(L&&a){let e=M,t=S;k!==D&&(e=S,t=M),D?(U||k)&&(t.toArray(a,0),t.toArray(a,9),U&&e.toArray(a,3)):!U&&k||(t.toArray(a,3),t.toArray(a,9),U&&e.toArray(a,0))}}else Y(C,x,b,D,!1,F);return O;function V(e,t,r){return r.subVectors(t,e),r.set(-r.y,r.x).normalize()}function H(e,t,r){a&&(a[G]=e.x,a[G+1]=e.y,a[G+2]=0,s&&(s[G]=0,s[G+1]=0,s[G+2]=1),G+=3,o&&(o[z]=t,o[z+1]=r,z+=2)),O+=3}function Q(e,t,n,i,a){c.copy(t).sub(e).normalize(),u.copy(n).sub(e).normalize();let s=Math.PI;const o=c.dot(u);Math.abs(o)<1&&(s=Math.abs(Math.acos(o))),s/=r,h.copy(t);for(let l=0,c=r-1;l<c;l++)d.copy(h).rotateAround(e,s),H(h,i,a),H(d,i,a),H(e,i,.5),h.copy(d);H(d,i,a),H(n,i,a),H(e,i,.5)}function j(){H(v,N,1),H(g,N,0),H(x,F,0),H(v,N,1),H(x,F,1),H(b,F,0)}function W(e,t,r){t?e?(H(v,N,1),H(g,N,0),H(x,F,0),H(v,N,1),H(x,F,0),H(S,F,1),H(x,r,0),H(w,r,0),H(S,r,.5)):(H(v,N,1),H(g,N,0),H(b,F,1),H(g,N,0),H(S,F,0),H(b,F,1),H(b,r,1),H(E,r,0),H(S,r,.5)):e?(H(x,r,0),H(w,r,0),H(C,r,.5)):(H(b,r,1),H(E,r,0),H(C,r,.5))}function X(e,t){t&&(e?(H(v,N,1),H(g,N,0),H(x,F,0),H(v,N,1),H(x,F,0),H(S,F,1),H(x,N,0),H(C,F,.5),H(S,F,1),H(C,F,.5),H(w,N,0),H(S,F,1)):(H(v,N,1),H(g,N,0),H(b,F,1),H(g,N,0),H(S,F,0),H(b,F,1),H(b,N,1),H(S,F,0),H(C,F,.5),H(C,F,.5),H(S,F,0),H(E,N,1)))}function Y(e,r,n,i,s,o){switch(t.strokeLineCap){case"round":s?Q(e,n,r,o,.5):Q(e,r,n,o,.5);break;case"square":if(s)c.subVectors(r,e),u.set(c.y,-c.x),h.addVectors(c,u).add(e),d.subVectors(u,c).add(e),i?(h.toArray(a,3),d.toArray(a,0),d.toArray(a,9)):(h.toArray(a,3),h.toArray(a,9),d.toArray(a,0));else{c.subVectors(n,e),u.set(c.y,-c.x),h.addVectors(c,u).add(e),d.subVectors(u,c).add(e);const t=a.length;i?(h.toArray(a,t-3),d.toArray(a,t-6),d.toArray(a,t-12)):(h.toArray(a,t-6),d.toArray(a,t-3),d.toArray(a,t-12))}}}}}const fm=new WeakMap;class mm extends n.Loader{constructor(e){super(e),this.libraryPath="",this.libraryPending=null,this.libraryBinary=null,this.libraryConfig={},this.url="",this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.workerConfig={},this.materials=[]}setLibraryPath(e){return this.libraryPath=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,r,i){const a=new n.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),this.url=e,a.load(e,(r=>{if(fm.has(r)){return fm.get(r).promise.then(t).catch(i)}this.decodeObjects(r,e).then(t).catch(i)}),r,i)}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}decodeObjects(e,t){let r,n;const i=e.byteLength,a=this._getWorker(i).then((t=>(r=t,n=this.workerNextTaskID++,new Promise(((t,i)=>{r._callbacks[n]={resolve:t,reject:i},r.postMessage({type:"decode",id:n,buffer:e},[e])}))))).then((e=>this._createGeometry(e.data)));return a.catch((()=>!0)).then((()=>{r&&n&&this._releaseTask(r,n)})),fm.set(e,{url:t,promise:a}),a}parse(e,t,r){this.decodeObjects(e,"").then(t).catch(r)}_compareMaterials(e){const t={};t.name=e.name,t.color={},t.color.r=e.color.r,t.color.g=e.color.g,t.color.b=e.color.b,t.type=e.type;for(let r=0;r<this.materials.length;r++){const e=this.materials[r],n={};if(n.name=e.name,n.color={},n.color.r=e.color.r,n.color.g=e.color.g,n.color.b=e.color.b,n.type=e.type,JSON.stringify(t)===JSON.stringify(n))return e}return this.materials.push(e),e}_createMaterial(e){if(void 0===e)return new n.MeshStandardMaterial({color:new n.Color(1,1,1),metalness:.8,name:"default",side:2});const t=e.diffuseColor,r=new n.Color(t.r/255,t.g/255,t.b/255);0===t.r&&0===t.g&&0===t.b&&(r.r=1,r.g=1,r.b=1);const i=new n.MeshStandardMaterial({color:r,name:e.name,side:2,transparent:e.transparency>0,opacity:1-e.transparency}),a=new n.TextureLoader;for(let n=0;n<e.textures.length;n++){const t=e.textures[n];if(null!==t.image){const e=a.load(t.image);switch(t.type){case"Diffuse":i.map=e;break;case"Bump":i.bumpMap=e;break;case"Transparency":i.alphaMap=e,i.transparent=!0;break;case"Emap":i.envMap=e}}}return i}_createGeometry(e){const t=new n.Object3D,r=[],i=[],a=[];t.userData.layers=e.layers,t.userData.groups=e.groups,t.userData.settings=e.settings,t.userData.objectType="File3dm",t.userData.materials=null,t.name=this.url;let s=e.objects;const o=e.materials;for(let n=0;n<s.length;n++){const l=s[n],c=l.attributes;switch(l.objectType){case"InstanceDefinition":i.push(l);break;case"InstanceReference":a.push(l);break;default:let n;if(c.materialIndex>=0){const e=o[c.materialIndex];let t=this._createMaterial(e);t=this._compareMaterials(t),n=this._createObject(l,t)}else{const e=this._createMaterial();n=this._createObject(l,e)}if(void 0===n)continue;const s=e.layers[c.layerIndex];n.visible=!s||e.layers[c.layerIndex].visible,c.isInstanceDefinitionObject?r.push(n):t.add(n)}}for(let l=0;l<i.length;l++){const e=i[l];s=[];for(let t=0;t<e.attributes.objectIds.length;t++){const n=e.attributes.objectIds[t];for(let e=0;e<r.length;e++){n===r[e].userData.attributes.id&&s.push(r[e])}}for(let r=0;r<a.length;r++){const i=a[r];if(i.geometry.parentIdefId===e.attributes.id){const e=new n.Object3D,r=i.geometry.xform.array,a=new n.Matrix4;a.set(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]),e.applyMatrix4(a);for(let t=0;t<s.length;t++)e.add(s[t].clone(!0));t.add(e)}}}return t.userData.materials=this.materials,t}_createObject(e,t){const r=new n.BufferGeometryLoader,i=e.attributes;let a,s,o,l;switch(e.objectType){case"Point":case"PointSet":a=r.parse(e.geometry),a.attributes.hasOwnProperty("color")?s=new n.PointsMaterial({vertexColors:!0,sizeAttenuation:!1,size:2}):(o=i.drawColor,l=new n.Color(o.r/255,o.g/255,o.b/255),s=new n.PointsMaterial({color:l,sizeAttenuation:!1,size:2})),s=this._compareMaterials(s);const c=new n.Points(a,s);return c.userData.attributes=i,c.userData.objectType=e.objectType,i.name&&(c.name=i.name),c;case"Mesh":case"Extrusion":case"SubD":case"Brep":if(null===e.geometry)return;a=r.parse(e.geometry),a.attributes.hasOwnProperty("color")&&(t.vertexColors=!0),null===t&&(t=this._createMaterial(),t=this._compareMaterials(t));const u=new n.Mesh(a,t);return u.castShadow=i.castsShadows,u.receiveShadow=i.receivesShadows,u.userData.attributes=i,u.userData.objectType=e.objectType,i.name&&(u.name=i.name),u;case"Curve":a=r.parse(e.geometry),o=i.drawColor,l=new n.Color(o.r/255,o.g/255,o.b/255),s=new n.LineBasicMaterial({color:l}),s=this._compareMaterials(s);const h=new n.Line(a,s);return h.userData.attributes=i,h.userData.objectType=e.objectType,i.name&&(h.name=i.name),h;case"TextDot":a=e.geometry;const d=document.createElement("canvas").getContext("2d"),p=`${a.fontHeight}px ${a.fontFace}`;d.font=p;const f=d.measureText(a.text).width+10,m=a.fontHeight+10,g=window.devicePixelRatio;d.canvas.width=f*g,d.canvas.height=m*g,d.canvas.style.width=f+"px",d.canvas.style.height=m+"px",d.setTransform(g,0,0,g,0,0),d.font=p,d.textBaseline="middle",d.textAlign="center",l=i.drawColor,d.fillStyle=`rgba(${l.r},${l.g},${l.b},${l.a})`,d.fillRect(0,0,f,m),d.fillStyle="white",d.fillText(a.text,f/2,m/2);const v=new n.CanvasTexture(d.canvas);v.minFilter=n.LinearFilter,v.wrapS=n.ClampToEdgeWrapping,v.wrapT=n.ClampToEdgeWrapping,s=new n.SpriteMaterial({map:v,depthTest:!1});const A=new n.Sprite(s);return A.position.set(a.point[0],a.point[1],a.point[2]),A.scale.set(f/10,m/10,1),A.userData.attributes=i,A.userData.objectType=e.objectType,i.name&&(A.name=i.name),A;case"Light":let y;if(a=e.geometry,a.isDirectionalLight)y=new n.DirectionalLight,y.castShadow=i.castsShadows,y.position.set(a.location[0],a.location[1],a.location[2]),y.target.position.set(a.direction[0],a.direction[1],a.direction[2]),y.shadow.normalBias=.1;else if(a.isPointLight)y=new n.PointLight,y.castShadow=i.castsShadows,y.position.set(a.location[0],a.location[1],a.location[2]),y.shadow.normalBias=.1;else if(a.isRectangularLight){y=new n.RectAreaLight;const e=Math.abs(a.width[2]),t=Math.abs(a.length[0]);y.position.set(a.location[0]-t/2,a.location[1],a.location[2]-e/2),y.height=t,y.width=e,y.lookAt(new n.Vector3(a.direction[0],a.direction[1],a.direction[2]))}else if(a.isSpotLight)y=new n.SpotLight,y.castShadow=i.castsShadows,y.position.set(a.location[0],a.location[1],a.location[2]),y.target.position.set(a.direction[0],a.direction[1],a.direction[2]),y.angle=a.spotAngleRadians,y.shadow.normalBias=.1;else if(a.isLinearLight)return void console.warn("THREE.3DMLoader: No conversion exists for linear lights.");return y&&(y.intensity=a.intensity,o=a.diffuse,l=new n.Color(o.r/255,o.g/255,o.b/255),y.color=l,y.userData.attributes=i,y.userData.objectType=e.objectType),y}}_initLibrary(){if(!this.libraryPending){const e=new n.FileLoader(this.manager);e.setPath(this.libraryPath);const t=new Promise(((t,r)=>{e.load("rhino3dm.js",t,void 0,r)})),r=new n.FileLoader(this.manager);r.setPath(this.libraryPath),r.setResponseType("arraybuffer");const i=new Promise(((e,t)=>{r.load("rhino3dm.wasm",e,void 0,t)}));this.libraryPending=Promise.all([t,i]).then((([e,t])=>{this.libraryConfig.wasmBinary=t;const r=gm.toString(),n=["/* rhino3dm.js */",e,"/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))}))}return this.libraryPending}_getWorker(e){return this._initLibrary().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",libraryConfig:this.libraryConfig}),e.onmessage=function(t){const r=t.data;switch(r.type){case"decode":e._callbacks[r.id].resolve(r);break;case"error":e._callbacks[r.id].reject(r);break;default:console.error('THREE.Rhino3dmLoader: Unexpected message, "'+r.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const t=this.workerPool[this.workerPool.length-1];return t._taskLoad+=e,t}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function gm(){let e,t,r;function n(e,t){const n=e.geometry(),s=e.attributes();let o,l,c,u,h,d=n.objectType;switch(d){case r.ObjectType.Curve:const e=a(n,100);c={},l={},u={},c.itemSize=3,c.type="Float32Array",c.array=[];for(let t=0;t<e.length;t++)c.array.push(e[t][0]),c.array.push(e[t][1]),c.array.push(e[t][2]);l.position=c,u.attributes=l,o={data:u};break;case r.ObjectType.Point:const p=n.location;c={};const f={};l={},u={},c.itemSize=3,c.type="Float32Array",c.array=[p[0],p[1],p[2]];const m=s.drawColor(t);f.itemSize=3,f.type="Float32Array",f.array=[m.r/255,m.g/255,m.b/255],l.position=c,l.color=f,u.attributes=l,o={data:u};break;case r.ObjectType.PointSet:case r.ObjectType.Mesh:o=n.toThreejsJSON();break;case r.ObjectType.Brep:const g=n.faces();h=new r.Mesh;for(let t=0;t<g.count;t++){const e=g.get(t),n=e.getMesh(r.MeshType.Any);n&&(h.append(n),n.delete()),e.delete()}h.faces().count>0&&(h.compact(),o=h.toThreejsJSON(),g.delete()),h.delete();break;case r.ObjectType.Extrusion:h=n.getMesh(r.MeshType.Any),h&&(o=h.toThreejsJSON(),h.delete());break;case r.ObjectType.TextDot:case r.ObjectType.Light:o=i(n);break;case r.ObjectType.InstanceReference:o=i(n),o.xform=i(n.xform),o.xform.array=n.xform.toFloatArray(!0);break;case r.ObjectType.SubD:n.subdivide(3),h=r.Mesh.createFromSubDControlNet(n),h&&(o=h.toThreejsJSON(),h.delete());break;default:console.warn(`THREE.3DMLoader: TODO: Implement ${d.constructor.name}`)}if(o)return l=i(s),l.geometry=i(n),s.groupCount>0&&(l.groupIds=s.getGroupList()),s.userStringCount>0&&(l.userStrings=s.getUserStrings()),n.userStringCount>0&&(l.geometry.userStrings=n.getUserStrings()),l.drawColor=s.drawColor(t),d=d.constructor.name,d=d.substring(11,d.length),{geometry:o,attributes:l,objectType:d};console.warn(`THREE.3DMLoader: ${d.constructor.name} has no associated mesh geometry.`)}function i(e){const t={};for(const r in e){const n=e[r];"function"!=typeof n&&("object"==typeof n&&null!==n&&n.hasOwnProperty("constructor")?t[r]={name:n.constructor.name,value:n.value}:t[r]=n)}return t}function a(e,t){let n=t,i=[];const s=[];if(e instanceof r.LineCurve)return[e.pointAtStart,e.pointAtEnd];if(e instanceof r.PolylineCurve){n=e.pointCount;for(let t=0;t<n;t++)i.push(e.point(t));return i}if(e instanceof r.PolyCurve){const t=e.segmentCount;for(let r=0;r<t;r++){const t=e.segmentCurve(r),s=a(t,n);i=i.concat(s),t.delete()}return i}if(e instanceof r.ArcCurve&&(n=Math.floor(e.angleDegrees/5),n=n<2?2:n),e instanceof r.NurbsCurve&&1===e.degree){const t=e.tryGetPolyline();for(let e=0;e<t.count;e++)i.push(t.get(e));return t.delete(),i}const o=e.domain,l=n-1;for(let r=0;r<n;r++){const t=o[0]+r/l*(o[1]-o[0]);if(t===o[0]||t===o[1]){s.push(t);continue}const n=e.tangentAt(t),i=e.tangentAt(s.slice(-1)[0]),a=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],c=i[0]*i[0]+i[1]*i[1]+i[2]*i[2],u=Math.sqrt(a*c);let h;if(0===u)h=Math.PI/2;else{const e=(n.x*i.x+n.y*i.y+n.z*i.z)/u;h=Math.acos(Math.max(-1,Math.min(1,e)))}h<.1||s.push(t)}return i=s.map((t=>e.pointAt(t))),i}onmessage=function(a){const s=a.data;switch(s.type){case"init":t=s.libraryConfig;const a=t.wasmBinary;let o;e=new Promise((function(e){o={wasmBinary:a,onRuntimeInitialized:e},rhino3dm(o)})).then((()=>{r=o}));break;case"decode":const l=s.buffer;e.then((()=>{const e=function(e,t){const r=new Uint8Array(t),a=e.File3dm.fromByteArray(r),s=[],o=[],l=[],c=[],u=[],h=[],d=a.objects(),p=d.count;for(let i=0;i<p;i++){const e=d.get(i),t=n(e,a);e.delete(),t&&s.push(t)}for(let n=0;n<a.instanceDefinitions().count();n++){const e=a.instanceDefinitions().get(n),t=i(e);t.objectIds=e.getObjectIds(),s.push({geometry:null,attributes:t,objectType:"InstanceDefinition"})}const f=[e.TextureType.Diffuse,e.TextureType.Bump,e.TextureType.Transparency,e.TextureType.Opacity,e.TextureType.Emap],m=[e.TextureType.PBR_BaseColor,e.TextureType.PBR_Subsurface,e.TextureType.PBR_SubsurfaceScattering,e.TextureType.PBR_SubsurfaceScatteringRadius,e.TextureType.PBR_Metallic,e.TextureType.PBR_Specular,e.TextureType.PBR_SpecularTint,e.TextureType.PBR_Roughness,e.TextureType.PBR_Anisotropic,e.TextureType.PBR_Anisotropic_Rotation,e.TextureType.PBR_Sheen,e.TextureType.PBR_SheenTint,e.TextureType.PBR_Clearcoat,e.TextureType.PBR_ClearcoatBump,e.TextureType.PBR_ClearcoatRoughness,e.TextureType.PBR_OpacityIor,e.TextureType.PBR_OpacityRoughness,e.TextureType.PBR_Emission,e.TextureType.PBR_AmbientOcclusion,e.TextureType.PBR_Displacement];for(let n=0;n<a.materials().count();n++){const e=a.materials().get(n),t=e.physicallyBased();let r=i(e);const s=[];for(let n=0;n<f.length;n++){const t=e.getTexture(f[n]);if(t){let e=f[n].constructor.name;e=e.substring(12,e.length);const r={type:e},i=a.getEmbeddedFileAsBase64(t.fileName);i?r.image="data:image/png;base64,"+i:(console.warn(`THREE.3DMLoader: Image for ${e} texture not embedded in file.`),r.image=null),s.push(r),t.delete()}}if(r.textures=s,t.supported){console.log("pbr true");for(let r=0;r<m.length;r++){const t=e.getTexture(f[r]);if(t){const e=a.getEmbeddedFileAsBase64(t.fileName);let n=f[r].constructor.name;n=n.substring(12,n.length);const i={type:n,image:"data:image/png;base64,"+e};s.push(i),t.delete()}}const t=i(e.physicallyBased());r=Object.assign(t,r)}o.push(r),e.delete(),t.delete()}for(let n=0;n<a.layers().count();n++){const e=a.layers().get(n),t=i(e);l.push(t),e.delete()}for(let n=0;n<a.views().count();n++){const e=a.views().get(n),t=i(e);c.push(t),e.delete()}for(let n=0;n<a.namedViews().count();n++){const e=a.namedViews().get(n),t=i(e);u.push(t),e.delete()}for(let n=0;n<a.groups().count();n++){const e=a.groups().get(n),t=i(e);h.push(t),e.delete()}const g=i(a.settings());return a.delete(),{objects:s,materials:o,layers:l,views:c,namedViews:u,groups:h,settings:g}}(r,l);self.postMessage({type:"decode",id:s.id,data:e})}))}}}const vm=/^[og]\s*(.+)?/,Am=/^mtllib /,ym=/^usemtl /,xm=/^usemap /,bm=new n.Vector3,wm=new n.Vector3,Em=new n.Vector3,Sm=new n.Vector3,Mm=new n.Vector3;function _m(){const e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=!1!==t);const r=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:!1!==t,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){const r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);const n={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){const t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(n),n},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){const t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){const e=r.clone(0);e.inherited=!0,this.object.materials.push(e)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){const r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){const r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){const n=this.vertices,i=this.object.geometry.vertices;i.push(n[e+0],n[e+1],n[e+2]),i.push(n[t+0],n[t+1],n[t+2]),i.push(n[r+0],n[r+1],n[r+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){const n=this.normals,i=this.object.geometry.normals;i.push(n[e+0],n[e+1],n[e+2]),i.push(n[t+0],n[t+1],n[t+2]),i.push(n[r+0],n[r+1],n[r+2])},addFaceNormal:function(e,t,r){const n=this.vertices,i=this.object.geometry.normals;bm.fromArray(n,e),wm.fromArray(n,t),Em.fromArray(n,r),Mm.subVectors(Em,wm),Sm.subVectors(bm,wm),Mm.cross(Sm),Mm.normalize(),i.push(Mm.x,Mm.y,Mm.z),i.push(Mm.x,Mm.y,Mm.z),i.push(Mm.x,Mm.y,Mm.z)},addColor:function(e,t,r){const n=this.colors,i=this.object.geometry.colors;void 0!==n[e]&&i.push(n[e+0],n[e+1],n[e+2]),void 0!==n[t]&&i.push(n[t+0],n[t+1],n[t+2]),void 0!==n[r]&&i.push(n[r+0],n[r+1],n[r+2])},addUV:function(e,t,r){const n=this.uvs,i=this.object.geometry.uvs;i.push(n[e+0],n[e+1]),i.push(n[t+0],n[t+1]),i.push(n[r+0],n[r+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,n,i,a,s,o,l){const c=this.vertices.length;let u=this.parseVertexIndex(e,c),h=this.parseVertexIndex(t,c),d=this.parseVertexIndex(r,c);if(this.addVertex(u,h,d),this.addColor(u,h,d),void 0!==s&&""!==s){const e=this.normals.length;u=this.parseNormalIndex(s,e),h=this.parseNormalIndex(o,e),d=this.parseNormalIndex(l,e),this.addNormal(u,h,d)}else this.addFaceNormal(u,h,d);if(void 0!==n&&""!==n){const e=this.uvs.length;u=this.parseUVIndex(n,e),h=this.parseUVIndex(i,e),d=this.parseUVIndex(a,e),this.addUV(u,h,d),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let r=0,n=e.length;r<n;r++){const n=this.parseVertexIndex(e[r],t);this.addVertexPoint(n),this.addColor(n)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const r=this.vertices.length,n=this.uvs.length;for(let i=0,a=e.length;i<a;i++)this.addVertexLine(this.parseVertexIndex(e[i],r));for(let i=0,a=t.length;i<a;i++)this.addUVLine(this.parseUVIndex(t[i],n))}};return e.startObject("",!1),e}class Tm extends n.Loader{constructor(e){super(e),this.materials=null}load(e,t,r,i){const a=this,s=new n.FileLoader(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}setMaterials(e){return this.materials=e,this}parse(e){const t=new _m;-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n")),-1!==e.indexOf("\\\n")&&(e=e.replace(/\\\n/g,""));const r=e.split("\n");let i="",a="",s=0,o=[];const l="function"==typeof"".trimLeft;for(let n=0,u=r.length;n<u;n++)if(i=r[n],i=l?i.trimLeft():i.trim(),s=i.length,0!==s&&(a=i.charAt(0),"#"!==a))if("v"===a){const e=i.split(/\s+/);switch(e[0]){case"v":t.vertices.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])),e.length>=7?t.colors.push(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6])):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]));break;case"vt":t.uvs.push(parseFloat(e[1]),parseFloat(e[2]))}}else if("f"===a){const e=i.substr(1).trim().split(/\s+/),r=[];for(let t=0,i=e.length;t<i;t++){const n=e[t];if(n.length>0){const e=n.split("/");r.push(e)}}const n=r[0];for(let i=1,a=r.length-1;i<a;i++){const e=r[i],a=r[i+1];t.addFace(n[0],e[0],a[0],n[1],e[1],a[1],n[2],e[2],a[2])}}else if("l"===a){const e=i.substring(1).trim().split(" ");let r=[];const n=[];if(-1===i.indexOf("/"))r=e;else for(let t=0,i=e.length;t<i;t++){const i=e[t].split("/");""!==i[0]&&r.push(i[0]),""!==i[1]&&n.push(i[1])}t.addLineGeometry(r,n)}else if("p"===a){const e=i.substr(1).trim().split(" ");t.addPointGeometry(e)}else if(null!==(o=vm.exec(i))){const e=(" "+o[0].substr(1).trim()).substr(1);t.startObject(e)}else if(ym.test(i))t.object.startMaterial(i.substring(7).trim(),t.materialLibraries);else if(Am.test(i))t.materialLibraries.push(i.substring(7).trim());else if(xm.test(i))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if("s"===a){if(o=i.split(" "),o.length>1){const e=o[1].trim().toLowerCase();t.object.smooth="0"!==e&&"off"!==e}else t.object.smooth=!0;const e=t.object.currentMaterial();e&&(e.smooth=t.object.smooth)}else{if("\0"===i)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+i+'"')}t.finalize();const c=new n.Group;c.materialLibraries=[].concat(t.materialLibraries);if(!0===!(1===t.objects.length&&0===t.objects[0].geometry.vertices.length))for(let u=0,h=t.objects.length;u<h;u++){const e=t.objects[u],r=e.geometry,i=e.materials,a="Line"===r.type,s="Points"===r.type;let o=!1;if(0===r.vertices.length)continue;const l=new n.BufferGeometry;l.setAttribute("position",new n.Float32BufferAttribute(r.vertices,3)),r.normals.length>0&&l.setAttribute("normal",new n.Float32BufferAttribute(r.normals,3)),r.colors.length>0&&(o=!0,l.setAttribute("color",new n.Float32BufferAttribute(r.colors,3))),!0===r.hasUVIndices&&l.setAttribute("uv",new n.Float32BufferAttribute(r.uvs,2));const h=[];for(let c=0,u=i.length;c<u;c++){const e=i[c],r=e.name+"_"+e.smooth+"_"+o;let l=t.materials[r];if(null!==this.materials)if(l=this.materials.create(e.name),!a||!l||l instanceof n.LineBasicMaterial){if(s&&l&&!(l instanceof n.PointsMaterial)){const e=new n.PointsMaterial({size:10,sizeAttenuation:!1});n.Material.prototype.copy.call(e,l),e.color.copy(l.color),e.map=l.map,l=e}}else{const e=new n.LineBasicMaterial;n.Material.prototype.copy.call(e,l),e.color.copy(l.color),l=e}void 0===l&&(l=a?new n.LineBasicMaterial:s?new n.PointsMaterial({size:1,sizeAttenuation:!1}):new n.MeshPhongMaterial,l.name=e.name,l.flatShading=!e.smooth,l.vertexColors=o,t.materials[r]=l),h.push(l)}let d;if(h.length>1){for(let e=0,t=i.length;e<t;e++){const t=i[e];l.addGroup(t.groupStart,t.groupCount,e)}d=a?new n.LineSegments(l,h):s?new n.Points(l,h):new n.Mesh(l,h)}else d=a?new n.LineSegments(l,h[0]):s?new n.Points(l,h[0]):new n.Mesh(l,h[0]);d.name=e.name,c.add(d)}else if(t.vertices.length>0){const e=new n.PointsMaterial({size:1,sizeAttenuation:!1}),r=new n.BufferGeometry;r.setAttribute("position",new n.Float32BufferAttribute(t.vertices,3)),t.colors.length>0&&void 0!==t.colors[0]&&(r.setAttribute("color",new n.Float32BufferAttribute(t.colors,3)),e.vertexColors=!0);const i=new n.Points(r,e);c.add(i)}return c}}class Cm extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=this,s=new n.FileLoader(a.manager);s.setPath(a.path),s.setResponseType("arraybuffer"),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){function t(e){let t="AMF Material";const i=e.attributes.id.textContent;let a={r:1,g:1,b:1,a:1},s=null;for(let n=0;n<e.childNodes.length;n++){const i=e.childNodes[n];"metadata"===i.nodeName&&void 0!==i.attributes.type?"name"===i.attributes.type.value&&(t=i.textContent):"color"===i.nodeName&&(a=r(i))}return s=new n.MeshPhongMaterial({flatShading:!0,color:new n.Color(a.r,a.g,a.b),name:t}),1!==a.a&&(s.transparent=!0,s.opacity=a.a),{id:i,material:s}}function r(e){const t={r:1,g:1,b:1,a:1};for(let r=0;r<e.childNodes.length;r++){const n=e.childNodes[r];"r"===n.nodeName?t.r=n.textContent:"g"===n.nodeName?t.g=n.textContent:"b"===n.nodeName?t.b=n.textContent:"a"===n.nodeName&&(t.a=n.textContent)}return t}function i(e){const t={name:"",triangles:[],materialid:null};let r=e.firstElementChild;for(void 0!==e.attributes.materialid&&(t.materialId=e.attributes.materialid.nodeValue);r;){if("metadata"===r.nodeName)void 0!==r.attributes.type&&"name"===r.attributes.type.value&&(t.name=r.textContent);else if("triangle"===r.nodeName){const e=r.getElementsByTagName("v1")[0].textContent,n=r.getElementsByTagName("v2")[0].textContent,i=r.getElementsByTagName("v3")[0].textContent;t.triangles.push(e,n,i)}r=r.nextElementSibling}return t}function a(e){const t=[],r=[];let n=e.firstElementChild;for(;n;){if("vertex"===n.nodeName){let e=n.firstElementChild;for(;e;){if("coordinates"===e.nodeName){const r=e.getElementsByTagName("x")[0].textContent,n=e.getElementsByTagName("y")[0].textContent,i=e.getElementsByTagName("z")[0].textContent;t.push(r,n,i)}else if("normal"===e.nodeName){const t=e.getElementsByTagName("nx")[0].textContent,n=e.getElementsByTagName("ny")[0].textContent,i=e.getElementsByTagName("nz")[0].textContent;r.push(t,n,i)}e=e.nextElementSibling}}n=n.nextElementSibling}return{vertices:t,normals:r}}function s(e){const t=e.attributes.id.textContent,n={name:"amfobject",meshes:[]};let s=null,o=e.firstElementChild;for(;o;){if("metadata"===o.nodeName)void 0!==o.attributes.type&&"name"===o.attributes.type.value&&(n.name=o.textContent);else if("color"===o.nodeName)s=r(o);else if("mesh"===o.nodeName){let e=o.firstElementChild;const t={vertices:[],normals:[],volumes:[],color:s};for(;e;){if("vertices"===e.nodeName){const r=a(e);t.normals=t.normals.concat(r.normals),t.vertices=t.vertices.concat(r.vertices)}else"volume"===e.nodeName&&t.volumes.push(i(e));e=e.nextElementSibling}n.meshes.push(t)}o=o.nextElementSibling}return{id:t,obj:n}}const o=function(e){let t=new DataView(e);if("PK"===String.fromCharCode(t.getUint8(0),t.getUint8(1))){let r=null,n=null;console.log("THREE.AMFLoader: Loading Zip");try{r=(0,Lt.GZ)(new Uint8Array(e))}catch(a){if(a instanceof ReferenceError)return console.log("THREE.AMFLoader: fflate missing and file is compressed."),null}for(n in r)if(".amf"===n.toLowerCase().substr(-4))break;console.log("THREE.AMFLoader: Trying to load file asset: "+n),t=new DataView(r[n].buffer)}const r=n.LoaderUtils.decodeText(t),i=(new DOMParser).parseFromString(r,"application/xml");return"amf"!==i.documentElement.nodeName.toLowerCase()?(console.log("THREE.AMFLoader: Error loading AMF - no AMF document found."),null):i}(e);let l="",c="";const u=function(e){let t=1,r="millimeter";void 0!==e.documentElement.attributes.unit&&(r=e.documentElement.attributes.unit.value.toLowerCase());const n={millimeter:1,inch:25.4,feet:304.8,meter:1e3,micron:.001};return void 0!==n[r]&&(t=n[r]),console.log("THREE.AMFLoader: Unit scale: "+t),t}(o),h={},d={},p=o.documentElement.childNodes;let f,m;for(f=0;f<p.length;f++){const e=p[f];if("metadata"===e.nodeName)void 0!==e.attributes.type&&("name"===e.attributes.type.value?l=e.textContent:"author"===e.attributes.type.value&&(c=e.textContent));else if("material"===e.nodeName){const r=t(e);h[r.id]=r.material}else if("object"===e.nodeName){const t=s(e);d[t.id]=t.obj}}const g=new n.Group,v=new n.MeshPhongMaterial({color:11184895,flatShading:!0});g.name=l,g.userData.author=c,g.userData.loader="AMF";for(const A in d){const e=d[A],t=e.meshes,r=new n.Group;for(r.name=e.name||"",f=0;f<t.length;f++){let e=v;const i=t[f],a=new n.Float32BufferAttribute(i.vertices,3);let s=null;if(i.normals.length&&(s=new n.Float32BufferAttribute(i.normals,3)),i.color){const t=i.color;e=v.clone(),e.color=new n.Color(t.r,t.g,t.b),1!==t.a&&(e.transparent=!0,e.opacity=t.a)}const o=i.volumes;for(m=0;m<o.length;m++){const t=o[m],i=new n.BufferGeometry;let l=e;i.setIndex(t.triangles),i.setAttribute("position",a.clone()),s&&i.setAttribute("normal",s.clone()),void 0!==h[t.materialId]&&(l=h[t.materialId]),i.scale(u,u,u),r.add(new n.Mesh(i,l.clone()))}}g.add(r)}return g}}class Im extends n.Loader{constructor(e){super(e),this.loader=new n.FileLoader(this.manager),this.parser=null,this.meshBuilder=new Rm(this.manager),this.animationBuilder=new Lm}setAnimationPath(e){return this.animationPath=e,this}load(e,t,r,i){const a=this.meshBuilder.setCrossOrigin(this.crossOrigin);let s;s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:n.LoaderUtils.extractUrlBase(e);const o=this._extractExtension(e).toLowerCase();"pmd"===o||"pmx"===o?this["pmd"===o?"loadPMD":"loadPMX"](e,(function(e){t(a.build(e,s,r,i))}),r,i):i&&i(new Error("THREE.MMDLoader: Unknown model file extension ."+o+"."))}loadAnimation(e,t,r,n,i){const a=this.animationBuilder;this.loadVMD(e,(function(e){r(t.isCamera?a.buildCameraAnimation(e):a.build(e,t))}),n,i)}loadWithAnimation(e,t,r,n,i){const a=this;this.load(e,(function(e){a.loadAnimation(t,e,(function(t){r({mesh:e,animation:t})}),n,i)}),n,i)}loadPMD(e,t,r,n){const i=this._getParser();this.loader.setMimeType(void 0).setPath(this.path).setResponseType("arraybuffer").setRequestHeader(this.requestHeader).setWithCredentials(this.withCredentials).load(e,(function(e){t(i.parsePmd(e,!0))}),r,n)}loadPMX(e,t,r,n){const i=this._getParser();this.loader.setMimeType(void 0).setPath(this.path).setResponseType("arraybuffer").setRequestHeader(this.requestHeader).setWithCredentials(this.withCredentials).load(e,(function(e){t(i.parsePmx(e,!0))}),r,n)}loadVMD(e,t,r,n){const i=Array.isArray(e)?e:[e],a=[],s=i.length,o=this._getParser();this.loader.setMimeType(void 0).setPath(this.animationPath).setResponseType("arraybuffer").setRequestHeader(this.requestHeader).setWithCredentials(this.withCredentials);for(let l=0,c=i.length;l<c;l++)this.loader.load(i[l],(function(e){a.push(o.parseVmd(e,!0)),a.length===s&&t(o.mergeVmds(a))}),r,n)}loadVPD(e,t,r,n,i){const a=this._getParser();this.loader.setMimeType(t?void 0:"text/plain; charset=shift_jis").setPath(this.animationPath).setResponseType("text").setRequestHeader(this.requestHeader).setWithCredentials(this.withCredentials).load(e,(function(e){r(a.parseVpd(e,!0))}),n,i)}_extractExtension(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t+1)}_getParser(){return null===this.parser&&(this.parser=new Wt.Parser),this.parser}}const Bm=["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAN0lEQVRYR+3WQREAMBACsZ5/bWiiMvgEBTt5cW37hjsBBAgQIECAwFwgyfYPCCBAgAABAgTWAh8aBHZBl14e8wAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAOUlEQVRYR+3WMREAMAwDsYY/yoDI7MLwIiP40+RJklfcCCBAgAABAgTqArfb/QMCCBAgQIAAgbbAB3z/e0F3js2cAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAN0lEQVRYR+3WQREAMBACsZ5/B5ilMvgEBTt5cW37hjsBBAgQIECAwFwgyfYPCCBAgAABAgTWAh81dWyx0gFwKAAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAOklEQVRYR+3WoREAMAwDsWb/UQtCy9wxTOQJ/oQ8SXKKGwEECBAgQIBAXeDt7f4BAQQIECBAgEBb4AOz8Hzx7WLY4wAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABPUlEQVRYR+1XwW7CMAy1+f9fZOMysSEOEweEOPRNdm3HbdOyIhAcklPrOs/PLy9RygBALxzcCDQFmgJNgaZAU6Ap0BR4PwX8gsRMVLssMRH5HcpzJEaWL7EVg9F1IHRlyqQohgVr4FGUlUcMJSjcUlDw0zvjeun70cLWmneoyf7NgBTQSniBTQQSuJAZsOnnaczjIMb5hCiuHKxokCrJfVnrctyZL0PkJAJe1HMil4nxeyi3Ypfn1kX51jpPvo/JeCNC4PhVdHdJw2XjBR8brF8PEIhNVn12AgP7uHsTBguBn53MUZCqv7Lp07Pn5k1Ro+uWmUNn7D+M57rtk7aG0Vo73xyF/fbFf0bPJjDXngnGocDTdFhygZjwUQrMNrDcmZlQT50VJ/g/UwNyHpu778+yW+/ksOz/BFo54P4AsUXMfRq7XWsAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACMElEQVRYR+2Xv4pTQRTGf2dubhLdICiii2KnYKHVolhauKWPoGAnNr6BD6CvIVaihYuI2i1ia0BY0MZGRHQXjZj/mSPnnskfNWiWZUlzJ5k7M2cm833nO5Mziej2DWWJRUoCpQKlAntSQCqgw39/iUWAGmh37jrRnVsKlgpiqmkoGVABA7E57fvY+pJDdgKqF6HzFCSADkDq+F6AHABtQ+UMVE5D7zXod7fFNhTEckTbj5XQgHzNN+5tQvc5NG7C6BNkp6D3EmpXHDR+dQAjFLchW3VS9rlw3JBh+B7ys5Cf9z0GW1C/7P32AyBAOAz1q4jGliIH3YPuBnSfQX4OGreTIgEYQb/pBDtPnEQ4CivXYPAWBk13oHrB54yA9QuSn2H4AcKRpEILDt0BUzj+RLR1V5EqjD66NPRBVpLcQwjHoHYJOhsQv6U4mnzmrIXJCFr4LDwm/xBUoboG9XX4cc9VKdYoSA2yk5NQLJaKDUjTBoveG3Z2TElTxwjNK4M3LEZgUdDdruvcXzKBpStgp2NPiWi3ks9ZXxIoFVi+AvHLdc9TqtjL3/aYjpPlrzOcEnK62Szhimdd7xX232zFDTgtxezOu3WNMRLjiKgjtOhHVMd1loynVHvOgjuIIJMaELEqhJAV/RCSLbWTcfPFakFgFlALTRRvx+ok6Hlp/Q+v3fmx90bMyUzaEAhmM3KvHlXTL5DxnbGf/1M8RNNACLL5MNtPxP/mypJAqcDSFfgFhpYqWUzhTEAAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII="];class Rm{constructor(e){this.crossOrigin="anonymous",this.geometryBuilder=new Pm,this.materialBuilder=new Fm(e)}setCrossOrigin(e){return this.crossOrigin=e,this}build(e,t,r,i){const a=this.geometryBuilder.build(e),s=this.materialBuilder.setCrossOrigin(this.crossOrigin).setResourcePath(t).build(e,a,r,i),o=new n.SkinnedMesh(a,s),l=new n.Skeleton(function(e){const t=e.geometry,r=[];if(t&&void 0!==t.bones){for(let e=0,i=t.bones.length;e<i;e++){const i=t.bones[e],a=new n.Bone;r.push(a),a.name=i.name,a.position.fromArray(i.pos),a.quaternion.fromArray(i.rotq),void 0!==i.scl&&a.scale.fromArray(i.scl)}for(let n=0,i=t.bones.length;n<i;n++){const i=t.bones[n];-1!==i.parent&&null!==i.parent&&void 0!==r[i.parent]?r[i.parent].add(r[n]):e.add(r[n])}}return e.updateMatrixWorld(!0),r}(o));return o.bind(l),o}}class Pm{build(e){const t=[],r=[],i=[],a=[],s=[],o=[],l=[],c=[],u=[],h=[],d=[],p=[],f=[],m=[];let g=0;const v={};for(let n=0;n<e.metadata.vertexCount;n++){const a=e.vertices[n];for(let e=0,r=a.position.length;e<r;e++)t.push(a.position[e]);for(let e=0,t=a.normal.length;e<t;e++)i.push(a.normal[e]);for(let e=0,t=a.uv.length;e<t;e++)r.push(a.uv[e]);for(let e=0;e<4;e++)l.push(a.skinIndices.length-1>=e?a.skinIndices[e]:0);for(let e=0;e<4;e++)c.push(a.skinWeights.length-1>=e?a.skinWeights[e]:0)}for(let n=0;n<e.metadata.faceCount;n++){const t=e.faces[n];for(let e=0,r=t.indices.length;e<r;e++)a.push(t.indices[e])}for(let n=0;n<e.metadata.materialCount;n++){const t=e.materials[n];s.push({offset:3*g,count:3*t.faceCount}),g+=t.faceCount}for(let n=0;n<e.metadata.rigidBodyCount;n++){const t=e.rigidBodies[n];let r=v[t.boneIndex];r=void 0===r?t.type:Math.max(t.type,r),v[t.boneIndex]=r}for(let n=0;n<e.metadata.boneCount;n++){const t=e.bones[n],r={index:n,transformationClass:t.transformationClass,parent:t.parentIndex,name:t.name,pos:t.position.slice(0,3),rotq:[0,0,0,1],scl:[1,1,1],rigidBodyType:void 0!==v[n]?v[n]:-1};-1!==r.parent&&(r.pos[0]-=e.bones[r.parent].position[0],r.pos[1]-=e.bones[r.parent].position[1],r.pos[2]-=e.bones[r.parent].position[2]),o.push(r)}if("pmd"===e.metadata.format)for(let x=0;x<e.metadata.ikCount;x++){const t=e.iks[x],r={target:t.target,effector:t.effector,iteration:t.iteration,maxAngle:4*t.maxAngle,links:[]};for(let i=0,a=t.links.length;i<a;i++){const a={};a.index=t.links[i].index,a.enabled=!0,e.bones[a.index].name.indexOf("\u3072\u3056")>=0&&(a.limitation=new n.Vector3(1,0,0)),r.links.push(a)}d.push(r)}else for(let x=0;x<e.metadata.boneCount;x++){const t=e.bones[x].ik;if(void 0===t)continue;const r={target:x,effector:t.effector,iteration:t.iteration,maxAngle:t.maxAngle,links:[]};for(let e=0,i=t.links.length;e<i;e++){const i={};if(i.index=t.links[e].index,i.enabled=!0,1===t.links[e].angleLimitation){const r=t.links[e].lowerLimitationAngle,a=t.links[e].upperLimitationAngle,s=-a[0],o=-a[1];a[0]=-r[0],a[1]=-r[1],r[0]=s,r[1]=o,i.rotationMin=(new n.Vector3).fromArray(r),i.rotationMax=(new n.Vector3).fromArray(a)}r.links.push(i)}d.push(r),o[x].ik=r}if("pmx"===e.metadata.format){let t=function(e){e.param&&(p.push(e.param),o[e.param.index].grant=e.param),e.visited=!0;for(let r=0,n=e.children.length;r<n;r++){const n=e.children[r];n.visited||t(n)}};const r={};for(let i=0;i<e.metadata.boneCount;i++){const t=e.bones[i],n=t.grant;if(void 0===n)continue;const a={index:i,parentIndex:n.parentIndex,ratio:n.ratio,isLocal:n.isLocal,affectRotation:n.affectRotation,affectPosition:n.affectPosition,transformationClass:t.transformationClass};r[i]={parent:null,children:[],param:a,visited:!1}}const n={parent:null,children:[],param:null,visited:!1};for(const e in r){const t=r[e],i=r[t.parentIndex]||n;t.parent=i,i.children.push(t)}t(n)}function A(t,r,n){for(let i=0;i<r.elementCount;i++){const a=r.elements[i];let s;s="pmd"===e.metadata.format?e.morphs[0].elements[a.index].index:a.index,t.array[3*s+0]+=a.position[0]*n,t.array[3*s+1]+=a.position[1]*n,t.array[3*s+2]+=a.position[2]*n}}for(let x=0;x<e.metadata.morphCount;x++){const r=e.morphs[x],i={name:r.name},a=new n.Float32BufferAttribute(3*e.metadata.vertexCount,3);a.name=r.name;for(let n=0;n<3*e.metadata.vertexCount;n++)a.array[n]=t[n];if("pmd"===e.metadata.format)0!==x&&A(a,r,1);else if(0===r.type)for(let t=0;t<r.elementCount;t++){const n=e.morphs[r.elements[t].index],i=r.elements[t].ratio;1===n.type&&A(a,n,i)}else 1===r.type?A(a,r,1):2===r.type||3===r.type||4===r.type||5===r.type||6===r.type||7===r.type||r.type;u.push(i),h.push(a)}for(let n=0;n<e.metadata.rigidBodyCount;n++){const t=e.rigidBodies[n],r={};for(const e in t)r[e]=t[e];if("pmx"===e.metadata.format&&-1!==r.boneIndex){const t=e.bones[r.boneIndex];r.position[0]-=t.position[0],r.position[1]-=t.position[1],r.position[2]-=t.position[2]}f.push(r)}for(let n=0;n<e.metadata.constraintCount;n++){const t=e.constraints[n],r={};for(const e in t)r[e]=t[e];const i=f[r.rigidBodyIndex1],a=f[r.rigidBodyIndex2];0!==i.type&&2===a.type&&-1!==i.boneIndex&&-1!==a.boneIndex&&e.bones[a.boneIndex].parentIndex===i.boneIndex&&(a.type=1),m.push(r)}const y=new n.BufferGeometry;y.setAttribute("position",new n.Float32BufferAttribute(t,3)),y.setAttribute("normal",new n.Float32BufferAttribute(i,3)),y.setAttribute("uv",new n.Float32BufferAttribute(r,2)),y.setAttribute("skinIndex",new n.Uint16BufferAttribute(l,4)),y.setAttribute("skinWeight",new n.Float32BufferAttribute(c,4)),y.setIndex(a);for(let n=0,x=s.length;n<x;n++)y.addGroup(s[n].offset,s[n].count,n);return y.bones=o,y.morphTargets=u,y.morphAttributes.position=h,y.morphTargetsRelative=!1,y.userData.MMD={bones:o,iks:d,grants:p,rigidBodies:f,constraints:m,format:e.metadata.format},y.computeBoundingSphere(),y}}class Fm{constructor(e){this.manager=e,this.textureLoader=new n.TextureLoader(this.manager),this.tgaLoader=null,this.crossOrigin="anonymous",this.resourcePath=void 0}setCrossOrigin(e){return this.crossOrigin=e,this}setResourcePath(e){return this.resourcePath=e,this}build(e,t){const r=[],i={};this.textureLoader.setCrossOrigin(this.crossOrigin);for(let a=0;a<e.metadata.materialCount;a++){const s=e.materials[a],o={userData:{}};if(void 0!==s.name&&(o.name=s.name),o.color=(new n.Color).fromArray(s.diffuse),o.opacity=s.diffuse[3],o.emissive=(new n.Color).fromArray(s.ambient),o.transparent=1!==o.opacity,o.skinning=t.bones.length>0,o.morphTargets=t.morphTargets.length>0,o.fog=!0,o.blending=n.CustomBlending,o.blendSrc=n.SrcAlphaFactor,o.blendDst=n.OneMinusSrcAlphaFactor,o.blendSrcAlpha=n.SrcAlphaFactor,o.blendDstAlpha=n.DstAlphaFactor,"pmx"===e.metadata.format&&1==(1&s.flag)?o.side=n.DoubleSide:o.side=1===o.opacity?n.FrontSide:n.DoubleSide,"pmd"===e.metadata.format){if(s.fileName){const e=s.fileName.split("*");if(o.map=this._loadTexture(e[0],i),e.length>1){const t=e[1].slice(-4).toLowerCase();o.envMap=this._loadTexture(e[1],i),o.combine=".sph"===t?n.MultiplyOperation:n.AddOperation}}const t=-1===s.toonIndex?"toon00.bmp":e.toonTextures[s.toonIndex].fileName;o.gradientMap=this._loadTexture(t,i,{isToonTexture:!0,isDefaultToonTexture:this._isDefaultToonTexture(t)}),o.userData.outlineParameters={thickness:1===s.edgeFlag?.003:0,color:[0,0,0],alpha:1,visible:1===s.edgeFlag}}else{let t,r;-1!==s.textureIndex&&(o.map=this._loadTexture(e.textures[s.textureIndex],i)),-1===s.envTextureIndex||1!==s.envFlag&&2!=s.envFlag||(o.envMap=this._loadTexture(e.textures[s.envTextureIndex],i),o.combine=1===s.envFlag?n.MultiplyOperation:n.AddOperation),-1===s.toonIndex||0!==s.toonFlag?(t="toon"+("0"+(s.toonIndex+1)).slice(-2)+".bmp",r=!0):(t=e.textures[s.toonIndex],r=!1),o.gradientMap=this._loadTexture(t,i,{isToonTexture:!0,isDefaultToonTexture:r}),o.userData.outlineParameters={thickness:s.edgeSize/300,color:s.edgeColor.slice(0,3),alpha:s.edgeColor[3],visible:0!=(16&s.flag)&&s.edgeSize>0}}void 0!==o.map&&(o.transparent||this._checkImageTransparency(o.map,t,a),o.emissive.multiplyScalar(.2)),r.push(new n.MeshToonMaterial(o))}if("pmx"===e.metadata.format){let t=function(e,t){for(let r=0,n=e.length;r<n;r++){const n=e[r];if(-1===n.index)continue;const i=t[n.index];i.opacity!==n.diffuse[3]&&(i.transparent=!0)}};for(let n=0,i=e.morphs.length;n<i;n++){const i=e.morphs[n],a=i.elements;if(0===i.type)for(let n=0,s=a.length;n<s;n++){const i=e.morphs[a[n].index];8===i.type&&t(i.elements,r)}else 8===i.type&&t(a,r)}}return r}_getTGALoader(){if(null===this.tgaLoader){if(void 0===Xl)throw new Error("THREE.MMDLoader: Import TGALoader");this.tgaLoader=new Xl(this.manager)}return this.tgaLoader}_isDefaultToonTexture(e){return 10===e.length&&/toon(10|0[0-9])\.bmp/.test(e)}_loadTexture(e,t,r,i,a){const s=this;let o;if(!0===(r=r||{}).isDefaultToonTexture){let t;try{t=parseInt(e.match(/toon([0-9]{2})\.bmp$/)[1])}catch(u){console.warn("THREE.MMDLoader: "+e+" seems like a not right default texture path. Using toon00.bmp instead."),t=0}o=Bm[t]}else o=this.resourcePath+e;if(void 0!==t[o])return t[o];let l=this.manager.getHandler(o);null===l&&(l=".tga"===e.slice(-4).toLowerCase()?this._getTGALoader():this.textureLoader);const c=l.load(o,(function(e){!0===r.isToonTexture&&(e.image=s._getRotatedImage(e.image),e.magFilter=n.NearestFilter,e.minFilter=n.NearestFilter),e.flipY=!1,e.wrapS=n.RepeatWrapping,e.wrapT=n.RepeatWrapping;for(let t=0;t<c.readyCallbacks.length;t++)c.readyCallbacks[t](c);delete c.readyCallbacks}),i,a);return c.readyCallbacks=[],t[o]=c,c}_getRotatedImage(e){const t=document.createElement("canvas"),r=t.getContext("2d"),n=e.width,i=e.height;return t.width=n,t.height=i,r.clearRect(0,0,n,i),r.translate(n/2,i/2),r.rotate(.5*Math.PI),r.translate(-n/2,-i/2),r.drawImage(e,0,0),r.getImageData(0,0,n,i)}_checkImageTransparency(e,t,r){e.readyCallbacks.push((function(n){function i(e,t){const r=e.width,n=e.height;let i=Math.round(t.x*r)%r,a=Math.round(t.y*n)%n;i<0&&(i+=r),a<0&&(a+=n);const s=a*r+i;return e.data[4*s+3]}const a=void 0!==n.image.data?n.image:function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");return r.drawImage(e,0,0),r.getImageData(0,0,t.width,t.height)}(n.image),s=t.groups[r];(function(e,t,r){const n=e.width,a=e.height;if(e.data.length/(n*a)!=4)return!1;for(let s=0;s<r.length;s+=3){const n={x:0,y:0};for(let a=0;a<3;a++){const o=r[3*s+a],l={x:t[2*o+0],y:t[2*o+1]};if(i(e,l)<253)return!0;n.x+=l.x,n.y+=l.y}if(n.x/=3,n.y/=3,i(e,n)<253)return!0}return!1})(a,t.attributes.uv.array,t.index.array.slice(s.start,s.start+s.count))&&(e.transparent=!0)}))}}class Lm{build(e,t){const r=this.buildSkeletalAnimation(e,t).tracks,i=this.buildMorphAnimation(e,t).tracks;for(let n=0,a=i.length;n<a;n++)r.push(i[n]);return new n.AnimationClip("",-1,r)}buildSkeletalAnimation(e,t){function r(e,t,r){e.push(t[r+0]/127),e.push(t[r+8]/127),e.push(t[r+4]/127),e.push(t[r+12]/127)}const i=[],a={},s=t.skeleton.bones,o={};for(let n=0,l=s.length;n<l;n++)o[s[n].name]=!0;for(let n=0;n<e.metadata.motionCount;n++){const t=e.motions[n],r=t.boneName;void 0!==o[r]&&(a[r]=a[r]||[],a[r].push(t))}for(const l in a){const e=a[l];e.sort((function(e,t){return e.frameNum-t.frameNum}));const s=[],o=[],c=[],u=[],h=[],d=t.skeleton.getBoneByName(l).position.toArray();for(let t=0,n=e.length;t<n;t++){const n=e[t].frameNum/30,i=e[t].position,a=e[t].rotation,l=e[t].interpolation;s.push(n);for(let e=0;e<3;e++)o.push(d[e]+i[e]);for(let e=0;e<4;e++)c.push(a[e]);for(let e=0;e<3;e++)r(u,l,e);r(h,l,3)}const p=".bones["+l+"]";i.push(this._createTrack(p+".position",n.VectorKeyframeTrack,s,o,u)),i.push(this._createTrack(p+".quaternion",n.QuaternionKeyframeTrack,s,c,h))}return new n.AnimationClip("",-1,i)}buildMorphAnimation(e,t){const r=[],i={},a=t.morphTargetDictionary;for(let n=0;n<e.metadata.morphCount;n++){const t=e.morphs[n],r=t.morphName;void 0!==a[r]&&(i[r]=i[r]||[],i[r].push(t))}for(const s in i){const e=i[s];e.sort((function(e,t){return e.frameNum-t.frameNum}));const t=[],o=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r].frameNum/30),o.push(e[r].weight);r.push(new n.NumberKeyframeTrack(".morphTargetInfluences["+a[s]+"]",t,o))}return new n.AnimationClip("",-1,r)}buildCameraAnimation(e){function t(e,t){e.push(t.x),e.push(t.y),e.push(t.z)}function r(e,t,r){e.push(t[4*r+0]/127),e.push(t[4*r+1]/127),e.push(t[4*r+2]/127),e.push(t[4*r+3]/127)}const i=void 0===e.cameras?[]:e.cameras.slice();i.sort((function(e,t){return e.frameNum-t.frameNum}));const a=[],s=[],o=[],l=[],c=[],u=[],h=[],d=[],p=[],f=new n.Quaternion,m=new n.Euler,g=new n.Vector3,v=new n.Vector3;for(let n=0,b=i.length;n<b;n++){const e=i[n],x=e.frameNum/30,b=e.position,w=e.rotation,E=e.distance,S=e.fov,M=e.interpolation;a.push(x),g.set(0,0,-E),v.set(b[0],b[1],b[2]),m.set(-w[0],-w[1],-w[2]),f.setFromEuler(m),g.add(v),g.applyQuaternion(f),t(s,v),(A=o).push((y=f).x),A.push(y.y),A.push(y.z),A.push(y.w),t(l,g),c.push(S);for(let t=0;t<3;t++)r(u,M,t);r(h,M,3);for(let t=0;t<3;t++)r(d,M,4);r(p,M,5)}var A,y;const x=[];return x.push(this._createTrack("target.position",n.VectorKeyframeTrack,a,s,u)),x.push(this._createTrack(".quaternion",n.QuaternionKeyframeTrack,a,o,h)),x.push(this._createTrack(".position",n.VectorKeyframeTrack,a,l,d)),x.push(this._createTrack(".fov",n.NumberKeyframeTrack,a,c,p)),new n.AnimationClip("",-1,x)}_createTrack(e,t,r,n,i){if(r.length>2){r=r.slice(),n=n.slice(),i=i.slice();const e=n.length/r.length,t=i.length/r.length;let a=1;for(let s=2,o=r.length;s<o;s++){for(let t=0;t<e;t++)if(n[a*e+t]!==n[(a-1)*e+t]||n[a*e+t]!==n[s*e+t]){a++;break}if(s>a){r[a]=r[s];for(let t=0;t<e;t++)n[a*e+t]=n[s*e+t];for(let e=0;e<t;e++)i[a*t+e]=i[s*t+e]}}r.length=a+1,n.length=(a+1)*e,i.length=(a+1)*t}const a=new t(e,r,n);return a.createInterpolant=function(e){return new Dm(this.times,this.values,this.getValueSize(),e,new Float32Array(i))},a}}class Dm extends n.Interpolant{constructor(e,t,r,n,i){super(e,t,r,n),this.interpolationParams=i}interpolate_(e,t,r,i){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=this.interpolationParams,c=e*o,u=c-o,h=i-t<.05?0:(r-t)/(i-t);if(4===o){const t=l[4*e+0],r=l[4*e+1],i=l[4*e+2],o=l[4*e+3],d=this._calculate(t,r,i,o,h);n.Quaternion.slerpFlat(a,0,s,u,s,c,d)}else if(3===o)for(let n=0;n!==o;++n){const t=l[12*e+4*n+0],r=l[12*e+4*n+1],i=l[12*e+4*n+2],o=l[12*e+4*n+3],d=this._calculate(t,r,i,o,h);a[n]=s[u+n]*(1-d)+s[c+n]*d}else{const t=l[4*e+0],r=l[4*e+1],n=l[4*e+2],i=l[4*e+3],o=this._calculate(t,r,n,i,h);a[0]=s[u]*(1-o)+s[c]*o}return a}_calculate(e,t,r,n,i){let a=.5,s=a,o=1-s;const l=Math;let c,u,h;for(let d=0;d<15;d++){c=3*o*o*s,u=3*o*s*s,h=s*s*s;const r=c*e+u*t+h-i;if(l.abs(r)<1e-5)break;a/=2,s+=r<0?a:-a,o=1-s}return c*r+u*n+h}}class Um extends n.CompressedTextureLoader{constructor(e){super(e)}parse(e,t){const r=new Nm(e,1);return{mipmaps:r.mipmaps(t),width:r.pixelWidth,height:r.pixelHeight,format:r.glInternalFormat,isCubemap:6===r.numberOfFaces,mipmapCount:r.numberOfMipmapLevels}}}class Nm{constructor(e,t){this.arrayBuffer=e;const r=new Uint8Array(this.arrayBuffer,0,12);if(171!==r[0]||75!==r[1]||84!==r[2]||88!==r[3]||32!==r[4]||49!==r[5]||49!==r[6]||187!==r[7]||13!==r[8]||10!==r[9]||26!==r[10]||10!==r[11])return void console.error("texture missing KTX identifier");const n=Uint32Array.BYTES_PER_ELEMENT,i=new DataView(this.arrayBuffer,12,13*n),a=67305985===i.getUint32(0,!0);this.glType=i.getUint32(1*n,a),this.glTypeSize=i.getUint32(2*n,a),this.glFormat=i.getUint32(3*n,a),this.glInternalFormat=i.getUint32(4*n,a),this.glBaseInternalFormat=i.getUint32(5*n,a),this.pixelWidth=i.getUint32(6*n,a),this.pixelHeight=i.getUint32(7*n,a),this.pixelDepth=i.getUint32(8*n,a),this.numberOfArrayElements=i.getUint32(9*n,a),this.numberOfFaces=i.getUint32(10*n,a),this.numberOfMipmapLevels=i.getUint32(11*n,a),this.bytesOfKeyValueData=i.getUint32(12*n,a),0===this.glType?(this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===t?this.loadType=0:console.warn("number of faces expected"+t+", but found "+this.numberOfFaces):console.warn("texture arrays not currently supported"):console.warn("only 2D textures currently supported")):console.warn("only compressed formats currently supported")}mipmaps(e){const t=[];let r=64+this.bytesOfKeyValueData,n=this.pixelWidth,i=this.pixelHeight;const a=e?this.numberOfMipmapLevels:1;for(let s=0;s<a;s++){const e=new Int32Array(this.arrayBuffer,r,1)[0];r+=4;for(let a=0;a<this.numberOfFaces;a++){const a=new Uint8Array(this.arrayBuffer,r,e);t.push({data:a,width:n,height:i}),r+=e,r+=3-(e+3)%4}n=Math.max(1,.5*n),i=Math.max(1,.5*i)}return t}}class km extends n.Loader{load(e,t,r,i){const a=this,s=new n.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){const t=new n.Group,r=(0,Lt.GZ)(new Uint8Array(e.slice(16))),i=JSON.parse((0,Lt.T8)(r["metadata.json"])),a=new DataView(r["data.sketch"].buffer),s=a.getInt32(16,!0),o={};let l=20;for(let n=0;n<s;n++){const e=a.getInt32(l,!0),t=[a.getFloat32(l+4,!0),a.getFloat32(l+8,!0),a.getFloat32(l+12,!0),a.getFloat32(l+16,!0)],r=a.getFloat32(l+20,!0),n=a.getUint32(l+24,!0),i=a.getUint32(l+28,!0);let s=0,c=0;for(let a=0;a<4;a++){const e=1<<a;(n&e)>0&&(s+=4),(i&e)>0&&(c+=4)}l=l+28+s+4;const u=a.getInt32(l,!0),h=new Float32Array(3*u),d=new Float32Array(4*u);l+=4;for(let o=0,p=0;o<h.length;o+=3,p+=4)h[o+0]=a.getFloat32(l+0,!0),h[o+1]=a.getFloat32(l+4,!0),h[o+2]=a.getFloat32(l+8,!0),d[p+0]=a.getFloat32(l+12,!0),d[p+1]=a.getFloat32(l+16,!0),d[p+2]=a.getFloat32(l+20,!0),d[p+3]=a.getFloat32(l+24,!0),l=l+28+c;e in o==!1&&(o[e]=[]),o[e].push([h,d,r,t])}for(const c in o){const e=new Om(o[c]),r=Vm(i.BrushIndex[c]);t.add(new n.Mesh(e,r))}return t}}class Om extends n.BufferGeometry{constructor(e){super();const t=[],r=[],i=[],a=new n.Vector3,s=new n.Vector3,o=new n.Quaternion,l=new n.Quaternion,c=new n.Vector3,u=new n.Vector3,h=new n.Vector3,d=new n.Vector3;for(const n in e){const p=e[n],f=p[0],m=p[1],g=p[2],v=p[3];s.fromArray(f,0),l.fromArray(m,0);for(let e=3,n=4,A=f.length;e<A;e+=3,n+=4){a.fromArray(f,e),o.fromArray(m,n),c.set(-g,0,0),c.applyQuaternion(o),c.add(a),u.set(g,0,0),u.applyQuaternion(o),u.add(a),h.set(g,0,0),h.applyQuaternion(l),h.add(s),d.set(-g,0,0),d.applyQuaternion(l),d.add(s),t.push(c.x,c.y,-c.z),t.push(u.x,u.y,-u.z),t.push(d.x,d.y,-d.z),t.push(u.x,u.y,-u.z),t.push(h.x,h.y,-h.z),t.push(d.x,d.y,-d.z),s.copy(a),l.copy(o),r.push(...v),r.push(...v),r.push(...v),r.push(...v),r.push(...v),r.push(...v);const p=e/A,y=(e-3)/A;i.push(p,0),i.push(p,1),i.push(y,0),i.push(p,1),i.push(y,1),i.push(y,0)}}this.setAttribute("position",new n.BufferAttribute(new Float32Array(t),3)),this.setAttribute("color",new n.BufferAttribute(new Float32Array(r),4)),this.setAttribute("uv",new n.BufferAttribute(new Float32Array(i),2))}}const Gm={"89d104cd-d012-426b-b5b3-bbaee63ac43c":"Bubbles","700f3aa8-9a7c-2384-8b8a-ea028905dd8c":"CelVinyl","0f0ff7b2-a677-45eb-a7d6-0cd7206f4816":"ChromaticWave","1161af82-50cf-47db-9706-0c3576d43c43":"CoarseBristles","79168f10-6961-464a-8be1-57ed364c5600":"CoarseBristlesSingleSided","1caa6d7d-f015-3f54-3a4b-8b5354d39f81":"Comet","c8313697-2563-47fc-832e-290f4c04b901":"DiamondHull","4391aaaa-df73-4396-9e33-31e4e4930b27":"Disco","d1d991f2-e7a0-4cf1-b328-f57e915e6260":"DotMarker","6a1cf9f9-032c-45ec-9b1d-a6680bee30f7":"Dots","0d3889f3-3ede-470c-8af4-f44813306126":"DoubleTaperedFlat","0d3889f3-3ede-470c-8af4-de4813306126":"DoubleTaperedMarker","d0262945-853c-4481-9cbd-88586bed93cb":"DuctTape","3ca16e2f-bdcd-4da2-8631-dcef342f40f1":"DuctTapeSingleSided","f6e85de3-6dcc-4e7f-87fd-cee8c3d25d51":"Electricity","02ffb866-7fb2-4d15-b761-1012cefb1360":"Embers","cb92b597-94ca-4255-b017-0e3f42f12f9e":"Fire","2d35bcf0-e4d8-452c-97b1-3311be063130":"Flat","55303bc4-c749-4a72-98d9-d23e68e76e18":"FlatDeprecated","280c0a7a-aad8-416c-a7d2-df63d129ca70":"FlatSingleSided","cf019139-d41c-4eb0-a1d0-5cf54b0a42f3":"Highlighter","6a1cf9f9-032c-45ec-9b6e-a6680bee32e9":"HyperGrid","dce872c2-7b49-4684-b59b-c45387949c5c":"Hypercolor","e8ef32b1-baa8-460a-9c2c-9cf8506794f5":"HypercolorSingleSided","2f212815-f4d3-c1a4-681a-feeaf9c6dc37":"Icing","f5c336cf-5108-4b40-ade9-c687504385ab":"Ink","c0012095-3ffd-4040-8ee1-fc180d346eaa":"InkSingleSided","4a76a27a-44d8-4bfe-9a8c-713749a499b0":"Leaves","ea19de07-d0c0-4484-9198-18489a3c1487":"LeavesSingleSided","2241cd32-8ba2-48a5-9ee7-2caef7e9ed62":"Light","4391aaaa-df81-4396-9e33-31e4e4930b27":"LightWire","d381e0f5-3def-4a0d-8853-31e9200bcbda":"Lofted","429ed64a-4e97-4466-84d3-145a861ef684":"Marker","79348357-432d-4746-8e29-0e25c112e3aa":"MatteHull","b2ffef01-eaaa-4ab5-aa64-95a2c4f5dbc6":"NeonPulse","f72ec0e7-a844-4e38-82e3-140c44772699":"OilPaint","c515dad7-4393-4681-81ad-162ef052241b":"OilPaintSingleSided","f1114e2e-eb8d-4fde-915a-6e653b54e9f5":"Paper","759f1ebd-20cd-4720-8d41-234e0da63716":"PaperSingleSided","e0abbc80-0f80-e854-4970-8924a0863dcc":"Petal","c33714d1-b2f9-412e-bd50-1884c9d46336":"Plasma","ad1ad437-76e2-450d-a23a-e17f8310b960":"Rainbow","faaa4d44-fcfb-4177-96be-753ac0421ba3":"ShinyHull","70d79cca-b159-4f35-990c-f02193947fe8":"Smoke","d902ed8b-d0d1-476c-a8de-878a79e3a34c":"Snow","accb32f5-4509-454f-93f8-1df3fd31df1b":"SoftHighlighter","cf7f0059-7aeb-53a4-2b67-c83d863a9ffa":"Spikes","8dc4a70c-d558-4efd-a5ed-d4e860f40dc3":"Splatter","7a1c8107-50c5-4b70-9a39-421576d6617e":"SplatterSingleSided","0eb4db27-3f82-408d-b5a1-19ebd7d5b711":"Stars","44bb800a-fbc3-4592-8426-94ecb05ddec3":"Streamers","0077f88c-d93a-42f3-b59b-b31c50cdb414":"Taffy","b468c1fb-f254-41ed-8ec9-57030bc5660c":"TaperedFlat","c8ccb53d-ae13-45ef-8afb-b730d81394eb":"TaperedFlatSingleSided","d90c6ad8-af0f-4b54-b422-e0f92abe1b3c":"TaperedMarker","1a26b8c0-8a07-4f8a-9fac-d2ef36e0cad0":"TaperedMarker_Flat","75b32cf0-fdd6-4d89-a64b-e2a00b247b0f":"ThickPaint","fdf0326a-c0d1-4fed-b101-9db0ff6d071f":"ThickPaintSingleSided","4391385a-df73-4396-9e33-31e4e4930b27":"Toon","a8fea537-da7c-4d4b-817f-24f074725d6d":"UnlitHull","d229d335-c334-495a-a801-660ac8a87360":"VelvetInk","10201aa3-ebc2-42d8-84b7-2e63f6eeb8ab":"Waveform","b67c0e81-ce6d-40a8-aeb0-ef036b081aa3":"WetPaint","dea67637-cd1a-27e4-c9b1-52f4bbcb84e5":"WetPaintSingleSided","5347acf0-a8e2-47b6-8346-30c70719d763":"WigglyGraphite","e814fef1-97fd-7194-4a2f-50c2bb918be2":"WigglyGraphiteSingleSided","4391385a-cf83-4396-9e33-31e4e4930b27":"Wire"},zm={BloomColor:"\n\t\t\tvec3 BloomColor(vec3 color, float gain) {\n\t\t\t\t// Guarantee that there's at least a little bit of all 3 channels.\n\t\t\t\t// This makes fully-saturated strokes (which only have 2 non-zero\n\t\t\t\t// color channels) eventually clip to white rather than to a secondary.\n\t\t\t\tfloat cmin = length(color.rgb) * .05;\n\t\t\t\tcolor.rgb = max(color.rgb, vec3(cmin, cmin, cmin));\n\t\t\t\t// If we try to remove this pow() from .a, it brightens up\n\t\t\t\t// pressure-sensitive strokes; looks better as-is.\n\t\t\t\tcolor = pow(color, vec3(2.2));\n\t\t\t\tcolor.rgb *= 2. * exp(gain * 10.);\n\t\t\t\treturn color;\n\t\t\t}\n\t\t",LinearToSrgb:"\n\t\t\tvec3 LinearToSrgb(vec3 color) {\n\t\t\t\t// Approximation http://chilliant.blogspot.com/2012/08/srgb-approximations-for-hlsl.html\n\t\t\t\tvec3 linearColor = color.rgb;\n\t\t\t\tvec3 S1 = sqrt(linearColor);\n\t\t\t\tvec3 S2 = sqrt(S1);\n\t\t\t\tvec3 S3 = sqrt(S2);\n\t\t\t\tcolor.rgb = 0.662002687 * S1 + 0.684122060 * S2 - 0.323583601 * S3 - 0.0225411470 * linearColor;\n\t\t\t\treturn color;\n\t\t\t}\n\t\t",hsv:"\n\t\t\t// uniform sampler2D lookupTex;\n\t\t\tvec4 lookup(vec4 textureColor) {\n\t\t\t\treturn textureColor;\n\t\t\t}\n\n\t\t\tvec3 lookup(vec3 textureColor) {\n\t\t\t\treturn textureColor;\n\t\t\t}\n\n\t\t\tvec3 hsv2rgb( vec3 hsv ) {\n\t\t\t\tvec3 rgb = clamp( abs(mod(hsv.x*6.0+vec3(0.0,4.0,2.0),6.0)-3.0)-1.0, 0.0, 1.0 );\n\t\t\t\treturn hsv.z * mix( vec3(1.0), rgb, hsv.y);\n\t\t\t}\n\n\t\t\tvec3 rgb2hsv( vec3 rgb ) {\n\t\t\t\tvec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n\t\t\t\tvec4 p = mix(vec4(rgb.bg, K.wz), vec4(rgb.gb, K.xy), step(rgb.b, rgb.g));\n\t\t\t\tvec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));\n\n\t\t\t\tfloat d = q.x - min(q.w, q.y);\n\t\t\t\tfloat e = 1.0e-10;\n\n\t\t\t\treturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n\t\t\t}\n\t\t",SrgbToLinear:"\n\t\t\tvec3 SrgbToLinear(vec3 color) {\n\t\t\t\t// Approximation http://chilliant.blogspot.com/2012/08/srgb-approximations-for-hlsl.html\n\t\t\t\tvec3 sRGB = color.rgb;\n\t\t\t\tcolor.rgb = sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878);\n\t\t\t\treturn color;\n\t\t\t}\n\t\t"};function Vm(e){return"Light"===Gm[e]?new n.RawShaderMaterial({uniforms:{mainTex:{value:(new n.TextureLoader).setPath("./textures/tiltbrush/").loader.load("Light.webp")},alphaTest:{value:.067},emission_gain:{value:.45},alpha:{value:1}},vertexShader:`\n\t\t\tprecision highp float;\n\t\t\tprecision highp int;\n\n\t\t\tattribute vec2 uv;\n\t\t\tattribute vec4 color;\n\t\t\tattribute vec3 position;\n\n\t\t\tuniform mat4 modelMatrix;\n\t\t\tuniform mat4 modelViewMatrix;\n\t\t\tuniform mat4 projectionMatrix;\n\t\t\tuniform mat4 viewMatrix;\n\t\t\tuniform mat3 normalMatrix;\n\t\t\tuniform vec3 cameraPosition;\n\n\t\t\tvarying vec2 vUv;\n\t\t\tvarying vec3 vColor;\n\n\t\t\t${zm.LinearToSrgb}\n\t\t\t${zm.hsv}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvUv = uv;\n\n\t\t\t\tvColor = lookup(color.rgb);\n\n\t\t\t\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\tgl_Position = projectionMatrix * mvPosition;\n\n\t\t\t}\n\t\t`,fragmentShader:`\n\t\t\tprecision highp float;\n\t\t\tprecision highp int;\n\n\t\t\tuniform float emission_gain;\n\n\t\t\tuniform sampler2D mainTex;\n\t\t\tuniform float alphaTest;\n\n\t\t\tvarying vec2 vUv;\n\t\t\tvarying vec3 vColor;\n\n\t\t\t${zm.BloomColor}\n\t\t\t${zm.SrgbToLinear}\n\n\t\t\tvoid main(){\n\t\t\t\tvec4 col = texture2D(mainTex, vUv);\n\t\t\t\tvec3 color = vColor;\n\t\t\t\tcolor = BloomColor(color, emission_gain);\n\t\t\t\tcolor = color * col.rgb;\n\t\t\t\tcolor = color * col.a;\n\t\t\t\tcolor = SrgbToLinear(color);\n\t\t\t\tgl_FragColor = vec4(color, 1.0);\n\t\t\t}\n\t\t`,side:2,transparent:!0,depthFunc:2,depthWrite:!0,depthTest:!1,blending:5,blendDst:201,blendDstAlpha:201,blendEquation:100,blendEquationAlpha:100,blendSrc:201,blendSrcAlpha:201}):new n.MeshBasicMaterial({vertexColors:!0,side:n.DoubleSide})}var Hm=r(44976);class Qm extends n.Loader{constructor(e){super(e),this.hdrLoader=new Xp.x,this.type=n.HalfFloatType}load(e,t,r,i){Array.isArray(e)||(console.warn("THREE.HDRCubeTextureLoader signature has changed. Use .setDataType() instead."),this.setDataType(e),e=t,t=r,r=i,i=arguments[4]);const a=new n.CubeTexture;switch(a.type=this.type,a.type){case n.FloatType:case n.HalfFloatType:"colorSpace"in a?a.colorSpace="srgb-linear":a.encoding=3e3,a.minFilter=n.LinearFilter,a.magFilter=n.LinearFilter,a.generateMipmaps=!1}const s=this;let o=0;function l(t,r,i,l){new n.FileLoader(s.manager).setPath(s.path).setResponseType("arraybuffer").setWithCredentials(s.withCredentials).load(e[t],(function(e){o++;const i=s.hdrLoader.parse(e);if(i){if(void 0!==i.data){const e=new n.DataTexture(i.data,i.width,i.height);e.type=a.type,e.encoding=a.encoding,e.format=a.format,e.minFilter=a.minFilter,e.magFilter=a.magFilter,e.generateMipmaps=a.generateMipmaps,a.images[t]=e}6===o&&(a.needsUpdate=!0,r&&r(a))}}),i,l)}for(let n=0;n<e.length;n++)l(n,t,r,i);return a}setDataType(e){return this.type=e,this.hdrLoader.setDataType(e),this}}class jm extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=this,s=new n.FileLoader(a.manager);s.setPath(a.path),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){function t(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(e,t,r,n){const i=parseInt(c[n].substr(e,t));if(i){const e=(a=r,l=i,"s"+Math.min(a,l)+"e"+Math.max(a,l));void 0===o[e]&&(s.push([r-1,i-1,1]),o[e]=s.length-1)}var a,l}const i={h:[255,255,255],he:[217,255,255],li:[204,128,255],be:[194,255,0],b:[255,181,181],c:[144,144,144],n:[48,80,248],o:[255,13,13],f:[144,224,80],ne:[179,227,245],na:[171,92,242],mg:[138,255,0],al:[191,166,166],si:[240,200,160],p:[255,128,0],s:[255,255,48],cl:[31,240,31],ar:[128,209,227],k:[143,64,212],ca:[61,255,0],sc:[230,230,230],ti:[191,194,199],v:[166,166,171],cr:[138,153,199],mn:[156,122,199],fe:[224,102,51],co:[240,144,160],ni:[80,208,80],cu:[200,128,51],zn:[125,128,176],ga:[194,143,143],ge:[102,143,143],as:[189,128,227],se:[255,161,0],br:[166,41,41],kr:[92,184,209],rb:[112,46,176],sr:[0,255,0],y:[148,255,255],zr:[148,224,224],nb:[115,194,201],mo:[84,181,181],tc:[59,158,158],ru:[36,143,143],rh:[10,125,140],pd:[0,105,133],ag:[192,192,192],cd:[255,217,143],in:[166,117,115],sn:[102,128,128],sb:[158,99,181],te:[212,122,0],i:[148,0,148],xe:[66,158,176],cs:[87,23,143],ba:[0,201,0],la:[112,212,255],ce:[255,255,199],pr:[217,255,199],nd:[199,255,199],pm:[163,255,199],sm:[143,255,199],eu:[97,255,199],gd:[69,255,199],tb:[48,255,199],dy:[31,255,199],ho:[0,255,156],er:[0,230,117],tm:[0,212,82],yb:[0,191,56],lu:[0,171,36],hf:[77,194,255],ta:[77,166,255],w:[33,148,214],re:[38,125,171],os:[38,102,150],ir:[23,84,135],pt:[208,208,224],au:[255,209,35],hg:[184,184,208],tl:[166,84,77],pb:[87,89,97],bi:[158,79,181],po:[171,92,0],at:[117,79,69],rn:[66,130,150],fr:[66,0,102],ra:[0,125,0],ac:[112,171,250],th:[0,186,255],pa:[0,161,255],u:[0,143,255],np:[0,128,255],pu:[0,107,255],am:[84,92,242],cm:[120,92,227],bk:[138,79,227],cf:[161,54,212],es:[179,31,212],fm:[179,31,186],md:[179,13,166],no:[189,13,135],lr:[199,0,102],rf:[204,0,89],db:[209,0,79],sg:[217,0,69],bh:[224,0,56],hs:[230,0,46],mt:[235,0,38],ds:[235,0,38],rg:[235,0,38],cn:[235,0,38],uut:[235,0,38],uuq:[235,0,38],uup:[235,0,38],uuh:[235,0,38],uus:[235,0,38],uuo:[235,0,38]},a=[],s=[],o={},l={},c=e.split("\n");for(let n=0,h=c.length;n<h;n++)if("ATOM"===c[n].substr(0,4)||"HETATM"===c[n].substr(0,6)){const e=parseFloat(c[n].substr(30,7)),r=parseFloat(c[n].substr(38,7)),s=parseFloat(c[n].substr(46,7)),o=parseInt(c[n].substr(6,5))-1;let h=t(c[n].substr(76,2)).toLowerCase();""===h&&(h=t(c[n].substr(12,2)).toLowerCase());const d=[e,r,s,i[h],(u=h,u.charAt(0).toUpperCase()+u.substr(1).toLowerCase())];a.push(d),l[o]=d}else if("CONECT"===c[n].substr(0,6)){const e=parseInt(c[n].substr(6,5));r(11,5,e,n),r(16,5,e,n),r(21,5,e,n),r(26,5,e,n)}var u;return function(){const e={geometryAtoms:new n.BufferGeometry,geometryBonds:new n.BufferGeometry,json:{atoms:a}},t=e.geometryAtoms,r=e.geometryBonds,i=[],o=[],c=[];for(let n=0,s=a.length;n<s;n++){const e=a[n],t=e[0],r=e[1],s=e[2];i.push(t,r,s);const l=e[3][0]/255,c=e[3][1]/255,u=e[3][2]/255;o.push(l,c,u)}for(let n=0,a=s.length;n<a;n++){const e=s[n],t=e[0],r=e[1],i=l[t],a=l[r];let o=i[0],u=i[1],h=i[2];c.push(o,u,h),o=a[0],u=a[1],h=a[2],c.push(o,u,h)}return t.setAttribute("position",new n.Float32BufferAttribute(i,3)),t.setAttribute("color",new n.Float32BufferAttribute(o,3)),r.setAttribute("position",new n.Float32BufferAttribute(c,3)),e}()}}let Wm=null;function Xm(){if(null===Wm){const e=new ArrayBuffer(2),t=new Uint8Array(e),r=new Uint16Array(e);t[0]=170,t[1]=187,Wm=43707===r[0]}return Wm}const Ym=[null,Float32Array,null,Int8Array,Int16Array,null,Int32Array,Uint8Array,Uint16Array,null,Uint32Array],qm={Uint16Array:"getUint16",Uint32Array:"getUint32",Int16Array:"getInt16",Int32Array:"getInt32",Float32Array:"getFloat32",Float64Array:"getFloat64"};function Km(e,t,r,n,i){const a=t.BYTES_PER_ELEMENT;let s;if(i===Xm()||1===a)s=new t(e,r,n);else{const o=new DataView(e,r,n*a),l=qm[t.name],c=!i;s=new t(n);for(let e=0;e<n;e++)s[e]=o[l](e*a,c)}return s}class Jm extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=this,s=new n.FileLoader(a.manager);s.setPath(a.path),s.setResponseType("arraybuffer"),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),e=e.replace(/\*/g,Xm()?"be":"le"),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){const t=function(e){const t=new Uint8Array(e),r=t[0];let n=t[1];const i=!!(n>>7&1),a=n>>6&1,s=1==(n>>5&1),o=31&n;let l=0,c=0;if(s?(l=(t[2]<<16)+(t[3]<<8)+t[4],c=(t[5]<<16)+(t[6]<<8)+t[7]):(l=t[2]+(t[3]<<8)+(t[4]<<16),c=t[5]+(t[6]<<8)+(t[7]<<16)),0===r)throw new Error("PRWM decoder: Invalid format version: 0");if(1!==r)throw new Error("PRWM decoder: Unsupported format version: "+r);if(!i){if(0!==a)throw new Error("PRWM decoder: Indices type must be set to 0 for non-indexed geometries");if(0!==c)throw new Error("PRWM decoder: Number of indices must be set to 0 for non-indexed geometries")}let u=8;const h={};for(let p=0;p<o;p++){let r="";for(;u<t.length;){const e=t[u];if(u++,0===e)break;r+=String.fromCharCode(e)}n=t[u];const i=n>>7&1,a=1+(n>>4&3),o=Ym[15&n];u++,u=4*Math.ceil(u/4);const c=Km(e,o,u,a*l,s);u+=o.BYTES_PER_ELEMENT*a*l,h[r]={type:i,cardinality:a,values:c}}u=4*Math.ceil(u/4);let d=null;return i&&(d=Km(e,1===a?Uint32Array:Uint16Array,u,c,s)),{version:r,attributes:h,indices:d}}(e),r=Object.keys(t.attributes),i=new n.BufferGeometry;for(let a=0;a<r.length;a++){const e=t.attributes[r[a]];i.setAttribute(r[a],new n.BufferAttribute(e.values,e.cardinality,e.normalized))}return null!==t.indices&&i.setIndex(new n.BufferAttribute(t.indices,1)),i}static isBigEndianPlatform(){return Xm()}}let Zm,$m;class eg extends n.DataTextureLoader{constructor(e){super(e),this.type=n.HalfFloatType,this.maxRange=7}setDataType(e){return this.type=e,this}setMaxRange(e){return this.maxRange=e,this}loadCubemap(e,t,r,i){const a=new n.CubeTexture;let s=0;const o=this;function l(r){o.load(e[r],(function(e){a.images[r]=e,s++,6===s&&(a.needsUpdate=!0,t&&t(a))}),void 0,i)}for(let n=0;n<e.length;++n)l(n);return a.type=this.type,a.format=n.RGBAFormat,a.minFilter=n.LinearFilter,a.generateMipmaps=!1,a}parse(e){!function(){if(Zm)return Zm;var e,t,r;Zm={},Zm.toRGBA8=function(e){var t=e.width,r=e.height;if(null==e.tabs.acTL)return[Zm.toRGBA8.decodeImage(e.data,t,r,e).buffer];var n=[];null==e.frames[0].data&&(e.frames[0].data=e.data);for(var i=t*r*4,a=new Uint8Array(i),s=new Uint8Array(i),o=new Uint8Array(i),l=0;l<e.frames.length;l++){var c=e.frames[l],u=c.rect.x,h=c.rect.y,d=c.rect.width,p=c.rect.height,f=Zm.toRGBA8.decodeImage(c.data,d,p,e);if(0!=l)for(var m=0;m<i;m++)o[m]=a[m];if(0==c.blend?Zm._copyTile(f,d,p,a,t,r,u,h,0):1==c.blend&&Zm._copyTile(f,d,p,a,t,r,u,h,1),n.push(a.buffer.slice(0)),1==c.dispose)Zm._copyTile(s,d,p,a,t,r,u,h,0);else if(2==c.dispose)for(m=0;m<i;m++)a[m]=o[m]}return n},Zm.toRGBA8.decodeImage=function(e,t,r,n){var i=t*r,a=Zm.decode._getBPP(n),s=Math.ceil(t*a/8),o=new Uint8Array(4*i),l=new Uint32Array(o.buffer),c=n.ctype,u=n.depth,h=Zm._bin.readUshort;if(6==c){var d=i<<2;if(8==u)for(var p=0;p<d;p+=4)o[p]=e[p],o[p+1]=e[p+1],o[p+2]=e[p+2],o[p+3]=e[p+3];if(16==u)for(p=0;p<d;p++)o[p]=e[p<<1]}else if(2==c){var f=n.tabs.tRNS;if(null==f){if(8==u)for(p=0;p<i;p++){var m=3*p;l[p]=255<<24|e[m+2]<<16|e[m+1]<<8|e[m]}if(16==u)for(p=0;p<i;p++)m=6*p,l[p]=255<<24|e[m+4]<<16|e[m+2]<<8|e[m]}else{var g=f[0],v=f[1],A=f[2];if(8==u)for(p=0;p<i;p++){var y=p<<2;m=3*p,l[p]=255<<24|e[m+2]<<16|e[m+1]<<8|e[m],e[m]==g&&e[m+1]==v&&e[m+2]==A&&(o[y+3]=0)}if(16==u)for(p=0;p<i;p++)y=p<<2,m=6*p,l[p]=255<<24|e[m+4]<<16|e[m+2]<<8|e[m],h(e,m)==g&&h(e,m+2)==v&&h(e,m+4)==A&&(o[y+3]=0)}}else if(3==c){var x=n.tabs.PLTE,b=n.tabs.tRNS,w=b?b.length:0;if(1==u)for(var E=0;E<r;E++){var S=E*s,M=E*t;for(p=0;p<t;p++){y=M+p<<2;var _=3*(T=e[S+(p>>3)]>>7-((7&p)<<0)&1);o[y]=x[_],o[y+1]=x[_+1],o[y+2]=x[_+2],o[y+3]=T<w?b[T]:255}}if(2==u)for(E=0;E<r;E++)for(S=E*s,M=E*t,p=0;p<t;p++)y=M+p<<2,_=3*(T=e[S+(p>>2)]>>6-((3&p)<<1)&3),o[y]=x[_],o[y+1]=x[_+1],o[y+2]=x[_+2],o[y+3]=T<w?b[T]:255;if(4==u)for(E=0;E<r;E++)for(S=E*s,M=E*t,p=0;p<t;p++)y=M+p<<2,_=3*(T=e[S+(p>>1)]>>4-((1&p)<<2)&15),o[y]=x[_],o[y+1]=x[_+1],o[y+2]=x[_+2],o[y+3]=T<w?b[T]:255;if(8==u)for(p=0;p<i;p++){var T;y=p<<2,_=3*(T=e[p]),o[y]=x[_],o[y+1]=x[_+1],o[y+2]=x[_+2],o[y+3]=T<w?b[T]:255}}else if(4==c){if(8==u)for(p=0;p<i;p++){y=p<<2;var C=e[I=p<<1];o[y]=C,o[y+1]=C,o[y+2]=C,o[y+3]=e[I+1]}if(16==u)for(p=0;p<i;p++){var I;y=p<<2,C=e[I=p<<2],o[y]=C,o[y+1]=C,o[y+2]=C,o[y+3]=e[I+2]}}else if(0==c)for(g=n.tabs.tRNS?n.tabs.tRNS:-1,E=0;E<r;E++){var B=E*s,R=E*t;if(1==u)for(var P=0;P<t;P++){var F=(C=255*(e[B+(P>>>3)]>>>7-(7&P)&1))==255*g?0:255;l[R+P]=F<<24|C<<16|C<<8|C}else if(2==u)for(P=0;P<t;P++)F=(C=85*(e[B+(P>>>2)]>>>6-((3&P)<<1)&3))==85*g?0:255,l[R+P]=F<<24|C<<16|C<<8|C;else if(4==u)for(P=0;P<t;P++)F=(C=17*(e[B+(P>>>1)]>>>4-((1&P)<<2)&15))==17*g?0:255,l[R+P]=F<<24|C<<16|C<<8|C;else if(8==u)for(P=0;P<t;P++)F=(C=e[B+P])==g?0:255,l[R+P]=F<<24|C<<16|C<<8|C;else if(16==u)for(P=0;P<t;P++)C=e[B+(P<<1)],F=h(e,B+(P<<1))==g?0:255,l[R+P]=F<<24|C<<16|C<<8|C}return o},Zm.decode=function(e){for(var t,r,n,i,a=new Uint8Array(e),s=8,o=Zm._bin,l=o.readUshort,c=o.readUint,u={tabs:{},frames:[]},h=new Uint8Array(a.length),d=0,p=0,f=[137,80,78,71,13,10,26,10],m=0;m<8;m++)if(a[m]!=f[m])throw new Error("The input is not a PNG file!");for(;s<a.length;){var g=o.readUint(a,s);s+=4;var v=o.readASCII(a,s,4);if(s+=4,"IHDR"==v)Zm.decode._IHDR(a,s,u);else if("CgBI"==v)u.tabs[v]=a.slice(s,s+4);else if("IDAT"==v){for(m=0;m<g;m++)h[d+m]=a[s+m];d+=g}else if("acTL"==v)u.tabs[v]={num_frames:c(a,s),num_plays:c(a,s+4)},t=new Uint8Array(a.length);else if("fcTL"==v){var A;0!=p&&((A=u.frames[u.frames.length-1]).data=Zm.decode._decompress(u,t.slice(0,p),A.rect.width,A.rect.height),p=0);var y={x:c(a,s+12),y:c(a,s+16),width:c(a,s+4),height:c(a,s+8)},x=l(a,s+22);x=l(a,s+20)/(0==x?100:x);var b={rect:y,delay:Math.round(1e3*x),dispose:a[s+24],blend:a[s+25]};u.frames.push(b)}else if("fdAT"==v){for(m=0;m<g-4;m++)t[p+m]=a[s+m+4];p+=g-4}else if("pHYs"==v)u.tabs[v]=[o.readUint(a,s),o.readUint(a,s+4),a[s+8]];else if("cHRM"==v)for(u.tabs[v]=[],m=0;m<8;m++)u.tabs[v].push(o.readUint(a,s+4*m));else if("tEXt"==v||"zTXt"==v){null==u.tabs[v]&&(u.tabs[v]={});var w=o.nextZero(a,s);n=o.readASCII(a,s,w-s);var E=s+g-w-1;"tEXt"==v?r=o.readASCII(a,w+1,E):(i=Zm.decode._inflate(a.slice(w+2,w+2+E)),r=o.readUTF8(i,0,i.length)),u.tabs[v][n]=r}else if("iTXt"==v){null==u.tabs[v]&&(u.tabs[v]={}),w=0;var S=s;w=o.nextZero(a,S),n=o.readASCII(a,S,w-S);var M=a[S=w+1];S+=2,w=o.nextZero(a,S),o.readASCII(a,S,w-S),S=w+1,w=o.nextZero(a,S),o.readUTF8(a,S,w-S),E=g-((S=w+1)-s),0==M?r=o.readUTF8(a,S,E):(i=Zm.decode._inflate(a.slice(S,S+E)),r=o.readUTF8(i,0,i.length)),u.tabs[v][n]=r}else if("PLTE"==v)u.tabs[v]=o.readBytes(a,s,g);else if("hIST"==v){var _=u.tabs.PLTE.length/3;for(u.tabs[v]=[],m=0;m<_;m++)u.tabs[v].push(l(a,s+2*m))}else if("tRNS"==v)3==u.ctype?u.tabs[v]=o.readBytes(a,s,g):0==u.ctype?u.tabs[v]=l(a,s):2==u.ctype&&(u.tabs[v]=[l(a,s),l(a,s+2),l(a,s+4)]);else if("gAMA"==v)u.tabs[v]=o.readUint(a,s)/1e5;else if("sRGB"==v)u.tabs[v]=a[s];else if("bKGD"==v)0==u.ctype||4==u.ctype?u.tabs[v]=[l(a,s)]:2==u.ctype||6==u.ctype?u.tabs[v]=[l(a,s),l(a,s+2),l(a,s+4)]:3==u.ctype&&(u.tabs[v]=a[s]);else if("IEND"==v)break;s+=g,o.readUint(a,s),s+=4}return 0!=p&&((A=u.frames[u.frames.length-1]).data=Zm.decode._decompress(u,t.slice(0,p),A.rect.width,A.rect.height)),u.data=Zm.decode._decompress(u,h,u.width,u.height),delete u.compress,delete u.interlace,delete u.filter,u},Zm.decode._decompress=function(e,t,r,n){var i=Zm.decode._getBPP(e),a=Math.ceil(r*i/8),s=new Uint8Array((a+1+e.interlace)*n);return t=e.tabs.CgBI?Zm.inflateRaw(t,s):Zm.decode._inflate(t,s),0==e.interlace?t=Zm.decode._filterZero(t,e,0,r,n):1==e.interlace&&(t=Zm.decode._readInterlace(t,e)),t},Zm.decode._inflate=function(e,t){return Zm.inflateRaw(new Uint8Array(e.buffer,2,e.length-6),t)},Zm.inflateRaw=((r={}).H={},r.H.N=function(e,t){var n,i,a=Uint8Array,s=0,o=0,l=0,c=0,u=0,h=0,d=0,p=0,f=0;if(3==e[0]&&0==e[1])return t||new a(0);var m=r.H,g=m.b,v=m.e,A=m.R,y=m.n,x=m.A,b=m.Z,w=m.m,E=null==t;for(E&&(t=new a(e.length>>>2<<5));0==s;)if(s=g(e,f,1),o=g(e,f+1,2),f+=3,0!=o){if(E&&(t=r.H.W(t,p+(1<<17))),1==o&&(n=w.J,i=w.h,h=511,d=31),2==o){l=v(e,f,5)+257,c=v(e,f+5,5)+1,u=v(e,f+10,4)+4,f+=14;for(var S=1,M=0;M<38;M+=2)w.Q[M]=0,w.Q[M+1]=0;for(M=0;M<u;M++){var _=v(e,f+3*M,3);w.Q[1+(w.X[M]<<1)]=_,_>S&&(S=_)}f+=3*u,y(w.Q,S),x(w.Q,S,w.u),n=w.w,i=w.d,f=A(w.u,(1<<S)-1,l+c,e,f,w.v);var T=m.V(w.v,0,l,w.C);h=(1<<T)-1;var C=m.V(w.v,l,c,w.D);d=(1<<C)-1,y(w.C,T),x(w.C,T,n),y(w.D,C),x(w.D,C,i)}for(;;){var I=n[b(e,f)&h];f+=15&I;var B=I>>>4;if(B>>>8==0)t[p++]=B;else{if(256==B)break;var R=p+B-254;if(B>264){var P=w.q[B-257];R=p+(P>>>3)+v(e,f,7&P),f+=7&P}var F=i[b(e,f)&d];f+=15&F;var L=F>>>4,D=w.c[L],U=(D>>>4)+g(e,f,15&D);for(f+=15&D;p<R;)t[p]=t[p++-U],t[p]=t[p++-U],t[p]=t[p++-U],t[p]=t[p++-U];p=R}}}else{0!=(7&f)&&(f+=8-(7&f));var N=4+(f>>>3),k=e[N-4]|e[N-3]<<8;E&&(t=r.H.W(t,p+k)),t.set(new a(e.buffer,e.byteOffset+N,k),p),f=N+k<<3,p+=k}return t.length==p?t:t.slice(0,p)},r.H.W=function(e,t){var r=e.length;if(t<=r)return e;var n=new Uint8Array(r<<1);return n.set(e,0),n},r.H.R=function(e,t,n,i,a,s){for(var o=r.H.e,l=r.H.Z,c=0;c<n;){var u=e[l(i,a)&t];a+=15&u;var h=u>>>4;if(h<=15)s[c]=h,c++;else{var d=0,p=0;16==h?(p=3+o(i,a,2),a+=2,d=s[c-1]):17==h?(p=3+o(i,a,3),a+=3):18==h&&(p=11+o(i,a,7),a+=7);for(var f=c+p;c<f;)s[c]=d,c++}}return a},r.H.V=function(e,t,r,n){for(var i=0,a=0,s=n.length>>>1;a<r;){var o=e[a+t];n[a<<1]=0,n[1+(a<<1)]=o,o>i&&(i=o),a++}for(;a<s;)n[a<<1]=0,n[1+(a<<1)]=0,a++;return i},r.H.n=function(e,t){for(var n,i,a,s,o=r.H.m,l=e.length,c=o.j,u=0;u<=t;u++)c[u]=0;for(u=1;u<l;u+=2)c[e[u]]++;var h=o.K;for(n=0,c[0]=0,i=1;i<=t;i++)n=n+c[i-1]<<1,h[i]=n;for(a=0;a<l;a+=2)0!=(s=e[a+1])&&(e[a]=h[s],h[s]++)},r.H.A=function(e,t,n){for(var i=e.length,a=r.H.m.r,s=0;s<i;s+=2)if(0!=e[s+1])for(var o=s>>1,l=e[s+1],c=o<<4|l,u=t-l,h=e[s]<<u,d=h+(1<<u);h!=d;)n[a[h]>>>15-t]=c,h++},r.H.l=function(e,t){for(var n=r.H.m.r,i=15-t,a=0;a<e.length;a+=2){var s=e[a]<<t-e[a+1];e[a]=n[s]>>>i}},r.H.M=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8},r.H.I=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},r.H.e=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<r)-1},r.H.b=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<r)-1},r.H.Z=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},r.H.i=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},r.H.m=(e=Uint16Array,t=Uint32Array,{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new e(65536),g:new e(32768)}),function(){for(var e=r.H.m,t=0;t<32768;t++){var n=t;n=(4278255360&(n=(4042322160&(n=(3435973836&(n=(2863311530&n)>>>1|(1431655765&n)<<1))>>>2|(858993459&n)<<2))>>>4|(252645135&n)<<4))>>>8|(16711935&n)<<8,e.r[t]=(n>>>16|n<<16)>>>17}function i(e,t,r){for(;0!=t--;)e.push(0,r)}for(t=0;t<32;t++)e.q[t]=e.S[t]<<3|e.T[t],e.c[t]=e.p[t]<<4|e.z[t];i(e._,144,8),i(e._,112,9),i(e._,24,7),i(e._,8,8),r.H.n(e._,9),r.H.A(e._,9,e.J),r.H.l(e._,9),i(e.$,32,5),r.H.n(e.$,5),r.H.A(e.$,5,e.h),r.H.l(e.$,5),i(e.Q,19,0),i(e.C,286,0),i(e.D,30,0),i(e.v,320,0)}(),r.H.N),Zm.decode._readInterlace=function(e,t){for(var r=t.width,n=t.height,i=Zm.decode._getBPP(t),a=i>>3,s=Math.ceil(r*i/8),o=new Uint8Array(n*s),l=0,c=[0,0,4,0,2,0,1],u=[0,4,0,2,0,1,0],h=[8,8,8,4,4,2,2],d=[8,8,4,4,2,2,1],p=0;p<7;){for(var f=h[p],m=d[p],g=0,v=0,A=c[p];A<n;)A+=f,v++;for(var y=u[p];y<r;)y+=m,g++;var x=Math.ceil(g*i/8);Zm.decode._filterZero(e,t,l,g,v);for(var b,w=0,E=c[p];E<n;){for(var S=u[p],M=l+w*x<<3;S<r;){if(1==i&&(b=(b=e[M>>3])>>7-(7&M)&1,o[E*s+(S>>3)]|=b<<7-((7&S)<<0)),2==i&&(b=(b=e[M>>3])>>6-(7&M)&3,o[E*s+(S>>2)]|=b<<6-((3&S)<<1)),4==i&&(b=(b=e[M>>3])>>4-(7&M)&15,o[E*s+(S>>1)]|=b<<4-((1&S)<<2)),i>=8)for(var _=E*s+S*a,T=0;T<a;T++)o[_+T]=e[(M>>3)+T];M+=i,S+=m}w++,E+=f}g*v!=0&&(l+=v*(1+x)),p+=1}return o},Zm.decode._getBPP=function(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth},Zm.decode._filterZero=function(e,t,r,n,i){var a=Zm.decode._getBPP(t),s=Math.ceil(n*a/8),o=Zm.decode._paeth;a=Math.ceil(a/8);var l,c,u=e[r],h=0;if(u>1&&(e[r]=[0,0,1][u-2]),3==u)for(h=a;h<s;h++)e[h+1]=e[h+1]+(e[h+1-a]>>>1)&255;for(var d=0;d<i;d++)if(h=0,0==(u=e[(c=(l=r+d*s)+d+1)-1]))for(;h<s;h++)e[l+h]=e[c+h];else if(1==u){for(;h<a;h++)e[l+h]=e[c+h];for(;h<s;h++)e[l+h]=e[c+h]+e[l+h-a]}else if(2==u)for(;h<s;h++)e[l+h]=e[c+h]+e[l+h-s];else if(3==u){for(;h<a;h++)e[l+h]=e[c+h]+(e[l+h-s]>>>1);for(;h<s;h++)e[l+h]=e[c+h]+(e[l+h-s]+e[l+h-a]>>>1)}else{for(;h<a;h++)e[l+h]=e[c+h]+o(0,e[l+h-s],0);for(;h<s;h++)e[l+h]=e[c+h]+o(e[l+h-a],e[l+h-s],e[l+h-a-s])}return e},Zm.decode._paeth=function(e,t,r){var n=e+t-r,i=n-e,a=n-t,s=n-r;return i*i<=a*a&&i*i<=s*s?e:a*a<=s*s?t:r},Zm.decode._IHDR=function(e,t,r){var n=Zm._bin;r.width=n.readUint(e,t),t+=4,r.height=n.readUint(e,t),t+=4,r.depth=e[t],t++,r.ctype=e[t],t++,r.compress=e[t],t++,r.filter=e[t],t++,r.interlace=e[t],t++},Zm._bin={nextZero:function(e,t){for(;0!=e[t];)t++;return t},readUshort:function(e,t){return e[t]<<8|e[t+1]},writeUshort:function(e,t,r){e[t]=r>>8&255,e[t+1]=255&r},readUint:function(e,t){return 16777216*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3])},writeUint:function(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r},readASCII:function(e,t,r){for(var n="",i=0;i<r;i++)n+=String.fromCharCode(e[t+i]);return n},writeASCII:function(e,t,r){for(var n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n)},readBytes:function(e,t,r){for(var n=[],i=0;i<r;i++)n.push(e[t+i]);return n},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,r){for(var n,i="",a=0;a<r;a++)i+="%"+Zm._bin.pad(e[t+a].toString(16));try{n=decodeURIComponent(i)}catch(s){return Zm._bin.readASCII(e,t,r)}return n}},Zm._copyTile=function(e,t,r,n,i,a,s,o,l){for(var c=Math.min(t,i),u=Math.min(r,a),h=0,d=0,p=0;p<u;p++)for(var f=0;f<c;f++)if(s>=0&&o>=0?(h=p*t+f<<2,d=(o+p)*i+s+f<<2):(h=(-o+p)*t-s+f<<2,d=p*i+f<<2),0==l)n[d]=e[h],n[d+1]=e[h+1],n[d+2]=e[h+2],n[d+3]=e[h+3];else if(1==l){var m=e[h+3]*(1/255),g=e[h]*m,v=e[h+1]*m,A=e[h+2]*m,y=n[d+3]*(1/255),x=n[d]*y,b=n[d+1]*y,w=n[d+2]*y,E=1-m,S=m+y*E,M=0==S?0:1/S;n[d+3]=255*S,n[d+0]=(g+x*E)*M,n[d+1]=(v+b*E)*M,n[d+2]=(A+w*E)*M}else if(2==l)m=e[h+3],g=e[h],v=e[h+1],A=e[h+2],y=n[d+3],x=n[d],b=n[d+1],w=n[d+2],m==y&&g==x&&v==b&&A==w?(n[d]=0,n[d+1]=0,n[d+2]=0,n[d+3]=0):(n[d]=g,n[d+1]=v,n[d+2]=A,n[d+3]=m);else if(3==l){if(m=e[h+3],g=e[h],v=e[h+1],A=e[h+2],y=n[d+3],x=n[d],b=n[d+1],w=n[d+2],m==y&&g==x&&v==b&&A==w)continue;if(m<220&&y>20)return!1}return!0}}();const t=Zm.decode(e),r=Zm.toRGBA8(t)[0],i=new Uint8Array(r),a=t.width*t.height*4,s=this.type===n.HalfFloatType?new Uint16Array(a):new Float32Array(a);for(let o=0;o<i.length;o+=4){const e=i[o+0]/255,t=i[o+1]/255,r=i[o+2]/255,a=i[o+3]/255;this.type===n.HalfFloatType?(s[o+0]=n.DataUtils.toHalfFloat(Math.min(e*a*this.maxRange,65504)),s[o+1]=n.DataUtils.toHalfFloat(Math.min(t*a*this.maxRange,65504)),s[o+2]=n.DataUtils.toHalfFloat(Math.min(r*a*this.maxRange,65504)),s[o+3]=n.DataUtils.toHalfFloat(1)):(s[o+0]=e*a*this.maxRange,s[o+1]=t*a*this.maxRange,s[o+2]=r*a*this.maxRange,s[o+3]=1)}return{width:t.width,height:t.height,data:s,format:n.RGBAFormat,type:this.type,flipY:!0}}}class tg extends n.Loader{load(e,t,r,i){const a=this,s=new n.FileLoader(a.manager);s.setPath(a.path),s.setResponseType("arraybuffer"),s.setRequestHeader(a.requestHeader),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e){const t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);if(542658390!==r||150!==n)return void console.error("Not a valid VOX file");const i=[0,4294967295,4291624959,4288282623,4284940287,4281597951,4278255615,4294954239,4291611903,4288269567,4284927231,4281584895,4278242559,4294941183,4291598847,4288256511,4284914175,4281571839,4278229503,4294928127,4291585791,4288243455,4284901119,4281558783,4278216447,4294915071,4291572735,4288230399,4284888063,4281545727,4278203391,4294902015,4291559679,4288217343,4284875007,4281532671,4278190335,4294967244,4291624908,4288282572,4284940236,4281597900,4278255564,4294954188,4291611852,4288269516,4284927180,4281584844,4278242508,4294941132,4291598796,4288256460,4284914124,4281571788,4278229452,4294928076,4291585740,4288243404,4284901068,4281558732,4278216396,4294915020,4291572684,4288230348,4284888012,4281545676,4278203340,4294901964,4291559628,4288217292,4284874956,4281532620,4278190284,4294967193,4291624857,4288282521,4284940185,4281597849,4278255513,4294954137,4291611801,4288269465,4284927129,4281584793,4278242457,4294941081,4291598745,4288256409,4284914073,4281571737,4278229401,4294928025,4291585689,4288243353,4284901017,4281558681,4278216345,4294914969,4291572633,4288230297,4284887961,4281545625,4278203289,4294901913,4291559577,4288217241,4284874905,4281532569,4278190233,4294967142,4291624806,4288282470,4284940134,4281597798,4278255462,4294954086,4291611750,4288269414,4284927078,4281584742,4278242406,4294941030,4291598694,4288256358,4284914022,4281571686,4278229350,4294927974,4291585638,4288243302,4284900966,4281558630,4278216294,4294914918,4291572582,4288230246,4284887910,4281545574,4278203238,4294901862,4291559526,4288217190,4284874854,4281532518,4278190182,4294967091,4291624755,4288282419,4284940083,4281597747,4278255411,4294954035,4291611699,4288269363,4284927027,4281584691,4278242355,4294940979,4291598643,4288256307,4284913971,4281571635,4278229299,4294927923,4291585587,4288243251,4284900915,4281558579,4278216243,4294914867,4291572531,4288230195,4284887859,4281545523,4278203187,4294901811,4291559475,4288217139,4284874803,4281532467,4278190131,4294967040,4291624704,4288282368,4284940032,4281597696,4278255360,4294953984,4291611648,4288269312,4284926976,4281584640,4278242304,4294940928,4291598592,4288256256,4284913920,4281571584,4278229248,4294927872,4291585536,4288243200,4284900864,4281558528,4278216192,4294914816,4291572480,4288230144,4284887808,4281545472,4278203136,4294901760,4291559424,4288217088,4284874752,4281532416,4278190318,4278190301,4278190267,4278190250,4278190216,4278190199,4278190165,4278190148,4278190114,4278190097,4278251008,4278246656,4278237952,4278233600,4278224896,4278220544,4278211840,4278207488,4278198784,4278194432,4293787648,4292673536,4290445312,4289331200,4287102976,4285988864,4283760640,4282646528,4280418304,4279304192,4293848814,4292730333,4290493371,4289374890,4287137928,4286019447,4283782485,4282664004,4280427042,4279308561];let a,s=8;const o=[];for(;s<t.byteLength;){let r="";for(let e=0;e<4;e++)r+=String.fromCharCode(t.getUint8(s++));const n=t.getUint32(s,!0);if(s+=4,s+=4,"SIZE"===r){const e=t.getUint32(s,!0);s+=4;const r=t.getUint32(s,!0);s+=4;const l=t.getUint32(s,!0);s+=4,a={palette:i,size:{x:e,y:r,z:l}},o.push(a),s+=n-12}else if("XYZI"===r){const r=t.getUint32(s,!0);s+=4,a.data=new Uint8Array(e,s,4*r),s+=4*r}else if("RGBA"===r){const e=[0];for(let r=0;r<256;r++)e[r+1]=t.getUint32(s,!0),s+=4;a.palette=e}else s+=n}return o}}class rg extends n.Mesh{constructor(e){const t=e.data,r=e.size,i=e.palette,a=[],s=[],o=[0,0,0,0,0,1,0,1,0,0,1,1,0,1,0,0,0,1],l=[1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0],c=[0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1],u=[0,0,0,0,1,0,1,0,0,1,1,0,1,0,0,0,1,0],h=[0,0,1,0,0,0,1,0,1,1,0,0,1,0,1,0,0,0],d=[0,1,1,1,1,1,0,1,0,1,1,0,0,1,0,1,1,1];function p(e,t,n,i,o,l,c){t-=r.x/2,n-=r.z/2,i+=r.y/2;for(let r=0;r<18;r+=3)a.push(e[r+0]+t,e[r+1]+n,e[r+2]+i),s.push(o,l,c)}const f=r.x,m=r.x*r.y,g=new Uint8Array(r.x*r.y*r.z);for(let n=0;n<t.length;n+=4){g[t[n+0]+t[n+1]*f+t[n+2]*m]=255}let v=!1;for(let n=0;n<t.length;n+=4){const e=t[n+0],a=t[n+1],s=t[n+2],A=i[t[n+3]],y=(A>>0&255)/255,x=(A>>8&255)/255,b=(A>>16&255)/255;(y>0||x>0||b>0)&&(v=!0);const w=e+a*f+s*m;0!==g[w+1]&&e!==r.x-1||p(l,e,s,-a,y,x,b),0!==g[w-1]&&0!==e||p(o,e,s,-a,y,x,b),0!==g[w+f]&&a!==r.y-1||p(u,e,s,-a,y,x,b),0!==g[w-f]&&0!==a||p(c,e,s,-a,y,x,b),0!==g[w+m]&&s!==r.z-1||p(d,e,s,-a,y,x,b),0!==g[w-m]&&0!==s||p(h,e,s,-a,y,x,b)}const A=new n.BufferGeometry;A.setAttribute("position",new n.Float32BufferAttribute(a,3)),A.computeVertexNormals();const y=new n.MeshStandardMaterial;v&&(A.setAttribute("color",new n.Float32BufferAttribute(s,3)),y.vertexColors=!0),super(A,y)}}class ng extends Yl.J{constructor(e){const t=e.data,r=e.size,i=r.x,a=r.x*r.y,s=new Uint8Array(r.x*r.y*r.z);for(let n=0;n<t.length;n+=4){s[t[n+0]+t[n+1]*i+t[n+2]*a]=255}super(s,r.x,r.y,r.z),this.format=n.RedFormat,this.minFilter=n.NearestFilter,this.magFilter=n.LinearFilter,this.unpackAlignment=1,this.needsUpdate=!0}}class ig extends n.Loader{constructor(e){super(e),this.littleEndian=!0}load(e,t,r,i){const a=this,s=new n.FileLoader(a.manager);s.setPath(a.path),s.setResponseType("arraybuffer"),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,(function(r){try{t(a.parse(r,e))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e,t){const r=n.LoaderUtils.decodeText(new Uint8Array(e)),i=function(e){const t={},r=e.search(/[\r\n]DATA\s(\S*)\s/i),n=/[\r\n]DATA\s(\S*)\s/i.exec(e.substr(r-1));if(t.data=n[1],t.headerLen=n[0].length+r,t.str=e.substr(0,t.headerLen),t.str=t.str.replace(/\#.*/gi,""),t.version=/VERSION (.*)/i.exec(t.str),t.fields=/FIELDS (.*)/i.exec(t.str),t.size=/SIZE (.*)/i.exec(t.str),t.type=/TYPE (.*)/i.exec(t.str),t.count=/COUNT (.*)/i.exec(t.str),t.width=/WIDTH (.*)/i.exec(t.str),t.height=/HEIGHT (.*)/i.exec(t.str),t.viewpoint=/VIEWPOINT (.*)/i.exec(t.str),t.points=/POINTS (.*)/i.exec(t.str),null!==t.version&&(t.version=parseFloat(t.version[1])),null!==t.fields&&(t.fields=t.fields[1].split(" ")),null!==t.type&&(t.type=t.type[1].split(" ")),null!==t.width&&(t.width=parseInt(t.width[1])),null!==t.height&&(t.height=parseInt(t.height[1])),null!==t.viewpoint&&(t.viewpoint=t.viewpoint[1]),null!==t.points&&(t.points=parseInt(t.points[1],10)),null===t.points&&(t.points=t.width*t.height),null!==t.size&&(t.size=t.size[1].split(" ").map((function(e){return parseInt(e,10)}))),null!==t.count)t.count=t.count[1].split(" ").map((function(e){return parseInt(e,10)}));else{t.count=[];for(let e=0,r=t.fields.length;e<r;e++)t.count.push(1)}t.offset={};let i=0;for(let a=0,s=t.fields.length;a<s;a++)"ascii"===t.data?t.offset[t.fields[a]]=a:(t.offset[t.fields[a]]=i,i+=t.size[a]*t.count[a]);return t.rowSize=i,t}(r),a=[],s=[],o=[];if("ascii"===i.data){const e=i.offset,t=r.substr(i.headerLen).split("\n");for(let r=0,n=t.length;r<n;r++){if(""===t[r])continue;const n=t[r].split(" ");if(void 0!==e.x&&(a.push(parseFloat(n[e.x])),a.push(parseFloat(n[e.y])),a.push(parseFloat(n[e.z]))),void 0!==e.rgb){const t=parseFloat(n[e.rgb]),r=t>>16&255,i=t>>8&255,a=t>>0&255;o.push(r/255,i/255,a/255)}void 0!==e.normal_x&&(s.push(parseFloat(n[e.normal_x])),s.push(parseFloat(n[e.normal_y])),s.push(parseFloat(n[e.normal_z])))}}if("binary_compressed"===i.data){const t=new Uint32Array(e.slice(i.headerLen,i.headerLen+8)),r=t[0],n=t[1],l=function(e,t){const r=e.length,n=new Uint8Array(t);let i,a,s,o=0,l=0;do{if(i=e[o++],i<32){if(i++,l+i>t)throw new Error("Output buffer is not large enough");if(o+i>r)throw new Error("Invalid compressed data");do{n[l++]=e[o++]}while(--i)}else{if(a=i>>5,s=l-((31&i)<<8)-1,o>=r)throw new Error("Invalid compressed data");if(7===a&&(a+=e[o++],o>=r))throw new Error("Invalid compressed data");if(s-=e[o++],l+a+2>t)throw new Error("Output buffer is not large enough");if(s<0)throw new Error("Invalid compressed data");if(s>=l)throw new Error("Invalid compressed data");do{n[l++]=n[s++]}while(2+--a)}}while(o<r);return n}(new Uint8Array(e,i.headerLen+8,r),n),c=new DataView(l.buffer),u=i.offset;for(let e=0;e<i.points;e++)void 0!==u.x&&(a.push(c.getFloat32(i.points*u.x+i.size[0]*e,this.littleEndian)),a.push(c.getFloat32(i.points*u.y+i.size[1]*e,this.littleEndian)),a.push(c.getFloat32(i.points*u.z+i.size[2]*e,this.littleEndian))),void 0!==u.rgb&&(o.push(c.getUint8(i.points*u.rgb+i.size[3]*e+2)/255),o.push(c.getUint8(i.points*u.rgb+i.size[3]*e+1)/255),o.push(c.getUint8(i.points*u.rgb+i.size[3]*e+0)/255)),void 0!==u.normal_x&&(s.push(c.getFloat32(i.points*u.normal_x+i.size[4]*e,this.littleEndian)),s.push(c.getFloat32(i.points*u.normal_y+i.size[5]*e,this.littleEndian)),s.push(c.getFloat32(i.points*u.normal_z+i.size[6]*e,this.littleEndian)))}if("binary"===i.data){const t=new DataView(e,i.headerLen),r=i.offset;for(let e=0,n=0;e<i.points;e++,n+=i.rowSize)void 0!==r.x&&(a.push(t.getFloat32(n+r.x,this.littleEndian)),a.push(t.getFloat32(n+r.y,this.littleEndian)),a.push(t.getFloat32(n+r.z,this.littleEndian))),void 0!==r.rgb&&(o.push(t.getUint8(n+r.rgb+2)/255),o.push(t.getUint8(n+r.rgb+1)/255),o.push(t.getUint8(n+r.rgb+0)/255)),void 0!==r.normal_x&&(s.push(t.getFloat32(n+r.normal_x,this.littleEndian)),s.push(t.getFloat32(n+r.normal_y,this.littleEndian)),s.push(t.getFloat32(n+r.normal_z,this.littleEndian)))}const l=new n.BufferGeometry;a.length>0&&l.setAttribute("position",new n.Float32BufferAttribute(a,3)),s.length>0&&l.setAttribute("normal",new n.Float32BufferAttribute(s,3)),o.length>0&&l.setAttribute("color",new n.Float32BufferAttribute(o,3)),l.computeBoundingSphere();const c=new n.PointsMaterial({size:.005});o.length>0?c.vertexColors=!0:c.color.setHex(16777215*Math.random());const u=new n.Points(l,c);let h=t.split("").reverse().join("");return h=/([^\/]*)/.exec(h),h=h[1].split("").reverse().join(""),u.name=h,u}}class ag{constructor(e){this.IFF=e}parseBlock(){this.IFF.debugger.offset=this.IFF.reader.offset,this.IFF.debugger.closeForms();const e=this.IFF.reader.getIDTag();let t=this.IFF.reader.getUint32();switch(t>this.IFF.reader.dv.byteLength-this.IFF.reader.offset&&(this.IFF.reader.offset-=4,t=this.IFF.reader.getUint16()),this.IFF.debugger.dataOffset=this.IFF.reader.offset,this.IFF.debugger.length=t,e){case"FORM":this.IFF.parseForm(t);break;case"ICON":case"VMPA":case"BBOX":case"NORM":case"PRE ":case"POST":case"KEY ":case"SPAN":case"TIME":case"CLRS":case"CLRA":case"FILT":case"DITH":case"CONT":case"BRIT":case"SATR":case"HUE ":case"GAMM":case"NEGA":case"IFLT":case"PFLT":case"PROJ":case"AXIS":case"AAST":case"PIXB":case"AUVO":case"STCK":case"PROC":case"VALU":case"FUNC":case"PNAM":case"INAM":case"GRST":case"GREN":case"GRPT":case"FKEY":case"IKEY":case"CSYS":case"OPAQ":case"CMAP":case"NLOC":case"NZOM":case"NVER":case"NSRV":case"NVSK":case"NCRD":case"WRPW":case"WRPH":case"NMOD":case"NSEL":case"NPRW":case"NPLA":case"NODS":case"VERS":case"ENUM":case"TAG ":case"OPAC":case"CGMD":case"CGTY":case"CGST":case"CGEN":case"CGTS":case"CGTE":case"OSMP":case"OMDE":case"OUTR":case"FLAG":case"TRNL":case"GLOW":case"GVAL":case"SHRP":case"RFOP":case"RSAN":case"TROP":case"RBLR":case"TBLR":case"CLRH":case"CLRF":case"ADTR":case"LINE":case"ALPH":case"VCOL":case"ENAB":case"TMAP":this.IFF.debugger.skipped=!0,this.IFF.reader.skip(t);break;case"SURF":this.IFF.parseSurfaceLwo2(t);break;case"CLIP":this.IFF.parseClipLwo2(t);break;case"IPIX":case"IMIP":case"IMOD":case"AMOD":case"IINV":case"INCR":case"IAXS":case"IFOT":case"ITIM":case"IWRL":case"IUTI":case"IINX":case"IINY":case"IINZ":case"IREF":4===t?this.IFF.currentNode[e]=this.IFF.reader.getInt32():this.IFF.reader.skip(t);break;case"OTAG":this.IFF.parseObjectTag();break;case"LAYR":this.IFF.parseLayer(t);break;case"PNTS":this.IFF.parsePoints(t);break;case"VMAP":this.IFF.parseVertexMapping(t);break;case"AUVU":case"AUVN":this.IFF.reader.skip(t-1),this.IFF.reader.getVariableLengthIndex();break;case"POLS":this.IFF.parsePolygonList(t);break;case"TAGS":this.IFF.parseTagStrings(t);break;case"PTAG":this.IFF.parsePolygonTagMapping(t);break;case"VMAD":this.IFF.parseVertexMapping(t,!0);break;case"DESC":this.IFF.currentForm.description=this.IFF.reader.getString();break;case"TEXT":case"CMNT":case"NCOM":this.IFF.currentForm.comment=this.IFF.reader.getString();break;case"NAME":this.IFF.currentForm.channelName=this.IFF.reader.getString();break;case"WRAP":this.IFF.currentForm.wrap={w:this.IFF.reader.getUint16(),h:this.IFF.reader.getUint16()};break;case"IMAG":const r=this.IFF.reader.getVariableLengthIndex();this.IFF.currentForm.imageIndex=r;break;case"OREF":this.IFF.currentForm.referenceObject=this.IFF.reader.getString();break;case"ROID":this.IFF.currentForm.referenceObjectID=this.IFF.reader.getUint32();break;case"SSHN":this.IFF.currentSurface.surfaceShaderName=this.IFF.reader.getString();break;case"AOVN":this.IFF.currentSurface.surfaceCustomAOVName=this.IFF.reader.getString();break;case"NSTA":this.IFF.currentForm.disabled=this.IFF.reader.getUint16();break;case"NRNM":this.IFF.currentForm.realName=this.IFF.reader.getString();break;case"NNME":this.IFF.currentForm.refName=this.IFF.reader.getString(),this.IFF.currentSurface.nodes[this.IFF.currentForm.refName]=this.IFF.currentForm;break;case"INME":this.IFF.currentForm.nodeName||(this.IFF.currentForm.nodeName=[]),this.IFF.currentForm.nodeName.push(this.IFF.reader.getString());break;case"IINN":this.IFF.currentForm.inputNodeName||(this.IFF.currentForm.inputNodeName=[]),this.IFF.currentForm.inputNodeName.push(this.IFF.reader.getString());break;case"IINM":this.IFF.currentForm.inputName||(this.IFF.currentForm.inputName=[]),this.IFF.currentForm.inputName.push(this.IFF.reader.getString());break;case"IONM":this.IFF.currentForm.inputOutputName||(this.IFF.currentForm.inputOutputName=[]),this.IFF.currentForm.inputOutputName.push(this.IFF.reader.getString());break;case"FNAM":this.IFF.currentForm.fileName=this.IFF.reader.getString();break;case"CHAN":4===t?this.IFF.currentForm.textureChannel=this.IFF.reader.getIDTag():this.IFF.reader.skip(t);break;case"SMAN":const n=this.IFF.reader.getFloat32();this.IFF.currentSurface.attributes.smooth=!(n<0);break;case"COLR":this.IFF.currentSurface.attributes.Color={value:this.IFF.reader.getFloat32Array(3)},this.IFF.reader.skip(2);break;case"LUMI":this.IFF.currentSurface.attributes.Luminosity={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"SPEC":this.IFF.currentSurface.attributes.Specular={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"DIFF":this.IFF.currentSurface.attributes.Diffuse={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"REFL":this.IFF.currentSurface.attributes.Reflection={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"GLOS":this.IFF.currentSurface.attributes.Glossiness={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"TRAN":this.IFF.currentSurface.attributes.opacity=this.IFF.reader.getFloat32(),this.IFF.reader.skip(2);break;case"BUMP":this.IFF.currentSurface.attributes.bumpStrength=this.IFF.reader.getFloat32(),this.IFF.reader.skip(2);break;case"SIDE":this.IFF.currentSurface.attributes.side=this.IFF.reader.getUint16();break;case"RIMG":this.IFF.currentSurface.attributes.reflectionMap=this.IFF.reader.getVariableLengthIndex();break;case"RIND":this.IFF.currentSurface.attributes.refractiveIndex=this.IFF.reader.getFloat32(),this.IFF.reader.skip(2);break;case"TIMG":this.IFF.currentSurface.attributes.refractionMap=this.IFF.reader.getVariableLengthIndex();break;case"IMAP":this.IFF.reader.skip(2);break;case"IUVI":this.IFF.currentNode.UVChannel=this.IFF.reader.getString(t);break;case"IUTL":this.IFF.currentNode.widthWrappingMode=this.IFF.reader.getUint32();break;case"IVTL":this.IFF.currentNode.heightWrappingMode=this.IFF.reader.getUint32();break;case"BLOK":break;default:this.IFF.parseUnknownCHUNK(e,t)}"FORM"!=e&&(this.IFF.debugger.node=1,this.IFF.debugger.nodeID=e,this.IFF.debugger.log()),this.IFF.reader.offset>=this.IFF.currentFormEnd&&(this.IFF.currentForm=this.IFF.parentForm)}}class sg{constructor(e){this.IFF=e}parseBlock(){this.IFF.debugger.offset=this.IFF.reader.offset,this.IFF.debugger.closeForms();const e=this.IFF.reader.getIDTag(),t=this.IFF.reader.getUint32();switch(this.IFF.debugger.dataOffset=this.IFF.reader.offset,this.IFF.debugger.length=t,e){case"FORM":this.IFF.parseForm(t);break;case"ICON":case"VMPA":case"BBOX":case"NORM":case"PRE ":case"POST":case"KEY ":case"SPAN":case"TIME":case"CLRS":case"CLRA":case"FILT":case"DITH":case"CONT":case"BRIT":case"SATR":case"HUE ":case"GAMM":case"NEGA":case"IFLT":case"PFLT":case"PROJ":case"AXIS":case"AAST":case"PIXB":case"STCK":case"VALU":case"PNAM":case"INAM":case"GRST":case"GREN":case"GRPT":case"FKEY":case"IKEY":case"CSYS":case"OPAQ":case"CMAP":case"NLOC":case"NZOM":case"NVER":case"NSRV":case"NCRD":case"NMOD":case"NSEL":case"NPRW":case"NPLA":case"VERS":case"ENUM":case"TAG ":case"CGMD":case"CGTY":case"CGST":case"CGEN":case"CGTS":case"CGTE":case"OSMP":case"OMDE":case"OUTR":case"FLAG":case"TRNL":case"SHRP":case"RFOP":case"RSAN":case"TROP":case"RBLR":case"TBLR":case"CLRH":case"CLRF":case"ADTR":case"GLOW":case"LINE":case"ALPH":case"VCOL":case"ENAB":this.IFF.debugger.skipped=!0,this.IFF.reader.skip(t);break;case"IPIX":case"IMIP":case"IMOD":case"AMOD":case"IINV":case"INCR":case"IAXS":case"IFOT":case"ITIM":case"IWRL":case"IUTI":case"IINX":case"IINY":case"IINZ":case"IREF":4===t?this.IFF.currentNode[e]=this.IFF.reader.getInt32():this.IFF.reader.skip(t);break;case"OTAG":this.IFF.parseObjectTag();break;case"LAYR":this.IFF.parseLayer(t);break;case"PNTS":this.IFF.parsePoints(t);break;case"VMAP":this.IFF.parseVertexMapping(t);break;case"POLS":this.IFF.parsePolygonList(t);break;case"TAGS":this.IFF.parseTagStrings(t);break;case"PTAG":this.IFF.parsePolygonTagMapping(t);break;case"VMAD":this.IFF.parseVertexMapping(t,!0);break;case"DESC":this.IFF.currentForm.description=this.IFF.reader.getString();break;case"TEXT":case"CMNT":case"NCOM":this.IFF.currentForm.comment=this.IFF.reader.getString();break;case"NAME":this.IFF.currentForm.channelName=this.IFF.reader.getString();break;case"WRAP":this.IFF.currentForm.wrap={w:this.IFF.reader.getUint16(),h:this.IFF.reader.getUint16()};break;case"IMAG":const r=this.IFF.reader.getVariableLengthIndex();this.IFF.currentForm.imageIndex=r;break;case"OREF":this.IFF.currentForm.referenceObject=this.IFF.reader.getString();break;case"ROID":this.IFF.currentForm.referenceObjectID=this.IFF.reader.getUint32();break;case"SSHN":this.IFF.currentSurface.surfaceShaderName=this.IFF.reader.getString();break;case"AOVN":this.IFF.currentSurface.surfaceCustomAOVName=this.IFF.reader.getString();break;case"NSTA":this.IFF.currentForm.disabled=this.IFF.reader.getUint16();break;case"NRNM":this.IFF.currentForm.realName=this.IFF.reader.getString();break;case"NNME":this.IFF.currentForm.refName=this.IFF.reader.getString(),this.IFF.currentSurface.nodes[this.IFF.currentForm.refName]=this.IFF.currentForm;break;case"INME":this.IFF.currentForm.nodeName||(this.IFF.currentForm.nodeName=[]),this.IFF.currentForm.nodeName.push(this.IFF.reader.getString());break;case"IINN":this.IFF.currentForm.inputNodeName||(this.IFF.currentForm.inputNodeName=[]),this.IFF.currentForm.inputNodeName.push(this.IFF.reader.getString());break;case"IINM":this.IFF.currentForm.inputName||(this.IFF.currentForm.inputName=[]),this.IFF.currentForm.inputName.push(this.IFF.reader.getString());break;case"IONM":this.IFF.currentForm.inputOutputName||(this.IFF.currentForm.inputOutputName=[]),this.IFF.currentForm.inputOutputName.push(this.IFF.reader.getString());break;case"FNAM":this.IFF.currentForm.fileName=this.IFF.reader.getString();break;case"CHAN":4===t?this.IFF.currentForm.textureChannel=this.IFF.reader.getIDTag():this.IFF.reader.skip(t);break;case"SMAN":const n=this.IFF.reader.getFloat32();this.IFF.currentSurface.attributes.smooth=!(n<0);break;case"COLR":this.IFF.currentSurface.attributes.Color={value:this.IFF.reader.getFloat32Array(3)},this.IFF.reader.skip(2);break;case"LUMI":this.IFF.currentSurface.attributes.Luminosity={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"SPEC":this.IFF.currentSurface.attributes.Specular={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"DIFF":this.IFF.currentSurface.attributes.Diffuse={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"REFL":this.IFF.currentSurface.attributes.Reflection={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"GLOS":this.IFF.currentSurface.attributes.Glossiness={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"TRAN":this.IFF.currentSurface.attributes.opacity=this.IFF.reader.getFloat32(),this.IFF.reader.skip(2);break;case"BUMP":this.IFF.currentSurface.attributes.bumpStrength=this.IFF.reader.getFloat32(),this.IFF.reader.skip(2);break;case"SIDE":this.IFF.currentSurface.attributes.side=this.IFF.reader.getUint16();break;case"RIMG":this.IFF.currentSurface.attributes.reflectionMap=this.IFF.reader.getVariableLengthIndex();break;case"RIND":this.IFF.currentSurface.attributes.refractiveIndex=this.IFF.reader.getFloat32(),this.IFF.reader.skip(2);break;case"TIMG":this.IFF.currentSurface.attributes.refractionMap=this.IFF.reader.getVariableLengthIndex();break;case"IMAP":this.IFF.currentSurface.attributes.imageMapIndex=this.IFF.reader.getUint32();break;case"IUVI":this.IFF.currentNode.UVChannel=this.IFF.reader.getString(t);break;case"IUTL":this.IFF.currentNode.widthWrappingMode=this.IFF.reader.getUint32();break;case"IVTL":this.IFF.currentNode.heightWrappingMode=this.IFF.reader.getUint32();break;default:this.IFF.parseUnknownCHUNK(e,t)}"FORM"!=e&&(this.IFF.debugger.node=1,this.IFF.debugger.nodeID=e,this.IFF.debugger.log()),this.IFF.reader.offset>=this.IFF.currentFormEnd&&(this.IFF.currentForm=this.IFF.parentForm)}}class og{constructor(){this.debugger=new cg}parse(e){if(this.reader=new lg(e),this.tree={materials:{},layers:[],tags:[],textures:[]},this.currentLayer=this.tree,this.currentForm=this.tree,this.parseTopForm(),void 0!==this.tree.format){if("LWO2"===this.tree.format)for(this.parser=new ag(this);!this.reader.endOfFile();)this.parser.parseBlock();else if("LWO3"===this.tree.format)for(this.parser=new sg(this);!this.reader.endOfFile();)this.parser.parseBlock();return this.debugger.offset=this.reader.offset,this.debugger.closeForms(),this.tree}}parseTopForm(){if(this.debugger.offset=this.reader.offset,"FORM"===this.reader.getIDTag()){var e=this.reader.getUint32();this.debugger.dataOffset=this.reader.offset,this.debugger.length=e;var t=this.reader.getIDTag();("LWO2"===t||"LWO3"===t)&&(this.tree.format=t),this.debugger.node=0,this.debugger.nodeID=t,this.debugger.log()}else console.warn("LWOLoader: Top-level FORM missing.")}parseForm(e){var t=this.reader.getIDTag();switch(t){case"ISEQ":case"ANIM":case"STCC":case"VPVL":case"VPRM":case"NROT":case"WRPW":case"WRPH":case"FUNC":case"FALL":case"OPAC":case"GRAD":case"ENVS":case"VMOP":case"VMBG":case"OMAX":case"STEX":case"CKBG":case"CKEY":case"VMLA":case"VMLB":this.debugger.skipped=!0,this.skipForm(e);break;case"META":case"NNDS":case"NODS":case"NDTA":case"ADAT":case"AOVS":case"BLOK":case"IBGC":case"IOPC":case"IIMG":case"TXTR":this.debugger.length=4,this.debugger.skipped=!0;break;case"IFAL":case"ISCL":case"IPOS":case"IROT":case"IBMP":case"IUTD":case"IVTD":this.parseTextureNodeAttribute(t);break;case"ENVL":this.parseEnvelope(e);break;case"CLIP":"LWO2"===this.tree.format?this.parseForm(e):this.parseClip(e);break;case"STIL":this.parseImage();break;case"XREF":this.reader.skip(8),this.currentForm.referenceTexture={index:this.reader.getUint32(),refName:this.reader.getString()};break;case"IMST":this.parseImageStateForm(e);break;case"SURF":this.parseSurfaceForm(e);break;case"VALU":this.parseValueForm(e);break;case"NTAG":this.parseSubNode(e);break;case"ATTR":case"SATR":this.setupForm("attributes",e);break;case"NCON":this.parseConnections(e);break;case"SSHA":this.parentForm=this.currentForm,this.currentForm=this.currentSurface,this.setupForm("surfaceShader",e);break;case"SSHD":this.setupForm("surfaceShaderData",e);break;case"ENTR":this.parseEntryForm(e);break;case"IMAP":this.parseImageMap(e);break;case"TAMP":this.parseXVAL("amplitude",e);break;case"TMAP":this.setupForm("textureMap",e);break;case"CNTR":this.parseXVAL3("center",e);break;case"SIZE":this.parseXVAL3("scale",e);break;case"ROTA":this.parseXVAL3("rotation",e);break;default:this.parseUnknownForm(t,e)}this.debugger.node=0,this.debugger.nodeID=t,this.debugger.log()}setupForm(e,t){this.currentForm||(this.currentForm=this.currentNode),this.currentFormEnd=this.reader.offset+t,this.parentForm=this.currentForm,this.currentForm[e]?(console.warn("LWOLoader: form already exists on parent: ",e,this.currentForm),this.currentForm=this.currentForm[e]):(this.currentForm[e]={},this.currentForm=this.currentForm[e])}skipForm(e){this.reader.skip(e-4)}parseUnknownForm(e,t){var r,n,i;console.warn("LWOLoader: unknown FORM encountered: "+e,t),r=this.reader.dv.buffer,n=this.reader.offset,i=t-4,console.log((new TextDecoder).decode(new Uint8Array(r,n,i))),this.reader.skip(t-4)}parseSurfaceForm(e){this.reader.skip(8);var t=this.reader.getString(),r={attributes:{},connections:{},name:t,inputName:t,nodes:{},source:this.reader.getString()};this.tree.materials[t]=r,this.currentSurface=r,this.parentForm=this.tree.materials,this.currentForm=r,this.currentFormEnd=this.reader.offset+e}parseSurfaceLwo2(e){var t=this.reader.getString(),r={attributes:{},connections:{},name:t,nodes:{},source:this.reader.getString()};this.tree.materials[t]=r,this.currentSurface=r,this.parentForm=this.tree.materials,this.currentForm=r,this.currentFormEnd=this.reader.offset+e}parseSubNode(e){this.reader.skip(8);var t={name:this.reader.getString()};this.currentForm=t,this.currentNode=t,this.currentFormEnd=this.reader.offset+e}parseConnections(e){this.currentFormEnd=this.reader.offset+e,this.parentForm=this.currentForm,this.currentForm=this.currentSurface.connections}parseEntryForm(e){this.reader.skip(8);var t=this.reader.getString();this.currentForm=this.currentNode.attributes,this.setupForm(t,e)}parseValueForm(){this.reader.skip(8);var e=this.reader.getString();"double"===e?this.currentForm.value=this.reader.getUint64():"int"===e?this.currentForm.value=this.reader.getUint32():"vparam"===e?(this.reader.skip(24),this.currentForm.value=this.reader.getFloat64()):"vparam3"===e&&(this.reader.skip(24),this.currentForm.value=this.reader.getFloat64Array(3))}parseImageStateForm(){this.reader.skip(8),this.currentForm.mipMapLevel=this.reader.getFloat32()}parseImageMap(e){this.currentFormEnd=this.reader.offset+e,this.parentForm=this.currentForm,this.currentForm.maps||(this.currentForm.maps=[]);var t={};this.currentForm.maps.push(t),this.currentForm=t,this.reader.skip(10)}parseTextureNodeAttribute(e){switch(this.reader.skip(28),this.reader.skip(20),e){case"ISCL":this.currentNode.scale=this.reader.getFloat32Array(3);break;case"IPOS":this.currentNode.position=this.reader.getFloat32Array(3);break;case"IROT":this.currentNode.rotation=this.reader.getFloat32Array(3);break;case"IFAL":this.currentNode.falloff=this.reader.getFloat32Array(3);break;case"IBMP":this.currentNode.amplitude=this.reader.getFloat32();break;case"IUTD":this.currentNode.uTiles=this.reader.getFloat32();break;case"IVTD":this.currentNode.vTiles=this.reader.getFloat32()}this.reader.skip(2)}parseEnvelope(e){this.reader.skip(e-4)}parseClip(e){if("FORM"===this.reader.getIDTag())return this.reader.skip(16),void(this.currentNode.fileName=this.reader.getString());this.reader.setOffset(this.reader.offset-4),this.currentFormEnd=this.reader.offset+e,this.parentForm=this.currentForm,this.reader.skip(8);var t={index:this.reader.getUint32()};this.tree.textures.push(t),this.currentForm=t}parseClipLwo2(e){for(var t={index:this.reader.getUint32(),fileName:""};;){var r=this.reader.getIDTag(),n=this.reader.getUint16();if("STIL"===r){t.fileName=this.reader.getString();break}if(n>=e)break}this.tree.textures.push(t),this.currentForm=t}parseImage(){this.reader.skip(8),this.currentForm.fileName=this.reader.getString()}parseXVAL(e,t){var r=this.reader.offset+t-4;this.reader.skip(8),this.currentForm[e]=this.reader.getFloat32(),this.reader.setOffset(r)}parseXVAL3(e,t){var r=this.reader.offset+t-4;this.reader.skip(8),this.currentForm[e]={x:this.reader.getFloat32(),y:this.reader.getFloat32(),z:this.reader.getFloat32()},this.reader.setOffset(r)}parseObjectTag(){this.tree.objectTags||(this.tree.objectTags={}),this.tree.objectTags[this.reader.getIDTag()]={tagString:this.reader.getString()}}parseLayer(e){var t={number:this.reader.getUint16(),flags:this.reader.getUint16(),pivot:this.reader.getFloat32Array(3),name:this.reader.getString()};this.tree.layers.push(t),this.currentLayer=t;var r=16+ug(this.currentLayer.name);this.currentLayer.parent=r<e?this.reader.getUint16():-1}parsePoints(e){this.currentPoints=[];for(var t=0;t<e/4;t+=3)this.currentPoints.push(this.reader.getFloat32(),this.reader.getFloat32(),-this.reader.getFloat32())}parseVertexMapping(e,t){var r=this.reader.offset+e,n=this.reader.getString();if(this.reader.offset!==r){this.reader.setOffset(this.reader.offset-ug(n));var i=this.reader.getIDTag();this.reader.getUint16();var a=this.reader.getString(),s=e-6-ug(a);switch(i){case"TXUV":this.parseUVMapping(a,r,t);break;case"MORF":case"SPOT":this.parseMorphTargets(a,r,i);break;case"APSL":case"NORM":case"WGHT":case"MNVW":case"PICK":case"RGB ":case"RGBA":this.reader.skip(s);break;default:console.warn("LWOLoader: unknown vertex map type: "+i),this.reader.skip(s)}}else this.currentForm.UVChannel=n}parseUVMapping(e,t,r){for(var n=[],i=[],a=[];this.reader.offset<t;)n.push(this.reader.getVariableLengthIndex()),r&&i.push(this.reader.getVariableLengthIndex()),a.push(this.reader.getFloat32(),this.reader.getFloat32());r?(this.currentLayer.discontinuousUVs||(this.currentLayer.discontinuousUVs={}),this.currentLayer.discontinuousUVs[e]={uvIndices:n,polyIndices:i,uvs:a}):(this.currentLayer.uvs||(this.currentLayer.uvs={}),this.currentLayer.uvs[e]={uvIndices:n,uvs:a})}parseMorphTargets(e,t,r){var n=[],i=[];for(r="MORF"===r?"relative":"absolute";this.reader.offset<t;)n.push(this.reader.getVariableLengthIndex()),i.push(this.reader.getFloat32(),this.reader.getFloat32(),-this.reader.getFloat32());this.currentLayer.morphTargets||(this.currentLayer.morphTargets={}),this.currentLayer.morphTargets[e]={indices:n,points:i,type:r}}parsePolygonList(e){for(var t=this.reader.offset+e,r=this.reader.getIDTag(),n=[],i=[];this.reader.offset<t;){var a=this.reader.getUint16();a&=1023,i.push(a);for(var s=0;s<a;s++)n.push(this.reader.getVariableLengthIndex())}var o={type:r,vertexIndices:n,polygonDimensions:i,points:this.currentPoints};1===i[0]?o.type="points":2===i[0]&&(o.type="lines"),this.currentLayer.geometry=o}parseTagStrings(e){this.tree.tags=this.reader.getStringArray(e)}parsePolygonTagMapping(e){var t=this.reader.offset+e;"SURF"===this.reader.getIDTag()?this.parseMaterialIndices(t):this.reader.skip(e-4)}parseMaterialIndices(e){for(this.currentLayer.geometry.materialIndices=[];this.reader.offset<e;){var t=this.reader.getVariableLengthIndex(),r=this.reader.getUint16();this.currentLayer.geometry.materialIndices.push(t,r)}}parseUnknownCHUNK(e,t){console.warn("LWOLoader: unknown chunk type: "+e+" length: "+t);var r=this.reader.getString(t);this.currentForm[e]=r}}class lg{constructor(e){this.dv=new DataView(e),this.offset=0,this._textDecoder=new TextDecoder,this._bytes=new Uint8Array(e)}size(){return this.dv.buffer.byteLength}setOffset(e){e>0&&e<this.dv.buffer.byteLength?this.offset=e:console.error("LWOLoader: invalid buffer offset")}endOfFile(){return this.offset>=this.size()}skip(e){this.offset+=e}getUint8(){var e=this.dv.getUint8(this.offset);return this.offset+=1,e}getUint16(){var e=this.dv.getUint16(this.offset);return this.offset+=2,e}getInt32(){var e=this.dv.getInt32(this.offset,!1);return this.offset+=4,e}getUint32(){var e=this.dv.getUint32(this.offset,!1);return this.offset+=4,e}getUint64(){return 4294967296*this.getUint32()+this.getUint32()}getFloat32(){var e=this.dv.getFloat32(this.offset,!1);return this.offset+=4,e}getFloat32Array(e){for(var t=[],r=0;r<e;r++)t.push(this.getFloat32());return t}getFloat64(){var e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){for(var t=[],r=0;r<e;r++)t.push(this.getFloat64());return t}getVariableLengthIndex(){var e=this.getUint8();return 255===e?65536*this.getUint8()+256*this.getUint8()+this.getUint8():256*e+this.getUint8()}getIDTag(){return this.getString(4)}getString(e){if(0===e)return;const t=this.offset;let r,n;return e?(n=e,r=this._textDecoder.decode(new Uint8Array(this.dv.buffer,t,e))):(n=this._bytes.indexOf(0,t)-t,r=this._textDecoder.decode(new Uint8Array(this.dv.buffer,t,n)),n++,n+=n%2),this.skip(n),r}getStringArray(e){var t=this.getString(e);return(t=t.split("\0")).filter(Boolean)}}class cg{constructor(){this.active=!1,this.depth=0,this.formList=[]}enable(){this.active=!0}log(){if(this.active){var e;switch(this.node){case 0:e="FORM";break;case 1:e="CHK";break;case 2:e="S-CHK"}console.log("| ".repeat(this.depth)+e,this.nodeID,`( ${this.offset} ) -> ( ${this.dataOffset+this.length} )`,0==this.node?" {":"",this.skipped?"SKIPPED":"",0==this.node&&this.skipped?"}":""),0!=this.node||this.skipped||(this.depth+=1,this.formList.push(this.dataOffset+this.length)),this.skipped=!1}}closeForms(){if(this.active)for(var e=this.formList.length-1;e>=0;e--)this.offset>=this.formList[e]&&(this.depth-=1,console.log("| ".repeat(this.depth)+"}"),this.formList.splice(-1,1))}}function ug(e){return e.length+1+((e.length+1)%2?1:0)}class hg extends n.Loader{constructor(e,t={}){super(e),this.resourcePath=void 0!==t.resourcePath?t.resourcePath:""}load(e,t,r,i){const a=this,s=""===a.path?function(e,t){const r=e.indexOf(t);return-1===r?"./":e.substr(0,r)}(e,"Objects"):a.path,o=e.split(s).pop().split(".")[0],l=new n.FileLoader(this.manager);l.setPath(a.path),l.setResponseType("arraybuffer"),l.load(e,(function(r){try{t(a.parse(r,s,o))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e,t,r){$m=(new og).parse(e);const i=new n.TextureLoader(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new dg(i).parse(r)}}class dg{constructor(e){this.textureLoader=e}parse(e){return this.materials=new pg(this.textureLoader).parse(),this.defaultLayerName=e,this.meshes=this.parseLayers(),{materials:this.materials,meshes:this.meshes}}parseLayers(){const e=[],t=[],r=new fg,n=this;return $m.layers.forEach((function(i){const a=r.parse(i.geometry,i),s=n.parseMesh(a,i);e[i.number]=s,-1===i.parent?t.push(s):e[i.parent].add(s)})),this.applyPivots(t),t}parseMesh(e,t){let r;const i=this.getMaterials(e.userData.matNames,t.geometry.type);return this.duplicateUVs(e,i),r="points"===t.geometry.type?new n.Points(e,i):"lines"===t.geometry.type?new n.LineSegments(e,i):new n.Mesh(e,i),t.name?r.name=t.name:r.name=this.defaultLayerName+"_layer_"+t.number,r.userData.pivot=t.pivot,r}applyPivots(e){e.forEach((function(e){e.traverse((function(e){const t=e.userData.pivot;if(e.position.x+=t[0],e.position.y+=t[1],e.position.z+=t[2],e.parent){const t=e.parent.userData.pivot;e.position.x-=t[0],e.position.y-=t[1],e.position.z-=t[2]}}))}))}getMaterials(e,t){const r=[],i=this;e.forEach((function(e,t){r[t]=i.getMaterialByName(e)})),"points"!==t&&"lines"!==t||r.forEach((function(e,i){const a={color:e.color};"points"===t?(a.size=.1,a.map=e.map,a.morphTargets=e.morphTargets,r[i]=new n.PointsMaterial(a)):"lines"===t&&(r[i]=new n.LineBasicMaterial(a))}));const a=r.filter(Boolean);return 1===a.length?a[0]:r}getMaterialByName(e){return this.materials.filter((function(t){return t.name===e}))[0]}duplicateUVs(e,t){let r=!1;Array.isArray(t)?t.forEach((function(e){e.aoMap&&(r=!0)})):t.aoMap&&(r=!0),r&&e.setAttribute("uv2",new n.BufferAttribute(e.attributes.uv.array,2))}}class pg{constructor(e){this.textureLoader=e}parse(){const e=[];this.textures={};for(const t in $m.materials)"LWO3"===$m.format?e.push(this.parseMaterial($m.materials[t],t,$m.textures)):"LWO2"===$m.format&&e.push(this.parseMaterialLwo2($m.materials[t],t,$m.textures));return e}parseMaterial(e,t,r){let n={name:t,side:this.getSide(e.attributes),flatShading:this.getSmooth(e.attributes)};const i=this.parseConnections(e.connections,e.nodes),a=this.parseTextureNodes(i.maps);this.parseAttributeImageMaps(i.attributes,r,a,e.maps);const s=this.parseAttributes(i.attributes,a);this.parseEnvMap(i,a,s),n=Object.assign(a,n),n=Object.assign(n,s);return new(this.getMaterialType(i.attributes))(n)}parseMaterialLwo2(e,t){let r={name:t,side:this.getSide(e.attributes),flatShading:this.getSmooth(e.attributes)};const i=this.parseAttributes(e.attributes,{});return r=Object.assign(r,i),new n.MeshPhongMaterial(r)}getSide(e){if(!e.side)return n.BackSide;switch(e.side){case 0:case 1:return n.BackSide;case 2:return n.FrontSide;case 3:return n.DoubleSide}}getSmooth(e){return!e.smooth||!e.smooth}parseConnections(e,t){const r={maps:{}},n=e.inputName,i=e.inputNodeName,a=e.nodeName,s=this;return n.forEach((function(e,n){if("Material"===e){const e=s.getNodeByRefName(i[n],t);r.attributes=e.attributes,r.envMap=e.fileName,r.name=i[n]}})),a.forEach((function(e,a){e===r.name&&(r.maps[n[a]]=s.getNodeByRefName(i[a],t))})),r}getNodeByRefName(e,t){for(const r in t)if(t[r].refName===e)return t[r]}parseTextureNodes(e){const t={};for(const r in e){const i=e[r],a=i.fileName;if(!a)return;const s=this.loadTexture(a);switch(void 0!==i.widthWrappingMode&&(s.wrapS=this.getWrappingType(i.widthWrappingMode)),void 0!==i.heightWrappingMode&&(s.wrapT=this.getWrappingType(i.heightWrappingMode)),r){case"Color":t.map=s;break;case"Roughness":t.roughnessMap=s,t.roughness=.5;break;case"Specular":t.specularMap=s,t.specular=16777215;break;case"Luminous":t.emissiveMap=s,t.emissive=8421504;break;case"Luminous Color":t.emissive=8421504;break;case"Metallic":t.metalnessMap=s,t.metalness=.5;break;case"Transparency":case"Alpha":t.alphaMap=s,t.transparent=!0;break;case"Normal":t.normalMap=s,void 0!==i.amplitude&&(t.normalScale=new n.Vector2(i.amplitude,i.amplitude));break;case"Bump":t.bumpMap=s}}return t.roughnessMap&&t.specularMap&&delete t.specularMap,t}parseAttributeImageMaps(e,t,r){for(const n in e){const i=e[n];if(i.maps){const e=i.maps[0],a=this.getTexturePathByIndex(e.imageIndex,t);if(!a)return;const s=this.loadTexture(a);switch(void 0!==e.wrap&&(s.wrapS=this.getWrappingType(e.wrap.w)),void 0!==e.wrap&&(s.wrapT=this.getWrappingType(e.wrap.h)),n){case"Color":r.map=s;break;case"Diffuse":r.aoMap=s;break;case"Roughness":r.roughnessMap=s,r.roughness=1;break;case"Specular":r.specularMap=s,r.specular=16777215;break;case"Luminosity":r.emissiveMap=s,r.emissive=8421504;break;case"Metallic":r.metalnessMap=s,r.metalness=1;break;case"Transparency":case"Alpha":r.alphaMap=s,r.transparent=!0;break;case"Normal":r.normalMap=s;break;case"Bump":r.bumpMap=s}}}}parseAttributes(e,t){const r={};return e.Color&&!t.map?r.color=(new n.Color).fromArray(e.Color.value):r.color=new n.Color,e.Transparency&&0!==e.Transparency.value&&(r.opacity=1-e.Transparency.value,r.transparent=!0),e["Bump Height"]&&(r.bumpScale=.1*e["Bump Height"].value),e["Refraction Index"]&&(r.refractionRatio=1/e["Refraction Index"].value),this.parsePhysicalAttributes(r,e,t),this.parseStandardAttributes(r,e,t),this.parsePhongAttributes(r,e,t),r}parsePhysicalAttributes(e,t){t.Clearcoat&&t.Clearcoat.value>0&&(e.clearcoat=t.Clearcoat.value,t["Clearcoat Gloss"]&&(e.clearcoatRoughness=.5*(1-t["Clearcoat Gloss"].value)))}parseStandardAttributes(e,t,r){t.Luminous&&(e.emissiveIntensity=t.Luminous.value,t["Luminous Color"]&&!r.emissive?e.emissive=(new n.Color).fromArray(t["Luminous Color"].value):e.emissive=new n.Color(8421504)),t.Roughness&&!r.roughnessMap&&(e.roughness=t.Roughness.value),t.Metallic&&!r.metalnessMap&&(e.metalness=t.Metallic.value)}parsePhongAttributes(e,t,r){t.Diffuse&&e.color.multiplyScalar(t.Diffuse.value),t.Reflection&&(e.reflectivity=t.Reflection.value,e.combine=n.AddOperation),t.Luminosity&&(e.emissiveIntensity=t.Luminosity.value,r.emissiveMap||r.map?e.emissive=new n.Color(8421504):e.emissive=e.color),t.Roughness||!t.Specular||r.specularMap||(t["Color Highlight"]?e.specular=(new n.Color).setScalar(t.Specular.value).lerp(e.color.clone().multiplyScalar(t.Specular.value),t["Color Highlight"].value):e.specular=(new n.Color).setScalar(t.Specular.value)),e.specular&&t.Glossiness&&(e.shininess=7+Math.pow(2,12*t.Glossiness.value+2))}parseEnvMap(e,t,r){if(e.envMap){const i=this.loadTexture(e.envMap);r.transparent&&r.opacity<.999?(i.mapping=n.EquirectangularRefractionMapping,void 0!==r.reflectivity&&(delete r.reflectivity,delete r.combine),void 0!==r.metalness&&delete r.metalness):i.mapping=n.EquirectangularReflectionMapping,t.envMap=i}}getTexturePathByIndex(e){let t="";return $m.textures?($m.textures.forEach((function(r){r.index===e&&(t=r.fileName)})),t):t}loadTexture(e){if(!e)return null;return this.textureLoader.load(e,void 0,void 0,(function(){console.warn("LWOLoader: non-standard resource hierarchy. Use `resourcePath` parameter to specify root content directory.")}))}getWrappingType(e){switch(e){case 0:return console.warn('LWOLoader: "Reset" texture wrapping type is not supported in three.js'),n.ClampToEdgeWrapping;case 1:return n.RepeatWrapping;case 2:return n.MirroredRepeatWrapping;case 3:return n.ClampToEdgeWrapping}}getMaterialType(e){return e.Clearcoat&&e.Clearcoat.value>0?n.MeshPhysicalMaterial:e.Roughness?n.MeshStandardMaterial:n.MeshPhongMaterial}}class fg{parse(e,t){const r=new n.BufferGeometry;r.setAttribute("position",new n.Float32BufferAttribute(e.points,3));const i=this.splitIndices(e.vertexIndices,e.polygonDimensions);return r.setIndex(i),this.parseGroups(r,e),r.computeVertexNormals(),this.parseUVs(r,t,i),this.parseMorphTargets(r,t,i),r.translate(-t.pivot[0],-t.pivot[1],-t.pivot[2]),r}splitIndices(e,t){const r=[];let n=0;return t.forEach((function(t){if(t<4)for(let i=0;i<t;i++)r.push(e[n+i]);else if(4===t)r.push(e[n],e[n+1],e[n+2],e[n],e[n+2],e[n+3]);else if(t>4){for(let i=1;i<t-1;i++)r.push(e[n],e[n+i],e[n+i+1]);console.warn("LWOLoader: polygons with greater than 4 sides are not supported")}n+=t})),r}parseGroups(e,t){const r=$m.tags,n=[];let i=3;"lines"===t.type&&(i=2),"points"===t.type&&(i=1);const a=this.splitMaterialIndices(t.polygonDimensions,t.materialIndices);let s=0;const o={};let l,c,u=0,h=0;for(let d=0;d<a.length;d+=2){if(c=a[d+1],0===d&&(n[s]=r[c]),void 0===l&&(l=c),c!==l){let t;o[r[l]]?t=o[r[l]]:(t=s,o[r[l]]=s,n[s]=r[l],s++),e.addGroup(u,h,t),u+=h,l=c,h=0}h+=i}if(e.groups.length>0){let t;o[r[c]]?t=o[r[c]]:(t=s,o[r[c]]=s,n[s]=r[c]),e.addGroup(u,h,t)}e.userData.matNames=n}splitMaterialIndices(e,t){const r=[];return e.forEach((function(e,n){if(e<=3)r.push(t[2*n],t[2*n+1]);else if(4===e)r.push(t[2*n],t[2*n+1],t[2*n],t[2*n+1]);else for(let i=0;i<e-2;i++)r.push(t[2*n],t[2*n+1])})),r}parseUVs(e,t){const r=Array.from(Array(2*e.attributes.position.count),(function(){return 0}));for(const n in t.uvs){const e=t.uvs[n].uvs;t.uvs[n].uvIndices.forEach((function(t,n){r[2*t]=e[2*n],r[2*t+1]=e[2*n+1]}))}e.setAttribute("uv",new n.Float32BufferAttribute(r,2))}parseMorphTargets(e,t){let r=0;for(const i in t.morphTargets){const a=e.attributes.position.array.slice();e.morphAttributes.position||(e.morphAttributes.position=[]);const s=t.morphTargets[i].points,o=t.morphTargets[i].indices,l=t.morphTargets[i].type;o.forEach((function(e,t){"relative"===l?(a[3*e]+=s[3*t],a[3*e+1]+=s[3*t+1],a[3*e+2]+=s[3*t+2]):(a[3*e]=s[3*t],a[3*e+1]=s[3*t+1],a[3*e+2]=s[3*t+2])})),e.morphAttributes.position[r]=new n.Float32BufferAttribute(a,3),e.morphAttributes.position[r].name=i,r++}e.morphTargetsRelative=!1}}class mg extends n.Loader{constructor(e){super(e),this.propertyNameMapping={}}load(e,t,r,i){const a=this,s=new n.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(r){try{t(a.parse(r))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}setPropertyNameMapping(e){this.propertyNameMapping=e}parse(e){function t(e){let t="",r=0;const n=/ply([\s\S]*)end_header\r?\n/.exec(e);null!==n&&(t=n[1],r=new Blob([n[0]]).size);const i={comments:[],elements:[],headerLength:r,objInfo:""},a=t.split("\n");let s;function o(e,t){const r={type:e[0]};return"list"===r.type?(r.name=e[3],r.countType=e[1],r.itemType=e[2]):r.name=e[1],r.name in t&&(r.name=t[r.name]),r}for(let l=0;l<a.length;l++){let e=a[l];if(e=e.trim(),""===e)continue;const t=e.split(/\s+/),r=t.shift();switch(e=t.join(" "),r){case"format":i.format=t[0],i.version=t[1];break;case"comment":i.comments.push(e);break;case"element":void 0!==s&&i.elements.push(s),s={},s.name=t[0],s.count=parseInt(t[1]),s.properties=[];break;case"property":s.properties.push(o(t,h.propertyNameMapping));break;case"obj_info":i.objInfo=e;break;default:console.log("unhandled",r,t)}}return void 0!==s&&i.elements.push(s),i}function r(e,t){switch(t){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(e);case"float":case"double":case"float32":case"float64":return parseFloat(e)}}function i(e,t){const n=t.split(/\s+/),i={};for(let a=0;a<e.length;a++)if("list"===e[a].type){const t=[],s=r(n.shift(),e[a].countType);for(let i=0;i<s;i++)t.push(r(n.shift(),e[a].itemType));i[e[a].name]=t}else i[e[a].name]=r(n.shift(),e[a].type);return i}function a(e,t){const r={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]};let n;let a="";null!==(n=/end_header\s([\s\S]*)$/.exec(e))&&(a=n[1]);const l=a.split("\n");let c=0,u=0;for(let s=0;s<l.length;s++){let e=l[s];if(e=e.trim(),""===e)continue;u>=t.elements[c].count&&(c++,u=0);const n=i(t.elements[c].properties,e);o(r,t.elements[c].name,n),u++}return s(r)}function s(e){let t=new n.BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.setAttribute("position",new n.Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.setAttribute("normal",new n.Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.setAttribute("uv",new n.Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.setAttribute("color",new n.Float32BufferAttribute(e.colors,3)),e.faceVertexUvs.length>0&&(t=t.toNonIndexed(),t.setAttribute("uv",new n.Float32BufferAttribute(e.faceVertexUvs,2))),t.computeBoundingSphere(),t}function o(e,t,r){if("vertex"===t)e.vertices.push(r.x,r.y,r.z),"nx"in r&&"ny"in r&&"nz"in r&&e.normals.push(r.nx,r.ny,r.nz),"s"in r&&"t"in r&&e.uvs.push(r.s,r.t),"red"in r&&"green"in r&&"blue"in r&&e.colors.push(r.red/255,r.green/255,r.blue/255);else if("face"===t){const t=r.vertex_indices||r.vertex_index,n=r.texcoord;3===t.length?(e.indices.push(t[0],t[1],t[2]),n&&6===n.length&&(e.faceVertexUvs.push(n[0],n[1]),e.faceVertexUvs.push(n[2],n[3]),e.faceVertexUvs.push(n[4],n[5]))):4===t.length&&(e.indices.push(t[0],t[1],t[3]),e.indices.push(t[1],t[2],t[3]))}}function l(e,t,r,n){switch(r){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,n),2];case"uint16":case"ushort":return[e.getUint16(t,n),2];case"int32":case"int":return[e.getInt32(t,n),4];case"uint32":case"uint":return[e.getUint32(t,n),4];case"float32":case"float":return[e.getFloat32(t,n),4];case"float64":case"double":return[e.getFloat64(t,n),8]}}function c(e,t,r,n){const i={};let a,s=0;for(let o=0;o<r.length;o++)if("list"===r[o].type){const c=[];a=l(e,t+s,r[o].countType,n);const u=a[0];s+=a[1];for(let i=0;i<u;i++)a=l(e,t+s,r[o].itemType,n),c.push(a[0]),s+=a[1];i[r[o].name]=c}else a=l(e,t+s,r[o].type,n),i[r[o].name]=a[0],s+=a[1];return[i,s]}let u;const h=this;if(e instanceof ArrayBuffer){const r=n.LoaderUtils.decodeText(new Uint8Array(e)),i=t(r);u="ascii"===i.format?a(r,i):function(e,t){const r={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]},n="binary_little_endian"===t.format,i=new DataView(e,t.headerLength);let a,l=0;for(let s=0;s<t.elements.length;s++)for(let e=0;e<t.elements[s].count;e++){a=c(i,l,t.elements[s].properties,n),l+=a[1];const e=a[0];o(r,t.elements[s].name,e)}return s(r)}(e,i)}else u=a(e,t(e));return u}}var gg=r(3415),vg=r(51815),Ag=r(10977);const yg=new n.Vector3,xg=new n.Vector3;class bg extends n.Mesh{constructor(e=new gg.z,t=new Ag.Y({color:16777215*Math.random()})){super(e,t),this.isWireframe=!0,this.type="Wireframe"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let n=0,s=0,o=t.count;n<o;n++,s+=2)yg.fromBufferAttribute(t,n),xg.fromBufferAttribute(r,n),i[s]=0===s?0:i[s-1],i[s+1]=i[s]+yg.distanceTo(xg);const a=new n.InstancedInterleavedBuffer(i,2,1);return e.setAttribute("instanceDistanceStart",new n.InterleavedBufferAttribute(a,1,0)),e.setAttribute("instanceDistanceEnd",new n.InterleavedBufferAttribute(a,1,1)),this}}class wg extends gg.z{constructor(e){super(),this.isWireframeGeometry2=!0,this.type="WireframeGeometry2",this.fromWireframeGeometry(new n.WireframeGeometry(e))}}var Eg=r(43075),Sg=r(21939);class Mg extends n.Mesh{constructor(e,t){const r=new n.ShaderMaterial({type:"LightProbeHelperMaterial",uniforms:{sh:{value:e.sh.coefficients},intensity:{value:e.intensity}},vertexShader:["varying vec3 vNormal;","void main() {","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI 0.318309886","vec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {","\t// matrix is assumed to be orthogonal","\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );","}","// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf","vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {","\t// normal is assumed to have unit length","\tfloat x = normal.x, y = normal.y, z = normal.z;","\t// band 0","\tvec3 result = shCoefficients[ 0 ] * 0.886227;","\t// band 1","\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;","\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;","\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;","\t// band 2","\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;","\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;","\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );","\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;","\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );","\treturn result;","}","uniform vec3 sh[ 9 ]; // sh coefficients","uniform float intensity; // light probe intensity","varying vec3 vNormal;","void main() {","\tvec3 normal = normalize( vNormal );","\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );","\tvec3 irradiance = shGetIrradianceAt( worldNormal, sh );","\tvec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;","\tgl_FragColor = linearToOutputTexel( vec4( outgoingLight, 1.0 ) );","}"].join("\n")});super(new n.SphereGeometry(1,32,16),r),this.lightProbe=e,this.size=t,this.type="LightProbeHelper",this.onBeforeRender()}dispose(){this.geometry.dispose(),this.material.dispose()}onBeforeRender(){this.position.copy(this.lightProbe.position),this.scale.set(1,1,1).multiplyScalar(this.size),this.material.uniforms.intensity.value=this.lightProbe.intensity}}const _g=new n.Vector3,Tg=new n.Vector3;class Cg extends n.LineSegments{constructor(e,t=1,r=65535){const i=new n.BufferGeometry,a=e.geometry.attributes.tangent.count,s=new n.Float32BufferAttribute(2*a*3,3);i.setAttribute("position",s),super(i,new n.LineBasicMaterial({color:r,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexTangentsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0);const e=this.object.matrixWorld,t=this.geometry.attributes.position,r=this.object.geometry,n=r.attributes.position,i=r.attributes.tangent;let a=0;for(let s=0,o=n.count;s<o;s++)_g.fromBufferAttribute(n,s).applyMatrix4(e),Tg.fromBufferAttribute(i,s),Tg.transformDirection(e).multiplyScalar(this.size).add(_g),t.setXYZ(a,_g.x,_g.y,_g.z),a+=1,t.setXYZ(a,Tg.x,Tg.y,Tg.z),a+=1;t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class Ig extends n.Line{constructor(e,t=1,r=16,i=2){const a=new n.BufferGeometry,s=new Float32Array(3*(3*(r+2*i)+3));a.setAttribute("position",new n.BufferAttribute(s,3));const o=new n.LineBasicMaterial({color:65280});super(a,[new n.LineBasicMaterial({color:16776960}),o]),this.type="PositionalAudioHelper",this.audio=e,this.range=t,this.divisionsInnerAngle=r,this.divisionsOuterAngle=i,this.update()}update(){const e=this.audio,t=this.range,r=this.divisionsInnerAngle,i=this.divisionsOuterAngle,a=n.MathUtils.degToRad(e.panner.coneInnerAngle),s=n.MathUtils.degToRad(e.panner.coneOuterAngle),o=a/2,l=s/2;let c,u,h=0,d=0;const p=this.geometry,f=p.attributes.position;function m(e,r,n,i){const a=(r-e)/n;for(f.setXYZ(h,0,0,0),d++,c=e;c<r;c+=a)u=h+d,f.setXYZ(u,Math.sin(c)*t,0,Math.cos(c)*t),f.setXYZ(u+1,Math.sin(Math.min(c+a,r))*t,0,Math.cos(Math.min(c+a,r))*t),f.setXYZ(u+2,0,0,0),d+=3;p.addGroup(h,d,i),h+=d,d=0}p.clearGroups(),m(-l,-o,i,0),m(-o,o,r,1),m(o,l,i,0),f.needsUpdate=!0,a===s&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}const Bg=new n.Vector3,Rg=new n.Vector3,Pg=new n.Matrix3;class Fg extends n.LineSegments{constructor(e,t=1,r=16711680){const i=new n.BufferGeometry,a=e.geometry.attributes.normal.count,s=new n.Float32BufferAttribute(2*a*3,3);i.setAttribute("position",s),super(i,new n.LineBasicMaterial({color:r,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),Pg.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,r=this.object.geometry;if(r){const n=r.attributes.position,i=r.attributes.normal;let a=0;for(let r=0,s=n.count;r<s;r++)Bg.fromBufferAttribute(n,r).applyMatrix4(e),Rg.fromBufferAttribute(i,r),Rg.applyMatrix3(Pg).normalize().multiplyScalar(this.size).add(Bg),t.setXYZ(a,Bg.x,Bg.y,Bg.z),a+=1,t.setXYZ(a,Rg.x,Rg.y,Rg.z),a+=1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class Lg extends n.Line{constructor(e,t){const r=new n.BufferGeometry;r.setAttribute("position",new n.Float32BufferAttribute([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),r.computeBoundingSphere();super(r,new n.LineBasicMaterial({fog:!1})),this.light=e,this.color=t,this.type="RectAreaLightHelper";const i=new n.BufferGeometry;i.setAttribute("position",new n.Float32BufferAttribute([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),i.computeBoundingSphere(),this.add(new n.Mesh(i,new n.MeshBasicMaterial({side:n.BackSide,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);const e=this.material.color,t=Math.max(e.r,e.g,e.b);t>1&&e.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}class Dg{static init(){const e=[1,0,0,2e-5,1,0,0,503905e-9,1,0,0,.00201562,1,0,0,.00453516,1,0,0,.00806253,1,0,0,.0125978,1,0,0,.018141,1,0,0,.0246924,1,0,0,.0322525,1,0,0,.0408213,1,0,0,.0503999,1,0,0,.0609894,1,0,0,.0725906,1,0,0,.0852058,1,0,0,.0988363,1,0,0,.113484,1,0,0,.129153,1,0,0,.145839,1,0,0,.163548,1,0,0,.182266,1,0,0,.201942,1,0,0,.222314,1,0,0,.241906,1,0,0,.262314,1,0,0,.285754,1,0,0,.310159,1,0,0,.335426,1,0,0,.361341,1,0,0,.387445,1,0,0,.412784,1,0,0,.438197,1,0,0,.466966,1,0,0,.49559,1,0,0,.523448,1,0,0,.549938,1,0,0,.57979,1,0,0,.608746,1,0,0,.636185,1,0,0,.664748,1,0,0,.69313,1,0,0,.71966,1,0,0,.747662,1,0,0,.774023,1,0,0,.799775,1,0,0,.825274,1,0,0,.849156,1,0,0,.873248,1,0,0,.89532,1,0,0,.917565,1,0,0,.937863,1,0,0,.958139,1,0,0,.976563,1,0,0,.994658,1,0,0,1.0112,1,0,0,1.02712,1,0,0,1.04189,1,0,0,1.05568,1,0,0,1.06877,1,0,0,1.08058,1,0,0,1.09194,1,0,0,1.10191,1,0,0,1.11161,1,0,0,1.1199,1,0,0,1.12813,.999547,-4.48815e-7,.0224417,199902e-10,.999495,-113079e-10,.0224406,503651e-9,.999496,-452317e-10,.0224406,.00201461,.999496,-101772e-9,.0224406,.00453287,.999495,-180928e-9,.0224406,.00805845,.999497,-282702e-9,.0224406,.0125914,.999496,-407096e-9,.0224406,.0181319,.999498,-554114e-9,.0224406,.02468,.999499,-723768e-9,.0224406,.0322363,.999495,-916058e-9,.0224405,.0408009,.999499,-.00113101,.0224408,.050375,.999494,-.00136863,.0224405,.0609586,.999489,-.00162896,.0224401,.0725537,.999489,-.00191201,.0224414,.0851619,.999498,-.00221787,.0224413,.0987867,.999492,-.00254642,.0224409,.113426,.999507,-.00289779,.0224417,.129088,.999494,-.0032716,.0224386,.145767,.999546,-.0036673,.0224424,.163472,.999543,-.00408166,.0224387,.182182,.999499,-.00450056,.0224338,.201843,.999503,-.00483661,.0224203,.222198,.999546,-.00452928,.022315,.241714,.999508,-.00587403,.0224329,.262184,.999509,-.00638806,.0224271,.285609,.999501,-.00691028,.0224166,.309998,.999539,-.00741979,.0223989,.335262,.999454,-.00786282,.0223675,.361154,.999529,-.00811928,.0222828,.387224,.999503,-.00799941,.0221063,.41252,.999561,-.00952753,.0223057,.438006,.999557,-.0099134,.0222065,.466735,.999541,-.0100935,.0220402,.495332,.999562,-.00996821,.0218067,.523197,.999556,-.0105031,.0217096,.550223,.999561,-.0114191,.0217215,.579498,.999588,-.0111818,.0213357,.608416,.999633,-.0107725,.0208689,.635965,.999527,-.0121671,.0210149,.664476,.999508,-.0116005,.020431,.692786,.999568,-.0115604,.0199791,.719709,.999671,-.0121117,.0197415,.74737,.999688,-.0110769,.0188846,.773692,.99962,-.0122368,.0188452,.799534,.999823,-.0110325,.0178001,.825046,.999599,-.0114923,.0174221,.849075,.999619,-.0105923,.0164345,.872999,.999613,-.0105988,.0158227,.895371,.99964,-.00979861,.0148131,.917364,.99977,-.00967238,.0140721,.938002,.999726,-.00869175,.0129543,.957917,.99973,-.00866872,.0122329,.976557,.999773,-.00731956,.0108958,.994459,.999811,-.00756027,.0102715,1.01118,.999862,-.00583732,.00878781,1.02701,.999835,-.00631438,.00827529,1.04186,.999871,-.00450785,.00674583,1.05569,.999867,-.00486079,.00621041,1.06861,.999939,-.00322072,.00478301,1.08064,.999918,-.00318199,.00406395,1.09181,1.00003,-.00193348,.00280682,1.10207,.999928,-.00153729,.00198741,1.11152,.999933,-623666e-9,917714e-9,1.12009,1,-102387e-11,9.07581e-7,1.12813,.997866,-8.96716e-7,.0448334,199584e-10,.997987,-225945e-10,.0448389,502891e-9,.997987,-903781e-10,.0448388,.00201156,.997985,-203351e-9,.0448388,.00452602,.997986,-361514e-9,.0448388,.00804629,.997987,-56487e-8,.0448389,.0125724,.997988,-813423e-9,.0448389,.0181045,.997984,-.00110718,.0448387,.0246427,.997985,-.00144616,.0448388,.0321875,.997987,-.00183038,.044839,.0407392,.997983,-.00225987,.0448387,.0502986,.997991,-.00273467,.0448389,.0608667,.997984,-.00325481,.0448384,.0724444,.998002,-.00382043,.044839,.0850348,.997997,-.00443145,.0448396,.0986372,.998007,-.00508796,.0448397,.113255,.998008,-.00578985,.04484,.128891,.998003,-.00653683,.0448384,.145548,.997983,-.00732713,.0448358,.163221,.997985,-.00815454,.0448358,.181899,.998005,-.00898985,.0448286,.201533,.998026,-.00964404,.0447934,.221821,.998055,-.00922677,.044611,.241282,.99804,-.0117361,.0448245,.261791,.998048,-.0127628,.0448159,.285181,.998088,-.0138055,.0447996,.30954,.998058,-.0148206,.0447669,.334751,.998099,-.0156998,.044697,.36061,.998116,-.0161976,.0445122,.386603,.998195,-.015945,.0441711,.411844,.998168,-.0183947,.0444255,.43773,.998184,-.0197913,.0443809,.466009,.998251,-.0201426,.0440689,.494574,.998305,-.0198847,.0435632,.522405,.998273,-.0210577,.043414,.549967,.998254,-.0227901,.0433943,.578655,.998349,-.0223108,.0426529,.60758,.99843,-.0223088,.042,.635524,.998373,-.0241141,.0418987,.663621,.998425,-.0231446,.0408118,.691906,.998504,-.0233684,.0400565,.719339,.998443,-.0241652,.0394634,.74643,.99848,-.0228715,.0380002,.773086,.998569,-.023519,.0372322,.798988,.998619,-.0223108,.0356468,.824249,.998594,-.0223105,.034523,.848808,.998622,-.0213426,.0328887,.87227,.998669,-.0207912,.0314374,.895157,.998705,-.0198416,.0296925,.916769,.998786,-.0189168,.0279634,.937773,.998888,-.0178811,.0261597,.957431,.99906,-.0166845,.0242159,.976495,.999038,-.0155464,.0222638,.994169,.999237,-.0141349,.0201967,1.01112,.999378,-.0129324,.0181744,1.02692,.999433,-.0113192,.0159898,1.04174,.999439,-.0101244,.0140385,1.05559,.999614,-.00837456,.0117826,1.06852,.999722,-.00721769,.00983745,1.08069,.999817,-.00554067,.00769002,1.09176,.99983,-.00426961,.005782,1.10211,.999964,-.00273904,.00374503,1.11152,1.00001,-.00136739,.00187176,1.12031,.999946,393227e-10,-28919e-9,1.12804,.995847,-13435e-10,.0671785,19916e-9,.995464,-338387e-10,.0671527,501622e-9,.99547,-135355e-9,.0671531,.00200649,.995471,-30455e-8,.0671532,.00451461,.99547,-541423e-9,.0671531,.008026,.995471,-84598e-8,.0671531,.0125407,.99547,-.00121823,.0671531,.0180589,.99547,-.00165817,.0671531,.0245806,.995463,-.00216583,.0671526,.0321062,.995468,-.00274127,.0671527,.0406366,.995474,-.00338447,.0671534,.0501717,.995473,-.00409554,.0671533,.0607131,.995478,-.00487451,.0671531,.0722618,.995476,-.00572148,.0671532,.0848191,.995477,-.00663658,.0671539,.0983882,.995498,-.00761986,.0671541,.112972,.995509,-.00867094,.0671542,.128568,.995509,-.00978951,.0671531,.145183,.995503,-.0109725,.0671491,.162808,.995501,-.012211,.0671465,.181441,.99553,-.0134565,.0671371,.201015,.99555,-.014391,.0670831,.221206,.99558,-.014351,.0668883,.240813,.995577,-.0173997,.0671055,.261257,.995602,-.0191111,.0671178,.284467,.995623,-.0206705,.0670946,.308765,.995658,-.022184,.0670472,.333905,.995705,-.0234832,.0669417,.359677,.995719,-.0241933,.0666714,.385554,.995786,-.0243539,.066266,.410951,.995887,-.0271866,.0664367,.437163,.995944,-.0296012,.0664931,.464842,.996004,-.0301045,.0660105,.49332,.996128,-.0298311,.0652694,.521131,.996253,-.0316426,.0650739,.549167,.996244,-.0339043,.0649433,.57737,.996309,-.033329,.0638926,.606073,.996417,-.0338935,.0630849,.634527,.996372,-.0353104,.0625083,.66256,.996542,-.0348942,.0611986,.690516,.996568,-.0351614,.060069,.718317,.996711,-.0354317,.0588522,.74528,.996671,-.0349513,.0571902,.772061,.996865,-.0345622,.0555321,.798089,.996802,-.0342566,.0537816,.823178,.996992,-.0330862,.0516095,.847949,.996944,-.0324666,.0495537,.871431,.997146,-.0309544,.0470302,.894357,.997189,-.0299372,.0446043,.916142,.997471,-.0281389,.0418812,.937193,.997515,-.0268702,.0391823,.957,.997812,-.0247166,.0361338,.975936,.998027,-.0233525,.0333945,.99391,.998233,-.0209839,.0301917,1.01075,.998481,-.0194309,.027271,1.02669,.998859,-.0169728,.0240162,1.04173,.99894,-.0152322,.0210517,1.05551,.999132,-.0127497,.0178632,1.06856,.999369,-.0108282,.014787,1.08054,.999549,-.00845886,.0116185,1.09185,.999805,-.0063937,.00867209,1.10207,.99985,-.00414582,.00566823,1.1117,.999912,-.00207443,.00277562,1.12022,1.00001,870226e-10,-53766e-9,1.12832,.991943,-178672e-11,.0893382,198384e-10,.991952,-450183e-10,.089339,499849e-9,.991956,-180074e-9,.0893394,.0019994,.991955,-405167e-9,.0893393,.00449867,.991953,-720298e-9,.0893391,.00799764,.991955,-.00112548,.0893393,.0124964,.991957,-.0016207,.0893395,.0179951,.991958,-.00220601,.0893396,.0244939,.991947,-.00288137,.0893385,.0319929,.991962,-.00364693,.0893399,.0404933,.991965,-.00450264,.0893399,.049995,.99198,-.00544862,.0893411,.0604995,.99197,-.00648491,.0893397,.0720074,.991976,-.00761164,.089341,.0845207,.99198,-.00882891,.0893405,.0980413,.991982,-.0101367,.0893396,.112571,.992008,-.011535,.0893415,.128115,.992026,-.0130228,.0893414,.144672,.992064,-.0145966,.0893418,.162241,.992041,-.0162421,.0893359,.180801,.992086,-.0178888,.0893214,.200302,.992157,-.0190368,.0892401,.220332,.992181,-.0195584,.0890525,.240144,.992175,-.0227257,.0892153,.260728,.99221,-.0254195,.089304,.283473,.99222,-.0274883,.0892703,.307673,.992317,-.0294905,.0892027,.332729,.992374,-.0311861,.0890577,.358387,.992505,-.0320656,.0886994,.384102,.992568,-.0329715,.0883198,.409767,.992675,-.036006,.0883602,.436145,.992746,-.0392897,.0884591,.463217,.992873,-.0399337,.0878287,.491557,.992934,-.040231,.0870108,.519516,.993091,-.0422013,.0865857,.547741,.993259,-.0443503,.0861937,.575792,.993455,-.0446368,.0851187,.604233,.993497,-.0454299,.0840576,.632925,.993694,-.0463296,.0829671,.660985,.993718,-.0470619,.0817185,.688714,.993973,-.0468838,.0800294,.716743,.994207,-.046705,.0781286,.74377,.994168,-.0469698,.0763337,.77042,.9945,-.0456816,.0738184,.796659,.994356,-.0455518,.0715545,.821868,.994747,-.0439488,.0686085,.846572,.994937,-.0430056,.065869,.870435,.995142,-.0413414,.0626446,.893272,.995451,-.0396521,.05929,.915376,.995445,-.0378453,.0558503,.936196,.995967,-.0355219,.0520949,.956376,.996094,-.0335146,.048377,.975327,.996622,-.030682,.0442575,.993471,.996938,-.0285504,.0404693,1.01052,.997383,-.0253399,.0360903,1.02637,.997714,-.0231651,.0322176,1.04139,.998249,-.0198138,.0278433,1.05542,.998596,-.0174337,.0238759,1.06846,.998946,-.0141349,.0195944,1.08056,.99928,-.0115603,.0156279,1.09181,.999507,-.00839065,.0114607,1.10213,.999697,-.005666,.00763325,1.11169,.999869,-.00269902,.00364946,1.12042,1.00001,623836e-10,-319288e-10,1.12832,.987221,-222675e-11,.111332,197456e-10,.98739,-561116e-10,.111351,497563e-9,.987448,-224453e-9,.111357,.00199031,.987441,-505019e-9,.111357,.0044782,.987442,-897816e-9,.111357,.00796129,.987442,-.00140284,.111357,.0124396,.987444,-.00202012,.111357,.0179132,.987442,-.00274964,.111357,.0243824,.987446,-.00359147,.111357,.0318474,.987435,-.00454562,.111356,.0403086,.987461,-.00561225,.111358,.0497678,.987458,-.00679125,.111358,.0602239,.987443,-.0080828,.111356,.0716792,.987476,-.0094872,.111358,.0841364,.98749,-.0110044,.111361,.097597,.987508,-.0126344,.111362,.112062,.987494,-.0143767,.111357,.127533,.987526,-.0162307,.111359,.144015,.987558,-.0181912,.111361,.161502,.987602,-.0202393,.111355,.179979,.987692,-.022273,.111346,.199386,.987702,-.0235306,.111215,.219183,.987789,-.0247628,.111061,.239202,.987776,-.0280668,.111171,.259957,.987856,-.0316751,.111327,.282198,.987912,-.0342468,.111282,.306294,.988,-.0367205,.111198,.331219,.988055,-.0387766,.110994,.356708,.988241,-.0397722,.110547,.382234,.988399,-.0416076,.110198,.408227,.988539,-.0448192,.110137,.434662,.988661,-.0483793,.110143,.461442,.988967,-.0495895,.109453,.489318,.989073,-.0506797,.108628,.517516,.989274,-.0526953,.108003,.545844,.989528,-.054578,.107255,.573823,.989709,-.0561503,.106294,.601944,.989991,-.056866,.104896,.630855,.990392,-.0572914,.103336,.658925,.990374,-.0586224,.10189,.686661,.990747,-.0584764,.099783,.714548,.991041,-.0582662,.0974309,.74186,.991236,-.0584118,.0951678,.768422,.991585,-.0573055,.0921581,.794817,.991984,-.0564241,.0891167,.820336,.9921,-.0553608,.085805,.84493,.992749,-.0533816,.0820354,.868961,.99288,-.0518661,.0782181,.891931,.993511,-.0492492,.0738935,.914186,.993617,-.0471956,.0696402,.93532,.99411,-.044216,.0649659,.95543,.994595,-.0416654,.0603177,.974685,.994976,-.0384314,.0553493,.992807,.995579,-.0353491,.0503942,1.00996,.996069,-.0319787,.0452123,1.02606,.996718,-.028472,.0400112,1.04114,.997173,-.0250789,.0349456,1.05517,.997818,-.0213326,.029653,1.0683,.998318,-.0178509,.024549,1.0805,.998853,-.0141118,.0194197,1.09177,.999218,-.0105914,.0143869,1.1022,.999594,-.00693474,.00943517,1.11175,.99975,-.00340478,.00464051,1.12056,1.00001,109172e-9,-112821e-9,1.12853,.983383,-266524e-11,.133358,196534e-10,.981942,-671009e-10,.133162,494804e-9,.981946,-268405e-9,.133163,.00197923,.981944,-603912e-9,.133163,.00445326,.981941,-.00107362,.133162,.00791693,.981946,-.00167755,.133163,.0123703,.981944,-.00241569,.133162,.0178135,.981945,-.00328807,.133163,.0242466,.981945,-.00429472,.133162,.03167,.981955,-.00543573,.133164,.0400846,.981951,-.00671105,.133163,.0494901,.981968,-.00812092,.133165,.0598886,.981979,-.00966541,.133166,.0712811,.981996,-.0113446,.133168,.083669,.982014,-.0131585,.133169,.0970533,.982011,-.0151073,.133167,.111438,.982062,-.0171906,.133172,.126826,.9821,-.0194067,.133175,.143215,.982149,-.0217502,.133176,.160609,.982163,-.0241945,.133173,.178981,.982247,-.0265907,.133148,.198249,.982291,-.027916,.132974,.217795,.982396,-.0299663,.132868,.238042,.982456,-.0334544,.132934,.258901,.982499,-.0378636,.133137,.280639,.982617,-.0409274,.133085,.304604,.98274,-.0438523,.132985,.329376,.982944,-.0462288,.132728,.354697,.98308,-.0475995,.132228,.380102,.983391,-.0501901,.131924,.406256,.983514,-.0535899,.131737,.432735,.98373,-.0571858,.131567,.459359,.984056,-.0592353,.130932,.486637,.984234,-.0610488,.130092,.51509,.984748,-.0630758,.12923,.543461,.985073,-.0647398,.128174,.571376,.985195,-.0671941,.127133,.599414,.985734,-.0681345,.125576,.628134,.986241,-.0686089,.123639,.656399,.986356,-.0698511,.121834,.684258,.986894,-.0700931,.119454,.711818,.987382,-.0698321,.116718,.739511,.988109,-.0693975,.113699,.766267,.988363,-.0689584,.110454,.792456,.989112,-.0672353,.106602,.81813,.989241,-.0662034,.10267,.842889,.990333,-.0638938,.0981381,.867204,.990591,-.0618534,.0935388,.89038,.991106,-.0593117,.088553,.912576,.991919,-.0562676,.0832187,.934118,.992111,-.0534085,.0778302,.954254,.992997,-.0495459,.0720453,.973722,.993317,-.0463707,.0663458,.991949,.994133,-.0421245,.0601883,1.00936,.994705,-.0384977,.0542501,1.02559,.995495,-.0340956,.0479862,1.04083,.996206,-.030105,.041887,1.05497,.996971,-.0256095,.0355355,1.06824,.997796,-.0213932,.0293655,1.08056,.998272,-.0169612,.0232926,1.09182,.998857,-.0126756,.0172786,1.10219,.99939,-.00832486,.0113156,1.11192,.999752,-.00410826,.00557892,1.12075,1,150957e-9,-119101e-9,1.12885,.975169,-309397e-11,.154669,195073e-10,.975439,-779608e-10,.154712,491534e-9,.975464,-311847e-9,.154716,.00196617,.975464,-701656e-9,.154716,.00442387,.975462,-.0012474,.154715,.0078647,.975461,-.00194906,.154715,.0122886,.975464,-.00280667,.154715,.0176959,.975468,-.00382025,.154716,.0240867,.975471,-.00498985,.154716,.0314612,.975472,-.00631541,.154717,.0398199,.975486,-.00779719,.154718,.0491639,.975489,-.00943505,.154718,.0594932,.975509,-.0112295,.154721,.0708113,.97554,-.0131802,.154724,.0831176,.975557,-.0152876,.154726,.096415,.975585,-.0175512,.154728,.110705,.975605,-.0199713,.154729,.125992,.975645,-.0225447,.154729,.142272,.975711,-.0252649,.154735,.159549,.975788,-.0280986,.154736,.177805,.975872,-.0308232,.154704,.196911,.975968,-.0324841,.154525,.216324,.976063,-.0351281,.154432,.236628,.976157,-.0388618,.15446,.257539,.976204,-.0437704,.154665,.278975,.976358,-.047514,.154652,.302606,.976571,-.0508638,.154535,.327204,.976725,-.0534995,.154221,.352276,.977013,-.0555547,.153737,.377696,.977294,-.0586728,.153403,.403855,.977602,-.0622715,.15312,.430333,.977932,-.0658166,.152755,.456855,.978241,-.0689877,.152233,.483668,.978602,-.0712805,.15132,.512097,.979234,-.0732775,.150235,.540455,.97977,-.075163,.148978,.568486,.979995,-.0778026,.147755,.596524,.98078,-.0791854,.146019,.624825,.981628,-.0799666,.143906,.653403,.982067,-.0808532,.141561,.681445,.98271,-.0816024,.139025,.708918,.983734,-.0812511,.135764,.736594,.98431,-.0806201,.132152,.763576,.985071,-.0801605,.12846,.789797,.98618,-.0784208,.124084,.815804,.986886,-.0766643,.1193,.840869,.987485,-.0747744,.114236,.864952,.988431,-.0716701,.108654,.888431,.988886,-.0691609,.102994,.910963,.990024,-.0654048,.0967278,.932629,.990401,-.0619765,.090384,.95313,.991093,-.0579296,.0837885,.972587,.992018,-.0536576,.0770171,.991184,.992536,-.0493719,.0701486,1.00863,.993421,-.0444813,.062953,1.02494,.993928,-.040008,.0560455,1.04017,.994994,-.0347982,.04856,1.05463,.995866,-.0301017,.0416152,1.06807,.996916,-.0248225,.0342597,1.08039,.997766,-.0199229,.0271668,1.09177,.998479,-.0147422,.0201387,1.10235,.99921,-.00980173,.0131944,1.11206,.999652,-.0047426,.00640712,1.12104,.999998,891673e-10,-10379e-8,1.12906,.967868,-351885e-11,.175947,193569e-10,.968001,-886733e-10,.175972,487782e-9,.96801,-354697e-9,.175973,.00195115,.968012,-798063e-9,.175974,.00439006,.968011,-.00141879,.175973,.00780461,.968011,-.00221686,.175973,.0121948,.968016,-.00319231,.175974,.0175607,.968019,-.00434515,.175974,.0239027,.968018,-.00567538,.175974,.0312208,.968033,-.00718308,.175977,.0395158,.968049,-.00886836,.175979,.0487885,.968047,-.0107312,.175978,.0590394,.968072,-.0127719,.175981,.0702705,.968108,-.0149905,.175986,.0824836,.968112,-.0173866,.175985,.0956783,.968173,-.0199611,.175993,.109862,.96827,-.0227128,.176008,.125033,.968292,-.025639,.17601,.141193,.968339,-.0287299,.176007,.158336,.968389,-.0319399,.176001,.176441,.968501,-.034941,.175962,.195359,.968646,-.0370812,.175793,.214686,.968789,-.0402329,.175708,.234973,.96886,-.0442601,.1757,.255871,.969013,-.049398,.175876,.277238,.969242,-.0539932,.17594,.300326,.969419,-.0577299,.175781,.324702,.969763,-.0605643,.175432,.349527,.970093,-.0634488,.174992,.374976,.970361,-.0670589,.174611,.401097,.970825,-.0708246,.174226,.427496,.971214,-.0742871,.173684,.453858,.971622,-.0782608,.173186,.480637,.972175,-.0813151,.172288,.508655,.972944,-.0832678,.170979,.536973,.973595,-.0855964,.169573,.565138,.974345,-.0882163,.168152,.593222,.975233,-.0901671,.166314,.621201,.976239,-.0912111,.163931,.649919,.977289,-.0916959,.161106,.678011,.978076,-.0927061,.158272,.705717,.979533,-.0925562,.15475,.733228,.980335,-.0918159,.150638,.760454,.981808,-.0908508,.146201,.786918,.983061,-.0896172,.141386,.812953,.984148,-.0871588,.135837,.838281,.985047,-.0850624,.130135,.862594,.986219,-.0818541,.123882,.88633,.987043,-.0784523,.117126,.908952,.988107,-.0749601,.110341,.930744,.988955,-.0703548,.102885,.951728,.989426,-.0662798,.0954167,.971166,.990421,-.0610834,.0876331,.989984,.991032,-.0562936,.0797785,1.00765,.992041,-.0508154,.0718166,1.02434,.992794,-.0454045,.0637125,1.03976,.993691,-.0398194,.0555338,1.05418,.994778,-.0341482,.0473388,1.06772,.995915,-.028428,.0391016,1.08028,.997109,-.022642,.0309953,1.09185,.998095,-.0168738,.0230288,1.10247,.998985,-.0111274,.0150722,1.11229,.999581,-.00543881,.00740605,1.12131,1.00003,162239e-9,-105549e-9,1.12946,.959505,-393734e-11,.196876,191893e-10,.959599,-992157e-10,.196895,483544e-9,.959641,-396868e-9,.196903,.0019342,.959599,-892948e-9,.196895,.00435193,.959603,-.00158747,.196896,.0077368,.959604,-.00248042,.196896,.0120888,.959605,-.00357184,.196896,.0174082,.959605,-.00486169,.196896,.0236949,.959613,-.00635008,.196897,.0309497,.959619,-.00803696,.196898,.0391725,.959636,-.00992255,.196901,.0483649,.959634,-.0120067,.1969,.0585266,.959675,-.0142898,.196906,.0696609,.959712,-.0167717,.196911,.0817678,.959752,-.0194524,.196918,.0948494,.959807,-.0223321,.196925,.10891,.959828,-.0254091,.196924,.123947,.959906,-.0286815,.196934,.139968,.960005,-.0321371,.196944,.156968,.960071,-.0357114,.196936,.17491,.960237,-.0389064,.196882,.193597,.960367,-.041623,.196731,.21285,.960562,-.0452655,.196654,.233075,.960735,-.0496207,.196643,.253941,.960913,-.0549379,.196774,.275278,.961121,-.0603414,.196893,.297733,.96139,-.0644244,.196717,.321877,.961818,-.067556,.196314,.346476,.962175,-.0712709,.195917,.371907,.96255,-.0752848,.1955,.397916,.963164,-.0792073,.195026,.424229,.963782,-.0828225,.194424,.450637,.964306,-.0873119,.193831,.477288,.964923,-.0911051,.192973,.504716,.966048,-.093251,.19151,.533053,.967024,-.0958983,.190013,.561366,.968038,-.09835,.188253,.589464,.969152,-.100754,.186257,.617433,.970557,-.102239,.183775,.645801,.972104,-.102767,.180645,.674278,.973203,-.103492,.177242,.702004,.975123,-.103793,.17345,.729529,.97641,-.102839,.168886,.756712,.978313,-.101687,.163892,.783801,.980036,-.100314,.158439,.809671,.981339,-.097836,.152211,.835402,.982794,-.0950006,.145679,.860081,.984123,-.0920994,.138949,.883757,.984918,-.0878641,.131283,.90685,.985999,-.083939,.123464,.928786,.987151,-.0791234,.115324,.94983,.987827,-.0739332,.106854,.96962,.988806,-.0688088,.0982691,.98861,.989588,-.0628962,.0893456,1.00667,.990438,-.0573146,.0805392,1.02344,.991506,-.0509433,.0713725,1.03933,.992492,-.0448724,.0623732,1.05378,.993663,-.0383497,.0530838,1.06747,.994956,-.0319593,.0439512,1.08007,.99634,-.025401,.0347803,1.09182,.99761,-.0189687,.0257954,1.1025,.99863,-.0124441,.0169893,1.11247,.99947,-.00614003,.00829498,1.12151,1.00008,216624e-9,-146107e-9,1.12993,.950129,-434955e-11,.217413,190081e-10,.950264,-10957e-8,.217444,47884e-8,.9503,-438299e-9,.217451,.00191543,.950246,-986124e-9,.21744,.00430951,.950246,-.00175311,.21744,.00766137,.950245,-.00273923,.21744,.011971,.950253,-.00394453,.217441,.0172385,.950258,-.00536897,.217442,.0234641,.950267,-.00701262,.217444,.030648,.950277,-.00887551,.217446,.038791,.950284,-.0109576,.217446,.0478931,.950312,-.0132591,.217451,.0579568,.950334,-.01578,.217454,.0689821,.950378,-.0185204,.217462,.0809714,.950417,-.0214803,.217467,.0939265,.950488,-.0246594,.217479,.10785,.950534,-.0280565,.217483,.122743,.950633,-.0316685,.217498,.138611,.950698,-.0354787,.217499,.155442,.950844,-.0394003,.217507,.173208,.950999,-.0426812,.217419,.191605,.951221,-.0461302,.217317,.21084,.951412,-.0502131,.217238,.230945,.951623,-.0549183,.21722,.251745,.951867,-.0604493,.217306,.273001,.952069,-.0665189,.217466,.294874,.952459,-.0709179,.217266,.318732,.952996,-.0746112,.216891,.34318,.953425,-.0789252,.216503,.36849,.953885,-.0833293,.216042,.394373,.954617,-.087371,.215469,.420505,.955429,-.0914054,.214802,.446907,.956068,-.0961671,.214146,.473522,.957094,-.10048,.213286,.50052,.958372,-.103248,.211796,.528715,.959654,-.106033,.21016,.557065,.961305,-.108384,.208149,.585286,.962785,-.111122,.206024,.613334,.964848,-.112981,.203442,.641334,.966498,-.113717,.19996,.669955,.968678,-.114121,.196105,.698094,.970489,-.114524,.191906,.725643,.972903,-.113792,.186963,.752856,.974701,-.112406,.181343,.780013,.976718,-.110685,.175185,.806268,.978905,-.108468,.168535,.832073,.980267,-.105061,.161106,.857149,.981967,-.101675,.153387,.881145,.983063,-.0974492,.145199,.904255,.984432,-.0925815,.136527,.926686,.985734,-.0877983,.127584,.947901,.986228,-.081884,.118125,.968111,.98719,-.0761208,.108594,.98719,.988228,-.0698196,.0989996,1.00559,.989046,-.0632739,.0890074,1.02246,.990242,-.056522,.0790832,1.03841,.991252,-.0495272,.0689182,1.05347,.992542,-.0425373,.0588592,1.06724,.994096,-.0353198,.0486833,1.08009,.995593,-.028235,.0385977,1.09177,.99711,-.0209511,.0286457,1.10274,.998263,-.0139289,.0188497,1.11262,.999254,-.0067359,.009208,1.12191,.999967,141846e-9,-657764e-10,1.13024,.935608,-474692e-11,.236466,187817e-10,.93996,-11971e-8,.237568,473646e-9,.939959,-478845e-9,.237567,.0018946,.939954,-.0010774,.237566,.00426284,.939956,-.00191538,.237566,.00757842,.939954,-.00299277,.237566,.0118413,.93996,-.00430961,.237567,.0170518,.939969,-.00586589,.237569,.02321,.939982,-.00766166,.237572,.0303164,.939987,-.00969686,.237572,.0383711,.939997,-.0119715,.237574,.0473751,.940031,-.0144858,.237581,.0573298,.940073,-.0172399,.237589,.0682366,.94012,-.0202335,.237598,.080097,.940162,-.0234663,.237604,.0929116,.940237,-.0269387,.237615,.106686,.940328,-.0306489,.237632,.121421,.940419,-.0345917,.237645,.137115,.940522,-.0387481,.237654,.153766,.940702,-.0429906,.237661,.17133,.940871,-.0465089,.237561,.189502,.941103,-.050531,.23748,.208616,.941369,-.0550657,.237423,.228595,.941641,-.0601337,.237399,.249287,.941903,-.0658804,.237443,.270467,.942224,-.0722674,.237597,.292024,.942633,-.0771788,.237419,.315272,.943172,-.0815623,.237068,.339579,.943691,-.0863973,.236682,.364717,.944382,-.0911536,.236213,.390435,.945392,-.0952967,.235562,.416425,.946185,-.0998948,.234832,.442772,.947212,-.104796,.234114,.469347,.948778,-.10928,.233222,.496162,.950149,-.113081,.231845,.523978,.951989,-.115893,.230005,.552295,.953921,-.11846,.227862,.580569,.955624,-.12115,.225439,.608698,.958234,-.123373,.222635,.636696,.960593,-.124519,.219093,.665208,.963201,-.124736,.214749,.693557,.965642,-.125012,.210059,.721334,.968765,-.124661,.204935,.748613,.971753,-.122996,.198661,.776224,.973751,-.120998,.191823,.802461,.976709,-.118583,.184359,.828399,.977956,-.115102,.176437,.853693,.979672,-.111077,.167681,.877962,.981816,-.10688,.158872,.901564,.98238,-.101469,.149398,.924057,.983964,-.0960013,.139436,.945751,.984933,-.0899626,.12943,.966272,.985694,-.0832973,.11894,.985741,.986822,-.0767082,.108349,1.00407,.987725,-.0693614,.0976026,1.02154,.98877,-.06211,.086652,1.03757,.990129,-.0544143,.0756182,1.05296,.991337,-.046744,.0645753,1.06683,.992978,-.0387931,.0534683,1.0798,.994676,-.030973,.0424137,1.09181,.99645,-.0230311,.0314035,1.10286,.997967,-.0152065,.0206869,1.11291,.99922,-.00744837,.010155,1.12237,1.00002,240209e-9,-752767e-10,1.13089,.922948,-515351e-11,.255626,186069e-10,.928785,-129623e-9,.257244,468009e-9,.928761,-51849e-8,.257237,.00187202,.928751,-.0011666,.257235,.00421204,.928751,-.00207395,.257234,.0074881,.928754,-.00324055,.257235,.0117002,.92876,-.00466639,.257236,.0168486,.928763,-.00635149,.257237,.0229334,.928774,-.00829584,.257239,.029955,.928791,-.0104995,.257243,.0379139,.928804,-.0129623,.257245,.0468108,.928847,-.0156846,.257255,.0566473,.92889,-.0186661,.257263,.0674246,.928924,-.0219067,.257268,.0791433,.928989,-.0254066,.257282,.0918076,.92909,-.0291651,.257301,.105419,.92918,-.0331801,.257316,.119978,.92929,-.0374469,.257332,.135491,.929453,-.041939,.257357,.151948,.929586,-.0464612,.257347,.169275,.929858,-.0503426,.257269,.187257,.930125,-.0548409,.257199,.206204,.930403,-.0598063,.257149,.22601,.930726,-.0652437,.257122,.246561,.931098,-.0712376,.257153,.267618,.931396,-.0777506,.257237,.288993,.931947,-.0832374,.257124,.311527,.932579,-.0883955,.25683,.335697,.933194,-.0937037,.256444,.360634,.934013,-.0987292,.255939,.386126,.935307,-.103215,.255282,.412018,.936374,-.108234,.254538,.438292,.93776,-.113234,.253728,.464805,.939599,-.118013,.25275,.491464,.941036,-.122661,.251404,.518751,.94337,-.125477,.249435,.547133,.945318,-.128374,.247113,.575456,.947995,-.130996,.244441,.60372,.950818,-.133438,.241352,.63174,.954378,-.135004,.237849,.659971,.957151,-.135313,.233188,.688478,.960743,-.13521,.228001,.716767,.964352,-.135007,.222249,.744349,.967273,-.133523,.21542,.771786,.969767,-.131155,.208039,.798639,.973195,-.128492,.200076,.824774,.975557,-.125094,.191451,.850222,.977692,-.120578,.18184,.874761,.98026,-.115882,.172102,.898497,.981394,-.110372,.161859,.921636,.982386,-.10415,.15108,.943467,.983783,-.0978128,.140407,.964045,.98422,-.0906171,.129058,.98398,.985447,-.0832921,.117614,1.00276,.986682,-.0754412,.10585,1.02047,.987326,-.0673885,.0940943,1.03678,.988707,-.0592565,.0822093,1.05218,.990185,-.050717,.070192,1.06652,.991866,-.0423486,.0582081,1.07965,.993897,-.0336118,.0460985,1.09188,.995841,-.0252178,.0342737,1.10307,.997605,-.0164893,.0224829,1.11324,.999037,-.00817112,.0110647,1.12262,1.00003,291686e-9,-168673e-9,1.13139,.915304,-552675e-11,.275999,183285e-10,.91668,-139285e-9,.276414,461914e-9,.916664,-55713e-8,.276409,.00184763,.916653,-.00125354,.276406,.00415715,.916651,-.00222851,.276405,.00739053,.916655,-.00348205,.276406,.0115478,.916653,-.00501414,.276405,.0166291,.916667,-.00682478,.276409,.0226346,.91668,-.00891398,.276412,.0295648,.91669,-.0112817,.276413,.0374199,.916727,-.013928,.276422,.0462016,.916759,-.0168528,.276429,.0559101,.916793,-.0200558,.276436,.0665466,.916849,-.0235373,.276448,.0781139,.916964,-.0272973,.276474,.0906156,.917047,-.0313344,.276491,.104051,.917152,-.0356465,.276511,.118424,.917286,-.0402271,.276533,.133736,.917469,-.0450408,.276564,.149978,.917686,-.0497872,.276563,.167057,.917953,-.0540937,.276493,.184846,.918228,-.0590709,.276437,.203614,.918572,-.0644277,.276398,.223212,.918918,-.0702326,.276362,.243584,.919356,-.076484,.276383,.264465,.919842,-.0830808,.276434,.285701,.920451,-.0892972,.276407,.307559,.921113,-.095016,.276128,.331501,.921881,-.100771,.275754,.356207,.923027,-.106029,.275254,.381477,.924364,-.111029,.274595,.40722,.925818,-.116345,.273841,.433385,.92746,-.121424,.272913,.459848,.929167,-.12657,.271837,.486493,.931426,-.131581,.270575,.513432,.934001,-.135038,.268512,.541502,.936296,-.138039,.266135,.569658,.939985,-.140687,.263271,.598375,.943516,-.143247,.260058,.626563,.94782,-.145135,.256138,.654711,.951023,-.145733,.251154,.683285,.955338,-.145554,.245562,.711831,.959629,-.145008,.239265,.739573,.963123,-.144003,.232064,.767027,.966742,-.141289,.224036,.794359,.969991,-.138247,.215305,.820361,.973403,-.134786,.206051,.846548,.975317,-.129966,.195914,.871541,.977647,-.12471,.185184,.895313,.980137,-.119086,.174161,.918398,.981031,-.112297,.162792,.940679,.982037,-.105372,.150952,.961991,.983164,-.097821,.138921,.981913,.983757,-.0897245,.126611,1.00109,.985036,-.0815974,.114228,1.01902,.986289,-.0727725,.101389,1.03604,.987329,-.0639323,.0886476,1.05149,.989193,-.0548109,.0756837,1.06619,.990716,-.045687,.0627581,1.07948,.992769,-.0364315,.0498337,1.09172,.99524,-.0271761,.0370305,1.1033,.997154,-.0179609,.0243959,1.11353,.998845,-.00878063,.0119567,1.12319,1.00002,259038e-9,-108146e-9,1.13177,.903945,-591681e-11,.295126,181226e-10,.903668,-148672e-9,.295037,455367e-9,.903677,-594683e-9,.29504,.00182145,.903673,-.00133805,.295039,.00409831,.903666,-.00237872,.295036,.00728584,.903668,-.00371676,.295037,.0113842,.903679,-.00535212,.29504,.0163936,.903684,-.00728479,.295041,.0223141,.903698,-.00951473,.295044,.0291462,.903718,-.0120419,.295049,.0368904,.903754,-.0148664,.295058,.0455477,.903801,-.017988,.29507,.0551194,.903851,-.0214064,.295082,.0656058,.903921,-.0251219,.295097,.0770109,.904002,-.0291337,.295116,.0893354,.904111,-.033441,.29514,.102583,.904246,-.0380415,.295169,.116755,.904408,-.0429258,.295202,.131853,.904637,-.0480468,.295245,.147869,.904821,-.0529208,.295214,.164658,.905163,-.0577748,.295185,.182274,.905469,-.0631763,.295143,.200828,.905851,-.068917,.295112,.2202,.906322,-.0750861,.295104,.240372,.906761,-.0815855,.295086,.261082,.90735,-.0882138,.295095,.282123,.908087,-.095082,.295139,.303563,.908826,-.101488,.29492,.327028,.909832,-.107577,.294577,.351464,.911393,-.113033,.294115,.376497,.912804,-.118629,.293446,.402115,.914081,-.124232,.292581,.428111,.91637,-.129399,.29166,.454442,.91814,-.134892,.290422,.481024,.921179,-.140069,.289194,.507924,.924544,-.144431,.287421,.535557,.927995,-.147498,.284867,.563984,.931556,-.150197,.281722,.5923,.935777,-.152711,.278207,.620832,.940869,-.154836,.274148,.649069,.945994,-.155912,.269057,.677746,.949634,-.155641,.262799,.706293,.955032,-.154809,.256097,.734278,.95917,-.153678,.248618,.761751,.962931,-.151253,.239794,.789032,.966045,-.147625,.230281,.815422,.96971,-.143964,.220382,.841787,.972747,-.139464,.209846,.867446,.975545,-.133459,.198189,.892004,.978381,-.127424,.186362,.915458,.979935,-.120506,.173964,.937948,.980948,-.11282,.161429,.959732,.982234,-.104941,.148557,.980118,.982767,-.0962905,.135508,.999463,.983544,-.0873625,.122338,1.01756,.984965,-.0783447,.108669,1.03492,.986233,-.0684798,.0949911,1.05087,.987796,-.0590867,.0811386,1.0656,.989885,-.0489145,.0673099,1.0794,.991821,-.0391,.0535665,1.09174,.99448,-.029087,.0397529,1.10341,.996769,-.019114,.0261463,1.11383,.998641,-.00947007,.0128731,1.1237,.999978,446316e-9,-169093e-9,1.13253,.888362,-627064e-11,.312578,178215e-10,.889988,-157791e-9,.313148,448451e-9,.889825,-631076e-9,.313092,.00179356,.88984,-.00141994,.313097,.00403554,.889828,-.0025243,.313092,.00717429,.889831,-.00394421,.313093,.0112099,.889831,-.00567962,.313093,.0161425,.889844,-.00773051,.313096,.0219724,.889858,-.0100968,.3131,.0286999,.889882,-.0127786,.313106,.0363256,.889918,-.0157757,.313116,.0448509,.889967,-.0190878,.313129,.0542758,.89003,-.022715,.313145,.0646032,.890108,-.0266566,.313165,.0758339,.890218,-.0309131,.313193,.0879729,.890351,-.0354819,.313226,.101019,.89051,-.0403613,.313263,.114979,.890672,-.0455385,.313294,.129848,.890882,-.0509444,.313333,.145616,.891189,-.0559657,.313324,.162122,.891457,-.0613123,.313281,.179524,.891856,-.0671488,.313281,.197855,.892312,-.0732732,.313268,.216991,.892819,-.0797865,.313263,.236924,.893369,-.0865269,.313247,.257433,.894045,-.0931592,.313205,.278215,.894884,-.100532,.313276,.299467,.895832,-.107716,.313205,.322276,.897043,-.114099,.312873,.34642,.898515,-.119941,.312331,.371187,.900191,-.126044,.311731,.396656,.90188,-.131808,.310859,.422488,.904359,-.137289,.309857,.448744,.906923,-.142991,.308714,.475239,.910634,-.148253,.307465,.501983,.914502,-.153332,.305774,.529254,.919046,-.156646,.303156,.557709,.923194,-.159612,.299928,.586267,.928858,-.162027,.296245,.614925,.934464,-.164203,.291832,.643187,.939824,-.165602,.286565,.671601,.944582,-.165383,.280073,.700213,.949257,-.164439,.272891,.728432,.954389,-.162953,.264771,.756082,.958595,-.161007,.255927,.78369,.962138,-.157243,.245769,.810769,.966979,-.152872,.235127,.836999,.969566,-.148209,.22347,.862684,.972372,-.142211,.211147,.887847,.975916,-.135458,.198606,.911843,.978026,-.128398,.185498,.934795,.979686,-.120313,.17171,.956787,.980748,-.11166,.158159,.978046,.981622,-.103035,.144399,.997693,.982356,-.0930328,.13001,1.01642,.983308,-.0834627,.115778,1.03366,.985037,-.0732249,.101327,1.05014,.986493,-.0628145,.086554,1.06507,.988484,-.0526556,.0720413,1.07907,.991051,-.0415744,.0571151,1.09189,.993523,-.0314275,.0426643,1.10369,.99628,-.0203603,.0279325,1.11423,.998344,-.0102446,.0138182,1.12421,.999997,42612e-8,-193628e-9,1.1333,.871555,-660007e-11,.329176,174749e-10,.875255,-166579e-9,.330571,441051e-9,.875644,-666394e-9,.330718,.00176441,.875159,-.00149903,.330536,.00396899,.87516,-.00266493,.330536,.007056,.875158,-.00416393,.330535,.0110251,.87516,-.00599598,.330535,.0158764,.875163,-.00816108,.330536,.0216101,.875174,-.0106591,.330538,.0282266,.875199,-.0134899,.330545,.0357266,.875257,-.0166538,.330563,.0441117,.875304,-.0201501,.330575,.0533821,.875373,-.0239785,.330595,.0635395,.875464,-.0281389,.330619,.0745872,.875565,-.0326301,.330645,.0865255,.875691,-.0374516,.330676,.0993599,.875897,-.0425993,.330733,.113093,.876091,-.0480576,.330776,.127722,.876353,-.0537216,.330826,.143227,.876649,-.0589807,.330809,.159462,.877034,-.0647865,.330819,.176642,.877443,-.0709789,.330817,.194702,.877956,-.0774782,.330832,.213577,.878499,-.0843175,.330822,.233246,.879144,-.0912714,.330804,.253512,.879982,-.0980824,.330766,.274137,.88097,-.105823,.330864,.295209,.882051,-.113671,.330896,.317226,.883397,-.120303,.330545,.341068,.884987,-.12667,.330068,.365613,.886789,-.133118,.329418,.390807,.889311,-.139024,.328683,.416494,.891995,-.144971,.327729,.442618,.895106,-.150747,.326521,.469131,.899527,-.156283,.325229,.495921,.90504,-.161707,.32378,.523162,.909875,-.165661,.32122,.55092,.91561,-.168755,.317942,.579928,.921225,-.171193,.313983,.608539,.927308,-.17319,.309636,.636854,.933077,-.174819,.304262,.66523,.938766,-.175002,.297563,.693609,.943667,-.173946,.289613,.722157,.949033,-.172221,.281227,.750021,.953765,-.169869,.271545,.777466,.95804,-.166578,.261034,.804853,.962302,-.161761,.249434,.831569,.966544,-.156636,.237484,.857779,.969372,-.150784,.224395,.883051,.972486,-.143672,.210786,.907864,.975853,-.135772,.196556,.931223,.977975,-.127942,.182307,.954061,.979122,-.118347,.167607,.97531,.980719,-.109112,.152739,.995666,.981223,-.0991789,.137932,1.01475,.98216,-.0883553,.122692,1.03253,.983379,-.0780825,.107493,1.04917,.985434,-.0665646,.0917791,1.06464,.987332,-.0557714,.0764949,1.07896,.990004,-.0442805,.060721,1.09199,.992975,-.0331676,.0452284,1.10393,.995811,-.0219547,.0297934,1.11476,.9982,-.0107613,.0146415,1.12484,1.00002,248678e-9,-14555e-8,1.13413,.859519,-693595e-11,.347264,171673e-10,.859843,-17503e-8,.347394,433219e-9,.859656,-700076e-9,.347319,.00173277,.859671,-.00157517,.347325,.00389875,.859669,-.00280028,.347324,.00693112,.85967,-.0043754,.347324,.01083,.859665,-.00630049,.347321,.0155954,.859685,-.0085755,.347328,.0212278,.859694,-.0112003,.347329,.0277273,.859718,-.0141747,.347336,.0350946,.85976,-.0174988,.347348,.0433314,.85982,-.0211722,.347366,.0524384,.859892,-.0251941,.347387,.0624168,.860006,-.0295649,.347422,.0732708,.860122,-.0342825,.347453,.0849999,.860282,-.0393462,.347499,.0976102,.860482,-.0447513,.347554,.111104,.860719,-.0504775,.347614,.125479,.860998,-.0563577,.347666,.140703,.861322,-.0619473,.347662,.156681,.861724,-.0681277,.347684,.173597,.862198,-.0746567,.347709,.191371,.862733,-.0815234,.347727,.209976,.863371,-.0886643,.347744,.229351,.86414,-.0957908,.347734,.24934,.865138,-.102912,.34772,.269797,.866182,-.110924,.3478,.290654,.867436,-.119223,.347911,.312074,.869087,-.126197,.347649,.335438,.870859,-.133145,.347222,.359732,.872997,-.139869,.346645,.38467,.875939,-.146089,.345935,.41019,.879012,-.152334,.345012,.436218,.883353,-.15821,.343924,.462641,.888362,-.164097,.342636,.489449,.895026,-.169528,.341351,.516629,.900753,-.174408,.339115,.544109,.906814,-.17751,.335809,.572857,.912855,-.180101,.331597,.601554,.919438,-.182116,.32698,.630198,.925962,-.183494,.321449,.658404,.931734,-.184159,.314595,.686625,.93762,-.18304,.306462,.71531,.943858,-.181323,.297514,.744272,.948662,-.178683,.287447,.771462,.953299,-.175379,.276166,.798593,.957346,-.170395,.263758,.8256,.962565,-.165042,.251019,.852575,.966075,-.158655,.237011,.878316,.969048,-.151707,.222518,.90329,.972423,-.143271,.207848,.927745,.975833,-.134824,.192463,.950859,.977629,-.125444,.1768,.972947,.978995,-.114949,.161033,.993263,.980533,-.104936,.145523,1.01337,.980745,-.0935577,.129799,1.03128,.981814,-.0822956,.113486,1.04825,.983943,-.0710082,.0972925,1.06405,.986141,-.0587931,.0808138,1.0785,.988878,-.0472755,.0644915,1.09204,.992132,-.0349128,.0478128,1.10413,.9953,-.0232407,.031621,1.11527,.998117,-.0112713,.0154935,1.12551,1.00003,339743e-9,-195763e-9,1.13504,.845441,-729126e-11,.364305,169208e-10,.843588,-183164e-9,.363506,425067e-9,.843412,-73253e-8,.36343,.00169999,.843401,-.00164818,.363426,.00382495,.843399,-.00293008,.363425,.00679993,.843401,-.00457822,.363425,.010625,.843394,-.00659249,.363421,.0153002,.843398,-.00897282,.363421,.0208258,.843415,-.0117191,.363426,.0272024,.843438,-.0148312,.363432,.0344305,.843483,-.018309,.363447,.0425116,.84356,-.0221521,.363472,.0514471,.843646,-.0263597,.363499,.061238,.843743,-.0309315,.363527,.0718873,.84388,-.0358658,.363569,.0833969,.844079,-.0411624,.363631,.0957742,.844279,-.0468128,.363688,.109015,.844549,-.0527923,.363761,.123124,.844858,-.0588204,.363817,.138044,.84522,-.0647573,.36383,.153755,.845669,-.0713181,.363879,.170394,.846155,-.0781697,.363908,.187861,.846789,-.0853913,.363969,.206176,.847502,-.0928086,.363999,.225244,.8484,-.10005,.363997,.244926,.849461,-.107615,.364008,.265188,.850562,-.115814,.364055,.28587,.851962,-.124334,.364179,.306926,.854326,-.131995,.364233,.329605,.856295,-.139338,.363856,.35359,.858857,-.146346,.363347,.37831,.862428,-.152994,.362807,.403722,.866203,-.159463,.361963,.429537,.871629,-.165623,.36112,.456,.877365,-.171649,.359917,.482773,.883744,-.177151,.35848,.509705,.890693,-.182381,.356523,.537215,.897278,-.186076,.3533,.565493,.903958,-.188602,.349095,.594293,.910908,-.190755,.344215,.623165,.918117,-.192063,.338606,.651573,.924644,-.192758,.331544,.679869,.931054,-.192238,.323163,.708668,.937303,-.190035,.313529,.737201,.943387,-.187162,.303152,.764977,.948494,-.183876,.29146,.792683,.952546,-.178901,.277917,.819228,.958077,-.173173,.264753,.846559,.962462,-.16645,.25002,.872962,.966569,-.159452,.234873,.898729,.969108,-.15074,.218752,.923126,.973072,-.141523,.202673,.947278,.975452,-.132075,.186326,.969938,.977784,-.121257,.169396,.991325,.97899,-.110182,.153044,1.01123,.979777,-.0989634,.136485,1.0299,.980865,-.0865894,.119343,1.04727,.982432,-.0746115,.102452,1.06341,.984935,-.0621822,.0852423,1.07834,.987776,-.0495694,.0678546,1.092,.99103,-.0372386,.0506917,1.1043,.99474,-.0244353,.0333316,1.11576,.997768,-.0121448,.0164348,1.12617,1.00003,31774e-8,-169504e-9,1.13598,.825551,-756799e-11,.378425,165099e-10,.82664,-190922e-9,.378923,416504e-9,.826323,-763495e-9,.378779,.0016656,.826359,-.00171789,.378795,.00374768,.82636,-.00305402,.378795,.00666259,.826368,-.00477185,.378798,.0104104,.826364,-.00687131,.378795,.0149912,.826368,-.00935232,.378795,.0204054,.826376,-.0122146,.378797,.0266532,.826399,-.0154581,.378803,.0337355,.82646,-.0190825,.378824,.0416537,.826525,-.0230873,.378846,.0504091,.826614,-.0274719,.378876,.0600032,.82674,-.0322355,.378917,.0704393,.826888,-.0373766,.378964,.0817195,.827078,-.0428936,.379024,.0938492,.827318,-.0487778,.379099,.106828,.82764,-.0549935,.379199,.120659,.827926,-.0611058,.379227,.13526,.828325,-.0675054,.379275,.150713,.828801,-.0743455,.379332,.167034,.8294,-.0815523,.379415,.184209,.830094,-.0890779,.379495,.202203,.8309,-.096736,.379555,.220945,.831943,-.104135,.379577,.240306,.833037,-.112106,.379604,.260317,.834278,-.120554,.379668,.2808,.836192,-.129128,.3799,.301654,.838671,-.137541,.380109,.323502,.840939,-.14523,.379809,.347176,.844575,-.15248,.379593,.371706,.848379,-.159607,.37909,.39688,.853616,-.166267,.378617,.422702,.858921,-.172698,.377746,.448919,.865324,-.178823,.376749,.475661,.872207,-.184542,.375363,.502599,.880018,-.189836,.373657,.529914,.88694,-.194294,.370673,.557683,.894779,-.197022,.36662,.586848,.902242,-.199108,.36138,.615831,.909914,-.200398,.355434,.644478,.917088,-.20094,.348173,.672905,.923888,-.200671,.339482,.701327,.930495,-.198773,.32956,.730101,.937247,-.195394,.318363,.758383,.943108,-.191956,.306323,.786539,.948296,-.187227,.292576,.813637,.953472,-.181165,.278234,.840793,.958485,-.174119,.263054,.867712,.962714,-.166564,.246756,.893635,.966185,-.158181,.229945,.919028,.970146,-.148275,.212633,.943413,.973491,-.138157,.195229,.966627,.975741,-.127574,.178048,.988817,.977238,-.11554,.160312,1.00924,.978411,-.10364,.142857,1.02845,.979811,-.0913122,.125317,1.04648,.98116,-.0782558,.107627,1.06284,.983543,-.0655957,.0895862,1.07798,.986789,-.0520411,.0713756,1.092,.990292,-.0389727,.053228,1.10484,.994187,-.025808,.0351945,1.11642,.997499,-.0126071,.0173198,1.12703,.999999,275604e-9,-148602e-9,1.13674,.81075,-78735e-10,.394456,161829e-10,.808692,-198293e-9,.393453,407564e-9,.80846,-792877e-9,.39334,.00162965,.808595,-.00178416,.393407,.00366711,.808597,-.00317182,.393408,.00651934,.808598,-.00495589,.393408,.0101866,.808591,-.00713627,.393403,.0146689,.808592,-.00971285,.393402,.0199667,.80861,-.0126855,.393407,.0260803,.808633,-.0160538,.393413,.0330107,.80868,-.0198175,.393429,.0407589,.808748,-.0239758,.393453,.0493264,.808854,-.0285286,.39349,.0587161,.808992,-.0334748,.39354,.0689304,.809141,-.0388116,.393588,.0799707,.809352,-.0445375,.39366,.0918432,.809608,-.0506427,.393742,.104549,.809915,-.0570708,.393834,.118085,.810253,-.0633526,.393885,.132377,.810687,-.0700966,.393953,.147537,.811233,-.0772274,.394047,.163543,.811865,-.0847629,.394148,.180394,.812648,-.0925663,.394265,.198051,.813583,-.100416,.394363,.216443,.814683,-.108119,.394402,.235502,.815948,-.11644,.394489,.255242,.817278,-.125036,.394542,.275441,.819605,-.133655,.39486,.296094,.822256,-.142682,.395248,.317309,.825349,-.150756,.395241,.340516,.829605,-.158392,.395285,.364819,.83391,-.165801,.394922,.389736,.839808,-.172677,.394691,.415409,.845708,-.179448,.394006,.441546,.853025,-.185746,.393279,.46832,.859666,-.191684,.391655,.495302,.86789,-.197146,.390068,.52262,.875845,-.201904,.38727,.550336,.882634,-.205023,.382688,.578825,.891076,-.207098,.377543,.608103,.900589,-.208474,.371752,.63723,.90791,-.209068,.364016,.665769,.915971,-.208655,.355593,.694428,.923455,-.20729,.345439,.723224,.931514,-.203821,.334099,.751925,.937885,-.19986,.321069,.780249,.943136,-.194993,.306571,.8077,.948818,-.189132,.291556,.83497,.954433,-.181617,.275745,.86188,.959078,-.173595,.258695,.888562,.962705,-.164855,.240825,.914008,.966753,-.155129,.22268,.939145,.970704,-.144241,.204542,.963393,.973367,-.133188,.185927,.985983,.975984,-.121146,.167743,1.00704,.976994,-.108366,.149218,1.02715,.978485,-.0956746,.13131,1.0455,.980074,-.0820733,.112513,1.06221,.98225,-.0684061,.0938323,1.07782,.98553,-.0549503,.0749508,1.09199,.989529,-.0407857,.055848,1.10508,.993536,-.0271978,.0368581,1.11684,.997247,-.0132716,.0181845,1.12789,1,431817e-9,-198809e-9,1.13792,.785886,-812608e-11,.405036,157669e-10,.790388,-205278e-9,.407355,398297e-9,.790145,-820824e-9,.407231,.00159263,.790135,-.00184681,.407226,.00358336,.790119,-.00328316,.407218,.00637039,.790126,-.00512988,.40722,.0099539,.79013,-.00738684,.407221,.0143339,.790135,-.0100538,.407221,.0195107,.790134,-.0131306,.407217,.0254848,.79016,-.0166169,.407224,.0322572,.790197,-.020512,.407236,.0398284,.790273,-.0248157,.407263,.0482014,.790381,-.029527,.407304,.0573777,.790521,-.0346446,.407355,.0673602,.790704,-.0401665,.40742,.0781522,.790925,-.0460896,.407499,.0897582,.791195,-.0524017,.407589,.10218,.791522,-.0590121,.407691,.11541,.791878,-.0654876,.407748,.12939,.792361,-.0725207,.407849,.144237,.792942,-.0799844,.407963,.159924,.79362,-.0877896,.408087,.176425,.794529,-.0958451,.408259,.193733,.795521,-.103827,.408362,.211756,.796778,-.111937,.408482,.230524,.798027,-.120521,.408547,.249967,.799813,-.129242,.408721,.269926,.802387,-.138048,.409148,.290338,.805279,-.147301,.409641,.311193,.809251,-.155895,.410154,.333611,.813733,-.163942,.410297,.357615,.819081,-.171666,.410373,.382339,.825427,-.178905,.410348,.407828,.83172,-.185812,.409486,.434034,.83877,-.192318,.408776,.460493,.845817,-.198249,.407176,.487346,.854664,-.204034,.405719,.514832,.863495,-.208908,.403282,.542401,.871883,-.212765,.399293,.570683,.88065,-.214911,.393803,.599947,.89004,-.216214,.387536,.62932,.898476,-.216745,.379846,.658319,.906738,-.216387,.370625,.687138,.914844,-.215053,.360139,.71601,.923877,-.212007,.348849,.745124,.931925,-.207481,.335639,.773366,.938054,-.202418,.320798,.801636,.943895,-.196507,.304772,.829055,.949468,-.189009,.288033,.856097,.955152,-.180539,.270532,.88301,.959403,-.171437,.251639,.909296,.963309,-.161661,.232563,.934868,.967399,-.150425,.213231,.959662,.972009,-.138659,.194247,.98302,.97433,-.126595,.174718,1.00517,.975823,-.113205,.155518,1.02566,.976371,-.0996096,.136709,1.04418,.978705,-.0860754,.117571,1.06146,.981477,-.0714438,.0980046,1.07777,.984263,-.0572304,.0782181,1.09214,.988423,-.0428875,.0584052,1.10553,.993,-.0282442,.038522,1.11758,.99704,-.0140183,.0190148,1.12864,.999913,369494e-9,-145203e-9,1.13901,.777662,-84153e-10,.423844,154403e-10,.770458,-211714e-9,.419915,38845e-8,.770716,-846888e-9,.420055,.00155386,.770982,-.00190567,.420202,.00349653,.770981,-.00338782,.420201,.00621606,.77098,-.00529338,.4202,.00971274,.770983,-.00762223,.4202,.0139867,.770985,-.0103741,.420198,.0190381,.770996,-.0135489,.4202,.0248677,.771029,-.0171461,.420212,.0314764,.771052,-.0211647,.420215,.0388648,.771131,-.0256048,.420245,.047036,.771235,-.0304647,.420284,.0559911,.771383,-.0357436,.420341,.0657346,.771591,-.0414392,.420423,.0762694,.771819,-.0475462,.420506,.0875984,.772123,-.0540506,.420617,.099727,.772464,-.060797,.42072,.112637,.772855,-.0675393,.420799,.126313,.773317,-.0748323,.420893,.140824,.773981,-.0825681,.421058,.15617,.774746,-.0906307,.421226,.172322,.77566,-.0988982,.421397,.189253,.776837,-.106994,.421569,.206912,.778097,-.115528,.421704,.225359,.779588,-.124317,.421849,.24447,.781574,-.133139,.422097,.264156,.784451,-.142179,.422615,.284318,.787682,-.15165,.423269,.304902,.792433,-.160771,.424396,.3265,.797359,-.169166,.424772,.35014,.803986,-.177149,.425475,.374768,.809504,-.184745,.424996,.399928,.815885,-.19173,.424247,.425796,.823513,-.198525,.423515,.452287,.832549,-.204709,.422787,.479321,.841653,-.210447,.421187,.506718,.850401,-.215501,.418519,.53432,.859854,-.219752,.414715,.56242,.869364,-.222305,.409462,.591558,.878837,-.223744,.402926,.621074,.888636,-.224065,.395043,.650538,.898132,-.223742,.38564,.679538,.907181,-.222308,.375378,.708674,.915621,-.219837,.363212,.737714,.9239,-.215233,.349313,.767014,.931644,-.209592,.334162,.795133,.938887,-.203644,.317943,.823228,.945282,-.196349,.300581,.850822,.950758,-.18742,.282195,.877594,.956146,-.177879,.262481,.904564,.960355,-.167643,.242487,.930741,.965256,-.156671,.222668,.955868,.968029,-.144123,.201907,.979869,.97251,-.131305,.18202,1.00291,.974925,-.118335,.161909,1.02392,.975402,-.103714,.142129,1.0433,.976987,-.089415,.122447,1.06089,.979677,-.0748858,.102248,1.07713,.983184,-.0596086,.0814851,1.09218,.987466,-.0447671,.0609484,1.10585,.992348,-.0295217,.0401835,1.11829,.996674,-.0143917,.0198163,1.12966,1.00003,321364e-9,-149983e-9,1.1402,.757901,-869074e-11,.436176,151011e-10,.751195,-217848e-9,.432317,378533e-9,.751178,-871373e-9,.432307,.0015141,.751195,-.00196061,.432317,.0034068,.751198,-.00348552,.432318,.00605659,.751195,-.00544599,.432315,.00946353,.751207,-.00784203,.43232,.013628,.751213,-.0106732,.43232,.0185499,.751221,-.0139393,.432319,.0242302,.751244,-.0176398,.432325,.0306694,.7513,-.0217743,.432348,.0378698,.751358,-.0263412,.432367,.0458321,.751458,-.0313396,.432404,.0545587,.751608,-.0367682,.432464,.0640543,.7518,-.0426246,.43254,.0743222,.752065,-.0489031,.432645,.0853668,.752376,-.0555828,.432762,.0971911,.752715,-.0623861,.432859,.109768,.753137,-.069415,.432958,.123126,.753676,-.0770039,.433099,.137308,.754345,-.084971,.433272,.15229,.755235,-.0932681,.433504,.168075,.756186,-.10171,.433693,.184625,.757363,-.110019,.433857,.201897,.75884,-.11887,.434102,.220014,.760467,-.127881,.434306,.238778,.762969,-.136766,.434751,.258172,.765823,-.14612,.43529,.278062,.769676,-.15566,.436236,.298437,.774909,-.165177,.437754,.319532,.77994,-.17402,.438343,.342505,.785757,-.182201,.438609,.366693,.792487,-.190104,.438762,.391668,.80038,-.197438,.438795,.417494,.808494,-.204365,.438226,.443933,.817695,-.210714,.437283,.470929,.828111,-.216651,.436087,.498569,.837901,-.221804,.433717,.526165,.847813,-.226318,.430133,.554155,.858314,-.229297,.425213,.582822,.868891,-.230999,.418576,.612847,.878941,-.231155,.410405,.642445,.888809,-.230935,.400544,.672024,.898089,-.229343,.389613,.701366,.908081,-.226886,.377197,.730763,.916819,-.222676,.363397,.759642,.924968,-.216835,.347437,.788775,.932906,-.210245,.32995,.817135,.940025,-.202992,.312262,.844912,.946101,-.19436,.293313,.872164,.952835,-.184125,.273638,.899443,.957347,-.173657,.252385,.926389,.961434,-.162204,.231038,.951947,.965522,-.14979,.209834,.976751,.969412,-.136307,.188821,1.00022,.973902,-.122527,.168013,1.02229,.974045,-.108213,.147634,1.04199,.975775,-.0927397,.12705,1.06019,.978383,-.0778212,.106309,1.07711,.98211,-.0621216,.0849279,1.09245,.986517,-.0463847,.0633519,1.10651,.991696,-.0309353,.0419698,1.11903,.996349,-.0150914,.0206272,1.13073,1.00003,442449e-9,-231396e-9,1.14146,.727498,-885074e-11,.441528,145832e-10,.730897,-223525e-9,.443589,368298e-9,.730796,-893996e-9,.443528,.00147303,.730805,-.00201149,.443533,.00331433,.730814,-.00357596,.443538,.00589222,.730815,-.00558734,.443538,.00920678,.730822,-.00804544,.44354,.0132582,.730836,-.0109501,.443545,.0180468,.730848,-.0143008,.443546,.0235732,.730871,-.0180969,.443552,.0298382,.730915,-.022338,.443567,.0368438,.730982,-.0270225,.443591,.044591,.731076,-.0321491,.443627,.0530831,.731245,-.0377166,.443699,.0623243,.73144,-.0437216,.443777,.0723181,.7317,-.0501576,.443881,.0830691,.732034,-.0569942,.444014,.0945809,.732388,-.0638756,.444113,.106825,.732853,-.071203,.444247,.119859,.733473,-.0790076,.444442,.13369,.734195,-.0871937,.444645,.148304,.735069,-.095696,.444877,.163702,.736169,-.10426,.445133,.179861,.73747,-.112853,.44537,.196778,.738991,-.12199,.445651,.214496,.740865,-.131153,.445958,.232913,.743637,-.140245,.446548,.251977,.746797,-.149722,.447246,.271551,.751517,-.159341,.448656,.291774,.756156,-.169106,.449866,.312455,.761519,-.178436,.450919,.334552,.768295,-.186904,.451776,.358491,.776613,-.195117,.452832,.383446,.783966,-.202695,.45249,.408945,.793542,-.20985,.452587,.435364,.803192,-.216403,.451852,.462336,.813892,-.22251,.450708,.48987,.824968,-.227676,.4486,.517697,.835859,-.232443,.445156,.545975,.846825,-.235775,.440351,.574483,.858085,-.237897,.433641,.604246,.868825,-.238074,.425354,.634101,.879638,-.237661,.415383,.664201,.889966,-.236186,.404136,.693918,.899479,-.233599,.390917,.723481,.908769,-.229737,.376352,.75258,.917966,-.223836,.360372,.781764,.926304,-.217067,.342551,.811139,.934626,-.209309,.324238,.839585,.941841,-.20071,.304484,.867044,.94789,-.190602,.283607,.894579,.954196,-.179253,.262205,.921743,.958383,-.167646,.239847,.948026,.963119,-.155073,.218078,.973296,.966941,-.141426,.195899,.998135,.970836,-.126849,.174121,1.02021,.973301,-.112296,.153052,1.04085,.97448,-.0964965,.131733,1.05946,.977045,-.080489,.10997,1.07693,.980751,-.064844,.0881657,1.09254,.985475,-.0481938,.0657987,1.10697,.991089,-.0319185,.0435215,1.12004,.996122,-.0158088,.0214779,1.13173,1.00001,372455e-9,-200295e-9,1.14291,.708622,-907597e-11,.45304,141962e-10,.711162,-228911e-9,.454662,358052e-9,.709812,-914446e-9,.453797,.00143034,.709865,-.00205819,.453834,.00321935,.709864,-.00365894,.453833,.00572331,.709855,-.00571692,.453826,.00894278,.709862,-.00823201,.453828,.012878,.709875,-.011204,.453832,.0175295,.709896,-.0146323,.453839,.0228978,.709925,-.0185163,.453847,.0289839,.709974,-.0228551,.453866,.0357894,.710045,-.0276473,.453892,.0433161,.710133,-.032891,.453924,.0515665,.710292,-.0385851,.453992,.0605458,.710485,-.0447254,.45407,.0702574,.710769,-.0513051,.454192,.0807077,.711106,-.0582733,.454329,.091896,.711516,-.0652866,.45446,.103814,.712071,-.0728426,.454653,.116508,.712676,-.0808307,.45484,.129968,.713476,-.0892216,.455096,.144206,.714377,-.0979047,.455346,.159212,.715579,-.106531,.455647,.174973,.716977,-.115492,.455961,.191504,.71862,-.124821,.456315,.208835,.72084,-.134079,.4568,.226869,.723786,-.143427,.457521,.245582,.727464,-.153061,.458475,.264957,.732771,-.162768,.460239,.284948,.736515,-.172627,.460899,.30522,.743519,-.182487,.463225,.326717,.750041,-.191295,.464027,.350113,.758589,-.199746,.465227,.374782,.767703,-.207584,.465877,.400226,.777484,-.214973,.465996,.426442,.788792,-.221796,.466019,.453688,.800194,-.228038,.465083,.481246,.811234,-.233346,.462506,.509086,.822859,-.238073,.459257,.537338,.835082,-.241764,.454863,.566108,.846332,-.244241,.448163,.595126,.858355,-.244736,.439709,.625574,.87034,-.244278,.429837,.65617,.881027,-.24255,.418002,.686029,.891007,-.239912,.404325,.716039,.900874,-.236133,.389222,.745518,.911072,-.230672,.373269,.775026,.920359,-.22356,.355083,.804521,.928604,-.215591,.335533,.834045,.937175,-.206503,.315278,.861612,.942825,-.196684,.293653,.889131,.949805,-.185116,.271503,.916853,.955535,-.172703,.248821,.943541,.959843,-.159978,.225591,.970132,.964393,-.146375,.202719,.994709,.968008,-.131269,.179928,1.0186,.971013,-.11569,.158007,1.03928,.973334,-.1003,.13624,1.05887,.975775,-.0833352,.1138,1.07652,.979579,-.0668981,.0913141,1.09297,.984323,-.0500902,.0683051,1.10734,.990351,-.0332377,.0451771,1.12084,.995823,-.0161491,.0221705,1.13296,1.0001,234083e-9,-108712e-9,1.14441,.683895,-924677e-11,.46015,137429e-10,.68833,-233383e-9,.463134,346865e-9,.688368,-933547e-9,.463159,.00138748,.688367,-.00210049,.463159,.00312187,.688369,-.00373415,.463159,.00555004,.688377,-.00583449,.463163,.00867216,.688386,-.00840128,.463166,.0124884,.688398,-.0114343,.463169,.0169993,.688418,-.0149329,.463175,.0222054,.688453,-.0188964,.463188,.028108,.688515,-.0233239,.463214,.0347085,.68857,-.0282136,.463231,.0420091,.688679,-.033564,.463276,.0500132,.688854,-.0393733,.463356,.0587255,.689038,-.0456354,.46343,.0681476,.689321,-.0523433,.463553,.0782897,.689662,-.059412,.463693,.0891501,.690188,-.0665736,.4639,.100735,.690755,-.0743106,.464107,.113074,.691405,-.0824722,.464329,.126161,.692198,-.0910484,.464585,.140007,.693196,-.0998778,.464893,.154612,.69454,-.108651,.465285,.169984,.695921,-.117855,.465596,.186106,.697749,-.12734,.466056,.203034,.700375,-.136714,.466771,.220703,.703395,-.146386,.467579,.239062,.707904,-.156096,.469067,.258188,.711673,-.165904,.469851,.277759,.717489,-.175812,.471815,.297935,.724051,-.185931,.47389,.318916,.731965,-.195238,.47587,.341591,.741151,-.204021,.477523,.366062,.751416,-.212113,.478881,.391396,.761848,-.21979,.479226,.417599,.771886,-.2267,.478495,.444401,.783998,-.232991,.477622,.472084,.796523,-.238645,.475833,.500193,.808851,-.243396,.472568,.52865,.821191,-.247226,.467857,.557362,.834261,-.250102,.461871,.586768,.846762,-.251056,.453543,.617085,.859867,-.250604,.443494,.647659,.871948,-.248783,.431711,.678119,.882967,-.245855,.417911,.708399,.892826,-.242168,.401993,.738256,.90332,-.237062,.385371,.767999,.913633,-.22997,.366837,.798191,.922774,-.221687,.346372,.827756,.931371,-.212345,.325682,.856425,.938929,-.20206,.303665,.884299,.944821,-.190981,.280786,.912023,.951792,-.178065,.2573,.939669,.957712,-.164634,.233448,.96655,.961912,-.150863,.209504,.992366,.966382,-.13577,.18597,1.01633,.969588,-.119593,.162905,1.03843,.971777,-.103203,.14053,1.05841,.97433,-.0865888,.117909,1.07632,.978686,-.0690829,.0944101,1.09326,.983281,-.0516568,.0705671,1.10796,.989562,-.034558,.0468592,1.12182,.995465,-.0167808,.0229846,1.1342,.999991,373016e-9,-235606e-9,1.1459,.662251,-939016e-11,.468575,132714e-10,.666634,-237624e-9,.471675,335842e-9,.666411,-950385e-9,.471516,.00134321,.666399,-.00213833,.471509,.00302221,.666386,-.0038014,.471499,.00537283,.666405,-.00593958,.471511,.00839533,.666406,-.00855253,.471508,.0120898,.666428,-.0116401,.471519,.0164569,.666444,-.0152015,.471522,.0214971,.66649,-.0192362,.471543,.027212,.666537,-.0237428,.471558,.033603,.666617,-.0287198,.471591,.0406728,.666718,-.0341647,.471631,.0484238,.666889,-.0400759,.47171,.0568621,.667104,-.0464479,.471805,.0659915,.667374,-.0532677,.471923,.0758178,.667772,-.0603805,.472098,.0863425,.668371,-.0677392,.472363,.0975917,.668971,-.0756028,.472596,.109567,.669696,-.0839293,.472869,.122272,.670481,-.0926683,.473126,.135718,.6715,-.1016,.473442,.149914,.672911,-.110566,.47389,.164882,.674512,-.119984,.474354,.180602,.67651,-.129574,.474922,.19711,.679292,-.139106,.475764,.214371,.682798,-.148993,.476886,.232405,.686955,-.158737,.478179,.251153,.691406,-.168754,.479432,.270436,.697438,-.178703,.481481,.290374,.704761,-.188955,.484143,.311044,.713599,-.198814,.487007,.333003,.723194,-.207869,.488962,.357144,.732601,-.216189,.489815,.382169,.744193,-.22398,.490888,.408227,.754907,-.231156,.490355,.434928,.767403,-.23747,.489548,.462599,.78107,-.243503,.488274,.490908,.793893,-.248114,.484843,.519421,.807296,-.25222,.4803,.548561,.820529,-.255265,.474097,.577772,.833716,-.256741,.466041,.607782,.848403,-.25637,.456547,.638807,.860755,-.254804,.443946,.670058,.874012,-.251834,.430852,.700749,.885619,-.247867,.414903,.731446,.896069,-.242634,.397276,.761191,.906266,-.236093,.378535,.791053,.916759,-.227543,.358038,.821298,.92523,-.21783,.335705,.850747,.93436,-.207534,.313797,.879258,.941631,-.195983,.289671,.907734,.947564,-.183567,.265319,.935206,.953681,-.169345,.240815,.962739,.960008,-.154909,.216119,.989227,.964145,-.140161,.192096,1.01465,.968171,-.123411,.167855,1.03737,.969859,-.106525,.144817,1.05767,.972666,-.0891023,.12149,1.0761,.977055,-.0718094,.0975306,1.09336,.982527,-.0534213,.0730217,1.10878,.989001,-.0355579,.0483366,1.12285,.99512,-.0176383,.023938,1.13548,1.00007,368831e-9,-211581e-9,1.14744,.651047,-960845e-11,.484101,12922e-9,.644145,-241347e-9,.478968,324578e-9,.64396,-965142e-9,.478831,.00129798,.64396,-.00217154,.47883,.00292046,.643968,-.00386049,.478835,.00519202,.643974,-.00603186,.478838,.0081128,.643977,-.0086854,.478836,.011683,.643982,-.0118207,.478834,.0159031,.644024,-.0154374,.478856,.0207743,.644059,-.0195343,.478868,.0262975,.644122,-.0241103,.478896,.0324747,.644207,-.0291638,.478933,.039309,.64432,-.0346919,.478981,.0468029,.644481,-.0406919,.479053,.0549614,.644722,-.047159,.479169,.0637909,.645013,-.0540748,.479302,.0732974,.645503,-.0612001,.479541,.0834898,.646117,-.0687303,.479829,.0943873,.646707,-.0767846,.480061,.105991,.647431,-.0852465,.480343,.11831,.64831,-.0940719,.48066,.131348,.649486,-.103056,.481083,.14514,.650864,-.112261,.481528,.159676,.652604,-.121852,.482102,.174979,.654825,-.131505,.482813,.191079,.657876,-.141189,.483876,.207927,.661339,-.151239,.48499,.225586,.665463,-.161091,.486279,.243947,.670542,-.171235,.487968,.262957,.677361,-.181347,.49053,.282781,.685672,-.191679,.493862,.303311,.694551,-.201781,.49699,.324607,.703753,-.211164,.498884,.347916,.713703,-.219675,.500086,.372628,.725911,-.227836,.501554,.398694,.73862,-.23533,.502193,.425529,.752118,-.241786,.501811,.453209,.76579,-.247865,.500185,.481381,.779568,-.252696,.497159,.51011,.793991,-.256802,.492765,.539322,.808182,-.259942,.486827,.569078,.821698,-.261703,.478386,.598818,.836009,-.262006,.468772,.629762,.849824,-.260333,.456352,.661366,.863888,-.257398,.442533,.69295,.876585,-.253264,.426573,.723608,.888665,-.248026,.408964,.754378,.899537,-.241487,.389677,.784761,.9094,-.233463,.368516,.814688,.920166,-.223397,.346624,.845009,.928899,-.21255,.322717,.874431,.937156,-.200869,.298698,.902922,.943861,-.188387,.273491,.931356,.949557,-.174341,.247866,.958854,.955862,-.158994,.222496,.986098,.961721,-.143664,.197522,1.01229,.965976,-.127412,.17302,1.03571,.968652,-.109798,.148954,1.05699,.971084,-.0916787,.125044,1.07587,.975584,-.0739634,.100577,1.09372,.98122,-.055322,.0753666,1.10948,.988253,-.0366825,.0498899,1.12394,.99482,-.0180389,.024611,1.13694,1.00001,229839e-9,-188283e-9,1.14919,.613867,-964198e-11,.479449,123452e-10,.621485,-244534e-9,.485399,313091e-9,.621429,-978202e-9,.485353,.00125245,.62112,-.00220004,.485114,.00281687,.621119,-.0039111,.485112,.00500783,.621122,-.00611091,.485112,.00782498,.621133,-.00879922,.485117,.0112687,.621152,-.0119756,.485125,.0153394,.621183,-.0156396,.485139,.0200382,.621227,-.0197898,.485158,.0253663,.621298,-.0244253,.485192,.0313261,.621388,-.0295441,.485233,.0379204,.621507,-.0351432,.485286,.0451523,.621693,-.0412198,.485378,.0530277,.621933,-.0477673,.485495,.0615522,.622232,-.0547574,.485635,.0707316,.622809,-.0619417,.485943,.0805883,.623407,-.069625,.486232,.0911267,.62406,-.077796,.486516,.102354,.624835,-.0863731,.486838,.114279,.625758,-.095251,.487188,.126902,.627043,-.104299,.487695,.140285,.628438,-.113724,.488163,.154397,.630325,-.123417,.488858,.169267,.632801,-.133137,.489754,.184941,.635784,-.143052,.490815,.20136,.639406,-.153132,.492048,.218643,.643872,-.163143,.49363,.236615,.6499,-.17333,.496009,.255449,.657201,-.183622,.498994,.275006,.666221,-.194019,.502888,.295354,.674419,-.204192,.505459,.316244,.683729,-.21406,.507771,.33849,.695584,-.222854,.510245,.363166,.708583,-.231315,.512293,.389071,.721233,-.238911,.512747,.415737,.735134,-.245657,.512482,.443331,.750179,-.251879,.511526,.471891,.765073,-.256911,.508935,.500892,.779794,-.261144,.504341,.530294,.794801,-.264316,.498515,.560144,.810339,-.266276,.491015,.590213,.824818,-.266981,.481126,.620865,.839375,-.265778,.468685,.652687,.853043,-.262748,.453925,.684759,.867335,-.258474,.437912,.716209,.88037,-.253187,.419648,.747508,.891711,-.246476,.39982,.77797,.902896,-.238735,.37879,.808586,.913601,-.22885,.355891,.838843,.923019,-.217656,.331773,.869014,.933432,-.205539,.307356,.898512,.939691,-.192595,.281321,.9269,.946938,-.178945,.255441,.955297,.952372,-.163587,.229013,.983231,.95909,-.147214,.203179,1.00971,.963675,-.13064,.17792,1.03438,.968247,-.113121,.152898,1.05625,.97001,-.0945824,.128712,1.07598,.974458,-.0755648,.103349,1.094,.980168,-.0571998,.0776731,1.1104,.987295,-.0377994,.0514445,1.12491,.994432,-.0186417,.025429,1.13851,.999975,542714e-9,-282356e-9,1.15108,.592656,-980249e-11,.486018,119532e-10,.598467,-247275e-9,.490781,301531e-9,.597934,-988317e-9,.490343,.00120517,.597903,-.00222366,.490319,.0027116,.597913,-.00395315,.490327,.00482077,.597919,-.00617653,.490329,.00753264,.597936,-.00889375,.490339,.0108478,.597956,-.0121043,.490347,.0147668,.597992,-.0158073,.490365,.0192905,.598032,-.0200017,.490382,.0244204,.598109,-.0246865,.49042,.0301593,.598215,-.0298594,.490474,.03651,.59833,-.0355167,.490524,.0434757,.598525,-.0416559,.490624,.0510629,.598778,-.0482692,.490753,.0592781,.599135,-.0553114,.49094,.0681304,.599802,-.062542,.491328,.0776467,.600361,-.0703638,.491598,.0878184,.60101,-.0786256,.491882,.0986573,.601811,-.0872962,.492232,.11018,.602861,-.0962284,.492684,.1224,.604167,-.10538,.493213,.135354,.605693,-.114896,.493799,.149034,.607682,-.124654,.494576,.163469,.610672,-.13456,.4959,.178747,.613313,-.144581,.496713,.194723,.617603,-.154703,.498499,.211617,.622174,-.16489,.500188,.229183,.628855,-.175164,.503072,.247786,.636963,-.185565,.506798,.267116,.644866,-.195911,.509719,.28702,.653741,-.206104,.512776,.307763,.664942,-.216447,.516812,.329631,.67633,-.22552,.519181,.353515,.690012,-.234316,.521681,.379226,.704243,-.242032,.523129,.405901,.719396,-.249172,.523768,.433585,.734471,-.255543,.522541,.462085,.750539,-.260697,.520217,.491233,.766365,-.26501,.516293,.521094,.781677,-.268409,.509708,.551014,.797132,-.270399,.501944,.581463,.812655,-.271247,.492025,.612402,.828592,-.270708,.480424,.643798,.844044,-.268085,.465955,.67682,.857305,-.263459,.448425,.708496,.87114,-.258151,.430243,.74046,.884936,-.251171,.410578,.771583,.895772,-.243305,.38862,.802234,.906961,-.234037,.365214,.833179,.917775,-.222714,.34116,.86353,.927883,-.210175,.31572,.893557,.936617,-.196925,.289159,.922976,.943384,-.182788,.261996,.951606,.949713,-.167965,.235324,.979958,.955818,-.151109,.208408,1.00765,.961344,-.133834,.182591,1.03329,.965469,-.115987,.156958,1.0557,.968693,-.09746,.132239,1.07583,.973165,-.0778514,.106195,1.09451,.979387,-.0585067,.0797669,1.11137,.98671,-.0390409,.0530263,1.12643,.994093,-.019408,.0263163,1.14016,1.00002,540029e-9,-194487e-9,1.15299,.574483,-989066e-11,.494533,114896e-10,.574478,-249127e-9,.494528,289403e-9,.574607,-996811e-9,.494637,.00115797,.574396,-.00224241,.494458,.00260498,.574377,-.00398632,.49444,.00463102,.574386,-.00622836,.494445,.00723623,.574401,-.0089683,.494453,.010421,.574419,-.0122056,.49446,.0141859,.574459,-.0159396,.494481,.0185322,.574525,-.0201692,.49452,.0234617,.574587,-.0248924,.494547,.0289762,.574697,-.0301074,.494604,.0350797,.574853,-.0358114,.494688,.0417767,.575027,-.041999,.494772,.0490718,.575294,-.0486618,.494915,.0569728,.575733,-.0557148,.495173,.0654955,.576356,-.0630489,.495537,.0746612,.576944,-.0709285,.495836,.0844615,.57765,-.0792723,.496177,.0949142,.578491,-.0880167,.496563,.10603,.579639,-.0969462,.497096,.117841,.580989,-.10622,.497684,.130367,.582587,-.115861,.498337,.143609,.584951,-.125605,.499414,.157625,.587602,-.135608,.500518,.172413,.59076,-.145742,.501767,.187999,.594992,-.155934,.503542,.20445,.600656,-.166303,.506135,.221764,.607816,-.176681,.509542,.24002,.61522,-.187071,.51263,.258992,.623702,-.197465,.516021,.278773,.634192,-.207816,.520422,.299377,.644936,-.218183,.524073,.320802,.657888,-.2278,.528049,.34384,.670666,-.236747,.52986,.36916,.685626,-.24484,.531892,.395867,.701304,-.252071,.532727,.423488,.717727,-.258714,.532146,.452201,.733914,-.264211,.529883,.481579,.750529,-.26859,.5259,.511558,.76747,-.272046,.51999,.542042,.785189,-.274225,.513083,.572799,.800954,-.275189,.502936,.603816,.816962,-.274946,.490921,.635461,.83336,-.272695,.47684,.6676,.848143,-.268223,.459405,.70051,.861818,-.262768,.440319,.732902,.876828,-.255872,.420123,.765084,.889312,-.247703,.398379,.796391,.900412,-.238381,.374496,.827333,.912251,-.227783,.349874,.858385,.921792,-.214832,.323181,.888652,.931273,-.200949,.296624,.917763,.940295,-.186537,.269211,.947878,.946812,-.171538,.241447,.977016,.953588,-.155254,.213829,1.00501,.958841,-.137156,.186807,1.03179,.963746,-.118699,.160706,1.05502,.966468,-.0998358,.135504,1.07568,.971178,-.0805186,.109131,1.09479,.97831,-.0599348,.0818293,1.1123,.985886,-.0399661,.0545872,1.12771,.994021,-.0198682,.0269405,1.14186,1.00009,271022e-9,-12989e-8,1.15514,.538716,-990918e-11,.486732,109675e-10,.550656,-250642e-9,.497518,277412e-9,.55057,-.00100265,.497441,.00110974,.550903,-.00225672,.497733,.00249779,.550568,-.00401046,.497438,.00443906,.550574,-.00626613,.49744,.00693637,.550591,-.0090226,.497449,.00998921,.550623,-.0122795,.497469,.0135984,.550667,-.0160361,.497495,.0177654,.550724,-.0202908,.497526,.0224915,.550792,-.0250421,.497557,.0277795,.550918,-.0302878,.49763,.0336334,.551058,-.0360241,.497701,.0400573,.551276,-.0422473,.497824,.0470585,.551551,-.0489441,.497977,.0546433,.552074,-.0559596,.498312,.0628367,.552681,-.0633978,.498679,.071646,.553324,-.0713176,.499031,.0810746,.554011,-.0797268,.499365,.091129,.55488,-.0885238,.499779,.101837,.556171,-.0974417,.500444,.113239,.557498,-.106841,.501025,.125316,.559299,-.116533,.501864,.138128,.561647,-.126298,.502967,.151695,.564347,-.136388,.504129,.16604,.567863,-.146576,.505713,.181207,.572569,-.156832,.507953,.197259,.578919,-.167323,.511186,.214258,.585387,-.177712,.514042,.232038,.593134,-.188184,.517484,.250733,.603295,-.198717,.522345,.270454,.613854,-.209177,.526751,.290807,.626092,-.219644,.531595,.312202,.637868,-.229494,.534721,.334435,.652458,-.238718,.538304,.359184,.666985,-.247061,.539875,.385637,.683301,-.254652,.541042,.41328,.69998,-.261376,.540735,.441903,.717824,-.267085,.539139,.471609,.734617,-.271465,.534958,.501446,.753663,-.27528,.53032,.532571,.770512,-.277617,.522134,.563641,.787356,-.278525,.51206,.595067,.806252,-.278512,.50119,.627226,.822061,-.277023,.486791,.659402,.838959,-.273175,.470467,.692874,.85379,-.267238,.450688,.725702,.868268,-.260327,.429741,.75832,.881994,-.251946,.407223,.790189,.893885,-.242432,.383214,.821625,.905118,-.231904,.357297,.853011,.916045,-.219545,.330733,.883773,.927614,-.205378,.303916,.914435,.936005,-.190388,.275941,.944502,.944533,-.1749,.247493,.974439,.950758,-.158588,.218996,1.00286,.957078,-.141027,.191559,1.0304,.962448,-.121507,.164457,1.05466,.964993,-.102068,.138636,1.0761,.970017,-.0822598,.111861,1.09541,.97661,-.062033,.0843438,1.11317,.985073,-.0409832,.0558496,1.12911,.993515,-.020146,.0275331,1.1438,1.00006,27329e-8,-107883e-9,1.15736,.525324,-999341e-11,.498153,105385e-10,.526513,-251605e-9,.499277,265329e-9,.526517,-.00100641,.499282,.0010613,.526588,-.00226466,.499337,.00238823,.526539,-.0040255,.499302,.00424535,.526547,-.00628954,.499306,.00663364,.526561,-.00905628,.499313,.00955337,.526593,-.0123253,.499334,.0130054,.526642,-.0160957,.499365,.0169911,.5267,-.0203661,.499396,.0215122,.526792,-.0251347,.499451,.0265718,.526904,-.0303985,.499511,.0321732,.527079,-.0361554,.499617,.0383231,.527285,-.0423982,.499731,.045026,.527602,-.0491121,.499924,.0522936,.528166,-.0561127,.500306,.0601528,.52879,-.0635988,.5007,.0686059,.529421,-.071581,.501048,.0776518,.530144,-.0799854,.501421,.0873148,.531062,-.0888032,.501884,.0976084,.532374,-.0977643,.50259,.108588,.533828,-.107197,.50329,.120234,.53581,-.116887,.504312,.132602,.538063,-.126755,.505365,.145721,.5409,-.136819,.506668,.159617,.544882,-.147117,.508731,.174369,.550238,-.157446,.511601,.190028,.556038,-.167988,.514431,.206587,.563031,-.178364,.517808,.224046,.571543,-.189007,.521937,.242503,.582255,-.199546,.527415,.261977,.59272,-.210084,.531682,.282162,.605648,-.220448,.537123,.303426,.61785,-.230593,.540664,.325323,.632223,-.240238,.544467,.348993,.648819,-.24887,.547594,.375462,.665825,-.256657,.54912,.403024,.683389,-.263711,.549294,.431773,.701495,-.269666,.547649,.461494,.719197,-.274169,.543786,.491623,.737906,-.278124,.538644,.522994,.756652,-.280632,.531057,.554775,.775279,-.281741,.521972,.586441,.792688,-.281652,.509613,.618596,.811894,-.280345,.496497,.651462,.827938,-.277128,.47968,.684023,.844837,-.271646,.460688,.718024,.859239,-.264397,.438872,.751207,.874088,-.256144,.41577,.784232,.887693,-.246311,.391369,.816191,.899402,-.235497,.365872,.847828,.910973,-.223631,.338618,.87934,.92204,-.209874,.310803,.910325,.930987,-.194265,.281802,.940695,.94,-.178125,.252836,.970958,.948018,-.161479,.224239,1.00078,.955141,-.144038,.195857,1.0288,.960513,-.124915,.168487,1.05371,.963964,-.104284,.141495,1.07596,.968713,-.0838732,.114437,1.09628,.975524,-.0635579,.0863105,1.11448,.98431,-.042291,.0574774,1.13069,.992916,-.0209131,.0284343,1.14568,.999926,743097e-9,-379265e-9,1.15955,.501042,-998428e-11,.498726,100306e-10,.502992,-252112e-9,.500665,253283e-9,.502417,-.00100791,.500092,.00101259,.502965,-.00226919,.500621,.00227978,.502318,-.00403109,.499994,.00405011,.502333,-.00629832,.500005,.00632868,.502362,-.00906907,.500027,.00911446,.502369,-.0123423,.500023,.0124078,.50243,-.0161178,.500066,.016211,.502493,-.0203937,.500103,.0205256,.502592,-.0251684,.500166,.0253548,.502707,-.0304389,.50023,.0307029,.502881,-.0362015,.500335,.0365753,.503124,-.0424507,.500488,.0429798,.503443,-.0491582,.500686,.0499268,.504083,-.0561476,.501155,.0574541,.504668,-.0636846,.501524,.0655408,.505319,-.0716834,.501904,.0742072,.50609,-.0800925,.502321,.0834699,.507122,-.0888425,.502896,.0933603,.508414,-.097855,.503603,.10391,.509955,-.107304,.504416,.115113,.512061,-.116921,.505565,.127054,.514419,-.12689,.506732,.139709,.517529,-.136934,.508338,.153173,.522085,-.147327,.510987,.167528,.526986,-.157612,.513527,.182708,.533122,-.168213,.516717,.198881,.540807,-.178688,.520832,.215986,.550687,-.189511,.52632,.234335,.560567,-.199998,.531009,.253375,.571698,-.210652,.535839,.273499,.584364,-.220917,.541091,.294355,.599066,-.23137,.546875,.316525,.614148,-.241206,.551306,.339671,.631157,-.250379,.555187,.36531,.647919,-.258397,.556595,.392767,.666112,-.265528,.556949,.421397,.686158,-.271827,.556617,.451433,.704838,-.27674,.552975,.482131,.723957,-.280733,.547814,.513458,.74262,-.283359,.53997,.545446,.762009,-.284541,.530422,.57775,.781314,-.284507,.518546,.610434,.799116,-.283309,.504178,.643178,.817604,-.280378,.48843,.676248,.83459,-.275619,.469457,.709698,.850974,-.26856,.447698,.744245,.866747,-.260094,.424791,.777695,.881412,-.249929,.399913,.810392,.8936,-.239137,.37308,.842872,.905943,-.226818,.345705,.874677,.916408,-.213699,.31706,.906257,.927215,-.198428,.288444,.936881,.935625,-.181643,.258329,.96795,.944076,-.164386,.228488,.998216,.951229,-.146339,.199763,1.02689,.958793,-.127709,.172153,1.0535,.963219,-.107244,.144989,1.07646,.967562,-.0857764,.11685,1.09675,.974866,-.0645377,.0880571,1.11576,.983353,-.0431732,.0587352,1.13227,.992503,-.0218356,.0294181,1.1478,1.00003,605203e-9,-231013e-9,1.16207,.482935,-101177e-10,.504695,968142e-11,.477554,-251521e-9,.499071,240676e-9,.477904,-.00100683,.499436,96342e-8,.478368,-.00226636,.499899,.0021687,.477977,-.00402719,.499513,.00385384,.477993,-.00629226,.499525,.0060221,.478011,-.00906011,.499536,.00867289,.478051,-.0123305,.499566,.0118074,.478089,-.016102,.499587,.0154269,.478171,-.0203736,.499645,.0195341,.478254,-.025143,.499692,.0241318,.47839,-.0304071,.499779,.0292247,.478588,-.0361631,.499911,.0348196,.478812,-.0424023,.500046,.0409231,.479208,-.0490724,.500326,.047552,.479841,-.0560722,.500805,.0547377,.480392,-.0636125,.501152,.0624607,.481068,-.0716134,.501561,.0707473,.481898,-.0800062,.502054,.0796118,.483022,-.0886568,.502728,.0890974,.484332,-.0977553,.503479,.0992099,.486126,-.107173,.504546,.10999,.488066,-.11677,.50557,.121476,.490521,-.126725,.506849,.133672,.494232,-.136793,.50911,.146731,.498302,-.147116,.511345,.160577,.503565,-.157446,.514344,.175335,.510902,-.168121,.518824,.191207,.519263,-.178799,.523666,.208058,.528204,-.189407,.528296,.225875,.538854,-.200145,.533724,.244782,.551278,-.210701,.539833,.264753,.565222,-.221303,.546131,.285745,.579403,-.231688,.551496,.307592,.595469,-.241718,.556809,.330582,.610929,-.250992,.559641,.354995,.629433,-.259602,.562379,.382471,.648504,-.267038,.563676,.411126,.66756,-.273388,.562092,.440924,.689143,-.278788,.560807,.472118,.709056,-.282783,.555701,.503774,.729855,-.285836,.548698,.536364,.748954,-.287078,.538544,.56895,.768373,-.287133,.526711,.601991,.78827,-.285839,.512511,.635403,.807465,-.283238,.496323,.668797,.825194,-.27906,.477638,.702584,.842203,-.272286,.456253,.736393,.857749,-.263854,.432412,.77096,.874799,-.253943,.407806,.80489,.887497,-.24237,.38033,.83771,.89966,-.230278,.352446,.870376,.911753,-.21646,.323268,.902256,.923011,-.202071,.294314,.933306,.932375,-.185519,.264104,.965177,.940537,-.167604,.234035,.996303,.948904,-.149068,.20412,1.0261,.955263,-.129539,.175431,1.05304,.960303,-.109932,.148116,1.07617,.965512,-.0880572,.119693,1.09742,.973466,-.0660548,.0901619,1.11721,.98284,-.0439228,.0599875,1.13436,.992216,-.0219588,.0298975,1.15006,.999946,119402e-9,-208547e-10,1.16471,.447827,-100414e-10,.491543,914833e-11,.454778,-251257e-9,.499172,22891e-8,.453519,-.00100342,.497787,914184e-9,.45357,-.00225776,.497847,.00205701,.453578,-.00401371,.497855,.00365705,.45357,-.00627107,.497841,.00571453,.453598,-.00902968,.497864,.00823019,.453627,-.0122888,.497882,.0112049,.453684,-.0160475,.497923,.0146405,.453764,-.0203044,.49798,.0185394,.453866,-.0250576,.498049,.0229054,.453996,-.0303028,.49813,.0277424,.454196,-.0360379,.498267,.0330587,.454457,-.0422521,.498445,.0388613,.454926,-.0488393,.498812,.0451767,.455525,-.0558653,.499272,.0520153,.456074,-.0633772,.499625,.0593754,.456752,-.0713606,.500049,.0672751,.457648,-.07971,.500615,.0757447,.458849,-.0883032,.501399,.0848231,.46029,-.0974095,.502293,.0945135,.462,-.106729,.503301,.104848,.464121,-.116354,.504533,.115884,.466889,-.126214,.506172,.127652,.470744,-.136324,.508667,.14024,.47488,-.146595,.510995,.153673,.480845,-.157027,.514832,.168053,.488262,-.167658,.519506,.183508,.496547,-.178343,.524347,.199948,.506254,-.188916,.52983,.217503,.517961,-.199975,.536357,.236272,.531484,-.210624,.543641,.256096,.545496,-.221227,.550048,.277085,.559497,-.231568,.555076,.298615,.575752,-.241698,.560541,.321547,.591999,-.251172,.564156,.345602,.610654,-.260178,.567607,.371851,.630484,-.268094,.56923,.40076,.651807,-.274661,.569779,.430801,.67239,-.280331,.566791,.461939,.693024,-.284501,.562007,.493854,.715473,-.287852,.555791,.526992,.736323,-.28929,.546345,.560102,.755771,-.289405,.534,.593543,.775424,-.2881,.519114,.627256,.795447,-.285562,.502543,.661464,.815319,-.281416,.484773,.695206,.831769,-.275523,.463445,.729044,.849464,-.267516,.440269,.764069,.866775,-.257584,.415049,.799089,.881252,-.245817,.388049,.831948,.894209,-.233127,.35889,.865526,.906922,-.219579,.329915,.89818,.919686,-.204491,.300441,.930013,.929044,-.188962,.269445,.962061,.938393,-.171079,.238402,.994214,.94661,-.15199,.208204,1.02533,.953095,-.131953,.178653,1.0529,.958644,-.111233,.150684,1.0771,.963925,-.0903098,.122359,1.09855,.971995,-.0680505,.0923342,1.11874,.981658,-.0448512,.0614195,1.13635,.991649,-.0221931,.0303582,1.15238,.999985,393403e-9,-111086e-9,1.16772,.396806,-971563e-11,.457671,842355e-11,.429186,-249421e-9,.495017,21625e-8,.429324,-998052e-9,.495173,865322e-9,.429175,-.00224487,.494999,.00194637,.429129,-.00399041,.494952,.00346004,.429153,-.00623476,.494974,.00540684,.429168,-.0089773,.494983,.00778714,.429207,-.0122175,.495012,.0106022,.429257,-.0159542,.495047,.0138535,.429338,-.0201864,.495106,.0175443,.429431,-.0249104,.495165,.0216774,.429587,-.0301252,.495279,.0262594,.429796,-.0358249,.495432,.0312968,.430065,-.0419972,.495621,.0367985,.430588,-.0485144,.496061,.042798,.43113,-.0555028,.496472,.0492914,.431743,-.0629852,.496904,.0562907,.432448,-.0709256,.497369,.0638056,.433414,-.0791942,.498032,.071885,.434638,-.0877346,.498854,.0805517,.43611,-.0968056,.499812,.0898047,.437859,-.106002,.500891,.0997142,.440017,-.115648,.502198,.110289,.443236,-.125427,.504389,.121644,.44697,-.135492,.506809,.133769,.451689,-.145746,.509858,.146787,.45811,-.156219,.514247,.160793,.465305,-.166834,.518816,.175791,.474085,-.177546,.524331,.191906,.484808,-.188262,.53104,.209199,.49732,-.199346,.538511,.227825,.509693,-.209951,.544554,.247269,.524367,-.220533,.551616,.267978,.539228,-.231082,.557368,.289672,.55644,-.241342,.563782,.31268,.574204,-.250964,.568851,.33651,.593388,-.260306,.57312,.362219,.613358,-.268667,.574916,.390322,.634512,-.275591,.575053,.420478,.65563,-.281328,.572404,.451614,.678265,-.285948,.568893,.484112,.70011,-.289408,.561878,.517348,.723005,-.291328,.55359,.551355,.743744,-.291418,.541099,.585109,.763949,-.290252,.526489,.619487,.784186,-.287648,.509496,.65404,.804304,-.283782,.491484,.688649,.823629,-.278067,.470517,.723133,.84094,-.270588,.44705,.757163,.857852,-.261188,.421252,.792816,.874934,-.249313,.394191,.827248,.888709,-.236492,.365359,.861074,.902589,-.222185,.336016,.894417,.914201,-.207314,.30527,.926825,.925978,-.191146,.274532,.9595,.93512,-.174135,.243393,.991583,.943656,-.155231,.212414,1.02356,.951719,-.134403,.182005,1.05239,.957164,-.113023,.153043,1.07754,.962656,-.0914493,.124186,1.09984,.970695,-.0694179,.0941654,1.12,.980749,-.0466199,.0629671,1.13849,.991205,-.0227032,.0311146,1.15494,.999884,632388e-9,-254483e-9,1.1706,.379821,-957289e-11,.460637,789337e-11,.405188,-247483e-9,.491396,204064e-9,.404796,-989434e-9,.490914,815853e-9,.40483,-.00222607,.490949,.00183559,.40473,-.00395723,.49084,.00326332,.404731,-.00618287,.490836,.00509945,.404768,-.00890258,.490871,.00734463,.404791,-.0121156,.490883,.00999992,.404857,-.0158214,.490938,.0130676,.404943,-.0200178,.491004,.0165503,.405059,-.0247027,.491093,.0204521,.405213,-.0298729,.491205,.0247788,.405399,-.0355226,.491333,.0295373,.405731,-.0416352,.491604,.034741,.406303,-.0480807,.492116,.0404255,.406814,-.0550458,.492506,.0465732,.407404,-.0624652,.492926,.0532058,.408149,-.0702958,.493442,.0603442,.409128,-.0784623,.494136,.0680297,.410408,-.087007,.495054,.0762786,.411813,-.0959639,.495962,.0851046,.413735,-.105075,.497257,.0945878,.416137,-.114646,.498882,.104725,.41934,-.124394,.501132,.11563,.423326,-.134328,.503883,.127325,.428419,-.14458,.50747,.139911,.43484,-.154979,.511964,.153481,.442641,-.165628,.517328,.168114,.452511,-.176365,.524258,.183995,.463473,-.187298,.531248,.200953,.475564,-.198244,.538367,.219176,.488664,-.208938,.545175,.238514,.504073,-.219599,.553227,.259129,.520832,-.230378,.560653,.280997,.538455,-.240703,.567523,.303821,.55709,-.250548,.573287,.327948,.576646,-.259964,.577795,.353362,.596705,-.268721,.580077,.380336,.618053,-.276054,.58018,.4101,.640303,-.282176,.578747,.44161,.662365,-.286931,.574294,.474106,.684542,-.290521,.567035,.507549,.707984,-.292672,.558687,.541853,.730913,-.293189,.547606,.576581,.752948,-.292199,.533471,.61172,.773452,-.289508,.516395,.646339,.794715,-.285716,.497873,.682131,.814251,-.280051,.476845,.716396,.833057,-.272873,.453449,.751503,.84959,-.263982,.427857,.786085,.867022,-.252745,.400335,.821355,.882277,-.239655,.371304,.85646,.895375,-.225386,.340397,.890828,.909347,-.209587,.310005,.923532,.921885,-.193433,.2796,.956419,.932127,-.176135,.247276,.989445,.941869,-.157872,.216186,1.02221,.949735,-.137577,.185602,1.05195,.956617,-.115285,.155767,1.07822,.961974,-.0928418,.126103,1.10149,.96972,-.0700592,.0956758,1.12207,.98012,-.0474671,.0643269,1.1408,.990825,-.0238113,.0320863,1.1577,.999876,381574e-9,-812203e-10,1.17403,.367636,-961342e-11,.469176,753287e-11,.380377,-244772e-9,.485434,191797e-9,.380416,-978857e-9,.485475,767015e-9,.380376,-.00220165,.485435,.00172522,.380419,-.00391408,.485487,.00306734,.380438,-.00611549,.485505,.00479332,.380462,-.00880558,.485525,.00690391,.380496,-.0119837,.485551,.00940039,.38056,-.0156487,.485605,.0122848,.38064,-.0197988,.485666,.0155601,.380767,-.0244324,.48577,.0192313,.380909,-.0295444,.485871,.0233032,.381142,-.0351321,.48606,.0277861,.381472,-.0411535,.486336,.0326939,.382015,-.0475408,.486833,.0380565,.382523,-.0544395,.487231,.0438615,.383129,-.061784,.487683,.0501332,.383952,-.0695085,.488313,.0568996,.38498,-.0775819,.489077,.0641952,.386331,-.0860443,.490113,.0720324,.387788,-.0948406,.491099,.0804379,.389808,-.103899,.492566,.0894899,.39252,-.113313,.494601,.0992098,.395493,-.123007,.496619,.109641,.399826,-.132859,.499912,.120919,.405341,-.143077,.504061,.133107,.411932,-.153465,.508905,.146263,.420591,-.164108,.515482,.160544,.43101,-.174893,.523191,.176123,.441881,-.185839,.53026,.192757,.453919,-.196633,.537295,.210535,.468715,-.207611,.546156,.229886,.485182,-.218517,.555173,.250543,.501926,-.229249,.562728,.27221,.51785,-.239481,.567494,.294892,.536947,-.249395,.573889,.318987,.557115,-.259,.578831,.344348,.577966,-.268075,.582055,.371223,.599489,-.276115,.583307,.399834,.62479,-.282523,.583902,.431415,.647504,-.287663,.57953,.464301,.670601,-.291538,.573103,.498123,.693539,-.293842,.563731,.532662,.717385,-.294681,.553169,.567925,.741533,-.293717,.539908,.603502,.762142,-.291156,.521902,.639074,.783014,-.28719,.502815,.674439,.805158,-.281773,.482598,.710497,.823646,-.274682,.458949,.7456,.841879,-.266184,.433129,.781085,.859515,-.255682,.406064,.816,.875335,-.242849,.376509,.851074,.890147,-.228329,.345502,.886473,.903144,-.212491,.31428,.920751,.916618,-.195695,.282994,.954606,.927953,-.178267,.251091,.988402,.937414,-.159549,.219107,1.02141,.946823,-.140022,.18896,1.05167,.954651,-.118154,.158667,1.07819,.959955,-.0946636,.128808,1.1025,.96858,-.0711792,.0973787,1.12391,.97938,-.0475046,.0650965,1.14322,.990498,-.024059,.0326267,1.16077,.999844,-512408e-10,112444e-9,1.17727,.316912,-934977e-11,.425996,695559e-11,.356423,-241372e-9,.479108,179562e-9,.356272,-965292e-9,.478897,71811e-8,.356262,-.00217182,.478894,.00161574,.356265,-.00386092,.478895,.00287261,.356278,-.0060324,.478905,.00448907,.356293,-.00868565,.478914,.00646572,.356346,-.0118207,.478965,.00880438,.356395,-.0154355,.479001,.0115066,.356484,-.019529,.479075,.0145762,.356609,-.0240991,.47918,.018018,.356766,-.0291413,.479305,.0218379,.357009,-.0346498,.479512,.0260454,.357424,-.0405462,.479909,.0306657,.357899,-.0468825,.480337,.0357054,.358424,-.0536887,.480771,.0411728,.359041,-.0609416,.481242,.0470841,.359903,-.0685239,.481943,.0534831,.360932,-.0764883,.482741,.0603795,.362196,-.0848364,.483688,.0678028,.363847,-.0935002,.484947,.0758086,.365972,-.102471,.486588,.0844173,.368741,-.111751,.488787,.0937199,.372146,-.121334,.491405,.103732,.377114,-.131147,.495604,.114608,.38226,-.141213,.499436,.126345,.389609,-.151632,.505334,.139116,.397925,-.162073,.51168,.152995,.407824,-.172819,.518876,.168071,.420014,-.183929,.527639,.184495,.434266,-.195032,.537588,.20232,.447352,-.205792,.544379,.221189,.463726,-.216704,.553422,.241616,.481406,-.227531,.562074,.263298,.498707,-.238017,.568227,.286116,.518039,-.247936,.574473,.3101,.538277,-.257437,.579191,.335401,.561166,-.266829,.584807,.362246,.583189,-.275329,.586476,.390609,.606024,-.28234,.585578,.420998,.632419,-.287924,.584496,.454357,.656128,-.291972,.577766,.488233,.679953,-.29456,.56875,.523248,.704654,-.295816,.558388,.559168,.729016,-.295157,.544826,.595326,.752062,-.292779,.528273,.631864,.773138,-.288681,.508482,.667793,.794869,-.283358,.487341,.704035,.815101,-.27608,.46354,.739925,.834212,-.26767,.438672,.775539,.852368,-.257397,.411239,.810895,.870207,-.245689,.3829,.846472,.884063,-.231452,.351496,.881788,.898284,-.215561,.31895,.917438,.912964,-.198208,.287367,.952422,.924666,-.180426,.254487,.987551,.934429,-.161525,.222226,1.02142,.943485,-.141197,.191143,1.05218,.9521,-.120085,.161112,1.07937,.957876,-.0975881,.130982,1.10403,.966943,-.0726842,.0990553,1.12616,.978313,-.0483705,.0662818,1.14619,.990048,-.0239072,.0329243,1.16413,.999984,461885e-9,-772859e-10,1.18099,.321287,-935049e-11,.455413,659662e-11,.332595,-237513e-9,.471437,167562e-9,.332729,-949964e-9,.471618,670192e-9,.332305,-.00213618,.471028,.00150712,.332326,-.00379765,.471055,.00267959,.332344,-.00593353,.471072,.00418751,.332356,-.00854349,.471077,.00603172,.332403,-.0116268,.471121,.00821362,.332461,-.0151824,.47117,.0107357,.332552,-.0192088,.471251,.0136014,.332657,-.0237024,.47133,.0168152,.332835,-.0286615,.471487,.0203853,.333083,-.0340765,.471708,.0243212,.333547,-.0398563,.47219,.0286518,.333989,-.0460916,.472587,.0333763,.334532,-.0527897,.473054,.0385084,.335167,-.0599284,.473568,.0440638,.33608,-.0673514,.474362,.0500962,.337146,-.0752237,.475231,.0566022,.338462,-.083418,.476282,.0636272,.34014,-.0919382,.477615,.0712153,.342341,-.100741,.479404,.079417,.345088,-.109905,.481618,.0882631,.349049,-.119369,.485081,.0978851,.353939,-.129033,.489317,.108336,.359893,-.139038,.494309,.119698,.366945,-.149411,.499983,.132024,.375814,-.159843,.507185,.145558,.387112,-.170664,.516392,.160433,.40023,-.181897,.526519,.176648,.412555,-.192785,.53423,.193922,.427023,-.203663,.542741,.212662,.443685,-.214695,.552066,.232944,.461499,-.225561,.560762,.254495,.480975,-.236257,.569421,.277531,.501,-.24639,.576101,.301724,.521691,-.256101,.581493,.327112,.543478,-.265289,.585221,.353917,.566094,-.273938,.587614,.381941,.589578,-.281679,.587991,.41172,.614583,-.287655,.585928,.444148,.641813,-.292228,.582092,.478617,.666189,-.295172,.57398,.51397,.690475,-.29648,.561676,.550118,.715543,-.296203,.548758,.586933,.740405,-.293999,.532792,.62384,.762183,-.28998,.512735,.660723,.786069,-.28478,.492402,.69807,.806812,-.277568,.469058,.734422,.826987,-.268951,.443017,.770946,.844588,-.259049,.415501,.80699,.863725,-.2471,.387328,.842107,.879137,-.234157,.356108,.878078,.894634,-.218719,.324315,.914058,.909162,-.201293,.291813,.949922,.92072,-.18267,.258474,.985337,.93158,-.163212,.225593,1.0205,.941238,-.142771,.193986,1.05273,.949293,-.120956,.163392,1.08075,.956226,-.0985743,.132934,1.10559,.96546,-.075118,.101255,1.12823,.977403,-.0497921,.0675441,1.149,.989648,-.0241574,.0334681,1.16765,1.00001,5762e-7,-184807e-9,1.18519,.303474,-916603e-11,.4542,61243e-10,.308894,-232869e-9,.462306,155592e-9,.309426,-931661e-9,.463093,622499e-9,.308643,-.0020949,.461933,.00139979,.308651,-.0037242,.461941,.00248874,.308662,-.00581873,.46195,.00388933,.308687,-.00837818,.461974,.00560247,.308728,-.0114016,.462011,.00762948,.308789,-.0148884,.462067,.00997326,.308882,-.0188369,.462151,.0126375,.309007,-.0232436,.462263,.0156271,.30918,-.0281054,.462417,.0189498,.309442,-.0334065,.462667,.0226167,.309901,-.0390589,.463162,.0266614,.310331,-.0452042,.463555,.0310715,.310858,-.0517735,.464019,.0358698,.311576,-.0587359,.464669,.0410848,.312436,-.0660383,.465406,.0467453,.313526,-.0737266,.466339,.0528718,.314903,-.0817574,.467504,.0595039,.316814,-.090167,.469226,.0666888,.318965,-.0987555,.470981,.0744658,.322077,-.107792,.473814,.082912,.325947,-.117098,.477241,.0920846,.331008,-.126602,.48184,.102137,.337893,-.136619,.488334,.113135,.345106,-.146838,.494415,.12511,.355111,-.157357,.503275,.138356,.365095,-.167955,.510966,.152686,.378344,-.179157,.521508,.16856,.391599,-.190143,.530455,.18561,.407786,-.20123,.541275,.204308,.425294,-.212456,.551784,.224623,.444021,-.223568,.561493,.246172,.463418,-.234154,.569886,.268979,.484077,-.244546,.577116,.293411,.505513,-.254301,.582914,.318936,.527672,-.263564,.587208,.345856,.550565,-.272332,.589277,.374054,.573656,-.280011,.588426,.403276,.59827,-.286924,.587504,.43474,.624731,-.291994,.583401,.468767,.652396,-.295159,.576997,.504411,.67732,-.296954,.565863,.54114,.703147,-.296877,.552316,.57816,.728715,-.295147,.536773,.616124,.752448,-.291275,.51771,.653885,.775169,-.285905,.496087,.691537,.799307,-.279064,.474232,.729251,.819482,-.270294,.447676,.766267,.837659,-.260032,.419656,.802616,.856903,-.248497,.391328,.838583,.873325,-.235252,.360285,.874711,.889788,-.221126,.329215,.91077,.904486,-.204304,.296392,.94653,.917711,-.185562,.262159,.983828,.928969,-.165635,.229142,1.01955,.939707,-.14442,.19673,1.05317,.948167,-.122147,.165095,1.0823,.955222,-.099098,.13451,1.10791,.964401,-.0755332,.102476,1.1312,.976605,-.0513817,.0689667,1.15218,.989085,-.0258499,.034506,1.17129,.999908,617773e-9,-271268e-9,1.18961,.285803,-905752e-11,.452348,572272e-11,.284689,-22732e-8,.450581,143626e-9,.285263,-910214e-9,.451482,575099e-9,.285302,-.00204784,.451553,.00129395,.285318,-.00364057,.451574,.0023006,.28533,-.00568813,.451585,.00359547,.285361,-.00819001,.451618,.00517934,.285397,-.0111458,.45165,.007054,.285447,-.0145536,.451688,.00922167,.285527,-.0184127,.451758,.0116869,.285688,-.0227207,.451929,.0144555,.28584,-.0274712,.452055,.0175341,.286136,-.0326278,.452369,.0209406,.286574,-.0381792,.452853,.0246965,.287012,-.0441879,.453272,.0287996,.287542,-.0506096,.453752,.033268,.288299,-.0573634,.454488,.0381504,.289186,-.0645458,.455294,.0434447,.290302,-.0720405,.456301,.0491973,.291776,-.0799046,.457648,.0554453,.29372,-.088117,.459483,.0622311,.296052,-.0965328,.461571,.0695992,.299563,-.105409,.465085,.077658,.30335,-.114553,.468506,.0864176,.309167,-.123917,.474423,.0961078,.31529,-.13381,.47995,.106643,.324163,-.144021,.488592,.118322,.333272,-.154382,.496461,.131133,.344224,-.165015,.50562,.145208,.357733,-.176168,.516719,.16073,.373046,-.187468,.528513,.177807,.38788,-.198488,.537713,.196072,.405133,-.209545,.547999,.21605,.423845,-.220724,.55759,.237484,.443777,-.231518,.566246,.26039,.464824,-.242035,.574326,.284835,.486635,-.251898,.58037,.310518,.51012,-.261304,.58568,.337678,.535301,-.270384,.590197,.366242,.559193,-.27841,.590569,.395873,.583544,-.285325,.588161,.426857,.608834,-.291113,.584249,.459477,.635753,-.294882,.57763,.494734,.664367,-.297088,.569479,.532023,.689688,-.297364,.555064,.569629,.715732,-.295949,.539522,.608124,.741307,-.292259,.521613,.646231,.764949,-.287063,.49969,.684938,.788599,-.28012,.476747,.723548,.81048,-.27153,.45116,.761135,.831372,-.261289,.424101,.798916,.850092,-.249559,.39443,.835952,.867777,-.236348,.363849,.871606,.884632,-.221569,.332477,.907843,.90047,-.20618,.300667,.944187,.914524,-.188771,.266552,.981371,.926892,-.168362,.232349,1.01841,.937951,-.146761,.199359,1.05308,.947236,-.123813,.1675,1.0839,.954367,-.099984,.136166,1.11047,.963907,-.0759278,.103808,1.13414,.976218,-.0511367,.0697061,1.15575,.988772,-.0267415,.0352529,1.17531,.999888,-520778e-9,289926e-9,1.19389,.263546,-883274e-11,.441896,526783e-11,.262352,-221849e-9,.439889,132311e-9,.262325,-886683e-9,.439848,528824e-9,.26228,-.00199476,.439765,.00118975,.262372,-.00354671,.439922,.00211568,.26239,-.00554141,.439941,.00330652,.262412,-.00797888,.439961,.00476346,.262453,-.0108584,.440002,.00648818,.262528,-.0141788,.440085,.0084835,.262615,-.017938,.440166,.0107533,.262744,-.0221346,.440291,.0133044,.262939,-.026762,.440493,.0161445,.263277,-.0317573,.440889,.0192974,.26368,-.0371832,.441338,.0227699,.264106,-.0430371,.441753,.0265698,.264624,-.0493035,.442227,.0307178,.265378,-.0558669,.442985,.0352616,.266253,-.0628718,.443795,.0401968,.267478,-.0701569,.445008,.04559,.269062,-.077845,.446599,.0514539,.270926,-.0857941,.448349,.0578382,.273693,-.0940773,.451221,.0648363,.276746,-.102704,.454097,.0724389,.281693,-.111735,.459517,.0808744,.287335,-.121004,.46531,.0901551,.29448,-.130734,.472605,.100371,.30257,-.140777,.480251,.111644,.312465,-.15111,.489444,.124111,.324856,-.16189,.500919,.137979,.33774,-.172946,.511317,.153163,.35255,-.184152,.522684,.169817,.367786,-.19522,.53248,.187886,.385474,-.20632,.543326,.207634,.404976,-.217744,.554109,.229165,.425203,-.228691,.563395,.252068,.446704,-.239299,.571565,.276471,.468951,-.249348,.577935,.302323,.493487,-.258933,.584309,.329882,.517861,-.268009,.58773,.358525,.543309,-.276238,.589612,.388585,.569704,-.28356,.589294,.419787,.594871,-.289497,.585137,.452114,.622555,-.294452,.580356,.486466,.651167,-.296918,.57185,.523079,.677332,-.297647,.558428,.5611,.703718,-.296321,.542232,.599592,.730262,-.293339,.524541,.639138,.754304,-.288036,.502691,.677978,.778051,-.281018,.479212,.716537,.801557,-.272414,.454071,.75586,.822559,-.262419,.425952,.794477,.843051,-.250702,.397313,.832664,.86232,-.237264,.366534,.869876,.879044,-.222716,.334816,.906973,.896362,-.206827,.303143,.943558,.910342,-.189659,.269699,.979759,.924119,-.171108,.236411,1.01718,.935374,-.149579,.202224,1.05289,.944295,-.126295,.16989,1.08496,.952227,-.101511,.138089,1.11256,.962041,-.0766392,.105053,1.1375,.97528,-.0511967,.070329,1.15983,.988476,-.025463,.0351268,1.17987,.999962,286808e-10,145564e-10,1.19901,.227089,-841413e-11,.404216,472707e-11,.239725,-215083e-9,.426708,120833e-9,.239904,-860718e-9,.427028,483555e-9,.239911,-.00193661,.427039,.00108806,.239914,-.00344276,.42704,.00193457,.239933,-.00537907,.427064,.00302363,.239944,-.00774482,.427065,.00435604,.239993,-.01054,.427122,.00593398,.240052,-.0137626,.427179,.00775987,.240148,-.0174115,.427279,.00983854,.240278,-.021484,.42741,.0121763,.240472,-.0259729,.427618,.0147827,.240839,-.0308131,.428086,.0176837,.241201,-.0360893,.428482,.0208775,.241626,-.0417723,.428907,.0243821,.242207,-.0478337,.42952,.0282228,.24298,-.0542199,.430332,.0324333,.243881,-.0610015,.431222,.0370252,.245123,-.0680874,.432512,.0420535,.24667,-.0755482,.434088,.0475414,.248779,-.0832873,.436323,.0535542,.251665,-.0913546,.439509,.0601716,.255305,-.0998489,.443478,.0674282,.260049,-.108576,.448713,.0754673,.266192,-.117754,.455524,.084339,.273158,-.127294,.4627,.0941683,.282131,-.137311,.472068,.10515,.293332,-.147736,.483565,.117402,.304667,-.158357,.493702,.130824,.317785,-.169274,.504708,.145724,.333245,-.180595,.517107,.16215,.349843,-.191892,.528849,.180149,.367944,-.203168,.540301,.199746,.387579,-.214443,.551514,.221047,.408247,-.225624,.560906,.243981,.43014,-.236422,.56959,.268513,.452669,-.24654,.576098,.294409,.476196,-.256157,.580925,.322002,.501157,-.265289,.584839,.351052,.527632,-.273671,.587614,.3812,.555754,-.281254,.589119,.412994,.581682,-.287448,.585204,.445498,.608196,-.292614,.579006,.479505,.635661,-.296068,.571297,.514643,.664999,-.297395,.560855,.552213,.691039,-.296645,.544525,.591365,.7179,-.293785,.526535,.630883,.744059,-.289089,.50545,.670932,.76863,-.282239,.482514,.710904,.793273,-.273688,.457246,.750259,.814731,-.26328,.428872,.78948,.835603,-.251526,.399384,.828597,.85489,-.238339,.368811,.866892,.872828,-.223607,.336617,.90563,.889462,-.207538,.303997,.943538,.904929,-.190297,.270812,.980591,.919101,-.172034,.237453,1.01935,.930536,-.152058,.204431,1.05498,.941223,-.129515,.172495,1.08717,.94982,-.104263,.140175,1.11551,.960592,-.0781944,.106465,1.14098,.974629,-.051688,.0711592,1.16418,.98811,-.0253929,.0354432,1.18465,1.00004,804378e-9,-330876e-9,1.20462,.214668,-821282e-11,.406619,433582e-11,.218053,-208144e-9,.413025,109887e-9,.217987,-832212e-9,.412901,439362e-9,.217971,-.00187246,.412876,988623e-9,.217968,-.00332855,.41286,.00175772,.217985,-.00520055,.412882,.00274729,.218014,-.00748814,.412916,.00395842,.218054,-.0101901,.412957,.00539274,.218106,-.0133057,.413005,.00705348,.218217,-.0168342,.413139,.00894581,.218338,-.0207707,.413258,.0110754,.21855,-.0251001,.413509,.0134551,.218913,-.0297861,.413992,.0161081,.219265,-.0348956,.414383,.0190307,.219696,-.0403909,.414839,.0222458,.220329,-.0462003,.415567,.025792,.220989,-.0524208,.41621,.0296637,.222027,-.058948,.417385,.0339323,.223301,-.0658208,.418779,.0386055,.224988,-.0730347,.420665,.0437355,.227211,-.0805274,.423198,.0493844,.230131,-.088395,.426566,.0556135,.233908,-.0966208,.43091,.0624829,.239092,-.105223,.437148,.0701636,.245315,-.11424,.444302,.0786949,.253166,-.12368,.453262,.0882382,.262374,-.133569,.463211,.0988682,.273145,-.143836,.474271,.110727,.285512,-.154577,.4863,.123945,.299512,-.165501,.498817,.138581,.314287,-.176698,.510341,.154676,.331083,-.188066,.522583,.172459,.349615,-.199597,.534879,.191979,.369318,-.210843,.546083,.21309,.390377,-.222068,.5562,.235998,.412411,-.233059,.564704,.260518,.435715,-.24357,.572314,.286795,.461196,-.253356,.579395,.314559,.485587,-.262362,.581985,.343581,.511908,-.270895,.584347,.374367,.539798,-.278452,.58505,.406015,.567974,-.284877,.583344,.439168,.594303,-.290124,.577348,.473005,.622951,-.294183,.570751,.508534,.652404,-.296389,.561541,.544764,.679291,-.296605,.546426,.582927,.706437,-.294095,.528599,.622681,.734485,-.28978,.508676,.663567,.758841,-.283363,.484768,.704092,.78537,-.275015,.460434,.745101,.807315,-.264689,.432166,.784712,.8271,-.252597,.401807,.824241,.849191,-.239154,.371458,.863803,.867046,-.224451,.338873,.903063,.8852,-.208342,.306175,.942763,.901771,-.190684,.272759,.981559,.915958,-.172105,.239306,1.02048,.928046,-.152214,.206071,1.05765,.939961,-.130247,.17367,1.08999,.948711,-.10672,.142201,1.11829,.959305,-.0808688,.108454,1.14467,.973009,-.0539145,.0728109,1.16839,.987631,-.0262947,.0360625,1.19004,.999978,.00132758,-559424e-9,1.21058,.193925,-793421e-11,.391974,392537e-11,.196746,-200315e-9,.397675,991033e-10,.19667,-801099e-9,.397521,396342e-9,.196633,-.00180246,.397445,891829e-9,.196654,-.00320443,.397482,.00158582,.196659,-.00500647,.39748,.00247867,.196683,-.0072086,.397506,.00357167,.196728,-.00981001,.397562,.00486675,.196792,-.0128096,.397633,.00636707,.19689,-.0162055,.397746,.00807752,.197017,-.0199943,.397884,.0100052,.19729,-.024139,.39827,.0121691,.197583,-.0286671,.398639,.0145755,.197927,-.0335858,.399034,.0172355,.198383,-.0388806,.399554,.0201718,.199002,-.0444736,.400289,.0234194,.199739,-.0504583,.401111,.026984,.200784,-.056729,.402349,.0309217,.202075,-.0633643,.403841,.0352496,.203898,-.0703247,.406076,.0400313,.206199,-.0775565,.408841,.0453282,.209252,-.085184,.41259,.0511794,.213638,-.0931994,.418288,.0577459,.21881,-.101617,.424681,.0650508,.225642,-.11052,.433429,.0732759,.233717,-.119772,.442897,.0824683,.242823,-.129505,.452888,.0927484,.254772,-.139906,.466407,.104417,.266603,-.150402,.477413,.117211,.28073,-.161395,.490519,.131598,.295399,-.172465,.50201,.147407,.312705,-.183982,.515311,.165031,.331335,-.195532,.52786,.184336,.351037,-.206971,.5392,.205361,.372175,-.218117,.54941,.228043,.394548,-.229327,.558642,.25267,.419598,-.240052,.567861,.279071,.443922,-.249937,.573332,.306882,.471495,-.259407,.58013,.33661,.496769,-.267749,.580564,.367328,.524951,-.275524,.581696,.399753,.55318,-.282148,.579885,.433134,.581577,-.287533,.575471,.467534,.609231,-.291612,.567445,.502943,.637478,-.293911,.557657,.53871,.667795,-.295096,.546535,.576568,.694272,-.294073,.529561,.614929,.722937,-.290386,.510561,.655909,.749682,-.284481,.487846,.697663,.774754,-.276188,.462487,.738515,.799301,-.266215,.43481,.779802,.820762,-.254116,.404879,.820045,.843231,-.240393,.374559,.860294,.861857,-.225503,.341582,.900965,.880815,-.209382,.308778,.941727,.89766,-.19155,.275232,.980916,.912926,-.172346,.240938,1.02162,.926391,-.151799,.207223,1.0597,.938429,-.129968,.17484,1.09291,.947834,-.10651,.142984,1.12248,.958432,-.0824098,.109902,1.149,.972402,-.0565242,.0744454,1.1733,.987191,-.028427,.0373794,1.19538,.999975,385685e-10,-4203e-8,1.21676,.178114,-766075e-11,.385418,354027e-11,.176074,-191966e-9,.381002,887135e-10,.17601,-767549e-9,.380861,354715e-9,.17598,-.00172696,.380798,798168e-9,.175994,-.00307012,.380824,.00141928,.176017,-.00479684,.380858,.00221859,.176019,-.00690648,.380839,.00319714,.176072,-.00939888,.380913,.0043572,.176131,-.0122726,.380979,.005702,.176239,-.0155264,.38112,.00723689,.176371,-.0191551,.381272,.00896907,.176638,-.023117,.381669,.0109194,.176912,-.0274633,.382015,.0130903,.177279,-.032173,.382476,.0154949,.17774,-.0372219,.383041,.0181669,.178344,-.0426132,.38378,.0211209,.179153,-.0483309,.384773,.0243899,.180197,-.0543447,.386076,.0280062,.181581,-.0607122,.387809,.032004,.18344,-.0673855,.390205,.036453,.186139,-.0743989,.393944,.0414162,.189432,-.0817731,.39832,.0469394,.193795,-.0895464,.404188,.0531442,.199641,-.0978264,.4121,.0601374,.206679,-.106499,.421425,.0680078,.214865,-.115654,.431504,.076919,.224406,-.125268,.442526,.0868835,.235876,-.135475,.455465,.0981875,.248335,-.146023,.4681,.110759,.262868,-.157016,.482069,.124885,.278962,-.168245,.496182,.140645,.295082,-.17958,.507401,.157838,.313738,-.191227,.520252,.17695,.333573,-.202718,.531708,.197817,.356433,-.214424,.544509,.220785,.378853,-.225492,.55373,.245306,.402717,-.236236,.561348,.271593,.428375,-.246568,.568538,.299776,.454724,-.255941,.573462,.329433,.482291,-.264511,.576356,.360598,.509706,-.272129,.576446,.393204,.538805,-.278979,.575298,.427227,.568919,-.284528,.572154,.462157,.596804,-.288801,.564691,.497997,.625987,-.291334,.555134,.534467,.656414,-.292722,.545051,.571736,.683916,-.292185,.528813,.610158,.711809,-.290043,.51106,.649061,.739547,-.285246,.490103,.690081,.766914,-.277647,.465523,.732554,.791375,-.267603,.437718,.773982,.814772,-.256109,.40882,.81609,.836691,-.242281,.377823,.856849,.856984,-.227155,.34496,.898363,.876332,-.210395,.311335,.939471,.894988,-.192612,.277703,.980799,.911113,-.173236,.243019,1.02215,.924092,-.152258,.209037,1.06139,.936828,-.129575,.175909,1.09635,.946869,-.10594,.143852,1.12707,.958284,-.081318,.110289,1.15419,.972325,-.0556133,.0747232,1.17909,.986878,-.0297899,.0383149,1.20163,.999936,-.00197169,912402e-9,1.22338,.151174,-720365e-11,.351531,309789e-11,.155594,-18279e-8,.361806,78608e-9,.156099,-731569e-9,.362982,314615e-9,.156053,-.00164578,.362869,707845e-9,.156093,-.0029261,.362961,.00125884,.156099,-.00457155,.362959,.00196783,.15612,-.00658224,.362982,.00283622,.156168,-.00895774,.363048,.00386625,.156221,-.0116962,.363101,.00506109,.156324,-.0147973,.363241,.00642675,.156476,-.0182503,.363448,.00797175,.156731,-.0220266,.36384,.00971484,.156994,-.026176,.364179,.0116575,.157341,-.0306701,.36462,.0138207,.157867,-.0354591,.365364,.0162356,.15846,-.0406141,.366111,.0189092,.159308,-.0460519,.367248,.021885,.160426,-.0518096,.368767,.0252004,.161877,-.0578906,.370745,.0288825,.163995,-.0642812,.373831,.0330139,.16655,-.0710067,.377366,.0376283,.170237,-.0781522,.382799,.0428493,.175096,-.0857172,.389915,.0487324,.181069,-.0938025,.398487,.0554214,.188487,-.102363,.408799,.0630189,.197029,-.111343,.419991,.071634,.206684,-.120812,.431455,.0812797,.218698,-.131033,.445746,.0923651,.230726,-.141373,.457471,.104545,.245516,-.152387,.472388,.118449,.261551,-.163628,.486671,.133923,.277437,-.174814,.49762,.150849,.296662,-.186713,.51162,.169924,.31795,-.198513,.525435,.190848,.339422,-.210119,.536267,.213504,.362143,-.221354,.545982,.237947,.387198,-.23224,.555364,.264427,.412349,-.24257,.561489,.292519,.439274,-.252284,.566903,.322561,.466779,-.261023,.569614,.353952,.496011,-.26899,.571589,.387278,.524964,-.275498,.570325,.421356,.556518,-.281449,.568792,.457314,.584363,-.285526,.560268,.493199,.614214,-.28844,.55205,.530276,.645684,-.289777,.541906,.56855,.673446,-.289722,.526464,.606927,.701924,-.287792,.509872,.645945,.73037,-.284315,.490649,.685564,.757405,-.278804,.467964,.726511,.784025,-.269543,.441468,.768601,.808255,-.258117,.41216,.811321,.830739,-.244728,.380606,.853496,.851914,-.229428,.348111,.895374,.872586,-.212508,.314732,.937674,.891581,-.194025,.280338,.979869,.907641,-.174711,.245203,1.02253,.922233,-.153509,.21077,1.06371,.935878,-.130418,.177399,1.09972,.946338,-.105558,.144507,1.13124,.957265,-.080059,.110508,1.15973,.971668,-.0539766,.0742311,1.18515,.9866,-.0277101,.0375224,1.20858,1.00021,-515531e-9,135226e-9,1.23135,.137468,-686011e-11,.345041,273315e-11,.13703,-173378e-9,.343936,690761e-10,.136986,-693048e-9,.34383,276126e-9,.136964,-.00155931,.343761,621337e-9,.137003,-.00277211,.343863,.00110494,.137012,-.00433103,.343868,.00172744,.137043,-.00623606,.343916,.00249022,.13709,-.0084868,.343986,.00339559,.137145,-.0110814,.344045,.00444687,.137242,-.0140187,.344177,.00565007,.137431,-.0172713,.344491,.00701868,.137644,-.0208605,.344805,.00856042,.13791,-.024792,.345172,.0102863,.138295,-.0290461,.345734,.0122185,.138764,-.0335957,.346371,.0143771,.139415,-.038467,.347298,.0167894,.140272,-.0436176,.348527,.0194895,.141457,-.0491016,.350276,.0225043,.14303,-.0548764,.352646,.0258962,.145289,-.0610096,.356206,.0297168,.148502,-.0674777,.361488,.0340562,.152188,-.074345,.367103,.0389534,.157359,-.0817442,.375247,.0445541,.16379,-.0896334,.385064,.0509535,.171376,-.098005,.396082,.0582611,.179901,-.106817,.407418,.06654,.189892,-.116239,.420031,.075994,.201838,-.12627,.434321,.0867239,.214311,-.136701,.447631,.0987517,.228902,-.147616,.462046,.112353,.245107,-.158871,.476942,.127605,.262292,-.170261,.490285,.144469,.281215,-.182017,.503783,.163282,.301058,-.193729,.515505,.183873,.322752,-.205512,.52682,.206466,.347547,-.217214,.539473,.231194,.370969,-.227966,.546625,.257288,.397533,-.238555,.55472,.285789,.42398,-.248278,.559468,.315746,.452928,-.257422,.564095,.347724,.482121,-.265306,.565426,.380922,.510438,-.272043,.563205,.415639,.541188,-.277614,.561087,.451702,.571667,-.281927,.554922,.48845,.602432,-.285015,.546838,.526442,.634126,-.286512,.537415,.564896,.662816,-.286388,.522906,.604037,.692411,-.284734,.507003,.643795,.720946,-.281297,.488398,.68298,.748293,-.276262,.466353,.723466,.776931,-.269978,.443573,.764565,.801065,-.260305,.415279,.805838,.825843,-.247426,.384773,.849985,.84807,-.232437,.352555,.893174,.869122,-.215806,.318642,.936564,.888963,-.197307,.28381,.980253,.905547,-.177203,.247888,1.02463,.918554,-.155542,.212904,1.06714,.931395,-.131948,.1787,1.10451,.941749,-.106723,.145902,1.13694,.954551,-.0804939,.111193,1.1666,.970279,-.0534239,.0744697,1.19249,.986117,-.0257452,.0368788,1.21665,.999938,.00190634,-.0010291,1.23981,.118493,-647439e-11,.32272,23772e-10,.118765,-163023e-9,.323456,598573e-10,.118772,-65212e-8,.323477,239447e-9,.118843,-.00146741,.323657,538881e-9,.118804,-.00260846,.323553,95826e-8,.118826,-.00407576,.323595,.00149845,.118846,-.00586826,.323617,.00216047,.118886,-.00798578,.32367,.00294679,.118947,-.0104273,.323753,.00386124,.119055,-.0131909,.323922,.00490999,.119241,-.0162444,.324251,.00610804,.11944,-.0196339,.324544,.00745805,.119739,-.0233378,.325026,.00897805,.12011,-.0273179,.325586,.0106895,.120571,-.0316143,.326231,.0126073,.12124,-.0361939,.327264,.0147654,.122162,-.0410511,.328733,.0172001,.123378,-.0462233,.330659,.0199375,.125183,-.0517109,.333754,.0230498,.127832,-.0575652,.338507,.026597,.130909,-.0637441,.343666,.0306345,.135221,-.0704302,.351063,.035273,.14082,-.0776364,.360604,.0406137,.146781,-.0852293,.369638,.0466788,.155121,-.0935351,.3827,.0537628,.16398,-.102234,.39522,.0617985,.173926,-.111465,.40793,.07097,.185137,-.121296,.42105,.0813426,.19826,-.13169,.435735,.0931596,.212938,-.142614,.450932,.106547,.229046,-.153884,.465726,.121575,.246246,-.165382,.479461,.138286,.264637,-.176806,.492106,.15666,.284959,-.188793,.504774,.17728,.308157,-.200763,.518805,.19988,.330951,-.21239,.528231,.224293,.3549,-.223521,.536376,.250541,.381502,-.234169,.544846,.278902,.409529,-.244077,.551717,.309227,.437523,-.253363,.55517,.341426,.467624,-.261659,.557772,.37518,.497268,-.268498,.556442,.41007,.528294,-.274018,.553915,.446445,.559053,-.278169,.549153,.483779,.589329,-.281229,.539878,.522249,.622503,-.282902,.53162,.561754,.652382,-.282815,.518119,.601544,.681847,-.281247,.502187,.641574,.712285,-.277986,.484824,.682633,.740094,-.273017,.463483,.723426,.768478,-.266692,.441299,.763747,.794556,-.258358,.415238,.805565,.819408,-.248807,.386912,.847254,.843411,-.236214,.356165,.891091,.862397,-.219794,.320562,.936174,.883113,-.201768,.285322,.982562,.90023,-.181672,.249713,1.02862,.915192,-.159279,.214546,1.07163,.928458,-.134725,.180285,1.10995,.94069,-.10913,.147119,1.14354,.953409,-.0821315,.112492,1.17372,.969537,-.0542677,.0752014,1.20043,.985612,-.0259096,.0370361,1.22528,.999835,.00298198,-.00151801,1.24959,.10097,-602574e-11,.300277,202619e-11,.101577,-152164e-9,.302077,511662e-10,.101572,-608889e-9,.302066,204751e-9,.101566,-.00136997,.302047,460753e-9,.101592,-.00243557,.302114,819497e-9,.101608,-.0038053,.30214,.00128154,.101627,-.00547906,.30216,.0018483,.101669,-.00745647,.302224,.00252223,.101732,-.00973615,.302318,.00330716,.101844,-.0123097,.302513,.00421061,.102025,-.0151681,.30285,.00524481,.102224,-.0183334,.303166,.0064154,.102515,-.0217819,.303654,.00774063,.102886,-.0255067,.304243,.0092398,.103395,-.029514,.305089,.0109339,.104109,-.0337912,.306301,.0128561,.105074,-.0383565,.30798,.0150338,.10654,-.0432132,.310726,.0175228,.108478,-.0484244,.314351,.0203648,.111015,-.0539339,.319032,.0236325,.114682,-.0598885,.32605,.0274188,.11911,-.0663375,.334109,.0317905,.124736,-.0733011,.344013,.0368502,.131479,-.0807744,.355358,.0427104,.139283,-.0888204,.367614,.0494788,.148054,-.0973394,.380072,.0572367,.159037,-.10665,.395678,.0662704,.169794,-.116221,.40795,.0763192,.18314,-.126632,.423546,.087956,.197515,-.137383,.438213,.101042,.213514,-.148641,.453248,.115827,.23065,-.160117,.46688,.132283,.249148,-.171807,.479962,.150644,.270219,-.183695,.494618,.171073,.292338,-.195574,.506937,.193378,.314999,-.207205,.516463,.217585,.340991,-.218955,.528123,.24428,.367982,-.229917,.537025,.272784,.39432,-.239737,.541627,.302742,.423364,-.249048,.546466,.335112,.453751,-.257329,.549466,.369032,.48416,-.264623,.549503,.404577,.515262,-.270411,.547008,.441337,.547036,-.274581,.542249,.479162,.576614,-.277266,.533015,.517904,.611143,-.279144,.525512,.558508,.640989,-.279001,.51154,.598995,.671182,-.277324,.495641,.639935,.700848,-.273908,.477526,.681017,.729862,-.269063,.457955,.722764,.758273,-.262282,.434846,.764349,.784121,-.254281,.409203,.806206,.809798,-.24505,.382694,.848617,.834953,-.233861,.354034,.892445,.856817,-.221308,.321764,.936263,.877609,-.205996,.288118,.982401,.897489,-.186702,.253277,1.02975,.913792,-.164618,.217963,1.07488,.92785,-.140023,.183221,1.11487,.940378,-.11328,.149385,1.14947,.95273,-.0853958,.114152,1.1807,.969059,-.0568698,.0769845,1.20912,.985574,-.0276502,.0381186,1.23498,.999943,.00239052,-.00126861,1.25987,.0852715,-560067e-11,.279021,171162e-11,.0854143,-140871e-9,.279483,430516e-10,.0854191,-563385e-9,.2795,172184e-9,.0854188,-.00126753,.279493,387464e-9,.0854229,-.00225337,.279501,68918e-8,.0854443,-.00352086,.279549,.00107803,.0854697,-.00506962,.279591,.00155536,.0855093,-.00689873,.279652,.00212354,.0855724,-.00900821,.279752,.00278703,.0856991,-.0113799,.280011,.0035551,.085855,-.0140314,.280297,.00443449,.0860682,-.016963,.280682,.00543636,.086344,-.0201438,.281159,.0065788,.0867426,-.0235999,.281886,.00787977,.087239,-.0273069,.282745,.0093606,.0879815,-.031269,.284139,.011056,.0891258,-.035531,.28647,.0130065,.0906909,-.0400947,.289708,.0152495,.0927624,-.0449638,.293904,.0178454,.0958376,-.0502427,.300471,.0208915,.0995827,-.0559514,.30806,.0244247,.104526,-.0622152,.317874,.0285721,.110532,-.0690046,.329332,.0334227,.117385,-.0763068,.341217,.0390466,.12522,-.084184,.353968,.0455786,.134037,-.0925248,.366797,.0530773,.144014,-.101487,.380209,.0617424,.156013,-.111273,.395956,.071777,.168872,-.121431,.41053,.0830905,.183089,-.132105,.425073,.0959341,.198763,-.143286,.439833,.110448,.216159,-.154841,.454507,.126769,.234859,-.166588,.468368,.14495,.255879,-.178626,.482846,.165233,.27677,-.190218,.493489,.187217,.301184,-.202227,.506549,.211659,.325852,-.213764,.5158,.237922,.352824,-.22487,.525442,.26632,.380882,-.235246,.532487,.296691,.410137,-.244847,.537703,.329179,.439787,-.253122,.540361,.363135,.472291,-.260517,.542734,.399222,.501856,-.266519,.538826,.436352,.534816,-.270905,.535152,.474505,.565069,-.273826,.525979,.513988,.597154,-.275333,.516394,.554852,.630473,-.275314,.506206,.596592,.660574,-.273323,.489769,.638117,.692015,-.270008,.472578,.680457,.720647,-.265001,.452134,.723008,.750528,-.258311,.430344,.765954,.777568,-.250046,.405624,.809012,.80387,-.240114,.378339,.852425,.828439,-.228737,.349877,.895346,.851472,-.216632,.318968,.940695,.873906,-.202782,.287489,.987235,.89467,-.187059,.254394,1.03348,.912281,-.168818,.221294,1.07812,.927358,-.146494,.18675,1.11928,.940385,-.120009,.152322,1.15609,.952672,-.0917183,.117514,1.18875,.968496,-.0620321,.0797405,1.21821,.985236,-.0314945,.0402383,1.24523,.99998,-575153e-9,110644e-9,1.27133,.0702429,-512222e-11,.255273,140947e-11,.0702981,-128826e-9,.255469,354488e-10,.0703691,-515562e-9,.255727,141874e-9,.0703805,-.00116,.255754,31929e-8,.0703961,-.00206224,.255813,567999e-9,.0704102,-.00322223,.255839,88871e-8,.0704298,-.00463928,.255863,.00128272,.0704759,-.00631375,.255953,.00175283,.0705434,-.00824317,.256079,.00230342,.0706693,-.010412,.25636,.0029443,.0708189,-.0128439,.256647,.00368031,.0710364,-.0155177,.257084,.00452614,.0713223,-.0184374,.257637,.00549706,.0717182,-.0216002,.258416,.00661246,.072321,-.0249966,.259699,.00790147,.0731446,-.0286566,.261475,.0093884,.0743352,-.0325888,.264132,.0111186,.0760676,-.036843,.26815,.013145,.078454,-.0414292,.273636,.0155251,.0818618,-.0464634,.281653,.0183525,.0857382,-.0519478,.289992,.0216642,.0908131,-.0579836,.30066,.0255956,.0967512,-.0645124,.312204,.0301954,.103717,-.0716505,.325001,.0356017,.111596,-.0793232,.338129,.041896,.120933,-.087645,.352853,.0492447,.130787,-.096492,.366192,.0576749,.142311,-.105973,.380864,.0673969,.155344,-.116182,.396575,.0785899,.169535,-.126815,.411443,.0912377,.185173,-.138015,.426256,.105607,.201755,-.149325,.439607,.121551,.221334,-.161207,.455467,.139608,.241461,-.173162,.469096,.159591,.26294,-.18504,.481014,.18156,.286776,-.196881,.493291,.205781,.311596,-.208311,.503556,.231819,.338667,-.219671,.513268,.260274,.366021,-.230451,.519414,.290862,.395875,-.240131,.526766,.323196,.425564,-.248566,.52905,.357071,.457094,-.256195,.530796,.393262,.488286,-.262331,.528703,.430797,.522291,-.267141,.52727,.470231,.554172,-.270411,.519848,.510477,.586427,-.271986,.510307,.551594,.619638,-.27192,.499158,.593849,.650656,-.269817,.483852,.636314,.68284,-.266267,.467515,.679679,.714356,-.26113,.44931,.723884,.742717,-.254067,.425789,.767245,.770894,-.245652,.401144,.811819,.797358,-.235554,.374224,.856315,.823377,-.223896,.346167,.901077,.847456,-.210865,.316056,.946502,.870697,-.196574,.284503,.993711,.891068,-.180814,.251628,1.04134,.909267,-.163314,.219065,1.08609,.925653,-.143304,.186446,1.12702,.940017,-.121322,.153416,1.16371,.952398,-.0973872,.120334,1.19712,.967568,-.0698785,.08352,1.22791,.984772,-.0390031,.0439209,1.25672,1.00026,-.0070087,.00315668,1.28428,.0556653,-459654e-11,.227325,112556e-11,.0565238,-116382e-9,.230826,284985e-10,.0565717,-465666e-9,.231026,114036e-9,.0565859,-.00104773,.231079,256656e-9,.0565761,-.00186255,.231025,45663e-8,.0565913,-.00291002,.231058,714664e-9,.0566108,-.00418998,.231085,.00103224,.0566532,-.00570206,.231169,.00141202,.0567473,-.00743666,.231417,.00186018,.0568567,-.00940298,.231661,.00238264,.0569859,-.0115991,.231895,.00298699,.0572221,-.0140096,.232456,.00368957,.057519,-.0166508,.233096,.00450303,.0579534,-.01951,.234094,.00544945,.0585922,-.0225991,.235629,.00655564,.0595647,-.0259416,.238106,.00785724,.0609109,-.0295661,.241557,.00939127,.0628751,-.0335126,.246652,.0112198,.0656908,-.0378604,.254091,.0134168,.0691347,-.0426543,.262666,.0160374,.0732165,-.0478967,.272029,.0191514,.0782863,-.0536716,.283007,.0228597,.0843973,-.0600683,.295732,.0272829,.0913598,-.0670095,.308779,.032484,.0994407,-.0745516,.322886,.0385886,.108189,-.082712,.336408,.0457133,.118574,-.0914927,.351692,.0539832,.129989,-.100854,.366502,.0635162,.142722,-.110837,.381675,.0744386,.156654,-.121353,.3963,.0868483,.172151,-.132414,.411477,.100963,.188712,-.143809,.42508,.116795,.208093,-.155765,.441328,.134715,.227936,-.167608,.454328,.154396,.249495,-.179579,.467235,.176179,.27362,-.191488,.480248,.200193,.296371,-.202618,.487886,.225775,.324234,-.214133,.499632,.25441,.353049,-.225212,.509532,.285077,.381785,-.234875,.514265,.317047,.414038,-.244205,.521282,.351874,.445251,-.252145,.522931,.388279,.476819,-.258433,.520947,.425825,.509209,-.263411,.517669,.465104,.542759,-.266732,.512841,.505741,.574822,-.268263,.503317,.547611,.609324,-.268489,.493035,.590953,.641772,-.266941,.478816,.63488,.674049,-.263297,.462863,.679072,.705071,-.257618,.442931,.723487,.734709,-.250625,.421299,.768708,.763704,-.24179,.397085,.814375,.791818,-.231115,.370577,.859907,.817439,-.21922,.34232,.906715,.843202,-.205658,.312627,.953943,.866639,-.190563,.280933,1.00185,.888129,-.173978,.248393,1.05105,.907239,-.155485,.216007,1.09704,.923893,-.134782,.183233,1.13857,.938882,-.11249,.150376,1.17539,.952464,-.0890706,.117177,1.20924,.968529,-.0646523,.0813095,1.24055,.984763,-.038606,.0439378,1.27018,1.00053,-.01238,.00598668,1.29873,.0437928,-409594e-11,.204012,8.79224e-7,.0440166,-103395e-9,.205049,221946e-10,.0440529,-413633e-9,.205225,887981e-10,.0440493,-930594e-9,.2052,199858e-9,.0439884,-.00165352,.204901,355495e-9,.0440716,-.0025849,.205255,556983e-9,.0440968,-.00372222,.205311,805326e-9,.0441359,-.00506478,.205391,.00110333,.0442231,-.00660384,.205638,.00145768,.0443254,-.00835246,.205877,.00187275,.0444832,-.0102992,.20627,.00235938,.0447001,-.0124449,.206796,.0029299,.0450168,-.0147935,.207593,.0036005,.0454816,-.017336,.208819,.00439246,.0462446,-.0201156,.211036,.00533864,.0473694,-.0231568,.214388,.00646984,.0490191,-.0264941,.219357,.00783856,.0512776,-.030184,.226061,.00950182,.0541279,-.0342661,.234094,.0115156,.0578989,-.0388539,.244297,.0139687,.0620835,-.0438735,.254457,.0169015,.0673497,-.04951,.266706,.0204554,.0731759,-.0556263,.278753,.0246606,.0803937,-.0624585,.29309,.0297126,.0879287,-.0697556,.305856,.0355868,.0970669,-.0778795,.321059,.0425768,.106508,-.0863541,.333873,.05056,.11776,-.0955935,.349008,.0598972,.130081,-.105438,.363776,.0706314,.144454,-.115899,.380112,.0828822,.1596,-.126827,.394843,.0967611,.176097,-.138161,.409033,.112381,.194726,-.149904,.424257,.129952,.213944,-.161675,.436945,.149333,.235516,-.173659,.450176,.170892,.260564,-.185963,.466305,.194984,.285183,-.197582,.477328,.220805,.311095,-.208697,.486566,.248694,.338924,-.219519,.494811,.279015,.369757,-.229766,.504065,.311725,.3996,-.238879,.507909,.345844,.430484,-.246802,.509805,.381749,.46413,-.253924,.511436,.420251,.497077,-.259319,.508787,.459957,.530434,-.263297,.50394,.501356,.565725,-.265619,.49804,.544252,.599254,-.265842,.487346,.587856,.631251,-.263978,.472975,.631969,.663972,-.26043,.457135,.677471,.697724,-.255358,.439844,.723744,.727725,-.248308,.417872,.770653,.756417,-.239181,.39273,.817357,.785419,-.22814,.367839,.864221,.81266,-.215681,.339449,.912701,.839391,-.201623,.309279,.962419,.86366,-.185624,.278029,1.0122,.885028,-.16797,.245294,1.06186,.904639,-.148336,.212689,1.10934,.922048,-.12637,.179616,1.15063,.936952,-.102928,.146749,1.18885,.951895,-.0785268,.112733,1.22352,.967198,-.0530153,.0760056,1.25681,.984405,-.02649,.0383183,1.28762,1.00021,70019e-8,-20039e-8,1.31656,.0325964,-355447e-11,.176706,6.55682e-7,.0329333,-899174e-10,.178527,165869e-10,.0329181,-359637e-9,.178453,663498e-10,.0329085,-808991e-9,.178383,149332e-9,.0329181,-.00143826,.178394,265873e-9,.0329425,-.00224678,.178517,416597e-9,.0329511,-.00323575,.17849,603299e-9,.033011,-.00439875,.178695,829422e-9,.0330733,-.00574059,.178843,.00109908,.0331857,-.00725896,.179176,.00141933,.0333445,-.00895289,.179618,.0017999,.0335674,-.0108219,.180238,.00225316,.033939,-.0128687,.181417,.00279765,.0345239,-.015114,.183395,.0034564,.0354458,-.017596,.186616,.00425864,.0368313,-.0203524,.191547,.00524936,.0386115,-.0234105,.197508,.00647033,.0410303,-.0268509,.205395,.00798121,.0442245,-.0307481,.215365,.0098557,.0478659,-.0350863,.225595,.0121417,.0522416,-.0399506,.236946,.0149385,.0574513,-.045357,.249442,.0183189,.0631208,-.0512863,.261222,.0223644,.0701124,-.0579273,.275418,.0272418,.0777331,-.0650652,.288989,.0329458,.0862709,-.0728813,.302546,.0396819,.096103,-.081363,.317164,.04757,.106976,-.0904463,.331733,.0567012,.119175,-.100105,.34661,.067202,.132919,-.110375,.362249,.0792588,.147727,-.121115,.376978,.0928672,.163618,-.132299,.390681,.108228,.182234,-.143887,.406571,.125502,.201809,-.155827,.42042,.144836,.225041,-.168357,.438411,.166706,.247621,-.18004,.450368,.189909,.27097,-.191536,.460083,.215251,.296658,-.203024,.469765,.243164,.325892,-.214056,.481837,.273388,.35406,-.224104,.487474,.305344,.384372,-.233489,.492773,.339741,.41749,-.241874,.498451,.376287,.45013,-.248834,.499632,.414195,.481285,-.254658,.495233,.454077,.519183,-.259367,.496401,.496352,.551544,-.261818,.487686,.538798,.587349,-.262964,.479453,.583626,.621679,-.262128,.467709,.629451,.654991,-.258998,.452123,.67566,.686873,-.254119,.433495,.723248,.719801,-.246946,.413657,.771156,.750355,-.237709,.390366,.81989,.780033,-.226549,.364947,.868601,.809254,-.214186,.337256,.920034,.836576,-.199639,.307395,.971706,.861774,-.183169,.275431,1.02479,.885707,-.165111,.243431,1.07837,.904742,-.144363,.210921,1.12783,.915604,-.121305,.17647,1.17254,.930959,-.0962119,.143106,1.21012,.948404,-.069969,.108112,1.24474,.967012,-.0427586,.0708478,1.27718,.984183,-.0147043,.032335,1.3083,.999577,.0142165,-.00726867,1.3382,.0229227,-299799e-11,.148623,4.62391e-7,.0232194,-758796e-10,.15054,117033e-10,.0232315,-303636e-9,.15063,468397e-10,.0232354,-683189e-9,.150624,105472e-9,.0232092,-.0012136,.150445,187744e-9,.0232523,-.00189765,.150679,294847e-9,.0232828,-.00273247,.150789,428013e-9,.0233371,-.00371287,.150995,591134e-9,.0234015,-.00484794,.15118,787642e-9,.023514,-.00612877,.151562,.00102547,.023679,-.00756125,.152116,.00131351,.0239559,-.00914651,.153162,.00166594,.0244334,-.010904,.155133,.00210182,.025139,-.0128615,.158035,.00264406,.0262598,-.0150628,.162751,.00332923,.0277875,-.0175532,.168944,.00419773,.0298472,-.0203981,.176835,.00530034,.0325444,-.023655,.186686,.00669777,.0355581,-.0272982,.196248,.00842661,.0392841,-.0314457,.207352,.0105854,.0436815,-.0361157,.219279,.0132458,.0485272,-.0412932,.230728,.0164736,.0541574,-.0470337,.242994,.0203715,.0609479,-.0535002,.257042,.0250953,.0685228,-.0605409,.27102,.0306856,.0768042,-.0680553,.28406,.037193,.0864844,-.0765011,.299186,.0449795,.0969415,-.0852674,.3132,.0538316,.108478,-.0947333,.327138,.0641149,.121705,-.10481,.342345,.0759185,.136743,-.115474,.358472,.0894116,.152986,-.126536,.374067,.104562,.170397,-.138061,.388267,.121632,.191392,-.150203,.406467,.140996,.211566,-.161751,.418641,.161696,.233567,-.173407,.430418,.184557,.257769,-.185397,.44277,.210092,.28531,-.197048,.457191,.237827,.311726,-.20784,.464712,.267253,.340537,-.218345,.472539,.299332,.372921,-.228306,.482331,.333988,.402924,-.236665,.484378,.369722,.434475,-.244097,.484717,.407836,.469736,-.250547,.487093,.448465,.505045,-.25511,.485575,.490263,.540262,-.258444,.481225,.534495,.576347,-.259903,.473481,.579451,.608656,-.259572,.4603,.625604,.646679,-.257908,.450341,.674511,.679902,-.253663,.431561,.723269,.714159,-.247419,.412684,.773263,.745345,-.239122,.389388,.824182,.778248,-.228837,.365361,.876634,.807208,-.216197,.337667,.92945,.835019,-.201772,.307197,.985261,.860261,-.185291,.274205,1.04299,.877601,-.165809,.240178,1.09816,.898211,-.143897,.207571,1.14694,.915789,-.119513,.174904,1.19008,.931831,-.0932919,.141423,1.2297,.949244,-.0656528,.105603,1.26553,.967527,-.0370262,.0679551,1.29986,.984139,-.00730117,.0283133,1.33252,.999713,.0234648,-.0121785,1.36397,.0152135,-245447e-11,.122795,3.04092e-7,.0151652,-615778e-10,.122399,76292e-10,.0151181,-245948e-9,.122023,304802e-10,.0151203,-553394e-9,.12203,686634e-10,.015125,-983841e-9,.122037,122463e-9,.0151427,-.00153774,.12214,192706e-9,.0151708,-.0022103,.122237,281219e-9,.0152115,-.00300741,.12238,390804e-9,.0152877,-.00392494,.1227,526317e-9,.015412,-.00496597,.123244,69443e-8,.0156201,-.00613314,.124228,90547e-8,.0159658,-.00744113,.125945,.0011732,.0165674,-.00892546,.129098,.00151888,.017487,-.010627,.133865,.00197007,.018839,-.0126043,.140682,.0025637,.020554,-.0148814,.148534,.00333637,.0226727,-.0175123,.157381,.00433738,.0251879,-.0205266,.166685,.00561664,.0283635,-.0240319,.177796,.00725563,.0318694,-.0279432,.188251,.00928811,.0361044,-.0324313,.200038,.011835,.0406656,-.0373527,.210685,.0149146,.0463846,-.0430132,.224182,.0187254,.0525696,-.0491013,.23634,.0232283,.0598083,-.0559175,.250013,.0286521,.0679437,-.0633657,.263981,.0350634,.0771181,-.0714602,.278072,.0425882,.0881273,-.0803502,.29511,.0514487,.0996628,-.0896903,.309976,.0615766,.112702,-.099644,.325611,.0732139,.126488,-.109829,.339321,.0862324,.142625,-.120859,.35574,.101275,.15953,-.131956,.369845,.117892,.176991,-.143145,.38146,.136205,.199715,-.155292,.40052,.157252,.220787,-.167066,.412055,.179966,.243697,-.178396,.423133,.204418,.272106,-.190433,.439524,.232141,.297637,-.201265,.447041,.261109,.325273,-.211834,.454488,.292627,.357219,-.221889,.465004,.326669,.387362,-.230729,.468527,.362426,.423131,-.23924,.475836,.401533,.45543,-.246067,.475017,.441902,.493393,-.251557,.478017,.484239,.526253,-.255571,.4709,.528586,.560554,-.257752,.463167,.574346,.599306,-.258076,.456452,.621655,.634541,-.256471,.443725,.670492,.668907,-.253283,.428719,.721943,.705619,-.247562,.411348,.772477,.739034,-.240626,.388939,.8264,.771408,-.231493,.36425,.881702,.803312,-.220125,.337321,.9385,.828457,-.206645,.305364,.997437,.854819,-.190664,.273715,1.05693,.878666,-.171429,.242218,1.11251,.898404,-.149235,.209556,1.16398,.917416,-.12435,.176863,1.21014,.933133,-.0972703,.142775,1.25178,.95066,-.0683607,.106735,1.29028,.968589,-.0378724,.0681609,1.32703,.984776,-.00605712,.0273966,1.36158,.99994,.0263276,-.0138124,1.3943,.00867437,-186005e-11,.0928979,1.73682e-7,.00864003,-466389e-10,.0925237,435505e-11,.00864593,-186594e-9,.0925806,174322e-10,.00864095,-419639e-9,.0924903,392862e-10,.00863851,-746272e-9,.0924589,702598e-10,.00868531,-.00116456,.0929,111188e-9,.00869667,-.00167711,.0928529,163867e-9,.00874332,-.00228051,.0930914,23104e-8,.00882709,-.00297864,.0935679,31741e-8,.00898874,-.00377557,.0946165,430186e-9,.00929346,-.00469247,.0967406,580383e-9,.00978271,-.00575491,.100084,783529e-9,.0105746,-.00701514,.105447,.00106304,.0116949,-.00851797,.112494,.00144685,.0130419,-.0102757,.119876,.00196439,.0148375,-.012381,.129034,.00266433,.0168725,-.01482,.137812,.00358364,.0193689,-.0176563,.147696,.00478132,.0222691,-.0209211,.157795,.00631721,.0256891,-.0246655,.168431,.00826346,.0294686,-.0288597,.178587,.0106714,.0340412,-.0336441,.190251,.0136629,.0393918,-.039033,.202999,.0173272,.0453947,-.0450087,.215655,.0217448,.0521936,-.0515461,.228686,.0269941,.0600279,-.058817,.242838,.033272,.0692398,-.0667228,.258145,.0406457,.0793832,-.0752401,.273565,.0492239,.0902297,-.0841851,.287735,.0590105,.102014,-.0936479,.301161,.0702021,.116054,-.103967,.317438,.0832001,.13191,-.114622,.334166,.0977951,.148239,-.125452,.348192,.113985,.165809,-.136453,.361094,.131928,.184616,-.147648,.373534,.151811,.207491,-.159607,.39101,.174476,.230106,-.171119,.402504,.198798,.257036,-.182906,.418032,.225796,.281172,-.193605,.425468,.254027,.312034,-.204771,.440379,.285713,.340402,-.214988,.445406,.319196,.370231,-.224711,.44968,.35537,.407105,-.233516,.460747,.393838,.439037,-.240801,.460624,.433747,.47781,-.24762,.465957,.477234,.510655,-.251823,.460054,.52044,.550584,-.255552,.459172,.567853,.585872,-.257036,.450311,.615943,.620466,-.257535,.437763,.667693,.660496,-.255248,.426639,.718988,.695578,-.251141,.409185,.772503,.732176,-.244718,.39015,.827023,.760782,-.236782,.362594,.885651,.79422,-.225923,.33711,.943756,.824521,-.213855,.308272,1.00874,.854964,-.197723,.278529,1.06764,.878065,-.179209,.246208,1.12836,.899834,-.157569,.21329,1.18318,.918815,-.133206,.181038,1.23161,.934934,-.106545,.146993,1.27644,.952115,-.0780574,.111175,1.31842,.96906,-.0478279,.0728553,1.35839,.985178,-.0160014,.032579,1.39697,1.00039,.0173126,-.0095256,1.43312,.00384146,-124311e-11,.0613583,7.78271e-8,.00390023,-314043e-10,.0622919,196626e-11,.00389971,-125622e-9,.0622632,787379e-11,.00389491,-282352e-9,.0620659,1778e-8,.00391618,-502512e-9,.0624687,320918e-10,.00392662,-784458e-9,.0625113,515573e-10,.00396053,-.00112907,.0628175,778668e-10,.00401911,-.00153821,.0633286,113811e-9,.00414994,-.0020208,.0646443,16445e-8,.00441223,-.00260007,.0673886,237734e-9,.00484427,-.0033097,.0716528,345929e-9,.00549109,-.00418966,.0774998,505987e-9,.00636293,-.00527331,.0844758,739208e-9,.00746566,-.00660428,.0921325,.00107347,.00876625,-.00818826,.0997067,.00153691,.0103125,-.0100811,.107433,.00217153,.0123309,-.0123643,.117088,.00303427,.0146274,-.0150007,.126438,.00416018,.0172295,-.0180531,.135672,.00561513,.0204248,-.0215962,.146244,.007478,.0241597,-.0256234,.157481,.00981046,.0284693,-.0302209,.169125,.0127148,.033445,-.0353333,.181659,.0162453,.0391251,-.0410845,.1944,.0205417,.0454721,-.0473451,.207082,.0256333,.0530983,-.0542858,.221656,.0317036,.0615356,-.0618384,.236036,.0388319,.0703363,-.0697631,.248398,.046974,.0810391,-.0784757,.263611,.0565246,.0920144,-.0873488,.275857,.0671724,.105584,-.0973652,.292555,.0798105,.119506,-.107271,.306333,.0935945,.134434,-.117608,.318888,.109106,.153399,-.128938,.337552,.127074,.171258,-.139944,.349955,.14643,.191059,-.151288,.361545,.168,.215069,-.163018,.378421,.192082,.237838,-.174226,.38879,.217838,.266965,-.186063,.405857,.246931,.292827,-.196909,.414146,.277505,.324352,-.207473,.426955,.310711,.354427,-.217713,.433429,.346794,.389854,-.227183,.443966,.385237,.420749,-.235131,.44471,.424955,.459597,-.242786,.451729,.468446,.495316,-.248767,.45072,.513422,.534903,-.253351,.450924,.560618,.572369,-.256277,.445266,.609677,.612383,-.2576,.438798,.660995,.644037,-.256931,.421693,.713807,.686749,-.254036,.4109,.767616,.719814,-.249785,.390151,.82533,.754719,-.244283,.367847,.888311,.792022,-.235076,.345013,.948177,.822404,-.225061,.316193,1.01661,.853084,-.211113,.287013,1.08075,.879871,-.19449,.255424,1.14501,.901655,-.174023,.222879,1.20203,.919957,-.1509,.18989,1.25698,.938412,-.124923,.15606,1.30588,.953471,-.0968139,.120512,1.3529,.970451,-.066734,.0828515,1.3986,.985522,-.034734,.0424458,1.44148,1.00099,-.00102222,678929e-9,1.48398,965494e-9,-6.27338e-7,.0306409,1.97672e-8,99168e-8,-158573e-10,.0314638,4.99803e-7,991068e-9,-634012e-10,.031363,200682e-11,974567e-9,-14144e-8,.03036,457312e-11,998079e-9,-252812e-9,.031496,860131e-11,.00102243,-396506e-9,.0319955,148288e-10,.00107877,-577593e-9,.0331376,249141e-10,.00121622,-816816e-9,.0359396,423011e-10,.0014455,-.00113761,.0399652,724613e-10,.00178791,-.00156959,.0450556,123929e-9,.00225668,-.00214064,.0508025,208531e-9,.00285627,-.00287655,.0568443,341969e-9,.0035991,-.00380271,.0630892,544158e-9,.00455524,-.00496264,.0702204,842423e-9,.00569143,-.0063793,.0773426,.00126704,.00716928,-.00813531,.0860839,.00186642,.00885307,-.0101946,.0944079,.00267014,.0109316,-.0126386,.103951,.00374033,.0133704,-.0154876,.113786,.0051304,.0161525,-.0187317,.123477,.00688858,.0194267,-.0224652,.133986,.00910557,.0230967,-.0265976,.143979,.0118074,.0273627,-.0312848,.154645,.0151266,.0323898,-.0365949,.166765,.0191791,.0379225,-.0422914,.177932,.0239236,.0447501,-.0487469,.19167,.0296568,.0519391,-.0556398,.203224,.0362924,.0599464,-.0631646,.215652,.0440585,.0702427,-.0714308,.232089,.0531619,.0806902,-.0800605,.245258,.0634564,.0923194,-.0892815,.258609,.0752481,.106938,-.09931,.276654,.0888914,.121238,-.109575,.289847,.104055,.138817,-.120461,.307566,.121266,.15595,-.131209,.320117,.139944,.178418,-.143049,.339677,.161591,.197875,-.154074,.349886,.184303,.224368,-.166307,.369352,.210669,.252213,-.178051,.386242,.238895,.277321,-.189335,.395294,.269182,.310332,-.200683,.412148,.302508,.338809,-.210856,.418266,.337264,.372678,-.220655,.428723,.374881,.405632,-.230053,.433887,.415656,.442293,-.237993,.439911,.457982,.477256,-.244897,.440175,.502831,.515592,-.250657,.441079,.550277,.550969,-.255459,.435219,.601102,.592883,-.257696,.432882,.651785,.629092,-.259894,.421054,.708961,.672033,-.258592,.41177,.763806,.709147,-.256525,.395267,.824249,.745367,-.254677,.375013,.8951,.784715,-.247892,.353906,.959317,.818107,-.240162,.327801,1.03153,.847895,-.229741,.298821,1.10601,.879603,-.213084,.269115,1.164,.902605,-.195242,.236606,1.22854,.922788,-.174505,.203442,1.29017,.944831,-.150169,.169594,1.34157,.959656,-.124099,.135909,1.3956,.972399,-.0960626,.0990563,1.45128,.986549,-.0657097,.0602348,1.50312,1.00013,-.0333558,.0186694,1.55364,619747e-11,-1e-7,.00778326,796756e-16,2.37499e-8,-9.99999e-8,282592e-10,1.14596e-10,100292e-11,-166369e-11,250354e-9,6.77492e-9,350752e-11,-637769e-11,357289e-9,6.31655e-8,826445e-11,-174689e-10,516179e-9,3.1851e-7,242481e-10,-450868e-10,.0010223,130577e-11,455631e-10,-89044e-9,.00144302,374587e-11,971222e-10,-178311e-9,.00241912,102584e-10,171403e-9,-313976e-9,.00354938,236481e-10,292747e-9,-520026e-9,.00513765,496014e-10,789827e-9,-.00118187,.0238621,139056e-9,.00114093,-.00171827,.0286691,244093e-9,.00176119,-.00249667,.0368565,420623e-9,.0022233,-.00333742,.0400469,65673e-8,.00343382,-.00481976,.0535751,.00109323,.00427602,-.00600755,.057099,.00155268,.00461435,-.00737637,.0551084,.00215031,.00695698,-.00971401,.0715767,.00316529,.00867619,-.0120943,.0793314,.00436995,.0106694,-.0148202,.0869391,.0058959,.0140351,-.0183501,.101572,.00798757,.0168939,-.022006,.11018,.0104233,.020197,-.0261568,.119041,.0134167,.0254702,-.0312778,.135404,.0173009,.0298384,-.0362469,.1437,.0215428,.035159,-.042237,.15512,.0268882,.0427685,-.0488711,.17128,.033235,.0494848,-.0557997,.181813,.0404443,.0592394,-.0635578,.198745,.0490043,.0681463,-.071838,.210497,.0588239,.0804753,-.0809297,.228864,.0702835,.0942205,-.0906488,.247008,.0834012,.106777,-.100216,.258812,.0975952,.124471,-.110827,.278617,.114162,.138389,-.121193,.287049,.131983,.159543,-.13253,.307151,.152541,.176432,-.143611,.31564,.174673,.201723,-.15548,.33538,.199842,.229721,-.167166,.355256,.227097,.250206,-.178238,.360047,.256014,.282118,-.189905,.378761,.28855,.312821,-.201033,.39181,.323348,.341482,-.211584,.397716,.360564,.377368,-.221314,.410141,.400004,.418229,-.230474,.423485,.442371,.444881,-.239443,.418874,.488796,.488899,-.245987,.427545,.535012,.520317,-.253948,.422147,.589678,.568566,-.256616,.42719,.637683,.599607,-.26376,.415114,.703363,.64222,-.268687,.408715,.771363,.685698,-.2694,.399722,.83574,.732327,-.266642,.388651,.897764,.769873,-.267712,.369198,.983312,.806733,-.263479,.346802,1.06222,.843466,-.254575,.321368,1.13477,.873008,-.242749,.29211,1.20712,.908438,-.22725,.262143,1.27465,.936321,-.207621,.228876,1.33203,.950353,-.187932,.19484,1.40439,.96442,-.165154,.163178,1.4732,.979856,-.139302,.127531,1.53574,.982561,-.11134,.0903457,1.59982,.996389,-.0808124,.0489007,1.6577],t=[1,0,0,0,1,791421e-36,0,0,1,104392e-29,0,0,1,349405e-26,0,0,1,109923e-23,0,0,1,947414e-22,0,0,1,359627e-20,0,0,1,772053e-19,0,0,1,108799e-17,0,0,1,110655e-16,0,0,1,865818e-16,0,0,.999998,5.45037e-10,0,0,.999994,2.85095e-9,0,0,.999989,1.26931e-8,0,0,.999973,4.89938e-8,0,0,.999947,1.66347e-7,0,0,.999894,5.02694e-7,0,0,.999798,136532e-11,0,0,.999617,335898e-11,0,0,.999234,752126e-11,0,0,.998258,152586e-10,0,0,.99504,266207e-10,0,0,.980816,236802e-10,0,0,.967553,207684e-11,0,0,.966877,403733e-11,0,0,.965752,741174e-11,0,0,.96382,127746e-10,0,0,.960306,202792e-10,0,0,.953619,280232e-10,0,0,.941103,278816e-10,0,0,.926619,160221e-10,0,0,.920983,235164e-10,0,0,.912293,311924e-10,0,.0158731,.899277,348118e-10,0,.0476191,.880884,26041e-9,0,.0793651,.870399,338726e-10,0,.111111,.856138,392906e-10,0,.142857,.837436,372874e-10,0,.174603,.820973,392558e-10,0,.206349,.803583,434658e-10,0,.238095,.782168,40256e-9,0,.269841,.764107,448159e-10,0,.301587,.743092,457627e-10,0,.333333,.721626,455314e-10,0,.365079,.700375,477335e-10,0,.396825,.677334,461072e-10,0,.428571,.655702,484393e-10,0,.460317,.632059,464583e-10,0,.492064,.610125,483923e-10,0,.52381,.58653,464342e-10,0,.555556,.564508,477033e-10,0,.587302,.541405,459263e-10,0,.619048,.519556,46412e-9,0,.650794,.497292,448913e-10,0,.68254,.475898,445789e-10,0,.714286,.454722,433496e-10,0,.746032,.434042,423054e-10,0,.777778,.414126,413737e-10,0,.809524,.394387,397265e-10,0,.84127,.375841,390709e-10,0,.873016,.357219,369938e-10,0,.904762,.340084,365618e-10,0,.936508,.322714,342533e-10,0,.968254,.306974,339596e-10,0,1,1,101524e-23,0,0,1,10292e-22,0,0,1,130908e-23,0,0,1,473331e-23,0,0,1,625319e-22,0,0,1,107932e-20,0,0,1,163779e-19,0,0,1,203198e-18,0,0,1,204717e-17,0,0,.999999,168995e-16,0,0,.999998,1.15855e-10,0,0,.999996,6.6947e-10,0,0,.999991,3.30863e-9,0,0,.999983,1.41737e-8,0,0,.999968,5.32626e-8,0,0,.99994,1.77431e-7,0,0,.999891,5.28835e-7,0,0,.999797,142169e-11,0,0,.999617,347057e-11,0,0,.999227,77231e-10,0,0,.998239,155753e-10,0,0,.994937,268495e-10,0,0,.980225,213742e-10,0,0,.967549,21631e-10,0,0,.966865,417989e-11,0,0,.965739,763341e-11,0,0,.963794,130892e-10,0,0,.960244,206456e-10,0,0,.953495,282016e-10,0,148105e-9,.940876,271581e-10,0,.002454,.926569,164159e-10,0,.00867491,.920905,239521e-10,0,.01956,.912169,315127e-10,0,.035433,.899095,346626e-10,0,.056294,.882209,290223e-10,0,.0818191,.870272,342992e-10,0,.111259,.855977,394164e-10,0,.142857,.837431,372343e-10,0,.174603,.820826,396691e-10,0,.206349,.803408,435395e-10,0,.238095,.782838,419579e-10,0,.269841,.763941,450953e-10,0,.301587,.742904,455847e-10,0,.333333,.721463,458833e-10,0,.365079,.700197,477159e-10,0,.396825,.677501,470641e-10,0,.428571,.655527,484732e-10,0,.460317,.6324,476834e-10,0,.492064,.609964,484213e-10,0,.52381,.586839,475541e-10,0,.555556,.564353,476951e-10,0,.587302,.541589,467611e-10,0,.619048,.519413,463493e-10,0,.650794,.497337,453994e-10,0,.68254,.475797,445308e-10,0,.714286,.454659,435787e-10,0,.746032,.434065,424839e-10,0,.777778,.414018,41436e-9,0,.809524,.39455,401902e-10,0,.84127,.375742,390813e-10,0,.873016,.357501,377116e-10,0,.904762,.339996,36535e-9,0,.936508,.323069,351265e-10,0,.968254,.306897,339112e-10,0,1,1,10396e-19,0,0,1,104326e-20,0,0,1,110153e-20,0,0,1,144668e-20,0,0,1,34528e-19,0,0,1,175958e-19,0,0,1,12627e-17,0,0,1,936074e-18,0,0,1,645742e-17,0,0,.999998,401228e-16,0,0,.999997,2.22338e-10,0,0,.999995,1.0967e-9,0,0,.999991,4.82132e-9,0,0,.999981,1.89434e-8,0,0,.999967,6.67716e-8,0,0,.999938,2.12066e-7,0,0,.999886,6.0977e-7,0,0,.999792,159504e-11,0,0,.999608,381191e-11,0,0,.999209,833727e-11,0,0,.998179,165288e-10,0,0,.994605,274387e-10,0,0,.979468,167316e-10,0,0,.967529,242877e-11,0,0,.966836,461696e-11,0,0,.96569,830977e-11,0,0,.963706,140427e-10,0,244659e-11,.960063,217353e-10,0,760774e-9,.953113,286606e-10,0,.00367261,.940192,247691e-10,0,.00940263,.927731,195814e-10,0,.018333,.920669,252531e-10,0,.0306825,.911799,324277e-10,0,.0465556,.89857,340982e-10,0,.0659521,.883283,319622e-10,0,.0887677,.86989,35548e-9,0,.114784,.855483,397143e-10,0,.143618,.837987,391665e-10,0,.174606,.820546,411306e-10,0,.206349,.802878,436753e-10,0,.238095,.783402,444e-7,0,.269841,.763439,458726e-10,0,.301587,.742925,467097e-10,0,.333333,.721633,478887e-10,0,.365079,.69985,481251e-10,0,.396825,.67783,491811e-10,0,.428571,.655126,488199e-10,0,.460318,.632697,496025e-10,0,.492064,.609613,48829e-9,0,.52381,.587098,492754e-10,0,.555556,.564119,482625e-10,0,.587302,.541813,482807e-10,0,.619048,.519342,471552e-10,0,.650794,.497514,466765e-10,0,.68254,.475879,455582e-10,0,.714286,.454789,446007e-10,0,.746032,.434217,435382e-10,0,.777778,.414086,421753e-10,0,.809524,.394744,412093e-10,0,.84127,.375782,396634e-10,0,.873016,.357707,386419e-10,0,.904762,.340038,370345e-10,0,.936508,.323284,359725e-10,0,.968254,.306954,3436e-8,0,1,1,599567e-19,0,0,1,600497e-19,0,0,1,614839e-19,0,0,1,686641e-19,0,0,1,972658e-19,0,0,1,221271e-18,0,0,1,833195e-18,0,0,1,403601e-17,0,0,.999999,206001e-16,0,0,.999998,1.01739e-10,0,0,.999997,4.70132e-10,0,0,.999993,2.00436e-9,0,0,.999988,7.83682e-9,0,0,.999979,2.80338e-8,0,0,.999962,9.17033e-8,0,0,.999933,2.74514e-7,0,0,.999881,7.53201e-7,0,0,.999783,189826e-11,0,0,.999594,440279e-11,0,0,.999178,93898e-10,0,0,.998073,181265e-10,0,0,.993993,280487e-10,0,0,.979982,149422e-10,0,0,.968145,378481e-11,0,0,.966786,53771e-10,0,0,.965611,947508e-11,0,388934e-10,.963557,156616e-10,0,9693e-7,.959752,235144e-10,0,.00370329,.952461,291568e-10,0,.00868428,.940193,240102e-10,0,.0161889,.929042,231235e-10,0,.0263948,.920266,273968e-10,0,.0394088,.911178,337915e-10,0,.0552818,.897873,333629e-10,0,.0740138,.884053,351405e-10,0,.0955539,.869455,378034e-10,0,.119795,.854655,399378e-10,0,.14656,.838347,419108e-10,0,.175573,.820693,440831e-10,0,.206388,.802277,445599e-10,0,.238095,.783634,472691e-10,0,.269841,.763159,476984e-10,0,.301587,.742914,491487e-10,0,.333333,.721662,502312e-10,0,.365079,.699668,502817e-10,0,.396825,.677839,51406e-9,0,.428571,.655091,511095e-10,0,.460317,.632665,516067e-10,0,.492064,.609734,512255e-10,0,.52381,.587043,510263e-10,0,.555556,.564298,50565e-9,0,.587302,.541769,497951e-10,0,.619048,.519529,492698e-10,0,.650794,.497574,482066e-10,0,.68254,.476028,473689e-10,0,.714286,.454961,461941e-10,0,.746032,.434341,450618e-10,0,.777778,.414364,438355e-10,0,.809524,.394832,424196e-10,0,.84127,.376109,412563e-10,0,.873016,.35779,396226e-10,0,.904762,.340379,384886e-10,0,.936508,.323385,368214e-10,0,.968254,.307295,356636e-10,0,1,1,106465e-17,0,0,1,106555e-17,0,0,1,107966e-17,0,0,1,114601e-17,0,0,1,137123e-17,0,0,1,21243e-16,0,0,.999999,489653e-17,0,0,.999999,160283e-16,0,0,.999998,62269e-15,0,0,.999997,2.51859e-10,0,0,.999996,9.96192e-10,0,0,.999992,3.74531e-9,0,0,.999986,1.32022e-8,0,0,.999975,4.33315e-8,0,0,.999959,1.31956e-7,0,0,.999927,3.72249e-7,0,0,.999871,9.72461e-7,0,0,.999771,235343e-11,0,0,.999572,52768e-10,0,0,.999133,109237e-10,0,0,.997912,203675e-10,0,0,.993008,279396e-10,0,0,.980645,139604e-10,0,0,.970057,646596e-11,0,0,.966717,65089e-10,0,474145e-10,.965497,111863e-10,0,89544e-8,.96334,179857e-10,0,.0032647,.959294,259045e-10,0,.0075144,.951519,292327e-10,0,.0138734,.940517,249769e-10,0,.0224952,.93014,26803e-9,0,.0334828,.91972,303656e-10,0,.0468973,.910294,353323e-10,0,.0627703,.897701,351002e-10,0,.0811019,.884522,388104e-10,0,.10186,.869489,412932e-10,0,.124985,.853983,415781e-10,0,.150372,.838425,454066e-10,0,.177868,.820656,471624e-10,0,.207245,.801875,475243e-10,0,.238143,.783521,505621e-10,0,.269841,.763131,50721e-9,0,.301587,.74261,523293e-10,0,.333333,.72148,528699e-10,0,.365079,.699696,538677e-10,0,.396825,.677592,539255e-10,0,.428571,.65525,546367e-10,0,.460317,.632452,541348e-10,0,.492064,.609903,544976e-10,0,.52381,.586928,536201e-10,0,.555556,.564464,535185e-10,0,.587302,.541801,524949e-10,0,.619048,.519681,51812e-9,0,.650794,.497685,507687e-10,0,.68254,.47622,496243e-10,0,.714286,.455135,485714e-10,0,.746032,.4346,471847e-10,0,.777778,.414564,459294e-10,0,.809524,.395165,444705e-10,0,.84127,.376333,430772e-10,0,.873016,.358197,416229e-10,0,.904762,.34064,401019e-10,0,.936508,.323816,386623e-10,0,.968254,.307581,370933e-10,0,1,1,991541e-17,0,0,1,992077e-17,0,0,1,100041e-16,0,0,1,10385e-15,0,0,1,115777e-16,0,0,1,150215e-16,0,0,.999999,254738e-16,0,0,.999999,598822e-16,0,0,.999998,1.79597e-10,0,0,.999997,6.02367e-10,0,0,.999994,2.06835e-9,0,0,.99999,6.94952e-9,0,0,.999984,2.23363e-8,0,0,.999972,6.78578e-8,0,0,.999952,1.93571e-7,0,0,.999919,5.16594e-7,0,0,.99986,128739e-11,0,0,.999753,299298e-11,0,0,.999546,648258e-11,0,0,.999074,129985e-10,0,0,.997671,232176e-10,0,0,.991504,256701e-10,0,0,.981148,131141e-10,0,0,.971965,869048e-11,0,280182e-10,.966624,808301e-11,0,695475e-9,.965344,135235e-10,0,.00265522,.963048,210592e-10,0,.00622975,.958673,287473e-10,0,.0116234,.950262,281379e-10,0,.018976,.940836,271089e-10,0,.0283844,.930996,30926e-9,0,.0399151,.919848,348359e-10,0,.0536063,.909136,366092e-10,0,.0694793,.897554,384162e-10,0,.0875342,.884691,430971e-10,0,.107749,.869414,447803e-10,0,.130087,.853462,452858e-10,0,.154481,.838187,495769e-10,0,.180833,.820381,502709e-10,0,.209005,.801844,522713e-10,0,.238791,.783061,541505e-10,0,.269869,.763205,553712e-10,0,.301587,.742362,564909e-10,0,.333333,.721393,572646e-10,0,.365079,.699676,581012e-10,0,.396825,.677395,58096e-9,0,.428571,.655208,585766e-10,0,.460317,.632451,583602e-10,0,.492064,.609839,580234e-10,0,.52381,.587093,577161e-10,0,.555556,.564467,568447e-10,0,.587302,.542043,563166e-10,0,.619048,.519826,55156e-9,0,.650794,.497952,541682e-10,0,.68254,.476477,528971e-10,0,.714286,.455412,514952e-10,0,.746032,.434926,502222e-10,0,.777778,.4149,485779e-10,0,.809524,.395552,472242e-10,0,.84127,.376712,454891e-10,0,.873016,.358622,440924e-10,0,.904762,.341048,422984e-10,0,.936508,.324262,408582e-10,0,.968254,.308013,390839e-10,0,1,1,613913e-16,0,0,1,614145e-16,0,0,1,617708e-16,0,0,1,633717e-16,0,0,1,681648e-16,0,0,1,808291e-16,0,0,1,1.14608e-10,0,0,.999998,2.10507e-10,0,0,.999997,4.99595e-10,0,0,.999995,1.39897e-9,0,0,.999994,4.19818e-9,0,0,.999988,1.27042e-8,0,0,.999979,3.75153e-8,0,0,.999965,1.06206e-7,0,0,.999945,2.85381e-7,0,0,.999908,7.23611e-7,0,0,.999846,17255e-10,0,0,.999733,386104e-11,0,0,.999511,808493e-11,0,0,.998993,156884e-10,0,0,.997326,265538e-10,0,0,.989706,206466e-10,0,0,.981713,130756e-10,0,70005e-10,.973636,106473e-10,0,464797e-9,.966509,10194e-9,0,.00201743,.965149,165881e-10,0,.00497549,.962669,249147e-10,0,.00953262,.95786,317449e-10,0,.0158211,.949334,281045e-10,0,.0239343,.941041,303263e-10,0,.0339372,.931575,356754e-10,0,.0458738,.920102,397075e-10,0,.059772,.908002,384886e-10,0,.075645,.897269,43027e-9,0,.0934929,.884559,479925e-10,0,.113302,.869161,48246e-9,0,.135045,.853342,509505e-10,0,.158678,.837633,542846e-10,0,.184136,.820252,554139e-10,0,.211325,.801872,581412e-10,0,.240113,.782418,585535e-10,0,.270306,.7631,610923e-10,0,.301594,.742183,613678e-10,0,.333333,.721098,627275e-10,0,.365079,.699512,629413e-10,0,.396825,.677372,636351e-10,0,.428571,.655059,633555e-10,0,.460317,.632567,636513e-10,0,.492064,.609784,628965e-10,0,.52381,.587237,625546e-10,0,.555556,.564525,615825e-10,0,.587302,.542181,605048e-10,0,.619048,.520017,596329e-10,0,.650794,.498204,581516e-10,0,.68254,.476742,569186e-10,0,.714286,.455803,553833e-10,0,.746032,.435251,537807e-10,0,.777778,.415374,522025e-10,0,.809524,.395921,503421e-10,0,.84127,.377253,488211e-10,0,.873016,.359021,468234e-10,0,.904762,.341637,453269e-10,0,.936508,.3247,433014e-10,0,.968254,.308625,418007e-10,0,1,1,2.86798e-10,0,0,1,2.86877e-10,0,0,1,2.88094e-10,0,0,1,2.93506e-10,0,0,1,3.09262e-10,0,0,.999999,3.48593e-10,0,0,.999999,4.44582e-10,0,0,.999998,6.88591e-10,0,0,.999996,1.34391e-9,0,0,.999993,3.17438e-9,0,0,.999989,8.35609e-9,0,0,.999983,2.28677e-8,0,0,.999974,6.23361e-8,0,0,.999959,1.65225e-7,0,0,.999936,4.19983e-7,0,0,.999896,101546e-11,0,0,.99983,232376e-11,0,0,.999709,50156e-10,0,0,.999469,10167e-9,0,0,.998886,190775e-10,0,0,.996819,300511e-10,0,0,.988837,185092e-10,0,1.68222e-7,.982178,134622e-10,0,259622e-9,.975017,125961e-10,0,.00142595,.967101,13507e-9,0,.00382273,.964905,205003e-10,0,.00764164,.96218,29546e-9,0,.0130121,.956821,343738e-10,0,.0200253,.948829,305063e-10,0,.0287452,.941092,346487e-10,0,.039218,.931883,412061e-10,0,.0514748,.920211,444651e-10,0,.0655351,.907307,431252e-10,0,.0814082,.89684,490382e-10,0,.0990939,.884119,53334e-9,0,.118583,.869148,54114e-9,0,.139856,.853377,578536e-10,0,.162882,.836753,592285e-10,0,.187615,.820063,622787e-10,0,.213991,.801694,645492e-10,0,.241918,.782116,65353e-9,0,.271267,.762673,674344e-10,0,.301847,.742133,682788e-10,0,.333333,.720779,691959e-10,0,.365079,.699386,696817e-10,0,.396826,.67732,699583e-10,0,.428572,.654888,698447e-10,0,.460318,.632499,694063e-10,0,.492064,.609825,691612e-10,0,.52381,.587287,681576e-10,0,.555556,.564743,674138e-10,0,.587302,.542409,661617e-10,0,.619048,.520282,647785e-10,0,.650794,.498506,633836e-10,0,.68254,.477102,615905e-10,0,.714286,.456167,601013e-10,0,.746032,.435728,581457e-10,0,.777778,.415809,564215e-10,0,.809524,.396517,544997e-10,0,.84127,.377737,525061e-10,0,.873016,.359698,506831e-10,0,.904762,.342164,48568e-9,0,.936508,.325417,467826e-10,0,.968254,.309186,446736e-10,0,1,1,1.09018e-9,0,0,1,1.0904e-9,0,0,1,1.09393e-9,0,0,1,1.1095e-9,0,0,1,1.154e-9,0,0,1,1.26089e-9,0,0,.999999,1.5059e-9,0,0,.999997,2.07899e-9,0,0,.999994,3.48164e-9,0,0,.999993,7.05728e-9,0,0,.999987,1.63692e-8,0,0,.999981,4.06033e-8,0,0,.999969,1.0245e-7,0,0,.999953,2.55023e-7,0,0,.999925,6.1511e-7,0,0,.999881,142218e-11,0,0,.99981,313086e-11,0,0,.99968,653119e-11,0,0,.999418,12832e-9,0,0,.998748,232497e-10,0,0,.996066,329522e-10,0,0,.988379,179613e-10,0,108799e-9,.982567,143715e-10,0,921302e-9,.976097,148096e-10,0,.00280738,.968475,178905e-10,0,.00596622,.964606,253921e-10,0,.0105284,.961564,348623e-10,0,.0165848,.955517,357612e-10,0,.0242,.948381,343493e-10,0,.03342,.941095,405849e-10,0,.0442777,.931923,475394e-10,0,.0567958,.91996,484328e-10,0,.0709879,.907419,502146e-10,0,.086861,.89618,561654e-10,0,.104415,.88337,587612e-10,0,.123643,.869046,618057e-10,0,.144531,.853278,657392e-10,0,.167057,.836091,66303e-9,0,.191188,.819644,704445e-10,0,.216878,.801246,714071e-10,0,.244062,.782031,740093e-10,0,.272649,.762066,74685e-9,0,.302509,.741964,766647e-10,0,.333442,.720554,766328e-10,0,.365079,.699098,777857e-10,0,.396826,.677189,774633e-10,0,.428572,.65484,776235e-10,0,.460318,.632496,770316e-10,0,.492064,.609908,762669e-10,0,.52381,.587312,753972e-10,0,.555556,.564938,739994e-10,0,.587302,.542577,728382e-10,0,.619048,.52062,71112e-9,0,.650794,.498819,694004e-10,0,.68254,.477555,675575e-10,0,.714286,.456568,653449e-10,0,.746032,.436278,636068e-10,0,.777778,.41637,613466e-10,0,.809524,.397144,594177e-10,0,.84127,.378412,570987e-10,0,.873016,.360376,550419e-10,0,.904762,.342906,527422e-10,0,.936508,.326136,506544e-10,0,.968254,.30997,484307e-10,0,1,1,3.54014e-9,0,0,1,3.54073e-9,0,0,1,3.54972e-9,0,0,1,3.58929e-9,0,0,1,3.70093e-9,0,0,.999999,3.96194e-9,0,0,.999998,4.53352e-9,0,0,.999997,5.78828e-9,0,0,.999994,8.63812e-9,0,0,.999991,1.53622e-8,0,0,.999985,3.16356e-8,0,0,.999977,7.12781e-8,0,0,.999964,1.66725e-7,0,0,.999945,3.90501e-7,0,0,.999912,8.95622e-7,0,0,.999866,198428e-11,0,0,.999786,421038e-11,0,0,.999647,850239e-11,0,0,.999356,162059e-10,0,0,.998563,282652e-10,0,0,.994928,336309e-10,0,244244e-10,.987999,178458e-10,0,523891e-9,.982893,159162e-10,0,.00194729,.977044,178056e-10,0,.00451099,.969972,230624e-10,0,.00835132,.964237,313922e-10,0,.013561,.960791,406145e-10,0,.0202056,.954292,372796e-10,0,.0283321,.948052,403199e-10,0,.0379739,.940938,479537e-10,0,.0491551,.931689,545292e-10,0,.0618918,.91987,54038e-9,0,.0761941,.907665,589909e-10,0,.0920672,.895281,642651e-10,0,.109511,.882621,659707e-10,0,.12852,.86873,709973e-10,0,.149085,.853008,742221e-10,0,.171189,.835944,761754e-10,0,.194809,.818949,797052e-10,0,.21991,.800951,812434e-10,0,.246447,.781847,838075e-10,0,.274352,.761649,84501e-9,0,.303535,.74152,860258e-10,0,.333857,.720495,866233e-10,0,.365104,.698742,868326e-10,0,.396826,.677096,87133e-9,0,.428572,.654782,863497e-10,0,.460318,.632335,860206e-10,0,.492064,.610031,849337e-10,0,.52381,.587457,838279e-10,0,.555556,.56513,82309e-9,0,.587302,.542877,803542e-10,0,.619048,.5209,786928e-10,0,.650794,.499291,765171e-10,0,.68254,.477971,744753e-10,0,.714286,.457221,72209e-9,0,.746032,.436803,697448e-10,0,.777778,.417083,675333e-10,0,.809524,.397749,648058e-10,0,.84127,.379177,625759e-10,0,.873016,.361061,598584e-10,0,.904762,.343713,575797e-10,0,.936508,.326894,549999e-10,0,.968254,.310816,527482e-10,0,1,1,1.0153e-8,0,0,1,1.01544e-8,0,0,1,1.01751e-8,0,0,1,1.02662e-8,0,0,1,1.0521e-8,0,0,.999999,1.11049e-8,0,0,.999999,1.23408e-8,0,0,.999996,1.4924e-8,0,0,.999992,2.04471e-8,0,0,.999989,3.26539e-8,0,0,.99998,6.03559e-8,0,0,.999971,1.23936e-7,0,0,.999955,2.69058e-7,0,0,.999933,5.93604e-7,0,0,.999901,129633e-11,0,0,.999847,275621e-11,0,0,.999761,564494e-11,0,0,.999607,110485e-10,0,0,.999282,204388e-10,0,0,.99831,341084e-10,0,2.2038e-7,.993288,294949e-10,0,242388e-9,.987855,192736e-10,0,.0012503,.983167,182383e-10,0,.0032745,.977908,218633e-10,0,.00646321,.971194,290662e-10,0,.0109133,.963867,386401e-10,0,.0166927,.95982,462827e-10,0,.0238494,.953497,420705e-10,0,.0324178,.947621,477743e-10,0,.0424225,.940611,568258e-10,0,.0538808,.931174,618061e-10,0,.0668047,.919919,627098e-10,0,.0812014,.907856,694714e-10,0,.0970745,.894509,735008e-10,0,.114424,.881954,763369e-10,0,.133246,.868309,821896e-10,0,.153534,.852511,83769e-9,0,.175275,.835821,881615e-10,0,.198453,.817981,896368e-10,0,.223042,.800504,930906e-10,0,.249009,.78141,945056e-10,0,.276304,.761427,963605e-10,0,.304862,.74094,968088e-10,0,.334584,.720233,981481e-10,0,.365322,.698592,979122e-10,0,.396826,.676763,981057e-10,0,.428571,.654808,973956e-10,0,.460318,.632326,962619e-10,0,.492064,.610049,952996e-10,0,.52381,.58763,933334e-10,0,.555556,.565261,917573e-10,0,.587302,.543244,896636e-10,0,.619048,.521273,873304e-10,0,.650794,.499818,852648e-10,0,.68254,.478536,823961e-10,0,.714286,.457826,79939e-9,0,.746032,.437549,77126e-9,0,.777778,.41776,743043e-10,0,.809524,.39863,716426e-10,0,.84127,.379954,686456e-10,0,.873016,.362025,660514e-10,0,.904762,.344581,630755e-10,0,.936508,.327909,605439e-10,0,.968254,.311736,576345e-10,0,1,1,2.63344e-8,0,0,1,2.63373e-8,0,0,1,2.63815e-8,0,0,1,2.65753e-8,0,0,1,2.71132e-8,0,0,.999999,2.83279e-8,0,0,.999997,3.0833e-8,0,0,.999995,3.58711e-8,0,0,.999992,4.61266e-8,0,0,.999985,6.7574e-8,0,0,.999977,1.1358e-7,0,0,.999966,2.13657e-7,0,0,.999948,4.31151e-7,0,0,.999923,8.96656e-7,0,0,.999884,186603e-11,0,0,.999826,381115e-11,0,0,.999732,754184e-11,0,0,.999561,143192e-10,0,0,.999191,257061e-10,0,0,.997955,405724e-10,0,744132e-10,.992228,276537e-10,0,716477e-9,.987638,208885e-10,0,.0022524,.983395,215226e-10,0,.00484816,.978614,270795e-10,0,.00860962,.972389,365282e-10,0,.0136083,.964392,474747e-10,0,.0198941,.95861,509141e-10,0,.0275023,.952806,48963e-9,0,.0364584,.94712,571119e-10,0,.04678,.940104,671704e-10,0,.0584799,.930398,687586e-10,0,.0715665,.919866,738161e-10,0,.086045,.907853,813235e-10,0,.101918,.894078,834582e-10,0,.119186,.881177,892093e-10,0,.137845,.867575,944548e-10,0,.157891,.852107,969607e-10,0,.179316,.835502,101456e-9,0,.202106,.81756,103256e-9,0,.226243,.79984,106954e-9,0,.251704,.780998,108066e-9,0,.278451,.761132,110111e-9,0,.306436,.740429,110459e-9,0,.335586,.719836,111219e-9,0,.365796,.698467,11145e-8,0,.3969,.676446,110393e-9,0,.428571,.654635,110035e-9,0,.460318,.632411,108548e-9,0,.492064,.609986,106963e-9,0,.52381,.587872,105238e-9,0,.555556,.565528,102665e-9,0,.587302,.543563,100543e-9,0,.619048,.52176,976182e-10,0,.650794,.500188,947099e-10,0,.68254,.479204,919929e-10,0,.714286,.458413,886139e-10,0,.746032,.438314,857839e-10,0,.777778,.418573,82411e-9,0,.809524,.39947,792211e-10,0,.84127,.380892,759546e-10,0,.873016,.362953,727571e-10,0,.904762,.345601,695738e-10,0,.936508,.328895,664907e-10,0,.968254,.312808,634277e-10,0,1,1,6.28647e-8,0,0,1,6.28705e-8,0,0,1,6.29587e-8,0,0,1,6.33441e-8,0,0,.999999,6.44087e-8,0,0,.999998,6.67856e-8,0,0,.999997,7.15889e-8,0,0,.999995,8.09577e-8,0,0,.999989,9.92764e-8,0,0,.999983,1.35834e-7,0,0,.999974,2.10482e-7,0,0,.999959,3.65215e-7,0,0,.999939,6.86693e-7,0,0,.999911,13472e-10,0,0,.999868,26731e-10,0,0,.999804,524756e-11,0,0,.9997,100403e-10,0,0,.99951,185019e-10,0,0,.999078,322036e-10,0,620676e-11,.997428,470002e-10,0,341552e-9,.99162,287123e-10,0,.00143727,.987479,234706e-10,0,.00349201,.983582,260083e-10,0,.0066242,.979186,337927e-10,0,.0109113,.97325,454689e-10,0,.0164064,.965221,573759e-10,0,.0231463,.957262,544114e-10,0,.0311571,.952211,587006e-10,0,.0404572,.946631,692256e-10,0,.0510592,.939391,787819e-10,0,.0629723,.929795,792368e-10,0,.0762025,.91965,875075e-10,0,.090753,.907737,950903e-10,0,.106626,.893899,972963e-10,0,.123822,.880239,10459e-8,0,.142337,.866562,107689e-9,0,.16217,.85164,113081e-9,0,.183314,.835021,116636e-9,0,.20576,.817311,120074e-9,0,.229496,.798845,121921e-9,0,.254502,.780479,12475e-8,0,.280753,.760694,125255e-9,0,.308212,.740142,126719e-9,0,.336825,.719248,12636e-8,0,.366517,.698209,126712e-9,0,.397167,.676398,125769e-9,0,.428578,.654378,124432e-9,0,.460318,.632484,123272e-9,0,.492064,.610113,12085e-8,0,.52381,.587931,118411e-9,0,.555556,.565872,11569e-8,0,.587302,.543814,112521e-9,0,.619048,.522265,109737e-9,0,.650794,.500835,106228e-9,0,.68254,.479818,102591e-9,0,.714286,.459258,991288e-10,0,.746032,.439061,952325e-10,0,.777778,.419552,91895e-9,0,.809524,.400399,879051e-10,0,.84127,.381976,844775e-10,0,.873016,.364009,806316e-10,0,.904762,.346761,771848e-10,0,.936508,.330049,735429e-10,0,.968254,.314018,702103e-10,0,1,1,1.39968e-7,0,0,1,1.39979e-7,0,0,1,1.40145e-7,0,0,1,1.4087e-7,0,0,.999999,1.42865e-7,0,0,.999998,1.47279e-7,0,0,.999997,1.56057e-7,0,0,.999992,1.7276e-7,0,0,.999989,2.04352e-7,0,0,.99998,2.6494e-7,0,0,.999969,3.83435e-7,0,0,.999953,6.18641e-7,0,0,.999929,108755e-11,0,0,.999898,201497e-11,0,0,.999849,381346e-11,0,0,.999778,719815e-11,0,0,.999661,133215e-10,0,0,.999451,238313e-10,0,0,.998936,401343e-10,0,113724e-9,.99662,517346e-10,0,820171e-9,.991094,304323e-10,0,.00238143,.987487,281757e-10,0,.00493527,.983731,320048e-10,0,.00856859,.979647,423905e-10,0,.0133393,.973837,562935e-10,0,.0192863,.96584,677442e-10,0,.0264369,.956309,623073e-10,0,.03481,.951523,704131e-10,0,.0444184,.946003,836594e-10,0,.0552713,.938454,911736e-10,0,.0673749,.929279,938264e-10,0,.0807329,.919239,103754e-9,0,.0953479,.907293,109928e-9,0,.111221,.893936,115257e-9,0,.128352,.879674,122265e-9,0,.14674,.865668,125733e-9,0,.166382,.850998,132305e-9,0,.187276,.834498,134844e-9,0,.209413,.816903,139276e-9,0,.232786,.798235,140984e-9,0,.257382,.779724,14378e-8,0,.283181,.760251,144623e-9,0,.310156,.739808,145228e-9,0,.338269,.718762,14539e-8,0,.367461,.697815,144432e-9,0,.397646,.67631,143893e-9,0,.428685,.654278,141846e-9,0,.460318,.632347,13935e-8,0,.492064,.610296,137138e-9,0,.52381,.588039,133806e-9,0,.555556,.566218,130755e-9,0,.587302,.544346,127128e-9,0,.619048,.522701,123002e-9,0,.650794,.501542,119443e-9,0,.68254,.480508,115055e-9,0,.714286,.460092,111032e-9,0,.746032,.440021,106635e-9,0,.777778,.420446,102162e-9,0,.809524,.401512,98184e-9,0,.84127,.38299,936497e-10,0,.873016,.365232,89813e-9,0,.904762,.347865,853073e-10,0,.936508,.331342,817068e-10,0,.968254,.315202,773818e-10,0,1,1,2.9368e-7,0,0,1,2.937e-7,0,0,1,2.93998e-7,0,0,1,2.95298e-7,0,0,.999999,2.98865e-7,0,0,.999998,3.067e-7,0,0,.999995,3.22082e-7,0,0,.999992,3.50767e-7,0,0,.999986,4.03538e-7,0,0,.999976,5.01372e-7,0,0,.999964,6.8562e-7,0,0,.999945,10374e-10,0,0,.999919,171269e-11,0,0,.999882,300175e-11,0,0,.999829,542144e-11,0,0,.999749,984182e-11,0,0,.99962,176213e-10,0,0,.999382,305995e-10,0,138418e-10,.998751,496686e-10,0,389844e-9,.995344,510733e-10,0,.00150343,.990768,345829e-10,0,.00352451,.987464,342841e-10,0,.00655379,.983846,399072e-10,0,.0106554,.980007,533219e-10,0,.0158723,.974494,696992e-10,0,.0222333,.96622,776754e-10,0,.029758,.956273,747718e-10,0,.0384596,.950952,864611e-10,0,.0483473,.945215,100464e-9,0,.0594266,.937287,103729e-9,0,.0717019,.928649,111665e-9,0,.0851752,.918791,12353e-8,0,.0998479,.906685,127115e-9,0,.115721,.893706,13628e-8,0,.132794,.879248,142427e-9,0,.151067,.864685,148091e-9,0,.170538,.850032,153517e-9,0,.191204,.833853,157322e-9,0,.213063,.816353,161086e-9,0,.236107,.797834,164111e-9,0,.260329,.778831,165446e-9,0,.285714,.759756,167492e-9,0,.312243,.739419,166928e-9,0,.339887,.718491,167e-6,0,.368604,.697392,165674e-9,0,.398329,.676102,163815e-9,0,.428961,.654243,162003e-9,0,.460331,.632176,158831e-9,0,.492064,.610407,155463e-9,0,.52381,.588394,152062e-9,0,.555556,.56645,147665e-9,0,.587302,.5449,14375e-8,0,.619048,.523276,138905e-9,0,.650794,.502179,134189e-9,0,.68254,.481359,129392e-9,0,.714286,.46092,124556e-9,0,.746032,.441084,11957e-8,0,.777778,.421517,114652e-9,0,.809524,.402721,109688e-9,0,.84127,.384222,104667e-9,0,.873016,.366534,999633e-10,0,.904762,.349205,950177e-10,0,.936508,.332702,907301e-10,0,.968254,.316599,859769e-10,0,1,1,5.85473e-7,0,0,1,5.85507e-7,0,0,1,5.8602e-7,0,0,.999999,5.88259e-7,0,0,.999999,5.94381e-7,0,0,.999998,6.07754e-7,0,0,.999995,6.33729e-7,0,0,.99999,6.8137e-7,0,0,.999984,7.67003e-7,0,0,.999973,9.21212e-7,0,0,.999959,120218e-11,0,0,.999936,172024e-11,0,0,.999907,268088e-11,0,0,.999866,445512e-11,0,0,.999806,768481e-11,0,0,.999716,1342e-8,0,0,.999576,232473e-10,0,0,.9993,391694e-10,0,129917e-9,.998498,608429e-10,0,845035e-9,.994132,489743e-10,0,.00237616,.99031,384644e-10,0,.00484456,.987409,421768e-10,0,.00832472,.983981,504854e-10,0,.0128643,.980268,671028e-10,0,.0184947,.974875,852749e-10,0,.025237,.966063,85531e-9,0,.0331046,.956779,900588e-10,0,.0421067,.950259,10577e-8,0,.0522487,.944239,119458e-9,0,.0635343,.936341,122164e-9,0,.0759654,.928047,134929e-9,0,.0895434,.918065,145544e-9,0,.104269,.906267,150531e-9,0,.120142,.893419,161652e-9,0,.137163,.878758,16593e-8,0,.15533,.863699,174014e-9,0,.174645,.848876,177877e-9,0,.195106,.833032,184049e-9,0,.21671,.815557,186088e-9,0,.239454,.797323,19054e-8,0,.263332,.778124,191765e-9,0,.288336,.758929,192535e-9,0,.314451,.738979,192688e-9,0,.341658,.718213,191522e-9,0,.369924,.696947,190491e-9,0,.399202,.675807,187913e-9,0,.429416,.654147,184451e-9,0,.460447,.63229,181442e-9,0,.492064,.610499,177139e-9,0,.523809,.588747,172596e-9,0,.555555,.566783,167457e-9,0,.587301,.545359,162518e-9,0,.619048,.523984,156818e-9,0,.650794,.502917,151884e-9,0,.68254,.482294,145514e-9,0,.714286,.461945,140199e-9,0,.746032,.442133,134101e-9,0,.777778,.422705,128374e-9,0,.809524,.403916,122996e-9,0,.84127,.38554,116808e-9,0,.873016,.367909,111973e-9,0,.904762,.350651,105938e-9,0,.936508,.334208,101355e-9,0,.968254,.318123,957629e-10,0,1,1,111633e-11,0,0,1,111639e-11,0,0,1,111725e-11,0,0,1,112096e-11,0,0,.999999,11311e-10,0,0,.999997,115315e-11,0,0,.999995,11956e-10,0,0,.999989,127239e-11,0,0,.999981,140772e-11,0,0,.999969,164541e-11,0,0,.999952,206607e-11,0,0,.999928,281783e-11,0,0,.999895,416835e-11,0,0,.999848,658728e-11,0,0,.999781,108648e-10,0,0,.999682,182579e-10,0,0,.999523,306003e-10,0,159122e-10,.999205,499862e-10,0,391184e-9,.998131,73306e-9,0,.00147534,.993334,513229e-10,0,.0034227,.99016,467783e-10,0,.00632232,.987321,523413e-10,0,.0102295,.984099,64267e-9,0,.0151794,.980432,843042e-10,0,.0211947,.974976,102819e-9,0,.0282899,.966429,996234e-10,0,.0364739,.957633,111074e-9,0,.0457522,.949422,128644e-9,0,.0561278,.943045,140076e-9,0,.0676023,.935448,146349e-9,0,.0801762,.927225,161854e-9,0,.0938499,.917033,169135e-9,0,.108623,.905762,179987e-9,0,.124496,.892879,189832e-9,0,.141469,.878435,195881e-9,0,.159541,.863114,20466e-8,0,.178713,.84776,209473e-9,0,.198985,.832084,214861e-9,0,.220355,.814915,217695e-9,0,.242823,.796711,220313e-9,0,.266385,.777603,22313e-8,0,.291036,.757991,222471e-9,0,.316767,.738371,222869e-9,0,.343563,.717872,221243e-9,0,.371402,.696619,218089e-9,0,.400248,.675379,21562e-8,0,.430047,.65411,21169e-8,0,.460709,.63241,206947e-9,0,.492079,.61046,201709e-9,0,.52381,.58903,196753e-9,0,.555556,.567267,189637e-9,0,.587302,.545886,184735e-9,0,.619048,.524714,177257e-9,0,.650794,.503789,171424e-9,0,.68254,.483204,164688e-9,0,.714286,.462976,157172e-9,0,.746032,.443294,151341e-9,0,.777778,.423988,143737e-9,0,.809524,.405325,138098e-9,0,.84127,.386981,130698e-9,0,.873016,.369436,125276e-9,0,.904762,.35219,118349e-9,0,.936508,.335804,11312e-8,0,.968254,.319749,106687e-9,0,1,1,204685e-11,0,0,1,204694e-11,0,0,1,204831e-11,0,0,.999999,205428e-11,0,0,.999999,207056e-11,0,0,.999997,210581e-11,0,0,.999993,21732e-10,0,0,.999987,229365e-11,0,0,.999979,250243e-11,0,0,.999965,286127e-11,0,0,.999947,348028e-11,0,0,.999918,455588e-11,0,0,.999881,643303e-11,0,0,.999828,970064e-11,0,0,.999753,153233e-10,0,0,.999642,24793e-9,0,0,.999464,402032e-10,0,122947e-9,.999089,635852e-10,0,807414e-9,.997567,857026e-10,0,.00227206,.992903,594912e-10,0,.00462812,.990011,578515e-10,0,.00794162,.987192,65399e-9,0,.0122534,.98418,819675e-10,0,.0175888,.980491,105514e-9,0,.0239635,.974779,121532e-9,0,.031387,.96675,119144e-9,0,.0398644,.958248,136125e-9,0,.0493982,.948884,155408e-9,0,.0599896,.941673,162281e-9,0,.0716382,.934521,176754e-9,0,.0843437,.926205,192873e-9,0,.0981056,.916089,200038e-9,0,.112923,.904963,213624e-9,0,.128796,.892089,221834e-9,0,.145725,.878028,232619e-9,0,.163709,.86249,238632e-9,0,.182749,.846587,247002e-9,0,.202847,.830988,250702e-9,0,.224001,.814165,255562e-9,0,.246214,.796135,257505e-9,0,.269482,.777052,258625e-9,0,.293805,.757201,258398e-9,0,.319176,.737655,256714e-9,0,.345587,.717477,255187e-9,0,.373021,.696433,251792e-9,0,.401454,.675084,247223e-9,0,.430844,.653907,242213e-9,0,.461125,.632561,237397e-9,0,.492187,.610658,229313e-9,0,.52381,.589322,224402e-9,0,.555556,.567857,216116e-9,0,.587302,.54652,209124e-9,0,.619048,.525433,201601e-9,0,.650794,.504679,192957e-9,0,.68254,.484203,186052e-9,0,.714286,.464203,177672e-9,0,.746032,.444549,170005e-9,0,.777778,.425346,162401e-9,0,.809524,.406706,1544e-7,0,.84127,.388576,147437e-9,0,.873016,.37094,139493e-9,0,.904762,.353996,133219e-9,0,.936508,.337391,125573e-9,0,.968254,.321648,119867e-9,0,1,1,362511e-11,0,0,1,362525e-11,0,0,1,362739e-11,0,0,.999999,363673e-11,0,0,.999998,366214e-11,0,0,.999996,371698e-11,0,0,.999992,382116e-11,0,0,.999986,400554e-11,0,0,.999976,432058e-11,0,0,.999961,485194e-11,0,0,.999938,574808e-11,0,0,.999908,726643e-11,0,0,.999865,984707e-11,0,0,.999807,142217e-10,0,0,.999723,215581e-10,0,0,.999602,336114e-10,0,119113e-10,.999398,527353e-10,0,355813e-9,.998946,805809e-10,0,.00137768,.996647,942908e-10,0,.00322469,.992298,668733e-10,0,.00597897,.989802,716564e-10,0,.00968903,.987019,821355e-10,0,.0143845,.984219,104555e-9,0,.0200831,.980425,131245e-9,0,.0267948,.974241,139613e-9,0,.034525,.967006,145931e-9,0,.0432757,.95893,167153e-9,0,.0530471,.949157,188146e-9,0,.0638386,.94062,194625e-9,0,.0756487,.933509,213721e-9,0,.0884762,.925088,229616e-9,0,.10232,.915178,239638e-9,0,.117178,.904093,254814e-9,0,.133051,.891337,263685e-9,0,.149939,.877326,274789e-9,0,.167841,.861794,280534e-9,0,.18676,.845758,289534e-9,0,.206696,.829792,294446e-9,0,.22765,.813037,296877e-9,0,.249625,.795285,300217e-9,0,.27262,.776323,299826e-9,0,.296636,.756673,299787e-9,0,.321671,.736856,297867e-9,0,.347718,.716883,294052e-9,0,.374768,.696089,289462e-9,0,.402804,.67505,285212e-9,0,.431796,.653509,27653e-8,0,.461695,.63258,271759e-9,0,.49242,.61104,262811e-9,0,.523822,.589567,255151e-9,0,.555556,.568322,246434e-9,0,.587302,.547235,237061e-9,0,.619048,.52616,228343e-9,0,.650794,.505716,219236e-9,0,.68254,.485274,209595e-9,0,.714286,.465411,201011e-9,0,.746032,.445854,19109e-8,0,.777778,.426911,182897e-9,0,.809524,.408222,173569e-9,0,.84127,.390307,165496e-9,0,.873016,.372624,156799e-9,0,.904762,.355804,14917e-8,0,.936508,.33924,140907e-9,0,.968254,.323534,134062e-9,0,1,1,622487e-11,0,0,1,62251e-10,0,0,1,622837e-11,0,0,.999999,624259e-11,0,0,.999998,628127e-11,0,0,.999996,636451e-11,0,0,.999991,65218e-10,0,0,.999984,679782e-11,0,0,.999973,726361e-11,0,0,.999955,803644e-11,0,0,.999931,931397e-11,0,0,.999896,114299e-10,0,0,.999847,149402e-10,0,0,.999784,207461e-10,0,0,.999692,302493e-10,0,0,.999554,454957e-10,0,997275e-10,.999326,690762e-10,0,724813e-9,.998757,101605e-9,0,.0020972,.995367,958745e-10,0,.00432324,.99209,832808e-10,0,.00746347,.989517,887601e-10,0,.0115534,.987008,10564e-8,0,.0166134,.98421,133179e-9,0,.0226552,.98021,161746e-9,0,.0296838,.973676,161821e-9,0,.0377016,.967052,178635e-9,0,.0467079,.959385,206765e-9,0,.0567013,.949461,22476e-8,0,.0676796,.939578,23574e-8,0,.0796403,.932416,25893e-8,0,.0925812,.923759,271228e-9,0,.106501,.914223,289165e-9,0,.121397,.902942,301156e-9,0,.13727,.890419,313852e-9,0,.15412,.876639,324408e-9,0,.171946,.861316,33249e-8,0,.190751,.84496,338497e-9,0,.210537,.828427,345861e-9,0,.231305,.811871,347863e-9,0,.253057,.794397,350225e-9,0,.275797,.775726,349915e-9,0,.299525,.75617,347297e-9,0,.324242,.736091,344232e-9,0,.349947,.716213,340835e-9,0,.376633,.695736,332369e-9,0,.404289,.674961,327943e-9,0,.432895,.653518,318533e-9,0,.462415,.632574,310391e-9,0,.492788,.61134,300755e-9,0,.523909,.590017,290506e-9,0,.555556,.568752,280446e-9,0,.587302,.548061,269902e-9,0,.619048,.52711,258815e-9,0,.650794,.506682,248481e-9,0,.68254,.486524,237141e-9,0,.714286,.466812,226872e-9,0,.746032,.44732,216037e-9,0,.777778,.428473,205629e-9,0,.809524,.409921,195691e-9,0,.84127,.392028,185457e-9,0,.873016,.374606,176436e-9,0,.904762,.357601,166508e-9,0,.936508,.341348,158385e-9,0,.968254,.32542,149203e-9,0,1,1,103967e-10,0,0,1,10397e-9,0,0,1,104019e-10,0,0,.999999,104231e-10,0,0,.999998,104806e-10,0,0,.999995,106042e-10,0,0,.999991,108366e-10,0,0,.999982,112415e-10,0,0,.999968,119174e-10,0,0,.99995,130227e-10,0,0,.999922,148176e-10,0,0,.999884,177303e-10,0,0,.99983,224564e-10,0,0,.999758,300966e-10,0,0,.999654,423193e-10,0,549083e-11,.999503,614848e-10,0,296087e-9,.999237,903576e-10,0,.00123144,.998491,1271e-7,0,.00295954,.994594,107754e-9,0,.00555829,.99178,103025e-9,0,.00907209,.989265,11154e-8,0,.0135257,.986998,136296e-9,0,.0189327,.984137,169154e-9,0,.0252993,.979798,196671e-9,0,.0326272,.97337,196678e-9,0,.0409157,.967239,223121e-9,0,.0501623,.959543,253809e-9,0,.0603638,.949466,265972e-9,0,.0715171,.939074,288372e-9,0,.0836187,.931118,310983e-9,0,.0966657,.922525,325561e-9,0,.110656,.912983,345725e-9,0,.125588,.901617,3556e-7,0,.141461,.889487,374012e-9,0,.158275,.875787,383445e-9,0,.176031,.860654,393972e-9,0,.19473,.844417,400311e-9,0,.214374,.82741,405004e-9,0,.234967,.810545,407378e-9,0,.256512,.793312,407351e-9,0,.279011,.774847,406563e-9,0,.302468,.755621,404903e-9,0,.326887,.735511,397486e-9,0,.352266,.715435,39357e-8,0,.378605,.695403,384739e-9,0,.405897,.674681,376108e-9,0,.43413,.65359,365997e-9,0,.463277,.632471,354957e-9,0,.493295,.61151,343593e-9,0,.524106,.59064,331841e-9,0,.555561,.569386,318891e-9,0,.587302,.548785,3072e-7,0,.619048,.528146,29361e-8,0,.650794,.507872,281709e-9,0,.68254,.487805,268627e-9,0,.714286,.468196,255887e-9,0,.746032,.448922,243997e-9,0,.777778,.430093,231662e-9,0,.809524,.411845,220339e-9,0,.84127,.393808,208694e-9,0,.873016,.376615,198045e-9,0,.904762,.359655,187375e-9,0,.936508,.343452,177371e-9,0,.968254,.32765,167525e-9,0,1,1,169351e-10,0,0,1,169356e-10,0,0,1,169427e-10,0,0,.999999,169736e-10,0,0,.999998,170575e-10,0,0,.999995,172372e-10,0,0,.99999,175739e-10,0,0,.999979,181568e-10,0,0,.999966,191206e-10,0,0,.999944,20677e-9,0,0,.999912,231644e-10,0,0,.999869,271268e-10,0,0,.999811,334272e-10,0,0,.99973,433979e-10,0,0,.999617,590083e-10,0,680315e-10,.999445,829497e-10,0,612796e-9,.999138,118019e-9,0,.00187408,.998095,156712e-9,0,.00395791,.993919,125054e-9,0,.00692144,.991333,126091e-9,0,.0107962,.989226,144912e-9,0,.0155986,.986954,175737e-9,0,.0213364,.983982,213883e-9,0,.0280114,.979128,234526e-9,0,.0356226,.973327,243725e-9,0,.0441668,.967416,2773e-7,0,.0536399,.959729,308799e-9,0,.0640376,.949758,322447e-9,0,.0753554,.939173,350021e-9,0,.0875893,.9296,370089e-9,0,.100736,.921181,391365e-9,0,.114793,.91164,413636e-9,0,.129759,.900435,427068e-9,0,.145632,.888183,441046e-9,0,.162412,.874772,454968e-9,0,.180101,.859566,461882e-9,0,.1987,.843579,471556e-9,0,.218213,.826453,474335e-9,0,.238641,.809164,477078e-9,0,.259989,.792179,47755e-8,0,.282262,.773866,472573e-9,0,.305464,.754944,469765e-9,0,.329599,.735133,462371e-9,0,.35467,.714858,453674e-9,0,.380678,.694829,443888e-9,0,.407622,.674453,432052e-9,0,.435493,.653685,420315e-9,0,.464275,.632666,406829e-9,0,.493938,.611676,392234e-9,0,.524422,.591193,379208e-9,0,.555624,.570145,36319e-8,0,.587302,.549566,349111e-9,0,.619048,.529278,334166e-9,0,.650794,.509026,318456e-9,0,.68254,.489186,30449e-8,0,.714286,.469662,289051e-9,0,.746032,.450691,275494e-9,0,.777778,.431841,261437e-9,0,.809524,.413752,247846e-9,0,.84127,.395951,235085e-9,0,.873016,.378633,222245e-9,0,.904762,.36194,210533e-9,0,.936508,.345599,198494e-9,0,.968254,.329999,188133e-9,0,1,1,269663e-10,0,0,1,26967e-9,0,0,1,269772e-10,0,0,.999999,270214e-10,0,0,.999998,271415e-10,0,0,.999994,27398e-9,0,0,.999988,278771e-10,0,0,.999977,287019e-10,0,0,.999961,300544e-10,0,0,.999937,322138e-10,0,0,.999904,356163e-10,0,0,.999854,409465e-10,0,0,.99979,492651e-10,0,0,.999699,621722e-10,0,8.8288e-7,.999572,819715e-10,0,223369e-9,.999381,111689e-9,0,.00105414,.999016,153862e-9,0,.0026493,.997437,187667e-9,0,.00508608,.993545,155672e-9,0,.00840554,.991135,161455e-9,0,.012629,.989157,188241e-9,0,.0177661,.986874,226229e-9,0,.0238198,.983714,268668e-9,0,.0307887,.978301,277109e-9,0,.0386688,.973227,303446e-9,0,.0474554,.967317,341851e-9,0,.0571428,.959477,370885e-9,0,.0677256,.950012,392753e-9,0,.0791988,.939484,42781e-8,0,.0915576,.928135,443866e-9,0,.104798,.919819,472959e-9,0,.118918,.910049,491551e-9,0,.133915,.899181,512616e-9,0,.149788,.886881,523563e-9,0,.166537,.87359,540183e-9,0,.184164,.858613,547386e-9,0,.202669,.842809,554809e-9,0,.222056,.825727,558316e-9,0,.242329,.808086,557824e-9,0,.263492,.790728,556346e-9,0,.285551,.772987,552672e-9,0,.30851,.7541,543738e-9,0,.332376,.734669,536107e-9,0,.357153,.714411,523342e-9,0,.382845,.694196,512238e-9,0,.409454,.674252,497465e-9,0,.436977,.65357,481096e-9,0,.465404,.632999,467054e-9,0,.494713,.611994,448771e-9,0,.524864,.591604,431889e-9,0,.555779,.571134,415238e-9,0,.587302,.550528,396369e-9,0,.619048,.530292,379477e-9,0,.650794,.510364,361488e-9,0,.68254,.490749,343787e-9,0,.714286,.471266,327822e-9,0,.746032,.452462,310626e-9,0,.777778,.433907,295352e-9,0,.809524,.415659,279179e-9,0,.84127,.398138,264685e-9,0,.873016,.380833,249905e-9,0,.904762,.364247,236282e-9,0,.936508,.348041,222905e-9,0,.968254,.332389,210522e-9,0,1,1,420604e-10,0,0,1,420614e-10,0,0,1,420757e-10,0,0,.999999,42138e-9,0,0,.999997,423067e-10,0,0,.999993,426668e-10,0,0,.999986,433372e-10,0,0,.999974,444857e-10,0,0,.999956,463554e-10,0,0,.99993,493105e-10,0,0,.999892,539077e-10,0,0,.999838,610005e-10,0,0,.999767,718822e-10,0,0,.999666,884581e-10,0,365471e-10,.999525,113398e-9,0,485623e-9,.999311,150043e-9,0,.00162096,.998865,200063e-9,0,.00355319,.996278,211014e-9,0,.00633818,.992956,189672e-9,0,.0100043,.991017,210262e-9,0,.0145648,.989055,244292e-9,0,.0200237,.986741,290481e-9,0,.0263798,.983288,334303e-9,0,.033629,.977784,340307e-9,0,.0417652,.973037,377864e-9,0,.0507821,.967181,4239e-7,0,.060673,.958971,443854e-9,0,.0714314,.950093,483039e-9,0,.0830518,.939552,517934e-9,0,.0955288,.927678,539449e-9,0,.108859,.918278,568604e-9,0,.123038,.908449,588505e-9,0,.138065,.897713,612473e-9,0,.153938,.885533,625575e-9,0,.170657,.872131,63854e-8,0,.188224,.857517,647034e-9,0,.20664,.841796,65209e-8,0,.225909,.824726,6544e-7,0,.246035,.807297,655744e-9,0,.267022,.789058,646716e-9,0,.288878,.77189,643898e-9,0,.311607,.753082,629973e-9,0,.335216,.7341,621564e-9,0,.359713,.714094,605171e-9,0,.385103,.693839,588752e-9,0,.41139,.673891,573294e-9,0,.438576,.653565,552682e-9,0,.466656,.633326,533446e-9,0,.495617,.612582,514635e-9,0,.525431,.59205,49303e-8,0,.556041,.571918,471842e-9,0,.587338,.551572,451713e-9,0,.619048,.531553,430049e-9,0,.650794,.51175,410445e-9,0,.68254,.49238,390098e-9,0,.714286,.473143,370033e-9,0,.746032,.45423,351205e-9,0,.777778,.435963,332049e-9,0,.809524,.41787,315021e-9,0,.84127,.400387,297315e-9,0,.873016,.383332,281385e-9,0,.904762,.366665,265397e-9,0,.936508,.350633,250601e-9,0,.968254,.334964,23589e-8,0,1,1,643736e-10,0,0,1,64375e-9,0,0,1,643947e-10,0,0,.999999,64481e-9,0,0,.999997,647143e-10,0,0,.999994,652119e-10,0,0,.999985,661359e-10,0,0,.999972,677116e-10,0,0,.999952,702599e-10,0,0,.999922,742517e-10,0,0,.99988,803906e-10,0,0,.99982,897315e-10,0,0,.999741,103838e-9,0,0,.999629,12496e-8,0,149024e-9,.999474,156161e-9,0,861027e-9,.999229,201034e-9,0,.00231198,.998662,259069e-9,0,.00458147,.995299,245439e-9,0,.00770895,.992732,24498e-8,0,.0117126,.990847,273211e-9,0,.0165989,.988911,316492e-9,0,.0223674,.98654,37161e-8,0,.0290135,.982636,410352e-9,0,.0365309,.977346,421756e-9,0,.0449117,.972909,475578e-9,0,.0541481,.966821,522482e-9,0,.0642326,.958686,545008e-9,0,.075158,.949754,589286e-9,0,.0869181,.939184,619995e-9,0,.0995074,.927505,654266e-9,0,.112922,.916606,682362e-9,0,.127157,.906707,704286e-9,0,.142212,.895937,725909e-9,0,.158085,.883913,743939e-9,0,.174776,.870642,755157e-9,0,.192287,.856241,764387e-9,0,.210619,.84069,771032e-9,0,.229775,.823728,765906e-9,0,.249761,.806481,767604e-9,0,.270582,.787924,754385e-9,0,.292243,.770588,749668e-9,0,.314753,.751991,731613e-9,0,.338118,.733407,717655e-9,0,.362347,.713688,700604e-9,0,.387447,.693595,678765e-9,0,.413424,.673426,657042e-9,0,.440284,.65359,635892e-9,0,.468027,.633576,611569e-9,0,.496645,.613144,586011e-9,0,.526122,.592711,563111e-9,0,.556417,.572722,537699e-9,0,.587451,.552762,512556e-9,0,.619048,.532985,489757e-9,0,.650794,.513219,464139e-9,0,.68254,.493992,442193e-9,0,.714286,.47509,418629e-9,0,.746032,.456287,397045e-9,0,.777778,.438152,375504e-9,0,.809524,.420294,35492e-8,0,.84127,.402749,335327e-9,0,.873016,.385879,316422e-9,0,.904762,.369352,298333e-9,0,.936508,.353301,281417e-9,0,.968254,.337781,265203e-9,0,1,1,968267e-10,0,0,1,968284e-10,0,0,1,968556e-10,0,0,.999999,969733e-10,0,0,.999997,972913e-10,0,0,.999993,979688e-10,0,0,.999984,992239e-10,0,0,.999969,101356e-9,0,0,.999946,104784e-9,0,0,.999913,110111e-9,0,0,.999868,118217e-9,0,0,.999801,130396e-9,0,0,.999712,148523e-9,0,124907e-10,.999589,175233e-9,0,355405e-9,.999416,213999e-9,0,.0013528,.999136,268529e-9,0,.00312557,.998367,333088e-9,0,.00573045,.994701,304757e-9,0,.00919397,.992497,318031e-9,0,.0135261,.990608,353863e-9,0,.0187278,.988715,409044e-9,0,.0247947,.986241,472967e-9,0,.0317196,.981696,495104e-9,0,.039494,.977097,532873e-9,0,.0481087,.972583,594447e-9,0,.0575549,.966142,636867e-9,0,.0678242,.95823,669899e-9,0,.0789089,.949677,719499e-9,0,.0908023,.939226,750584e-9,0,.103499,.927501,793183e-9,0,.116993,.915199,81995e-8,0,.131282,.90498,847654e-9,0,.146364,.894243,868929e-9,0,.162237,.882154,884278e-9,0,.178902,.869161,898108e-9,0,.196358,.854751,901254e-9,0,.21461,.839368,90679e-8,0,.23366,.822874,901541e-9,0,.253512,.805514,897297e-9,0,.274174,.78716,881856e-9,0,.29565,.769061,870032e-9,0,.31795,.751,851719e-9,0,.341081,.732614,830671e-9,0,.365053,.713171,806569e-9,0,.389874,.693472,78338e-8,0,.415553,.673528,756404e-9,0,.442098,.653397,726872e-9,0,.469512,.633781,700494e-9,0,.497794,.613877,67105e-8,0,.526935,.593506,640361e-9,0,.556908,.573667,613502e-9,0,.587657,.553932,583177e-9,0,.61906,.534345,554375e-9,0,.650794,.515042,527811e-9,0,.68254,.495674,499367e-9,0,.714286,.477132,47429e-8,0,.746032,.458609,447726e-9,0,.777778,.440354,424205e-9,0,.809524,.422765,399549e-9,0,.84127,.405472,378315e-9,0,.873016,.388482,355327e-9,0,.904762,.372191,336122e-9,0,.936508,.356099,315247e-9,0,.968254,.340737,29794e-8,0,1,1,143327e-9,0,0,1,14333e-8,0,0,1,143366e-9,0,0,.999999,143524e-9,0,0,.999996,143952e-9,0,0,.999991,144862e-9,0,0,.999981,146544e-9,0,0,.999966,149391e-9,0,0,.999941,153946e-9,0,0,.999905,160971e-9,0,0,.999852,171562e-9,0,0,.99978,18729e-8,0,0,.999681,210386e-9,0,826239e-10,.999546,243906e-9,0,664807e-9,.999352,291739e-9,0,.00196192,.999027,357419e-9,0,.00405941,.997886,422349e-9,0,.00699664,.99419,385008e-9,0,.0107896,.99214,409775e-9,0,.0154415,.990274,456418e-9,0,.0209488,.988455,527008e-9,0,.0273037,.985804,597685e-9,0,.0344969,.98103,613124e-9,0,.0425183,.976674,668321e-9,0,.0513575,.972021,736985e-9,0,.0610046,.965274,773789e-9,0,.0714508,.958046,830852e-9,0,.0826877,.949333,875766e-9,0,.0947085,.939135,917088e-9,0,.107507,.927119,952244e-9,0,.121078,.91469,990626e-9,0,.135419,.903006,.00101304,0,.150526,.892368,.00103834,0,.166399,.880231,.00105002,0,.183038,.867432,.00106331,0,.200443,.853208,.00106783,0,.218618,.837956,.00106458,0,.237566,.821772,.00105945,0,.257291,.804328,.00104685,0,.2778,.786465,.00103178,0,.2991,.768004,.00101077,0,.321199,.74972,985504e-9,0,.344106,.731682,962893e-9,0,.36783,.712813,932146e-9,0,.392383,.693139,89871e-8,0,.417774,.673566,869678e-9,0,.444013,.653483,835525e-9,0,.471107,.633891,799853e-9,0,.49906,.614433,766838e-9,0,.527869,.594586,732227e-9,0,.557517,.574769,696442e-9,0,.587966,.555149,663935e-9,0,.61913,.535898,629826e-9,0,.650794,.516753,596486e-9,0,.68254,.497816,567078e-9,0,.714286,.479034,534399e-9,0,.746032,.460975,507013e-9,0,.777778,.442935,477421e-9,0,.809524,.425263,451101e-9,0,.84127,.408248,424964e-9,0,.873016,.391339,39993e-8,0,.904762,.37513,377619e-9,0,.936508,.359172,354418e-9,0,.968254,.343876,334823e-9,0,1,1,209042e-9,0,0,1,209045e-9,0,0,1,209093e-9,0,0,.999999,209304e-9,0,0,.999996,209871e-9,0,0,.999991,211078e-9,0,0,.999979,213304e-9,0,0,.999963,217061e-9,0,0,.999933,223042e-9,0,0,.999894,232206e-9,0,0,.999837,245901e-9,0,0,.999756,266023e-9,0,102927e-11,.999648,295204e-9,0,233468e-9,.999499,336958e-9,0,.00108237,.999283,395563e-9,0,.00268832,.998896,473785e-9,0,.00511138,.997006,520008e-9,0,.00837705,.993819,497261e-9,0,.0124928,.991632,523722e-9,0,.0174561,.989875,587258e-9,0,.0232596,.988109,676329e-9,0,.0298932,.985155,747701e-9,0,.0373453,.980479,768803e-9,0,.0456045,.976271,841054e-9,0,.0546593,.971347,911469e-9,0,.0644994,.964528,953057e-9,0,.0751152,.957632,.00102221,0,.0864981,.948681,.00106122,0,.0986407,.938716,.00111857,0,.111537,.926629,.00114762,0,.125182,.914025,.00118995,0,.139571,.901026,.00121228,0,.154703,.890358,.00123946,0,.170576,.878283,.0012527,0,.18719,.865459,.00125536,0,.204547,.851407,.00126134,0,.222648,.836276,.00124759,0,.241498,.820436,.00124443,0,.261101,.803253,.00122071,0,.281465,.785562,.00120107,0,.302595,.76718,.00117762,0,.324501,.748551,.00114289,0,.347192,.730564,.00110872,0,.370679,.712253,.00107636,0,.394973,.692867,.00103646,0,.420085,.673695,996793e-9,0,.446027,.653912,95675e-8,0,.47281,.634129,916739e-9,0,.500441,.615004,874401e-9,0,.528921,.595587,833411e-9,0,.558244,.575965,794556e-9,0,.588384,.5566,75196e-8,0,.619281,.537428,716381e-9,0,.650795,.518623,676558e-9,0,.68254,.499964,64074e-8,0,.714286,.481356,605984e-9,0,.746032,.463279,570256e-9,0,.777778,.445673,540138e-9,0,.809524,.428032,507299e-9,0,.84127,.411112,479553e-9,0,.873016,.394444,450737e-9,0,.904762,.378247,424269e-9,0,.936508,.362415,399111e-9,0,.968254,.347103,375274e-9,0,1,1,300729e-9,0,0,1,300733e-9,0,0,1,300797e-9,0,0,.999998,301072e-9,0,0,.999996,301817e-9,0,0,.999989,303398e-9,0,0,.999977,306309e-9,0,0,.999958,311209e-9,0,0,.999927,318975e-9,0,0,.999884,330804e-9,0,0,.99982,34834e-8,0,0,.999733,373854e-9,0,326995e-10,.999613,410424e-9,0,477174e-9,.999447,462047e-9,0,.00161099,.999204,533322e-9,0,.00353153,.998725,624964e-9,0,.00627965,.995871,631786e-9,0,.0098693,.993194,632017e-9,0,.0143011,.991541,68923e-8,0,.019568,.989773,766892e-9,0,.0256593,.987647,863668e-9,0,.0325625,.984193,922089e-9,0,.0402647,.980016,970749e-9,0,.0487532,.975859,.00106027,0,.058016,.970514,.00112239,0,.0680419,.963625,.00117212,0,.0788208,.956959,.00125211,0,.0903439,.947956,.00129411,0,.102604,.93809,.00135879,0,.115594,.92659,.00139309,0,.129309,.913829,.00143253,0,.143745,.90005,.00145809,0,.158901,.888129,.0014748,0,.174774,.87607,.00148756,0,.191365,.863461,.00148714,0,.208674,.849594,.00148892,0,.226705,.834531,.00146496,0,.245461,.81903,.0014579,0,.264947,.802122,.00143039,0,.28517,.78445,.00139717,0,.306137,.766434,.00136312,0,.327857,.747816,.00132597,0,.350341,.729519,.00128323,0,.373598,.711454,.00123803,0,.397642,.692699,.00119097,0,.422485,.673723,.00114565,0,.448139,.654386,.00109552,0,.474619,.634673,.00104553,0,.501933,.615554,99985e-8,0,.530089,.596462,948207e-9,0,.559087,.577385,902299e-9,0,.588913,.558257,856448e-9,0,.619525,.5392,810395e-9,0,.650826,.520543,768558e-9,0,.68254,.502206,7239e-7,0,.714286,.48402,685794e-9,0,.746032,.465779,64471e-8,0,.777778,.448455,609583e-9,0,.809524,.431091,57227e-8,0,.84127,.414147,54042e-8,0,.873016,.39765,506545e-9,0,.904762,.381576,477635e-9,0,.936508,.365881,448446e-9,0,.968254,.350582,421424e-9,0,1,1,427144e-9,0,0,1,427151e-9,0,0,1,427232e-9,0,0,.999998,42759e-8,0,0,.999995,428555e-9,0,0,.999988,430603e-9,0,0,.999976,434368e-9,0,0,.999952,440688e-9,0,0,.999919,450667e-9,0,0,.999871,46578e-8,0,0,.999801,488024e-9,0,0,.999704,520092e-9,0,129791e-9,.999572,565553e-9,0,821056e-9,.999389,628906e-9,0,.00225241,.999114,714911e-9,0,.00449109,.998488,819218e-9,0,.00756249,.995234,80415e-8,0,.0114716,.993021,830181e-9,0,.0162131,.991407,902645e-9,0,.021776,.989625,996934e-9,0,.0281471,.987064,.00109707,0,.0353118,.983265,.00114353,0,.0432562,.979535,.0012272,0,.0519665,.975224,.00132642,0,.0614298,.969574,.00138092,0,.0716348,.963021,.00145896,0,.0825709,.956046,.00152834,0,.094229,.947136,.00158217,0,.106602,.937313,.0016347,0,.119682,.926073,.00168383,0,.133465,.913121,.00171627,0,.147947,.899165,.00174229,0,.163125,.885891,.00176137,0,.178998,.873783,.00176406,0,.195566,.861331,.00176156,0,.21283,.847569,.00175346,0,.230793,.832785,.00172753,0,.249459,.817442,.00170204,0,.268832,.800613,.00166576,0,.28892,.783597,.00162909,0,.30973,.76571,.0015826,0,.331271,.747021,.00153106,0,.353554,.728593,.00148036,0,.37659,.710661,.00142808,0,.400391,.692426,.00136906,0,.424973,.673623,.00131066,0,.450347,.65494,.00125569,0,.476531,.635448,.00119517,0,.503535,.616221,.00113828,0,.531372,.597531,.0010816,0,.560047,.578795,.00102673,0,.589554,.559892,970985e-9,0,.619869,.541307,919773e-9,0,.650923,.522608,868479e-9,0,.68254,.504484,82137e-8,0,.714286,.486603,772916e-9,0,.746032,.468802,730353e-9,0,.777778,.451172,684955e-9,0,.809524,.434348,647565e-9,0,.84127,.417445,605863e-9,0,.873016,.401077,571885e-9,0,.904762,.385039,536034e-9,0,.936508,.369483,504227e-9,0,.968254,.354272,473165e-9,0,1,1,599525e-9,0,0,1,599533e-9,0,0,1,599639e-9,0,0,.999998,600097e-9,0,0,.999994,601336e-9,0,0,.999987,603958e-9,0,0,.999972,608775e-9,0,0,.999949,616842e-9,0,0,.999912,629534e-9,0,0,.999857,648658e-9,0,0,.999781,676615e-9,0,538873e-11,.999674,716574e-9,0,308602e-9,.999528,772641e-9,0,.00127003,.999326,849806e-9,0,.00300783,.999009,952682e-9,0,.00556637,.998112,.00106394,0,.00895889,.994496,.00102228,0,.0131827,.992806,.00108586,0,.0182277,.991211,.0011759,0,.0240795,.989415,.00128955,0,.030723,.986499,.00139038,0,.0381418,.982679,.00144539,0,.046321,.978839,.00153954,0,.0552459,.974295,.00164417,0,.0649034,.968784,.00171517,0,.0752814,.962324,.00180282,0,.0863693,.954956,.00186387,0,.0981578,.94624,.00193817,0,.110639,.936517,.00198156,0,.123806,.925186,.00203042,0,.137655,.91252,.0020664,0,.15218,.898441,.00207822,0,.16738,.884394,.0020992,0,.183253,.871273,.00208748,0,.199799,.859057,.00208686,0,.21702,.845243,.00205519,0,.234918,.830723,.00202868,0,.253496,.815801,.00199501,0,.272761,.79914,.00194193,0,.292719,.782372,.00188824,0,.313377,.76482,.00183695,0,.334745,.746586,.00177418,0,.356833,.7281,.00170628,0,.379654,.709842,.00164063,0,.403221,.692019,.00157355,0,.427548,.67364,.00150262,0,.452651,.655277,.00143473,0,.478545,.636438,.00136371,0,.505246,.617364,.00129911,0,.532768,.598603,.00123014,0,.561122,.580195,.00116587,0,.590309,.561786,.00110398,0,.620318,.543377,.00104148,0,.651102,.525093,983984e-9,0,.682545,.506791,92667e-8,0,.714286,.489291,874326e-9,0,.746032,.471811,821734e-9,0,.777778,.454435,774698e-9,0,.809524,.437493,727302e-9,0,.84127,.420977,684039e-9,0,.873016,.404729,64373e-8,0,.904762,.388756,60285e-8,0,.936508,.373344,56765e-8,0,.968254,.358191,531929e-9,0,1,1,832169e-9,0,0,1,832178e-9,0,0,1,83231e-8,0,0,.999998,832893e-9,0,0,.999995,834465e-9,0,0,.999985,837791e-9,0,0,.999969,843893e-9,0,0,.999944,854086e-9,0,0,.999903,870071e-9,0,0,.999843,894042e-9,0,0,.999759,928865e-9,0,531805e-10,.999643,978242e-9,0,579365e-9,.99948,.00104684,0,.00182774,.999255,.00114012,0,.00387804,.998885,.00126188,0,.00675709,.997405,.00135888,0,.010468,.99424,.00133626,0,.0150018,.992458,.00140905,0,.0203443,.990929,.00152305,0,.0264786,.989116,.00165882,0,.0333875,.985624,.00174128,0,.0410536,.982003,.00182108,0,.0494609,.978336,.00194498,0,.0585941,.973184,.00202708,0,.0684396,.9678,.00212166,0,.0789851,.961348,.00221366,0,.0902199,.953841,.00228219,0,.102134,.94534,.00235662,0,.114721,.935552,.00240572,0,.127972,.924064,.00244405,0,.141884,.911827,.00247557,0,.156451,.897731,.00248374,0,.171672,.883409,.00249863,0,.187545,.868625,.00246688,0,.20407,.856529,.00246523,0,.221249,.842999,.00242368,0,.239083,.828505,.00237354,0,.257578,.813825,.00232588,0,.276738,.797813,.00226731,0,.296569,.781097,.00219704,0,.31708,.764038,.00212394,0,.338281,.746067,.00204786,0,.360181,.727687,.00196728,0,.382794,.709571,.00188779,0,.406133,.691503,.00180532,0,.430213,.673673,.00171849,0,.45505,.655732,.00164147,0,.480662,.637399,.00155858,0,.507065,.618616,.00147641,0,.534278,.60005,.00140125,0,.562313,.581713,.00132441,0,.59118,.563546,.00125014,0,.620875,.545605,.00118249,0,.651373,.527559,.0011116,0,.682593,.509764,.00104979,0,.714286,.49193,985977e-9,0,.746032,.475011,928592e-9,0,.777778,.457878,873466e-9,0,.809524,.440979,819585e-9,0,.84127,.424613,772365e-9,0,.873016,.408549,722195e-9,0,.904762,.392771,680014e-9,0,.936508,.377317,636797e-9,0,.968254,.362352,598318e-9,0,1,1,.00114313,0,0,1,.00114314,0,0,.999999,.00114331,0,0,.999998,.00114404,0,0,.999994,.00114601,0,0,.999984,.00115019,0,0,.999967,.00115784,0,0,.999937,.0011706,0,0,.999894,.00119054,0,0,.999828,.00122031,0,0,.999735,.00126331,0,169263e-9,.999606,.00132382,0,949167e-9,.999426,.0014071,0,.00249668,.999173,.00151895,0,.00486392,.99873,.00166102,0,.00806323,.996243,.0017023,0,.0120895,.993779,.00172782,0,.0169288,.9919,.0018108,0,.0225633,.990524,.00196028,0,.028974,.98868,.00212014,0,.036142,.984663,.00217598,0,.044049,.981457,.00230563,0,.0526781,.977608,.00243966,0,.0620137,.972215,.00251336,0,.0720418,.966798,.0026285,0,.0827499,.960241,.00271409,0,.0941271,.952489,.00278381,0,.106164,.944127,.00285399,0,.118852,.934282,.00290994,0,.132185,.923271,.00294558,0,.146157,.910803,.00296269,0,.160766,.896705,.00296803,0,.176007,.88238,.00296637,0,.19188,.867116,.00293163,0,.208385,.853636,.00289418,0,.225523,.840469,.00284663,0,.243296,.82639,.00278594,0,.261709,.811759,.00271618,0,.280767,.796113,.00263187,0,.300476,.779518,.00254589,0,.320845,.763142,.00246003,0,.341883,.745464,.00236529,0,.363601,.727491,.00226536,0,.386011,.709414,.00216375,0,.409128,.691396,.00207127,0,.432967,.67368,.00197106,0,.457545,.656049,.00187022,0,.482881,.638188,.00177605,0,.508992,.620177,.00168482,0,.535899,.601506,.00158909,0,.563619,.58362,.00150583,0,.592165,.565496,.00141791,0,.621544,.54789,.00133693,0,.651743,.530323,.00126038,0,.682709,.512795,.00118556,0,.714286,.495199,.00111527,0,.746032,.478101,.0010489,0,.777778,.461511,984264e-9,0,.809524,.444879,92591e-8,0,.84127,.428424,866582e-9,0,.873016,.412495,814463e-9,0,.904762,.396975,764498e-9,0,.936508,.381614,715967e-9,0,.968254,.366732,672483e-9,0,1,1,.00155501,0,0,1,.00155503,0,0,1,.00155524,0,0,.999998,.00155615,0,0,.999994,.0015586,0,0,.999983,.00156379,0,0,.999963,.0015733,0,0,.999932,.00158911,0,0,.999882,.00161376,0,0,.99981,.00165041,0,100875e-10,.999708,.00170304,0,367658e-9,.999565,.00177658,0,.0014234,.999368,.00187688,0,.00327939,.999081,.00200989,0,.00596629,.99852,.00217177,0,.0094852,.99549,.0021745,0,.013824,.993252,.00222357,0,.0189642,.991727,.00235022,0,.0248856,.989951,.00250561,0,.0315669,.988029,.00268829,0,.0389882,.984029,.0027496,0,.0471302,.980683,.00289793,0,.0559754,.976554,.00303315,0,.0655081,.97139,.00313257,0,.0757138,.965544,.00323656,0,.08658,.95912,.00333432,0,.0980954,.951183,.0034039,0,.110251,.942974,.00347515,0,.123038,.932642,.00350381,0,.13645,.922158,.00354519,0,.150482,.909404,.00353851,0,.165129,.896071,.0035435,0,.18039,.881206,.00349936,0,.196263,.866077,.00347256,0,.212748,.85093,.003415,0,.229847,.837703,.00333367,0,.247561,.823878,.003249,0,.265895,.809449,.00316347,0,.284854,.794379,.00306351,0,.304445,.778138,.0029499,0,.324675,.761997,.00284099,0,.345555,.744938,.00272104,0,.367095,.727212,.00260715,0,.389309,.709549,.00248855,0,.41221,.691704,.00236783,0,.435814,.673689,.00225178,0,.460138,.656453,.00213765,0,.485203,.639128,.00202178,0,.511028,.621512,.00191443,0,.537634,.603598,.00180977,0,.565041,.58559,.00170456,0,.593268,.567852,.00160927,0,.622327,.5503,.00151395,0,.652217,.533033,.00142499,0,.682907,.515942,.00133955,0,.714296,.498814,.0012602,0,.746032,.481595,.00118188,0,.777778,.465117,.00111171,0,.809524,.448865,.00104091,0,.84127,.432711,976618e-9,0,.873016,.416822,91859e-8,0,.904762,.401272,857704e-9,0,.936508,.386226,807172e-9,0,.968254,.371321,75464e-8,0,1,1,.00209596,0,0,1,.00209598,0,0,1,.00209624,0,0,.999997,.00209736,0,0,.999991,.00210039,0,0,.999979,.00210678,0,0,.999959,.00211847,0,0,.999925,.0021379,0,0,.99987,.00216809,0,0,.999791,.00221281,0,681487e-10,.999677,.00227669,0,658161e-9,.999521,.00236533,0,.00200635,.999301,.00248514,0,.0041779,.998977,.00264185,0,.00718648,.998191,.00281695,0,.0110239,.994801,.00278518,0,.015672,.993091,.00288774,0,.0211091,.991571,.00303931,0,.0273123,.9897,.00321643,0,.034259,.987023,.00337332,0,.0419282,.983289,.00346146,0,.0502998,.979892,.00363704,0,.0593562,.975111,.00373601,0,.069081,.970351,.0038842,0,.0794598,.964131,.00397053,0,.0904798,.957747,.00408078,0,.10213,.949536,.00413533,0,.1144,.941372,.00420305,0,.127284,.931049,.00422815,0,.140772,.920647,.00425048,0,.154862,.908033,.0042281,0,.169548,.895028,.00422026,0,.184828,.879968,.00415042,0,.200701,.864875,.00408821,0,.217167,.84918,.00400909,0,.234227,.834934,.00391178,0,.251884,.821397,.00380066,0,.270141,.807135,.00367974,0,.289004,.792363,.00355172,0,.308479,.776661,.003411,0,.328575,.760705,.00328123,0,.349301,.744408,.00314003,0,.370668,.726994,.0029906,0,.392689,.709598,.00285034,0,.415379,.692112,.00271179,0,.438754,.674435,.00257185,0,.46283,.65676,.00243425,0,.48763,.639982,.00230351,0,.513173,.622983,.0021777,0,.539482,.605471,.00204991,0,.566579,.58796,.00193759,0,.594488,.570463,.00181976,0,.623226,.553058,.00171497,0,.6528,.535894,.00161109,0,.683198,.519089,.00151394,0,.714354,.502454,.00142122,0,.746032,.485681,.00133488,0,.777778,.468935,.00124975,0,.809524,.452951,.00117309,0,.84127,.437139,.00110155,0,.873016,.421446,.00103124,0,.904762,.405951,966387e-9,0,.936508,.391003,908119e-9,0,.968254,.376198,848057e-9,0,1,1,.00280076,0,0,1,.00280078,0,0,.999999,.00280109,0,0,.999997,.00280246,0,0,.999992,.00280616,0,0,.999979,.00281396,0,0,.999956,.00282822,0,0,.999916,.00285186,0,0,.999857,.0028885,0,0,.999768,.00294259,0,196026e-9,.999645,.00301946,0,.00104842,.99947,.00312541,0,.00270199,.999229,.00326733,0,.00519449,.998852,.00344992,0,.00852602,.997558,.00361052,0,.0126804,.994417,.0035898,0,.017635,.992824,.00372393,0,.023365,.991344,.00390695,0,.0298456,.989337,.00410392,0,.0370529,.985811,.00420987,0,.0449651,.982772,.00437488,0,.0535615,.979001,.00455069,0,.0628243,.974102,.00464462,0,.0727368,.969197,.00480577,0,.0832844,.962759,.00487818,0,.0944545,.956207,.00498176,0,.106236,.947909,.00503392,0,.118619,.939596,.00507474,0,.131595,.929642,.00509798,0,.145159,.918807,.00508476,0,.159305,.906921,.00505634,0,.174028,.893312,.00498845,0,.189327,.878933,.0049133,0,.2052,.863986,.0048259,0,.221647,.847936,.00470848,0,.23867,.832253,.00456889,0,.25627,.818619,.00442726,0,.274453,.804788,.00427677,0,.293222,.790241,.00411906,0,.312585,.775162,.00394833,0,.33255,.759463,.00377366,0,.353126,.743598,.00361026,0,.374324,.72697,.00343627,0,.396158,.709646,.00326422,0,.418641,.69277,.00309717,0,.44179,.675371,.0029356,0,.465624,.657863,.00277712,0,.490163,.640772,.00261738,0,.515429,.624441,.0024737,0,.541445,.607497,.00233125,0,.568236,.590438,.00218994,0,.595828,.573224,.0020664,0,.624242,.556168,.00193526,0,.653496,.539232,.00182463,0,.683588,.522352,.00170735,0,.714482,.506172,.00160555,0,.746032,.489842,.00150451,0,.777778,.473463,.00140938,0,.809524,.457266,.00132568,0,.84127,.441609,.0012376,0,.873016,.426348,.00116265,0,.904762,.411002,.00108935,0,.936508,.396045,.00101946,0,.968254,.381448,955665e-9,0,1,1,.0037121,0,0,1,.00371213,0,0,1,.00371251,0,0,.999997,.00371417,0,0,.99999,.00371863,0,0,.999977,.00372807,0,0,.99995,.00374529,0,0,.999908,.0037738,0,0,.999843,.00381789,0,123596e-10,.999745,.00388273,0,407442e-9,.999608,.00397443,0,.0015447,.999415,.00409998,0,.00351385,.999143,.00426662,0,.0063316,.9987,.00447625,0,.00998679,.996363,.00455323,0,.0144569,.994021,.00461052,0,.0197151,.992372,.00476359,0,.0257344,.991007,.00499101,0,.0324882,.988767,.0051972,0,.0399517,.984872,.00528407,0,.0481022,.982004,.00548926,0,.0569191,.977714,.00564385,0,.0663839,.973076,.0057693,0,.0764801,.967565,.0058924,0,.0871928,.961384,.00599629,0,.0985095,.954435,.00605998,0,.110419,.946303,.0061133,0,.122912,.937662,.00612028,0,.13598,.927867,.00612209,0,.149617,.916475,.00604813,0,.163817,.90541,.00603088,0,.178577,.891591,.00592218,0,.193894,.877573,.00578854,0,.209767,.862511,.00566648,0,.226196,.846861,.00551481,0,.243182,.83068,.00533754,0,.260728,.815725,.00515487,0,.278837,.802321,.0049655,0,.297515,.787826,.00475421,0,.316768,.773454,.00456002,0,.336605,.758224,.00434727,0,.357034,.74265,.00414444,0,.378067,.726729,.00393738,0,.399717,.710155,.00373575,0,.421998,.693312,.00353736,0,.444928,.67653,.00334368,0,.468523,.659444,.00315981,0,.492806,.642051,.00297809,0,.517798,.625758,.00280592,0,.543525,.609615,.00264254,0,.570012,.592919,.00248459,0,.597288,.576298,.00233327,0,.625379,.559489,.00219519,0,.654307,.542891,.00205441,0,.684084,.526255,.00193385,0,.714693,.509853,.00180745,0,.746044,.494131,.00169817,0,.777778,.478114,.0015913,0,.809524,.462274,.00148981,0,.84127,.446412,.00139537,0,.873016,.431274,.00130984,0,.904762,.41635,.00122403,0,.936508,.401476,.00114809,0,.968254,.386993,.00107563,0,1,1,.00488216,0,0,1,.0048822,0,0,1,.00488265,0,0,.999997,.00488463,0,0,.999988,.00488999,0,0,.999974,.00490129,0,0,.999946,.00492191,0,0,.999897,.00495598,0,0,.999825,.00500855,0,744791e-10,.999718,.00508559,0,712744e-9,.999565,.005194,0,.00215249,.999352,.00534147,0,.00444576,.999046,.00553523,0,.00759218,.998492,.00577016,0,.0115714,.995564,.00578487,0,.0163557,.993339,.00586414,0,.021915,.991834,.00606002,0,.0282201,.990496,.00633312,0,.0352433,.987826,.00651941,0,.042959,.98383,.00660842,0,.0513439,.98109,.00685523,0,.0603772,.976131,.00695778,0,.0700402,.971922,.00714236,0,.0803163,.965901,.00721437,0,.0911908,.959606,.00732017,0,.102651,.952504,.00735788,0,.114686,.944365,.00738493,0,.127286,.935652,.00737969,0,.140443,.925813,.00733612,0,.154151,.914397,.00723094,0,.168405,.903257,.00714002,0,.183201,.890015,.00700149,0,.198536,.876014,.00682813,0,.214409,.861436,.00665567,0,.23082,.845752,.00644526,0,.24777,.829169,.00621635,0,.265263,.813435,.00597789,0,.283301,.799701,.00575694,0,.301889,.785726,.00549866,0,.321035,.77152,.0052503,0,.340746,.75683,.00499619,0,.361032,.741951,.0047543,0,.381904,.726367,.0045084,0,.403374,.710537,.00426784,0,.425457,.693965,.00403487,0,.448169,.677724,.0038075,0,.47153,.66117,.00359431,0,.495561,.644274,.00338354,0,.520284,.627449,.00318163,0,.545725,.611645,.00299672,0,.571911,.595614,.00281016,0,.598873,.579426,.00264252,0,.62664,.563016,.00247509,0,.655239,.546728,.00232647,0,.684692,.530539,.00217803,0,.714999,.514164,.00204216,0,.746106,.498344,.00191403,0,.777778,.482957,.00179203,0,.809524,.467336,.00167695,0,.84127,.451994,.00157567,0,.873016,.436514,.00147113,0,.904762,.42178,.00138034,0,.936508,.407271,.00129219,0,.968254,.392822,.0012098,0,1,1,.00637427,0,0,1,.00637431,0,0,.999999,.00637485,0,0,.999996,.00637721,0,0,.999987,.00638357,0,0,.999971,.006397,0,0,.999939,.00642142,0,0,.999888,.00646177,0,0,.999807,.00652387,0,207916e-9,.999689,.00661454,0,.00112051,.99952,.00674155,0,.00287719,.999283,.00691313,0,.00550145,.998936,.00713598,0,.00897928,.998165,.00738501,0,.0132829,.994847,.00734388,0,.01838,.993182,.00749991,0,.0242381,.991665,.0077246,0,.030826,.989708,.00797579,0,.0381152,.986663,.00813011,0,.0460794,.983288,.00830365,0,.0546951,.980104,.00853496,0,.0639411,.974855,.00861045,0,.0737988,.97045,.00879133,0,.0842516,.964509,.00886377,0,.0952848,.957594,.00890346,0,.106886,.950546,.00893289,0,.119044,.942225,.00890074,0,.131749,.933365,.00886826,0,.144994,.923202,.0087316,0,.158772,.912605,.00863082,0,.173078,.901099,.00847403,0,.187908,.888177,.00825838,0,.203261,.873955,.00801834,0,.219134,.860091,.00779026,0,.235527,.84434,.00752478,0,.252443,.828517,.00724074,0,.269883,.81239,.00693769,0,.287851,.79721,.00664817,0,.306352,.783489,.00634763,0,.325393,.769514,.00604221,0,.344981,.755419,.00573568,0,.365126,.741083,.00544359,0,.385839,.726059,.00515515,0,.407132,.710809,.00487139,0,.42902,.695052,.00459846,0,.45152,.678886,.00433412,0,.474651,.663042,.00407981,0,.498433,.646634,.00384264,0,.52289,.630117,.00360897,0,.548048,.613804,.00338863,0,.573936,.598338,.00318486,0,.600584,.582687,.00298377,0,.628027,.566809,.00280082,0,.656295,.550817,.00262255,0,.685417,.534937,.00245835,0,.715406,.519151,.00230574,0,.74624,.503118,.0021549,0,.777778,.487723,.00202008,0,.809524,.472725,.00189355,0,.84127,.457599,.00177108,0,.873016,.442558,.00165843,0,.904762,.427624,.00155494,0,.936508,.413171,.00145273,0,.968254,.399122,.00136454,0,1,1,.00826496,0,0,1,.00826499,0,0,1,.00826564,0,0,.999996,.00826842,0,0,.999987,.00827589,0,0,.999967,.00829167,0,0,.999933,.00832037,0,0,.999876,.00836768,0,109338e-10,.999786,.00844031,0,427145e-9,.999655,.00854603,0,.0016384,.999468,.00869337,0,.00372392,.999203,.008891,0,.00668513,.998803,.00914387,0,.0104968,.99748,.00935838,0,.015125,.994446,.00933309,0,.0205338,.99292,.00953084,0,.0266884,.991414,.0097893,0,.0335565,.989049,.0100228,0,.0411086,.98582,.0101664,0,.0493181,.982441,.0103582,0,.0581613,.978595,.0105292,0,.0676169,.973495,.0106274,0,.0776661,.968405,.0107261,0,.0882926,.962717,.0108234,0,.0994817,.955478,.0108102,0,.111221,.948275,.0107914,0,.123499,.940006,.0107161,0,.136308,.930831,.0106309,0,.149639,.920648,.0104083,0,.163485,.910205,.0102312,0,.177843,.898445,.0100051,0,.192707,.885986,.00971928,0,.208077,.872204,.00940747,0,.22395,.858436,.0091085,0,.240326,.843454,.00876595,0,.257208,.827437,.00839794,0,.274596,.811488,.00803692,0,.292496,.796039,.00767352,0,.310911,.781083,.0073097,0,.329849,.767642,.00694032,0,.349316,.753901,.00657476,0,.369323,.740131,.00622699,0,.38988,.725845,.0058838,0,.410999,.710991,.00555586,0,.432696,.696002,.00523089,0,.454987,.680461,.00492494,0,.47789,.664875,.00463464,0,.501426,.649273,.00435422,0,.52562,.63302,.0040875,0,.550498,.61705,.00384075,0,.576089,.601154,.00359557,0,.602427,.586008,.00337636,0,.629544,.570699,.00316019,0,.657479,.555166,.00296033,0,.686264,.539645,.00277552,0,.715924,.524159,.00259499,0,.746459,.508682,.00243257,0,.777789,.493163,.00227851,0,.809524,.478004,.00213083,0,.84127,.46347,.00199502,0,.873016,.448778,.00186967,0,.904762,.434105,.00174732,0,.936508,.419576,.00163861,0,.968254,.405541,.00153341,0,1,1,.0106462,0,0,1,.0106462,0,0,.999999,.010647,0,0,.999995,.0106502,0,0,.999985,.0106589,0,0,.999964,.0106773,0,0,.999925,.0107106,0,0,.999861,.0107655,0,712986e-10,.999763,.0108497,0,743959e-9,.999616,.0109716,0,.00227361,.999408,.0111408,0,.0046983,.999112,.0113659,0,.00800158,.998637,.0116475,0,.0121493,.996223,.0117231,0,.0171023,.994006,.0118064,0,.0228218,.992444,.0120254,0,.0292711,.991028,.0123314,0,.036417,.98803,.0124954,0,.0442295,.984816,.0126538,0,.0526815,.981399,.0128537,0,.0617492,.977085,.0129694,0,.0714114,.972154,.013091,0,.0816495,.966617,.0131166,0,.0924472,.960628,.0131583,0,.10379,.953295,.0131094,0,.115665,.94575,.0129966,0,.128062,.937654,.0128796,0,.140972,.927716,.0126477,0,.154387,.917932,.0123889,0,.168301,.907719,.012131,0,.182709,.89584,.0118013,0,.197608,.883526,.0114145,0,.212994,.870301,.0110075,0,.228867,.856272,.0106019,0,.245227,.842251,.0101938,0,.262074,.826466,.00973254,0,.279412,.810859,.0092846,0,.297244,.795051,.00883304,0,.315575,.780053,.00840272,0,.334412,.76575,.00796438,0,.35376,.752298,.00752526,0,.373631,.739153,.00711486,0,.394034,.725514,.00670361,0,.414983,.711473,.00632656,0,.436491,.696936,.00595206,0,.458575,.682126,.00559191,0,.481253,.667027,.00525362,0,.504547,.651875,.00493805,0,.528481,.636463,.00462848,0,.553081,.620641,.00433936,0,.578377,.604931,.00407,0,.604404,.589549,.00380864,0,.631197,.574712,.00357049,0,.658795,.559775,.00334466,0,.687238,.544514,.00312505,0,.716559,.529555,.00293199,0,.746776,.514402,.00274204,0,.777849,.499302,.00256647,0,.809524,.484114,.00239901,0,.84127,.469308,.00225148,0,.873016,.455133,.00210178,0,.904762,.440939,.0019727,0,.936508,.426627,.00184382,0,.968254,.412509,.00172548,0,1,1,.013628,0,0,1,.0136281,0,0,.999999,.0136289,0,0,.999995,.0136327,0,0,.999983,.0136427,0,0,.99996,.0136638,0,0,.999917,.0137022,0,0,.999846,.0137652,0,204597e-9,.999736,.0138615,0,.00116837,.999573,.0140007,0,.00303325,.99934,.0141927,0,.00580613,.999004,.0144457,0,.00945626,.998407,.0147489,0,.0139421,.995464,.014731,0,.0192202,.993328,.0148283,0,.0252495,.991799,.0150797,0,.0319921,.990397,.0154316,0,.0394138,.986835,.0155005,0,.0474843,.983938,.0157308,0,.0561763,.980154,.0158753,0,.0654661,.975659,.0159581,0,.0753326,.970171,.0159832,0,.0857571,.964803,.0160084,0,.0967236,.958366,.0159484,0,.108218,.950613,.0158001,0,.120227,.942874,.0155845,0,.132741,.935005,.0154292,0,.145751,.924991,.0150742,0,.159249,.914814,.0146757,0,.17323,.904743,.0143097,0,.187687,.893216,.0138695,0,.202619,.880769,.0133706,0,.218021,.868136,.0128606,0,.233894,.85469,.0123403,0,.250238,.840593,.0118091,0,.267052,.825808,.011253,0,.284341,.81009,.0107099,0,.302106,.79504,.0101636,0,.320354,.779757,.00964041,0,.33909,.764697,.00911896,0,.358322,.750913,.00859533,0,.378059,.738175,.00811592,0,.398311,.725242,.00764504,0,.41909,.711864,.00718885,0,.440412,.698009,.00675843,0,.462292,.683841,.00634984,0,.484748,.669391,.00595502,0,.507802,.654731,.00558671,0,.531477,.639805,.00523578,0,.555802,.624789,.00490834,0,.580805,.609325,.00459448,0,.606522,.593975,.00430342,0,.63299,.578983,.00403019,0,.66025,.564442,.0037707,0,.688346,.549835,.0035316,0,.717319,.535039,.00330255,0,.7472,.520403,.00308932,0,.777982,.505687,.00289335,0,.809524,.490939,.00270818,0,.84127,.476233,.0025343,0,.873016,.461624,.00237097,0,.904762,.447833,.00222065,0,.936508,.433992,.00207561,0,.968254,.420147,.00194955,0,1,1,.0173415,0,0,1,.0173416,0,0,.999999,.0173426,0,0,.999995,.0173468,0,0,.999983,.0173582,0,0,.999954,.0173822,0,0,.999908,.0174258,0,669501e-11,.999828,.0174973,0,427399e-9,.999705,.0176063,0,.00171019,.999524,.0177631,0,.0039248,.999263,.0179781,0,.00705382,.998878,.018258,0,.0110552,.998012,.0185551,0,.0158812,.994614,.0184264,0,.0214852,.993132,.0186385,0,.0278239,.991563,.0189067,0,.0348585,.989298,.0191577,0,.0425544,.986036,.0192522,0,.050881,.982558,.0194063,0,.059811,.978531,.019486,0,.0693209,.974198,.0195847,0,.0793895,.968148,.0194749,0,.0899984,.962565,.0194277,0,.101132,.956041,.0192991,0,.112775,.947749,.0189893,0,.124917,.94018,.018704,0,.137547,.93165,.0183458,0,.150655,.921798,.0178775,0,.164236,.911573,.0173618,0,.178281,.901569,.0168482,0,.192788,.890341,.016265,0,.207752,.877835,.0156199,0,.223171,.865472,.0149516,0,.239044,.852905,.0143274,0,.255371,.838906,.0136643,0,.272153,.824888,.0129903,0,.289393,.809977,.0123218,0,.307093,.794697,.0116572,0,.325259,.780028,.0110307,0,.343896,.765124,.0104236,0,.363012,.750411,.0098219,0,.382617,.737264,.00924397,0,.402719,.724799,.00868719,0,.423332,.712253,.00816476,0,.444469,.699267,.00767262,0,.466146,.685618,.00719746,0,.488383,.671736,.00673916,0,.511199,.657777,.00631937,0,.534618,.643497,.00592411,0,.558668,.62889,.00553928,0,.58338,.614299,.0051934,0,.608787,.599197,.00485985,0,.634929,.584175,.00454357,0,.661849,.569541,.00425787,0,.689594,.555193,.00397905,0,.718211,.540947,.00372364,0,.747742,.526593,.00348599,0,.778205,.512335,.00326103,0,.80953,.498017,.00305137,0,.84127,.483609,.00285485,0,.873016,.469368,.00267472,0,.904762,.455037,.00249945,0,.936508,.441493,.00234792,0,.968254,.428147,.00219936,0,1,1,.0219422,0,0,1,.0219423,0,0,.999998,.0219434,0,0,.999993,.0219481,0,0,.999981,.021961,0,0,.999949,.0219879,0,0,.999896,.0220367,0,593194e-10,.999808,.0221167,0,75364e-8,.99967,.0222383,0,.00237884,.999466,.0224125,0,.00495612,.999174,.0226495,0,.00844887,.998725,.0229525,0,.0128058,.996979,.0231123,0,.0179742,.994317,.0230742,0,.0239047,.992781,.0232895,0,.0305526,.991191,.0235734,0,.0378786,.987787,.0236152,0,.0458475,.985092,.0237994,0,.0544287,.981121,.0238553,0,.0635952,.976924,.0238706,0,.0733233,.97218,.0238704,0,.0835922,.965956,.0236598,0,.0943839,.959998,.0234735,0,.105682,.953245,.0232277,0,.117474,.944445,.0226973,0,.129747,.937087,.0223527,0,.142491,.928341,.0218144,0,.155697,.9184,.0211516,0,.169358,.907959,.0204553,0,.183469,.89808,.0197673,0,.198024,.887047,.0189915,0,.21302,.875221,.0182082,0,.228455,.86269,.0173584,0,.244329,.850735,.0165718,0,.260639,.837545,.0157524,0,.277389,.823639,.0149482,0,.29458,.809699,.0141431,0,.312216,.794797,.0133527,0,.3303,.780578,.0126193,0,.34884,.766019,.0118914,0,.367842,.751447,.0111839,0,.387315,.737275,.010514,0,.40727,.724545,.00987277,0,.427717,.712644,.00926569,0,.448671,.700432,.00869029,0,.470149,.687664,.00814691,0,.492167,.674288,.00763012,0,.514746,.660966,.00714437,0,.537911,.647264,.00668457,0,.561688,.633431,.00626581,0,.586108,.619133,.00585593,0,.611206,.604935,.00548188,0,.637022,.590236,.00513288,0,.663599,.575473,.0047906,0,.690989,.561228,.00448895,0,.719242,.547054,.00420233,0,.748411,.533175,.00392869,0,.778531,.519163,.00367445,0,.809583,.505328,.00344097,0,.84127,.491446,.00322003,0,.873016,.477356,.00301283,0,.904762,.46356,.00282592,0,.936508,.449623,.00264956,0,.968254,.436068,.00246956,0,1,1,.0276135,0,0,1,.0276136,0,0,.999998,.0276148,0,0,.999993,.0276201,0,0,.999976,.0276342,0,0,.999945,.027664,0,0,.999884,.0277179,0,18679e-8,.999784,.027806,0,.00119607,.99963,.0279394,0,.00318407,.999401,.0281295,0,.00613601,.999066,.0283858,0,.00999963,.998524,.0287027,0,.0147164,.995702,.0286256,0,.0202295,.993593,.0286733,0,.0264876,.992067,.0288989,0,.0334452,.990548,.0292135,0,.0410621,.986775,.0291296,0,.0493032,.984054,.0293099,0,.0581381,.979481,.0291881,0,.0675397,.975297,.0291598,0,.0774848,.96981,.028954,0,.0879528,.963524,.028628,0,.0989258,.957398,.0283135,0,.110388,.950088,.0278469,0,.122327,.941538,.0271798,0,.134729,.933332,.0265388,0,.147587,.924392,.0257776,0,.160889,.914581,.024916,0,.174631,.904347,.0240242,0,.188806,.894324,.0231229,0,.203409,.883724,.022153,0,.218437,.872207,.0211355,0,.233888,.859927,.0201048,0,.249761,.848373,.0191263,0,.266056,.836023,.0181306,0,.282774,.82289,.0171718,0,.299917,.809324,.0162196,0,.317488,.795361,.0152622,0,.335493,.781253,.01439,0,.353936,.767338,.013533,0,.372825,.753156,.0127244,0,.392168,.739122,.0119454,0,.411976,.725358,.0112054,0,.432259,.712949,.010487,0,.453032,.701621,.00984032,0,.47431,.689703,.00921495,0,.496111,.677216,.00862492,0,.518456,.664217,.00806882,0,.541367,.65137,.00755922,0,.564872,.638,.00705705,0,.589001,.62453,.00661266,0,.613789,.610601,.00618432,0,.639277,.59676,.00578033,0,.66551,.582433,.00540927,0,.692539,.568026,.00506104,0,.720422,.55414,.0047353,0,.749216,.540178,.00442889,0,.778974,.526513,.00414363,0,.809711,.512954,.00388237,0,.84127,.499403,.00362875,0,.873016,.486026,.00340827,0,.904762,.472345,.00318598,0,.936508,.458828,.00297635,0,.968254,.445379,.00279447,0,1,1,.0345716,0,0,1,.0345717,0,0,.999999,.034573,0,0,.999991,.0345787,0,0,.999974,.0345941,0,0,.999937,.0346263,0,188589e-11,.999869,.0346847,0,409238e-9,.999757,.0347798,0,.0017674,.999582,.0349233,0,.00413658,.999322,.0351265,0,.00747408,.998939,.0353967,0,.0117157,.998219,.0357018,0,.0167966,.994974,.0354726,0,.0226572,.993201,.0355621,0,.0292445,.991573,.0357641,0,.0365123,.989301,.0359252,0,.0444203,.985712,.0358017,0,.0529334,.982411,.0358353,0,.0620214,.977827,.035617,0,.0716574,.973278,.0354398,0,.0818186,.967397,.0350483,0,.0924846,.960696,.0344795,0,.103638,.954349,.0339861,0,.115263,.946066,.0331323,0,.127348,.938012,.032359,0,.13988,.929413,.0314413,0,.152849,.920355,.0304103,0,.166248,.910586,.0292785,0,.18007,.900609,.0281391,0,.194308,.890093,.0269103,0,.208958,.880013,.0257269,0,.224018,.869001,.0244671,0,.239485,.85751,.0232252,0,.255359,.84582,.0220117,0,.271638,.834383,.0208274,0,.288324,.822158,.0196628,0,.305419,.809056,.0185306,0,.322927,.795832,.0174174,0,.340851,.782547,.0163758,0,.359199,.7689,.015391,0,.377975,.755526,.0144488,0,.397189,.741681,.0135372,0,.416851,.728178,.0126957,0,.436971,.714642,.0118812,0,.457564,.702756,.0111165,0,.478644,.69175,.0104145,0,.500229,.680159,.00974439,0,.522339,.668073,.00911926,0,.544997,.655405,.00851393,0,.56823,.642921,.00797637,0,.592068,.629993,.00745119,0,.616546,.616828,.00696972,0,.641705,.603305,.00652425,0,.66759,.589833,.00610188,0,.694255,.575945,.00570834,0,.72176,.561745,.00533384,0,.750168,.548277,.00500001,0,.779545,.534467,.00467582,0,.809933,.521032,.00438092,0,.841272,.507877,.00410348,0,.873016,.494654,.00383618,0,.904762,.481592,.00358699,0,.936508,.468509,.00337281,0,.968254,.455293,.00316196,0,1,1,.0430698,0,0,1,.0430699,0,0,.999998,.0430713,0,0,.999991,.0430773,0,0,.99997,.0430936,0,0,.999928,.0431277,0,406396e-10,.999852,.0431893,0,744376e-9,.999724,.0432895,0,.0024806,.999527,.0434397,0,.00524779,.99923,.0436507,0,.00898164,.998783,.0439255,0,.0136083,.997507,.0441104,0,.0190582,.994418,.0438225,0,.0252694,.992864,.0439396,0,.0321879,.991127,.0440962,0,.039767,.987331,.0438408,0,.0479667,.984819,.0438991,0,.056752,.980384,.0435906,0,.0660929,.975846,.0432543,0,.075963,.970748,.0428293,0,.0863398,.964303,.042153,0,.0972035,.95772,.0414111,0,.108537,.950747,.0405893,0,.120325,.942533,.0394887,0,.132554,.934045,.0383544,0,.145215,.924942,.037057,0,.158296,.915811,.0356993,0,.17179,.90612,.0342401,0,.185691,.896434,.0328078,0,.199993,.886021,.031288,0,.214691,.876081,.0297776,0,.229782,.865608,.0282334,0,.245265,.854924,.026749,0,.261138,.843607,.02526,0,.277401,.832456,.0238214,0,.294056,.821342,.0224682,0,.311104,.809303,.0211297,0,.328548,.796468,.0198387,0,.346394,.784046,.0186227,0,.364645,.771262,.0174561,0,.38331,.758118,.0163806,0,.402396,.745075,.0153287,0,.421912,.731926,.0143647,0,.44187,.71863,.0134363,0,.462283,.705414,.0125603,0,.483165,.693792,.0117508,0,.504535,.683108,.0110016,0,.52641,.67183,.0102757,0,.548816,.66015,.00962044,0,.571776,.647907,.00898031,0,.595323,.635734,.00840811,0,.619489,.623208,.00786211,0,.644317,.610438,.00734953,0,.669852,.597345,.00687688,0,.696148,.584138,.00643469,0,.723267,.5707,.00602236,0,.75128,.556966,.0056324,0,.780258,.543607,.00528277,0,.810268,.530213,.00493999,0,.841311,.516912,.00462265,0,.873016,.503916,.0043307,0,.904762,.491146,.00406858,0,.936508,.478439,.00381436,0,.968254,.465834,.00358003,0,1,1,.0534039,0,0,1,.053404,0,0,.999998,.0534055,0,0,.999989,.0534116,0,0,.999968,.0534283,0,0,.999918,.0534633,0,155895e-9,.99983,.0535262,0,.00120914,.999685,.0536281,0,.00334944,.999461,.0537799,0,.00653077,.999119,.0539902,0,.0106718,.998582,.0542524,0,.0156907,.995919,.0540318,0,.0215147,.993735,.0538914,0,.0280801,.992126,.0539557,0,.0353323,.990266,.0540401,0,.0432247,.986317,.0536064,0,.0517172,.983213,.0534425,0,.0607754,.978303,.0528622,0,.0703698,.973665,.0523363,0,.0804742,.968091,.0516165,0,.0910667,.961026,.0505434,0,.102128,.954333,.049523,0,.113641,.946372,.0481698,0,.125591,.938254,.0467674,0,.137965,.929516,.0452341,0,.150754,.920106,.0435083,0,.163947,.910899,.0417399,0,.177537,.901532,.0399389,0,.191516,.891919,.0380901,0,.205881,.882006,.0362341,0,.220626,.871965,.0343444,0,.235749,.862145,.0324832,0,.251248,.852058,.0306681,0,.267121,.84161,.0289097,0,.283368,.830806,.0272079,0,.299992,.820476,.0256089,0,.316992,.809514,.0240394,0,.334374,.797865,.0225379,0,.35214,.785621,.0211235,0,.370296,.773765,.0197908,0,.388849,.761629,.0185235,0,.407807,.748891,.0173358,0,.427178,.736437,.0162305,0,.446974,.723707,.0151778,0,.467207,.710606,.0141791,0,.487892,.698019,.0132592,0,.509046,.686203,.0123887,0,.530687,.675692,.0115976,0,.552839,.664826,.0108325,0,.575527,.65349,.0101348,0,.59878,.641774,.00947756,0,.622634,.629794,.00886058,0,.647128,.617647,.00828526,0,.672308,.60534,.00775312,0,.698231,.592718,.00726033,0,.724958,.579746,.00679731,0,.752563,.566763,.00636111,0,.781127,.553515,.00595228,0,.810733,.540118,.00556876,0,.841426,.527325,.00523051,0,.873016,.514265,.00490712,0,.904762,.501406,.00460297,0,.936508,.488922,.00431247,0,.968254,.476541,.0040472,0,1,1,.0659184,0,0,1,.0659185,0,0,.999998,.06592,0,0,.999988,.0659259,0,0,.999963,.0659423,0,0,.999907,.0659764,0,374198e-9,.999806,.0660376,0,.00182071,.999639,.0661361,0,.0043894,.999378,.0662814,0,.00800055,.998985,.0664779,0,.0125594,.998285,.0666914,0,.0179786,.995071,.0661989,0,.0241822,.993172,.0660454,0,.031106,.991438,.0660105,0,.0386952,.988428,.0656875,0,.0469032,.985218,.0652913,0,.0556905,.981128,.0647107,0,.065023,.976015,.0638491,0,.0748717,.97097,.062993,0,.0852112,.964582,.0617927,0,.0960199,.957383,.0603626,0,.107279,.949969,.0588128,0,.118971,.941843,.0570274,0,.131084,.933624,.0551885,0,.143604,.924543,.053122,0,.156521,.914919,.0508897,0,.169825,.905773,.0486418,0,.18351,.896434,.0463364,0,.197569,.887195,.0440623,0,.211997,.877706,.0417799,0,.226789,.867719,.03945,0,.241944,.858587,.037243,0,.257458,.849317,.0350956,0,.273331,.839585,.0329852,0,.289563,.829856,.0310028,0,.306154,.819589,.0290953,0,.323108,.809714,.0272738,0,.340426,.79934,.0255631,0,.358113,.788224,.0239175,0,.376175,.776619,.0223831,0,.394616,.76521,.0209298,0,.413445,.753716,.0195786,0,.432671,.741564,.0183001,0,.452305,.729413,.0171259,0,.472358,.717146,.0159933,0,.492845,.70436,.0149495,0,.513783,.69219,.0139681,0,.535189,.680289,.0130577,0,.557087,.669611,.0122198,0,.5795,.659113,.0114174,0,.602459,.648148,.0106729,0,.625997,.636905,.00998997,0,.650154,.625154,.00934313,0,.674976,.613481,.00874839,0,.700518,.60154,.00818265,0,.726845,.58943,.00766889,0,.754032,.576828,.00717153,0,.782167,.564194,.00672696,0,.811344,.551501,.00630863,0,.841644,.538635,.00592177,0,.873016,.525724,.00554888,0,.904762,.513209,.00520225,0,.936508,.500457,.00488231,0,.968254,.48799,.00457153,0,1,1,.0810131,0,0,1,.0810133,0,0,.999997,.0810145,0,0,.999985,.08102,0,0,.999956,.0810347,0,195026e-10,.999893,.0810656,0,719316e-9,.999777,.0811205,0,.00259774,.999583,.081208,0,.00561807,.999281,.0813343,0,.00967472,.998813,.0814969,0,.0146627,.997597,.0815217,0,.0204902,.994379,.0808502,0,.0270802,.992744,.0806792,0,.0343674,.990745,.0804589,0,.0422974,.986646,.0796107,0,.0508242,.983611,.0790913,0,.0599087,.978869,.0780746,0,.0695175,.973475,.0768218,0,.0796223,.967845,.0754926,0,.0901983,.960778,.0737063,0,.101224,.953333,.0718052,0,.112682,.945274,.0695946,0,.124555,.936955,.0672492,0,.136831,.928319,.0647732,0,.149496,.919075,.0620947,0,.162542,.909114,.0591816,0,.175958,.900137,.0563917,0,.189739,.891069,.0535392,0,.203877,.882262,.0507642,0,.218368,.873232,.0479793,0,.233208,.864042,.045226,0,.248393,.855002,.0425413,0,.263923,.846569,.0400126,0,.279796,.837714,.0375269,0,.296012,.828918,.0352027,0,.312573,.819783,.0330011,0,.329479,.810129,.0308908,0,.346734,.800866,.0289112,0,.364342,.79093,.0270255,0,.382307,.780593,.0252758,0,.400637,.769511,.0236178,0,.419337,.758558,.0220652,0,.438418,.747632,.0206289,0,.457889,.736146,.0192873,0,.477761,.724093,.0180333,0,.49805,.71234,.0168264,0,.51877,.700201,.015746,0,.53994,.687949,.0147027,0,.561581,.676163,.0137512,0,.583718,.665001,.0128655,0,.60638,.65472,.0120366,0,.629599,.644213,.0112604,0,.653415,.633382,.0105413,0,.677874,.62212,.00986498,0,.70303,.610631,.00923308,0,.728948,.599078,.00864206,0,.755706,.587519,.00811784,0,.783396,.575505,.00761237,0,.812121,.563148,.00713949,0,.841989,.550828,.00668379,0,.873035,.538458,.00627715,0,.904762,.525905,.00588336,0,.936508,.513517,.00552687,0,.968254,.501395,.00519681,0,1,1,.0991506,0,0,1,.0991504,0,0,.999996,.0991515,0,0,.999984,.0991558,0,0,.999947,.0991672,0,114389e-9,.999874,.0991912,0,.00121503,.999739,.0992331,0,.00356108,.999514,.0992983,0,.00705578,.999159,.0993877,0,.011574,.998586,.0994837,0,.017003,.995731,.0988425,0,.0232484,.993384,.098276,0,.0302318,.991615,.0979269,0,.0378884,.989029,.0973432,0,.0461641,.985373,.0963539,0,.0550136,.981278,.0952306,0,.0643988,.975777,.0936233,0,.0742868,.970526,.0920219,0,.0846501,.963755,.0898912,0,.0954644,.956676,.0876064,0,.106709,.948099,.0847751,0,.118367,.939718,.0818638,0,.130423,.931305,.078857,0,.142862,.922342,.0756127,0,.155674,.912842,.0721473,0,.168849,.903304,.0686195,0,.182378,.89411,.0650589,0,.196255,.885512,.0616022,0,.210473,.877193,.0582434,0,.225027,.86877,.0548979,0,.239915,.860267,.0516095,0,.255132,.851915,.048468,0,.270678,.843912,.0454447,0,.286551,.83604,.0425612,0,.302751,.828245,.0398752,0,.31928,.820159,.0373198,0,.336138,.81167,.034916,0,.35333,.802659,.0326402,0,.370858,.793921,.0304901,0,.388728,.784713,.0284857,0,.406944,.774946,.0266186,0,.425515,.76448,.0248593,0,.444449,.753793,.0232114,0,.463756,.743506,.0217039,0,.483447,.732555,.0202841,0,.503535,.720965,.0189648,0,.524036,.709422,.0177189,0,.544968,.697756,.0165626,0,.56635,.685565,.015483,0,.588208,.673987,.0144892,0,.610569,.66244,.0135607,0,.633466,.651675,.0126956,0,.656936,.641598,.0118788,0,.681025,.63121,.0111261,0,.705788,.620514,.010437,0,.731289,.609366,.00978747,0,.757606,.598137,.00917257,0,.784834,.586966,.00859778,0,.813085,.575549,.00806803,0,.842485,.563797,.00757294,0,.87313,.551758,.00710592,0,.904762,.539894,.0066841,0,.936508,.527901,.00627901,0,.968254,.515819,.00590506,0,1,1,.120864,0,0,1,.120864,0,0,.999996,.120864,0,0,.99998,.120867,0,0,.99994,.120872,0,323781e-9,.999852,.120884,0,.00188693,.999693,.120903,0,.00473489,.999426,.120929,0,.00872704,.999002,.120955,0,.0137237,.998235,.120918,0,.0196068,.994608,.119764,0,.0262803,.992997,.119265,0,.0336657,.990968,.11863,0,.0416987,.987002,.117261,0,.0503261,.983524,.116009,0,.0595035,.97875,.114252,0,.0691935,.972652,.11193,0,.0793645,.966613,.109555,0,.0899894,.959275,.106612,0,.101045,.951272,.103375,0,.112512,.942323,.0996594,0,.124372,.933679,.0958841,0,.136611,.924822,.0919265,0,.149216,.915742,.0878061,0,.162176,.906348,.0834894,0,.175482,.896883,.079085,0,.189125,.88774,.0746745,0,.203098,.87986,.0705773,0,.217396,.871998,.0665005,0,.232015,.864325,.0625413,0,.24695,.856685,.0586781,0,.2622,.84925,.0550063,0,.277761,.841719,.0514727,0,.293634,.834755,.0481398,0,.309819,.827853,.0450172,0,.326315,.820888,.0420969,0,.343126,.813616,.0393702,0,.360254,.805767,.0367771,0,.377701,.797338,.0343274,0,.395474,.789122,.0320529,0,.413577,.780601,.0299485,0,.432018,.771424,.0279812,0,.450804,.761502,.0261054,0,.469944,.751166,.0243942,0,.489451,.741276,.0228087,0,.509337,.730898,.0213265,0,.529617,.719878,.0199307,0,.550307,.708379,.0186574,0,.571428,.697165,.0174446,0,.593003,.685554,.0163144,0,.615059,.673631,.015276,0,.637628,.662385,.0143003,0,.660746,.651059,.0134112,0,.68446,.640451,.0125794,0,.70882,.630536,.011793,0,.733893,.620316,.0110547,0,.759756,.609722,.0103668,0,.786505,.598804,.00973009,0,.814259,.587871,.00912812,0,.843157,.577121,.00858916,0,.87334,.566019,.00807333,0,.904762,.554664,.00759687,0,.936508,.543101,.00714759,0,.968254,.531558,.00673418,0,1,1,.146767,0,0,1,.146767,0,0,.999997,.146767,0,0,.999977,.146765,0,320658e-11,.999929,.146762,0,682576e-9,.999823,.146753,0,.00276402,.999633,.146735,0,.00614771,.999314,.146699,0,.0106613,.998796,.14662,0,.0161546,.997124,.146107,0,.0225063,.994062,.144857,0,.0296198,.992154,.144011,0,.037417,.989186,.142712,0,.0458348,.985279,.140926,0,.0548211,.980826,.13885,0,.0643326,.975056,.136168,0,.074333,.969005,.133217,0,.0847917,.961554,.12959,0,.0956828,.954206,.125886,0,.106984,.945046,.121335,0,.118675,.935678,.116492,0,.130741,.926748,.111635,0,.143166,.917764,.106625,0,.155939,.908358,.101325,0,.169049,.899219,.0960249,0,.182487,.890089,.0906527,0,.196245,.881488,.0853905,0,.210317,.874031,.0804177,0,.224697,.866932,.0756005,0,.23938,.859976,.0709019,0,.254364,.853375,.0664391,0,.269646,.846971,.0622012,0,.285223,.840483,.058129,0,.301096,.833969,.0542762,0,.317265,.82806,.0507042,0,.333729,.822128,.047368,0,.350491,.815989,.044272,0,.367554,.809336,.0413444,0,.38492,.802177,.038601,0,.402594,.79441,.0360227,0,.420582,.786573,.0336383,0,.438891,.778619,.0314321,0,.457527,.77,.029362,0,.476499,.760698,.0274102,0,.49582,.750932,.0256146,0,.5155,.740993,.023974,0,.535555,.731159,.0224182,0,.556,.720836,.0209889,0,.576855,.709913,.0196411,0,.598143,.698415,.0183824,0,.619888,.68745,.0172222,0,.642123,.676154,.0161509,0,.664883,.664383,.0151397,0,.688211,.6533,.0141873,0,.71216,.642072,.0133105,0,.736792,.631412,.0124932,0,.762186,.621622,.0117408,0,.788439,.611681,.0110358,0,.815672,.60142,.0103775,0,.844034,.59083,.00975623,0,.873699,.580254,.00918084,0,.904765,.569841,.00864721,0,.936508,.559224,.00815731,0,.968254,.548315,.00767924,0,1,1,.177563,0,0,1,.177563,0,0,.999994,.177562,0,0,.999972,.177555,0,664171e-10,.999914,.177536,0,.0012276,.999787,.177496,0,.00388025,.999556,.17742,0,.00783463,.999165,.177285,0,.0128953,.9985,.177037,0,.0189053,.995388,.175634,0,.025742,.993102,.174375,0,.033309,.990992,.173121,0,.0415298,.986932,.170896,0,.0503425,.982786,.16847,0,.0596964,.977592,.165455,0,.0695498,.971075,.161676,0,.0798676,.963967,.157458,0,.0906201,.956397,.152836,0,.101783,.947489,.147467,0,.113333,.937564,.14145,0,.125254,.928182,.135383,0,.137529,.919027,.129212,0,.150144,.909618,.12276,0,.163088,.900492,.116273,0,.176351,.891671,.1098,0,.189924,.883146,.103362,0,.203799,.875151,.0970799,0,.21797,.868338,.0911732,0,.232433,.862033,.0854966,0,.247182,.856107,.0800691,0,.262216,.850644,.0749618,0,.27753,.845261,.070079,0,.293124,.839885,.0654321,0,.308997,.834609,.0610975,0,.325149,.829083,.0569741,0,.341581,.82404,.0531736,0,.358294,.818968,.049665,0,.37529,.813496,.0463856,0,.392573,.807533,.0433217,0,.410148,.80099,.0404402,0,.428019,.793891,.0377578,0,.446192,.786281,.0352616,0,.464676,.778773,.0329577,0,.483478,.770737,.030808,0,.502608,.762094,.0287964,0,.522079,.752898,.0269254,0,.541905,.743306,.0251926,0,.5621,.733416,.023595,0,.582684,.723742,.0221155,0,.603677,.713542,.0207435,0,.625106,.702755,.019434,0,.646998,.691484,.0182046,0,.66939,.680531,.0170771,0,.692324,.66953,.0160339,0,.715849,.658126,.0150677,0,.740028,.646933,.0141551,0,.764937,.636107,.0133179,0,.790673,.625271,.0125284,0,.817358,.615225,.0117937,0,.84515,.605678,.0111181,0,.874244,.59583,.0104759,0,.904828,.585704,.00986672,0,.936508,.575413,.00929712,0,.968254,.565373,.00876713,0,1,1,.214058,0,0,.999999,.214058,0,0,.999994,.214055,0,0,.999966,.214039,0,259642e-9,.999893,.213998,0,.00200075,.999737,.21391,0,.00527775,.999449,.213745,0,.00983959,.99896,.213458,0,.0154755,.9979,.212855,0,.0220249,.994278,.210779,0,.0293654,.992254,.20926,0,.0374021,.98881,.206908,0,.0460604,.984715,.204009,0,.0552802,.979738,.200471,0,.0650127,.972884,.195813,0,.0752175,.965996,.190856,0,.0858612,.957974,.185077,0,.0969155,.949155,.17868,0,.108356,.939288,.171513,0,.120163,.928996,.163838,0,.132319,.919563,.156246,0,.144808,.910004,.148359,0,.157618,.900791,.140417,0,.170737,.892135,.132569,0,.184155,.883803,.124741,0,.197866,.876034,.117091,0,.211861,.869219,.109835,0,.226134,.863062,.102859,0,.240682,.857795,.0962928,0,.255499,.853009,.0900725,0,.270583,.848603,.0842101,0,.285931,.844335,.0786527,0,.301542,.840208,.0734397,0,.317415,.836035,.0685334,0,.33355,.83172,.0639275,0,.349948,.827135,.0595909,0,.36661,.822797,.0556204,0,.383539,.818387,.0519394,0,.400738,.813565,.0485317,0,.41821,.808142,.0453138,0,.435961,.802212,.0423354,0,.453997,.79573,.0395553,0,.472324,.788741,.036988,0,.490951,.781093,.0345688,0,.509887,.773597,.0323297,0,.529144,.765622,.0302719,0,.548735,.757083,.0283477,0,.568674,.747992,.0265562,0,.588979,.738591,.0248844,0,.609671,.728719,.0233342,0,.630773,.719146,.0219081,0,.652314,.709165,.0205711,0,.674328,.69875,.0193248,0,.696854,.687884,.0181582,0,.719942,.676818,.0170746,0,.743651,.666247,.0160718,0,.768057,.655284,.0151262,0,.793253,.64401,.0142561,0,.819363,.633353,.0134327,0,.846547,.622674,.012653,0,.875017,.612265,.0119354,0,.905021,.602455,.0112533,0,.936508,.593147,.0106234,0,.968254,.583592,.0100213,0,1,1,.25717,0,0,1,.25717,0,0,.999992,.257164,0,0,.999958,.257135,0,641715e-9,.999864,.25706,0,.00305314,.999666,.256897,0,.00700975,.999302,.256596,0,.0122194,.998663,.25607,0,.0184622,.995607,.254123,0,.0255773,.993094,.252081,0,.0334439,.9907,.249867,0,.0419696,.98594,.246118,0,.0510823,.981214,.242049,0,.0607242,.974966,.236869,0,.0708486,.967589,.230724,0,.081417,.95915,.223635,0,.0923974,.950257,.21596,0,.103763,.940165,.207296,0,.115491,.929396,.197901,0,.127562,.919288,.188437,0,.13996,.909428,.178762,0,.15267,.900105,.169072,0,.165679,.891418,.159478,0,.178979,.883347,.15002,0,.192558,.875992,.140813,0,.20641,.869466,.13196,0,.220529,.863699,.123501,0,.234907,.858553,.115436,0,.249542,.854379,.107901,0,.264428,.850894,.10088,0,.279564,.847632,.0942296,0,.294947,.844571,.0879861,0,.310575,.84163,.0821534,0,.326448,.838542,.0766409,0,.342566,.835412,.0715322,0,.358929,.831899,.0666883,0,.37554,.828177,.0622175,0,.392399,.82416,.0580452,0,.409511,.820393,.054267,0,.426878,.816068,.0507172,0,.444506,.811201,.0474041,0,.4624,.805785,.0443174,0,.480566,.799878,.0414562,0,.499013,.793469,.0388147,0,.517749,.786473,.0363453,0,.536785,.778874,.0340225,0,.556134,.771277,.0318599,0,.575809,.763426,.0298859,0,.595827,.755044,.0280357,0,.616207,.746161,.0262979,0,.636973,.737124,.0247295,0,.65815,.72761,.0232514,0,.679772,.717822,.0218755,0,.701876,.708279,.0205942,0,.724509,.698333,.0193947,0,.74773,.68802,.0182717,0,.771609,.677321,.0172044,0,.79624,.666504,.0162122,0,.821743,.656184,.0152924,0,.84828,.64556,.0144326,0,.876069,.634636,.0136157,0,.905404,.624124,.0128612,0,.936508,.613914,.0121435,0,.968254,.603589,.0114887,0,1,1,.307946,0,0,.999999,.307945,0,0,.999988,.307934,0,204479e-10,.999944,.307886,0,.00127833,.999824,.307756,0,.00445047,.999565,.30748,0,.00914673,.999085,.306966,0,.0150498,.998103,.306004,0,.0219367,.994249,.303028,0,.0296485,.991807,.300435,0,.038068,.987773,.296554,0,.0471062,.982673,.2916,0,.0566942,.976623,.285641,0,.0667768,.968757,.27815,0,.0773099,.959849,.269529,0,.088257,.950663,.260248,0,.0995879,.940129,.249704,0,.111277,.92895,.238291,0,.123304,.917996,.226501,0,.13565,.907813,.214669,0,.148299,.898305,.202835,0,.161237,.889626,.191158,0,.174455,.88175,.179695,0,.187941,.874715,.168548,0,.201687,.868746,.15792,0,.215687,.863703,.147807,0,.229933,.859315,.138149,0,.24442,.855538,.128993,0,.259145,.852428,.120414,0,.274103,.850168,.112498,0,.289293,.848132,.105054,0,.304711,.846291,.0981087,0,.320357,.844431,.0915942,0,.33623,.842493,.0855056,0,.35233,.840368,.0798204,0,.368658,.83798,.0745097,0,.385214,.83523,.0695424,0,.402002,.832091,.0649092,0,.419023,.828667,.0606291,0,.436282,.824805,.0566523,0,.453782,.820988,.0530229,0,.471529,.816635,.0496364,0,.489528,.811725,.0464658,0,.507788,.806316,.0435082,0,.526317,.800469,.0407873,0,.545124,.794107,.038255,0,.564221,.787218,.0358825,0,.583621,.779872,.0336785,0,.603341,.772097,.0316379,0,.623397,.764484,.0297379,0,.643812,.756428,.0279581,0,.664611,.748022,.0263153,0,.685824,.739268,.0247799,0,.707488,.73024,.0233385,0,.729646,.720893,.0220035,0,.752354,.71119,.0207555,0,.77568,.701791,.0195843,0,.799715,.692184,.0184891,0,.824574,.682258,.0174541,0,.850417,.67206,.0164873,0,.877466,.661717,.0155959,0,.90604,.651462,.0147519,0,.936528,.641467,.0139727,0,.968254,.631229,.0132363,0,1,1,.367573,0,0,.999999,.367571,0,0,.999984,.367553,0,183382e-9,.999925,.367473,0,.00225254,.999759,.367259,0,.00628165,.99941,.366801,0,.0117858,.998739,.365946,0,.0184359,.995529,.363191,0,.0260114,.992875,.360171,0,.0343581,.989135,.355981,0,.0433637,.984166,.350401,0,.0529438,.977871,.343348,0,.0630334,.96951,.334341,0,.0735805,.959964,.323862,0,.0845437,.950162,.312521,0,.095889,.938882,.299577,0,.107588,.926992,.285573,0,.119617,.915589,.271212,0,.131957,.904791,.256611,0,.144591,.895177,.242224,0,.157503,.886403,.227952,0,.170682,.878957,.214192,0,.184117,.872418,.200795,0,.197799,.867029,.188015,0,.21172,.862835,.175975,0,.225873,.859411,.164526,0,.240253,.856655,.153693,0,.254854,.854519,.14352,0,.269673,.852828,.13397,0,.284707,.851412,.124984,0,.299953,.850609,.116748,0,.315408,.849855,.10905,0,.331073,.849017,.101839,0,.346946,.848079,.0951359,0,.363028,.846911,.0888774,0,.379318,.845445,.0830375,0,.395818,.84362,.0775844,0,.41253,.841411,.0725054,0,.429457,.838768,.0677691,0,.446602,.835801,.0634016,0,.463968,.832341,.0593095,0,.481561,.828424,.0555121,0,.499386,.824312,.052024,0,.51745,.819918,.0487865,0,.535761,.815072,.0457801,0,.554328,.809863,.0430184,0,.573162,.804164,.0404245,0,.592275,.798034,.0380146,0,.611681,.791436,.0357436,0,.631398,.784498,.0336475,0,.651445,.777125,.0316666,0,.671845,.769365,.0298122,0,.692628,.761579,.0281001,0,.713827,.753746,.0265049,0,.735484,.745573,.0250067,0,.75765,.737083,.0236026,0,.78039,.728545,.0223302,0,.803789,.719691,.0211243,0,.82796,.710569,.0199983,0,.853056,.701216,.0189569,0,.879298,.692094,.0179702,0,.907014,.682909,.0170418,0,.936691,.673509,.0161732,0,.968254,.663863,.0153406,0,1,1,.437395,0,0,.999998,.437394,0,0,.99998,.437363,0,616704e-9,.999891,.437232,0,.00367925,.999656,.436877,0,.00867446,.999148,.436121,0,.0150679,.997959,.434564,0,.022531,.993464,.430134,0,.0308507,.990606,.426077,0,.0398805,.985027,.419397,0,.0495148,.978491,.41118,0,.0596749,.969643,.40048,0,.0703001,.959189,.38769,0,.0813427,.948223,.373575,0,.0927641,.935955,.357622,0,.104533,.923237,.34043,0,.116624,.911074,.322735,0,.129015,.899724,.30479,0,.141687,.890189,.287392,0,.154626,.881796,.270248,0,.167818,.874781,.253659,0,.181252,.869166,.237786,0,.194918,.864725,.222618,0,.208807,.861565,.208356,0,.222913,.859284,.194867,0,.237229,.857677,.18212,0,.25175,.856714,.17018,0,.266473,.856155,.158969,0,.281392,.8558,.148413,0,.296505,.855672,.138578,0,.311811,.855538,.129345,0,.327306,.855689,.120861,0,.342991,.855767,.112969,0,.358864,.855618,.105593,0,.374925,.85525,.0987451,0,.391176,.854583,.0923727,0,.407616,.853534,.0864143,0,.424249,.852061,.0808338,0,.441076,.850253,.0756771,0,.4581,.848004,.0708612,0,.475324,.845333,.0663784,0,.492754,.842376,.0622631,0,.510394,.838956,.0584112,0,.528251,.835121,.0548328,0,.546331,.830842,.0514838,0,.564644,.826212,.048355,0,.583198,.821522,.0454714,0,.602005,.816551,.0428263,0,.621078,.811211,.0403612,0,.640434,.805479,.038039,0,.660089,.799409,.0358739,0,.680066,.79306,.0338727,0,.70039,.786395,.0319985,0,.721094,.779416,.030241,0,.742215,.77214,.0285951,0,.7638,.764636,.0270747,0,.785912,.756836,.0256354,0,.808628,.749315,.0243027,0,.832055,.741561,.0230497,0,.856338,.733589,.0218801,0,.88169,.725479,.020784,0,.908441,.717255,.0197702,0,.937125,.708829,.0188168,0,.968254,.700191,.0179113,0,1,1,.518937,0,0,.999998,.518933,0,0,.999967,.518883,0,.00147741,.999832,.51866,0,.00573221,.999466,.518057,0,.011826,.998644,.516752,0,.0192116,.994458,.512347,0,.027573,.991223,.507675,0,.0367099,.985515,.500188,0,.046487,.978308,.490408,0,.0568071,.968359,.477357,0,.0675984,.95682,.461752,0,.0788059,.943929,.443796,0,.090386,.930224,.423893,0,.102304,.916514,.402682,0,.114532,.903653,.380914,0,.127047,.892315,.359212,0,.139828,.882942,.338102,0,.152861,.875438,.31773,0,.16613,.869642,.298186,0,.179624,.865304,.279491,0,.193332,.862382,.261804,0,.207247,.860666,.245146,0,.22136,.859788,.229406,0,.235666,.859608,.214605,0,.250158,.859912,.200691,0,.264832,.86053,.187623,0,.279684,.861368,.17539,0,.294711,.862237,.163901,0,.309911,.863127,.153175,0,.32528,.863923,.143147,0,.340819,.864567,.133781,0,.356524,.865013,.125042,0,.372397,.86539,.116952,0,.388438,.865591,.109476,0,.404645,.865517,.102542,0,.421022,.865084,.0960688,0,.437569,.864309,.0900499,0,.454287,.863151,.0844328,0,.471181,.861649,.0792218,0,.488253,.859742,.0743482,0,.505507,.857446,.0697963,0,.522947,.854757,.0655364,0,.54058,.851783,.061608,0,.558412,.848516,.0579701,0,.576449,.844897,.0545742,0,.594701,.840956,.0514167,0,.613178,.836676,.0484598,0,.631892,.832075,.0456934,0,.650856,.827191,.0431178,0,.670088,.822295,.0407718,0,.689606,.817294,.0386032,0,.709434,.812013,.0365675,0,.7296,.806465,.0346547,0,.750138,.800691,.0328717,0,.771093,.794709,.031211,0,.792519,.788493,.0296504,0,.814488,.782049,.0281782,0,.837097,.775403,.0267965,0,.860481,.76857,.0255002,0,.884842,.761536,.0242759,0,.910494,.754303,.0231142,0,.937985,.74692,.0220305,0,.968254,.739745,.0210192,0,1,1,.613914,0,0,.999996,.613907,0,963597e-10,.999942,.613814,0,.00301247,.999704,.613407,0,.00870385,.999046,.612302,0,.0160714,.995516,.608266,0,.0245899,.991726,.602863,0,.0339681,.985157,.593956,0,.0440254,.97642,.581748,0,.0546409,.964404,.565183,0,.0657284,.950601,.545273,0,.0772246,.935158,.522129,0,.0890812,.919364,.496782,0,.10126,.904754,.470571,0,.113731,.89176,.444037,0,.126469,.881492,.418322,0,.139454,.873656,.393522,0,.15267,.868053,.369795,0,.166101,.864336,.347171,0,.179736,.862259,.325737,0,.193565,.861556,.305532,0,.207578,.861776,.286416,0,.221769,.862661,.268355,0,.23613,.864015,.251334,0,.250656,.865711,.235352,0,.265343,.867519,.220302,0,.280187,.869351,.206161,0,.295183,.871144,.192908,0,.31033,.872839,.180505,0,.325624,.874307,.168848,0,.341065,.875667,.158021,0,.35665,.876758,.147877,0,.37238,.87764,.138441,0,.388253,.878237,.129627,0,.404269,.878563,.121415,0,.42043,.878572,.113741,0,.436735,.87842,.106652,0,.453187,.878057,.100097,0,.469786,.877413,.0940128,0,.486536,.87646,.0883462,0,.503439,.875233,.0830924,0,.520498,.8737,.0781975,0,.537717,.871873,.07364,0,.555102,.86978,.0694103,0,.572657,.867405,.0654696,0,.59039,.864751,.0617914,0,.608307,.861818,.0583491,0,.626419,.858645,.0551443,0,.644733,.855307,.0521894,0,.663264,.851736,.0494334,0,.682025,.847927,.0468504,0,.701032,.843888,.0444261,0,.720308,.839629,.0421497,0,.739875,.835158,.0400082,0,.759764,.830509,.0380076,0,.780014,.825714,.0361488,0,.800673,.820729,.0343956,0,.821803,.815751,.0327781,0,.843492,.810752,.031275,0,.86586,.805587,.0298542,0,.889087,.800317,.0285397,0,.913466,.79489,.0272948,0,.93952,.789314,.0261139,0,.96835,.783593,.0249938,0,1,1,.724258,0,0,.999992,.724243,0,726889e-9,.99987,.724044,0,.00569574,.999336,.72317,0,.0131702,.996271,.719432,0,.0220738,.991159,.712576,0,.0319405,.982465,.700927,0,.0425202,.97049,.684297,0,.0536599,.953973,.661244,0,.065258,.935546,.633804,0,.0772427,.916596,.603071,0,.0895616,.899353,.57105,0,.102175,.885216,.539206,0,.11505,.875076,.508714,0,.128164,.868334,.479571,0,.141495,.864414,.451796,0,.155026,.862678,.425328,0,.168745,.862835,.400352,0,.182639,.864067,.376532,0,.196699,.866086,.35391,0,.210915,.868557,.332424,0,.225282,.871271,.312053,0,.239792,.874058,.292764,0,.25444,.8768,.27453,0,.269223,.87939,.257297,0,.284135,.8819,.24114,0,.299174,.884187,.225934,0,.314337,.886262,.211669,0,.329622,.888119,.198311,0,.345026,.889709,.185783,0,.360549,.891054,.174063,0,.376189,.892196,.163143,0,.391946,.893101,.152952,0,.407819,.893803,.143475,0,.423808,.894277,.134647,0,.439914,.894532,.126434,0,.456137,.894576,.1188,0,.472479,.894393,.111694,0,.48894,.893976,.105069,0,.505523,.893346,.0989077,0,.52223,.892502,.0931724,0,.539064,.891441,.0878276,0,.556028,.890276,.082903,0,.573125,.888972,.0783505,0,.590361,.887469,.0741083,0,.607741,.885785,.0701633,0,.62527,.883914,.0664835,0,.642957,.881872,.0630567,0,.660809,.879651,.0598527,0,.678836,.877267,.0568615,0,.69705,.874717,.05406,0,.715465,.872012,.0514378,0,.734098,.869157,.0489805,0,.752968,.866155,.0466727,0,.772101,.863014,.0445056,0,.791529,.859748,.0424733,0,.81129,.856416,.0405957,0,.831438,.852958,.0388273,0,.852044,.849382,.0371619,0,.87321,.845694,.0355959,0,.89509,.841893,.0341155,0,.917932,.837981,.0327141,0,.942204,.833963,.0313856,0,.968981,.829847,.0301275,0,1,1,.85214,0,0,.999969,.852095,0,.00279627,.999483,.851408,0,.0107635,.994545,.84579,0,.0206454,.986188,.835231,0,.0315756,.969847,.814687,0,.0432021,.945951,.783735,0,.0553396,.91917,.746074,0,.0678766,.895488,.706938,0,.0807395,.878232,.669534,0,.0938767,.868252,.635168,0,.10725,.863873,.603069,0,.120832,.863369,.572514,0,.134598,.86545,.543169,0,.148533,.868803,.514578,0,.16262,.872794,.486762,0,.176849,.87702,.459811,0,.19121,.881054,.433654,0,.205694,.884974,.408574,0,.220294,.888587,.384525,0,.235005,.891877,.36156,0,.24982,.894793,.339661,0,.264737,.89743,.318913,0,.279751,.899796,.299302,0,.294859,.901943,.280843,0,.310058,.903858,.263481,0,.325346,.905574,.247197,0,.340721,.907069,.231915,0,.356181,.908379,.217614,0,.371725,.90952,.20425,0,.387353,.910483,.191758,0,.403063,.91128,.180092,0,.418854,.911936,.169222,0,.434727,.912454,.159098,0,.450682,.912835,.149668,0,.466718,.913078,.140884,0,.482837,.913192,.132709,0,.499038,.913175,.125095,0,.515324,.91304,.118012,0,.531695,.912781,.111417,0,.548153,.91241,.105281,0,.5647,.911924,.0995691,0,.581338,.911331,.0942531,0,.59807,.910637,.0893076,0,.6149,.90984,.0846998,0,.63183,.908941,.0804044,0,.648865,.907944,.0763984,0,.666011,.906857,.0726638,0,.683273,.90568,.0691783,0,.700659,.904416,.0659222,0,.718176,.903067,.0628782,0,.735834,.901637,.0600307,0,.753646,.900128,.0573647,0,.771625,.898544,.0548668,0,.78979,.89689,.052527,0,.808162,.895165,.0503306,0,.826771,.893371,.0482668,0,.845654,.891572,.0463605,0,.864863,.889763,.0445998,0,.884472,.887894,.0429451,0,.904592,.885967,.0413884,0,.925407,.883984,.0399225,0,.947271,.881945,.0385405,0,.97105,.879854,.0372362,0,1,.999804,.995833,0,0,.938155,.933611,0,.0158731,.864755,.854311,0,.0317461,.888594,.865264,0,.0476191,.905575,.863922,0,.0634921,.915125,.850558,0,.0793651,.920665,.829254,0,.0952381,.924073,.802578,0,.111111,.926304,.772211,0,.126984,.927829,.739366,0,.142857,.928924,.705033,0,.15873,.92973,.670019,0,.174603,.930339,.634993,0,.190476,.930811,.600485,0,.206349,.931191,.566897,0,.222222,.93149,.534485,0,.238095,.931737,.503429,0,.253968,.931939,.473811,0,.269841,.932108,.445668,0,.285714,.93225,.418993,0,.301587,.932371,.393762,0,.31746,.932474,.369939,0,.333333,.932562,.347479,0,.349206,.932638,.326336,0,.365079,.932703,.306462,0,.380952,.93276,.287805,0,.396825,.932809,.270313,0,.412698,.932851,.253933,0,.428571,.932887,.23861,0,.444444,.932917,.224289,0,.460317,.932943,.210917,0,.47619,.932965,.19844,0,.492063,.932982,.186807,0,.507937,.932995,.175966,0,.52381,.933005,.165869,0,.539683,.933011,.156468,0,.555556,.933013,.147719,0,.571429,.933013,.139579,0,.587302,.93301,.132007,0,.603175,.933004,.124965,0,.619048,.932994,.118416,0,.634921,.932982,.112326,0,.650794,.932968,.106663,0,.666667,.93295,.101397,0,.68254,.932931,.0964993,0,.698413,.932908,.0919438,0,.714286,.932883,.0877057,0,.730159,.932856,.0837623,0,.746032,.932827,.0800921,0,.761905,.932796,.0766754,0,.777778,.932762,.0734936,0,.793651,.932727,.0705296,0,.809524,.932689,.0677676,0,.825397,.93265,.0651929,0,.84127,.932609,.0627917,0,.857143,.932565,.0605515,0,.873016,.932521,.0584606,0,.888889,.932474,.0565082,0,.904762,.932427,.0546841,0,.920635,.932377,.0529793,0,.936508,.932326,.0513851,0,.952381,.932274,.0498936,0,.968254,.93222,.0484975,0,.984127,.932164,.0471899,0,1],r=new Float32Array(e),i=new Float32Array(t);n.UniformsLib.LTC_FLOAT_1=new n.DataTexture(r,64,64,n.RGBAFormat,n.FloatType,n.UVMapping,n.ClampToEdgeWrapping,n.ClampToEdgeWrapping,n.LinearFilter,n.NearestFilter,1),n.UniformsLib.LTC_FLOAT_2=new n.DataTexture(i,64,64,n.RGBAFormat,n.FloatType,n.UVMapping,n.ClampToEdgeWrapping,n.ClampToEdgeWrapping,n.LinearFilter,n.NearestFilter,1),n.UniformsLib.LTC_FLOAT_1.needsUpdate=!0,n.UniformsLib.LTC_FLOAT_2.needsUpdate=!0;const a=new Uint16Array(e.length);e.forEach((function(e,t){a[t]=n.DataUtils.toHalfFloat(e)}));const s=new Uint16Array(t.length);t.forEach((function(e,t){s[t]=n.DataUtils.toHalfFloat(e)})),n.UniformsLib.LTC_HALF_1=new n.DataTexture(a,64,64,n.RGBAFormat,n.HalfFloatType,n.UVMapping,n.ClampToEdgeWrapping,n.ClampToEdgeWrapping,n.LinearFilter,n.NearestFilter,1),n.UniformsLib.LTC_HALF_2=new n.DataTexture(s,64,64,n.RGBAFormat,n.HalfFloatType,n.UVMapping,n.ClampToEdgeWrapping,n.ClampToEdgeWrapping,n.LinearFilter,n.NearestFilter,1),n.UniformsLib.LTC_HALF_1.needsUpdate=!0,n.UniformsLib.LTC_HALF_2.needsUpdate=!0}}class Ug{static fromCubeTexture(e){let t=0;const r=new n.Vector3,i=new n.Vector3,a=new n.Color,s=[0,0,0,0,0,0,0,0,0],o=new n.SphericalHarmonics3,l=o.coefficients;for(let u=0;u<6;u++){const o=e.image[u],c=o.width,h=o.height,d=document.createElement("canvas");d.width=c,d.height=h;const p=d.getContext("2d");p.drawImage(o,0,0,c,h);const f=p.getImageData(0,0,c,h),m=f.data,g=f.width,v=2/g;for(let A=0,y=m.length;A<y;A+=4){a.setRGB(m[A]/255,m[A+1]/255,m[A+2]/255),"colorSpace"in e?"srgb"===e.colorSpace&&a.convertSRGBToLinear():3001===e.encoding&&a.convertSRGBToLinear();const o=A/4,c=(o%g+.5)*v-1,h=1-(Math.floor(o/g)+.5)*v;switch(u){case 0:r.set(-1,h,-c);break;case 1:r.set(1,h,c);break;case 2:r.set(-c,1,-h);break;case 3:r.set(-c,-1,h);break;case 4:r.set(-c,h,1);break;case 5:r.set(c,h,-1)}const d=r.lengthSq(),p=4/(Math.sqrt(d)*d);t+=p,i.copy(r).normalize(),n.SphericalHarmonics3.getBasisAt(i,s);for(let e=0;e<9;e++)l[e].x+=s[e]*a.r*p,l[e].y+=s[e]*a.g*p,l[e].z+=s[e]*a.b*p}}const c=4*Math.PI/t;for(let n=0;n<9;n++)l[n].x*=c,l[n].y*=c,l[n].z*=c;return new n.LightProbe(o)}static fromCubeRenderTarget(e,t){let r=0;const i=new n.Vector3,a=new n.Vector3,s=new n.Color,o=[0,0,0,0,0,0,0,0,0],l=new n.SphericalHarmonics3,c=l.coefficients;for(let h=0;h<6;h++){const l=t.width,u=new Uint8Array(l*l*4);e.readRenderTargetPixels(t,0,0,l,l,u,h);const d=2/l;for(let e=0,p=u.length;e<p;e+=4){s.setRGB(u[e]/255,u[e+1]/255,u[e+2]/255),"colorSpace"in t.texture?"srgb"===t.texture.colorSpace&&s.convertSRGBToLinear():3001===t.texture.encoding&&s.convertSRGBToLinear();const p=e/4,f=(p%l+.5)*d-1,m=1-(Math.floor(p/l)+.5)*d;switch(h){case 0:i.set(1,m,-f);break;case 1:i.set(-1,m,f);break;case 2:i.set(f,1,-m);break;case 3:i.set(f,-1,m);break;case 4:i.set(f,m,1);break;case 5:i.set(-f,m,-1)}const g=i.lengthSq(),v=4/(Math.sqrt(g)*g);r+=v,a.copy(i).normalize(),n.SphericalHarmonics3.getBasisAt(a,o);for(let e=0;e<9;e++)c[e].x+=o[e]*s.r*v,c[e].y+=o[e]*s.g*v,c[e].z+=o[e]*s.b*v}}const u=4*Math.PI/r;for(let n=0;n<9;n++)c[n].x*=u,c[n].y*=u,c[n].z*=u;return new n.LightProbe(l)}}var Ng=r(71246),kg=r(33785);class Og{constructor(e,t,r,i,a){this.degree1=e,this.degree2=t,this.knots1=r,this.knots2=i,this.controlPoints=[];const s=r.length-e-1,o=i.length-t-1;for(let l=0;l<s;++l){this.controlPoints[l]=[];for(let e=0;e<o;++e){const t=a[l][e];this.controlPoints[l][e]=new n.Vector4(t.x,t.y,t.z,t.w)}}}getPoint(e,t,r){const n=this.knots1[0]+e*(this.knots1[this.knots1.length-1]-this.knots1[0]),i=this.knots2[0]+t*(this.knots2[this.knots2.length-1]-this.knots2[0]);(0,Ng.nl)(this.degree1,this.degree2,this.knots1,this.knots2,this.controlPoints,n,i,r)}}class Gg extends n.Curve{getPoint(e,t=new n.Vector3){const r=t;e=2*Math.PI*e;const i=-.22*Math.cos(e)-1.28*Math.sin(e)-.44*Math.cos(3*e)-.78*Math.sin(3*e),a=-.1*Math.cos(2*e)-.27*Math.sin(2*e)+.38*Math.cos(4*e)+.46*Math.sin(4*e),s=.7*Math.cos(3*e)-.4*Math.sin(3*e);return r.set(i,a,s).multiplyScalar(20)}}class zg extends n.Curve{constructor(e=5){super(),this.scale=e}getPoint(e,t=new n.Vector3){const r=t;e*=2*Math.PI;const i=16*Math.pow(Math.sin(e),3),a=13*Math.cos(e)-5*Math.cos(2*e)-2*Math.cos(3*e)-Math.cos(4*e);return r.set(i,a,0).multiplyScalar(this.scale)}}class Vg extends n.Curve{constructor(e=70){super(),this.scale=e}getPoint(e,t=new n.Vector3){const r=t;e=4*e*Math.PI;const i=this.scale/2,a=i*(1+Math.cos(e)),s=i*Math.sin(e),o=2*i*Math.sin(e/2);return r.set(a,s,o)}}class Hg extends n.Curve{getPoint(e,t=new n.Vector3){const r=t;e*=2*Math.PI;const i=50*Math.sin(e),a=Math.cos(e)*(10+50*Math.cos(e)),s=Math.sin(e)*(10+50*Math.cos(e));return r.set(i,a,s)}}class Qg extends n.Curve{getPoint(e,t=new n.Vector3){const r=t,i=2*Math.PI*e*150/30,a=30*Math.cos(i),s=30*Math.sin(i),o=150*e;return r.set(a,s,o)}}class jg extends n.Curve{constructor(e=10){super(),this.scale=e}getPoint(e,t=new n.Vector3){const r=t;e*=2*Math.PI;const i=(2+Math.cos(3*e))*Math.cos(2*e),a=(2+Math.cos(3*e))*Math.sin(2*e),s=Math.sin(3*e);return r.set(i,a,s).multiplyScalar(this.scale)}}class Wg extends n.Curve{constructor(e=10){super(),this.scale=e}getPoint(e,t=new n.Vector3){const r=t;e*=2*Math.PI;const i=(2+Math.cos(4*e))*Math.cos(3*e),a=(2+Math.cos(4*e))*Math.sin(3*e),s=Math.sin(4*e);return r.set(i,a,s).multiplyScalar(this.scale)}}class Xg extends n.Curve{constructor(e=10){super(),this.scale=e}getPoint(e,t=new n.Vector3){const r=t;e*=2*Math.PI;const i=(2+Math.cos(5*e))*Math.cos(2*e),a=(2+Math.cos(5*e))*Math.sin(2*e),s=Math.sin(5*e);return r.set(i,a,s).multiplyScalar(this.scale)}}class Yg extends n.Curve{constructor(e=10){super(),this.scale=e}getPoint(e,t=new n.Vector3){const r=t;e=4*e-2;const i=Math.pow(e,3)-3*e,a=Math.pow(e,4)-4*e*e,s=.2*Math.pow(e,5)-2*e;return r.set(i,a,s).multiplyScalar(this.scale)}}class qg extends n.Curve{constructor(e=1){super(),this.scale=e}getPoint(e,t=new n.Vector3){const r=t;e=function(e,t,r){return r*(t-e)+e}(-4,4,e);const i=.4*e*(e*e-7)*(e*e-10),a=Math.pow(e,4)-13*e*e,s=.1*e*(e*e-4)*(e*e-9)*(e*e-12);return r.set(i,a,s).multiplyScalar(this.scale)}}class Kg extends n.Curve{constructor(e=40){super(),this.scale=e}getPoint(e,t=new n.Vector3){const r=t;e*=2*Math.PI;const i=Math.cos(2*e)*(1+.6*(Math.cos(5*e)+.75*Math.cos(10*e))),a=Math.sin(2*e)*(1+.6*(Math.cos(5*e)+.75*Math.cos(10*e))),s=.35*Math.sin(5*e);return r.set(i,a,s).multiplyScalar(this.scale)}}class Jg extends n.Curve{constructor(e=40){super(),this.scale=e}getPoint(e,t=new n.Vector3){const r=t,i=e*Math.PI*2,a=Math.cos(2*i)*(1+.45*Math.cos(3*i)+.4*Math.cos(9*i)),s=Math.sin(2*i)*(1+.45*Math.cos(3*i)+.4*Math.cos(9*i)),o=.2*Math.sin(9*i);return r.set(a,s,o).multiplyScalar(this.scale)}}class Zg extends n.Curve{constructor(e=40){super(),this.scale=e}getPoint(e,t=new n.Vector3){const r=t,i=e*Math.PI*2,a=Math.cos(3*i)*(1+.3*Math.cos(5*i)+.5*Math.cos(10*i)),s=Math.sin(3*i)*(1+.3*Math.cos(5*i)+.5*Math.cos(10*i)),o=.2*Math.sin(20*i);return r.set(a,s,o).multiplyScalar(this.scale)}}class $g extends n.Curve{constructor(e=40){super(),this.scale=e}getPoint(e,t=new n.Vector3){const r=t,i=e*Math.PI*2,a=Math.cos(4*i)*(1+.5*(Math.cos(5*i)+.4*Math.cos(20*i))),s=Math.sin(4*i)*(1+.5*(Math.cos(5*i)+.4*Math.cos(20*i))),o=.35*Math.sin(15*i);return r.set(a,s,o).multiplyScalar(this.scale)}}const ev=new n.Matrix4,tv=new n.Object3D,rv=new n.Vector3;class nv extends n.EventDispatcher{static createBufferGeometryFromObject(e){let t=new n.BufferGeometry;const r=e.geometry;if(e.isPoints||e.isLine){const e=new n.Float32BufferAttribute(3*r.vertices.length,3),i=new n.Float32BufferAttribute(3*r.colors.length,3);if(t.setAttribute("position",e.copyVector3sArray(r.vertices)),t.setAttribute("color",i.copyColorsArray(r.colors)),r.lineDistances&&r.lineDistances.length===r.vertices.length){const e=new n.Float32BufferAttribute(r.lineDistances.length,1);t.setAttribute("lineDistance",e.copyArray(r.lineDistances))}null!==r.boundingSphere&&(t.boundingSphere=r.boundingSphere.clone()),null!==r.boundingBox&&(t.boundingBox=r.boundingBox.clone())}else e.isMesh&&(t=r.toBufferGeometry());return t}constructor(){super(),this.isGeometry=!0,this.uuid=n.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){const t=(new n.Matrix3).getNormalMatrix(e);for(let r=0,n=this.vertices.length;r<n;r++){this.vertices[r].applyMatrix4(e)}for(let r=0,n=this.faces.length;r<n;r++){const e=this.faces[r];e.normal.applyMatrix3(t).normalize();for(let r=0,n=e.vertexNormals.length;r<n;r++)e.vertexNormals[r].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this}rotateX(e){return ev.makeRotationX(e),this.applyMatrix4(ev),this}rotateY(e){return ev.makeRotationY(e),this.applyMatrix4(ev),this}rotateZ(e){return ev.makeRotationZ(e),this.applyMatrix4(ev),this}translate(e,t,r){return ev.makeTranslation(e,t,r),this.applyMatrix4(ev),this}scale(e,t,r){return ev.makeScale(e,t,r),this.applyMatrix4(ev),this}lookAt(e){return tv.lookAt(e),tv.updateMatrix(),this.applyMatrix4(tv.matrix),this}fromBufferGeometry(e){const t=this,r=null!==e.index?e.index:void 0,i=e.attributes;if(void 0===i.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;const a=i.position,s=i.normal,o=i.color,l=i.uv,c=i.uv2;void 0!==c&&(this.faceVertexUvs[1]=[]);for(let d=0;d<a.count;d++)t.vertices.push((new n.Vector3).fromBufferAttribute(a,d)),void 0!==o&&t.colors.push((new n.Color).fromBufferAttribute(o,d));function u(e,r,i,a){const u=void 0===o?[]:[t.colors[e].clone(),t.colors[r].clone(),t.colors[i].clone()],h=void 0===s?[]:[(new n.Vector3).fromBufferAttribute(s,e),(new n.Vector3).fromBufferAttribute(s,r),(new n.Vector3).fromBufferAttribute(s,i)],d=new av(e,r,i,h,u,a);t.faces.push(d),void 0!==l&&t.faceVertexUvs[0].push([(new n.Vector2).fromBufferAttribute(l,e),(new n.Vector2).fromBufferAttribute(l,r),(new n.Vector2).fromBufferAttribute(l,i)]),void 0!==c&&t.faceVertexUvs[1].push([(new n.Vector2).fromBufferAttribute(c,e),(new n.Vector2).fromBufferAttribute(c,r),(new n.Vector2).fromBufferAttribute(c,i)])}const h=e.groups;if(h.length>0)for(let n=0;n<h.length;n++){const e=h[n],t=e.start;for(let n=t,i=t+e.count;n<i;n+=3)void 0!==r?u(r.getX(n),r.getX(n+1),r.getX(n+2),e.materialIndex):u(n,n+1,n+2,e.materialIndex)}else if(void 0!==r)for(let n=0;n<r.count;n+=3)u(r.getX(n),r.getX(n+1),r.getX(n+2));else for(let n=0;n<a.count;n+=3)u(n,n+1,n+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(rv).negate(),this.translate(rv.x,rv.y,rv.z),this}normalize(){this.computeBoundingSphere();const e=this.boundingSphere.center,t=this.boundingSphere.radius,r=0===t?1:1/t,i=new n.Matrix4;return i.set(r,0,0,-r*e.x,0,r,0,-r*e.y,0,0,r,-r*e.z,0,0,0,1),this.applyMatrix4(i),this}computeFaceNormals(){const e=new n.Vector3,t=new n.Vector3;for(let r=0,n=this.faces.length;r<n;r++){const n=this.faces[r],i=this.vertices[n.a],a=this.vertices[n.b],s=this.vertices[n.c];e.subVectors(s,a),t.subVectors(i,a),e.cross(t),e.normalize(),n.normal.copy(e)}}computeVertexNormals(e=!0){const t=new Array(this.vertices.length);for(let r=0,i=this.vertices.length;r<i;r++)t[r]=new n.Vector3;if(e){const e=new n.Vector3,r=new n.Vector3;for(let n=0,i=this.faces.length;n<i;n++){const i=this.faces[n],a=this.vertices[i.a],s=this.vertices[i.b],o=this.vertices[i.c];e.subVectors(o,s),r.subVectors(a,s),e.cross(r),t[i.a].add(e),t[i.b].add(e),t[i.c].add(e)}}else{this.computeFaceNormals();for(let e=0,r=this.faces.length;e<r;e++){const r=this.faces[e];t[r.a].add(r.normal),t[r.b].add(r.normal),t[r.c].add(r.normal)}}for(let r=0,n=this.vertices.length;r<n;r++)t[r].normalize();for(let r=0,n=this.faces.length;r<n;r++){const e=this.faces[r],n=e.vertexNormals;3===n.length?(n[0].copy(t[e.a]),n[1].copy(t[e.b]),n[2].copy(t[e.c])):(n[0]=t[e.a].clone(),n[1]=t[e.b].clone(),n[2]=t[e.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e<t;e++){const t=this.faces[e],r=t.vertexNormals;3===r.length?(r[0].copy(t.normal),r[1].copy(t.normal),r[2].copy(t.normal)):(r[0]=t.normal.clone(),r[1]=t.normal.clone(),r[2]=t.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,r=this.faces.length;t<r;t++){const e=this.faces[t];e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]);for(let t=0,r=e.vertexNormals.length;t<r;t++)e.__originalVertexNormals[t]?e.__originalVertexNormals[t].copy(e.vertexNormals[t]):e.__originalVertexNormals[t]=e.vertexNormals[t].clone()}const e=new nv;e.faces=this.faces;for(let t=0,r=this.morphTargets.length;t<r;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];const e=this.morphNormals[t].faceNormals,r=this.morphNormals[t].vertexNormals;for(let t=0,i=this.faces.length;t<i;t++){const t=new n.Vector3,i={a:new n.Vector3,b:new n.Vector3,c:new n.Vector3};e.push(t),r.push(i)}}const r=this.morphNormals[t];e.vertices=this.morphTargets[t].vertices,e.computeFaceNormals(),e.computeVertexNormals();for(let e=0,t=this.faces.length;e<t;e++){const t=this.faces[e],n=r.faceNormals[e],i=r.vertexNormals[e];n.copy(t.normal),i.a.copy(t.vertexNormals[0]),i.b.copy(t.vertexNormals[1]),i.c.copy(t.vertexNormals[2])}}for(let t=0,r=this.faces.length;t<r;t++){const e=this.faces[t];e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals}}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new n.Box3),this.boundingBox.setFromPoints(this.vertices)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new n.Sphere),this.boundingSphere.setFromPoints(this.vertices)}merge(e,t,r=0){if(!e||!e.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);let i;const a=this.vertices.length,s=this.vertices,o=e.vertices,l=this.faces,c=e.faces,u=this.colors,h=e.colors;void 0!==t&&(i=(new n.Matrix3).getNormalMatrix(t));for(let n=0,d=o.length;n<d;n++){const e=o[n].clone();void 0!==t&&e.applyMatrix4(t),s.push(e)}for(let n=0,d=h.length;n<d;n++)u.push(h[n].clone());for(let n=0,d=c.length;n<d;n++){const e=c[n];let t,s;const o=e.vertexNormals,u=e.vertexColors,h=new av(e.a+a,e.b+a,e.c+a);h.normal.copy(e.normal),void 0!==i&&h.normal.applyMatrix3(i).normalize();for(let r=0,n=o.length;r<n;r++)t=o[r].clone(),void 0!==i&&t.applyMatrix3(i).normalize(),h.vertexNormals.push(t);h.color.copy(e.color);for(let r=0,n=u.length;r<n;r++)s=u[r],h.vertexColors.push(s.clone());h.materialIndex=e.materialIndex+r,l.push(h)}for(let n=0,d=e.faceVertexUvs.length;n<d;n++){const t=e.faceVertexUvs[n];void 0===this.faceVertexUvs[n]&&(this.faceVertexUvs[n]=[]);for(let e=0,r=t.length;e<r;e++){const r=t[e],i=[];for(let e=0,t=r.length;e<t;e++)i.push(r[e].clone());this.faceVertexUvs[n].push(i)}}}mergeMesh(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)}mergeVertices(e=4){const t={},r=[],n=[],i=Math.pow(10,e);for(let o=0,l=this.vertices.length;o<l;o++){const e=this.vertices[o],a=`${Math.round(e.x*i)}_${Math.round(e.y*i)}_${Math.round(e.z*i)}`;void 0===t[a]?(t[a]=o,r.push(this.vertices[o]),n[o]=r.length-1):n[o]=n[t[a]]}const a=[];for(let o=0,l=this.faces.length;o<l;o++){const e=this.faces[o];e.a=n[e.a],e.b=n[e.b],e.c=n[e.c];const t=[e.a,e.b,e.c];for(let r=0;r<3;r++)if(t[r]===t[(r+1)%3]){a.push(o);break}}for(let o=a.length-1;o>=0;o--){const e=a[o];this.faces.splice(e,1);for(let t=0,r=this.faceVertexUvs.length;t<r;t++)this.faceVertexUvs[t].splice(e,1)}const s=this.vertices.length-r.length;return this.vertices=r,s}setFromPoints(e){this.vertices=[];for(let t=0,r=e.length;t<r;t++){const r=e[t];this.vertices.push(new n.Vector3(r.x,r.y,r.z||0))}return this}sortFacesByMaterialIndex(){const e=this.faces,t=e.length;for(let s=0;s<t;s++)e[s]._id=s;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));const r=this.faceVertexUvs[0],n=this.faceVertexUvs[1];let i,a;r&&r.length===t&&(i=[]),n&&n.length===t&&(a=[]);for(let s=0;s<t;s++){const t=e[s]._id;i&&i.push(r[t]),a&&a.push(n[t])}i&&(this.faceVertexUvs[0]=i),a&&(this.faceVertexUvs[1]=a)}toJSON(){const e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){const t=this.parameters;for(let r in t)void 0!==t[r]&&(e[r]=t[r]);return e}const t=[];for(let p=0;p<this.vertices.length;p++){const e=this.vertices[p];t.push(e.x,e.y,e.z)}const r=[],n=[],i={},a=[],s={},o=[],l={};for(let p=0;p<this.faces.length;p++){const e=this.faces[p],t=!0,n=!1,i=void 0!==this.faceVertexUvs[0][p],a=e.normal.length()>0,s=e.vertexNormals.length>0,o=1!==e.color.r||1!==e.color.g||1!==e.color.b,l=e.vertexColors.length>0;let f=0;if(f=c(f,0,0),f=c(f,1,t),f=c(f,2,n),f=c(f,3,i),f=c(f,4,a),f=c(f,5,s),f=c(f,6,o),f=c(f,7,l),r.push(f),r.push(e.a,e.b,e.c),r.push(e.materialIndex),i){const e=this.faceVertexUvs[0][p];r.push(d(e[0]),d(e[1]),d(e[2]))}if(a&&r.push(u(e.normal)),s){const t=e.vertexNormals;r.push(u(t[0]),u(t[1]),u(t[2]))}if(o&&r.push(h(e.color)),l){const t=e.vertexColors;r.push(h(t[0]),h(t[1]),h(t[2]))}}function c(e,t,r){return r?e|1<<t:e&~(1<<t)}function u(e){const t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==i[t]||(i[t]=n.length/3,n.push(e.x,e.y,e.z)),i[t]}function h(e){const t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==s[t]||(s[t]=a.length,a.push(e.getHex())),s[t]}function d(e){const t=e.x.toString()+e.y.toString();return void 0!==l[t]||(l[t]=o.length/2,o.push(e.x,e.y)),l[t]}return e.data={},e.data.vertices=t,e.data.normals=n,a.length>0&&(e.data.colors=a),o.length>0&&(e.data.uvs=[o]),e.data.faces=r,e}clone(){return(new nv).copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;const t=e.vertices;for(let h=0,d=t.length;h<d;h++)this.vertices.push(t[h].clone());const r=e.colors;for(let h=0,d=r.length;h<d;h++)this.colors.push(r[h].clone());const n=e.faces;for(let h=0,d=n.length;h<d;h++)this.faces.push(n[h].clone());for(let h=0,d=e.faceVertexUvs.length;h<d;h++){const t=e.faceVertexUvs[h];void 0===this.faceVertexUvs[h]&&(this.faceVertexUvs[h]=[]);for(let e=0,r=t.length;e<r;e++){const r=t[e],n=[];for(let e=0,t=r.length;e<t;e++){const t=r[e];n.push(t.clone())}this.faceVertexUvs[h].push(n)}}const i=e.morphTargets;for(let h=0,d=i.length;h<d;h++){const e={};if(e.name=i[h].name,void 0!==i[h].vertices){e.vertices=[];for(let t=0,r=i[h].vertices.length;t<r;t++)e.vertices.push(i[h].vertices[t].clone())}if(void 0!==i[h].normals){e.normals=[];for(let t=0,r=i[h].normals.length;t<r;t++)e.normals.push(i[h].normals[t].clone())}this.morphTargets.push(e)}const a=e.morphNormals;for(let h=0,d=a.length;h<d;h++){const e={};if(void 0!==a[h].vertexNormals){e.vertexNormals=[];for(let t=0,r=a[h].vertexNormals.length;t<r;t++){const r=a[h].vertexNormals[t],n={};n.a=r.a.clone(),n.b=r.b.clone(),n.c=r.c.clone(),e.vertexNormals.push(n)}}if(void 0!==a[h].faceNormals){e.faceNormals=[];for(let t=0,r=a[h].faceNormals.length;t<r;t++)e.faceNormals.push(a[h].faceNormals[t].clone())}this.morphNormals.push(e)}const s=e.skinWeights;for(let h=0,d=s.length;h<d;h++)this.skinWeights.push(s[h].clone());const o=e.skinIndices;for(let h=0,d=o.length;h<d;h++)this.skinIndices.push(o[h].clone());const l=e.lineDistances;for(let h=0,d=l.length;h<d;h++)this.lineDistances.push(l[h]);const c=e.boundingBox;null!==c&&(this.boundingBox=c.clone());const u=e.boundingSphere;return null!==u&&(this.boundingSphere=u.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}toBufferGeometry(){const e=(new iv).fromGeometry(this),t=new n.BufferGeometry,r=new Float32Array(3*e.vertices.length);if(t.setAttribute("position",new n.BufferAttribute(r,3).copyVector3sArray(e.vertices)),e.normals.length>0){const r=new Float32Array(3*e.normals.length);t.setAttribute("normal",new n.BufferAttribute(r,3).copyVector3sArray(e.normals))}if(e.colors.length>0){const r=new Float32Array(3*e.colors.length);t.setAttribute("color",new n.BufferAttribute(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){const r=new Float32Array(2*e.uvs.length);t.setAttribute("uv",new n.BufferAttribute(r,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){const r=new Float32Array(2*e.uvs2.length);t.setAttribute("uv2",new n.BufferAttribute(r,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){const r=[],a=e.morphTargets[i];for(let e=0,t=a.length;e<t;e++){const t=a[e],i=new n.Float32BufferAttribute(3*t.data.length,3);i.name=t.name,r.push(i.copyVector3sArray(t.data))}t.morphAttributes[i]=r}if(e.skinIndices.length>0){const r=new n.Float32BufferAttribute(4*e.skinIndices.length,4);t.setAttribute("skinIndex",r.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){const r=new n.Float32BufferAttribute(4*e.skinWeights.length,4);t.setAttribute("skinWeight",r.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(t.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}}class iv{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 r,n,i;const a=e.faces;for(n=0;n<a.length;n++){const e=a[n];e.materialIndex!==i&&(i=e.materialIndex,void 0!==r&&(r.count=3*n-r.start,t.push(r)),r={start:3*n,materialIndex:i})}void 0!==r&&(r.count=3*n-r.start,t.push(r)),this.groups=t}fromGeometry(e){const t=e.faces,r=e.vertices,i=e.faceVertexUvs,a=i[0]&&i[0].length>0,s=i[1]&&i[1].length>0,o=e.morphTargets,l=o.length;let c;if(l>0){c=[];for(let e=0;e<l;e++)c[e]={name:o[e].name,data:[]};this.morphTargets.position=c}const u=e.morphNormals,h=u.length;let d;if(h>0){d=[];for(let e=0;e<h;e++)d[e]={name:u[e].name,data:[]};this.morphTargets.normal=d}const p=e.skinIndices,f=e.skinWeights,m=p.length===r.length,g=f.length===r.length;r.length>0&&0===t.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let v=0;v<t.length;v++){const e=t[v];this.vertices.push(r[e.a],r[e.b],r[e.c]);const A=e.vertexNormals;if(3===A.length)this.normals.push(A[0],A[1],A[2]);else{const t=e.normal;this.normals.push(t,t,t)}const y=e.vertexColors;if(3===y.length)this.colors.push(y[0],y[1],y[2]);else{const t=e.color;this.colors.push(t,t,t)}if(!0===a){const e=i[0][v];void 0!==e?this.uvs.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",v),this.uvs.push(new n.Vector2,new n.Vector2,new n.Vector2))}if(!0===s){const e=i[1][v];void 0!==e?this.uvs2.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",v),this.uvs2.push(new n.Vector2,new n.Vector2,new n.Vector2))}for(let t=0;t<l;t++){const r=o[t].vertices;c[t].data.push(r[e.a],r[e.b],r[e.c])}for(let t=0;t<h;t++){const e=u[t].vertexNormals[v];d[t].data.push(e.a,e.b,e.c)}m&&this.skinIndices.push(p[e.a],p[e.b],p[e.c]),g&&this.skinWeights.push(f[e.a],f[e.b],f[e.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}}class av{constructor(e,t,r,i,a,s=0){this.a=e,this.b=t,this.c=r,this.normal=i&&i.isVector3?i:new n.Vector3,this.vertexNormals=Array.isArray(i)?i:[],this.color=a&&a.isColor?a:new n.Color,this.vertexColors=Array.isArray(a)?a:[],this.materialIndex=s}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,r=e.vertexNormals.length;t<r;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(let t=0,r=e.vertexColors.length;t<r;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}}var sv=r(46295)},31480:(e,t,r)=>{"use strict";r.d(t,{M:()=>y});var n=r(99477);const i=new n.Frustum,a=new n.Vector3,s=new n.Vector3,o=new n.Vector3,l=new n.Vector3,c=new n.Vector3,u=new n.Vector3,h=new n.Vector3,d=new n.Vector3,p=new n.Vector3,f=new n.Vector3,m=new n.Vector3,g=new n.Vector3,v=new n.Vector3,A=new n.Vector3;class y{constructor(e,t,r){this.camera=e,this.scene=t,this.startPoint=new n.Vector3,this.endPoint=new n.Vector3,this.collection=[],this.deep=r||Number.MAX_VALUE}select(e,t){return this.startPoint=e||this.startPoint,this.endPoint=t||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(i,this.scene),this.collection}updateFrustum(e,t){if(e=e||this.startPoint,t=t||this.endPoint,e.x===t.x&&(t.x+=Number.EPSILON),e.y===t.y&&(t.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera)s.copy(e),s.x=Math.min(e.x,t.x),s.y=Math.max(e.y,t.y),t.x=Math.max(e.x,t.x),t.y=Math.min(e.y,t.y),o.setFromMatrixPosition(this.camera.matrixWorld),l.copy(s),c.set(t.x,s.y,0),u.copy(t),h.set(s.x,t.y,0),l.unproject(this.camera),c.unproject(this.camera),u.unproject(this.camera),h.unproject(this.camera),g.copy(l).sub(o),v.copy(c).sub(o),A.copy(u).sub(o),g.normalize(),v.normalize(),A.normalize(),g.multiplyScalar(this.deep),v.multiplyScalar(this.deep),A.multiplyScalar(this.deep),g.add(o),v.add(o),A.add(o),(r=i.planes)[0].setFromCoplanarPoints(o,l,c),r[1].setFromCoplanarPoints(o,c,u),r[2].setFromCoplanarPoints(u,h,o),r[3].setFromCoplanarPoints(h,l,o),r[4].setFromCoplanarPoints(c,u,h),r[5].setFromCoplanarPoints(A,v,g),r[5].normal.multiplyScalar(-1);else if(this.camera.isOrthographicCamera){const n=Math.min(e.x,t.x),a=Math.max(e.y,t.y),s=Math.max(e.x,t.x),o=Math.min(e.y,t.y);var r;l.set(n,a,-1),c.set(s,a,-1),u.set(s,o,-1),h.set(n,o,-1),d.set(n,a,1),p.set(s,a,1),f.set(s,o,1),m.set(n,o,1),l.unproject(this.camera),c.unproject(this.camera),u.unproject(this.camera),h.unproject(this.camera),d.unproject(this.camera),p.unproject(this.camera),f.unproject(this.camera),m.unproject(this.camera),(r=i.planes)[0].setFromCoplanarPoints(l,d,p),r[1].setFromCoplanarPoints(c,p,f),r[2].setFromCoplanarPoints(f,m,h),r[3].setFromCoplanarPoints(m,d,l),r[4].setFromCoplanarPoints(c,u,h),r[5].setFromCoplanarPoints(f,p,d),r[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(e,t){if((t.isMesh||t.isLine||t.isPoints)&&void 0!==t.material&&(null===t.geometry.boundingSphere&&t.geometry.computeBoundingSphere(),a.copy(t.geometry.boundingSphere.center),a.applyMatrix4(t.matrixWorld),e.containsPoint(a)&&this.collection.push(t)),t.children.length>0)for(let r=0;r<t.children.length;r++)this.searchChildInFrustum(e,t.children[r])}}},46295:(e,t,r)=>{"use strict";let n;r.d(t,{z:()=>i});const i=()=>{if(n)return n;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let r,i="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(e)&&(i="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB");const a=WebAssembly.instantiate(function(e){const r=new Uint8Array(e.length);for(let t=0;t<e.length;++t){const n=e.charCodeAt(t);r[t]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let n=0;for(let i=0;i<e.length;++i)r[n++]=r[i]<60?t[r[i]]:64*(r[i]-60)+r[++i];return r.buffer.slice(0,n)}(i),{}).then((e=>{r=e.instance,r.exports.__wasm_call_ctors()}));function s(e,t,n,i,a,s){const o=r.exports.sbrk,l=n+3&-4,c=o(l*i),u=o(a.length),h=new Uint8Array(r.exports.memory.buffer);h.set(a,u);const d=e(c,n,i,u,a.length);if(0===d&&s&&s(c,l,i),t.set(h.subarray(c,c+n*i)),o(c-o(0)),0!==d)throw new Error(`Malformed buffer data: ${d}`)}const o={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return n={ready:a,supported:!0,decodeVertexBuffer(e,t,n,i,a){s(r.exports.meshopt_decodeVertexBuffer,e,t,n,i,r.exports[o[a]])},decodeIndexBuffer(e,t,n,i){s(r.exports.meshopt_decodeIndexBuffer,e,t,n,i)},decodeIndexSequence(e,t,n,i){s(r.exports.meshopt_decodeIndexSequence,e,t,n,i)},decodeGltfBuffer(e,t,n,i,a,c){s(r.exports[l[a]],e,t,n,i,r.exports[o[c]])}},n}},43075:(e,t,r)=>{"use strict";r.d(t,{w:()=>s});var n=r(21939),i=r(51815),a=r(10977);class s extends n.w{constructor(e=new i.L,t=new a.Y({color:16777215*Math.random()})){super(e,t),this.isLine2=!0,this.type="Line2"}}},51815:(e,t,r)=>{"use strict";r.d(t,{L:()=>i});var n=r(3415);class i extends n.z{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,r=new Float32Array(2*t);for(let n=0;n<t;n+=3)r[2*n]=e[n],r[2*n+1]=e[n+1],r[2*n+2]=e[n+2],r[2*n+3]=e[n+3],r[2*n+4]=e[n+4],r[2*n+5]=e[n+5];return super.setPositions(r),this}setColors(e){const t=e.length-3,r=new Float32Array(2*t);for(let n=0;n<t;n+=3)r[2*n]=e[n],r[2*n+1]=e[n+1],r[2*n+2]=e[n+2],r[2*n+3]=e[n+3],r[2*n+4]=e[n+4],r[2*n+5]=e[n+5];return super.setColors(r),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}},10977:(e,t,r)=>{"use strict";r.d(t,{Y:()=>i});var n=r(99477);class i extends n.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:n.UniformsUtils.clone(n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new n.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:"\n\t\t\t\t#include <common>\n\t\t\t\t#include <color_pars_vertex>\n\t\t\t\t#include <fog_pars_vertex>\n\t\t\t\t#include <logdepthbuf_pars_vertex>\n\t\t\t\t#include <clipping_planes_pars_vertex>\n\n\t\t\t\tuniform float linewidth;\n\t\t\t\tuniform vec2 resolution;\n\n\t\t\t\tattribute vec3 instanceStart;\n\t\t\t\tattribute vec3 instanceEnd;\n\n\t\t\t\tattribute vec3 instanceColorStart;\n\t\t\t\tattribute vec3 instanceColorEnd;\n\n\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\tvarying vec4 worldPos;\n\t\t\t\t\tvarying vec3 worldStart;\n\t\t\t\t\tvarying vec3 worldEnd;\n\n\t\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#else\n\n\t\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t#endif\n\n\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\tuniform float dashScale;\n\t\t\t\t\tattribute float instanceDistanceStart;\n\t\t\t\t\tattribute float instanceDistanceEnd;\n\t\t\t\t\tvarying float vLineDistance;\n\n\t\t\t\t#endif\n\n\t\t\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t\t\t// conservative estimate of the near plane\n\t\t\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#ifdef USE_COLOR\n\n\t\t\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\t\t\t\t\t\tvUv = uv;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\t\t\t// camera space\n\t\t\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\t\tworldStart = start.xyz;\n\t\t\t\t\t\tworldEnd = end.xyz;\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tvUv = uv;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\t\t\tif ( perspective ) {\n\n\t\t\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// clip space\n\t\t\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t\t\t// ndc space\n\t\t\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t\t\t// direction\n\t\t\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t\t\t// account for clip-space aspect ratio\n\t\t\t\t\tdir.x *= aspect;\n\t\t\t\t\tdir = normalize( dir );\n\n\t\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\t\t// get the offset direction as perpendicular to the view vector\n\t\t\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\t\t\tvec3 offset;\n\t\t\t\t\t\tif ( position.y < 0.5 ) {\n\n\t\t\t\t\t\t\toffset = normalize( cross( start.xyz, worldDir ) );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\toffset = normalize( cross( end.xyz, worldDir ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// sign flip\n\t\t\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t\t\tfloat forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );\n\n\t\t\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t\t\t// extend the line bounds to encompass endcaps\n\t\t\t\t\t\t\tstart.xyz += - worldDir * linewidth * 0.5;\n\t\t\t\t\t\t\tend.xyz += worldDir * linewidth * 0.5;\n\n\t\t\t\t\t\t\t// shift the position of the quad so it hugs the forward edge of the line\n\t\t\t\t\t\t\toffset.xy -= dir * forwardOffset;\n\t\t\t\t\t\t\toffset.z += 0.5;\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t// endcaps\n\t\t\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\t\t\toffset.xy += dir * 2.0 * forwardOffset;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// adjust for linewidth\n\t\t\t\t\t\toffset *= linewidth * 0.5;\n\n\t\t\t\t\t\t// set the world position\n\t\t\t\t\t\tworldPos = ( position.y < 0.5 ) ? start : end;\n\t\t\t\t\t\tworldPos.xyz += offset;\n\n\t\t\t\t\t\t// project the worldpos\n\t\t\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t\t\t// segments overlap neatly\n\t\t\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t\t\t\t// undo aspect ratio adjustment\n\t\t\t\t\t\tdir.x /= aspect;\n\t\t\t\t\t\toffset.x /= aspect;\n\n\t\t\t\t\t\t// sign flip\n\t\t\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t\t\t// endcaps\n\t\t\t\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\t\t\t\toffset += - dir;\n\n\t\t\t\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\t\t\t\toffset += dir;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// adjust for linewidth\n\t\t\t\t\t\toffset *= linewidth;\n\n\t\t\t\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\t\t\t\toffset /= resolution.y;\n\n\t\t\t\t\t\t// select end\n\t\t\t\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t\t\t\t// back to clip space\n\t\t\t\t\t\toffset *= clip.w;\n\n\t\t\t\t\t\tclip.xy += offset;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tgl_Position = clip;\n\n\t\t\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t\t\t#include <logdepthbuf_vertex>\n\t\t\t\t\t#include <clipping_planes_vertex>\n\t\t\t\t\t#include <fog_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\t\t\t\tuniform vec3 diffuse;\n\t\t\t\tuniform float opacity;\n\t\t\t\tuniform float linewidth;\n\n\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\tuniform float dashOffset;\n\t\t\t\t\tuniform float dashSize;\n\t\t\t\t\tuniform float gapSize;\n\n\t\t\t\t#endif\n\n\t\t\t\tvarying float vLineDistance;\n\n\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\tvarying vec4 worldPos;\n\t\t\t\t\tvarying vec3 worldStart;\n\t\t\t\t\tvarying vec3 worldEnd;\n\n\t\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#else\n\n\t\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t#endif\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <color_pars_fragment>\n\t\t\t\t#include <fog_pars_fragment>\n\t\t\t\t#include <logdepthbuf_pars_fragment>\n\t\t\t\t#include <clipping_planes_pars_fragment>\n\n\t\t\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\t\t\tfloat mua;\n\t\t\t\t\tfloat mub;\n\n\t\t\t\t\tvec3 p13 = p1 - p3;\n\t\t\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\t\t\tmua = numer / denom;\n\t\t\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\t\t\treturn vec2( mua, mub );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tfloat alpha = opacity;\n\n\t\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\t\t\tfloat len = length( delta );\n\t\t\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t\t\t#else\n\n\t\t\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t#else\n\n\t\t\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t\t\t#include <logdepthbuf_fragment>\n\t\t\t\t\t#include <color_fragment>\n\n\t\t\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <encodings_fragment>\n\t\t\t\t\t#include <fog_fragment>\n\t\t\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t\t\t}\n\t\t\t",clipping:!0}),this.isLineMaterial=!0,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return Boolean("USE_DASH"in this.defines)},set(e){Boolean(e)!==Boolean("USE_DASH"in this.defines)&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return Boolean("USE_ALPHA_TO_COVERAGE"in this.defines)},set:function(e){Boolean(e)!==Boolean("USE_ALPHA_TO_COVERAGE"in this.defines)&&(this.needsUpdate=!0),!0===e?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}},21939:(e,t,r)=>{"use strict";r.d(t,{w:()=>E});var n=r(99477),i=r(3415),a=r(10977);const s=new n.Vector3,o=new n.Vector3,l=new n.Vector4,c=new n.Vector4,u=new n.Vector4,h=new n.Vector3,d=new n.Matrix4,p=new n.Line3,f=new n.Vector3,m=new n.Box3,g=new n.Sphere,v=new n.Vector4;let A,y,x,b;function w(e,t,r){return v.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),v.multiplyScalar(1/v.w),v.x=b/r.width,v.y=b/r.height,v.applyMatrix4(e.projectionMatrixInverse),v.multiplyScalar(1/v.w),Math.abs(Math.max(v.x,v.y))}class E extends n.Mesh{constructor(e=new i.z,t=new a.Y({color:16777215*Math.random()})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let n=0,l=0,c=t.count;n<c;n++,l+=2)s.fromBufferAttribute(t,n),o.fromBufferAttribute(r,n),i[l]=0===l?0:i[l-1],i[l+1]=i[l]+s.distanceTo(o);const a=new n.InstancedInterleavedBuffer(i,2,1);return e.setAttribute("instanceDistanceStart",new n.InterleavedBufferAttribute(a,1,0)),e.setAttribute("instanceDistanceEnd",new n.InterleavedBufferAttribute(a,1,1)),this}raycast(e,t){const r=this.material.worldUnits,i=e.camera;null!==i||r||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const a=void 0!==e.params.Line2&&e.params.Line2.threshold||0;A=e.ray;const s=this.matrixWorld,o=this.geometry,v=this.material;let E,S;if(b=v.linewidth+a,y=o.attributes.instanceStart,x=o.attributes.instanceEnd,null===o.boundingSphere&&o.computeBoundingSphere(),g.copy(o.boundingSphere).applyMatrix4(s),r)E=.5*b;else{E=w(i,Math.max(i.near,g.distanceToPoint(A.origin)),v.resolution)}if(g.radius+=E,!1!==A.intersectsSphere(g)){if(null===o.boundingBox&&o.computeBoundingBox(),m.copy(o.boundingBox).applyMatrix4(s),r)S=.5*b;else{S=w(i,Math.max(i.near,m.distanceToPoint(A.origin)),v.resolution)}m.expandByScalar(S),!1!==A.intersectsBox(m)&&(r?function(e,t){for(let r=0,i=y.count;r<i;r++){p.start.fromBufferAttribute(y,r),p.end.fromBufferAttribute(x,r);const i=new n.Vector3,a=new n.Vector3;A.distanceSqToSegment(p.start,p.end,a,i),a.distanceTo(i)<.5*b&&t.push({point:a,pointOnLine:i,distance:A.origin.distanceTo(a),object:e,face:null,faceIndex:r,uv:null,uv2:null})}}(this,t):function(e,t,r){const i=t.projectionMatrix,a=e.material.resolution,s=e.matrixWorld,o=e.geometry,m=o.attributes.instanceStart,g=o.attributes.instanceEnd,v=-t.near;A.at(1,u),u.w=1,u.applyMatrix4(t.matrixWorldInverse),u.applyMatrix4(i),u.multiplyScalar(1/u.w),u.x*=a.x/2,u.y*=a.y/2,u.z=0,h.copy(u),d.multiplyMatrices(t.matrixWorldInverse,s);for(let u=0,y=m.count;u<y;u++){if(l.fromBufferAttribute(m,u),c.fromBufferAttribute(g,u),l.w=1,c.w=1,l.applyMatrix4(d),c.applyMatrix4(d),l.z>v&&c.z>v)continue;if(l.z>v){const e=l.z-c.z,t=(l.z-v)/e;l.lerp(c,t)}else if(c.z>v){const e=c.z-l.z,t=(c.z-v)/e;c.lerp(l,t)}l.applyMatrix4(i),c.applyMatrix4(i),l.multiplyScalar(1/l.w),c.multiplyScalar(1/c.w),l.x*=a.x/2,l.y*=a.y/2,c.x*=a.x/2,c.y*=a.y/2,p.start.copy(l),p.start.z=0,p.end.copy(c),p.end.z=0;const t=p.closestPointToPointParameter(h,!0);p.at(t,f);const o=n.MathUtils.lerp(l.z,c.z,t),y=o>=-1&&o<=1,x=h.distanceTo(f)<.5*b;if(y&&x){p.start.fromBufferAttribute(m,u),p.end.fromBufferAttribute(g,u),p.start.applyMatrix4(s),p.end.applyMatrix4(s);const t=new n.Vector3,i=new n.Vector3;A.distanceSqToSegment(p.start,p.end,i,t),r.push({point:i,pointOnLine:t,distance:A.origin.distanceTo(i),object:e,face:null,faceIndex:u,uv:null,uv2:null})}}}(this,i,t))}}}},3415:(e,t,r)=>{"use strict";r.d(t,{z:()=>s});var n=r(99477);const i=new n.Box3,a=new n.Vector3;class s extends n.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new n.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new n.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){const t=this.attributes.instanceStart,r=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),r.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const r=new n.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new n.InterleavedBufferAttribute(r,3,0)),this.setAttribute("instanceEnd",new n.InterleavedBufferAttribute(r,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const r=new n.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceColorStart",new n.InterleavedBufferAttribute(r,3,0)),this.setAttribute("instanceColorEnd",new n.InterleavedBufferAttribute(r,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new n.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new n.Box3);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;void 0!==e&&void 0!==t&&(this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(t),this.boundingBox.union(i))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new n.Sphere),null===this.boundingBox&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){const r=this.boundingSphere.center;this.boundingBox.getCenter(r);let n=0;for(let i=0,s=e.count;i<s;i++)a.fromBufferAttribute(e,i),n=Math.max(n,r.distanceToSquared(a)),a.fromBufferAttribute(t,i),n=Math.max(n,r.distanceToSquared(a));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}},44976:(e,t,r)=>{"use strict";r.d(t,{_:()=>a});var n=r(99477);const i=new WeakMap;class a extends n.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,r,i){const a=new n.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(e=>{const r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(i)}),r,i)}decodeDracoFile(e,t,r,n){const i={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){for(const i in t.attributeTypes){const e=t.attributeTypes[i];void 0!==e.BYTES_PER_ELEMENT&&(t.attributeTypes[i]=e.name)}const r=JSON.stringify(t);if(i.has(e)){const t=i.get(e);if(t.key===r)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n;const a=this.workerNextTaskID++,s=e.byteLength,o=this._getWorker(a,s).then((r=>(n=r,new Promise(((r,i)=>{n._callbacks[a]={resolve:r,reject:i},n.postMessage({type:"decode",id:a,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return o.catch((()=>!0)).then((()=>{n&&a&&this._releaseTask(n,a)})),i.set(e,{key:r,promise:o}),o}_createGeometry(e){const t=new n.BufferGeometry;e.index&&t.setIndex(new n.BufferAttribute(e.index.array,1));for(let r=0;r<e.attributes.length;r++){const i=e.attributes[r],a=i.name,s=i.array,o=i.itemSize;t.setAttribute(a,new n.BufferAttribute(s,o))}return t}_loadLibrary(e,t){const r=new n.FileLoader(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),r.setWithCredentials(this.withCredentials),new Promise(((t,n)=>{r.load(e,t,void 0,n)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{const r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const n=s.toString(),i=["/* draco decoder */",r,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){const r=t.data;switch(r.type){case"decode":e._callbacks[r.id].resolve(r);break;case"error":e._callbacks[r.id].reject(r);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+r.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function s(){let e,t;function r(e,t,r,n,i,a){const s=a.num_components(),o=r.num_points()*s,l=o*i.BYTES_PER_ELEMENT,c=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),u=e._malloc(l);t.GetAttributeDataArrayForAllPoints(r,a,c,l,u);const h=new i(e.HEAPF32.buffer,u,o).slice();return e._free(u),{name:n,array:h,itemSize:s}}onmessage=function(n){const i=n.data;switch(i.type){case"init":e=i.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":const n=i.buffer,a=i.taskConfig;t.then((e=>{const t=e.draco,s=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(n),n.byteLength);try{const e=function(e,t,n,i){const a=i.attributeIDs,s=i.attributeTypes;let o,l;const c=t.GetEncodedGeometryType(n);if(c===e.TRIANGULAR_MESH)o=new e.Mesh,l=t.DecodeBufferToMesh(n,o);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");o=new e.PointCloud,l=t.DecodeBufferToPointCloud(n,o)}if(!l.ok()||0===o.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const u={index:null,attributes:[]};for(const h in a){const n=self[s[h]];let l,c;if(i.useUniqueIDs)c=a[h],l=t.GetAttributeByUniqueId(o,c);else{if(c=t.GetAttributeId(o,e[a[h]]),-1===c)continue;l=t.GetAttribute(o,c)}u.attributes.push(r(e,t,o,h,n,l))}c===e.TRIANGULAR_MESH&&(u.index=function(e,t,r){const n=3*r.num_faces(),i=4*n,a=e._malloc(i);t.GetTrianglesUInt32Array(r,i,a);const s=new Uint32Array(e.HEAPF32.buffer,a,n).slice();return e._free(a),{array:s,itemSize:1}}(e,t,o));return e.destroy(o),u}(t,s,o,a),n=e.attributes.map((e=>e.array.buffer));e.index&&n.push(e.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:e},n)}catch(l){console.error(l),self.postMessage({type:"error",id:i.id,error:l.message})}finally{t.destroy(o),t.destroy(s)}}))}}}},43953:(e,t,r)=>{"use strict";r.d(t,{y:()=>c});var n=r(99477),i=r(93778),a=r(33785);let s,o,l;class c extends n.Loader{constructor(e){super(e)}load(e,t,r,i){const a=this,s=""===a.path?n.LoaderUtils.extractUrlBase(e):a.path,o=new n.FileLoader(this.manager);o.setPath(a.path),o.setResponseType("arraybuffer"),o.setRequestHeader(a.requestHeader),o.setWithCredentials(a.withCredentials),o.load(e,(function(r){try{t(a.parse(r,s))}catch(n){i?i(n):console.error(n),a.manager.itemError(e)}}),r,i)}parse(e,t){if(function(e){const t="Kaydara FBX Binary \0";return e.byteLength>=t.length&&t===_(e,0,t.length)}(e))s=(new f).parse(e);else{const t=_(e);if(!function(e){const t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let r=0;function n(t){const n=e[t-1];return e=e.slice(r+t),r++,n}for(let i=0;i<t.length;++i){if(n(1)===t[i])return!1}return!0}(t))throw new Error("THREE.FBXLoader: Unknown format.");if(v(t)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+v(t));s=(new p).parse(t)}const r=new n.TextureLoader(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new u(r,this.manager).parse(s)}}class u{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){o=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),r=this.parseMaterials(t),n=this.parseDeformers(),i=(new h).parse(n);return this.parseScene(n,i,r),l}parseConnections(){const e=new Map;if("Connections"in s){s.Connections.connections.forEach((function(t){const r=t[0],n=t[1],i=t[2];e.has(r)||e.set(r,{parents:[],children:[]});const a={ID:n,relationship:i};e.get(r).parents.push(a),e.has(n)||e.set(n,{parents:[],children:[]});const s={ID:r,relationship:i};e.get(n).children.push(s)}))}return e}parseImages(){const e={},t={};if("Video"in s.Objects){const r=s.Objects.Video;for(const n in r){const i=r[n];if(e[parseInt(n)]=i.RelativeFilename||i.Filename,"Content"in i){const e=i.Content instanceof ArrayBuffer&&i.Content.byteLength>0,a="string"==typeof i.Content&&""!==i.Content;if(e||a){const e=this.parseImage(r[n]);t[i.RelativeFilename||i.Filename]=e}}}}for(const r in e){const n=e[r];void 0!==t[n]?e[r]=t[n]:e[r]=e[r].split("\\").pop()}return e}parseImage(e){const t=e.Content,r=e.RelativeFilename||e.Filename,n=r.slice(r.lastIndexOf(".")+1).toLowerCase();let i;switch(n){case"bmp":i="image/bmp";break;case"jpg":case"jpeg":i="image/jpeg";break;case"png":i="image/png";break;case"tif":i="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",r),i="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+n+'" is not supported.')}if("string"==typeof t)return"data:"+i+";base64,"+t;{const e=new Uint8Array(t);return window.URL.createObjectURL(new Blob([e],{type:i}))}}parseTextures(e){const t=new Map;if("Texture"in s.Objects){const r=s.Objects.Texture;for(const n in r){const i=this.parseTexture(r[n],e);t.set(parseInt(n),i)}}return t}parseTexture(e,t){const r=this.loadTexture(e,t);r.ID=e.id,r.name=e.attrName;const i=e.WrapModeU,a=e.WrapModeV,s=void 0!==i?i.value:0,o=void 0!==a?a.value:0;if(r.wrapS=0===s?n.RepeatWrapping:n.ClampToEdgeWrapping,r.wrapT=0===o?n.RepeatWrapping:n.ClampToEdgeWrapping,"Scaling"in e){const t=e.Scaling.value;r.repeat.x=t[0],r.repeat.y=t[1]}return r}loadTexture(e,t){let r;const i=this.textureLoader.path,a=o.get(e.id).children;let s;void 0!==a&&a.length>0&&void 0!==t[a[0].ID]&&(r=t[a[0].ID],0!==r.indexOf("blob:")&&0!==r.indexOf("data:")||this.textureLoader.setPath(void 0));const l=e.FileName.slice(-3).toLowerCase();if("tga"===l){const t=this.manager.getHandler(".tga");null===t?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",e.RelativeFilename),s=new n.Texture):(t.setPath(this.textureLoader.path),s=t.load(r))}else"psd"===l?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",e.RelativeFilename),s=new n.Texture):s=this.textureLoader.load(r);return this.textureLoader.setPath(i),s}parseMaterials(e){const t=new Map;if("Material"in s.Objects){const r=s.Objects.Material;for(const n in r){const i=this.parseMaterial(r[n],e);null!==i&&t.set(parseInt(n),i)}}return t}parseMaterial(e,t){const r=e.id,i=e.attrName;let a=e.ShadingModel;if("object"==typeof a&&(a=a.value),!o.has(r))return null;const s=this.parseParameters(e,t,r);let l;switch(a.toLowerCase()){case"phong":l=new n.MeshPhongMaterial;break;case"lambert":l=new n.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',a),l=new n.MeshPhongMaterial}return l.setValues(s),l.name=i,l}parseParameters(e,t,r){const i={};e.BumpFactor&&(i.bumpScale=e.BumpFactor.value),e.Diffuse?i.color=(new n.Color).fromArray(e.Diffuse.value):!e.DiffuseColor||"Color"!==e.DiffuseColor.type&&"ColorRGB"!==e.DiffuseColor.type||(i.color=(new n.Color).fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(i.displacementScale=e.DisplacementFactor.value),e.Emissive?i.emissive=(new n.Color).fromArray(e.Emissive.value):!e.EmissiveColor||"Color"!==e.EmissiveColor.type&&"ColorRGB"!==e.EmissiveColor.type||(i.emissive=(new n.Color).fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(i.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(i.opacity=parseFloat(e.Opacity.value)),i.opacity<1&&(i.transparent=!0),e.ReflectionFactor&&(i.reflectivity=e.ReflectionFactor.value),e.Shininess&&(i.shininess=e.Shininess.value),e.Specular?i.specular=(new n.Color).fromArray(e.Specular.value):e.SpecularColor&&"Color"===e.SpecularColor.type&&(i.specular=(new n.Color).fromArray(e.SpecularColor.value));const a=this;return o.get(r).children.forEach((function(e){const r=e.relationship;switch(r){case"Bump":i.bumpMap=a.getTexture(t,e.ID);break;case"Maya|TEX_ao_map":i.aoMap=a.getTexture(t,e.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":i.map=a.getTexture(t,e.ID),void 0!==i.map&&("colorSpace"in i.map?i.map.colorSpace="srgb":i.map.encoding=3001);break;case"DisplacementColor":i.displacementMap=a.getTexture(t,e.ID);break;case"EmissiveColor":i.emissiveMap=a.getTexture(t,e.ID),void 0!==i.emissiveMap&&("colorSpace"in i.emissiveMap?i.emissiveMap.colorSpace="srgb":i.emissiveMap.encoding=3001);break;case"NormalMap":case"Maya|TEX_normal_map":i.normalMap=a.getTexture(t,e.ID);break;case"ReflectionColor":i.envMap=a.getTexture(t,e.ID),void 0!==i.envMap&&(i.envMap.mapping=n.EquirectangularReflectionMapping,"colorSpace"in i.envMap?i.envMap.colorSpace="srgb":i.envMap.encoding=3001);break;case"SpecularColor":i.specularMap=a.getTexture(t,e.ID),void 0!==i.specularMap&&("colorSpace"in i.specularMap?i.specularMap.colorSpace="srgb":i.specularMap.encoding=3001);break;case"TransparentColor":case"TransparencyFactor":i.alphaMap=a.getTexture(t,e.ID),i.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",r)}})),i}getTexture(e,t){return"LayeredTexture"in s.Objects&&t in s.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=o.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in s.Objects){const r=s.Objects.Deformer;for(const n in r){const i=r[n],a=o.get(parseInt(n));if("Skin"===i.attrType){const t=this.parseSkeleton(a,r);t.ID=n,a.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),t.geometryID=a.parents[0].ID,e[n]=t}else if("BlendShape"===i.attrType){const e={id:n};e.rawTargets=this.parseMorphTargets(a,r),e.id=n,a.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[n]=e}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const r=[];return e.children.forEach((function(e){const i=t[e.ID];if("Cluster"!==i.attrType)return;const a={ID:e.ID,indices:[],weights:[],transformLink:(new n.Matrix4).fromArray(i.TransformLink.a)};"Indexes"in i&&(a.indices=i.Indexes.a,a.weights=i.Weights.a),r.push(a)})),{rawBones:r,bones:[]}}parseMorphTargets(e,t){const r=[];for(let n=0;n<e.children.length;n++){const i=e.children[n],a=t[i.ID],s={name:a.attrName,initialWeight:a.DeformPercent,id:a.id,fullWeights:a.FullWeights.a};if("BlendShapeChannel"!==a.attrType)return;s.geoID=o.get(parseInt(i.ID)).children.filter((function(e){return void 0===e.relationship}))[0].ID,r.push(s)}return r}parseScene(e,t,r){l=new n.Group;const i=this.parseModels(e.skeletons,t,r),a=s.Objects.Model,c=this;i.forEach((function(e){const t=a[e.ID];c.setLookAtProperties(e,t);o.get(e.ID).parents.forEach((function(t){const r=i.get(t.ID);void 0!==r&&r.add(e)})),null===e.parent&&l.add(e)})),this.bindSkeleton(e.skeletons,t,i),this.createAmbientLight(),l.traverse((function(e){if(e.userData.transformData){e.parent&&(e.userData.transformData.parentMatrix=e.parent.matrix,e.userData.transformData.parentMatrixWorld=e.parent.matrixWorld);const t=E(e.userData.transformData);e.applyMatrix4(t),e.updateWorldMatrix()}}));const u=(new d).parse();1===l.children.length&&l.children[0].isGroup&&(l.children[0].animations=u,l=l.children[0]),l.animations=u}parseModels(e,t,r){const i=new Map,a=s.Objects.Model;for(const s in a){const l=parseInt(s),c=a[s],u=o.get(l);let h=this.buildSkeleton(u,e,l,c.attrName);if(!h){switch(c.attrType){case"Camera":h=this.createCamera(u);break;case"Light":h=this.createLight(u);break;case"Mesh":h=this.createMesh(u,t,r);break;case"NurbsCurve":h=this.createCurve(u,t);break;case"LimbNode":case"Root":h=new n.Bone;break;default:h=new n.Group}h.name=c.attrName?n.PropertyBinding.sanitizeNodeName(c.attrName):"",h.ID=l}this.getTransformData(h,c),i.set(l,h)}return i}buildSkeleton(e,t,r,i){let a=null;return e.parents.forEach((function(e){for(const s in t){const o=t[s];o.rawBones.forEach((function(t,s){if(t.ID===e.ID){const e=a;a=new n.Bone,a.matrixWorld.copy(t.transformLink),a.name=i?n.PropertyBinding.sanitizeNodeName(i):"",a.ID=r,o.bones[s]=a,null!==e&&a.add(e)}}))}})),a}createCamera(e){let t,r;if(e.children.forEach((function(e){const t=s.Objects.NodeAttribute[e.ID];void 0!==t&&(r=t)})),void 0===r)t=new n.Object3D;else{let e=0;void 0!==r.CameraProjectionType&&1===r.CameraProjectionType.value&&(e=1);let i=1;void 0!==r.NearPlane&&(i=r.NearPlane.value/1e3);let a=1e3;void 0!==r.FarPlane&&(a=r.FarPlane.value/1e3);let s=window.innerWidth,o=window.innerHeight;void 0!==r.AspectWidth&&void 0!==r.AspectHeight&&(s=r.AspectWidth.value,o=r.AspectHeight.value);const l=s/o;let c=45;void 0!==r.FieldOfView&&(c=r.FieldOfView.value);const u=r.FocalLength?r.FocalLength.value:null;switch(e){case 0:t=new n.PerspectiveCamera(c,l,i,a),null!==u&&t.setFocalLength(u);break;case 1:t=new n.OrthographicCamera(-s/2,s/2,o/2,-o/2,i,a);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+e+"."),t=new n.Object3D}}return t}createLight(e){let t,r;if(e.children.forEach((function(e){const t=s.Objects.NodeAttribute[e.ID];void 0!==t&&(r=t)})),void 0===r)t=new n.Object3D;else{let e;e=void 0===r.LightType?0:r.LightType.value;let i=16777215;void 0!==r.Color&&(i=(new n.Color).fromArray(r.Color.value));let a=void 0===r.Intensity?1:r.Intensity.value/100;void 0!==r.CastLightOnObject&&0===r.CastLightOnObject.value&&(a=0);let s=0;void 0!==r.FarAttenuationEnd&&(s=void 0!==r.EnableFarAttenuation&&0===r.EnableFarAttenuation.value?0:r.FarAttenuationEnd.value);const o=1;switch(e){case 0:t=new n.PointLight(i,a,s,o);break;case 1:t=new n.DirectionalLight(i,a);break;case 2:let e=Math.PI/3;void 0!==r.InnerAngle&&(e=n.MathUtils.degToRad(r.InnerAngle.value));let l=0;void 0!==r.OuterAngle&&(l=n.MathUtils.degToRad(r.OuterAngle.value),l=Math.max(l,1)),t=new n.SpotLight(i,a,s,e,l,o);break;default:console.warn("THREE.FBXLoader: Unknown light type "+r.LightType.value+", defaulting to a PointLight."),t=new n.PointLight(i,a)}void 0!==r.CastShadows&&1===r.CastShadows.value&&(t.castShadow=!0)}return t}createMesh(e,t,r){let i,a=null,s=null;const o=[];return e.children.forEach((function(e){t.has(e.ID)&&(a=t.get(e.ID)),r.has(e.ID)&&o.push(r.get(e.ID))})),o.length>1?s=o:o.length>0?s=o[0]:(s=new n.MeshPhongMaterial({color:13421772}),o.push(s)),"color"in a.attributes&&o.forEach((function(e){e.vertexColors=!0})),a.FBX_Deformer?(i=new n.SkinnedMesh(a,s),i.normalizeSkinWeights()):i=new n.Mesh(a,s),i}createCurve(e,t){const r=e.children.reduce((function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e}),null),i=new n.LineBasicMaterial({color:3342591,linewidth:1});return new n.Line(r,i)}getTransformData(e,t){const r={};"InheritType"in t&&(r.inheritType=parseInt(t.InheritType.value)),r.eulerOrder="RotationOrder"in t?S(t.RotationOrder.value):"ZYX","Lcl_Translation"in t&&(r.translation=t.Lcl_Translation.value),"PreRotation"in t&&(r.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(r.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(r.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(r.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(r.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(r.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(r.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(r.rotationPivot=t.RotationPivot.value),e.userData.transformData=r}setLookAtProperties(e,t){if("LookAtProperty"in t){o.get(e.ID).children.forEach((function(t){if("LookAtProperty"===t.relationship){const r=s.Objects.Model[t.ID];if("Lcl_Translation"in r){const t=r.Lcl_Translation.value;void 0!==e.target?(e.target.position.fromArray(t),l.add(e.target)):e.lookAt((new n.Vector3).fromArray(t))}}}))}}bindSkeleton(e,t,r){const i=this.parsePoseNodes();for(const a in e){const s=e[a];o.get(parseInt(s.ID)).parents.forEach((function(e){if(t.has(e.ID)){const t=e.ID;o.get(t).parents.forEach((function(e){if(r.has(e.ID)){r.get(e.ID).bind(new n.Skeleton(s.bones),i[e.ID])}}))}}))}}parsePoseNodes(){const e={};if("Pose"in s.Objects){const t=s.Objects.Pose;for(const r in t)if("BindPose"===t[r].attrType&&t[r].NbPoseNodes>0){const i=t[r].PoseNode;Array.isArray(i)?i.forEach((function(t){e[t.Node]=(new n.Matrix4).fromArray(t.Matrix.a)})):e[i.Node]=(new n.Matrix4).fromArray(i.Matrix.a)}}return e}createAmbientLight(){if("GlobalSettings"in s&&"AmbientColor"in s.GlobalSettings){const e=s.GlobalSettings.AmbientColor.value,t=e[0],r=e[1],i=e[2];if(0!==t||0!==r||0!==i){const e=new n.Color(t,r,i);l.add(new n.AmbientLight(e,1))}}}}class h{parse(e){const t=new Map;if("Geometry"in s.Objects){const r=s.Objects.Geometry;for(const n in r){const i=o.get(parseInt(n)),a=this.parseGeometry(i,r[n],e);t.set(parseInt(n),a)}}return t}parseGeometry(e,t,r){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,r);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,r){const n=r.skeletons,i=[],a=e.parents.map((function(e){return s.Objects.Model[e.ID]}));if(0===a.length)return;const o=e.children.reduce((function(e,t){return void 0!==n[t.ID]&&(e=n[t.ID]),e}),null);e.children.forEach((function(e){void 0!==r.morphTargets[e.ID]&&i.push(r.morphTargets[e.ID])}));const l=a[0],c={};"RotationOrder"in l&&(c.eulerOrder=S(l.RotationOrder.value)),"InheritType"in l&&(c.inheritType=parseInt(l.InheritType.value)),"GeometricTranslation"in l&&(c.translation=l.GeometricTranslation.value),"GeometricRotation"in l&&(c.rotation=l.GeometricRotation.value),"GeometricScaling"in l&&(c.scale=l.GeometricScaling.value);const u=E(c);return this.genGeometry(t,o,i,u)}genGeometry(e,t,r,i){const a=new n.BufferGeometry;e.attrName&&(a.name=e.attrName);const s=this.parseGeoNode(e,t),o=this.genBuffers(s),l=new n.Float32BufferAttribute(o.vertex,3);if(l.applyMatrix4(i),a.setAttribute("position",l),o.colors.length>0&&a.setAttribute("color",new n.Float32BufferAttribute(o.colors,3)),t&&(a.setAttribute("skinIndex",new n.Uint16BufferAttribute(o.weightsIndices,4)),a.setAttribute("skinWeight",new n.Float32BufferAttribute(o.vertexWeights,4)),a.FBX_Deformer=t),o.normal.length>0){const e=(new n.Matrix3).getNormalMatrix(i),t=new n.Float32BufferAttribute(o.normal,3);t.applyNormalMatrix(e),a.setAttribute("normal",t)}if(o.uvs.forEach((function(e,t){let r="uv"+(t+1).toString();0===t&&(r="uv"),a.setAttribute(r,new n.Float32BufferAttribute(o.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){let e=o.materialIndex[0],t=0;if(o.materialIndex.forEach((function(r,n){r!==e&&(a.addGroup(t,n-t,e),e=r,t=n)})),a.groups.length>0){const t=a.groups[a.groups.length-1],r=t.start+t.count;r!==o.materialIndex.length&&a.addGroup(r,o.materialIndex.length-r,e)}0===a.groups.length&&a.addGroup(0,o.materialIndex.length,o.materialIndex[0])}return this.addMorphTargets(a,e,r,i),a}parseGeoNode(e,t){const r={};if(r.vertexPositions=void 0!==e.Vertices?e.Vertices.a:[],r.vertexIndices=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(r.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(r.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(r.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){r.uv=[];let t=0;for(;e.LayerElementUV[t];)e.LayerElementUV[t].UV&&r.uv.push(this.parseUVs(e.LayerElementUV[t])),t++}return r.weightTable={},null!==t&&(r.skeleton=t,t.rawBones.forEach((function(e,t){e.indices.forEach((function(n,i){void 0===r.weightTable[n]&&(r.weightTable[n]=[]),r.weightTable[n].push({id:t,weight:e.weights[i]})}))}))),r}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let r=0,n=0,i=!1,a=[],s=[],o=[],l=[],c=[],u=[];const h=this;return e.vertexIndices.forEach((function(d,p){let f,m=!1;d<0&&(d^=-1,m=!0);let g=[],v=[];if(a.push(3*d,3*d+1,3*d+2),e.color){const t=x(p,r,d,e.color);o.push(t[0],t[1],t[2])}if(e.skeleton){if(void 0!==e.weightTable[d]&&e.weightTable[d].forEach((function(e){v.push(e.weight),g.push(e.id)})),v.length>4){i||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),i=!0);const e=[0,0,0,0],t=[0,0,0,0];v.forEach((function(r,n){let i=r,a=g[n];t.forEach((function(t,r,n){if(i>t){n[r]=i,i=t;const s=e[r];e[r]=a,a=s}}))})),g=e,v=t}for(;v.length<4;)v.push(0),g.push(0);for(let e=0;e<4;++e)c.push(v[e]),u.push(g[e])}if(e.normal){const t=x(p,r,d,e.normal);s.push(t[0],t[1],t[2])}e.material&&"AllSame"!==e.material.mappingType&&(f=x(p,r,d,e.material)[0]),e.uv&&e.uv.forEach((function(e,t){const n=x(p,r,d,e);void 0===l[t]&&(l[t]=[]),l[t].push(n[0]),l[t].push(n[1])})),n++,m&&(h.genFace(t,e,a,f,s,o,l,c,u,n),r++,n=0,a=[],s=[],o=[],l=[],c=[],u=[])})),t}genFace(e,t,r,n,i,a,s,o,l,c){for(let u=2;u<c;u++)e.vertex.push(t.vertexPositions[r[0]]),e.vertex.push(t.vertexPositions[r[1]]),e.vertex.push(t.vertexPositions[r[2]]),e.vertex.push(t.vertexPositions[r[3*(u-1)]]),e.vertex.push(t.vertexPositions[r[3*(u-1)+1]]),e.vertex.push(t.vertexPositions[r[3*(u-1)+2]]),e.vertex.push(t.vertexPositions[r[3*u]]),e.vertex.push(t.vertexPositions[r[3*u+1]]),e.vertex.push(t.vertexPositions[r[3*u+2]]),t.skeleton&&(e.vertexWeights.push(o[0]),e.vertexWeights.push(o[1]),e.vertexWeights.push(o[2]),e.vertexWeights.push(o[3]),e.vertexWeights.push(o[4*(u-1)]),e.vertexWeights.push(o[4*(u-1)+1]),e.vertexWeights.push(o[4*(u-1)+2]),e.vertexWeights.push(o[4*(u-1)+3]),e.vertexWeights.push(o[4*u]),e.vertexWeights.push(o[4*u+1]),e.vertexWeights.push(o[4*u+2]),e.vertexWeights.push(o[4*u+3]),e.weightsIndices.push(l[0]),e.weightsIndices.push(l[1]),e.weightsIndices.push(l[2]),e.weightsIndices.push(l[3]),e.weightsIndices.push(l[4*(u-1)]),e.weightsIndices.push(l[4*(u-1)+1]),e.weightsIndices.push(l[4*(u-1)+2]),e.weightsIndices.push(l[4*(u-1)+3]),e.weightsIndices.push(l[4*u]),e.weightsIndices.push(l[4*u+1]),e.weightsIndices.push(l[4*u+2]),e.weightsIndices.push(l[4*u+3])),t.color&&(e.colors.push(a[0]),e.colors.push(a[1]),e.colors.push(a[2]),e.colors.push(a[3*(u-1)]),e.colors.push(a[3*(u-1)+1]),e.colors.push(a[3*(u-1)+2]),e.colors.push(a[3*u]),e.colors.push(a[3*u+1]),e.colors.push(a[3*u+2])),t.material&&"AllSame"!==t.material.mappingType&&(e.materialIndex.push(n),e.materialIndex.push(n),e.materialIndex.push(n)),t.normal&&(e.normal.push(i[0]),e.normal.push(i[1]),e.normal.push(i[2]),e.normal.push(i[3*(u-1)]),e.normal.push(i[3*(u-1)+1]),e.normal.push(i[3*(u-1)+2]),e.normal.push(i[3*u]),e.normal.push(i[3*u+1]),e.normal.push(i[3*u+2])),t.uv&&t.uv.forEach((function(t,r){void 0===e.uvs[r]&&(e.uvs[r]=[]),e.uvs[r].push(s[r][0]),e.uvs[r].push(s[r][1]),e.uvs[r].push(s[r][2*(u-1)]),e.uvs[r].push(s[r][2*(u-1)+1]),e.uvs[r].push(s[r][2*u]),e.uvs[r].push(s[r][2*u+1])}))}addMorphTargets(e,t,r,n){if(0===r.length)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const i=this;r.forEach((function(r){r.rawTargets.forEach((function(r){const a=s.Objects.Geometry[r.geoID];void 0!==a&&i.genMorphGeometry(e,t,a,n,r.name)}))}))}genMorphGeometry(e,t,r,i,a){const s=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],o=void 0!==r.Vertices?r.Vertices.a:[],l=void 0!==r.Indexes?r.Indexes.a:[],c=3*e.attributes.position.count,u=new Float32Array(c);for(let n=0;n<l.length;n++){const e=3*l[n];u[e]=o[3*n],u[e+1]=o[3*n+1],u[e+2]=o[3*n+2]}const h={vertexIndices:s,vertexPositions:u},d=this.genBuffers(h),p=new n.Float32BufferAttribute(d.vertex,3);p.name=a||r.attrName,p.applyMatrix4(i),e.morphAttributes.position.push(p)}parseNormals(e){const t=e.MappingInformationType,r=e.ReferenceInformationType,n=e.Normals.a;let i=[];return"IndexToDirect"===r&&("NormalIndex"in e?i=e.NormalIndex.a:"NormalsIndex"in e&&(i=e.NormalsIndex.a)),{dataSize:3,buffer:n,indices:i,mappingType:t,referenceType:r}}parseUVs(e){const t=e.MappingInformationType,r=e.ReferenceInformationType,n=e.UV.a;let i=[];return"IndexToDirect"===r&&(i=e.UVIndex.a),{dataSize:2,buffer:n,indices:i,mappingType:t,referenceType:r}}parseVertexColors(e){const t=e.MappingInformationType,r=e.ReferenceInformationType,n=e.Colors.a;let i=[];return"IndexToDirect"===r&&(i=e.ColorIndex.a),{dataSize:4,buffer:n,indices:i,mappingType:t,referenceType:r}}parseMaterialIndices(e){const t=e.MappingInformationType,r=e.ReferenceInformationType;if("NoMappingInformation"===t)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:r};const n=e.Materials.a,i=[];for(let a=0;a<n.length;++a)i.push(a);return{dataSize:1,buffer:n,indices:i,mappingType:t,referenceType:r}}parseNurbsGeometry(e){if(void 0===a.e)return console.error("THREE.FBXLoader: The loader relies on NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry."),new n.BufferGeometry;const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new n.BufferGeometry;const r=t-1,i=e.KnotVector.a,s=[],o=e.Points.a;for(let a=0,h=o.length;a<h;a+=4)s.push((new n.Vector4).fromArray(o,a));let l,c;if("Closed"===e.Form)s.push(s[0]);else if("Periodic"===e.Form){l=r,c=i.length-1-l;for(let e=0;e<r;++e)s.push(s[e])}const u=new a.e(r,i,s,l,c).getPoints(12*s.length);return(new n.BufferGeometry).setFromPoints(u)}}class d{parse(){const e=[],t=this.parseClips();if(void 0!==t)for(const r in t){const n=t[r],i=this.addClip(n);e.push(i)}return e}parseClips(){if(void 0===s.Objects.AnimationCurve)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=s.Objects.AnimationCurveNode,t=new Map;for(const r in e){const n=e[r];if(null!==n.attrName.match(/S|R|T|DeformPercent/)){const e={id:n.id,attr:n.attrName,curves:{}};t.set(e.id,e)}}return t}parseAnimationCurves(e){const t=s.Objects.AnimationCurve;for(const r in t){const n={id:t[r].id,times:t[r].KeyTime.a.map(A),values:t[r].KeyValueFloat.a},i=o.get(n.id);if(void 0!==i){const t=i.parents[0].ID,r=i.parents[0].relationship;r.match(/X/)?e.get(t).curves.x=n:r.match(/Y/)?e.get(t).curves.y=n:r.match(/Z/)?e.get(t).curves.z=n:r.match(/d|DeformPercent/)&&e.has(t)&&(e.get(t).curves.morph=n)}}}parseAnimationLayers(e){const t=s.Objects.AnimationLayer,r=new Map;for(const i in t){const t=[],a=o.get(parseInt(i));if(void 0!==a){a.children.forEach((function(r,i){if(e.has(r.ID)){const a=e.get(r.ID);if(void 0!==a.curves.x||void 0!==a.curves.y||void 0!==a.curves.z){if(void 0===t[i]){const e=o.get(r.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID;if(void 0!==e){const a=s.Objects.Model[e.toString()];if(void 0===a)return void console.warn("THREE.FBXLoader: Encountered a unused curve.",r);const o={modelName:a.attrName?n.PropertyBinding.sanitizeNodeName(a.attrName):"",ID:a.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};l.traverse((function(e){e.ID===a.id&&(o.transform=e.matrix,e.userData.transformData&&(o.eulerOrder=e.userData.transformData.eulerOrder))})),o.transform||(o.transform=new n.Matrix4),"PreRotation"in a&&(o.preRotation=a.PreRotation.value),"PostRotation"in a&&(o.postRotation=a.PostRotation.value),t[i]=o}}t[i]&&(t[i][a.attr]=a)}else if(void 0!==a.curves.morph){if(void 0===t[i]){const e=o.get(r.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID,a=o.get(e).parents[0].ID,l=o.get(a).parents[0].ID,c=o.get(l).parents[0].ID,u=s.Objects.Model[c],h={modelName:u.attrName?n.PropertyBinding.sanitizeNodeName(u.attrName):"",morphName:s.Objects.Deformer[e].attrName};t[i]=h}t[i][a.attr]=a}}})),r.set(parseInt(i),t)}}return r}parseAnimStacks(e){const t=s.Objects.AnimationStack,r={};for(const n in t){const i=o.get(parseInt(n)).children;i.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const a=e.get(i[0].ID);r[n]={name:t[n].attrName,layer:a}}return r}addClip(e){let t=[];const r=this;return e.layer.forEach((function(e){t=t.concat(r.generateTracks(e))})),new n.AnimationClip(e.name,-1,t)}generateTracks(e){const t=[];let r=new n.Vector3,i=new n.Quaternion,a=new n.Vector3;if(e.transform&&e.transform.decompose(r,i,a),r=r.toArray(),i=(new n.Euler).setFromQuaternion(i,e.eulerOrder).toArray(),a=a.toArray(),void 0!==e.T&&Object.keys(e.T.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.T.curves,r,"position");void 0!==n&&t.push(n)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){const r=this.generateRotationTrack(e.modelName,e.R.curves,i,e.preRotation,e.postRotation,e.eulerOrder);void 0!==r&&t.push(r)}if(void 0!==e.S&&Object.keys(e.S.curves).length>0){const r=this.generateVectorTrack(e.modelName,e.S.curves,a,"scale");void 0!==r&&t.push(r)}if(void 0!==e.DeformPercent){const r=this.generateMorphTrack(e);void 0!==r&&t.push(r)}return t}generateVectorTrack(e,t,r,i){const a=this.getTimesForAllAxes(t),s=this.getKeyframeTrackValues(a,t,r);return new n.VectorKeyframeTrack(e+"."+i,a,s)}generateRotationTrack(e,t,r,i,a,s){void 0!==t.x&&(this.interpolateRotations(t.x),t.x.values=t.x.values.map(n.MathUtils.degToRad)),void 0!==t.y&&(this.interpolateRotations(t.y),t.y.values=t.y.values.map(n.MathUtils.degToRad)),void 0!==t.z&&(this.interpolateRotations(t.z),t.z.values=t.z.values.map(n.MathUtils.degToRad));const o=this.getTimesForAllAxes(t),l=this.getKeyframeTrackValues(o,t,r);void 0!==i&&((i=i.map(n.MathUtils.degToRad)).push(s),i=(new n.Euler).fromArray(i),i=(new n.Quaternion).setFromEuler(i)),void 0!==a&&((a=a.map(n.MathUtils.degToRad)).push(s),a=(new n.Euler).fromArray(a),a=(new n.Quaternion).setFromEuler(a).invert());const c=new n.Quaternion,u=new n.Euler,h=[];for(let n=0;n<l.length;n+=3)u.set(l[n],l[n+1],l[n+2],s),c.setFromEuler(u),void 0!==i&&c.premultiply(i),void 0!==a&&c.multiply(a),c.toArray(h,n/3*4);return new n.QuaternionKeyframeTrack(e+".quaternion",o,h)}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,r=t.values.map((function(e){return e/100})),i=l.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new n.NumberKeyframeTrack(e.modelName+".morphTargetInfluences["+i+"]",t.times,r)}getTimesForAllAxes(e){let t=[];if(void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})),t.length>1){let e=1,r=t[0];for(let n=1;n<t.length;n++){const i=t[n];i!==r&&(t[e]=i,r=i,e++)}t=t.slice(0,e)}return t}getKeyframeTrackValues(e,t,r){const n=r,i=[];let a=-1,s=-1,o=-1;return e.forEach((function(e){if(t.x&&(a=t.x.times.indexOf(e)),t.y&&(s=t.y.times.indexOf(e)),t.z&&(o=t.z.times.indexOf(e)),-1!==a){const e=t.x.values[a];i.push(e),n[0]=e}else i.push(n[0]);if(-1!==s){const e=t.y.values[s];i.push(e),n[1]=e}else i.push(n[1]);if(-1!==o){const e=t.z.values[o];i.push(e),n[2]=e}else i.push(n[2])})),i}interpolateRotations(e){for(let t=1;t<e.values.length;t++){const r=e.values[t-1],n=e.values[t]-r,i=Math.abs(n);if(i>=180){const a=i/180,s=n/a;let o=r+s;const l=e.times[t-1],c=(e.times[t]-l)/a;let u=l+c;const h=[],d=[];for(;u<e.times[t];)h.push(u),u+=c,d.push(o),o+=s;e.times=T(e.times,t,h),e.values=T(e.values,t,d)}}}}class p{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new g,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,r=e.split(/[\r\n]+/);return r.forEach((function(e,n){const i=e.match(/^[\s\t]*;/),a=e.match(/^[\s\t]*$/);if(i||a)return;const s=e.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),o=e.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=e.match("^\\t{"+(t.currentIndent-1)+"}}");s?t.parseNodeBegin(e,s):o?t.parseNodeProperty(e,o,r[++n]):l?t.popStack():e.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(e)})),this.allNodes}parseNodeBegin(e,t){const r=t[1].trim().replace(/^"/,"").replace(/"$/,""),n=t[2].split(",").map((function(e){return e.trim().replace(/^"/,"").replace(/"$/,"")})),i={name:r},a=this.parseNodeAttr(n),s=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(r,i):r in s?("PoseNode"===r?s.PoseNode.push(i):void 0!==s[r].id&&(s[r]={},s[r][s[r].id]=s[r]),""!==a.id&&(s[r][a.id]=i)):"number"==typeof a.id?(s[r]={},s[r][a.id]=i):"Properties70"!==r&&(s[r]="PoseNode"===r?[i]:i),"number"==typeof a.id&&(i.id=a.id),""!==a.name&&(i.attrName=a.name),""!==a.type&&(i.attrType=a.type),this.pushStack(i)}parseNodeAttr(e){let t=e[0];""!==e[0]&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let r="",n="";return e.length>1&&(r=e[1].replace(/^(\w+)::/,""),n=e[2]),{id:t,name:r,type:n}}parseNodeProperty(e,t,r){let n=t[1].replace(/^"/,"").replace(/"$/,"").trim(),i=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===n&&","===i&&(i=r.replace(/"/g,"").replace(/,$/,"").trim());const a=this.getCurrentNode();if("Properties70"!==a.name){if("C"===n){const e=i.split(",").slice(1),t=parseInt(e[0]),r=parseInt(e[1]);let s=i.split(",").slice(3);s=s.map((function(e){return e.trim().replace(/^"/,"")})),n="connections",i=[t,r],function(e,t){for(let r=0,n=e.length,i=t.length;r<i;r++,n++)e[n]=t[r]}(i,s),void 0===a[n]&&(a[n]=[])}"Node"===n&&(a.id=i),n in a&&Array.isArray(a[n])?a[n].push(i):"a"!==n?a[n]=i:a.a=i,this.setCurrentProp(a,n),"a"===n&&","!==i.slice(-1)&&(a.a=M(i))}else this.parseNodeSpecialProperty(e,n,i)}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,","!==e.slice(-1)&&(t.a=M(t.a))}parseNodeSpecialProperty(e,t,r){const n=r.split('",').map((function(e){return e.trim().replace(/^\"/,"").replace(/\s/,"_")})),i=n[0],a=n[1],s=n[2],o=n[3];let l=n[4];switch(a){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=M(l)}this.getPrevNode()[i]={type:a,type2:s,flag:o,value:l},this.setCurrentProp(this.getPrevNode(),i)}}class f{parse(e){const t=new m(e);t.skip(23);const r=t.getUint32();if(r<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+r);const n=new g;for(;!this.endOfContent(t);){const e=this.parseNode(t,r);null!==e&&n.add(e.name,e)}return n}endOfContent(e){return e.size()%16==0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const r={},n=t>=7500?e.getUint64():e.getUint32(),i=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const a=e.getUint8(),s=e.getString(a);if(0===n)return null;const o=[];for(let h=0;h<i;h++)o.push(this.parseProperty(e));const l=o.length>0?o[0]:"",c=o.length>1?o[1]:"",u=o.length>2?o[2]:"";for(r.singleProperty=1===i&&e.getOffset()===n;n>e.getOffset();){const n=this.parseNode(e,t);null!==n&&this.parseSubNode(s,r,n)}return r.propertyList=o,"number"==typeof l&&(r.id=l),""!==c&&(r.attrName=c),""!==u&&(r.attrType=u),""!==s&&(r.name=s),r}parseSubNode(e,t,r){if(!0===r.singleProperty){const e=r.propertyList[0];Array.isArray(e)?(t[r.name]=r,r.a=e):t[r.name]=e}else if("Connections"===e&&"C"===r.name){const e=[];r.propertyList.forEach((function(t,r){0!==r&&e.push(t)})),void 0===t.connections&&(t.connections=[]),t.connections.push(e)}else if("Properties70"===r.name){Object.keys(r).forEach((function(e){t[e]=r[e]}))}else if("Properties70"===e&&"P"===r.name){let e=r.propertyList[0],n=r.propertyList[1];const i=r.propertyList[2],a=r.propertyList[3];let s;0===e.indexOf("Lcl ")&&(e=e.replace("Lcl ","Lcl_")),0===n.indexOf("Lcl ")&&(n=n.replace("Lcl ","Lcl_")),s="Color"===n||"ColorRGB"===n||"Vector"===n||"Vector3D"===n||0===n.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[e]={type:n,type2:i,flag:a,value:s}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)}parseProperty(e){const t=e.getString(1);let r;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return r=e.getUint32(),e.getArrayBuffer(r);case"S":return r=e.getUint32(),e.getString(r);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const n=e.getUint32(),a=e.getUint32(),s=e.getUint32();if(0===a)switch(t){case"b":case"c":return e.getBooleanArray(n);case"d":return e.getFloat64Array(n);case"f":return e.getFloat32Array(n);case"i":return e.getInt32Array(n);case"l":return e.getInt64Array(n)}const o=(0,i.HT)(new Uint8Array(e.getArrayBuffer(s))),l=new m(o.buffer);switch(t){case"b":case"c":return l.getBooleanArray(n);case"d":return l.getFloat64Array(n);case"f":return l.getFloat32Array(n);case"i":return l.getInt32Array(n);case"l":return l.getInt64Array(n)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class m{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return 1==(1&this.getUint8())}getBooleanArray(e){const t=[];for(let r=0;r<e;r++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let r=0;r<e;r++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),2147483648&t?(t=4294967295&~t,e=4294967295&~e,4294967295===e&&(t=t+1&4294967295),e=e+1&4294967295,-(4294967296*t+e)):4294967296*t+e}getInt64Array(e){const t=[];for(let r=0;r<e;r++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),4294967296*t+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let r=0;r<e;r++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let r=0;r<e;r++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){let t=[];for(let n=0;n<e;n++)t[n]=this.getUint8();const r=t.indexOf(0);return r>=0&&(t=t.slice(0,r)),n.LoaderUtils.decodeText(new Uint8Array(t))}}class g{add(e,t){this[e]=t}}function v(e){const t=e.match(/FBXVersion: (\d+)/);if(t){return parseInt(t[1])}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function A(e){return e/46186158e3}const y=[];function x(e,t,r,n){let i;switch(n.mappingType){case"ByPolygonVertex":i=e;break;case"ByPolygon":i=t;break;case"ByVertice":i=r;break;case"AllSame":i=n.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+n.mappingType)}"IndexToDirect"===n.referenceType&&(i=n.indices[i]);const a=i*n.dataSize,s=a+n.dataSize;return function(e,t,r,n){for(let i=r,a=0;i<n;i++,a++)e[a]=t[i];return e}(y,n.buffer,a,s)}const b=new n.Euler,w=new n.Vector3;function E(e){const t=new n.Matrix4,r=new n.Matrix4,i=new n.Matrix4,a=new n.Matrix4,s=new n.Matrix4,o=new n.Matrix4,l=new n.Matrix4,c=new n.Matrix4,u=new n.Matrix4,h=new n.Matrix4,d=new n.Matrix4,p=new n.Matrix4,f=e.inheritType?e.inheritType:0;if(e.translation&&t.setPosition(w.fromArray(e.translation)),e.preRotation){const t=e.preRotation.map(n.MathUtils.degToRad);t.push(e.eulerOrder),r.makeRotationFromEuler(b.fromArray(t))}if(e.rotation){const t=e.rotation.map(n.MathUtils.degToRad);t.push(e.eulerOrder),i.makeRotationFromEuler(b.fromArray(t))}if(e.postRotation){const t=e.postRotation.map(n.MathUtils.degToRad);t.push(e.eulerOrder),a.makeRotationFromEuler(b.fromArray(t)),a.invert()}e.scale&&s.scale(w.fromArray(e.scale)),e.scalingOffset&&l.setPosition(w.fromArray(e.scalingOffset)),e.scalingPivot&&o.setPosition(w.fromArray(e.scalingPivot)),e.rotationOffset&&c.setPosition(w.fromArray(e.rotationOffset)),e.rotationPivot&&u.setPosition(w.fromArray(e.rotationPivot)),e.parentMatrixWorld&&(d.copy(e.parentMatrix),h.copy(e.parentMatrixWorld));const m=r.clone().multiply(i).multiply(a),g=new n.Matrix4;g.extractRotation(h);const v=new n.Matrix4;v.copyPosition(h);const A=v.clone().invert().multiply(h),y=g.clone().invert().multiply(A),x=s,E=new n.Matrix4;if(0===f)E.copy(g).multiply(m).multiply(y).multiply(x);else if(1===f)E.copy(g).multiply(y).multiply(m).multiply(x);else{const e=(new n.Matrix4).scale((new n.Vector3).setFromMatrixScale(d)).clone().invert(),t=y.clone().multiply(e);E.copy(g).multiply(m).multiply(t).multiply(x)}const S=u.clone().invert(),M=o.clone().invert();let _=t.clone().multiply(c).multiply(u).multiply(r).multiply(i).multiply(a).multiply(S).multiply(l).multiply(o).multiply(s).multiply(M);const T=(new n.Matrix4).copyPosition(_),C=h.clone().multiply(T);return p.copyPosition(C),_=p.clone().multiply(E),_.premultiply(h.invert()),_}function S(e){const t=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(e=e||0)?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),t[0]):t[e]}function M(e){return e.split(",").map((function(e){return parseFloat(e)}))}function _(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=e.byteLength),n.LoaderUtils.decodeText(new Uint8Array(e,t,r))}function T(e,t,r){return e.slice(0,t).concat(r).concat(e.slice(t))}},17607:(e,t,r)=>{"use strict";r.d(t,{E:()=>a});var n=r(99477),i=r(84975);class a extends n.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new h(e)})),this.register((function(e){return new A(e)})),this.register((function(e){return new y(e)})),this.register((function(e){return new x(e)})),this.register((function(e){return new p(e)})),this.register((function(e){return new f(e)})),this.register((function(e){return new m(e)})),this.register((function(e){return new g(e)})),this.register((function(e){return new u(e)})),this.register((function(e){return new v(e)})),this.register((function(e){return new d(e)})),this.register((function(e){return new l(e)})),this.register((function(e){return new b(e)})),this.register((function(e){return new w(e)}))}load(e,t,r,i){const a=this;let s;s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:n.LoaderUtils.extractUrlBase(e),this.manager.itemStart(e);const o=function(t){i?i(t):console.error(t),a.manager.itemError(e),a.manager.itemEnd(e)},l=new n.FileLoader(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,(function(r){try{a.parse(r,s,(function(r){t(r),a.manager.itemEnd(e)}),o)}catch(n){o(n)}}),r,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,r,i){let a;const s={},l={};if("string"==typeof e)a=JSON.parse(e);else if(e instanceof ArrayBuffer){if(n.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4)))===E){try{s[o.KHR_BINARY_GLTF]=new _(e)}catch(h){return void(i&&i(h))}a=JSON.parse(s[o.KHR_BINARY_GLTF].content)}else a=JSON.parse(n.LoaderUtils.decodeText(new Uint8Array(e)))}else a=e;if(void 0===a.asset||a.asset.version[0]<2)return void(i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const u=new J(a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let n=0;n<this.pluginCallbacks.length;n++){const e=this.pluginCallbacks[n](u);l[e.name]=e,s[e.name]=!0}if(a.extensionsUsed)for(let n=0;n<a.extensionsUsed.length;++n){const e=a.extensionsUsed[n],t=a.extensionsRequired||[];switch(e){case o.KHR_MATERIALS_UNLIT:s[e]=new c;break;case o.KHR_DRACO_MESH_COMPRESSION:s[e]=new T(a,this.dracoLoader);break;case o.KHR_TEXTURE_TRANSFORM:s[e]=new C;break;case o.KHR_MESH_QUANTIZATION:s[e]=new I;break;default:t.indexOf(e)>=0&&void 0===l[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}u.setExtensions(s),u.setPlugins(l),u.parse(r,i)}parseAsync(e,t){const r=this;return new Promise((function(n,i){r.parse(e,t,n,i)}))}}function s(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const o={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class l{constructor(e){this.parser=e,this.name=o.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r<n;r++){const n=t[r];n.extensions&&n.extensions[this.name]&&void 0!==n.extensions[this.name].light&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){const t=this.parser,r="light:"+e;let i=t.cache.get(r);if(i)return i;const a=t.json,s=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e];let o;const l=new n.Color(16777215);void 0!==s.color&&l.fromArray(s.color);const c=void 0!==s.range?s.range:0;switch(s.type){case"directional":o=new n.DirectionalLight(l),o.target.position.set(0,0,-1),o.add(o.target);break;case"point":o=new n.PointLight(l),o.distance=c;break;case"spot":o=new n.SpotLight(l),o.distance=c,s.spot=s.spot||{},s.spot.innerConeAngle=void 0!==s.spot.innerConeAngle?s.spot.innerConeAngle:0,s.spot.outerConeAngle=void 0!==s.spot.outerConeAngle?s.spot.outerConeAngle:Math.PI/4,o.angle=s.spot.outerConeAngle,o.penumbra=1-s.spot.innerConeAngle/s.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+s.type)}return o.position.set(0,0,0),o.decay=2,j(o,s),void 0!==s.intensity&&(o.intensity=s.intensity),o.name=t.createUniqueName(s.name||"light_"+e),i=Promise.resolve(o),t.cache.add(r,i),i}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){const t=this,r=this.parser,n=r.json.nodes[e],i=(n.extensions&&n.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then((function(e){return r._getNodeRef(t.cache,i,e)}))}}class c{constructor(){this.name=o.KHR_MATERIALS_UNLIT}getMaterialType(){return n.MeshBasicMaterial}extendParams(e,t,r){const i=[];e.color=new n.Color(1,1,1),e.opacity=1;const a=t.pbrMetallicRoughness;if(a){if(Array.isArray(a.baseColorFactor)){const t=a.baseColorFactor;e.color.fromArray(t),e.opacity=t[3]}void 0!==a.baseColorTexture&&i.push(r.assignTexture(e,"map",a.baseColorTexture,3001))}return Promise.all(i)}}class u{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const n=r.extensions[this.name].emissiveStrength;return void 0!==n&&(t.emissiveIntensity=n),Promise.resolve()}}class h{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];if(void 0!==s.clearcoatFactor&&(t.clearcoat=s.clearcoatFactor),void 0!==s.clearcoatTexture&&a.push(r.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),void 0!==s.clearcoatRoughnessFactor&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),void 0!==s.clearcoatRoughnessTexture&&a.push(r.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),void 0!==s.clearcoatNormalTexture&&(a.push(r.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),void 0!==s.clearcoatNormalTexture.scale)){const e=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new n.Vector2(e,e)}return Promise.all(a)}}class d{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],a=n.extensions[this.name];return void 0!==a.iridescenceFactor&&(t.iridescence=a.iridescenceFactor),void 0!==a.iridescenceTexture&&i.push(r.assignTexture(t,"iridescenceMap",a.iridescenceTexture)),void 0!==a.iridescenceIor&&(t.iridescenceIOR=a.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==a.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=a.iridescenceThicknessMinimum),void 0!==a.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=a.iridescenceThicknessMaximum),void 0!==a.iridescenceThicknessTexture&&i.push(r.assignTexture(t,"iridescenceThicknessMap",a.iridescenceThicknessTexture)),Promise.all(i)}}class p{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[];t.sheenColor=new n.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=i.extensions[this.name];return void 0!==s.sheenColorFactor&&t.sheenColor.fromArray(s.sheenColorFactor),void 0!==s.sheenRoughnessFactor&&(t.sheenRoughness=s.sheenRoughnessFactor),void 0!==s.sheenColorTexture&&a.push(r.assignTexture(t,"sheenColorMap",s.sheenColorTexture,3001)),void 0!==s.sheenRoughnessTexture&&a.push(r.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(a)}}class f{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],a=n.extensions[this.name];return void 0!==a.transmissionFactor&&(t.transmission=a.transmissionFactor),void 0!==a.transmissionTexture&&i.push(r.assignTexture(t,"transmissionMap",a.transmissionTexture)),Promise.all(i)}}class m{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];t.thickness=void 0!==s.thicknessFactor?s.thicknessFactor:0,void 0!==s.thicknessTexture&&a.push(r.assignTexture(t,"thicknessMap",s.thicknessTexture)),t.attenuationDistance=s.attenuationDistance||1/0;const o=s.attenuationColor||[1,1,1];return t.attenuationColor=new n.Color(o[0],o[1],o[2]),Promise.all(a)}}class g{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const n=r.extensions[this.name];return t.ior=void 0!==n.ior?n.ior:1.5,Promise.resolve()}}class v{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];t.specularIntensity=void 0!==s.specularFactor?s.specularFactor:1,void 0!==s.specularTexture&&a.push(r.assignTexture(t,"specularIntensityMap",s.specularTexture));const o=s.specularColorFactor||[1,1,1];return t.specularColor=new n.Color(o[0],o[1],o[2]),void 0!==s.specularColorTexture&&a.push(r.assignTexture(t,"specularColorMap",s.specularColorTexture,3001)),Promise.all(a)}}class A{constructor(e){this.parser=e,this.name=o.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,r=t.json,n=r.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const i=n.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,a)}}class y{constructor(e){this.parser=e,this.name=o.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const a=i.extensions[t],s=n.images[a.source];let o=r.textureLoader;if(s.uri){const e=r.options.manager.getHandler(s.uri);null!==e&&(o=e)}return this.detectSupport().then((function(i){if(i)return r.loadTextureImage(e,a.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class x{constructor(e){this.parser=e,this.name=o.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const a=i.extensions[t],s=n.images[a.source];let o=r.textureLoader;if(s.uri){const e=r.options.manager.getHandler(s.uri);null!==e&&(o=e)}return this.detectSupport().then((function(i){if(i)return r.loadTextureImage(e,a.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class b{constructor(e){this.name=o.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const e=r.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return n.then((function(t){const r=e.byteOffset||0,n=e.byteLength||0,a=e.count,s=e.byteStride,o=new Uint8Array(t,r,n);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,s,o,e.mode,e.filter).then((function(e){return e.buffer})):i.ready.then((function(){const t=new ArrayBuffer(a*s);return i.decodeGltfBuffer(new Uint8Array(t),a,s,o,e.mode,e.filter),t}))}))}return null}}class w{constructor(e){this.name=o.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;const i=t.meshes[r.mesh];for(const n of i.primitives)if(n.mode!==F.TRIANGLES&&n.mode!==F.TRIANGLE_STRIP&&n.mode!==F.TRIANGLE_FAN&&void 0!==n.mode)return null;const a=r.extensions[this.name].attributes,s=[],o={};for(const n in a)s.push(this.parser.getDependency("accessor",a[n]).then((e=>(o[n]=e,o[n]))));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then((e=>{const t=e.pop(),r=t.isGroup?t.children:[t],i=e[0].count,a=[];for(const s of r){const e=new n.Matrix4,t=new n.Vector3,r=new n.Quaternion,l=new n.Vector3(1,1,1),c=new n.InstancedMesh(s.geometry,s.material,i);for(let n=0;n<i;n++)o.TRANSLATION&&t.fromBufferAttribute(o.TRANSLATION,n),o.ROTATION&&r.fromBufferAttribute(o.ROTATION,n),o.SCALE&&l.fromBufferAttribute(o.SCALE,n),c.setMatrixAt(n,e.compose(t,r,l));for(const n in o)"TRANSLATION"!==n&&"ROTATION"!==n&&"SCALE"!==n&&s.geometry.setAttribute(n,o[n]);n.Object3D.prototype.copy.call(c,s),this.parser.assignFinalMaterial(c),a.push(c)}return t.isGroup?(t.clear(),t.add(...a),t):a[0]})))}}const E="glTF",S=1313821514,M=5130562;class _{constructor(e){this.name=o.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12);if(this.header={magic:n.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==E)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const r=this.header.length-12,i=new DataView(e,12);let a=0;for(;a<r;){const t=i.getUint32(a,!0);a+=4;const r=i.getUint32(a,!0);if(a+=4,r===S){const r=new Uint8Array(e,12+a,t);this.content=n.LoaderUtils.decodeText(r)}else if(r===M){const r=12+a;this.body=e.slice(r,r+t)}a+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class T{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=o.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const r=this.json,n=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,s={},o={},l={};for(const c in a){const e=k[c]||c.toLowerCase();s[e]=a[c]}for(const c in e.attributes){const t=k[c]||c.toLowerCase();if(void 0!==a[c]){const n=r.accessors[e.attributes[c]],i=L[n.componentType];l[t]=i.name,o[t]=!0===n.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t){n.decodeDracoFile(e,(function(e){for(const t in e.attributes){const r=e.attributes[t],n=o[t];void 0!==n&&(r.normalized=n)}t(e)}),s,l)}))}))}}class C{constructor(){this.name=o.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&t.texCoord!==e.channel||void 0!==t.offset||void 0!==t.rotation||void 0!==t.scale?(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0,e):e}}class I{constructor(){this.name=o.KHR_MESH_QUANTIZATION}}class B extends n.Interpolant{constructor(e,t,r,n){super(e,t,r,n)}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,i=e*n*3+n;for(let a=0;a!==n;a++)t[a]=r[i+a];return t}interpolate_(e,t,r,n){const i=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=2*s,l=3*s,c=n-t,u=(r-t)/c,h=u*u,d=h*u,p=e*l,f=p-l,m=-2*d+3*h,g=d-h,v=1-m,A=g-h+u;for(let y=0;y!==s;y++){const e=a[f+y+s],t=a[f+y+o]*c,r=a[p+y+s],n=a[p+y]*c;i[y]=v*e+A*t+m*r+g*n}return i}}const R=new n.Quaternion;class P extends B{interpolate_(e,t,r,n){const i=super.interpolate_(e,t,r,n);return R.fromArray(i).normalize().toArray(i),i}}const F={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},L={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},D={9728:n.NearestFilter,9729:n.LinearFilter,9984:n.NearestMipmapNearestFilter,9985:n.LinearMipmapNearestFilter,9986:n.NearestMipmapLinearFilter,9987:n.LinearMipmapLinearFilter},U={33071:n.ClampToEdgeWrapping,33648:n.MirroredRepeatWrapping,10497:n.RepeatWrapping},N={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},k={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...n.REVISION.replace(/\D+/g,"")>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},O={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},G={CUBICSPLINE:void 0,LINEAR:n.InterpolateLinear,STEP:n.InterpolateDiscrete},z="OPAQUE",V="MASK",H="BLEND";function Q(e,t,r){for(const n in r.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=r.extensions[n])}function j(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function W(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,n=t.weights.length;r<n;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){const r=t.extras.targetNames;if(e.morphTargetInfluences.length===r.length){e.morphTargetDictionary={};for(let t=0,n=r.length;t<n;t++)e.morphTargetDictionary[r[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function X(e){const t=e.extensions&&e.extensions[o.KHR_DRACO_MESH_COMPRESSION];let r;return r=t?"draco:"+t.bufferView+":"+t.indices+":"+Y(t.attributes):e.indices+":"+Y(e.attributes)+":"+e.mode,r}function Y(e){let t="";const r=Object.keys(e).sort();for(let n=0,i=r.length;n<i;n++)t+=r[n]+":"+e[r[n]]+";";return t}function q(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}const K=new n.Matrix4;class J{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new s,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=!1,a=-1;"undefined"!=typeof navigator&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=navigator.userAgent.indexOf("Firefox")>-1,a=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||i&&a<98?this.textureLoader=new n.TextureLoader(this.options.manager):this.textureLoader=new n.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new n.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])})).then((function(t){const a={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:r,userData:{}};Q(i,a,n),j(a,n),Promise.all(r._invokeAll((function(e){return e.afterRoot&&e.afterRoot(a)}))).then((function(){e(a)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let n=0,i=t.length;n<i;n++){const r=t[n].joints;for(let t=0,n=r.length;t<n;t++)e[r[t]].isBone=!0}for(let n=0,i=e.length;n<i;n++){const t=e[n];void 0!==t.mesh&&(this._addNodeRef(this.meshCache,t.mesh),void 0!==t.skin&&(r[t.mesh].isSkinnedMesh=!0)),void 0!==t.camera&&this._addNodeRef(this.cameraCache,t.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,r){if(e.refs[t]<=1)return r;const n=r.clone(),i=(e,t)=>{const r=this.associations.get(e);null!=r&&this.associations.set(t,r);for(const[n,a]of e.children.entries())i(a,t.children[n])};return i(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r<t.length;r++){const n=e(t[r]);if(n)return n}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const r=[];for(let n=0;n<t.length;n++){const i=e(t[n]);i&&r.push(i)}return r}getDependency(e,t){const r=e+":"+t;let n=this.cache.get(r);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne((function(e){return e.loadNode&&e.loadNode(t)}));break;case"mesh":n=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":n=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":n=this.loadCamera(t);break;default:if(n=this._invokeOne((function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)})),!n)throw new Error("Unknown type: "+e)}this.cache.add(r,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){const r=this,n=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(n.map((function(t,n){return r.getDependency(e,n)}))),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],r=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[o.KHR_BINARY_GLTF].body);const i=this.options;return new Promise((function(e,a){r.load(n.LoaderUtils.resolveURL(t.uri,i.path),e,void 0,(function(){a(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const r=t.byteLength||0,n=t.byteOffset||0;return e.slice(n,n+r)}))}loadAccessor(e){const t=this,r=this.json,i=this.json.accessors[e];if(void 0===i.bufferView&&void 0===i.sparse){const e=N[i.type],t=L[i.componentType],r=!0===i.normalized,a=new t(i.count*e);return Promise.resolve(new n.BufferAttribute(a,e,r))}const a=[];return void 0!==i.bufferView?a.push(this.getDependency("bufferView",i.bufferView)):a.push(null),void 0!==i.sparse&&(a.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),a.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(a).then((function(e){const a=e[0],s=N[i.type],o=L[i.componentType],l=o.BYTES_PER_ELEMENT,c=l*s,u=i.byteOffset||0,h=void 0!==i.bufferView?r.bufferViews[i.bufferView].byteStride:void 0,d=!0===i.normalized;let p,f;if(h&&h!==c){const e=Math.floor(u/h),r="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+e+":"+i.count;let c=t.cache.get(r);c||(p=new o(a,e*h,i.count*h/l),c=new n.InterleavedBuffer(p,h/l),t.cache.add(r,c)),f=new n.InterleavedBufferAttribute(c,s,u%h/l,d)}else p=null===a?new o(i.count*s):new o(a,u,i.count*s),f=new n.BufferAttribute(p,s,d);if(void 0!==i.sparse){const t=N.SCALAR,r=L[i.sparse.indices.componentType],l=i.sparse.indices.byteOffset||0,c=i.sparse.values.byteOffset||0,u=new r(e[1],l,i.sparse.count*t),h=new o(e[2],c,i.sparse.count*s);null!==a&&(f=new n.BufferAttribute(f.array.slice(),f.itemSize,f.normalized));for(let e=0,n=u.length;e<n;e++){const t=u[e];if(f.setX(t,h[e*s]),s>=2&&f.setY(t,h[e*s+1]),s>=3&&f.setZ(t,h[e*s+2]),s>=4&&f.setW(t,h[e*s+3]),s>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return f}))}loadTexture(e){const t=this.json,r=this.options,n=t.textures[e].source,i=t.images[n];let a=this.textureLoader;if(i.uri){const e=r.manager.getHandler(i.uri);null!==e&&(a=e)}return this.loadTextureImage(e,n,a)}loadTextureImage(e,t,r){const i=this,a=this.json,s=a.textures[e],o=a.images[t],l=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,r).then((function(t){t.flipY=!1,t.name=s.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);const r=(a.samplers||{})[s.sampler]||{};return t.magFilter=D[r.magFilter]||n.LinearFilter,t.minFilter=D[r.minFilter]||n.LinearMipmapLinearFilter,t.wrapS=U[r.wrapS]||n.RepeatWrapping,t.wrapT=U[r.wrapT]||n.RepeatWrapping,i.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[l]=c,c}loadImageSource(e,t){const r=this,i=this.json,a=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const s=i.images[e],o=self.URL||self.webkitURL;let l=s.uri||"",c=!1;if(void 0!==s.bufferView)l=r.getDependency("bufferView",s.bufferView).then((function(e){c=!0;const t=new Blob([e],{type:s.mimeType});return l=o.createObjectURL(t),l}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then((function(e){return new Promise((function(r,i){let s=r;!0===t.isImageBitmapLoader&&(s=function(e){const t=new n.Texture(e);t.needsUpdate=!0,r(t)}),t.load(n.LoaderUtils.resolveURL(e,a.path),s,void 0,i)}))})).then((function(e){var t;return!0===c&&o.revokeObjectURL(l),e.userData.mimeType=s.mimeType||((t=s.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),e}));return this.sourceCache[e]=u,u}assignTexture(e,t,r,n){const i=this;return this.getDependency("texture",r.index).then((function(a){if(!a)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((a=a.clone()).channel=r.texCoord),i.extensions[o.KHR_TEXTURE_TRANSFORM]){const e=void 0!==r.extensions?r.extensions[o.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=i.associations.get(a);a=i.extensions[o.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return void 0!==n&&("colorSpace"in a?a.colorSpace=3001===n?"srgb":"srgb-linear":a.encoding=n),e[t]=a,a}))}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const i=void 0===t.attributes.tangent,a=void 0!==t.attributes.color,s=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new n.PointsMaterial,n.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){const e="LineBasicMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new n.LineBasicMaterial,n.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(i||a||s){let e="ClonedMaterial:"+r.uuid+":";i&&(e+="derivative-tangents:"),a&&(e+="vertex-colors:"),s&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),a&&(t.vertexColors=!0),s&&(t.flatShading=!0),i&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return n.MeshStandardMaterial}loadMaterial(e){const t=this,r=this.json,i=this.extensions,a=r.materials[e];let s;const l={},c=[];if((a.extensions||{})[o.KHR_MATERIALS_UNLIT]){const e=i[o.KHR_MATERIALS_UNLIT];s=e.getMaterialType(),c.push(e.extendParams(l,a,t))}else{const r=a.pbrMetallicRoughness||{};if(l.color=new n.Color(1,1,1),l.opacity=1,Array.isArray(r.baseColorFactor)){const e=r.baseColorFactor;l.color.fromArray(e),l.opacity=e[3]}void 0!==r.baseColorTexture&&c.push(t.assignTexture(l,"map",r.baseColorTexture,3001)),l.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,l.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(c.push(t.assignTexture(l,"metalnessMap",r.metallicRoughnessTexture)),c.push(t.assignTexture(l,"roughnessMap",r.metallicRoughnessTexture))),s=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),c.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,l)}))))}!0===a.doubleSided&&(l.side=n.DoubleSide);const u=a.alphaMode||z;if(u===H?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,u===V&&(l.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&s!==n.MeshBasicMaterial&&(c.push(t.assignTexture(l,"normalMap",a.normalTexture)),l.normalScale=new n.Vector2(1,1),void 0!==a.normalTexture.scale)){const e=a.normalTexture.scale;l.normalScale.set(e,e)}return void 0!==a.occlusionTexture&&s!==n.MeshBasicMaterial&&(c.push(t.assignTexture(l,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(l.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&s!==n.MeshBasicMaterial&&(l.emissive=(new n.Color).fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&s!==n.MeshBasicMaterial&&c.push(t.assignTexture(l,"emissiveMap",a.emissiveTexture,3001)),Promise.all(c).then((function(){const r=new s(l);return a.name&&(r.name=a.name),j(r,a),t.associations.set(r,{materials:e}),a.extensions&&Q(i,r,a),r}))}createUniqueName(e){const t=n.PropertyBinding.sanitizeNodeName(e||"");let r=t;for(let n=1;this.nodeNamesUsed[r];++n)r=t+"_"+n;return this.nodeNamesUsed[r]=!0,r}loadGeometries(e){const t=this,r=this.extensions,i=this.primitiveCache;function a(e){return r[o.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(r){return Z(r,e,t)}))}const s=[];for(let l=0,c=e.length;l<c;l++){const r=e[l],c=X(r),u=i[c];if(u)s.push(u.promise);else{let e;e=r.extensions&&r.extensions[o.KHR_DRACO_MESH_COMPRESSION]?a(r):Z(new n.BufferGeometry,r,t),i[c]={primitive:r,promise:e},s.push(e)}}return Promise.all(s)}loadMesh(e){const t=this,r=this.json,a=this.extensions,s=r.meshes[e],o=s.primitives,l=[];for(let i=0,u=o.length;i<u;i++){const e=void 0===o[i].material?(void 0===(c=this.cache).DefaultMaterial&&(c.DefaultMaterial=new n.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:n.FrontSide})),c.DefaultMaterial):this.getDependency("material",o[i].material);l.push(e)}var c;return l.push(t.loadGeometries(o)),Promise.all(l).then((function(r){const l=r.slice(0,r.length-1),c=r[r.length-1],u=[];for(let d=0,p=c.length;d<p;d++){const r=c[d],h=o[d];let p;const f=l[d];if(h.mode===F.TRIANGLES||h.mode===F.TRIANGLE_STRIP||h.mode===F.TRIANGLE_FAN||void 0===h.mode)p=!0===s.isSkinnedMesh?new n.SkinnedMesh(r,f):new n.Mesh(r,f),!0===p.isSkinnedMesh&&p.normalizeSkinWeights(),h.mode===F.TRIANGLE_STRIP?p.geometry=(0,i.toTrianglesDrawMode)(p.geometry,n.TriangleStripDrawMode):h.mode===F.TRIANGLE_FAN&&(p.geometry=(0,i.toTrianglesDrawMode)(p.geometry,n.TriangleFanDrawMode));else if(h.mode===F.LINES)p=new n.LineSegments(r,f);else if(h.mode===F.LINE_STRIP)p=new n.Line(r,f);else if(h.mode===F.LINE_LOOP)p=new n.LineLoop(r,f);else{if(h.mode!==F.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+h.mode);p=new n.Points(r,f)}Object.keys(p.geometry.morphAttributes).length>0&&W(p,s),p.name=t.createUniqueName(s.name||"mesh_"+e),j(p,s),h.extensions&&Q(a,p,h),t.assignFinalMaterial(p),u.push(p)}for(let n=0,i=u.length;n<i;n++)t.associations.set(u[n],{meshes:e,primitives:n});if(1===u.length)return u[0];const h=new n.Group;t.associations.set(h,{meshes:e});for(let e=0,t=u.length;e<t;e++)h.add(u[e]);return h}))}loadCamera(e){let t;const r=this.json.cameras[e],i=r[r.type];if(i)return"perspective"===r.type?t=new n.PerspectiveCamera(n.MathUtils.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):"orthographic"===r.type&&(t=new n.OrthographicCamera(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),j(t,r),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],r=[];for(let n=0,i=t.joints.length;n<i;n++)r.push(this._loadNodeShallow(t.joints[n]));return void 0!==t.inverseBindMatrices?r.push(this.getDependency("accessor",t.inverseBindMatrices)):r.push(null),Promise.all(r).then((function(e){const r=e.pop(),i=e,a=[],s=[];for(let o=0,l=i.length;o<l;o++){const e=i[o];if(e){a.push(e);const t=new n.Matrix4;null!==r&&t.fromArray(r.array,16*o),s.push(t)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[o])}return new n.Skeleton(a,s)}))}loadAnimation(e){const t=this.json.animations[e],r=t.name?t.name:"animation_"+e,i=[],a=[],s=[],o=[],l=[];for(let n=0,c=t.channels.length;n<c;n++){const e=t.channels[n],r=t.samplers[e.sampler],c=e.target,u=c.node,h=void 0!==t.parameters?t.parameters[r.input]:r.input,d=void 0!==t.parameters?t.parameters[r.output]:r.output;void 0!==c.node&&(i.push(this.getDependency("node",u)),a.push(this.getDependency("accessor",h)),s.push(this.getDependency("accessor",d)),o.push(r),l.push(c))}return Promise.all([Promise.all(i),Promise.all(a),Promise.all(s),Promise.all(o),Promise.all(l)]).then((function(e){const t=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=[];for(let r=0,c=t.length;r<c;r++){const e=t[r],c=i[r],u=a[r],h=s[r],d=o[r];if(void 0===e)continue;let p;switch(e.updateMatrix(),O[d.path]){case O.weights:p=n.NumberKeyframeTrack;break;case O.rotation:p=n.QuaternionKeyframeTrack;break;default:p=n.VectorKeyframeTrack}const f=e.name?e.name:e.uuid,m=void 0!==h.interpolation?G[h.interpolation]:n.InterpolateLinear,g=[];O[d.path]===O.weights?e.traverse((function(e){e.morphTargetInfluences&&g.push(e.name?e.name:e.uuid)})):g.push(f);let v=u.array;if(u.normalized){const e=q(v.constructor),t=new Float32Array(v.length);for(let r=0,n=v.length;r<n;r++)t[r]=v[r]*e;v=t}for(let t=0,r=g.length;t<r;t++){const e=new p(g[t]+"."+O[d.path],c.array,v,m);"CUBICSPLINE"===h.interpolation&&(e.createInterpolant=function(e){return new(this instanceof n.QuaternionKeyframeTrack?P:B)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(e)}}return new n.AnimationClip(r,void 0,l)}))}createNodeMesh(e){const t=this.json,r=this,n=t.nodes[e];return void 0===n.mesh?null:r.getDependency("mesh",n.mesh).then((function(e){const t=r._getNodeRef(r.meshCache,n.mesh,e);return void 0!==n.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,r=n.weights.length;t<r;t++)e.morphTargetInfluences[t]=n.weights[t]})),t}))}loadNode(e){const t=this,r=this.json.nodes[e],n=t._loadNodeShallow(e),i=[],a=r.children||[];for(let o=0,l=a.length;o<l;o++)i.push(t.getDependency("node",a[o]));const s=void 0===r.skin?Promise.resolve(null):t.getDependency("skin",r.skin);return Promise.all([n,Promise.all(i),s]).then((function(e){const t=e[0],r=e[1],n=e[2];null!==n&&t.traverse((function(e){e.isSkinnedMesh&&e.bind(n,K)}));for(let i=0,a=r.length;i<a;i++)t.add(r[i]);return t}))}_loadNodeShallow(e){const t=this.json,r=this.extensions,i=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];const a=t.nodes[e],s=a.name?i.createUniqueName(a.name):"",o=[],l=i._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return l&&o.push(l),void 0!==a.camera&&o.push(i.getDependency("camera",a.camera).then((function(e){return i._getNodeRef(i.cameraCache,a.camera,e)}))),i._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){o.push(e)})),this.nodeCache[e]=Promise.all(o).then((function(t){let o;if(o=!0===a.isBone?new n.Bone:t.length>1?new n.Group:1===t.length?t[0]:new n.Object3D,o!==t[0])for(let e=0,r=t.length;e<r;e++)o.add(t[e]);if(a.name&&(o.userData.name=a.name,o.name=s),j(o,a),a.extensions&&Q(r,o,a),void 0!==a.matrix){const e=new n.Matrix4;e.fromArray(a.matrix),o.applyMatrix4(e)}else void 0!==a.translation&&o.position.fromArray(a.translation),void 0!==a.rotation&&o.quaternion.fromArray(a.rotation),void 0!==a.scale&&o.scale.fromArray(a.scale);return i.associations.has(o)||i.associations.set(o,{}),i.associations.get(o).nodes=e,o})),this.nodeCache[e]}loadScene(e){const t=this.extensions,r=this.json.scenes[e],i=this,a=new n.Group;r.name&&(a.name=i.createUniqueName(r.name)),j(a,r),r.extensions&&Q(t,a,r);const s=r.nodes||[],o=[];for(let n=0,l=s.length;n<l;n++)o.push(i.getDependency("node",s[n]));return Promise.all(o).then((function(e){for(let t=0,r=e.length;t<r;t++)a.add(e[t]);return i.associations=(e=>{const t=new Map;for(const[r,a]of i.associations)(r instanceof n.Material||r instanceof n.Texture)&&t.set(r,a);return e.traverse((e=>{const r=i.associations.get(e);null!=r&&t.set(e,r)})),t})(a),a}))}}function Z(e,t,r){const i=t.attributes,a=[];function s(t,n){return r.getDependency("accessor",t).then((function(t){e.setAttribute(n,t)}))}for(const n in i){const t=k[n]||n.toLowerCase();t in e.attributes||a.push(s(i[n],t))}if(void 0!==t.indices&&!e.index){const n=r.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));a.push(n)}return j(e,t),function(e,t,r){const i=t.attributes,a=new n.Box3;if(void 0===i.POSITION)return;{const e=r.json.accessors[i.POSITION],t=e.min,s=e.max;if(void 0===t||void 0===s)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(a.set(new n.Vector3(t[0],t[1],t[2]),new n.Vector3(s[0],s[1],s[2])),e.normalized){const t=q(L[e.componentType]);a.min.multiplyScalar(t),a.max.multiplyScalar(t)}}const s=t.targets;if(void 0!==s){const e=new n.Vector3,t=new n.Vector3;for(let n=0,i=s.length;n<i;n++){const i=s[n];if(void 0!==i.POSITION){const n=r.json.accessors[i.POSITION],a=n.min,s=n.max;if(void 0!==a&&void 0!==s){if(t.setX(Math.max(Math.abs(a[0]),Math.abs(s[0]))),t.setY(Math.max(Math.abs(a[1]),Math.abs(s[1]))),t.setZ(Math.max(Math.abs(a[2]),Math.abs(s[2]))),n.normalized){const e=q(L[n.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}a.expandByVector(e)}e.boundingBox=a;const o=new n.Sphere;a.getCenter(o.center),o.radius=a.min.distanceTo(a.max)/2,e.boundingSphere=o}(e,t,r),Promise.all(a).then((function(){return void 0!==t.targets?function(e,t,r){let n=!1,i=!1,a=!1;for(let c=0,u=t.length;c<u;c++){const e=t[c];if(void 0!==e.POSITION&&(n=!0),void 0!==e.NORMAL&&(i=!0),void 0!==e.COLOR_0&&(a=!0),n&&i&&a)break}if(!n&&!i&&!a)return Promise.resolve(e);const s=[],o=[],l=[];for(let c=0,u=t.length;c<u;c++){const u=t[c];if(n){const t=void 0!==u.POSITION?r.getDependency("accessor",u.POSITION):e.attributes.position;s.push(t)}if(i){const t=void 0!==u.NORMAL?r.getDependency("accessor",u.NORMAL):e.attributes.normal;o.push(t)}if(a){const t=void 0!==u.COLOR_0?r.getDependency("accessor",u.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(s),Promise.all(o),Promise.all(l)]).then((function(t){const r=t[0],s=t[1],o=t[2];return n&&(e.morphAttributes.position=r),i&&(e.morphAttributes.normal=s),a&&(e.morphAttributes.color=o),e.morphTargetsRelative=!0,e}))}(e,t.targets,r):e}))}},28934:(e,t,r)=>{"use strict";r.d(t,{a:()=>E});var n=r(99477);class i{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const r=this.workersResolve[e];if(r&&r(t),this.queue.length){const{resolve:t,msg:r,transfer:n}=this.queue.shift();this.workersResolve[e]=t,this.workers[e].postMessage(r,n)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise((r=>{const n=this._getIdleWorker();-1!==n?(this._initWorker(n),this.workerStatus|=1<<n,this.workersResolve[n]=r,this.workers[n].postMessage(e,t)):this.queue.push({resolve:r,msg:e,transfer:t})}))}dispose(){this.workers.forEach((e=>e.terminate())),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}class a{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class s{constructor(e,t,r,n){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,r),this._littleEndian=n,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const r=this._offset;let n=0;for(;this._dataView.getUint8(this._offset)!==t&&n<e;)n++,this._offset++;return n<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+r,n)}}new Uint8Array([0]);const o=[171,75,84,88,32,50,48,187,13,10,26,10];function l(e){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(e):Buffer.from(e).toString("utf8")}let c,u,h;const d={env:{emscripten_notify_memory_growth:function(e){h=new Uint8Array(u.exports.memory.buffer)}}};class p{init(){return c||(c="undefined"!=typeof fetch?fetch("data:application/wasm;base64,"+f).then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,d))).then(this._init):WebAssembly.instantiate(Buffer.from(f,"base64"),d).then(this._init),c)}_init(e){u=e.instance,d.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!u)throw new Error("ZSTDDecoder: Await .init() before decoding.");const r=e.byteLength,n=u.exports.malloc(r);h.set(e,n),t=t||Number(u.exports.ZSTD_findDecompressedSize(n,r));const i=u.exports.malloc(t),a=u.exports.ZSTD_decompress(i,t,n,r),s=h.slice(i,i+a);return u.exports.free(n),u.exports.free(i),s}}const f="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ";class m extends n.CompressedTexture{constructor(e,t,r,i,a,s){super(e,t,r,a,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=n.ClampToEdgeWrapping}}var g=r(81111),v=Object.defineProperty,A=(e,t,r)=>(((e,t,r)=>{t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const y=new WeakMap;let x,b=0;const w=class extends n.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new i,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}detectSupport(e){return this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},e.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1),this}init(){if(!this.transcoderPending){const e=new n.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),r=new n.FileLoader(this.manager);r.setPath(this.transcoderPath),r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials);const i=r.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then((([e,t])=>{const r=w.BasisWorker.toString(),n=["/* constants */","let _EngineFormat = "+JSON.stringify(w.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(w.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(w.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n])),this.transcoderBinary=t,this.workerPool.setWorkerCreator((()=>{const e=new Worker(this.workerSourceURL),t=this.transcoderBinary.slice(0);return e.postMessage({type:"init",config:this.workerConfig,transcoderBinary:t},[t]),e}))})),b>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),b++}return this.transcoderPending}load(e,t,r,i){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const a=new n.FileLoader(this.manager);a.setResponseType("arraybuffer"),a.setWithCredentials(this.withCredentials),a.load(e,(e=>{if(y.has(e)){return y.get(e).promise.then(t).catch(i)}this._createTexture(e).then((e=>t?t(e):null)).catch(i)}),r,i)}_createTextureFrom(e,t){const{mipmaps:r,width:i,height:a,format:s,type:o,error:l,dfdTransferFn:c,dfdFlags:u}=e;if("error"===o)return Promise.reject(l);const h=t.layerCount>1?new m(r,i,a,t.layerCount,s,n.UnsignedByteType):new n.CompressedTexture(r,i,a,s,n.UnsignedByteType);return h.minFilter=1===r.length?n.LinearFilter:n.LinearMipmapLinearFilter,h.magFilter=n.LinearFilter,h.generateMipmaps=!1,h.needsUpdate=!0,"colorSpace"in h?h.colorSpace=2===c?"srgb":"srgb-linear":h.encoding=2===c?3001:3e3,h.premultiplyAlpha=!!(1&u),h}async _createTexture(e,t={}){const r=function(e){const t=new Uint8Array(e.buffer,e.byteOffset,o.length);if(t[0]!==o[0]||t[1]!==o[1]||t[2]!==o[2]||t[3]!==o[3]||t[4]!==o[4]||t[5]!==o[5]||t[6]!==o[6]||t[7]!==o[7]||t[8]!==o[8]||t[9]!==o[9]||t[10]!==o[10]||t[11]!==o[11])throw new Error("Missing KTX 2.0 identifier.");const r=new a,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new s(e,o.length,n,!0);r.vkFormat=i._nextUint32(),r.typeSize=i._nextUint32(),r.pixelWidth=i._nextUint32(),r.pixelHeight=i._nextUint32(),r.pixelDepth=i._nextUint32(),r.layerCount=i._nextUint32(),r.faceCount=i._nextUint32();const c=i._nextUint32();r.supercompressionScheme=i._nextUint32();const u=i._nextUint32(),h=i._nextUint32(),d=i._nextUint32(),p=i._nextUint32(),f=i._nextUint64(),m=i._nextUint64(),g=new s(e,o.length+n,3*c*8,!0);for(let a=0;a<c;a++)r.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+g._nextUint64(),g._nextUint64()),uncompressedByteLength:g._nextUint64()});const v=new s(e,u,h,!0),A={vendorId:v._skip(4)._nextUint16(),descriptorType:v._nextUint16(),versionNumber:v._nextUint16(),descriptorBlockSize:v._nextUint16(),colorModel:v._nextUint8(),colorPrimaries:v._nextUint8(),transferFunction:v._nextUint8(),flags:v._nextUint8(),texelBlockDimension:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],bytesPlane:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],samples:[]},y=(A.descriptorBlockSize/4-6)/4;for(let a=0;a<y;a++){const e={bitOffset:v._nextUint16(),bitLength:v._nextUint8(),channelType:v._nextUint8(),samplePosition:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&e.channelType?(e.sampleLower=v._nextInt32(),e.sampleUpper=v._nextInt32()):(e.sampleLower=v._nextUint32(),e.sampleUpper=v._nextUint32()),A.samples[a]=e}r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(A);const x=new s(e,d,p,!0);for(;x._offset<p;){const e=x._nextUint32(),t=x._scan(e),n=l(t),i=x._scan(e-t.byteLength);r.keyValue[n]=n.match(/^ktx/i)?l(i):i,x._offset%4&&x._skip(4-x._offset%4)}if(m<=0)return r;const b=new s(e,f,m,!0),w=b._nextUint16(),E=b._nextUint16(),S=b._nextUint32(),M=b._nextUint32(),_=b._nextUint32(),T=b._nextUint32(),C=[];for(let a=0;a<c;a++)C.push({imageFlags:b._nextUint32(),rgbSliceByteOffset:b._nextUint32(),rgbSliceByteLength:b._nextUint32(),alphaSliceByteOffset:b._nextUint32(),alphaSliceByteLength:b._nextUint32()});const I=f+b._offset,B=I+S,R=B+M,P=R+_,F=new Uint8Array(e.buffer,e.byteOffset+I,S),L=new Uint8Array(e.buffer,e.byteOffset+B,M),D=new Uint8Array(e.buffer,e.byteOffset+R,_),U=new Uint8Array(e.buffer,e.byteOffset+P,T);return r.globalData={endpointCount:w,selectorCount:E,imageDescs:C,endpointsData:F,selectorsData:L,tablesData:D,extendedData:U},r}(new Uint8Array(e));if(0!==r.vkFormat)return async function(e){const{vkFormat:t,pixelWidth:r,pixelHeight:i,pixelDepth:a}=e;if(void 0===S[t])throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");const s=e.levels[0];let o,l;if(0===e.supercompressionScheme)o=s.levelData;else{if(2!==e.supercompressionScheme)throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");x||(x=new Promise((async e=>{const t=new p;await t.init(),e(t)}))),o=(await x).decode(s.levelData,s.uncompressedByteLength)}l=M[t]===n.FloatType?new Float32Array(o.buffer,o.byteOffset,o.byteLength/Float32Array.BYTES_PER_ELEMENT):M[t]===n.HalfFloatType?new Uint16Array(o.buffer,o.byteOffset,o.byteLength/Uint16Array.BYTES_PER_ELEMENT):o;const c=0===a?new n.DataTexture(l,r,i):new g.J(l,r,i,a);return c.type=M[t],c.format=S[t],c.encoding=_[t]||3e3,c.needsUpdate=!0,Promise.resolve(c)}(r);const i=t,c=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:i},[e]))).then((e=>this._createTextureFrom(e.data,r)));return y.set(e,{promise:c}),c}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),b--,this}};let E=w;A(E,"BasisFormat",{ETC1S:0,UASTC_4x4:1}),A(E,"TranscoderFormat",{ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16}),A(E,"EngineFormat",{RGBAFormat:n.RGBAFormat,RGBA_ASTC_4x4_Format:n.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:n.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:n.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:n.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:n.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:n.RGB_ETC1_Format,RGB_ETC2_Format:n.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:n.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:n.RGB_S3TC_DXT1_Format}),A(E,"BasisWorker",(function(){let e,t,r;const n=_EngineFormat,i=_TranscoderFormat,a=_BasisFormat;self.addEventListener("message",(function(s){const h=s.data;switch(h.type){case"init":e=h.config,d=h.transcoderBinary,t=new Promise((e=>{r={wasmBinary:d,onRuntimeInitialized:e},BASIS(r)})).then((()=>{r.initializeBasis(),void 0===r.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":t.then((()=>{try{const{width:t,height:s,hasAlpha:d,mipmaps:p,format:f,dfdTransferFn:m,dfdFlags:g}=function(t){const s=new r.KTX2File(new Uint8Array(t));function h(){s.close(),s.delete()}if(!s.isValid())throw h(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const d=s.isUASTC()?a.UASTC_4x4:a.ETC1S,p=s.getWidth(),f=s.getHeight(),m=s.getLayers()||1,g=s.getLevels(),v=s.getHasAlpha(),A=s.getDFDTransferFunc(),y=s.getDFDFlags(),{transcoderFormat:x,engineFormat:b}=function(t,r,s,u){let h,d;const p=t===a.ETC1S?o:l;for(let n=0;n<p.length;n++){const i=p[n];if(e[i.if]&&(i.basisFormat.includes(t)&&!(u&&i.transcoderFormat.length<2)&&(!i.needsPowerOfTwo||c(r)&&c(s))))return h=i.transcoderFormat[u?1:0],d=i.engineFormat[u?1:0],{transcoderFormat:h,engineFormat:d}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),h=i.RGBA32,d=n.RGBAFormat,{transcoderFormat:h,engineFormat:d}}(d,p,f,v);if(!p||!f||!g)throw h(),new Error("THREE.KTX2Loader:\tInvalid texture");if(!s.startTranscoding())throw h(),new Error("THREE.KTX2Loader: .startTranscoding failed");const w=[];for(let e=0;e<g;e++){const t=[];let r,n;for(let i=0;i<m;i++){const a=s.getImageLevelInfo(e,i,0);r=a.origWidth<4?a.origWidth:a.width,n=a.origHeight<4?a.origHeight:a.height;const o=new Uint8Array(s.getImageTranscodedSizeInBytes(e,i,0,x));if(!s.transcodeImage(o,e,i,0,x,0,-1,-1))throw h(),new Error("THREE.KTX2Loader: .transcodeImage failed.");t.push(o)}w.push({data:u(t),width:r,height:n})}return h(),{width:p,height:f,hasAlpha:v,mipmaps:w,format:b,dfdTransferFn:A,dfdFlags:y}}(h.buffer),v=[];for(let e=0;e<p.length;++e)v.push(p[e].data.buffer);self.postMessage({type:"transcode",id:h.id,width:t,height:s,hasAlpha:d,mipmaps:p,format:f,dfdTransferFn:m,dfdFlags:g},v)}catch(t){console.error(t),self.postMessage({type:"error",id:h.id,error:t.message})}}))}var d}));const s=[{if:"astcSupported",basisFormat:[a.UASTC_4x4],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[i.BC1,i.BC3],engineFormat:[n.RGB_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[i.ETC1],engineFormat:[n.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],o=s.sort((function(e,t){return e.priorityETC1S-t.priorityETC1S})),l=s.sort((function(e,t){return e.priorityUASTC-t.priorityUASTC}));function c(e){return e<=2||0==(e&e-1)&&0!==e}function u(e){let t=0;for(let i=0;i<e.length;i++){t+=e[i].byteLength}const r=new Uint8Array(t);let n=0;for(let i=0;i<e.length;i++){const t=e[i];r.set(t,n),n+=t.byteLength}return r}}));const S={109:n.RGBAFormat,97:n.RGBAFormat,37:n.RGBAFormat,43:n.RGBAFormat,103:n.RGFormat,83:n.RGFormat,16:n.RGFormat,22:n.RGFormat,100:n.RedFormat,76:n.RedFormat,15:n.RedFormat,9:n.RedFormat},M={109:n.FloatType,97:n.HalfFloatType,37:n.UnsignedByteType,43:n.UnsignedByteType,103:n.FloatType,83:n.HalfFloatType,16:n.UnsignedByteType,22:n.UnsignedByteType,100:n.FloatType,76:n.HalfFloatType,15:n.UnsignedByteType,9:n.UnsignedByteType},_={43:3001,22:3001,15:3001}},8197:(e,t,r)=>{"use strict";r.d(t,{x:()=>i});var n=r(99477);class i extends n.DataTextureLoader{constructor(e){super(e),this.type=n.HalfFloatType}parse(e){const t=function(e,t){switch(e){case 1:console.error("THREE.RGBELoader Read Error: "+(t||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(t||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(t||""));break;default:console.error("THREE.RGBELoader: Error: "+(t||""))}return-1},r=function(e,t,r){t=t||1024;let n=e.pos,i=-1,a=0,s="",o=String.fromCharCode.apply(null,new Uint16Array(e.subarray(n,n+128)));for(;0>(i=o.indexOf("\n"))&&a<t&&n<e.byteLength;)s+=o,a+=o.length,n+=128,o+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(n,n+128)));return-1<i&&(!1!==r&&(e.pos+=a+i+1),s+o.slice(0,i))},i=function(e,t,r,n){const i=e[t+3],a=Math.pow(2,i-128)/255;r[n+0]=e[t+0]*a,r[n+1]=e[t+1]*a,r[n+2]=e[t+2]*a,r[n+3]=1},a=function(e,t,r,i){const a=e[t+3],s=Math.pow(2,a-128)/255;r[i+0]=n.DataUtils.toHalfFloat(Math.min(e[t+0]*s,65504)),r[i+1]=n.DataUtils.toHalfFloat(Math.min(e[t+1]*s,65504)),r[i+2]=n.DataUtils.toHalfFloat(Math.min(e[t+2]*s,65504)),r[i+3]=n.DataUtils.toHalfFloat(1)},s=new Uint8Array(e);s.pos=0;const o=function(e){const n=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,i=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,a=/^\s*FORMAT=(\S+)\s*$/,s=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,o={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let l,c;if(e.pos>=e.byteLength||!(l=r(e)))return t(1,"no header found");if(!(c=l.match(/^#\?(\S+)/)))return t(3,"bad initial token");for(o.valid|=1,o.programtype=c[1],o.string+=l+"\n";l=r(e),!1!==l;)if(o.string+=l+"\n","#"!==l.charAt(0)){if((c=l.match(n))&&(o.gamma=parseFloat(c[1])),(c=l.match(i))&&(o.exposure=parseFloat(c[1])),(c=l.match(a))&&(o.valid|=2,o.format=c[1]),(c=l.match(s))&&(o.valid|=4,o.height=parseInt(c[1],10),o.width=parseInt(c[2],10)),2&o.valid&&4&o.valid)break}else o.comments+=l+"\n";return 2&o.valid?4&o.valid?o:t(3,"missing image size specifier"):t(3,"missing format specifier")}(s);if(-1!==o){const e=o.width,r=o.height,l=function(e,r,n){const i=r;if(i<8||i>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(i!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");const a=new Uint8Array(4*r*n);if(!a.length)return t(4,"unable to allocate buffer space");let s=0,o=0;const l=4*i,c=new Uint8Array(4),u=new Uint8Array(l);let h=n;for(;h>0&&o<e.byteLength;){if(o+4>e.byteLength)return t(1);if(c[0]=e[o++],c[1]=e[o++],c[2]=e[o++],c[3]=e[o++],2!=c[0]||2!=c[1]||(c[2]<<8|c[3])!=i)return t(3,"bad rgbe scanline format");let r,n=0;for(;n<l&&o<e.byteLength;){r=e[o++];const i=r>128;if(i&&(r-=128),0===r||n+r>l)return t(3,"bad scanline data");if(i){const t=e[o++];for(let e=0;e<r;e++)u[n++]=t}else u.set(e.subarray(o,o+r),n),n+=r,o+=r}const d=i;for(let e=0;e<d;e++){let t=0;a[s]=u[e+t],t+=i,a[s+1]=u[e+t],t+=i,a[s+2]=u[e+t],t+=i,a[s+3]=u[e+t],s+=4}h--}return a}(s.subarray(s.pos),e,r);if(-1!==l){let t,s,c;switch(this.type){case n.FloatType:c=l.length/4;const e=new Float32Array(4*c);for(let t=0;t<c;t++)i(l,4*t,e,4*t);t=e,s=n.FloatType;break;case n.HalfFloatType:c=l.length/4;const r=new Uint16Array(4*c);for(let t=0;t<c;t++)a(l,4*t,r,4*t);t=r,s=n.HalfFloatType;break;default:console.error("THREE.RGBELoader: unsupported type: ",this.type)}return{width:e,height:r,data:t,header:o.string,gamma:o.gamma,exposure:o.exposure,type:s}}}return null}setDataType(e){return this.type=e,this}load(e,t,r,i){return super.load(e,(function(e,r){switch(e.type){case n.FloatType:case n.HalfFloatType:"colorSpace"in e?e.colorSpace="srgb-linear":e.encoding=3e3,e.minFilter=n.LinearFilter,e.magFilter=n.LinearFilter,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,r)}),r,i)}}},96272:(e,t,r)=>{"use strict";r.d(t,{a:()=>s});var n=r(99477);const i=new n.Triangle,a=new n.Vector3;class s{constructor(e){let t=e.geometry;t.index&&(console.warn("THREE.MeshSurfaceSampler: Converting geometry to non-indexed BufferGeometry."),t=t.toNonIndexed()),this.geometry=t,this.randomFunction=Math.random,this.positionAttribute=this.geometry.getAttribute("position"),this.colorAttribute=this.geometry.getAttribute("color"),this.weightAttribute=null,this.distribution=null}setWeightAttribute(e){return this.weightAttribute=e?this.geometry.getAttribute(e):null,this}build(){const e=this.positionAttribute,t=this.weightAttribute,r=new Float32Array(e.count/3);for(let a=0;a<e.count;a+=3){let n=1;t&&(n=t.getX(a)+t.getX(a+1)+t.getX(a+2)),i.a.fromBufferAttribute(e,a),i.b.fromBufferAttribute(e,a+1),i.c.fromBufferAttribute(e,a+2),n*=i.getArea(),r[a/3]=n}this.distribution=new Float32Array(e.count/3);let n=0;for(let i=0;i<r.length;i++)n+=r[i],this.distribution[i]=n;return this}setRandomGenerator(e){return this.randomFunction=e,this}sample(e,t,r){const n=this.sampleFaceIndex();return this.sampleFace(n,e,t,r)}sampleFaceIndex(){const e=this.distribution[this.distribution.length-1];return this.binarySearch(this.randomFunction()*e)}binarySearch(e){const t=this.distribution;let r=0,n=t.length-1,i=-1;for(;r<=n;){const a=Math.ceil((r+n)/2);if(0===a||t[a-1]<=e&&t[a]>e){i=a;break}e<t[a]?n=a-1:r=a+1}return i}sampleFace(e,t,r,n){let s=this.randomFunction(),o=this.randomFunction();return s+o>1&&(s=1-s,o=1-o),i.a.fromBufferAttribute(this.positionAttribute,3*e),i.b.fromBufferAttribute(this.positionAttribute,3*e+1),i.c.fromBufferAttribute(this.positionAttribute,3*e+2),t.set(0,0,0).addScaledVector(i.a,s).addScaledVector(i.b,o).addScaledVector(i.c,1-(s+o)),void 0!==r&&i.getNormal(r),void 0!==n&&void 0!==this.colorAttribute&&(i.a.fromBufferAttribute(this.colorAttribute,3*e),i.b.fromBufferAttribute(this.colorAttribute,3*e+1),i.c.fromBufferAttribute(this.colorAttribute,3*e+2),a.set(0,0,0).addScaledVector(i.a,s).addScaledVector(i.b,o).addScaledVector(i.c,1-(s+o)),n.r=a.x,n.g=a.y,n.b=a.z),this}}},13945:(e,t,r)=>{"use strict";r.d(t,{L:()=>a});var n=Object.defineProperty,i=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class a{constructor(e=Math){i(this,"grad3",[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]]),i(this,"grad4",[[0,1,1,1],[0,1,1,-1],[0,1,-1,1],[0,1,-1,-1],[0,-1,1,1],[0,-1,1,-1],[0,-1,-1,1],[0,-1,-1,-1],[1,0,1,1],[1,0,1,-1],[1,0,-1,1],[1,0,-1,-1],[-1,0,1,1],[-1,0,1,-1],[-1,0,-1,1],[-1,0,-1,-1],[1,1,0,1],[1,1,0,-1],[1,-1,0,1],[1,-1,0,-1],[-1,1,0,1],[-1,1,0,-1],[-1,-1,0,1],[-1,-1,0,-1],[1,1,1,0],[1,1,-1,0],[1,-1,1,0],[1,-1,-1,0],[-1,1,1,0],[-1,1,-1,0],[-1,-1,1,0],[-1,-1,-1,0]]),i(this,"p",[]),i(this,"perm",[]),i(this,"simplex",[[0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0],[0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0],[1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0],[2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]]),i(this,"dot",((e,t,r)=>e[0]*t+e[1]*r)),i(this,"dot3",((e,t,r,n)=>e[0]*t+e[1]*r+e[2]*n)),i(this,"dot4",((e,t,r,n,i)=>e[0]*t+e[1]*r+e[2]*n+e[3]*i)),i(this,"noise",((e,t)=>{let r,n,i;const a=(e+t)*(.5*(Math.sqrt(3)-1)),s=Math.floor(e+a),o=Math.floor(t+a),l=(3-Math.sqrt(3))/6,c=(s+o)*l,u=e-(s-c),h=t-(o-c);let d=0,p=1;u>h&&(d=1,p=0);const f=u-d+l,m=h-p+l,g=u-1+2*l,v=h-1+2*l,A=255&s,y=255&o,x=this.perm[A+this.perm[y]]%12,b=this.perm[A+d+this.perm[y+p]]%12,w=this.perm[A+1+this.perm[y+1]]%12;let E=.5-u*u-h*h;E<0?r=0:(E*=E,r=E*E*this.dot(this.grad3[x],u,h));let S=.5-f*f-m*m;S<0?n=0:(S*=S,n=S*S*this.dot(this.grad3[b],f,m));let M=.5-g*g-v*v;return M<0?i=0:(M*=M,i=M*M*this.dot(this.grad3[w],g,v)),70*(r+n+i)})),i(this,"noise3d",((e,t,r)=>{let n,i,a,s;const o=(e+t+r)*(1/3),l=Math.floor(e+o),c=Math.floor(t+o),u=Math.floor(r+o),h=1/6,d=(l+c+u)*h,p=e-(l-d),f=t-(c-d),m=r-(u-d);let g,v,A,y,x,b;p>=f?f>=m?(g=1,v=0,A=0,y=1,x=1,b=0):p>=m?(g=1,v=0,A=0,y=1,x=0,b=1):(g=0,v=0,A=1,y=1,x=0,b=1):f<m?(g=0,v=0,A=1,y=0,x=1,b=1):p<m?(g=0,v=1,A=0,y=0,x=1,b=1):(g=0,v=1,A=0,y=1,x=1,b=0);const w=p-g+h,E=f-v+h,S=m-A+h,M=p-y+2*h,_=f-x+2*h,T=m-b+2*h,C=p-1+.5,I=f-1+.5,B=m-1+.5,R=255&l,P=255&c,F=255&u,L=this.perm[R+this.perm[P+this.perm[F]]]%12,D=this.perm[R+g+this.perm[P+v+this.perm[F+A]]]%12,U=this.perm[R+y+this.perm[P+x+this.perm[F+b]]]%12,N=this.perm[R+1+this.perm[P+1+this.perm[F+1]]]%12;let k=.6-p*p-f*f-m*m;k<0?n=0:(k*=k,n=k*k*this.dot3(this.grad3[L],p,f,m));let O=.6-w*w-E*E-S*S;O<0?i=0:(O*=O,i=O*O*this.dot3(this.grad3[D],w,E,S));let G=.6-M*M-_*_-T*T;G<0?a=0:(G*=G,a=G*G*this.dot3(this.grad3[U],M,_,T));let z=.6-C*C-I*I-B*B;return z<0?s=0:(z*=z,s=z*z*this.dot3(this.grad3[N],C,I,B)),32*(n+i+a+s)})),i(this,"noise4d",((e,t,r,n)=>{const i=this.grad4,a=this.simplex,s=this.perm,o=(Math.sqrt(5)-1)/4,l=(5-Math.sqrt(5))/20;let c,u,h,d,p;const f=(e+t+r+n)*o,m=Math.floor(e+f),g=Math.floor(t+f),v=Math.floor(r+f),A=Math.floor(n+f),y=(m+g+v+A)*l,x=e-(m-y),b=t-(g-y),w=r-(v-y),E=n-(A-y),S=(x>b?32:0)+(x>w?16:0)+(b>w?8:0)+(x>E?4:0)+(b>E?2:0)+(w>E?1:0);let M,_,T,C,I,B,R,P,F,L,D,U;M=a[S][0]>=3?1:0,_=a[S][1]>=3?1:0,T=a[S][2]>=3?1:0,C=a[S][3]>=3?1:0,I=a[S][0]>=2?1:0,B=a[S][1]>=2?1:0,R=a[S][2]>=2?1:0,P=a[S][3]>=2?1:0,F=a[S][0]>=1?1:0,L=a[S][1]>=1?1:0,D=a[S][2]>=1?1:0,U=a[S][3]>=1?1:0;const N=x-M+l,k=b-_+l,O=w-T+l,G=E-C+l,z=x-I+2*l,V=b-B+2*l,H=w-R+2*l,Q=E-P+2*l,j=x-F+3*l,W=b-L+3*l,X=w-D+3*l,Y=E-U+3*l,q=x-1+4*l,K=b-1+4*l,J=w-1+4*l,Z=E-1+4*l,$=255&m,ee=255&g,te=255&v,re=255&A,ne=s[$+s[ee+s[te+s[re]]]]%32,ie=s[$+M+s[ee+_+s[te+T+s[re+C]]]]%32,ae=s[$+I+s[ee+B+s[te+R+s[re+P]]]]%32,se=s[$+F+s[ee+L+s[te+D+s[re+U]]]]%32,oe=s[$+1+s[ee+1+s[te+1+s[re+1]]]]%32;let le=.6-x*x-b*b-w*w-E*E;le<0?c=0:(le*=le,c=le*le*this.dot4(i[ne],x,b,w,E));let ce=.6-N*N-k*k-O*O-G*G;ce<0?u=0:(ce*=ce,u=ce*ce*this.dot4(i[ie],N,k,O,G));let ue=.6-z*z-V*V-H*H-Q*Q;ue<0?h=0:(ue*=ue,h=ue*ue*this.dot4(i[ae],z,V,H,Q));let he=.6-j*j-W*W-X*X-Y*Y;he<0?d=0:(he*=he,d=he*he*this.dot4(i[se],j,W,X,Y));let de=.6-q*q-K*K-J*J-Z*Z;return de<0?p=0:(de*=de,p=de*de*this.dot4(i[oe],q,K,J,Z)),27*(c+u+h+d+p)}));for(let t=0;t<256;t++)this.p[t]=Math.floor(256*e.random());for(let t=0;t<512;t++)this.perm[t]=this.p[255&t]}}},53615:(e,t,r)=>{"use strict";r.d(t,{TU:()=>l,Zw:()=>d,az:()=>u,iJ:()=>f,i_:()=>h,z_:()=>o});var n=r(99477),i=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const s=1024,o=(e=1)=>{const t=new Float32Array(4096*e*4),r=new n.DataTexture(t,s,4*e,n.RGBAFormat,n.FloatType);return r.wrapS=n.RepeatWrapping,r.wrapT=n.RepeatWrapping,r.magFilter=n.NearestFilter,r.needsUpdate=!0,r},l=(e,t,r=0)=>{const n=Math.floor(1024);t.arcLengthDivisions=n/2,t.updateArcLengths();const i=t.getSpacedPoints(n),a=t.computeFrenetFrames(n,!0);for(let o=0;o<n;o++){const t=Math.floor(o/s),n=o%s;let l=i[o];c(e,n,l.x,l.y,l.z,0+t+4*r),l=a.tangents[o],c(e,n,l.x,l.y,l.z,1+t+4*r),l=a.normals[o],c(e,n,l.x,l.y,l.z,2+t+4*r),l=a.binormals[o],c(e,n,l.x,l.y,l.z,3+t+4*r)}e.needsUpdate=!0},c=(e,t,r,n,i,a)=>{const s=e.image,{data:o}=s,l=4096*a;o[4*t+l+0]=r,o[4*t+l+1]=n,o[4*t+l+2]=i,o[4*t+l+3]=1},u=e=>({spineTexture:{value:e},pathOffset:{type:"f",value:0},pathSegment:{type:"f",value:1},spineOffset:{type:"f",value:161},spineLength:{type:"f",value:400},flow:{type:"i",value:1}});function h(e,t,r=1){e.__ok||(e.__ok=!0,e.onBeforeCompile=e=>{if(e.__modified)return;e.__modified=!0,Object.assign(e.uniforms,t);const n=`\n\t\tuniform sampler2D spineTexture;\n\t\tuniform float pathOffset;\n\t\tuniform float pathSegment;\n\t\tuniform float spineOffset;\n\t\tuniform float spineLength;\n\t\tuniform int flow;\n\n\t\tfloat textureLayers = ${4*r}.;\n\t\tfloat textureStacks = 1.;\n\n\t\t${e.vertexShader}\n\t\t`.replace("#include <beginnormal_vertex>","").replace("#include <defaultnormal_vertex>","").replace("#include <begin_vertex>","").replace(/void\s*main\s*\(\)\s*\{/,"\n void main() {\n #include <beginnormal_vertex>\n\n vec4 worldPos = modelMatrix * vec4(position, 1.);\n\n bool bend = flow > 0;\n float xWeight = bend ? 0. : 1.;\n\n #ifdef USE_INSTANCING\n float pathOffsetFromInstanceMatrix = instanceMatrix[3][2];\n float spineLengthFromInstanceMatrix = instanceMatrix[3][0];\n float spinePortion = bend ? (worldPos.x + spineOffset) / spineLengthFromInstanceMatrix : 0.;\n float mt = (spinePortion * pathSegment + pathOffset + pathOffsetFromInstanceMatrix)*textureStacks;\n #else\n float spinePortion = bend ? (worldPos.x + spineOffset) / spineLength : 0.;\n float mt = (spinePortion * pathSegment + pathOffset)*textureStacks;\n #endif\n\n mt = mod(mt, textureStacks);\n float rowOffset = floor(mt);\n\n #ifdef USE_INSTANCING\n rowOffset += instanceMatrix[3][1] * 4.;\n #endif\n\n vec3 spinePos = texture2D(spineTexture, vec2(mt, (0. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 a = texture2D(spineTexture, vec2(mt, (1. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 b = texture2D(spineTexture, vec2(mt, (2. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 c = texture2D(spineTexture, vec2(mt, (3. + rowOffset + 0.5) / textureLayers)).xyz;\n mat3 basis = mat3(a, b, c);\n\n vec3 transformed = basis\n * vec3(worldPos.x * xWeight, worldPos.y * 1., worldPos.z * 1.)\n + spinePos;\n\n vec3 transformedNormal = normalMatrix * (basis * objectNormal);\n\t\t\t").replace("#include <project_vertex>","vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n\t\t\t\tgl_Position = projectionMatrix * mvPosition;");e.vertexShader=n})}class d{constructor(e,t=1){a(this,"curveArray"),a(this,"curveLengthArray"),a(this,"object3D"),a(this,"splineTexure"),a(this,"uniforms");const r=e.clone(),i=o(t),s=u(i);r.traverse((e=>{(e instanceof n.Mesh||e instanceof n.InstancedMesh)&&(e.material=e.material.clone(),h(e.material,s,t))})),this.curveArray=new Array(t),this.curveLengthArray=new Array(t),this.object3D=r,this.splineTexure=i,this.uniforms=s}updateCurve(e,t){if(e>=this.curveArray.length)throw Error("Index out of range for Flow");const r=t.getLength();this.uniforms.spineLength.value=r,this.curveLengthArray[e]=r,this.curveArray[e]=t,l(this.splineTexure,t,e)}moveAlongCurve(e){this.uniforms.pathOffset.value+=e}}const p=new n.Matrix4;class f extends d{constructor(e,t,r,i){const s=new n.InstancedMesh(r,i,e);s.instanceMatrix.setUsage(n.DynamicDrawUsage),s.frustumCulled=!1,super(s,t),a(this,"offsets"),a(this,"whichCurve"),this.offsets=new Array(e).fill(0),this.whichCurve=new Array(e).fill(0)}writeChanges(e){p.makeTranslation(this.curveLengthArray[this.whichCurve[e]],this.whichCurve[e],this.offsets[e]),this.object3D.setMatrixAt(e,p),this.object3D.instanceMatrix.needsUpdate=!0}moveIndividualAlongCurve(e,t){this.offsets[e]+=t,this.writeChanges(e)}setCurve(e,t){if(isNaN(t))throw Error("curve index being set is Not a Number (NaN)");this.whichCurve[e]=t,this.writeChanges(e)}}},48756:(e,t,r)=>{"use strict";r.d(t,{q:()=>l});var n=r(99477),i=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const s={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new n.Vector3},up:{value:new n.Vector3(0,1,0)}},vertexShader:"\n uniform vec3 sunPosition;\n uniform float rayleigh;\n uniform float turbidity;\n uniform float mieCoefficient;\n uniform vec3 up;\n\n varying vec3 vWorldPosition;\n varying vec3 vSunDirection;\n varying float vSunfade;\n varying vec3 vBetaR;\n varying vec3 vBetaM;\n varying float vSunE;\n\n // constants for atmospheric scattering\n const float e = 2.71828182845904523536028747135266249775724709369995957;\n const float pi = 3.141592653589793238462643383279502884197169;\n\n // wavelength of used primaries, according to preetham\n const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );\n // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function:\n // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))\n const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );\n\n // mie stuff\n // K coefficient for the primaries\n const float v = 4.0;\n const vec3 K = vec3( 0.686, 0.678, 0.666 );\n // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K\n const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );\n\n // earth shadow hack\n // cutoffAngle = pi / 1.95;\n const float cutoffAngle = 1.6110731556870734;\n const float steepness = 1.5;\n const float EE = 1000.0;\n\n float sunIntensity( float zenithAngleCos ) {\n zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );\n return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );\n }\n\n vec3 totalMie( float T ) {\n float c = ( 0.2 * T ) * 10E-18;\n return 0.434 * c * MieConst;\n }\n\n void main() {\n\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n gl_Position.z = gl_Position.w; // set z to camera.far\n\n vSunDirection = normalize( sunPosition );\n\n vSunE = sunIntensity( dot( vSunDirection, up ) );\n\n vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );\n\n float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );\n\n // extinction (absorbtion + out scattering)\n // rayleigh coefficients\n vBetaR = totalRayleigh * rayleighCoefficient;\n\n // mie coefficients\n vBetaM = totalMie( turbidity ) * mieCoefficient;\n\n }\n ",fragmentShader:"\n varying vec3 vWorldPosition;\n varying vec3 vSunDirection;\n varying float vSunfade;\n varying vec3 vBetaR;\n varying vec3 vBetaM;\n varying float vSunE;\n\n uniform float mieDirectionalG;\n uniform vec3 up;\n\n const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 );\n\n // constants for atmospheric scattering\n const float pi = 3.141592653589793238462643383279502884197169;\n\n const float n = 1.0003; // refractive index of air\n const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)\n\n // optical length at zenith for molecules\n const float rayleighZenithLength = 8.4E3;\n const float mieZenithLength = 1.25E3;\n // 66 arc seconds -> degrees, and the cosine of that\n const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;\n\n // 3.0 / ( 16.0 * pi )\n const float THREE_OVER_SIXTEENPI = 0.05968310365946075;\n // 1.0 / ( 4.0 * pi )\n const float ONE_OVER_FOURPI = 0.07957747154594767;\n\n float rayleighPhase( float cosTheta ) {\n return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );\n }\n\n float hgPhase( float cosTheta, float g ) {\n float g2 = pow( g, 2.0 );\n float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );\n return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );\n }\n\n void main() {\n\n vec3 direction = normalize( vWorldPosition - cameraPos );\n\n // optical length\n // cutoff angle at 90 to avoid singularity in next formula.\n float zenithAngle = acos( max( 0.0, dot( up, direction ) ) );\n float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );\n float sR = rayleighZenithLength * inverse;\n float sM = mieZenithLength * inverse;\n\n // combined extinction factor\n vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );\n\n // in scattering\n float cosTheta = dot( direction, vSunDirection );\n\n float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );\n vec3 betaRTheta = vBetaR * rPhase;\n\n float mPhase = hgPhase( cosTheta, mieDirectionalG );\n vec3 betaMTheta = vBetaM * mPhase;\n\n vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );\n Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );\n\n // nightsky\n float theta = acos( direction.y ); // elevation --\x3e y-axis, [-pi/2, pi/2]\n float phi = atan( direction.z, direction.x ); // azimuth --\x3e x-axis [-pi/2, pi/2]\n vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );\n vec3 L0 = vec3( 0.1 ) * Fex;\n\n // composition + solar disc\n float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );\n L0 += ( vSunE * 19000.0 * Fex ) * sundisk;\n\n vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );\n\n vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );\n\n gl_FragColor = vec4( retColor, 1.0 );\n\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n\n }\n "},o=new n.ShaderMaterial({name:"SkyShader",fragmentShader:s.fragmentShader,vertexShader:s.vertexShader,uniforms:n.UniformsUtils.clone(s.uniforms),side:n.BackSide,depthWrite:!1});class l extends n.Mesh{constructor(){super(new n.BoxGeometry(1,1,1),o)}}a(l,"SkyShader",s),a(l,"material",o)},8064:(e,t,r)=>{"use strict";r.d(t,{x:()=>c});var n=r(99477),i=r(84360),a=r(6073),s=r(14394),o=Object.defineProperty,l=(e,t,r)=>(((e,t,r)=>{t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class c{constructor(e,t){if(l(this,"renderer"),l(this,"_pixelRatio"),l(this,"_width"),l(this,"_height"),l(this,"renderTarget1"),l(this,"renderTarget2"),l(this,"writeBuffer"),l(this,"readBuffer"),l(this,"renderToScreen"),l(this,"passes",[]),l(this,"copyPass"),l(this,"clock"),this.renderer=e,void 0===t){const r={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat},i=e.getSize(new n.Vector2);this._pixelRatio=e.getPixelRatio(),this._width=i.width,this._height=i.height,(t=new n.WebGLRenderTarget(this._width*this._pixelRatio,this._height*this._pixelRatio,r)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,void 0===i.C&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===a.T&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new a.T(i.C),this.clock=new n.Clock}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);-1!==t&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){void 0===e&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let r=!1;const n=this.passes.length;for(let i=0;i<n;i++){const t=this.passes[i];if(!1!==t.enabled){if(t.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(i),t.render(this.renderer,this.writeBuffer,this.readBuffer,e,r),t.needsSwap){if(r){const t=this.renderer.getContext(),r=this.renderer.state.buffers.stencil;r.setFunc(t.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),r.setFunc(t.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==s.F&&(t instanceof s.F?r=!0:t instanceof s.M&&(r=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(void 0===e){const t=this.renderer.getSize(new n.Vector2);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,(e=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const r=this._width*this._pixelRatio,n=this._height*this._pixelRatio;this.renderTarget1.setSize(r,n),this.renderTarget2.setSize(r,n);for(let i=0;i<this.passes.length;i++)this.passes[i].setSize(r,n)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}}},14394:(e,t,r)=>{"use strict";r.d(t,{F:()=>s,M:()=>o});var n=r(87628),i=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class s extends n.w{constructor(e,t){super(),a(this,"scene"),a(this,"camera"),a(this,"inverse"),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,r){const n=e.getContext(),i=e.state;let a,s;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(a=0,s=1):(a=1,s=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(n.REPLACE,n.REPLACE,n.REPLACE),i.buffers.stencil.setFunc(n.ALWAYS,a,4294967295),i.buffers.stencil.setClear(s),i.buffers.stencil.setLocked(!0),e.setRenderTarget(r),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(n.EQUAL,1,4294967295),i.buffers.stencil.setOp(n.KEEP,n.KEEP,n.KEEP),i.buffers.stencil.setLocked(!0)}}class o extends n.w{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}},87628:(e,t,r)=>{"use strict";r.d(t,{T:()=>o,w:()=>s});var n=r(99477),i=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class s{constructor(){a(this,"enabled",!0),a(this,"needsSwap",!0),a(this,"clear",!1),a(this,"renderToScreen",!1)}setSize(e,t){}render(e,t,r,n,i){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}class o{constructor(e){a(this,"camera",new n.OrthographicCamera(-1,1,1,-1,0,1)),a(this,"geometry",new n.PlaneGeometry(2,2)),a(this,"mesh"),this.mesh=new n.Mesh(this.geometry,e)}get material(){return this.mesh.material}set material(e){this.mesh.material=e}dispose(){this.mesh.geometry.dispose()}render(e){e.render(this.mesh,this.camera)}}},48197:(e,t,r)=>{"use strict";r.d(t,{C:()=>o});var n=r(99477),i=r(87628),a=Object.defineProperty,s=(e,t,r)=>(((e,t,r)=>{t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class o extends i.w{constructor(e,t,r,i,a=0){super(),s(this,"scene"),s(this,"camera"),s(this,"overrideMaterial"),s(this,"clearColor"),s(this,"clearAlpha"),s(this,"clearDepth",!1),s(this,"_oldClearColor",new n.Color),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=i,this.clearAlpha=a,this.clear=!0,this.needsSwap=!1}render(e,t,r){let n,i=e.autoClear;e.autoClear=!1;let a=null;void 0!==this.overrideMaterial&&(a=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(e.getClearColor(this._oldClearColor),n=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:r),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor&&e.setClearColor(this._oldClearColor,n),void 0!==this.overrideMaterial&&(this.scene.overrideMaterial=a),e.autoClear=i}}},6073:(e,t,r)=>{"use strict";r.d(t,{T:()=>o});var n=r(99477),i=r(87628),a=Object.defineProperty,s=(e,t,r)=>(((e,t,r)=>{t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class o extends i.w{constructor(e,t="tDiffuse"){super(),s(this,"textureID"),s(this,"uniforms"),s(this,"material"),s(this,"fsQuad"),this.textureID=t,e instanceof n.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):(this.uniforms=n.UniformsUtils.clone(e.uniforms),this.material=new n.ShaderMaterial({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new i.T(this.material)}render(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}}},84360:(e,t,r)=>{"use strict";r.d(t,{C:()=>n});const n={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")}},60809:(e,t,r)=>{"use strict";r.d(t,{Y:()=>n});const n={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 tex = texture2D( tDiffuse, vUv );","\tgl_FragColor = LinearTosRGB( tex );","}"].join("\n")}},78466:(e,t,r)=>{"use strict";r.d(t,{P:()=>n});const n={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n ",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform float h;\n\n varying vec2 vUv;\n\n void main() {\n\n \tvec4 sum = vec4( 0.0 );\n\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;\n\n \tgl_FragColor = sum;\n\n }\n "}},37312:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n ",fragmentShader:"\n\n uniform sampler2D tDiffuse;\n uniform float v;\n\n varying vec2 vUv;\n\n void main() {\n\n vec4 sum = vec4( 0.0 );\n\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;\n\n gl_FragColor = sum;\n\n }\n "}},84975:(e,t,r)=>{"use strict";r.r(t),r.d(t,{computeMorphedAttributes:()=>h,estimateBytesUsed:()=>l,interleaveAttributes:()=>o,mergeBufferAttributes:()=>s,mergeBufferGeometries:()=>a,mergeVertices:()=>c,toCreasedNormals:()=>d,toTrianglesDrawMode:()=>u});var n=r(99477);const i=(e,t)=>e[t],a=(e,t)=>{const r=null!==e[0].index,i=new Set(Object.keys(e[0].attributes)),a=new Set(Object.keys(e[0].morphAttributes)),o={},l={},c=e[0].morphTargetsRelative,u=new n.BufferGeometry;let h=0;if(e.forEach(((e,n)=>{let s=0;if(r!==(null!==e.index))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+n+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let t in e.attributes){if(!i.has(t))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+n+'. All geometries must have compatible attributes; make sure "'+t+'" attribute exists among all geometries, or in none of them.'),null;void 0===o[t]&&(o[t]=[]),o[t].push(e.attributes[t]),s++}if(s!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+n+". Make sure all geometries have the same number of attributes."),null;if(c!==e.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+n+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let t in e.morphAttributes){if(!a.has(t))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+n+". .morphAttributes must be consistent throughout all geometries."),null;void 0===l[t]&&(l[t]=[]),l[t].push(e.morphAttributes[t])}if(u.userData.mergedUserData=u.userData.mergedUserData||[],u.userData.mergedUserData.push(e.userData),t){let t;if(e.index)t=e.index.count;else{if(void 0===e.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+n+". The geometry must have either an index or a position attribute"),null;t=e.attributes.position.count}u.addGroup(h,t,n),h+=t}})),r){let t=0;const r=[];e.forEach((e=>{const n=e.index;for(let i=0;i<n.count;++i)r.push(n.getX(i)+t);t+=e.attributes.position.count})),u.setIndex(r)}for(let n in o){const e=s(o[n]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+n+" attribute."),null;u.setAttribute(n,e)}for(let n in l){const e=l[n][0].length;if(0===e)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[n]=[];for(let t=0;t<e;++t){const e=[];for(let i=0;i<l[n].length;++i)e.push(l[n][i][t]);const r=s(e);if(!r)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+n+" morphAttribute."),null;u.morphAttributes[n].push(r)}}return u},s=e=>{let t,r,i,a=0;if(e.forEach((e=>(void 0===t&&(t=e.array.constructor),t!==e.array.constructor?(console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null):(void 0===r&&(r=e.itemSize),r!==e.itemSize?(console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null):(void 0===i&&(i=e.normalized),i!==e.normalized?(console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null):void(a+=e.array.length)))))),t&&r){const s=new t(a);let o=0;return e.forEach((e=>{s.set(e.array,o),o+=e.array.length})),new n.BufferAttribute(s,r,i)}},o=e=>{let t,r=0,a=0;for(let n=0,i=e.length;n<i;++n){const i=e[n];if(void 0===t&&(t=i.array.constructor),t!==i.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;r+=i.array.length,a+=i.itemSize}const s=new n.InterleavedBuffer(new t(r),a);let o=0;const l=[],c=["getX","getY","getZ","getW"],u=["setX","setY","setZ","setW"];for(let h=0,d=e.length;h<d;h++){const t=e[h],r=t.itemSize,a=t.count,d=new n.InterleavedBufferAttribute(s,r,o,t.normalized);l.push(d),o+=r;for(let e=0;e<a;e++)for(let n=0;n<r;n++){i(d,u[n])(e,i(t,c[n])(e))}}return l};function l(e){let t=0;for(let n in e.attributes){const r=e.getAttribute(n);t+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}const r=e.getIndex();return t+=r?r.count*r.itemSize*r.array.BYTES_PER_ELEMENT:0,t}function c(e,t=1e-4){t=Math.max(t,Number.EPSILON);const r={},i=e.getIndex(),a=e.getAttribute("position"),s=i?i.count:a.count;let o=0;const l=Object.keys(e.attributes),c={},u={},h=[],d=["getX","getY","getZ","getW"];for(let n=0,g=l.length;n<g;n++){const t=l[n];c[t]=[];const r=e.morphAttributes[t];r&&(u[t]=new Array(r.length).fill(0).map((()=>[])))}const p=Math.log10(1/t),f=Math.pow(10,p);for(let n=0;n<s;n++){const t=i?i.getX(n):n;let a="";for(let r=0,n=l.length;r<n;r++){const n=l[r],i=e.getAttribute(n),s=i.itemSize;for(let e=0;e<s;e++)a+=~~(i[d[e]](t)*f)+","}if(a in r)h.push(r[a]);else{for(let r=0,n=l.length;r<n;r++){const n=l[r],i=e.getAttribute(n),a=e.morphAttributes[n],s=i.itemSize,o=c[n],h=u[n];for(let e=0;e<s;e++){const r=d[e];if(o.push(i[r](t)),a)for(let e=0,n=a.length;e<n;e++)h[e].push(a[e][r](t))}}r[a]=o,h.push(o),o++}}const m=e.clone();for(let g=0,v=l.length;g<v;g++){const t=l[g],r=e.getAttribute(t),i=new r.array.constructor(c[t]),a=new n.BufferAttribute(i,r.itemSize,r.normalized);if(m.setAttribute(t,a),t in u)for(let s=0;s<u[t].length;s++){const r=e.morphAttributes[t][s],i=new r.array.constructor(u[t][s]),a=new n.BufferAttribute(i,r.itemSize,r.normalized);m.morphAttributes[t][s]=a}}return m.setIndex(h),m}function u(e,t){if(t===n.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===n.TriangleFanDrawMode||t===n.TriangleStripDrawMode){let r=e.getIndex();if(null===r){const t=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<n.count;e++)t.push(e);e.setIndex(t),r=e.getIndex()}const i=r.count-2,a=[];if(r)if(t===n.TriangleFanDrawMode)for(let e=1;e<=i;e++)a.push(r.getX(0)),a.push(r.getX(e)),a.push(r.getX(e+1));else for(let e=0;e<i;e++)e%2==0?(a.push(r.getX(e)),a.push(r.getX(e+1)),a.push(r.getX(e+2))):(a.push(r.getX(e+2)),a.push(r.getX(e+1)),a.push(r.getX(e)));a.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=e.clone();return s.setIndex(a),s.clearGroups(),s}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}function h(e){if(!0!==e.geometry.isBufferGeometry)return console.error("THREE.BufferGeometryUtils: Geometry is not of type BufferGeometry."),null;const t=new n.Vector3,r=new n.Vector3,i=new n.Vector3,a=new n.Vector3,s=new n.Vector3,o=new n.Vector3,l=new n.Vector3,c=new n.Vector3,u=new n.Vector3;function h(e,n,h,d,p,f,m,g,v){t.fromBufferAttribute(h,f),r.fromBufferAttribute(h,m),i.fromBufferAttribute(h,g);const A=e.morphTargetInfluences;if(n.morphTargets&&d&&A){l.set(0,0,0),c.set(0,0,0),u.set(0,0,0);for(let e=0,n=d.length;e<n;e++){const n=A[e],h=d[e];0!==n&&(a.fromBufferAttribute(h,f),s.fromBufferAttribute(h,m),o.fromBufferAttribute(h,g),p?(l.addScaledVector(a,n),c.addScaledVector(s,n),u.addScaledVector(o,n)):(l.addScaledVector(a.sub(t),n),c.addScaledVector(s.sub(r),n),u.addScaledVector(o.sub(i),n)))}t.add(l),r.add(c),i.add(u)}e.isSkinnedMesh&&(e.boneTransform(f,t),e.boneTransform(m,r),e.boneTransform(g,i)),v[3*f+0]=t.x,v[3*f+1]=t.y,v[3*f+2]=t.z,v[3*m+0]=r.x,v[3*m+1]=r.y,v[3*m+2]=r.z,v[3*g+0]=i.x,v[3*g+1]=i.y,v[3*g+2]=i.z}const d=e.geometry,p=e.material;let f,m,g;const v=d.index,A=d.attributes.position,y=d.morphAttributes.position,x=d.morphTargetsRelative,b=d.attributes.normal,w=d.morphAttributes.position,E=d.groups,S=d.drawRange;let M,_,T,C,I,B,R,P;const F=new Float32Array(A.count*A.itemSize),L=new Float32Array(b.count*b.itemSize);if(null!==v)if(Array.isArray(p))for(M=0,T=E.length;M<T;M++)for(I=E[M],B=p[I.materialIndex],R=Math.max(I.start,S.start),P=Math.min(I.start+I.count,S.start+S.count),_=R,C=P;_<C;_+=3)f=v.getX(_),m=v.getX(_+1),g=v.getX(_+2),h(e,B,A,y,x,f,m,g,F),h(e,B,b,w,x,f,m,g,L);else for(R=Math.max(0,S.start),P=Math.min(v.count,S.start+S.count),M=R,T=P;M<T;M+=3)f=v.getX(M),m=v.getX(M+1),g=v.getX(M+2),h(e,p,A,y,x,f,m,g,F),h(e,p,b,w,x,f,m,g,L);else if(void 0!==A)if(Array.isArray(p))for(M=0,T=E.length;M<T;M++)for(I=E[M],B=p[I.materialIndex],R=Math.max(I.start,S.start),P=Math.min(I.start+I.count,S.start+S.count),_=R,C=P;_<C;_+=3)f=_,m=_+1,g=_+2,h(e,B,A,y,x,f,m,g,F),h(e,B,b,w,x,f,m,g,L);else for(R=Math.max(0,S.start),P=Math.min(A.count,S.start+S.count),M=R,T=P;M<T;M+=3)f=M,m=M+1,g=M+2,h(e,p,A,y,x,f,m,g,F),h(e,p,b,w,x,f,m,g,L);return{positionAttribute:A,normalAttribute:b,morphedPositionAttribute:new n.Float32BufferAttribute(F,3),morphedNormalAttribute:new n.Float32BufferAttribute(L,3)}}function d(e,t=Math.PI/3){const r=Math.cos(t),i=100*(1+1e-10),a=[new n.Vector3,new n.Vector3,new n.Vector3],s=new n.Vector3,o=new n.Vector3,l=new n.Vector3,c=new n.Vector3;function u(e){return`${~~(e.x*i)},${~~(e.y*i)},${~~(e.z*i)}`}const h=e.toNonIndexed(),d=h.attributes.position,p={};for(let g=0,v=d.count/3;g<v;g++){const e=3*g,t=a[0].fromBufferAttribute(d,e+0),r=a[1].fromBufferAttribute(d,e+1),i=a[2].fromBufferAttribute(d,e+2);s.subVectors(i,r),o.subVectors(t,r);const l=(new n.Vector3).crossVectors(s,o).normalize();for(let n=0;n<3;n++){const e=u(a[n]);e in p||(p[e]=[]),p[e].push(l)}}const f=new Float32Array(3*d.count),m=new n.BufferAttribute(f,3,!1);for(let n=0,g=d.count/3;n<g;n++){const e=3*n,t=a[0].fromBufferAttribute(d,e+0),i=a[1].fromBufferAttribute(d,e+1),h=a[2].fromBufferAttribute(d,e+2);s.subVectors(h,i),o.subVectors(t,i),l.crossVectors(s,o).normalize();for(let n=0;n<3;n++){const t=p[u(a[n])];c.set(0,0,0);for(let e=0,n=t.length;e<n;e++){const n=t[e];l.dot(n)>r&&c.add(n)}c.normalize(),m.setXYZ(e+n,c.x,c.y,c.z)}}return h.setAttribute("normal",m),h}},14671:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(67294);function i(e){let t;const r=new Set,n=(e,n)=>{const i="function"==typeof e?e(t):e;if(i!==t){const e=t;t=n?i:Object.assign({},t,i),r.forEach((r=>r(t,e)))}},i=()=>t,a={setState:n,getState:i,subscribe:(e,n,a)=>n||a?((e,n=i,a=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let s=n(t);function o(){const r=n(t);if(!a(s,r)){const t=s;e(s=r,t)}}return r.add(o),()=>r.delete(o)})(e,n,a):(r.add(e),()=>r.delete(e)),destroy:()=>r.clear()};return t=e(n,i,a),a}const a="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?n.useEffect:n.useLayoutEffect;function s(e){const t="function"==typeof e?i(e):e,r=(e=t.getState,r=Object.is)=>{const[,i]=(0,n.useReducer)((e=>e+1),0),s=t.getState(),o=(0,n.useRef)(s),l=(0,n.useRef)(e),c=(0,n.useRef)(r),u=(0,n.useRef)(!1),h=(0,n.useRef)();let d;void 0===h.current&&(h.current=e(s));let p=!1;(o.current!==s||l.current!==e||c.current!==r||u.current)&&(d=e(s),p=!r(h.current,d)),a((()=>{p&&(h.current=d),o.current=s,l.current=e,c.current=r,u.current=!1}));const f=(0,n.useRef)(s);a((()=>{const e=()=>{try{const e=t.getState(),r=l.current(e);c.current(h.current,r)||(o.current=e,h.current=r,i())}catch(e){u.current=!0,i()}},r=t.subscribe(e);return t.getState()!==f.current&&e(),r}),[]);const m=p?d:h.current;return(0,n.useDebugValue)(m),m};return Object.assign(r,t),r[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const e=[r,t];return{next(){const t=e.length<=0;return{value:e.shift(),done:t}}}},r}},60374:(e,t,r)=>{"use strict";function n(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!Object.is(e[r[n]],t[r[n]]))return!1;return!0}r.d(t,{Z:()=>n})},99477:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ACESFilmicToneMapping:()=>te,AddEquation:()=>S,AddOperation:()=>K,AdditiveAnimationBlendMode:()=>Bt,AdditiveBlending:()=>x,AlphaFormat:()=>Fe,AlwaysDepth:()=>z,AlwaysStencilFunc:()=>ar,AmbientLight:()=>fd,AmbientLightProbe:()=>Rd,AnimationAction:()=>ap,AnimationClip:()=>kh,AnimationLoader:()=>Xh,AnimationMixer:()=>op,AnimationObjectGroup:()=>ip,AnimationUtils:()=>Mh,ArcCurve:()=>Vc,ArrayCamera:()=>fl,ArrowHelper:()=>Zp,Audio:()=>Hd,AudioAnalyser:()=>qd,AudioContext:()=>Cd,AudioListener:()=>Vd,AudioLoader:()=>Id,AxesHelper:()=>$p,BackSide:()=>m,BasicDepthPacking:()=>Ut,BasicShadowMap:()=>u,Bone:()=>nc,BooleanKeyframeTrack:()=>Rh,Box2:()=>yp,Box3:()=>pn,Box3Helper:()=>Xp,BoxBufferGeometry:()=>tf,BoxGeometry:()=>Sa,BoxHelper:()=>Wp,BufferAttribute:()=>Gi,BufferGeometry:()=>ia,BufferGeometryLoader:()=>bd,ByteType:()=>Ee,Cache:()=>Gh,Camera:()=>Ba,CameraHelper:()=>Hp,CanvasTexture:()=>Oc,CapsuleBufferGeometry:()=>rf,CapsuleGeometry:()=>cu,CatmullRomCurve3:()=>Yc,CineonToneMapping:()=>ee,CircleBufferGeometry:()=>nf,CircleGeometry:()=>uu,ClampToEdgeWrapping:()=>ue,Clock:()=>Ud,Color:()=>Bi,ColorKeyframeTrack:()=>Ph,ColorManagement:()=>Yr,CompressedArrayTexture:()=>kc,CompressedTexture:()=>Nc,CompressedTextureLoader:()=>Yh,ConeBufferGeometry:()=>af,ConeGeometry:()=>du,CubeCamera:()=>Fa,CubeReflectionMapping:()=>ie,CubeRefractionMapping:()=>ae,CubeTexture:()=>La,CubeTextureLoader:()=>Kh,CubeUVReflectionMapping:()=>le,CubicBezierCurve:()=>Zc,CubicBezierCurve3:()=>$c,CubicInterpolant:()=>Th,CullFaceBack:()=>o,CullFaceFront:()=>l,CullFaceFrontBack:()=>c,CullFaceNone:()=>s,Curve:()=>Gc,CurvePath:()=>su,CustomBlending:()=>E,CustomToneMapping:()=>re,CylinderBufferGeometry:()=>sf,CylinderGeometry:()=>hu,Cylindrical:()=>vp,Data3DTexture:()=>sn,DataArrayTexture:()=>nn,DataTexture:()=>ic,DataTextureLoader:()=>Jh,DataUtils:()=>Ni,DecrementStencilOp:()=>Yt,DecrementWrapStencilOp:()=>Kt,DefaultLoadingManager:()=>Vh,DepthFormat:()=>Ne,DepthStencilFormat:()=>ke,DepthTexture:()=>Al,DirectionalLight:()=>pd,DirectionalLightHelper:()=>Gp,DiscreteInterpolant:()=>Ih,DisplayP3ColorSpace:()=>Ht,DodecahedronBufferGeometry:()=>of,DodecahedronGeometry:()=>fu,DoubleSide:()=>g,DstAlphaFactor:()=>D,DstColorFactor:()=>N,DynamicCopyUsage:()=>pr,DynamicDrawUsage:()=>or,DynamicReadUsage:()=>ur,EdgesGeometry:()=>yu,EllipseCurve:()=>zc,EqualDepth:()=>Q,EqualStencilFunc:()=>er,EquirectangularReflectionMapping:()=>se,EquirectangularRefractionMapping:()=>oe,Euler:()=>Kn,EventDispatcher:()=>Ar,ExtrudeBufferGeometry:()=>lf,ExtrudeGeometry:()=>qu,FileLoader:()=>Wh,Float16BufferAttribute:()=>Yi,Float32BufferAttribute:()=>qi,Float64BufferAttribute:()=>Ki,FloatType:()=>Ce,Fog:()=>_l,FogExp2:()=>Ml,FramebufferTexture:()=>Uc,FrontSide:()=>f,Frustum:()=>Va,GLBufferAttribute:()=>dp,GLSL1:()=>mr,GLSL3:()=>gr,GreaterDepth:()=>W,GreaterEqualDepth:()=>j,GreaterEqualStencilFunc:()=>ir,GreaterStencilFunc:()=>rr,GridHelper:()=>Dp,Group:()=>ml,HalfFloatType:()=>Ie,HemisphereLight:()=>ed,HemisphereLightHelper:()=>Lp,HemisphereLightProbe:()=>Bd,IcosahedronBufferGeometry:()=>cf,IcosahedronGeometry:()=>Ju,ImageBitmapLoader:()=>_d,ImageLoader:()=>qh,ImageUtils:()=>Kr,IncrementStencilOp:()=>Xt,IncrementWrapStencilOp:()=>qt,InstancedBufferAttribute:()=>lc,InstancedBufferGeometry:()=>xd,InstancedInterleavedBuffer:()=>hp,InstancedMesh:()=>gc,Int16BufferAttribute:()=>Qi,Int32BufferAttribute:()=>Wi,Int8BufferAttribute:()=>zi,IntType:()=>_e,InterleavedBuffer:()=>Cl,InterleavedBufferAttribute:()=>Bl,Interpolant:()=>_h,InterpolateDiscrete:()=>Et,InterpolateLinear:()=>St,InterpolateSmooth:()=>Mt,InvertStencilOp:()=>Jt,KeepStencilOp:()=>jt,KeyframeTrack:()=>Bh,LOD:()=>ql,LatheBufferGeometry:()=>uf,LatheGeometry:()=>lu,Layers:()=>Jn,LessDepth:()=>V,LessEqualDepth:()=>H,LessEqualStencilFunc:()=>tr,LessStencilFunc:()=>$t,Light:()=>$h,LightProbe:()=>vd,Line:()=>Ec,Line3:()=>wp,LineBasicMaterial:()=>vc,LineCurve:()=>eu,LineCurve3:()=>tu,LineDashedMaterial:()=>Ah,LineLoop:()=>Tc,LineSegments:()=>_c,LinearEncoding:()=>Lt,LinearFilter:()=>ve,LinearInterpolant:()=>Ch,LinearMipMapLinearFilter:()=>be,LinearMipMapNearestFilter:()=>ye,LinearMipmapLinearFilter:()=>xe,LinearMipmapNearestFilter:()=>Ae,LinearSRGBColorSpace:()=>Vt,LinearToneMapping:()=>Z,Loader:()=>Hh,LoaderUtils:()=>yd,LoadingManager:()=>zh,LoopOnce:()=>xt,LoopPingPong:()=>wt,LoopRepeat:()=>bt,LuminanceAlphaFormat:()=>Ue,LuminanceFormat:()=>De,MOUSE:()=>i,Material:()=>Mi,MaterialLoader:()=>Ad,MathUtils:()=>Pr,Matrix3:()=>Lr,Matrix4:()=>Gn,MaxEquation:()=>C,Mesh:()=>wa,MeshBasicMaterial:()=>Pi,MeshDepthMaterial:()=>ll,MeshDistanceMaterial:()=>cl,MeshLambertMaterial:()=>gh,MeshMatcapMaterial:()=>vh,MeshNormalMaterial:()=>mh,MeshPhongMaterial:()=>ph,MeshPhysicalMaterial:()=>dh,MeshStandardMaterial:()=>hh,MeshToonMaterial:()=>fh,MinEquation:()=>T,MirroredRepeatWrapping:()=>he,MixOperation:()=>q,MultiplyBlending:()=>w,MultiplyOperation:()=>Y,NearestFilter:()=>de,NearestMipMapLinearFilter:()=>ge,NearestMipMapNearestFilter:()=>fe,NearestMipmapLinearFilter:()=>me,NearestMipmapNearestFilter:()=>pe,NeverDepth:()=>G,NeverStencilFunc:()=>Zt,NoBlending:()=>A,NoColorSpace:()=>Gt,NoToneMapping:()=>J,NormalAnimationBlendMode:()=>It,NormalBlending:()=>y,NotEqualDepth:()=>X,NotEqualStencilFunc:()=>nr,NumberKeyframeTrack:()=>Fh,Object3D:()=>hi,ObjectLoader:()=>wd,ObjectSpaceNormalMap:()=>Ot,OctahedronBufferGeometry:()=>hf,OctahedronGeometry:()=>Zu,OneFactor:()=>B,OneMinusDstAlphaFactor:()=>U,OneMinusDstColorFactor:()=>k,OneMinusSrcAlphaFactor:()=>L,OneMinusSrcColorFactor:()=>P,OrthographicCamera:()=>rs,PCFShadowMap:()=>h,PCFSoftShadowMap:()=>d,PMREMGenerator:()=>hs,Path:()=>ou,PerspectiveCamera:()=>Ra,Plane:()=>Oa,PlaneBufferGeometry:()=>df,PlaneGeometry:()=>ja,PlaneHelper:()=>Yp,PointLight:()=>hd,PointLightHelper:()=>Bp,Points:()=>Fc,PointsMaterial:()=>Cc,PolarGridHelper:()=>Up,PolyhedronBufferGeometry:()=>pf,PolyhedronGeometry:()=>pu,PositionalAudio:()=>Yd,PropertyBinding:()=>np,PropertyMixer:()=>Kd,QuadraticBezierCurve:()=>ru,QuadraticBezierCurve3:()=>nu,Quaternion:()=>cn,QuaternionKeyframeTrack:()=>Dh,QuaternionLinearInterpolant:()=>Lh,RED_GREEN_RGTC2_Format:()=>At,RED_RGTC1_Format:()=>gt,REVISION:()=>n,RGBADepthPacking:()=>Nt,RGBAFormat:()=>Le,RGBAIntegerFormat:()=>He,RGBA_ASTC_10x10_Format:()=>dt,RGBA_ASTC_10x5_Format:()=>ct,RGBA_ASTC_10x6_Format:()=>ut,RGBA_ASTC_10x8_Format:()=>ht,RGBA_ASTC_12x10_Format:()=>pt,RGBA_ASTC_12x12_Format:()=>ft,RGBA_ASTC_4x4_Format:()=>tt,RGBA_ASTC_5x4_Format:()=>rt,RGBA_ASTC_5x5_Format:()=>nt,RGBA_ASTC_6x5_Format:()=>it,RGBA_ASTC_6x6_Format:()=>at,RGBA_ASTC_8x5_Format:()=>st,RGBA_ASTC_8x6_Format:()=>ot,RGBA_ASTC_8x8_Format:()=>lt,RGBA_BPTC_Format:()=>mt,RGBA_ETC2_EAC_Format:()=>et,RGBA_PVRTC_2BPPV1_Format:()=>Je,RGBA_PVRTC_4BPPV1_Format:()=>Ke,RGBA_S3TC_DXT1_Format:()=>je,RGBA_S3TC_DXT3_Format:()=>We,RGBA_S3TC_DXT5_Format:()=>Xe,RGB_ETC1_Format:()=>Ze,RGB_ETC2_Format:()=>$e,RGB_PVRTC_2BPPV1_Format:()=>qe,RGB_PVRTC_4BPPV1_Format:()=>Ye,RGB_S3TC_DXT1_Format:()=>Qe,RGFormat:()=>ze,RGIntegerFormat:()=>Ve,RawShaderMaterial:()=>uh,Ray:()=>On,Raycaster:()=>pp,RectAreaLight:()=>md,RedFormat:()=>Oe,RedIntegerFormat:()=>Ge,ReinhardToneMapping:()=>$,RepeatWrapping:()=>ce,ReplaceStencilOp:()=>Wt,ReverseSubtractEquation:()=>_,RingBufferGeometry:()=>ff,RingGeometry:()=>$u,SIGNED_RED_GREEN_RGTC2_Format:()=>yt,SIGNED_RED_RGTC1_Format:()=>vt,SRGBColorSpace:()=>zt,Scene:()=>Tl,ShaderChunk:()=>Wa,ShaderLib:()=>Ya,ShaderMaterial:()=>Ia,ShadowMaterial:()=>ch,Shape:()=>xu,ShapeBufferGeometry:()=>mf,ShapeGeometry:()=>eh,ShapePath:()=>ef,ShapeUtils:()=>Wu,ShortType:()=>Se,Skeleton:()=>oc,SkeletonHelper:()=>Cp,SkinnedMesh:()=>rc,Source:()=>Jr,Sphere:()=>Rn,SphereBufferGeometry:()=>gf,SphereGeometry:()=>th,Spherical:()=>gp,SphericalHarmonics3:()=>gd,SplineCurve:()=>iu,SpotLight:()=>sd,SpotLightHelper:()=>Sp,Sprite:()=>jl,SpriteMaterial:()=>Rl,SrcAlphaFactor:()=>F,SrcAlphaSaturateFactor:()=>O,SrcColorFactor:()=>R,StaticCopyUsage:()=>dr,StaticDrawUsage:()=>sr,StaticReadUsage:()=>cr,StereoCamera:()=>Dd,StreamCopyUsage:()=>fr,StreamDrawUsage:()=>lr,StreamReadUsage:()=>hr,StringKeyframeTrack:()=>Uh,SubtractEquation:()=>M,SubtractiveBlending:()=>b,TOUCH:()=>a,TangentSpaceNormalMap:()=>kt,TetrahedronBufferGeometry:()=>vf,TetrahedronGeometry:()=>rh,Texture:()=>en,TextureLoader:()=>Zh,TorusBufferGeometry:()=>Af,TorusGeometry:()=>nh,TorusKnotBufferGeometry:()=>yf,TorusKnotGeometry:()=>ih,Triangle:()=>Ei,TriangleFanDrawMode:()=>Ft,TriangleStripDrawMode:()=>Pt,TrianglesDrawMode:()=>Rt,TubeBufferGeometry:()=>xf,TubeGeometry:()=>ah,TwoPassDoubleSide:()=>v,UVMapping:()=>ne,Uint16BufferAttribute:()=>ji,Uint32BufferAttribute:()=>Xi,Uint8BufferAttribute:()=>Vi,Uint8ClampedBufferAttribute:()=>Hi,Uniform:()=>lp,UniformsGroup:()=>up,UniformsLib:()=>Xa,UniformsUtils:()=>Ca,UnsignedByteType:()=>we,UnsignedInt248Type:()=>Pe,UnsignedIntType:()=>Te,UnsignedShort4444Type:()=>Be,UnsignedShort5551Type:()=>Re,UnsignedShortType:()=>Me,VSMShadowMap:()=>p,Vector2:()=>Fr,Vector3:()=>un,Vector4:()=>tn,VectorKeyframeTrack:()=>Nh,VideoTexture:()=>Dc,WebGL1Renderer:()=>Sl,WebGL3DRenderTarget:()=>on,WebGLArrayRenderTarget:()=>an,WebGLCubeRenderTarget:()=>Da,WebGLMultipleRenderTargets:()=>ln,WebGLRenderTarget:()=>rn,WebGLRenderer:()=>El,WebGLUtils:()=>pl,WireframeGeometry:()=>sh,WrapAroundEnding:()=>Ct,ZeroCurvatureEnding:()=>_t,ZeroFactor:()=>I,ZeroSlopeEnding:()=>Tt,ZeroStencilOp:()=>Qt,_SRGBAFormat:()=>vr,sRGBEncoding:()=>Dt});const n="152",i={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},a={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},s=0,o=1,l=2,c=3,u=0,h=1,d=2,p=3,f=0,m=1,g=2,v=2,A=0,y=1,x=2,b=3,w=4,E=5,S=100,M=101,_=102,T=103,C=104,I=200,B=201,R=202,P=203,F=204,L=205,D=206,U=207,N=208,k=209,O=210,G=0,z=1,V=2,H=3,Q=4,j=5,W=6,X=7,Y=0,q=1,K=2,J=0,Z=1,$=2,ee=3,te=4,re=5,ne=300,ie=301,ae=302,se=303,oe=304,le=306,ce=1e3,ue=1001,he=1002,de=1003,pe=1004,fe=1004,me=1005,ge=1005,ve=1006,Ae=1007,ye=1007,xe=1008,be=1008,we=1009,Ee=1010,Se=1011,Me=1012,_e=1013,Te=1014,Ce=1015,Ie=1016,Be=1017,Re=1018,Pe=1020,Fe=1021,Le=1023,De=1024,Ue=1025,Ne=1026,ke=1027,Oe=1028,Ge=1029,ze=1030,Ve=1031,He=1033,Qe=33776,je=33777,We=33778,Xe=33779,Ye=35840,qe=35841,Ke=35842,Je=35843,Ze=36196,$e=37492,et=37496,tt=37808,rt=37809,nt=37810,it=37811,at=37812,st=37813,ot=37814,lt=37815,ct=37816,ut=37817,ht=37818,dt=37819,pt=37820,ft=37821,mt=36492,gt=36283,vt=36284,At=36285,yt=36286,xt=2200,bt=2201,wt=2202,Et=2300,St=2301,Mt=2302,_t=2400,Tt=2401,Ct=2402,It=2500,Bt=2501,Rt=0,Pt=1,Ft=2,Lt=3e3,Dt=3001,Ut=3200,Nt=3201,kt=0,Ot=1,Gt="",zt="srgb",Vt="srgb-linear",Ht="display-p3",Qt=0,jt=7680,Wt=7681,Xt=7682,Yt=7683,qt=34055,Kt=34056,Jt=5386,Zt=512,$t=513,er=514,tr=515,rr=516,nr=517,ir=518,ar=519,sr=35044,or=35048,lr=35040,cr=35045,ur=35049,hr=35041,dr=35046,pr=35050,fr=35042,mr="100",gr="300 es",vr=1035;class Ar{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const r=this._listeners[e];if(void 0!==r){const e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const r=t.slice(0);for(let t=0,n=r.length;t<n;t++)r[t].call(this,e);e.target=null}}}const yr=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let xr=1234567;const br=Math.PI/180,wr=180/Math.PI;function Er(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,r=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(yr[255&e]+yr[e>>8&255]+yr[e>>16&255]+yr[e>>24&255]+"-"+yr[255&t]+yr[t>>8&255]+"-"+yr[t>>16&15|64]+yr[t>>24&255]+"-"+yr[63&r|128]+yr[r>>8&255]+"-"+yr[r>>16&255]+yr[r>>24&255]+yr[255&n]+yr[n>>8&255]+yr[n>>16&255]+yr[n>>24&255]).toLowerCase()}function Sr(e,t,r){return Math.max(t,Math.min(r,e))}function Mr(e,t){return(e%t+t)%t}function _r(e,t,r){return(1-r)*e+r*t}function Tr(e){return 0==(e&e-1)&&0!==e}function Cr(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function Ir(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function Br(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function Rr(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}const Pr={DEG2RAD:br,RAD2DEG:wr,generateUUID:Er,clamp:Sr,euclideanModulo:Mr,mapLinear:function(e,t,r,n,i){return n+(e-t)*(i-n)/(r-t)},inverseLerp:function(e,t,r){return e!==t?(r-e)/(t-e):0},lerp:_r,damp:function(e,t,r,n){return _r(e,t,1-Math.exp(-r*n))},pingpong:function(e,t=1){return t-Math.abs(Mr(e,2*t)-t)},smoothstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*(3-2*e)},smootherstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(xr=e);let t=xr+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*br},radToDeg:function(e){return e*wr},isPowerOfTwo:Tr,ceilPowerOfTwo:Cr,floorPowerOfTwo:Ir,setQuaternionFromProperEuler:function(e,t,r,n,i){const a=Math.cos,s=Math.sin,o=a(r/2),l=s(r/2),c=a((t+n)/2),u=s((t+n)/2),h=a((t-n)/2),d=s((t-n)/2),p=a((n-t)/2),f=s((n-t)/2);switch(i){case"XYX":e.set(o*u,l*h,l*d,o*c);break;case"YZY":e.set(l*d,o*u,l*h,o*c);break;case"ZXZ":e.set(l*h,l*d,o*u,o*c);break;case"XZX":e.set(o*u,l*f,l*p,o*c);break;case"YXY":e.set(l*p,o*u,l*f,o*c);break;case"ZYZ":e.set(l*f,l*p,o*u,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:Rr,denormalize:Br};class Fr{constructor(e=0,t=0){Fr.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,n=e.elements;return this.x=n[0]*t+n[3]*r+n[6],this.y=n[1]*t+n[4]*r+n[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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(Sr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),n=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*r-a*n+e.x,this.y=i*n+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Lr{constructor(){Lr.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,r,n,i,a,s,o,l){const c=this.elements;return c[0]=e,c[1]=n,c[2]=s,c[3]=t,c[4]=i,c[5]=o,c[6]=r,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.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 r=e.elements,n=t.elements,i=this.elements,a=r[0],s=r[3],o=r[6],l=r[1],c=r[4],u=r[7],h=r[2],d=r[5],p=r[8],f=n[0],m=n[3],g=n[6],v=n[1],A=n[4],y=n[7],x=n[2],b=n[5],w=n[8];return i[0]=a*f+s*v+o*x,i[3]=a*m+s*A+o*b,i[6]=a*g+s*y+o*w,i[1]=l*f+c*v+u*x,i[4]=l*m+c*A+u*b,i[7]=l*g+c*y+u*w,i[2]=h*f+d*v+p*x,i[5]=h*m+d*A+p*b,i[8]=h*g+d*y+p*w,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],r=e[1],n=e[2],i=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8];return t*a*c-t*s*l-r*i*c+r*s*o+n*i*l-n*a*o}invert(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],u=c*a-s*l,h=s*o-c*i,d=l*i-a*o,p=t*u+r*h+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=u*f,e[1]=(n*l-c*r)*f,e[2]=(s*r-n*a)*f,e[3]=h*f,e[4]=(c*t-n*o)*f,e[5]=(n*i-s*t)*f,e[6]=d*f,e[7]=(r*o-l*t)*f,e[8]=(a*t-r*i)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,n,i,a,s){const o=Math.cos(i),l=Math.sin(i);return this.set(r*o,r*l,-r*(o*a+l*s)+a+e,-n*l,n*o,-n*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(Dr.makeScale(e,t)),this}rotate(e){return this.premultiply(Dr.makeRotation(-e)),this}translate(e,t){return this.premultiply(Dr.makeTranslation(e,t)),this}makeTranslation(e,t){return this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,r=e.elements;for(let n=0;n<9;n++)if(t[n]!==r[n])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const Dr=new Lr;function Ur(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}const Nr={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function kr(e,t){return new Nr[e](t)}function Or(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}const Gr={};function zr(e){e in Gr||(Gr[e]=!0,console.warn(e))}function Vr(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Hr(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}const Qr=(new Lr).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),jr=(new Lr).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);const Wr={[Vt]:e=>e,[zt]:e=>e.convertSRGBToLinear(),[Ht]:function(e){return e.convertSRGBToLinear().applyMatrix3(jr)}},Xr={[Vt]:e=>e,[zt]:e=>e.convertLinearToSRGB(),[Ht]:function(e){return e.applyMatrix3(Qr).convertLinearToSRGB()}},Yr={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(e){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!e},get workingColorSpace(){return Vt},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,r){if(!1===this.enabled||t===r||!t||!r)return e;const n=Wr[t],i=Xr[r];if(void 0===n||void 0===i)throw new Error(`Unsupported color space conversion, "${t}" to "${r}".`);return i(n(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}};let qr;class Kr{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===qr&&(qr=Or("canvas")),qr.width=e.width,qr.height=e.height;const r=qr.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=qr}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=Or("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const n=r.getImageData(0,0,e.width,e.height),i=n.data;for(let e=0;e<i.length;e++)i[e]=255*Vr(i[e]/255);return r.putImageData(n,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*Vr(t[e]/255)):t[e]=Vr(t[e]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}class Jr{constructor(e=null){this.isSource=!0,this.uuid=Er(),this.data=e,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const r={uuid:this.uuid,url:""},n=this.data;if(null!==n){let e;if(Array.isArray(n)){e=[];for(let t=0,r=n.length;t<r;t++)n[t].isDataTexture?e.push(Zr(n[t].image)):e.push(Zr(n[t]))}else e=Zr(n);r.url=e}return t||(e.images[this.uuid]=r),r}}function Zr(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Kr.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let $r=0;class en extends Ar{constructor(e=en.DEFAULT_IMAGE,t=en.DEFAULT_MAPPING,r=ue,n=ue,i=ve,a=xe,s=Le,o=we,l=en.DEFAULT_ANISOTROPY,c=Gt){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:$r++}),this.uuid=Er(),this.name="",this.source=new Jr(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=r,this.wrapT=n,this.magFilter=i,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new Fr(0,0),this.repeat=new Fr(1,1),this.center=new Fr(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Lr,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,"string"==typeof c?this.colorSpace=c:(zr("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=c===Dt?zt:Gt),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const r={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ne)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ce:e.x=e.x-Math.floor(e.x);break;case ue:e.x=e.x<0?0:1;break;case he: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 ce:e.y=e.y-Math.floor(e.y);break;case ue:e.y=e.y<0?0:1;break;case he:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return zr("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===zt?Dt:Lt}set encoding(e){zr("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Dt?zt:Gt}}en.DEFAULT_IMAGE=null,en.DEFAULT_MAPPING=ne,en.DEFAULT_ANISOTROPY=1;class tn{constructor(e=0,t=0,r=0,n=1){tn.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=n}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,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,n=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*r+a[8]*n+a[12]*i,this.y=a[1]*t+a[5]*r+a[9]*n+a[13]*i,this.z=a[2]*t+a[6]*r+a[10]*n+a[14]*i,this.w=a[3]*t+a[7]*r+a[11]*n+a[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,n,i;const a=.01,s=.1,o=e.elements,l=o[0],c=o[4],u=o[8],h=o[1],d=o[5],p=o[9],f=o[2],m=o[6],g=o[10];if(Math.abs(c-h)<a&&Math.abs(u-f)<a&&Math.abs(p-m)<a){if(Math.abs(c+h)<s&&Math.abs(u+f)<s&&Math.abs(p+m)<s&&Math.abs(l+d+g-3)<s)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,o=(d+1)/2,v=(g+1)/2,A=(c+h)/4,y=(u+f)/4,x=(p+m)/4;return e>o&&e>v?e<a?(r=0,n=.707106781,i=.707106781):(r=Math.sqrt(e),n=A/r,i=y/r):o>v?o<a?(r=.707106781,n=0,i=.707106781):(n=Math.sqrt(o),r=A/n,i=x/n):v<a?(r=.707106781,n=.707106781,i=0):(i=Math.sqrt(v),r=y/i,n=x/i),this.set(r,n,i,t),this}let v=Math.sqrt((m-p)*(m-p)+(u-f)*(u-f)+(h-c)*(h-c));return Math.abs(v)<.001&&(v=1),this.x=(m-p)/v,this.y=(u-f)/v,this.z=(h-c)/v,this.w=Math.acos((l+d+g-1)/2),this}min(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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class rn extends Ar{constructor(e=1,t=1,r={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new tn(0,0,e,t),this.scissorTest=!1,this.viewport=new tn(0,0,e,t);const n={width:e,height:t,depth:1};void 0!==r.encoding&&(zr("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),r.colorSpace=r.encoding===Dt?zt:Gt),this.texture=new en(n,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==r.generateMipmaps&&r.generateMipmaps,this.texture.internalFormat=void 0!==r.internalFormat?r.internalFormat:null,this.texture.minFilter=void 0!==r.minFilter?r.minFilter:ve,this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0!==r.stencilBuffer&&r.stencilBuffer,this.depthTexture=void 0!==r.depthTexture?r.depthTexture:null,this.samples=void 0!==r.samples?r.samples:0}setSize(e,t,r=1){this.width===e&&this.height===t&&this.depth===r||(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Jr(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class nn extends en{constructor(e=null,t=1,r=1,n=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:n},this.magFilter=de,this.minFilter=de,this.wrapR=ue,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class an extends rn{constructor(e=1,t=1,r=1){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new nn(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class sn extends en{constructor(e=null,t=1,r=1,n=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:n},this.magFilter=de,this.minFilter=de,this.wrapR=ue,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class on extends rn{constructor(e=1,t=1,r=1){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new sn(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class ln extends rn{constructor(e=1,t=1,r=1,n={}){super(e,t,n),this.isWebGLMultipleRenderTargets=!0;const i=this.texture;this.texture=[];for(let a=0;a<r;a++)this.texture[a]=i.clone(),this.texture[a].isRenderTargetTexture=!0}setSize(e,t,r=1){if(this.width!==e||this.height!==t||this.depth!==r){this.width=e,this.height=t,this.depth=r;for(let n=0,i=this.texture.length;n<i;n++)this.texture[n].image.width=e,this.texture[n].image.height=t,this.texture[n].image.depth=r;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let t=0,r=e.texture.length;t<r;t++)this.texture[t]=e.texture[t].clone(),this.texture[t].isRenderTargetTexture=!0;return this}}class cn{constructor(e=0,t=0,r=0,n=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=r,this._w=n}static slerpFlat(e,t,r,n,i,a,s){let o=r[n+0],l=r[n+1],c=r[n+2],u=r[n+3];const h=i[a+0],d=i[a+1],p=i[a+2],f=i[a+3];if(0===s)return e[t+0]=o,e[t+1]=l,e[t+2]=c,void(e[t+3]=u);if(1===s)return e[t+0]=h,e[t+1]=d,e[t+2]=p,void(e[t+3]=f);if(u!==f||o!==h||l!==d||c!==p){let e=1-s;const t=o*h+l*d+c*p+u*f,r=t>=0?1:-1,n=1-t*t;if(n>Number.EPSILON){const i=Math.sqrt(n),a=Math.atan2(i,t*r);e=Math.sin(e*a)/i,s=Math.sin(s*a)/i}const i=s*r;if(o=o*e+h*i,l=l*e+d*i,c=c*e+p*i,u=u*e+f*i,e===1-s){const e=1/Math.sqrt(o*o+l*l+c*c+u*u);o*=e,l*=e,c*=e,u*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,r,n,i,a){const s=r[n],o=r[n+1],l=r[n+2],c=r[n+3],u=i[a],h=i[a+1],d=i[a+2],p=i[a+3];return e[t]=s*p+c*u+o*d-l*h,e[t+1]=o*p+c*h+l*u-s*d,e[t+2]=l*p+c*d+s*h-o*u,e[t+3]=c*p-s*u-o*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,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){const r=e._x,n=e._y,i=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(r/2),c=s(n/2),u=s(i/2),h=o(r/2),d=o(n/2),p=o(i/2);switch(a){case"XYZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"YXZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"ZXY":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"ZYX":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"YZX":this._x=h*c*u+l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u-h*d*p;break;case"XZY":this._x=h*c*u-l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u+h*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],n=t[4],i=t[8],a=t[1],s=t[5],o=t[9],l=t[2],c=t[6],u=t[10],h=r+s+u;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-o)*e,this._y=(i-l)*e,this._z=(a-n)*e}else if(r>s&&r>u){const e=2*Math.sqrt(1+r-s-u);this._w=(c-o)/e,this._x=.25*e,this._y=(n+a)/e,this._z=(i+l)/e}else if(s>u){const e=2*Math.sqrt(1+s-r-u);this._w=(i-l)/e,this._x=(n+a)/e,this._y=.25*e,this._z=(o+c)/e}else{const e=2*Math.sqrt(1+u-r-s);this._w=(a-n)/e,this._x=(i+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return r<Number.EPSILON?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(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=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Sr(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(0===r)return this;const n=Math.min(1,t/r);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const r=e._x,n=e._y,i=e._z,a=e._w,s=t._x,o=t._y,l=t._z,c=t._w;return this._x=r*c+a*s+n*l-i*o,this._y=n*c+a*o+i*s-r*l,this._z=i*c+a*l+r*o-n*s,this._w=a*c-r*s-n*o-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const r=this._x,n=this._y,i=this._z,a=this._w;let s=a*e._w+r*e._x+n*e._y+i*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=r,this._y=n,this._z=i,this;const o=1-s*s;if(o<=Number.EPSILON){const e=1-t;return this._w=e*a+t*this._w,this._x=e*r+t*this._x,this._y=e*n+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,s),u=Math.sin((1-t)*c)/l,h=Math.sin(t*c)/l;return this._w=a*u+this._w*h,this._x=r*u+this._x*h,this._y=n*u+this._y*h,this._z=i*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=Math.random(),t=Math.sqrt(1-e),r=Math.sqrt(e),n=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(t*Math.cos(n),r*Math.sin(i),r*Math.cos(i),t*Math.sin(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class un{constructor(e=0,t=0,r=0){un.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return void 0===r&&(r=this.z),this.x=e,this.y=t,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(dn.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(dn.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,n=this.z,i=e.elements,a=1/(i[3]*t+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])*a,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])*a,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])*a,this}applyQuaternion(e){const t=this.x,r=this.y,n=this.z,i=e.x,a=e.y,s=e.z,o=e.w,l=o*t+a*n-s*r,c=o*r+s*t-i*n,u=o*n+i*r-a*t,h=-i*t-a*r-s*n;return this.x=l*o+h*-i+c*-s-u*-a,this.y=c*o+h*-a+u*-i-l*-s,this.z=u*o+h*-s+l*-a-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,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,n=e.y,i=e.z,a=t.x,s=t.y,o=t.z;return this.x=n*o-i*s,this.y=i*a-r*o,this.z=r*s-n*a,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return hn.copy(this).projectOnVector(e),this.sub(hn)}reflect(e){return this.sub(hn.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 r=this.dot(e)/t;return Math.acos(Sr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n}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,r){const n=Math.sin(t)*e;return this.x=n*Math.sin(r),this.y=Math.cos(t)*e,this.z=n*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,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(),r=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const hn=new un,dn=new cn;class pn{constructor(e=new un(1/0,1/0,1/0),t=new un(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t+=3)this.expandByPoint(mn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,r=e.count;t<r;t++)this.expandByPoint(mn.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=mn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){if(e.updateWorldMatrix(!1,!1),void 0!==e.boundingBox)null===e.boundingBox&&e.computeBoundingBox(),gn.copy(e.boundingBox),gn.applyMatrix4(e.matrixWorld),this.union(gn);else{const r=e.geometry;if(void 0!==r)if(t&&void 0!==r.attributes&&void 0!==r.attributes.position){const t=r.attributes.position;for(let r=0,n=t.count;r<n;r++)mn.fromBufferAttribute(t,r).applyMatrix4(e.matrixWorld),this.expandByPoint(mn)}else null===r.boundingBox&&r.computeBoundingBox(),gn.copy(r.boundingBox),gn.applyMatrix4(e.matrixWorld),this.union(gn)}const r=e.children;for(let n=0,i=r.length;n<i;n++)this.expandByObject(r[n],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,mn),mn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(En),Sn.subVectors(this.max,En),vn.subVectors(e.a,En),An.subVectors(e.b,En),yn.subVectors(e.c,En),xn.subVectors(An,vn),bn.subVectors(yn,An),wn.subVectors(vn,yn);let t=[0,-xn.z,xn.y,0,-bn.z,bn.y,0,-wn.z,wn.y,xn.z,0,-xn.x,bn.z,0,-bn.x,wn.z,0,-wn.x,-xn.y,xn.x,0,-bn.y,bn.x,0,-wn.y,wn.x,0];return!!Tn(t,vn,An,yn,Sn)&&(t=[1,0,0,0,1,0,0,0,1],!!Tn(t,vn,An,yn,Sn)&&(Mn.crossVectors(xn,bn),t=[Mn.x,Mn.y,Mn.z],Tn(t,vn,An,yn,Sn)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,mn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(mn).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()||(fn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),fn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),fn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),fn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),fn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),fn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),fn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),fn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(fn)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const fn=[new un,new un,new un,new un,new un,new un,new un,new un],mn=new un,gn=new pn,vn=new un,An=new un,yn=new un,xn=new un,bn=new un,wn=new un,En=new un,Sn=new un,Mn=new un,_n=new un;function Tn(e,t,r,n,i){for(let a=0,s=e.length-3;a<=s;a+=3){_n.fromArray(e,a);const s=i.x*Math.abs(_n.x)+i.y*Math.abs(_n.y)+i.z*Math.abs(_n.z),o=t.dot(_n),l=r.dot(_n),c=n.dot(_n);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>s)return!1}return!0}const Cn=new pn,In=new un,Bn=new un;class Rn{constructor(e=new un,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;void 0!==t?r.copy(t):Cn.setFromPoints(e).getCenter(r);let n=0;for(let i=0,a=e.length;i<a;i++)n=Math.max(n,r.distanceToSquared(e[i]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const r=this.center.distanceToSquared(e);return t.copy(e),r>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;In.subVectors(e,this.center);const t=In.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),r=.5*(e-this.radius);this.center.addScaledVector(In,r/e),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(Bn.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(In.copy(e.center).add(Bn)),this.expandByPoint(In.copy(e.center).sub(Bn))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Pn=new un,Fn=new un,Ln=new un,Dn=new un,Un=new un,Nn=new un,kn=new un;class On{constructor(e=new un,t=new un(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Pn)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Pn.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Pn.copy(this.origin).addScaledVector(this.direction,t),Pn.distanceToSquared(e))}distanceSqToSegment(e,t,r,n){Fn.copy(e).add(t).multiplyScalar(.5),Ln.copy(t).sub(e).normalize(),Dn.copy(this.origin).sub(Fn);const i=.5*e.distanceTo(t),a=-this.direction.dot(Ln),s=Dn.dot(this.direction),o=-Dn.dot(Ln),l=Dn.lengthSq(),c=Math.abs(1-a*a);let u,h,d,p;if(c>0)if(u=a*o-s,h=a*s-o,p=i*c,u>=0)if(h>=-p)if(h<=p){const e=1/c;u*=e,h*=e,d=u*(u+a*h+2*s)+h*(a*u+h+2*o)+l}else h=i,u=Math.max(0,-(a*h+s)),d=-u*u+h*(h+2*o)+l;else h=-i,u=Math.max(0,-(a*h+s)),d=-u*u+h*(h+2*o)+l;else h<=-p?(u=Math.max(0,-(-a*i+s)),h=u>0?-i:Math.min(Math.max(-i,-o),i),d=-u*u+h*(h+2*o)+l):h<=p?(u=0,h=Math.min(Math.max(-i,-o),i),d=h*(h+2*o)+l):(u=Math.max(0,-(a*i+s)),h=u>0?i:Math.min(Math.max(-i,-o),i),d=-u*u+h*(h+2*o)+l);else h=a>0?-i:i,u=Math.max(0,-(a*h+s)),d=-u*u+h*(h+2*o)+l;return r&&r.copy(this.origin).addScaledVector(this.direction,u),n&&n.copy(Fn).addScaledVector(Ln,h),d}intersectSphere(e,t){Pn.subVectors(e.center,this.origin);const r=Pn.dot(this.direction),n=Pn.dot(Pn)-r*r,i=e.radius*e.radius;if(n>i)return null;const a=Math.sqrt(i-n),s=r-a,o=r+a;return o<0?null:s<0?this.at(o,t):this.at(s,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 r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return null===r?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,n,i,a,s,o;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(r=(e.min.x-h.x)*l,n=(e.max.x-h.x)*l):(r=(e.max.x-h.x)*l,n=(e.min.x-h.x)*l),c>=0?(i=(e.min.y-h.y)*c,a=(e.max.y-h.y)*c):(i=(e.max.y-h.y)*c,a=(e.min.y-h.y)*c),r>a||i>n?null:((i>r||isNaN(r))&&(r=i),(a<n||isNaN(n))&&(n=a),u>=0?(s=(e.min.z-h.z)*u,o=(e.max.z-h.z)*u):(s=(e.max.z-h.z)*u,o=(e.min.z-h.z)*u),r>o||s>n?null:((s>r||r!=r)&&(r=s),(o<n||n!=n)&&(n=o),n<0?null:this.at(r>=0?r:n,t)))}intersectsBox(e){return null!==this.intersectBox(e,Pn)}intersectTriangle(e,t,r,n,i){Un.subVectors(t,e),Nn.subVectors(r,e),kn.crossVectors(Un,Nn);let a,s=this.direction.dot(kn);if(s>0){if(n)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}Dn.subVectors(this.origin,e);const o=a*this.direction.dot(Nn.crossVectors(Dn,Nn));if(o<0)return null;const l=a*this.direction.dot(Un.cross(Dn));if(l<0)return null;if(o+l>s)return null;const c=-a*Dn.dot(kn);return c<0?null:this.at(c/s,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Gn{constructor(){Gn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,r,n,i,a,s,o,l,c,u,h,d,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=n,g[1]=i,g[5]=a,g[9]=s,g[13]=o,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Gn).fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,n=1/zn.setFromMatrixColumn(e,0).length(),i=1/zn.setFromMatrixColumn(e,1).length(),a=1/zn.setFromMatrixColumn(e,2).length();return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=0,t[4]=r[4]*i,t[5]=r[5]*i,t[6]=r[6]*i,t[7]=0,t[8]=r[8]*a,t[9]=r[9]*a,t[10]=r[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,n=e.y,i=e.z,a=Math.cos(r),s=Math.sin(r),o=Math.cos(n),l=Math.sin(n),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=a*c,r=a*u,n=s*c,i=s*u;t[0]=o*c,t[4]=-o*u,t[8]=l,t[1]=r+n*l,t[5]=e-i*l,t[9]=-s*o,t[2]=i-e*l,t[6]=n+r*l,t[10]=a*o}else if("YXZ"===e.order){const e=o*c,r=o*u,n=l*c,i=l*u;t[0]=e+i*s,t[4]=n*s-r,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-s,t[2]=r*s-n,t[6]=i+e*s,t[10]=a*o}else if("ZXY"===e.order){const e=o*c,r=o*u,n=l*c,i=l*u;t[0]=e-i*s,t[4]=-a*u,t[8]=n+r*s,t[1]=r+n*s,t[5]=a*c,t[9]=i-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){const e=a*c,r=a*u,n=s*c,i=s*u;t[0]=o*c,t[4]=n*l-r,t[8]=e*l+i,t[1]=o*u,t[5]=i*l+e,t[9]=r*l-n,t[2]=-l,t[6]=s*o,t[10]=a*o}else if("YZX"===e.order){const e=a*o,r=a*l,n=s*o,i=s*l;t[0]=o*c,t[4]=i-e*u,t[8]=n*u+r,t[1]=u,t[5]=a*c,t[9]=-s*c,t[2]=-l*c,t[6]=r*u+n,t[10]=e-i*u}else if("XZY"===e.order){const e=a*o,r=a*l,n=s*o,i=s*l;t[0]=o*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=a*c,t[9]=r*u-n,t[2]=n*u-r,t[6]=s*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(Hn,e,Qn)}lookAt(e,t,r){const n=this.elements;return Xn.subVectors(e,t),0===Xn.lengthSq()&&(Xn.z=1),Xn.normalize(),jn.crossVectors(r,Xn),0===jn.lengthSq()&&(1===Math.abs(r.z)?Xn.x+=1e-4:Xn.z+=1e-4,Xn.normalize(),jn.crossVectors(r,Xn)),jn.normalize(),Wn.crossVectors(Xn,jn),n[0]=jn.x,n[4]=Wn.x,n[8]=Xn.x,n[1]=jn.y,n[5]=Wn.y,n[9]=Xn.y,n[2]=jn.z,n[6]=Wn.z,n[10]=Xn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,n=t.elements,i=this.elements,a=r[0],s=r[4],o=r[8],l=r[12],c=r[1],u=r[5],h=r[9],d=r[13],p=r[2],f=r[6],m=r[10],g=r[14],v=r[3],A=r[7],y=r[11],x=r[15],b=n[0],w=n[4],E=n[8],S=n[12],M=n[1],_=n[5],T=n[9],C=n[13],I=n[2],B=n[6],R=n[10],P=n[14],F=n[3],L=n[7],D=n[11],U=n[15];return i[0]=a*b+s*M+o*I+l*F,i[4]=a*w+s*_+o*B+l*L,i[8]=a*E+s*T+o*R+l*D,i[12]=a*S+s*C+o*P+l*U,i[1]=c*b+u*M+h*I+d*F,i[5]=c*w+u*_+h*B+d*L,i[9]=c*E+u*T+h*R+d*D,i[13]=c*S+u*C+h*P+d*U,i[2]=p*b+f*M+m*I+g*F,i[6]=p*w+f*_+m*B+g*L,i[10]=p*E+f*T+m*R+g*D,i[14]=p*S+f*C+m*P+g*U,i[3]=v*b+A*M+y*I+x*F,i[7]=v*w+A*_+y*B+x*L,i[11]=v*E+A*T+y*R+x*D,i[15]=v*S+A*C+y*P+x*U,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[4],n=e[8],i=e[12],a=e[1],s=e[5],o=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+i*o*u-n*l*u-i*s*h+r*l*h+n*s*d-r*o*d)+e[7]*(+t*o*d-t*l*h+i*a*h-n*a*d+n*l*c-i*o*c)+e[11]*(+t*l*u-t*s*d-i*a*u+r*a*d+i*s*c-r*l*c)+e[15]*(-n*s*c-t*o*u+t*s*h+n*a*u-r*a*h+r*o*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,r){const n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=u*m*l-f*h*l+f*o*d-s*m*d-u*o*g+s*h*g,A=p*h*l-c*m*l-p*o*d+a*m*d+c*o*g-a*h*g,y=c*f*l-p*u*l+p*s*d-a*f*d-c*s*g+a*u*g,x=p*u*o-c*f*o-p*s*h+a*f*h+c*s*m-a*u*m,b=t*v+r*A+n*y+i*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/b;return e[0]=v*w,e[1]=(f*h*i-u*m*i-f*n*d+r*m*d+u*n*g-r*h*g)*w,e[2]=(s*m*i-f*o*i+f*n*l-r*m*l-s*n*g+r*o*g)*w,e[3]=(u*o*i-s*h*i-u*n*l+r*h*l+s*n*d-r*o*d)*w,e[4]=A*w,e[5]=(c*m*i-p*h*i+p*n*d-t*m*d-c*n*g+t*h*g)*w,e[6]=(p*o*i-a*m*i-p*n*l+t*m*l+a*n*g-t*o*g)*w,e[7]=(a*h*i-c*o*i+c*n*l-t*h*l-a*n*d+t*o*d)*w,e[8]=y*w,e[9]=(p*u*i-c*f*i-p*r*d+t*f*d+c*r*g-t*u*g)*w,e[10]=(a*f*i-p*s*i+p*r*l-t*f*l-a*r*g+t*s*g)*w,e[11]=(c*s*i-a*u*i-c*r*l+t*u*l+a*r*d-t*s*d)*w,e[12]=x*w,e[13]=(c*f*n-p*u*n+p*r*h-t*f*h-c*r*m+t*u*m)*w,e[14]=(p*s*n-a*f*n-p*r*o+t*f*o+a*r*m-t*s*m)*w,e[15]=(a*u*n-c*s*n+c*r*o-t*u*o-a*r*h+t*s*h)*w,this}scale(e){const t=this.elements,r=e.x,n=e.y,i=e.z;return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,n))}makeTranslation(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),n=Math.sin(t),i=1-r,a=e.x,s=e.y,o=e.z,l=i*a,c=i*s;return this.set(l*a+r,l*s-n*o,l*o+n*s,0,l*s+n*o,c*s+r,c*o-n*a,0,l*o-n*s,c*o+n*a,i*o*o+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,n,i,a){return this.set(1,r,i,0,e,1,a,0,t,n,1,0,0,0,0,1),this}compose(e,t,r){const n=this.elements,i=t._x,a=t._y,s=t._z,o=t._w,l=i+i,c=a+a,u=s+s,h=i*l,d=i*c,p=i*u,f=a*c,m=a*u,g=s*u,v=o*l,A=o*c,y=o*u,x=r.x,b=r.y,w=r.z;return n[0]=(1-(f+g))*x,n[1]=(d+y)*x,n[2]=(p-A)*x,n[3]=0,n[4]=(d-y)*b,n[5]=(1-(h+g))*b,n[6]=(m+v)*b,n[7]=0,n[8]=(p+A)*w,n[9]=(m-v)*w,n[10]=(1-(h+f))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,r){const n=this.elements;let i=zn.set(n[0],n[1],n[2]).length();const a=zn.set(n[4],n[5],n[6]).length(),s=zn.set(n[8],n[9],n[10]).length();this.determinant()<0&&(i=-i),e.x=n[12],e.y=n[13],e.z=n[14],Vn.copy(this);const o=1/i,l=1/a,c=1/s;return Vn.elements[0]*=o,Vn.elements[1]*=o,Vn.elements[2]*=o,Vn.elements[4]*=l,Vn.elements[5]*=l,Vn.elements[6]*=l,Vn.elements[8]*=c,Vn.elements[9]*=c,Vn.elements[10]*=c,t.setFromRotationMatrix(Vn),r.x=i,r.y=a,r.z=s,this}makePerspective(e,t,r,n,i,a){const s=this.elements,o=2*i/(t-e),l=2*i/(r-n),c=(t+e)/(t-e),u=(r+n)/(r-n),h=-(a+i)/(a-i),d=-2*a*i/(a-i);return s[0]=o,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=u,s[13]=0,s[2]=0,s[6]=0,s[10]=h,s[14]=d,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,t,r,n,i,a){const s=this.elements,o=1/(t-e),l=1/(r-n),c=1/(a-i),u=(t+e)*o,h=(r+n)*l,d=(a+i)*c;return s[0]=2*o,s[4]=0,s[8]=0,s[12]=-u,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-h,s[2]=0,s[6]=0,s[10]=-2*c,s[14]=-d,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let n=0;n<16;n++)if(t[n]!==r[n])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const zn=new un,Vn=new Gn,Hn=new un(0,0,0),Qn=new un(1,1,1),jn=new un,Wn=new un,Xn=new un,Yn=new Gn,qn=new cn;class Kn{constructor(e=0,t=0,r=0,n=Kn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=n}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,r,n=this._order){return this._x=e,this._y=t,this._z=r,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,r=!0){const n=e.elements,i=n[0],a=n[4],s=n[8],o=n[1],l=n[5],c=n[9],u=n[2],h=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(Sr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Sr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-u,i),this._z=0);break;case"ZXY":this._x=Math.asin(Sr(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,i));break;case"ZYX":this._y=Math.asin(-Sr(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(o,i)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(Sr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-Sr(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,i)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===r&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return Yn.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Yn,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return qn.setFromEuler(this),this.setFromQuaternion(qn,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Kn.DEFAULT_ORDER="XYZ";class Jn{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}isEnabled(e){return 0!=(this.mask&(1<<e|0))}}let Zn=0;const $n=new un,ei=new cn,ti=new Gn,ri=new un,ni=new un,ii=new un,ai=new cn,si=new un(1,0,0),oi=new un(0,1,0),li=new un(0,0,1),ci={type:"added"},ui={type:"removed"};class hi extends Ar{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Zn++}),this.uuid=Er(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=hi.DEFAULT_UP.clone();const e=new un,t=new Kn,r=new cn,n=new un(1,1,1);t._onChange((function(){r.setFromEuler(t,!1)})),r._onChange((function(){t.setFromQuaternion(r,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Gn},normalMatrix:{value:new Lr}}),this.matrix=new Gn,this.matrixWorld=new Gn,this.matrixAutoUpdate=hi.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=hi.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new Jn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return ei.setFromAxisAngle(e,t),this.quaternion.multiply(ei),this}rotateOnWorldAxis(e,t){return ei.setFromAxisAngle(e,t),this.quaternion.premultiply(ei),this}rotateX(e){return this.rotateOnAxis(si,e)}rotateY(e){return this.rotateOnAxis(oi,e)}rotateZ(e){return this.rotateOnAxis(li,e)}translateOnAxis(e,t){return $n.copy(e).applyQuaternion(this.quaternion),this.position.add($n.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(si,e)}translateY(e){return this.translateOnAxis(oi,e)}translateZ(e){return this.translateOnAxis(li,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ti.copy(this.matrixWorld).invert())}lookAt(e,t,r){e.isVector3?ri.copy(e):ri.set(e,t,r);const n=this.parent;this.updateWorldMatrix(!0,!1),ni.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ti.lookAt(ni,ri,this.up):ti.lookAt(ri,ni,this.up),this.quaternion.setFromRotationMatrix(ti),n&&(ti.extractRotation(n.matrixWorld),ei.setFromRotationMatrix(ti),this.quaternion.premultiply(ei.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(ci)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(ui)),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(ui)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),ti.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),ti.multiply(e.parent.matrixWorld)),e.applyMatrix4(ti),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let r=0,n=this.children.length;r<n;r++){const n=this.children[r].getObjectByProperty(e,t);if(void 0!==n)return n}}getObjectsByProperty(e,t){let r=[];this[e]===t&&r.push(this);for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n].getObjectsByProperty(e,t);i.length>0&&(r=r.concat(i))}return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ni,e,ii),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ni,ai,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let r=0,n=t.length;r<n;r++)t[r].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let r=0,n=t.length;r<n;r++)t[r].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let r=0,n=t.length;r<n;r++){const n=t[r];!0!==n.matrixWorldAutoUpdate&&!0!==e||n.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const r=this.parent;if(!0===e&&null!==r&&!0===r.matrixWorldAutoUpdate&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){const e=this.children;for(let t=0,r=e.length;t<r;t++){const r=e[t];!0===r.matrixWorldAutoUpdate&&r.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=void 0===e||"string"==typeof e,r={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const n={};function i(t,r){return void 0===t[r.uuid]&&(t[r.uuid]=r.toJSON(e)),r.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const r=t.shapes;if(Array.isArray(r))for(let t=0,n=r.length;t<n;t++){const n=r[t];i(e.shapes,n)}else i(e.shapes,r)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let r=0,n=this.material.length;r<n;r++)t.push(i(e.materials,this.material[r]));n.material=t}else n.material=i(e.materials,this.material);if(this.children.length>0){n.children=[];for(let t=0;t<this.children.length;t++)n.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(let t=0;t<this.animations.length;t++){const r=this.animations[t];n.animations.push(i(e.animations,r))}}if(t){const t=a(e.geometries),n=a(e.materials),i=a(e.textures),s=a(e.images),o=a(e.shapes),l=a(e.skeletons),c=a(e.animations),u=a(e.nodes);t.length>0&&(r.geometries=t),n.length>0&&(r.materials=n),i.length>0&&(r.textures=i),s.length>0&&(r.images=s),o.length>0&&(r.shapes=o),l.length>0&&(r.skeletons=l),c.length>0&&(r.animations=c),u.length>0&&(r.nodes=u)}return r.object=n,r;function a(e){const t=[];for(const r in e){const n=e[r];delete n.metadata,t.push(n)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let r=0;r<e.children.length;r++){const t=e.children[r];this.add(t.clone())}return this}}hi.DEFAULT_UP=new un(0,1,0),hi.DEFAULT_MATRIX_AUTO_UPDATE=!0,hi.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const di=new un,pi=new un,fi=new un,mi=new un,gi=new un,vi=new un,Ai=new un,yi=new un,xi=new un,bi=new un;let wi=!1;class Ei{constructor(e=new un,t=new un,r=new un){this.a=e,this.b=t,this.c=r}static getNormal(e,t,r,n){n.subVectors(r,t),di.subVectors(e,t),n.cross(di);const i=n.lengthSq();return i>0?n.multiplyScalar(1/Math.sqrt(i)):n.set(0,0,0)}static getBarycoord(e,t,r,n,i){di.subVectors(n,t),pi.subVectors(r,t),fi.subVectors(e,t);const a=di.dot(di),s=di.dot(pi),o=di.dot(fi),l=pi.dot(pi),c=pi.dot(fi),u=a*l-s*s;if(0===u)return i.set(-2,-1,-1);const h=1/u,d=(l*o-s*c)*h,p=(a*c-s*o)*h;return i.set(1-d-p,p,d)}static containsPoint(e,t,r,n){return this.getBarycoord(e,t,r,n,mi),mi.x>=0&&mi.y>=0&&mi.x+mi.y<=1}static getUV(e,t,r,n,i,a,s,o){return!1===wi&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),wi=!0),this.getInterpolation(e,t,r,n,i,a,s,o)}static getInterpolation(e,t,r,n,i,a,s,o){return this.getBarycoord(e,t,r,n,mi),o.setScalar(0),o.addScaledVector(i,mi.x),o.addScaledVector(a,mi.y),o.addScaledVector(s,mi.z),o}static isFrontFacing(e,t,r,n){return di.subVectors(r,t),pi.subVectors(e,t),di.cross(pi).dot(n)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,n){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,r,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,n),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 di.subVectors(this.c,this.b),pi.subVectors(this.a,this.b),.5*di.cross(pi).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ei.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ei.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,r,n,i){return!1===wi&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),wi=!0),Ei.getInterpolation(e,this.a,this.b,this.c,t,r,n,i)}getInterpolation(e,t,r,n,i){return Ei.getInterpolation(e,this.a,this.b,this.c,t,r,n,i)}containsPoint(e){return Ei.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ei.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,n=this.b,i=this.c;let a,s;gi.subVectors(n,r),vi.subVectors(i,r),yi.subVectors(e,r);const o=gi.dot(yi),l=vi.dot(yi);if(o<=0&&l<=0)return t.copy(r);xi.subVectors(e,n);const c=gi.dot(xi),u=vi.dot(xi);if(c>=0&&u<=c)return t.copy(n);const h=o*u-c*l;if(h<=0&&o>=0&&c<=0)return a=o/(o-c),t.copy(r).addScaledVector(gi,a);bi.subVectors(e,i);const d=gi.dot(bi),p=vi.dot(bi);if(p>=0&&d<=p)return t.copy(i);const f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return s=l/(l-p),t.copy(r).addScaledVector(vi,s);const m=c*p-d*u;if(m<=0&&u-c>=0&&d-p>=0)return Ai.subVectors(i,n),s=(u-c)/(u-c+(d-p)),t.copy(n).addScaledVector(Ai,s);const g=1/(m+f+h);return a=f*g,s=h*g,t.copy(r).addScaledVector(gi,a).addScaledVector(vi,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let Si=0;class Mi extends Ar{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Si++}),this.uuid=Er(),this.name="",this.type="Material",this.blending=y,this.side=f,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=F,this.blendDst=L,this.blendEquation=S,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=H,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=ar,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=jt,this.stencilZFail=jt,this.stencilZPass=jt,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const r=e[t];if(void 0===r){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const n=this[t];void 0!==n?n&&n.isColor?n.set(r):n&&n.isVector3&&r&&r.isVector3?n.copy(r):this[t]=r:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(e){const t=[];for(const r in e){const n=e[r];delete n.metadata,t.push(n)}return t}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),void 0!==this.sheen&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(r.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(r.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowSide&&(r.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==y&&(r.blending=this.blending),this.side!==f&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(r.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(r.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(r.flatShading=this.flatShading),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),!1===this.fog&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData),t){const t=n(e.textures),i=n(e.images);t.length>0&&(r.textures=t),i.length>0&&(r.images=i)}return r}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.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 r=null;if(null!==t){const e=t.length;r=new Array(e);for(let n=0;n!==e;++n)r[n]=t[n].clone()}return this.clippingPlanes=r,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.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}const _i={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},Ti={h:0,s:0,l:0},Ci={h:0,s:0,l:0};function Ii(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+6*(t-e)*(2/3-r):e}class Bi{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===t&&void 0===r?this.set(e):this.setRGB(e,t,r)}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,t=zt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,Yr.toWorkingColorSpace(this,t),this}setRGB(e,t,r,n=Yr.workingColorSpace){return this.r=e,this.g=t,this.b=r,Yr.toWorkingColorSpace(this,n),this}setHSL(e,t,r,n=Yr.workingColorSpace){if(e=Mr(e,1),t=Sr(t,0,1),r=Sr(r,0,1),0===t)this.r=this.g=this.b=r;else{const n=r<=.5?r*(1+t):r+t-r*t,i=2*r-n;this.r=Ii(i,n,e+1/3),this.g=Ii(i,n,e),this.b=Ii(i,n,e-1/3)}return Yr.toWorkingColorSpace(this,n),this}setStyle(e,t=zt){function r(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const a=n[1],s=n[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=n[1],i=r.length;if(3===i)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(6===i)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=zt){const r=_i[e.toLowerCase()];return void 0!==r?this.setHex(r,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Vr(e.r),this.g=Vr(e.g),this.b=Vr(e.b),this}copyLinearToSRGB(e){return this.r=Hr(e.r),this.g=Hr(e.g),this.b=Hr(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=zt){return Yr.fromWorkingColorSpace(Ri.copy(this),e),65536*Math.round(Sr(255*Ri.r,0,255))+256*Math.round(Sr(255*Ri.g,0,255))+Math.round(Sr(255*Ri.b,0,255))}getHexString(e=zt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Yr.workingColorSpace){Yr.fromWorkingColorSpace(Ri.copy(this),t);const r=Ri.r,n=Ri.g,i=Ri.b,a=Math.max(r,n,i),s=Math.min(r,n,i);let o,l;const c=(s+a)/2;if(s===a)o=0,l=0;else{const e=a-s;switch(l=c<=.5?e/(a+s):e/(2-a-s),a){case r:o=(n-i)/e+(n<i?6:0);break;case n:o=(i-r)/e+2;break;case i:o=(r-n)/e+4}o/=6}return e.h=o,e.s=l,e.l=c,e}getRGB(e,t=Yr.workingColorSpace){return Yr.fromWorkingColorSpace(Ri.copy(this),t),e.r=Ri.r,e.g=Ri.g,e.b=Ri.b,e}getStyle(e=zt){Yr.fromWorkingColorSpace(Ri.copy(this),e);const t=Ri.r,r=Ri.g,n=Ri.b;return e!==zt?`color(${e} ${t.toFixed(3)} ${r.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*r)},${Math.round(255*n)})`}offsetHSL(e,t,r){return this.getHSL(Ti),Ti.h+=e,Ti.s+=t,Ti.l+=r,this.setHSL(Ti.h,Ti.s,Ti.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,r){return this.r=e.r+(t.r-e.r)*r,this.g=e.g+(t.g-e.g)*r,this.b=e.b+(t.b-e.b)*r,this}lerpHSL(e,t){this.getHSL(Ti),e.getHSL(Ci);const r=_r(Ti.h,Ci.h,t),n=_r(Ti.s,Ci.s,t),i=_r(Ti.l,Ci.l,t);return this.setHSL(r,n,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,r=this.g,n=this.b,i=e.elements;return this.r=i[0]*t+i[3]*r+i[6]*n,this.g=i[1]*t+i[4]*r+i[7]*n,this.b=i[2]*t+i[5]*r+i[8]*n,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Ri=new Bi;Bi.NAMES=_i;class Pi extends Mi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Bi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Y,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Fi=Li();function Li(){const e=new ArrayBuffer(4),t=new Float32Array(e),r=new Uint32Array(e),n=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const e=l-127;e<-27?(n[l]=0,n[256|l]=32768,i[l]=24,i[256|l]=24):e<-14?(n[l]=1024>>-e-14,n[256|l]=1024>>-e-14|32768,i[l]=-e-1,i[256|l]=-e-1):e<=15?(n[l]=e+15<<10,n[256|l]=e+15<<10|32768,i[l]=13,i[256|l]=13):e<128?(n[l]=31744,n[256|l]=64512,i[l]=24,i[256|l]=24):(n[l]=31744,n[256|l]=64512,i[l]=13,i[256|l]=13)}const a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let e=l<<13,t=0;for(;0==(8388608&e);)e<<=1,t-=8388608;e&=-8388609,t+=947912704,a[l]=e|t}for(let l=1024;l<2048;++l)a[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)s[l]=l<<23;s[31]=1199570944,s[32]=2147483648;for(let l=33;l<63;++l)s[l]=2147483648+(l-32<<23);s[63]=3347054592;for(let l=1;l<64;++l)32!==l&&(o[l]=1024);return{floatView:t,uint32View:r,baseTable:n,shiftTable:i,mantissaTable:a,exponentTable:s,offsetTable:o}}function Di(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=Sr(e,-65504,65504),Fi.floatView[0]=e;const t=Fi.uint32View[0],r=t>>23&511;return Fi.baseTable[r]+((8388607&t)>>Fi.shiftTable[r])}function Ui(e){const t=e>>10;return Fi.uint32View[0]=Fi.mantissaTable[Fi.offsetTable[t]+(1023&e)]+Fi.exponentTable[t],Fi.floatView[0]}const Ni={toHalfFloat:Di,fromHalfFloat:Ui},ki=new un,Oi=new Fr;class Gi{constructor(e,t,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=r,this.usage=sr,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,r){e*=this.itemSize,r*=t.itemSize;for(let n=0,i=this.itemSize;n<i;n++)this.array[e+n]=t.array[r+n];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,r=this.count;t<r;t++)Oi.fromBufferAttribute(this,t),Oi.applyMatrix3(e),this.setXY(t,Oi.x,Oi.y);else if(3===this.itemSize)for(let t=0,r=this.count;t<r;t++)ki.fromBufferAttribute(this,t),ki.applyMatrix3(e),this.setXYZ(t,ki.x,ki.y,ki.z);return this}applyMatrix4(e){for(let t=0,r=this.count;t<r;t++)ki.fromBufferAttribute(this,t),ki.applyMatrix4(e),this.setXYZ(t,ki.x,ki.y,ki.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)ki.fromBufferAttribute(this,t),ki.applyNormalMatrix(e),this.setXYZ(t,ki.x,ki.y,ki.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)ki.fromBufferAttribute(this,t),ki.transformDirection(e),this.setXYZ(t,ki.x,ki.y,ki.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Br(t,this.array)),t}setX(e,t){return this.normalized&&(t=Rr(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Br(t,this.array)),t}setY(e,t){return this.normalized&&(t=Rr(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Br(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Rr(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Br(t,this.array)),t}setW(e,t){return this.normalized&&(t=Rr(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=Rr(t,this.array),r=Rr(r,this.array)),this.array[e+0]=t,this.array[e+1]=r,this}setXYZ(e,t,r,n){return e*=this.itemSize,this.normalized&&(t=Rr(t,this.array),r=Rr(r,this.array),n=Rr(n,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this}setXYZW(e,t,r,n,i){return e*=this.itemSize,this.normalized&&(t=Rr(t,this.array),r=Rr(r,this.array),n=Rr(n,this.array),i=Rr(i,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==sr&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class zi extends Gi{constructor(e,t,r){super(new Int8Array(e),t,r)}}class Vi extends Gi{constructor(e,t,r){super(new Uint8Array(e),t,r)}}class Hi extends Gi{constructor(e,t,r){super(new Uint8ClampedArray(e),t,r)}}class Qi extends Gi{constructor(e,t,r){super(new Int16Array(e),t,r)}}class ji extends Gi{constructor(e,t,r){super(new Uint16Array(e),t,r)}}class Wi extends Gi{constructor(e,t,r){super(new Int32Array(e),t,r)}}class Xi extends Gi{constructor(e,t,r){super(new Uint32Array(e),t,r)}}class Yi extends Gi{constructor(e,t,r){super(new Uint16Array(e),t,r),this.isFloat16BufferAttribute=!0}getX(e){let t=Ui(this.array[e*this.itemSize]);return this.normalized&&(t=Br(t,this.array)),t}setX(e,t){return this.normalized&&(t=Rr(t,this.array)),this.array[e*this.itemSize]=Di(t),this}getY(e){let t=Ui(this.array[e*this.itemSize+1]);return this.normalized&&(t=Br(t,this.array)),t}setY(e,t){return this.normalized&&(t=Rr(t,this.array)),this.array[e*this.itemSize+1]=Di(t),this}getZ(e){let t=Ui(this.array[e*this.itemSize+2]);return this.normalized&&(t=Br(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Rr(t,this.array)),this.array[e*this.itemSize+2]=Di(t),this}getW(e){let t=Ui(this.array[e*this.itemSize+3]);return this.normalized&&(t=Br(t,this.array)),t}setW(e,t){return this.normalized&&(t=Rr(t,this.array)),this.array[e*this.itemSize+3]=Di(t),this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=Rr(t,this.array),r=Rr(r,this.array)),this.array[e+0]=Di(t),this.array[e+1]=Di(r),this}setXYZ(e,t,r,n){return e*=this.itemSize,this.normalized&&(t=Rr(t,this.array),r=Rr(r,this.array),n=Rr(n,this.array)),this.array[e+0]=Di(t),this.array[e+1]=Di(r),this.array[e+2]=Di(n),this}setXYZW(e,t,r,n,i){return e*=this.itemSize,this.normalized&&(t=Rr(t,this.array),r=Rr(r,this.array),n=Rr(n,this.array),i=Rr(i,this.array)),this.array[e+0]=Di(t),this.array[e+1]=Di(r),this.array[e+2]=Di(n),this.array[e+3]=Di(i),this}}class qi extends Gi{constructor(e,t,r){super(new Float32Array(e),t,r)}}class Ki extends Gi{constructor(e,t,r){super(new Float64Array(e),t,r)}}let Ji=0;const Zi=new Gn,$i=new hi,ea=new un,ta=new pn,ra=new pn,na=new un;class ia extends Ar{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Ji++}),this.uuid=Er(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Ur(e)?Xi:ji)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,r=0){this.groups.push({start:e,count:t,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const r=this.attributes.normal;if(void 0!==r){const t=(new Lr).getNormalMatrix(e);r.applyNormalMatrix(t),r.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(e),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return Zi.makeRotationFromQuaternion(e),this.applyMatrix4(Zi),this}rotateX(e){return Zi.makeRotationX(e),this.applyMatrix4(Zi),this}rotateY(e){return Zi.makeRotationY(e),this.applyMatrix4(Zi),this}rotateZ(e){return Zi.makeRotationZ(e),this.applyMatrix4(Zi),this}translate(e,t,r){return Zi.makeTranslation(e,t,r),this.applyMatrix4(Zi),this}scale(e,t,r){return Zi.makeScale(e,t,r),this.applyMatrix4(Zi),this}lookAt(e){return $i.lookAt(e),$i.updateMatrix(),this.applyMatrix4($i.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ea).negate(),this.translate(ea.x,ea.y,ea.z),this}setFromPoints(e){const t=[];for(let r=0,n=e.length;r<n;r++){const n=e[r];t.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new qi(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new pn);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 un(-1/0,-1/0,-1/0),new un(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let r=0,n=t.length;r<n;r++){const e=t[r];ta.setFromBufferAttribute(e),this.morphTargetsRelative?(na.addVectors(this.boundingBox.min,ta.min),this.boundingBox.expandByPoint(na),na.addVectors(this.boundingBox.max,ta.max),this.boundingBox.expandByPoint(na)):(this.boundingBox.expandByPoint(ta.min),this.boundingBox.expandByPoint(ta.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Rn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new un,1/0);if(e){const r=this.boundingSphere.center;if(ta.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){const r=t[e];ra.setFromBufferAttribute(r),this.morphTargetsRelative?(na.addVectors(ta.min,ra.min),ta.expandByPoint(na),na.addVectors(ta.max,ra.max),ta.expandByPoint(na)):(ta.expandByPoint(ra.min),ta.expandByPoint(ra.max))}ta.getCenter(r);let n=0;for(let t=0,i=e.count;t<i;t++)na.fromBufferAttribute(e,t),n=Math.max(n,r.distanceToSquared(na));if(t)for(let i=0,a=t.length;i<a;i++){const a=t[i],s=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)na.fromBufferAttribute(a,t),s&&(ea.fromBufferAttribute(e,t),na.add(ea)),n=Math.max(n,r.distanceToSquared(na))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const r=e.array,n=t.position.array,i=t.normal.array,a=t.uv.array,s=n.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Gi(new Float32Array(4*s),4));const o=this.getAttribute("tangent").array,l=[],c=[];for(let M=0;M<s;M++)l[M]=new un,c[M]=new un;const u=new un,h=new un,d=new un,p=new Fr,f=new Fr,m=new Fr,g=new un,v=new un;function A(e,t,r){u.fromArray(n,3*e),h.fromArray(n,3*t),d.fromArray(n,3*r),p.fromArray(a,2*e),f.fromArray(a,2*t),m.fromArray(a,2*r),h.sub(u),d.sub(u),f.sub(p),m.sub(p);const i=1/(f.x*m.y-m.x*f.y);isFinite(i)&&(g.copy(h).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(i),v.copy(d).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(i),l[e].add(g),l[t].add(g),l[r].add(g),c[e].add(v),c[t].add(v),c[r].add(v))}let y=this.groups;0===y.length&&(y=[{start:0,count:r.length}]);for(let M=0,_=y.length;M<_;++M){const e=y[M],t=e.start;for(let n=t,i=t+e.count;n<i;n+=3)A(r[n+0],r[n+1],r[n+2])}const x=new un,b=new un,w=new un,E=new un;function S(e){w.fromArray(i,3*e),E.copy(w);const t=l[e];x.copy(t),x.sub(w.multiplyScalar(w.dot(t))).normalize(),b.crossVectors(E,t);const r=b.dot(c[e])<0?-1:1;o[4*e]=x.x,o[4*e+1]=x.y,o[4*e+2]=x.z,o[4*e+3]=r}for(let M=0,_=y.length;M<_;++M){const e=y[M],t=e.start;for(let n=t,i=t+e.count;n<i;n+=3)S(r[n+0]),S(r[n+1]),S(r[n+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let r=this.getAttribute("normal");if(void 0===r)r=new Gi(new Float32Array(3*t.count),3),this.setAttribute("normal",r);else for(let e=0,t=r.count;e<t;e++)r.setXYZ(e,0,0,0);const n=new un,i=new un,a=new un,s=new un,o=new un,l=new un,c=new un,u=new un;if(e)for(let h=0,d=e.count;h<d;h+=3){const d=e.getX(h+0),p=e.getX(h+1),f=e.getX(h+2);n.fromBufferAttribute(t,d),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,f),c.subVectors(a,i),u.subVectors(n,i),c.cross(u),s.fromBufferAttribute(r,d),o.fromBufferAttribute(r,p),l.fromBufferAttribute(r,f),s.add(c),o.add(c),l.add(c),r.setXYZ(d,s.x,s.y,s.z),r.setXYZ(p,o.x,o.y,o.z),r.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,h=t.count;e<h;e+=3)n.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),c.subVectors(a,i),u.subVectors(n,i),c.cross(u),r.setXYZ(e+0,c.x,c.y,c.z),r.setXYZ(e+1,c.x,c.y,c.z),r.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),r.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead."),this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,r=e.count;t<r;t++)na.fromBufferAttribute(e,t),na.normalize(),e.setXYZ(t,na.x,na.y,na.z)}toNonIndexed(){function e(e,t){const r=e.array,n=e.itemSize,i=e.normalized,a=new r.constructor(t.length*n);let s=0,o=0;for(let l=0,c=t.length;l<c;l++){s=e.isInterleavedBufferAttribute?t[l]*e.data.stride+e.offset:t[l]*n;for(let e=0;e<n;e++)a[o++]=r[s++]}return new Gi(a,n,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new ia,r=this.index.array,n=this.attributes;for(const s in n){const i=e(n[s],r);t.setAttribute(s,i)}const i=this.morphAttributes;for(const s in i){const n=[],a=i[s];for(let t=0,i=a.length;t<i;t++){const i=e(a[t],r);n.push(i)}t.morphAttributes[s]=n}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let s=0,o=a.length;s<o;s++){const e=a[s];t.addGroup(e.start,e.count,e.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const r in t)void 0!==t[r]&&(e[r]=t[r]);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 r=this.attributes;for(const o in r){const t=r[o];e.data.attributes[o]=t.toJSON(e.data)}const n={};let i=!1;for(const o in this.morphAttributes){const t=this.morphAttributes[o],r=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];r.push(i.toJSON(e.data))}r.length>0&&(n[o]=r,i=!0)}i&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return null!==s&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const r=e.index;null!==r&&this.setIndex(r.clone(t));const n=e.attributes;for(const l in n){const e=n[l];this.setAttribute(l,e.clone(t))}const i=e.morphAttributes;for(const l in i){const e=[],r=i[l];for(let n=0,i=r.length;n<i;n++)e.push(r[n].clone(t));this.morphAttributes[l]=e}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let l=0,c=a.length;l<c;l++){const e=a[l];this.addGroup(e.start,e.count,e.materialIndex)}const s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());const o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const aa=new Gn,sa=new On,oa=new Rn,la=new un,ca=new un,ua=new un,ha=new un,da=new un,pa=new un,fa=new Fr,ma=new Fr,ga=new Fr,va=new un,Aa=new un,ya=new un,xa=new un,ba=new un;class wa extends hi{constructor(e=new ia,t=new Pi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;e<t;e++){const t=r[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){const r=this.geometry,n=r.attributes.position,i=r.morphAttributes.position,a=r.morphTargetsRelative;t.fromBufferAttribute(n,e);const s=this.morphTargetInfluences;if(i&&s){pa.set(0,0,0);for(let r=0,n=i.length;r<n;r++){const n=s[r],o=i[r];0!==n&&(da.fromBufferAttribute(o,e),a?pa.addScaledVector(da,n):pa.addScaledVector(da.sub(t),n))}t.add(pa)}return t}raycast(e,t){const r=this.geometry,n=this.material,i=this.matrixWorld;if(void 0!==n){if(null===r.boundingSphere&&r.computeBoundingSphere(),oa.copy(r.boundingSphere),oa.applyMatrix4(i),sa.copy(e.ray).recast(e.near),!1===oa.containsPoint(sa.origin)){if(null===sa.intersectSphere(oa,la))return;if(sa.origin.distanceToSquared(la)>(e.far-e.near)**2)return}aa.copy(i).invert(),sa.copy(e.ray).applyMatrix4(aa),null!==r.boundingBox&&!1===sa.intersectsBox(r.boundingBox)||this._computeIntersections(e,t)}}_computeIntersections(e,t){let r;const n=this.geometry,i=this.material,a=n.index,s=n.attributes.position,o=n.attributes.uv,l=n.attributes.uv1,c=n.attributes.normal,u=n.groups,h=n.drawRange;if(null!==a)if(Array.isArray(i))for(let d=0,p=u.length;d<p;d++){const n=u[d],s=i[n.materialIndex];for(let i=Math.max(n.start,h.start),u=Math.min(a.count,Math.min(n.start+n.count,h.start+h.count));i<u;i+=3){const u=a.getX(i),h=a.getX(i+1),d=a.getX(i+2);r=Ea(this,s,e,sa,o,l,c,u,h,d),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=n.materialIndex,t.push(r))}}else{for(let n=Math.max(0,h.start),s=Math.min(a.count,h.start+h.count);n<s;n+=3){const s=a.getX(n),u=a.getX(n+1),h=a.getX(n+2);r=Ea(this,i,e,sa,o,l,c,s,u,h),r&&(r.faceIndex=Math.floor(n/3),t.push(r))}}else if(void 0!==s)if(Array.isArray(i))for(let d=0,p=u.length;d<p;d++){const n=u[d],a=i[n.materialIndex];for(let i=Math.max(n.start,h.start),u=Math.min(s.count,Math.min(n.start+n.count,h.start+h.count));i<u;i+=3){r=Ea(this,a,e,sa,o,l,c,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=n.materialIndex,t.push(r))}}else{for(let n=Math.max(0,h.start),a=Math.min(s.count,h.start+h.count);n<a;n+=3){r=Ea(this,i,e,sa,o,l,c,n,n+1,n+2),r&&(r.faceIndex=Math.floor(n/3),t.push(r))}}}}function Ea(e,t,r,n,i,a,s,o,l,c){e.getVertexPosition(o,ca),e.getVertexPosition(l,ua),e.getVertexPosition(c,ha);const u=function(e,t,r,n,i,a,s,o){let l;if(l=t.side===m?n.intersectTriangle(s,a,i,!0,o):n.intersectTriangle(i,a,s,t.side===f,o),null===l)return null;ba.copy(o),ba.applyMatrix4(e.matrixWorld);const c=r.ray.origin.distanceTo(ba);return c<r.near||c>r.far?null:{distance:c,point:ba.clone(),object:e}}(e,t,r,n,ca,ua,ha,xa);if(u){i&&(fa.fromBufferAttribute(i,o),ma.fromBufferAttribute(i,l),ga.fromBufferAttribute(i,c),u.uv=Ei.getInterpolation(xa,ca,ua,ha,fa,ma,ga,new Fr)),a&&(fa.fromBufferAttribute(a,o),ma.fromBufferAttribute(a,l),ga.fromBufferAttribute(a,c),u.uv1=Ei.getInterpolation(xa,ca,ua,ha,fa,ma,ga,new Fr),u.uv2=u.uv1),s&&(va.fromBufferAttribute(s,o),Aa.fromBufferAttribute(s,l),ya.fromBufferAttribute(s,c),u.normal=Ei.getInterpolation(xa,ca,ua,ha,va,Aa,ya,new un),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const e={a:o,b:l,c:c,normal:new un,materialIndex:0};Ei.getNormal(ca,ua,ha,e.normal),u.face=e}return u}class Sa extends ia{constructor(e=1,t=1,r=1,n=1,i=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:n,heightSegments:i,depthSegments:a};const s=this;n=Math.floor(n),i=Math.floor(i),a=Math.floor(a);const o=[],l=[],c=[],u=[];let h=0,d=0;function p(e,t,r,n,i,a,p,f,m,g,v){const A=a/m,y=p/g,x=a/2,b=p/2,w=f/2,E=m+1,S=g+1;let M=0,_=0;const T=new un;for(let s=0;s<S;s++){const a=s*y-b;for(let o=0;o<E;o++){const h=o*A-x;T[e]=h*n,T[t]=a*i,T[r]=w,l.push(T.x,T.y,T.z),T[e]=0,T[t]=0,T[r]=f>0?1:-1,c.push(T.x,T.y,T.z),u.push(o/m),u.push(1-s/g),M+=1}}for(let s=0;s<g;s++)for(let e=0;e<m;e++){const t=h+e+E*s,r=h+e+E*(s+1),n=h+(e+1)+E*(s+1),i=h+(e+1)+E*s;o.push(t,r,i),o.push(r,n,i),_+=6}s.addGroup(d,_,v),d+=_,h+=M}p("z","y","x",-1,-1,r,t,e,a,i,0),p("z","y","x",1,-1,r,t,-e,a,i,1),p("x","z","y",1,1,e,r,t,n,a,2),p("x","z","y",1,-1,e,r,-t,n,a,3),p("x","y","z",1,-1,e,t,r,n,i,4),p("x","y","z",-1,-1,e,t,-r,n,i,5),this.setIndex(o),this.setAttribute("position",new qi(l,3)),this.setAttribute("normal",new qi(c,3)),this.setAttribute("uv",new qi(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Sa(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Ma(e){const t={};for(const r in e){t[r]={};for(const n in e[r]){const i=e[r][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[r][n]=null):t[r][n]=i.clone():Array.isArray(i)?t[r][n]=i.slice():t[r][n]=i}}return t}function _a(e){const t={};for(let r=0;r<e.length;r++){const n=Ma(e[r]);for(const e in n)t[e]=n[e]}return t}function Ta(e){return null===e.getRenderTarget()?e.outputColorSpace:Vt}const Ca={clone:Ma,merge:_a};class Ia extends Mi{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ma(e.uniforms),this.uniformsGroups=function(e){const t=[];for(let r=0;r<e.length;r++)t.push(e[r].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){const r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const r={};for(const n in this.extensions)!0===this.extensions[n]&&(r[n]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class Ba extends hi{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Gn,this.projectionMatrix=new Gn,this.projectionMatrixInverse=new Gn}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class Ra extends Ba{constructor(e=50,t=1,r=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*wr*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*br*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*wr*Math.atan(Math.tan(.5*br*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,r,n,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*br*this.fov)/this.zoom,r=2*t,n=this.aspect*r,i=-.5*n;const a=this.view;if(null!==this.view&&this.view.enabled){const e=a.fullWidth,s=a.fullHeight;i+=a.offsetX*n/e,t-=a.offsetY*r/s,n*=a.width/e,r*=a.height/s}const s=this.filmOffset;0!==s&&(i+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+n,t,t-r,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Pa=-90;class Fa extends hi{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r;const n=new Ra(Pa,1,e,t);n.layers=this.layers,n.up.set(0,1,0),n.lookAt(1,0,0),this.add(n);const i=new Ra(Pa,1,e,t);i.layers=this.layers,i.up.set(0,1,0),i.lookAt(-1,0,0),this.add(i);const a=new Ra(Pa,1,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(0,1,0),this.add(a);const s=new Ra(Pa,1,e,t);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(0,-1,0),this.add(s);const o=new Ra(Pa,1,e,t);o.layers=this.layers,o.up.set(0,1,0),o.lookAt(0,0,1),this.add(o);const l=new Ra(Pa,1,e,t);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,-1),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();const r=this.renderTarget,[n,i,a,s,o,l]=this.children,c=e.getRenderTarget(),u=e.toneMapping,h=e.xr.enabled;e.toneMapping=J,e.xr.enabled=!1;const d=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,n),e.setRenderTarget(r,1),e.render(t,i),e.setRenderTarget(r,2),e.render(t,a),e.setRenderTarget(r,3),e.render(t,s),e.setRenderTarget(r,4),e.render(t,o),r.texture.generateMipmaps=d,e.setRenderTarget(r,5),e.render(t,l),e.setRenderTarget(c),e.toneMapping=u,e.xr.enabled=h,r.texture.needsPMREMUpdate=!0}}class La extends en{constructor(e,t,r,n,i,a,s,o,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:ie,r,n,i,a,s,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Da extends rn{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},n=[r,r,r,r,r,r];void 0!==t.encoding&&(zr("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Dt?zt:Gt),this.texture=new La(n,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:ve}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},n=new Sa(5,5,5),i=new Ia({name:"CubemapFromEquirect",uniforms:Ma(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:m,blending:A});i.uniforms.tEquirect.value=t;const a=new wa(n,i),s=t.minFilter;t.minFilter===xe&&(t.minFilter=ve);return new Fa(1,10,this).update(e,a),t.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,r,n){const i=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,r,n);e.setRenderTarget(i)}}const Ua=new un,Na=new un,ka=new Lr;class Oa{constructor(e=new un(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,n){return this.normal.set(e,t,r),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const n=Ua.subVectors(r,t).cross(Na.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const r=e.delta(Ua),n=this.normal.dot(r);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/n;return i<0||i>1?null:t.copy(e.start).addScaledVector(r,i)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const r=t||ka.getNormalMatrix(e),n=this.coplanarPoint(Ua).applyMatrix4(e),i=this.normal.applyMatrix3(r).normalize();return this.constant=-n.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Ga=new Rn,za=new un;class Va{constructor(e=new Oa,t=new Oa,r=new Oa,n=new Oa,i=new Oa,a=new Oa){this.planes=[e,t,r,n,i,a]}set(e,t,r,n,i,a){const s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(r),s[3].copy(n),s[4].copy(i),s[5].copy(a),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e){const t=this.planes,r=e.elements,n=r[0],i=r[1],a=r[2],s=r[3],o=r[4],l=r[5],c=r[6],u=r[7],h=r[8],d=r[9],p=r[10],f=r[11],m=r[12],g=r[13],v=r[14],A=r[15];return t[0].setComponents(s-n,u-o,f-h,A-m).normalize(),t[1].setComponents(s+n,u+o,f+h,A+m).normalize(),t[2].setComponents(s+i,u+l,f+d,A+g).normalize(),t[3].setComponents(s-i,u-l,f-d,A-g).normalize(),t[4].setComponents(s-a,u-c,f-p,A-v).normalize(),t[5].setComponents(s+a,u+c,f+p,A+v).normalize(),this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),Ga.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),Ga.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ga)}intersectsSprite(e){return Ga.center.set(0,0,0),Ga.radius=.7071067811865476,Ga.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ga)}intersectsSphere(e){const t=this.planes,r=e.center,n=-e.radius;for(let i=0;i<6;i++){if(t[i].distanceToPoint(r)<n)return!1}return!0}intersectsBox(e){const t=this.planes;for(let r=0;r<6;r++){const n=t[r];if(za.x=n.normal.x>0?e.max.x:e.min.x,za.y=n.normal.y>0?e.max.y:e.min.y,za.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(za)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Ha(){let e=null,t=!1,r=null,n=null;function i(t,a){r(t,a),n=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==r&&(n=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){r=e},setContext:function(t){e=t}}}function Qa(e,t){const r=t.isWebGL2,n=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),n.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const r=n.get(t);r&&(e.deleteBuffer(r.buffer),n.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=n.get(t);return void((!e||e.version<t.version)&&n.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const a=n.get(t);void 0===a?n.set(t,function(t,n){const i=t.array,a=t.usage,s=e.createBuffer();let o;if(e.bindBuffer(n,s),e.bufferData(n,i,a),t.onUploadCallback(),i instanceof Float32Array)o=e.FLOAT;else if(i instanceof Uint16Array)if(t.isFloat16BufferAttribute){if(!r)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");o=e.HALF_FLOAT}else o=e.UNSIGNED_SHORT;else if(i instanceof Int16Array)o=e.SHORT;else if(i instanceof Uint32Array)o=e.UNSIGNED_INT;else if(i instanceof Int32Array)o=e.INT;else if(i instanceof Int8Array)o=e.BYTE;else if(i instanceof Uint8Array)o=e.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);o=e.UNSIGNED_BYTE}return{buffer:s,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}(t,i)):a.version<t.version&&(!function(t,n,i){const a=n.array,s=n.updateRange;e.bindBuffer(i,t),-1===s.count?e.bufferSubData(i,0,a):(r?e.bufferSubData(i,s.offset*a.BYTES_PER_ELEMENT,a,s.offset,s.count):e.bufferSubData(i,s.offset*a.BYTES_PER_ELEMENT,a.subarray(s.offset,s.offset+s.count)),s.count=-1),n.onUploadCallback()}(a.buffer,t,i),a.version=t.version)}}}class ja extends ia{constructor(e=1,t=1,r=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:n};const i=e/2,a=t/2,s=Math.floor(r),o=Math.floor(n),l=s+1,c=o+1,u=e/s,h=t/o,d=[],p=[],f=[],m=[];for(let g=0;g<c;g++){const e=g*h-a;for(let t=0;t<l;t++){const r=t*u-i;p.push(r,-e,0),f.push(0,0,1),m.push(t/s),m.push(1-g/o)}}for(let g=0;g<o;g++)for(let e=0;e<s;e++){const t=e+l*g,r=e+l*(g+1),n=e+1+l*(g+1),i=e+1+l*g;d.push(t,r,i),d.push(r,n,i)}this.setIndex(d),this.setAttribute("position",new qi(p,3)),this.setAttribute("normal",new qi(f,3)),this.setAttribute("uv",new qi(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ja(e.width,e.height,e.widthSegments,e.heightSegments)}}const Wa={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",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:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",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, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",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#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",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 vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",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.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",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\tdiffuseColor *= texture2D( map, vMapUv );\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_NORMALMAP_TANGENTSPACE\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",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}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\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 depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 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:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn 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; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},Xa={common:{diffuse:{value:new Bi(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Lr},alphaMap:{value:null},alphaMapTransform:{value:new Lr},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Lr}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Lr}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Lr}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Lr},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Lr},normalScale:{value:new Fr(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Lr},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Lr}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Lr}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Lr}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Bi(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Bi(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Lr}},sprite:{diffuse:{value:new Bi(16777215)},opacity:{value:1},center:{value:new Fr(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Lr},alphaMap:{value:null},alphaTest:{value:0}}},Ya={basic:{uniforms:_a([Xa.common,Xa.specularmap,Xa.envmap,Xa.aomap,Xa.lightmap,Xa.fog]),vertexShader:Wa.meshbasic_vert,fragmentShader:Wa.meshbasic_frag},lambert:{uniforms:_a([Xa.common,Xa.specularmap,Xa.envmap,Xa.aomap,Xa.lightmap,Xa.emissivemap,Xa.bumpmap,Xa.normalmap,Xa.displacementmap,Xa.fog,Xa.lights,{emissive:{value:new Bi(0)}}]),vertexShader:Wa.meshlambert_vert,fragmentShader:Wa.meshlambert_frag},phong:{uniforms:_a([Xa.common,Xa.specularmap,Xa.envmap,Xa.aomap,Xa.lightmap,Xa.emissivemap,Xa.bumpmap,Xa.normalmap,Xa.displacementmap,Xa.fog,Xa.lights,{emissive:{value:new Bi(0)},specular:{value:new Bi(1118481)},shininess:{value:30}}]),vertexShader:Wa.meshphong_vert,fragmentShader:Wa.meshphong_frag},standard:{uniforms:_a([Xa.common,Xa.envmap,Xa.aomap,Xa.lightmap,Xa.emissivemap,Xa.bumpmap,Xa.normalmap,Xa.displacementmap,Xa.roughnessmap,Xa.metalnessmap,Xa.fog,Xa.lights,{emissive:{value:new Bi(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Wa.meshphysical_vert,fragmentShader:Wa.meshphysical_frag},toon:{uniforms:_a([Xa.common,Xa.aomap,Xa.lightmap,Xa.emissivemap,Xa.bumpmap,Xa.normalmap,Xa.displacementmap,Xa.gradientmap,Xa.fog,Xa.lights,{emissive:{value:new Bi(0)}}]),vertexShader:Wa.meshtoon_vert,fragmentShader:Wa.meshtoon_frag},matcap:{uniforms:_a([Xa.common,Xa.bumpmap,Xa.normalmap,Xa.displacementmap,Xa.fog,{matcap:{value:null}}]),vertexShader:Wa.meshmatcap_vert,fragmentShader:Wa.meshmatcap_frag},points:{uniforms:_a([Xa.points,Xa.fog]),vertexShader:Wa.points_vert,fragmentShader:Wa.points_frag},dashed:{uniforms:_a([Xa.common,Xa.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Wa.linedashed_vert,fragmentShader:Wa.linedashed_frag},depth:{uniforms:_a([Xa.common,Xa.displacementmap]),vertexShader:Wa.depth_vert,fragmentShader:Wa.depth_frag},normal:{uniforms:_a([Xa.common,Xa.bumpmap,Xa.normalmap,Xa.displacementmap,{opacity:{value:1}}]),vertexShader:Wa.meshnormal_vert,fragmentShader:Wa.meshnormal_frag},sprite:{uniforms:_a([Xa.sprite,Xa.fog]),vertexShader:Wa.sprite_vert,fragmentShader:Wa.sprite_frag},background:{uniforms:{uvTransform:{value:new Lr},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Wa.background_vert,fragmentShader:Wa.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Wa.backgroundCube_vert,fragmentShader:Wa.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Wa.cube_vert,fragmentShader:Wa.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Wa.equirect_vert,fragmentShader:Wa.equirect_frag},distanceRGBA:{uniforms:_a([Xa.common,Xa.displacementmap,{referencePosition:{value:new un},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Wa.distanceRGBA_vert,fragmentShader:Wa.distanceRGBA_frag},shadow:{uniforms:_a([Xa.lights,Xa.fog,{color:{value:new Bi(0)},opacity:{value:1}}]),vertexShader:Wa.shadow_vert,fragmentShader:Wa.shadow_frag}};Ya.physical={uniforms:_a([Ya.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Lr},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Lr},clearcoatNormalScale:{value:new Fr(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Lr},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Lr},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Lr},sheen:{value:0},sheenColor:{value:new Bi(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Lr},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Lr},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Lr},transmissionSamplerSize:{value:new Fr},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Lr},attenuationDistance:{value:0},attenuationColor:{value:new Bi(0)},specularColor:{value:new Bi(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Lr},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Lr}}]),vertexShader:Wa.meshphysical_vert,fragmentShader:Wa.meshphysical_frag};const qa={r:0,b:0,g:0};function Ka(e,t,r,n,i,a,s){const o=new Bi(0);let l,c,u=!0===a?0:1,h=null,d=0,p=null;function g(t,r){t.getRGB(qa,Ta(e)),n.buffers.color.setClear(qa.r,qa.g,qa.b,r,s)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),u=t,g(o,u)},getClearAlpha:function(){return u},setClearAlpha:function(e){u=e,g(o,u)},render:function(a,v){let A=!1,y=!0===v.isScene?v.background:null;if(y&&y.isTexture){y=(v.backgroundBlurriness>0?r:t).get(y)}switch(null===y?g(o,u):y&&y.isColor&&(g(y,1),A=!0),e.xr.getEnvironmentBlendMode()){case"opaque":A=!0;break;case"additive":n.buffers.color.setClear(0,0,0,1,s),A=!0;break;case"alpha-blend":n.buffers.color.setClear(0,0,0,0,s),A=!0}(e.autoClear||A)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),y&&(y.isCubeTexture||y.mapping===le)?(void 0===c&&(c=new wa(new Sa(1,1,1),new Ia({name:"BackgroundCubeMaterial",uniforms:Ma(Ya.backgroundCube.uniforms),vertexShader:Ya.backgroundCube.vertexShader,fragmentShader:Ya.backgroundCube.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&!1===y.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=y.colorSpace!==zt,h===y&&d===y.version&&p===e.toneMapping||(c.material.needsUpdate=!0,h=y,d=y.version,p=e.toneMapping),c.layers.enableAll(),a.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(void 0===l&&(l=new wa(new ja(2,2),new Ia({name:"BackgroundMaterial",uniforms:Ma(Ya.background.uniforms),vertexShader:Ya.background.vertexShader,fragmentShader:Ya.background.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=y,l.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,l.material.toneMapped=y.colorSpace!==zt,!0===y.matrixAutoUpdate&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),h===y&&d===y.version&&p===e.toneMapping||(l.material.needsUpdate=!0,h=y,d=y.version,p=e.toneMapping),l.layers.enableAll(),a.unshift(l,l.geometry,l.material,0,0,null))}}}function Ja(e,t,r,n){const i=e.getParameter(e.MAX_VERTEX_ATTRIBS),a=n.isWebGL2?null:t.get("OES_vertex_array_object"),s=n.isWebGL2||null!==a,o={},l=p(null);let c=l,u=!1;function h(t){return n.isWebGL2?e.bindVertexArray(t):a.bindVertexArrayOES(t)}function d(t){return n.isWebGL2?e.deleteVertexArray(t):a.deleteVertexArrayOES(t)}function p(e){const t=[],r=[],n=[];for(let a=0;a<i;a++)t[a]=0,r[a]=0,n[a]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:n,object:e,attributes:{},index:null}}function f(){const e=c.newAttributes;for(let t=0,r=e.length;t<r;t++)e[t]=0}function m(e){g(e,0)}function g(r,i){const a=c.newAttributes,s=c.enabledAttributes,o=c.attributeDivisors;if(a[r]=1,0===s[r]&&(e.enableVertexAttribArray(r),s[r]=1),o[r]!==i){(n.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](r,i),o[r]=i}}function v(){const t=c.newAttributes,r=c.enabledAttributes;for(let n=0,i=r.length;n<i;n++)r[n]!==t[n]&&(e.disableVertexAttribArray(n),r[n]=0)}function A(t,r,i,a,s,o){!0!==n.isWebGL2||i!==e.INT&&i!==e.UNSIGNED_INT?e.vertexAttribPointer(t,r,i,a,s,o):e.vertexAttribIPointer(t,r,i,s,o)}function y(){x(),u=!0,c!==l&&(c=l,h(c.object))}function x(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(i,l,d,y,x){let b=!1;if(s){const t=function(t,r,i){const s=!0===i.wireframe;let l=o[t.id];void 0===l&&(l={},o[t.id]=l);let c=l[r.id];void 0===c&&(c={},l[r.id]=c);let u=c[s];void 0===u&&(u=p(n.isWebGL2?e.createVertexArray():a.createVertexArrayOES()),c[s]=u);return u}(y,d,l);c!==t&&(c=t,h(c.object)),b=function(e,t,r,n){const i=c.attributes,a=t.attributes;let s=0;const o=r.getAttributes();for(const l in o){if(o[l].location>=0){const t=i[l];let r=a[l];if(void 0===r&&("instanceMatrix"===l&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===l&&e.instanceColor&&(r=e.instanceColor)),void 0===t)return!0;if(t.attribute!==r)return!0;if(r&&t.data!==r.data)return!0;s++}}return c.attributesNum!==s||c.index!==n}(i,y,d,x),b&&function(e,t,r,n){const i={},a=t.attributes;let s=0;const o=r.getAttributes();for(const l in o){if(o[l].location>=0){let t=a[l];void 0===t&&("instanceMatrix"===l&&e.instanceMatrix&&(t=e.instanceMatrix),"instanceColor"===l&&e.instanceColor&&(t=e.instanceColor));const r={};r.attribute=t,t&&t.data&&(r.data=t.data),i[l]=r,s++}}c.attributes=i,c.attributesNum=s,c.index=n}(i,y,d,x)}else{const e=!0===l.wireframe;c.geometry===y.id&&c.program===d.id&&c.wireframe===e||(c.geometry=y.id,c.program=d.id,c.wireframe=e,b=!0)}null!==x&&r.update(x,e.ELEMENT_ARRAY_BUFFER),(b||u)&&(u=!1,function(i,a,s,o){if(!1===n.isWebGL2&&(i.isInstancedMesh||o.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;f();const l=o.attributes,c=s.getAttributes(),u=a.defaultAttributeValues;for(const t in c){const n=c[t];if(n.location>=0){let a=l[t];if(void 0===a&&("instanceMatrix"===t&&i.instanceMatrix&&(a=i.instanceMatrix),"instanceColor"===t&&i.instanceColor&&(a=i.instanceColor)),void 0!==a){const t=a.normalized,s=a.itemSize,l=r.get(a);if(void 0===l)continue;const c=l.buffer,u=l.type,h=l.bytesPerElement;if(a.isInterleavedBufferAttribute){const r=a.data,l=r.stride,d=a.offset;if(r.isInstancedInterleavedBuffer){for(let e=0;e<n.locationSize;e++)g(n.location+e,r.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=r.meshPerAttribute*r.count)}else for(let e=0;e<n.locationSize;e++)m(n.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<n.locationSize;e++)A(n.location+e,s/n.locationSize,u,t,l*h,(d+s/n.locationSize*e)*h)}else{if(a.isInstancedBufferAttribute){for(let e=0;e<n.locationSize;e++)g(n.location+e,a.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=a.meshPerAttribute*a.count)}else for(let e=0;e<n.locationSize;e++)m(n.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<n.locationSize;e++)A(n.location+e,s/n.locationSize,u,t,s*h,s/n.locationSize*e*h)}}else if(void 0!==u){const r=u[t];if(void 0!==r)switch(r.length){case 2:e.vertexAttrib2fv(n.location,r);break;case 3:e.vertexAttrib3fv(n.location,r);break;case 4:e.vertexAttrib4fv(n.location,r);break;default:e.vertexAttrib1fv(n.location,r)}}}}v()}(i,l,d,y),null!==x&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){y();for(const e in o){const t=o[e];for(const e in t){const r=t[e];for(const e in r)d(r[e].object),delete r[e];delete t[e]}delete o[e]}},releaseStatesOfGeometry:function(e){if(void 0===o[e.id])return;const t=o[e.id];for(const r in t){const e=t[r];for(const t in e)d(e[t].object),delete e[t];delete t[r]}delete o[e.id]},releaseStatesOfProgram:function(e){for(const t in o){const r=o[t];if(void 0===r[e.id])continue;const n=r[e.id];for(const e in n)d(n[e].object),delete n[e];delete r[e.id]}},initAttributes:f,enableAttribute:m,disableUnusedAttributes:v}}function Za(e,t,r,n){const i=n.isWebGL2;let a;this.setMode=function(e){a=e},this.render=function(t,n){e.drawArrays(a,t,n),r.update(n,a,1)},this.renderInstances=function(n,s,o){if(0===o)return;let l,c;if(i)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](a,n,s,o),r.update(s,a,o)}}function $a(e,t,r){let n;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const a="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===e.constructor.name;let s=void 0!==r.precision?r.precision:"highp";const o=i(s);o!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",o,"instead."),s=o);const l=a||t.has("WEBGL_draw_buffers"),c=!0===r.logarithmicDepthBuffer,u=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_TEXTURE_SIZE),p=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),f=e.getParameter(e.MAX_VERTEX_ATTRIBS),m=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),g=e.getParameter(e.MAX_VARYING_VECTORS),v=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),A=h>0,y=a||t.has("OES_texture_float");return{isWebGL2:a,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===t.has("EXT_texture_filter_anisotropic")){const r=t.get("EXT_texture_filter_anisotropic");n=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:i,precision:s,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:h,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:A,floatFragmentTextures:y,floatVertexTextures:A&&y,maxSamples:a?e.getParameter(e.MAX_SAMPLES):0}}function es(e){const t=this;let r=null,n=0,i=!1,a=!1;const s=new Oa,o=new Lr,l={value:null,needsUpdate:!1};function c(e,r,n,i){const a=null!==e?e.length:0;let c=null;if(0!==a){if(c=l.value,!0!==i||null===c){const t=n+4*a,i=r.matrixWorldInverse;o.getNormalMatrix(i),(null===c||c.length<t)&&(c=new Float32Array(t));for(let r=0,l=n;r!==a;++r,l+=4)s.copy(e[r]).applyMatrix4(i,o),s.normal.toArray(c,l),c[l+3]=s.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){const r=0!==e.length||t||0!==n||i;return i=t,n=e.length,r},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){r=c(e,t,0)},this.setState=function(s,o,u){const h=s.clippingPlanes,d=s.clipIntersection,p=s.clipShadows,f=e.get(s);if(!i||null===h||0===h.length||a&&!p)a?c(null):function(){l.value!==r&&(l.value=r,l.needsUpdate=n>0);t.numPlanes=n,t.numIntersection=0}();else{const e=a?0:n,t=4*e;let i=f.clippingState||null;l.value=i,i=c(h,o,t,u);for(let n=0;n!==t;++n)i[n]=r[n];f.clippingState=i,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}}}function ts(e){let t=new WeakMap;function r(e,t){return t===se?e.mapping=ie:t===oe&&(e.mapping=ae),e}function n(e){const r=e.target;r.removeEventListener("dispose",n);const i=t.get(r);void 0!==i&&(t.delete(r),i.dispose())}return{get:function(i){if(i&&i.isTexture&&!1===i.isRenderTargetTexture){const a=i.mapping;if(a===se||a===oe){if(t.has(i)){return r(t.get(i).texture,i.mapping)}{const a=i.image;if(a&&a.height>0){const s=new Da(a.height/2);return s.fromEquirectangularTexture(e,i),t.set(i,s),i.addEventListener("dispose",n),r(s.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}class rs extends Ba{constructor(e=-1,t=1,r=1,n=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=n,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,r,n,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let i=r-e,a=r+e,s=n+t,o=n-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,a=i+e*this.view.width,s-=t*this.view.offsetY,o=s-t*this.view.height}this.projectionMatrix.makeOrthographic(i,a,s,o,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const ns=[.125,.215,.35,.446,.526,.582],is=20,as=new rs,ss=new Bi;let os=null;const ls=(1+Math.sqrt(5))/2,cs=1/ls,us=[new un(1,1,1),new un(-1,1,1),new un(1,1,-1),new un(-1,1,-1),new un(0,ls,cs),new un(0,ls,-cs),new un(cs,0,ls),new un(-cs,0,ls),new un(ls,cs,0),new un(-ls,cs,0)];class hs{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,r=.1,n=100){os=this._renderer.getRenderTarget(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,r,n,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=ms(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=fs(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(os),e.scissorTest=!1,ps(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===ie||e.mapping===ae?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),os=this._renderer.getRenderTarget();const r=t||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,r={magFilter:ve,minFilter:ve,generateMipmaps:!1,type:Ie,format:Le,colorSpace:Vt,depthBuffer:!1},n=ds(e,t,r);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=ds(e,t,r);const{_lodMax:n}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],r=[],n=[];let i=e;const a=e-4+1+ns.length;for(let s=0;s<a;s++){const a=Math.pow(2,i);r.push(a);let o=1/a;s>e-4?o=ns[s-e+4-1]:0===s&&(o=0),n.push(o);const l=1/(a-2),c=-l,u=1+l,h=[c,c,u,c,u,u,c,c,u,u,c,u],d=6,p=6,f=3,m=2,g=1,v=new Float32Array(f*p*d),A=new Float32Array(m*p*d),y=new Float32Array(g*p*d);for(let e=0;e<d;e++){const t=e%3*2/3-1,r=e>2?0:-1,n=[t,r,0,t+2/3,r,0,t+2/3,r+1,0,t,r,0,t+2/3,r+1,0,t,r+1,0];v.set(n,f*p*e),A.set(h,m*p*e);const i=[e,e,e,e,e,e];y.set(i,g*p*e)}const x=new ia;x.setAttribute("position",new Gi(v,f)),x.setAttribute("uv",new Gi(A,m)),x.setAttribute("faceIndex",new Gi(y,g)),t.push(x),i>4&&i--}return{lodPlanes:t,sizeLods:r,sigmas:n}}(n)),this._blurMaterial=function(e,t,r){const n=new Float32Array(is),i=new un(0,1,0);return new Ia({name:"SphericalGaussianBlur",defines:{n:is,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/r,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:gs(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:A,depthTest:!1,depthWrite:!1})}(n,e,t)}return n}_compileMaterial(e){const t=new wa(this._lodPlanes[0],e);this._renderer.compile(t,as)}_sceneToCubeUV(e,t,r,n){const i=new Ra(90,1,t,r),a=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,c=o.toneMapping;o.getClearColor(ss),o.toneMapping=J,o.autoClear=!1;const u=new Pi({name:"PMREM.Background",side:m,depthWrite:!1,depthTest:!1}),h=new wa(new Sa,u);let d=!1;const p=e.background;p?p.isColor&&(u.color.copy(p),e.background=null,d=!0):(u.color.copy(ss),d=!0);for(let f=0;f<6;f++){const t=f%3;0===t?(i.up.set(0,a[f],0),i.lookAt(s[f],0,0)):1===t?(i.up.set(0,0,a[f]),i.lookAt(0,s[f],0)):(i.up.set(0,a[f],0),i.lookAt(0,0,s[f]));const r=this._cubeSize;ps(n,t*r,f>2?r:0,r,r),o.setRenderTarget(n),d&&o.render(h,i),o.render(e,i)}h.geometry.dispose(),h.material.dispose(),o.toneMapping=c,o.autoClear=l,e.background=p}_textureToCubeUV(e,t){const r=this._renderer,n=e.mapping===ie||e.mapping===ae;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=ms()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=fs());const i=n?this._cubemapMaterial:this._equirectMaterial,a=new wa(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const s=this._cubeSize;ps(t,0,0,3*s,2*s),r.setRenderTarget(t),r.render(a,as)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let n=1;n<this._lodPlanes.length;n++){const t=Math.sqrt(this._sigmas[n]*this._sigmas[n]-this._sigmas[n-1]*this._sigmas[n-1]),r=us[(n-1)%us.length];this._blur(e,n-1,n,t,r)}t.autoClear=r}_blur(e,t,r,n,i){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,r,n,"latitudinal",i),this._halfBlur(a,e,r,r,n,"longitudinal",i)}_halfBlur(e,t,r,n,i,a,s){const o=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new wa(this._lodPlanes[n],l),u=l.uniforms,h=this._sizeLods[r]-1,d=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,p=i/d,f=isFinite(i)?1+Math.floor(3*p):is;f>is&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let y=0;y<is;++y){const e=y/p,t=Math.exp(-e*e/2);m.push(t),0===y?g+=t:y<f&&(g+=2*t)}for(let y=0;y<m.length;y++)m[y]=m[y]/g;u.envMap.value=e.texture,u.samples.value=f,u.weights.value=m,u.latitudinal.value="latitudinal"===a,s&&(u.poleAxis.value=s);const{_lodMax:v}=this;u.dTheta.value=d,u.mipInt.value=v-r;const A=this._sizeLods[n];ps(t,3*A*(n>v-4?n-v+4:0),4*(this._cubeSize-A),3*A,2*A),o.setRenderTarget(t),o.render(c,as)}}function ds(e,t,r){const n=new rn(e,t,r);return n.texture.mapping=le,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function ps(e,t,r,n,i){e.viewport.set(t,r,n,i),e.scissor.set(t,r,n,i)}function fs(){return new Ia({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:gs(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:A,depthTest:!1,depthWrite:!1})}function ms(){return new Ia({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:gs(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:A,depthTest:!1,depthWrite:!1})}function gs(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function vs(e){let t=new WeakMap,r=null;function n(e){const r=e.target;r.removeEventListener("dispose",n);const i=t.get(r);void 0!==i&&(t.delete(r),i.dispose())}return{get:function(i){if(i&&i.isTexture){const a=i.mapping,s=a===se||a===oe,o=a===ie||a===ae;if(s||o){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let n=t.get(i);return null===r&&(r=new hs(e)),n=s?r.fromEquirectangular(i,n):r.fromCubemap(i,n),t.set(i,n),n.texture}if(t.has(i))return t.get(i).texture;{const a=i.image;if(s&&a&&a.height>0||o&&a&&function(e){let t=0;const r=6;for(let n=0;n<r;n++)void 0!==e[n]&&t++;return t===r}(a)){null===r&&(r=new hs(e));const a=s?r.fromEquirectangular(i):r.fromCubemap(i);return t.set(i,a),i.addEventListener("dispose",n),a.texture}return null}}}return i},dispose:function(){t=new WeakMap,null!==r&&(r.dispose(),r=null)}}}function As(e){const t={};function r(r){if(void 0!==t[r])return t[r];let n;switch(r){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(r)}return t[r]=n,n}return{has:function(e){return null!==r(e)},init:function(e){e.isWebGL2?r("EXT_color_buffer_float"):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float"),r("WEBGL_multisampled_render_to_texture")},get:function(e){const t=r(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function ys(e,t,r,n){const i={},a=new WeakMap;function s(e){const o=e.target;null!==o.index&&t.remove(o.index);for(const r in o.attributes)t.remove(o.attributes[r]);o.removeEventListener("dispose",s),delete i[o.id];const l=a.get(o);l&&(t.remove(l),a.delete(o)),n.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,r.memory.geometries--}function o(e){const r=[],n=e.index,i=e.attributes.position;let s=0;if(null!==n){const e=n.array;s=n.version;for(let t=0,n=e.length;t<n;t+=3){const n=e[t+0],i=e[t+1],a=e[t+2];r.push(n,i,i,a,a,n)}}else{const e=i.array;s=i.version;for(let t=0,n=e.length/3-1;t<n;t+=3){const e=t+0,n=t+1,i=t+2;r.push(e,n,n,i,i,e)}}const o=new(Ur(r)?Xi:ji)(r,1);o.version=s;const l=a.get(e);l&&t.remove(l),a.set(e,o)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",s),i[t.id]=!0,r.memory.geometries++),t},update:function(r){const n=r.attributes;for(const a in n)t.update(n[a],e.ARRAY_BUFFER);const i=r.morphAttributes;for(const a in i){const r=i[a];for(let n=0,i=r.length;n<i;n++)t.update(r[n],e.ARRAY_BUFFER)}},getWireframeAttribute:function(e){const t=a.get(e);if(t){const r=e.index;null!==r&&t.version<r.version&&o(e)}else o(e);return a.get(e)}}}function xs(e,t,r,n){const i=n.isWebGL2;let a,s,o;this.setMode=function(e){a=e},this.setIndex=function(e){s=e.type,o=e.bytesPerElement},this.render=function(t,n){e.drawElements(a,n,s,t*o),r.update(n,a,1)},this.renderInstances=function(n,l,c){if(0===c)return;let u,h;if(i)u=e,h="drawElementsInstanced";else if(u=t.get("ANGLE_instanced_arrays"),h="drawElementsInstancedANGLE",null===u)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[h](a,l,s,n*o,c),r.update(l,a,c)}}function bs(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(r,n,i){switch(t.calls++,n){case e.TRIANGLES:t.triangles+=i*(r/3);break;case e.LINES:t.lines+=i*(r/2);break;case e.LINE_STRIP:t.lines+=i*(r-1);break;case e.LINE_LOOP:t.lines+=i*r;break;case e.POINTS:t.points+=i*r;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function ws(e,t){return e[0]-t[0]}function Es(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Ss(e,t,r){const n={},i=new Float32Array(8),a=new WeakMap,s=new tn,o=[];for(let l=0;l<8;l++)o[l]=[l,0];return{update:function(l,c,u){const h=l.morphTargetInfluences;if(!0===t.isWebGL2){const d=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,p=void 0!==d?d.length:0;let f=a.get(c);if(void 0===f||f.count!==p){void 0!==f&&f.texture.dispose();const v=void 0!==c.morphAttributes.position,A=void 0!==c.morphAttributes.normal,y=void 0!==c.morphAttributes.color,x=c.morphAttributes.position||[],b=c.morphAttributes.normal||[],w=c.morphAttributes.color||[];let E=0;!0===v&&(E=1),!0===A&&(E=2),!0===y&&(E=3);let S=c.attributes.position.count*E,M=1;S>t.maxTextureSize&&(M=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);const _=new Float32Array(S*M*4*p),T=new nn(_,S,M,p);T.type=Ce,T.needsUpdate=!0;const C=4*E;for(let B=0;B<p;B++){const R=x[B],P=b[B],F=w[B],L=S*M*4*B;for(let D=0;D<R.count;D++){const U=D*C;!0===v&&(s.fromBufferAttribute(R,D),_[L+U+0]=s.x,_[L+U+1]=s.y,_[L+U+2]=s.z,_[L+U+3]=0),!0===A&&(s.fromBufferAttribute(P,D),_[L+U+4]=s.x,_[L+U+5]=s.y,_[L+U+6]=s.z,_[L+U+7]=0),!0===y&&(s.fromBufferAttribute(F,D),_[L+U+8]=s.x,_[L+U+9]=s.y,_[L+U+10]=s.z,_[L+U+11]=4===F.itemSize?s.w:1)}}function I(){T.dispose(),a.delete(c),c.removeEventListener("dispose",I)}f={count:p,texture:T,size:new Fr(S,M)},a.set(c,f),c.addEventListener("dispose",I)}let m=0;for(let N=0;N<h.length;N++)m+=h[N];const g=c.morphTargetsRelative?1:1-m;u.getUniforms().setValue(e,"morphTargetBaseInfluence",g),u.getUniforms().setValue(e,"morphTargetInfluences",h),u.getUniforms().setValue(e,"morphTargetsTexture",f.texture,r),u.getUniforms().setValue(e,"morphTargetsTextureSize",f.size)}else{const k=void 0===h?0:h.length;let O=n[c.id];if(void 0===O||O.length!==k){O=[];for(let Q=0;Q<k;Q++)O[Q]=[Q,0];n[c.id]=O}for(let j=0;j<k;j++){const W=O[j];W[0]=j,W[1]=h[j]}O.sort(Es);for(let X=0;X<8;X++)X<k&&O[X][1]?(o[X][0]=O[X][0],o[X][1]=O[X][1]):(o[X][0]=Number.MAX_SAFE_INTEGER,o[X][1]=0);o.sort(ws);const G=c.morphAttributes.position,z=c.morphAttributes.normal;let V=0;for(let Y=0;Y<8;Y++){const q=o[Y],K=q[0],J=q[1];K!==Number.MAX_SAFE_INTEGER&&J?(G&&c.getAttribute("morphTarget"+Y)!==G[K]&&c.setAttribute("morphTarget"+Y,G[K]),z&&c.getAttribute("morphNormal"+Y)!==z[K]&&c.setAttribute("morphNormal"+Y,z[K]),i[Y]=J,V+=J):(G&&!0===c.hasAttribute("morphTarget"+Y)&&c.deleteAttribute("morphTarget"+Y),z&&!0===c.hasAttribute("morphNormal"+Y)&&c.deleteAttribute("morphNormal"+Y),i[Y]=0)}const H=c.morphTargetsRelative?1:1-V;u.getUniforms().setValue(e,"morphTargetBaseInfluence",H),u.getUniforms().setValue(e,"morphTargetInfluences",i)}}}}function Ms(e,t,r,n){let i=new WeakMap;function a(e){const t=e.target;t.removeEventListener("dispose",a),r.remove(t.instanceMatrix),null!==t.instanceColor&&r.remove(t.instanceColor)}return{update:function(s){const o=n.render.frame,l=s.geometry,c=t.get(s,l);return i.get(c)!==o&&(t.update(c),i.set(c,o)),s.isInstancedMesh&&(!1===s.hasEventListener("dispose",a)&&s.addEventListener("dispose",a),r.update(s.instanceMatrix,e.ARRAY_BUFFER),null!==s.instanceColor&&r.update(s.instanceColor,e.ARRAY_BUFFER)),c},dispose:function(){i=new WeakMap}}}const _s=new en,Ts=new nn,Cs=new sn,Is=new La,Bs=[],Rs=[],Ps=new Float32Array(16),Fs=new Float32Array(9),Ls=new Float32Array(4);function Ds(e,t,r){const n=e[0];if(n<=0||n>0)return e;const i=t*r;let a=Bs[i];if(void 0===a&&(a=new Float32Array(i),Bs[i]=a),0!==t){n.toArray(a,0);for(let n=1,i=0;n!==t;++n)i+=r,e[n].toArray(a,i)}return a}function Us(e,t){if(e.length!==t.length)return!1;for(let r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Ns(e,t){for(let r=0,n=t.length;r<n;r++)e[r]=t[r]}function ks(e,t){let r=Rs[t];void 0===r&&(r=new Int32Array(t),Rs[t]=r);for(let n=0;n!==t;++n)r[n]=e.allocateTextureUnit();return r}function Os(e,t){const r=this.cache;r[0]!==t&&(e.uniform1f(this.addr,t),r[0]=t)}function Gs(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),r[0]=t.x,r[1]=t.y);else{if(Us(r,t))return;e.uniform2fv(this.addr,t),Ns(r,t)}}function zs(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),r[0]=t.x,r[1]=t.y,r[2]=t.z);else if(void 0!==t.r)r[0]===t.r&&r[1]===t.g&&r[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),r[0]=t.r,r[1]=t.g,r[2]=t.b);else{if(Us(r,t))return;e.uniform3fv(this.addr,t),Ns(r,t)}}function Vs(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z&&r[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=t.w);else{if(Us(r,t))return;e.uniform4fv(this.addr,t),Ns(r,t)}}function Hs(e,t){const r=this.cache,n=t.elements;if(void 0===n){if(Us(r,t))return;e.uniformMatrix2fv(this.addr,!1,t),Ns(r,t)}else{if(Us(r,n))return;Ls.set(n),e.uniformMatrix2fv(this.addr,!1,Ls),Ns(r,n)}}function Qs(e,t){const r=this.cache,n=t.elements;if(void 0===n){if(Us(r,t))return;e.uniformMatrix3fv(this.addr,!1,t),Ns(r,t)}else{if(Us(r,n))return;Fs.set(n),e.uniformMatrix3fv(this.addr,!1,Fs),Ns(r,n)}}function js(e,t){const r=this.cache,n=t.elements;if(void 0===n){if(Us(r,t))return;e.uniformMatrix4fv(this.addr,!1,t),Ns(r,t)}else{if(Us(r,n))return;Ps.set(n),e.uniformMatrix4fv(this.addr,!1,Ps),Ns(r,n)}}function Ws(e,t){const r=this.cache;r[0]!==t&&(e.uniform1i(this.addr,t),r[0]=t)}function Xs(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y||(e.uniform2i(this.addr,t.x,t.y),r[0]=t.x,r[1]=t.y);else{if(Us(r,t))return;e.uniform2iv(this.addr,t),Ns(r,t)}}function Ys(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z||(e.uniform3i(this.addr,t.x,t.y,t.z),r[0]=t.x,r[1]=t.y,r[2]=t.z);else{if(Us(r,t))return;e.uniform3iv(this.addr,t),Ns(r,t)}}function qs(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z&&r[3]===t.w||(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=t.w);else{if(Us(r,t))return;e.uniform4iv(this.addr,t),Ns(r,t)}}function Ks(e,t){const r=this.cache;r[0]!==t&&(e.uniform1ui(this.addr,t),r[0]=t)}function Js(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y||(e.uniform2ui(this.addr,t.x,t.y),r[0]=t.x,r[1]=t.y);else{if(Us(r,t))return;e.uniform2uiv(this.addr,t),Ns(r,t)}}function Zs(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z||(e.uniform3ui(this.addr,t.x,t.y,t.z),r[0]=t.x,r[1]=t.y,r[2]=t.z);else{if(Us(r,t))return;e.uniform3uiv(this.addr,t),Ns(r,t)}}function $s(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z&&r[3]===t.w||(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=t.w);else{if(Us(r,t))return;e.uniform4uiv(this.addr,t),Ns(r,t)}}function eo(e,t,r){const n=this.cache,i=r.allocateTextureUnit();n[0]!==i&&(e.uniform1i(this.addr,i),n[0]=i),r.setTexture2D(t||_s,i)}function to(e,t,r){const n=this.cache,i=r.allocateTextureUnit();n[0]!==i&&(e.uniform1i(this.addr,i),n[0]=i),r.setTexture3D(t||Cs,i)}function ro(e,t,r){const n=this.cache,i=r.allocateTextureUnit();n[0]!==i&&(e.uniform1i(this.addr,i),n[0]=i),r.setTextureCube(t||Is,i)}function no(e,t,r){const n=this.cache,i=r.allocateTextureUnit();n[0]!==i&&(e.uniform1i(this.addr,i),n[0]=i),r.setTexture2DArray(t||Ts,i)}function io(e,t){e.uniform1fv(this.addr,t)}function ao(e,t){const r=Ds(t,this.size,2);e.uniform2fv(this.addr,r)}function so(e,t){const r=Ds(t,this.size,3);e.uniform3fv(this.addr,r)}function oo(e,t){const r=Ds(t,this.size,4);e.uniform4fv(this.addr,r)}function lo(e,t){const r=Ds(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,r)}function co(e,t){const r=Ds(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,r)}function uo(e,t){const r=Ds(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,r)}function ho(e,t){e.uniform1iv(this.addr,t)}function po(e,t){e.uniform2iv(this.addr,t)}function fo(e,t){e.uniform3iv(this.addr,t)}function mo(e,t){e.uniform4iv(this.addr,t)}function go(e,t){e.uniform1uiv(this.addr,t)}function vo(e,t){e.uniform2uiv(this.addr,t)}function Ao(e,t){e.uniform3uiv(this.addr,t)}function yo(e,t){e.uniform4uiv(this.addr,t)}function xo(e,t,r){const n=this.cache,i=t.length,a=ks(r,i);Us(n,a)||(e.uniform1iv(this.addr,a),Ns(n,a));for(let s=0;s!==i;++s)r.setTexture2D(t[s]||_s,a[s])}function bo(e,t,r){const n=this.cache,i=t.length,a=ks(r,i);Us(n,a)||(e.uniform1iv(this.addr,a),Ns(n,a));for(let s=0;s!==i;++s)r.setTexture3D(t[s]||Cs,a[s])}function wo(e,t,r){const n=this.cache,i=t.length,a=ks(r,i);Us(n,a)||(e.uniform1iv(this.addr,a),Ns(n,a));for(let s=0;s!==i;++s)r.setTextureCube(t[s]||Is,a[s])}function Eo(e,t,r){const n=this.cache,i=t.length,a=ks(r,i);Us(n,a)||(e.uniform1iv(this.addr,a),Ns(n,a));for(let s=0;s!==i;++s)r.setTexture2DArray(t[s]||Ts,a[s])}class So{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.setValue=function(e){switch(e){case 5126:return Os;case 35664:return Gs;case 35665:return zs;case 35666:return Vs;case 35674:return Hs;case 35675:return Qs;case 35676:return js;case 5124:case 35670:return Ws;case 35667:case 35671:return Xs;case 35668:case 35672:return Ys;case 35669:case 35673:return qs;case 5125:return Ks;case 36294:return Js;case 36295:return Zs;case 36296:return $s;case 35678:case 36198:case 36298:case 36306:case 35682:return eo;case 35679:case 36299:case 36307:return to;case 35680:case 36300:case 36308:case 36293:return ro;case 36289:case 36303:case 36311:case 36292:return no}}(t.type)}}class Mo{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return io;case 35664:return ao;case 35665:return so;case 35666:return oo;case 35674:return lo;case 35675:return co;case 35676:return uo;case 5124:case 35670:return ho;case 35667:case 35671:return po;case 35668:case 35672:return fo;case 35669:case 35673:return mo;case 5125:return go;case 36294:return vo;case 36295:return Ao;case 36296:return yo;case 35678:case 36198:case 36298:case 36306:case 35682:return xo;case 35679:case 36299:case 36307:return bo;case 35680:case 36300:case 36308:case 36293:return wo;case 36289:case 36303:case 36311:case 36292:return Eo}}(t.type)}}class _o{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,r){const n=this.seq;for(let i=0,a=n.length;i!==a;++i){const a=n[i];a.setValue(e,t[a.id],r)}}}const To=/(\w+)(\])?(\[|\.)?/g;function Co(e,t){e.seq.push(t),e.map[t.id]=t}function Io(e,t,r){const n=e.name,i=n.length;for(To.lastIndex=0;;){const a=To.exec(n),s=To.lastIndex;let o=a[1];const l="]"===a[2],c=a[3];if(l&&(o|=0),void 0===c||"["===c&&s+2===i){Co(r,void 0===c?new So(o,e,t):new Mo(o,e,t));break}{let e=r.map[o];void 0===e&&(e=new _o(o),Co(r,e)),r=e}}}class Bo{constructor(e,t){this.seq=[],this.map={};const r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let n=0;n<r;++n){const r=e.getActiveUniform(t,n);Io(r,e.getUniformLocation(t,r.name),this)}}setValue(e,t,r,n){const i=this.map[t];void 0!==i&&i.setValue(e,r,n)}setOptional(e,t,r){const n=t[r];void 0!==n&&this.setValue(e,r,n)}static upload(e,t,r,n){for(let i=0,a=t.length;i!==a;++i){const a=t[i],s=r[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,n)}}static seqWithValue(e,t){const r=[];for(let n=0,i=e.length;n!==i;++n){const i=e[n];i.id in t&&r.push(i)}return r}}function Ro(e,t,r){const n=e.createShader(t);return e.shaderSource(n,r),e.compileShader(n),n}let Po=0;function Fo(e,t,r){const n=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(n&&""===i)return"";const a=/ERROR: 0:(\d+)/.exec(i);if(a){const n=parseInt(a[1]);return r.toUpperCase()+"\n\n"+i+"\n\n"+function(e,t){const r=e.split("\n"),n=[],i=Math.max(t-6,0),a=Math.min(t+6,r.length);for(let s=i;s<a;s++){const e=s+1;n.push(`${e===t?">":" "} ${e}: ${r[s]}`)}return n.join("\n")}(e.getShaderSource(t),n)}return i}function Lo(e,t){const r=function(e){switch(e){case Vt:return["Linear","( value )"];case zt:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),["Linear","( value )"]}}(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+r[0]+r[1]+"; }"}function Do(e,t){let r;switch(t){case Z:r="Linear";break;case $:r="Reinhard";break;case ee:r="OptimizedCineon";break;case te:r="ACESFilmic";break;case re:r="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),r="Linear"}return"vec3 "+e+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function Uo(e){return""!==e}function No(e,t){const r=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,r).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function ko(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Oo=/^[ \t]*#include +<([\w\d./]+)>/gm;function Go(e){return e.replace(Oo,zo)}function zo(e,t){const r=Wa[t];if(void 0===r)throw new Error("Can not resolve #include <"+t+">");return Go(r)}const Vo=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Ho(e){return e.replace(Vo,Qo)}function Qo(e,t,r,n){let i="";for(let a=parseInt(t);a<parseInt(r);a++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function jo(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Wo(e,t,r,n){const i=e.getContext(),a=r.defines;let s=r.vertexShader,o=r.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===h?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===d?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===p&&(t="SHADOWMAP_TYPE_VSM"),t}(r),c=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case ie:case ae:t="ENVMAP_TYPE_CUBE";break;case le:t="ENVMAP_TYPE_CUBE_UV"}return t}(r),u=function(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===ae&&(t="ENVMAP_MODE_REFRACTION");return t}(r),f=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case Y:t="ENVMAP_BLENDING_MULTIPLY";break;case q:t="ENVMAP_BLENDING_MIX";break;case K:t="ENVMAP_BLENDING_ADD"}return t}(r),m=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const r=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,r),112)),texelHeight:n,maxMip:r}}(r),g=r.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUVHeight||e.bumpMap||e.normalMapTangentSpace||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Uo).join("\n")}(r),v=function(e){const t=[];for(const r in e){const n=e[r];!1!==n&&t.push("#define "+r+" "+n)}return t.join("\n")}(a),A=i.createProgram();let y,x,b=r.glslVersion?"#version "+r.glslVersion+"\n":"";r.isRawShaderMaterial?(y=[v].filter(Uo).join("\n"),y.length>0&&(y+="\n"),x=[g,v].filter(Uo).join("\n"),x.length>0&&(x+="\n")):(y=[jo(r),"#define SHADER_NAME "+r.shaderName,v,r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+u:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.displacementMap?"#define USE_DISPLACEMENTMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.mapUv?"#define MAP_UV "+r.mapUv:"",r.alphaMapUv?"#define ALPHAMAP_UV "+r.alphaMapUv:"",r.lightMapUv?"#define LIGHTMAP_UV "+r.lightMapUv:"",r.aoMapUv?"#define AOMAP_UV "+r.aoMapUv:"",r.emissiveMapUv?"#define EMISSIVEMAP_UV "+r.emissiveMapUv:"",r.bumpMapUv?"#define BUMPMAP_UV "+r.bumpMapUv:"",r.normalMapUv?"#define NORMALMAP_UV "+r.normalMapUv:"",r.displacementMapUv?"#define DISPLACEMENTMAP_UV "+r.displacementMapUv:"",r.metalnessMapUv?"#define METALNESSMAP_UV "+r.metalnessMapUv:"",r.roughnessMapUv?"#define ROUGHNESSMAP_UV "+r.roughnessMapUv:"",r.clearcoatMapUv?"#define CLEARCOATMAP_UV "+r.clearcoatMapUv:"",r.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+r.clearcoatNormalMapUv:"",r.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+r.clearcoatRoughnessMapUv:"",r.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+r.iridescenceMapUv:"",r.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+r.iridescenceThicknessMapUv:"",r.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+r.sheenColorMapUv:"",r.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+r.sheenRoughnessMapUv:"",r.specularMapUv?"#define SPECULARMAP_UV "+r.specularMapUv:"",r.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+r.specularColorMapUv:"",r.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+r.specularIntensityMapUv:"",r.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+r.transmissionMapUv:"",r.thicknessMapUv?"#define THICKNESSMAP_UV "+r.thicknessMapUv:"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.morphColors&&r.isWebGL2?"#define USE_MORPHCOLORS":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+r.morphTextureStride:"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Uo).join("\n"),x=[g,jo(r),"#define SHADER_NAME "+r.shaderName,v,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+c:"",r.envMap?"#define "+u:"",r.envMap?"#define "+f:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescence?"#define USE_IRIDESCENCE":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.useLegacyLights?"#define LEGACY_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==J?"#define TONE_MAPPING":"",r.toneMapping!==J?Wa.tonemapping_pars_fragment:"",r.toneMapping!==J?Do("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.opaque?"#define OPAQUE":"",Wa.encodings_pars_fragment,Lo("linearToOutputTexel",r.outputColorSpace),r.useDepthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Uo).join("\n")),s=Go(s),s=No(s,r),s=ko(s,r),o=Go(o),o=No(o,r),o=ko(o,r),s=Ho(s),o=Ho(o),r.isWebGL2&&!0!==r.isRawShaderMaterial&&(b="#version 300 es\n",y=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+y,x=["#define varying in",r.glslVersion===gr?"":"layout(location = 0) out highp vec4 pc_fragColor;",r.glslVersion===gr?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+x);const w=b+y+s,E=b+x+o,S=Ro(i,i.VERTEX_SHADER,w),M=Ro(i,i.FRAGMENT_SHADER,E);if(i.attachShader(A,S),i.attachShader(A,M),void 0!==r.index0AttributeName?i.bindAttribLocation(A,0,r.index0AttributeName):!0===r.morphTargets&&i.bindAttribLocation(A,0,"position"),i.linkProgram(A),e.debug.checkShaderErrors){const t=i.getProgramInfoLog(A).trim(),r=i.getShaderInfoLog(S).trim(),n=i.getShaderInfoLog(M).trim();let a=!0,s=!0;if(!1===i.getProgramParameter(A,i.LINK_STATUS))if(a=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(i,A,S,M);else{const e=Fo(i,S,"vertex"),r=Fo(i,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(A,i.VALIDATE_STATUS)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+r)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==r&&""!==n||(s=!1);s&&(this.diagnostics={runnable:a,programLog:t,vertexShader:{log:r,prefix:y},fragmentShader:{log:n,prefix:x}})}let _,T;return i.deleteShader(S),i.deleteShader(M),this.getUniforms=function(){return void 0===_&&(_=new Bo(i,A)),_},this.getAttributes=function(){return void 0===T&&(T=function(e,t){const r={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const n=e.getActiveAttrib(t,i),a=n.name;let s=1;n.type===e.FLOAT_MAT2&&(s=2),n.type===e.FLOAT_MAT3&&(s=3),n.type===e.FLOAT_MAT4&&(s=4),r[a]={type:n.type,location:e.getAttribLocation(t,a),locationSize:s}}return r}(i,A)),T},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(A),this.program=void 0},this.name=r.shaderName,this.id=Po++,this.cacheKey=t,this.usedTimes=1,this.program=A,this.vertexShader=S,this.fragmentShader=M,this}let Xo=0;class Yo{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,n=this._getShaderStage(t),i=this._getShaderStage(r),a=this._getShaderCacheForMaterial(e);return!1===a.has(n)&&(a.add(n),n.usedTimes++),!1===a.has(i)&&(a.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,0===r.usedTimes&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let r=t.get(e);return void 0===r&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return void 0===r&&(r=new qo(e),t.set(e,r)),r}}class qo{constructor(e){this.id=Xo++,this.code=e,this.usedTimes=0}}function Ko(e,t,r,n,i,a,s){const o=new Jn,l=new Yo,c=[],u=i.isWebGL2,h=i.logarithmicDepthBuffer,d=i.vertexTextures;let p=i.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(e){return 1===e?"uv1":2===e?"uv2":3===e?"uv3":"uv"}return{getParameters:function(a,o,c,A,x){const b=A.fog,w=x.geometry,E=a.isMeshStandardMaterial?A.environment:null,S=(a.isMeshStandardMaterial?r:t).get(a.envMap||E),M=S&&S.mapping===le?S.image.height:null,_=f[a.type];null!==a.precision&&(p=i.getMaxPrecision(a.precision),p!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",p,"instead."));const T=w.morphAttributes.position||w.morphAttributes.normal||w.morphAttributes.color,C=void 0!==T?T.length:0;let I,B,R,P,F=0;if(void 0!==w.morphAttributes.position&&(F=1),void 0!==w.morphAttributes.normal&&(F=2),void 0!==w.morphAttributes.color&&(F=3),_){const e=Ya[_];I=e.vertexShader,B=e.fragmentShader}else I=a.vertexShader,B=a.fragmentShader,l.update(a),R=l.getVertexShaderID(a),P=l.getFragmentShaderID(a);const L=e.getRenderTarget(),D=!0===x.isInstancedMesh,U=!!a.map,N=!!a.matcap,k=!!S,O=!!a.aoMap,G=!!a.lightMap,z=!!a.bumpMap,V=!!a.normalMap,H=!!a.displacementMap,Q=!!a.emissiveMap,j=!!a.metalnessMap,W=!!a.roughnessMap,X=a.clearcoat>0,Y=a.iridescence>0,q=a.sheen>0,K=a.transmission>0,Z=X&&!!a.clearcoatMap,$=X&&!!a.clearcoatNormalMap,ee=X&&!!a.clearcoatRoughnessMap,te=Y&&!!a.iridescenceMap,re=Y&&!!a.iridescenceThicknessMap,ne=q&&!!a.sheenColorMap,ie=q&&!!a.sheenRoughnessMap,ae=!!a.specularMap,se=!!a.specularColorMap,oe=!!a.specularIntensityMap,ce=K&&!!a.transmissionMap,ue=K&&!!a.thicknessMap,he=!!a.gradientMap,de=!!a.alphaMap,pe=a.alphaTest>0,fe=!!a.extensions,me=!!w.attributes.uv1,ge=!!w.attributes.uv2,ve=!!w.attributes.uv3;return{isWebGL2:u,shaderID:_,shaderName:a.type,vertexShader:I,fragmentShader:B,defines:a.defines,customVertexShaderID:R,customFragmentShaderID:P,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:p,instancing:D,instancingColor:D&&null!==x.instanceColor,supportsVertexTextures:d,outputColorSpace:null===L?e.outputColorSpace:!0===L.isXRRenderTarget?L.texture.colorSpace:Vt,map:U,matcap:N,envMap:k,envMapMode:k&&S.mapping,envMapCubeUVHeight:M,aoMap:O,lightMap:G,bumpMap:z,normalMap:V,displacementMap:d&&H,emissiveMap:Q,normalMapObjectSpace:V&&a.normalMapType===Ot,normalMapTangentSpace:V&&a.normalMapType===kt,metalnessMap:j,roughnessMap:W,clearcoat:X,clearcoatMap:Z,clearcoatNormalMap:$,clearcoatRoughnessMap:ee,iridescence:Y,iridescenceMap:te,iridescenceThicknessMap:re,sheen:q,sheenColorMap:ne,sheenRoughnessMap:ie,specularMap:ae,specularColorMap:se,specularIntensityMap:oe,transmission:K,transmissionMap:ce,thicknessMap:ue,gradientMap:he,opaque:!1===a.transparent&&a.blending===y,alphaMap:de,alphaTest:pe,combine:a.combine,mapUv:U&&v(a.map.channel),aoMapUv:O&&v(a.aoMap.channel),lightMapUv:G&&v(a.lightMap.channel),bumpMapUv:z&&v(a.bumpMap.channel),normalMapUv:V&&v(a.normalMap.channel),displacementMapUv:H&&v(a.displacementMap.channel),emissiveMapUv:Q&&v(a.emissiveMap.channel),metalnessMapUv:j&&v(a.metalnessMap.channel),roughnessMapUv:W&&v(a.roughnessMap.channel),clearcoatMapUv:Z&&v(a.clearcoatMap.channel),clearcoatNormalMapUv:$&&v(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ee&&v(a.clearcoatRoughnessMap.channel),iridescenceMapUv:te&&v(a.iridescenceMap.channel),iridescenceThicknessMapUv:re&&v(a.iridescenceThicknessMap.channel),sheenColorMapUv:ne&&v(a.sheenColorMap.channel),sheenRoughnessMapUv:ie&&v(a.sheenRoughnessMap.channel),specularMapUv:ae&&v(a.specularMap.channel),specularColorMapUv:se&&v(a.specularColorMap.channel),specularIntensityMapUv:oe&&v(a.specularIntensityMap.channel),transmissionMapUv:ce&&v(a.transmissionMap.channel),thicknessMapUv:ue&&v(a.thicknessMap.channel),alphaMapUv:de&&v(a.alphaMap.channel),vertexTangents:V&&!!w.attributes.tangent,vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!w.attributes.color&&4===w.attributes.color.itemSize,vertexUv1s:me,vertexUv2s:ge,vertexUv3s:ve,pointsUvs:!0===x.isPoints&&!!w.attributes.uv&&(U||de),fog:!!b,useFog:!0===a.fog,fogExp2:b&&b.isFogExp2,flatShading:!0===a.flatShading,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==w.morphAttributes.position,morphNormals:void 0!==w.morphAttributes.normal,morphColors:void 0!==w.morphAttributes.color,morphTargetsCount:C,morphTextureStride:F,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:a.toneMapped?e.toneMapping:J,useLegacyLights:e.useLegacyLights,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===g,flipSided:a.side===m,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionDerivatives:fe&&!0===a.extensions.derivatives,extensionFragDepth:fe&&!0===a.extensions.fragDepth,extensionDrawBuffers:fe&&!0===a.extensions.drawBuffers,extensionShaderTextureLOD:fe&&!0===a.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||n.has("EXT_shader_texture_lod"),customProgramCacheKey:a.customProgramCacheKey()}},getProgramCacheKey:function(t){const r=[];if(t.shaderID?r.push(t.shaderID):(r.push(t.customVertexShaderID),r.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)r.push(e),r.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(r,t),function(e,t){o.disableAll(),t.isWebGL2&&o.enable(0);t.supportsVertexTextures&&o.enable(1);t.instancing&&o.enable(2);t.instancingColor&&o.enable(3);t.matcap&&o.enable(4);t.envMap&&o.enable(5);t.normalMapObjectSpace&&o.enable(6);t.normalMapTangentSpace&&o.enable(7);t.clearcoat&&o.enable(8);t.iridescence&&o.enable(9);t.alphaTest&&o.enable(10);t.vertexColors&&o.enable(11);t.vertexAlphas&&o.enable(12);t.vertexUv1s&&o.enable(13);t.vertexUv2s&&o.enable(14);t.vertexUv3s&&o.enable(15);t.vertexTangents&&o.enable(16);e.push(o.mask),o.disableAll(),t.fog&&o.enable(0);t.useFog&&o.enable(1);t.flatShading&&o.enable(2);t.logarithmicDepthBuffer&&o.enable(3);t.skinning&&o.enable(4);t.morphTargets&&o.enable(5);t.morphNormals&&o.enable(6);t.morphColors&&o.enable(7);t.premultipliedAlpha&&o.enable(8);t.shadowMapEnabled&&o.enable(9);t.useLegacyLights&&o.enable(10);t.doubleSided&&o.enable(11);t.flipSided&&o.enable(12);t.useDepthPacking&&o.enable(13);t.dithering&&o.enable(14);t.transmission&&o.enable(15);t.sheen&&o.enable(16);t.opaque&&o.enable(17);t.pointsUvs&&o.enable(18);e.push(o.mask)}(r,t),r.push(e.outputColorSpace)),r.push(t.customProgramCacheKey),r.join()},getUniforms:function(e){const t=f[e.type];let r;if(t){const e=Ya[t];r=Ca.clone(e.uniforms)}else r=e.uniforms;return r},acquireProgram:function(t,r){let n;for(let e=0,i=c.length;e<i;e++){const t=c[e];if(t.cacheKey===r){n=t,++n.usedTimes;break}}return void 0===n&&(n=new Wo(e,r,t,a),c.push(n)),n},releaseProgram:function(e){if(0==--e.usedTimes){const t=c.indexOf(e);c[t]=c[c.length-1],c.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:c,dispose:function(){l.dispose()}}}function Jo(){let e=new WeakMap;return{get:function(t){let r=e.get(t);return void 0===r&&(r={},e.set(t,r)),r},remove:function(t){e.delete(t)},update:function(t,r,n){e.get(t)[r]=n},dispose:function(){e=new WeakMap}}}function Zo(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function $o(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function el(){const e=[];let t=0;const r=[],n=[],i=[];function a(r,n,i,a,s,o){let l=e[t];return void 0===l?(l={id:r.id,object:r,geometry:n,material:i,groupOrder:a,renderOrder:r.renderOrder,z:s,group:o},e[t]=l):(l.id=r.id,l.object=r,l.geometry=n,l.material=i,l.groupOrder=a,l.renderOrder=r.renderOrder,l.z=s,l.group=o),t++,l}return{opaque:r,transmissive:n,transparent:i,init:function(){t=0,r.length=0,n.length=0,i.length=0},push:function(e,t,s,o,l,c){const u=a(e,t,s,o,l,c);s.transmission>0?n.push(u):!0===s.transparent?i.push(u):r.push(u)},unshift:function(e,t,s,o,l,c){const u=a(e,t,s,o,l,c);s.transmission>0?n.unshift(u):!0===s.transparent?i.unshift(u):r.unshift(u)},finish:function(){for(let r=t,n=e.length;r<n;r++){const t=e[r];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){r.length>1&&r.sort(e||Zo),n.length>1&&n.sort(t||$o),i.length>1&&i.sort(t||$o)}}}function tl(){let e=new WeakMap;return{get:function(t,r){const n=e.get(t);let i;return void 0===n?(i=new el,e.set(t,[i])):r>=n.length?(i=new el,n.push(i)):i=n[r],i},dispose:function(){e=new WeakMap}}}function rl(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let r;switch(t.type){case"DirectionalLight":r={direction:new un,color:new Bi};break;case"SpotLight":r={position:new un,direction:new un,color:new Bi,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new un,color:new Bi,distance:0,decay:0};break;case"HemisphereLight":r={direction:new un,skyColor:new Bi,groundColor:new Bi};break;case"RectAreaLight":r={color:new Bi,position:new un,halfWidth:new un,halfHeight:new un}}return e[t.id]=r,r}}}let nl=0;function il(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function al(e,t){const r=new rl,n=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let r;switch(t.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fr};break;case"PointLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fr,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=r,r}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let l=0;l<9;l++)i.probe.push(new un);const a=new un,s=new Gn,o=new Gn;return{setup:function(a,s){let o=0,l=0,c=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let u=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,A=0,y=0;a.sort(il);const x=!0===s?Math.PI:1;for(let e=0,t=a.length;e<t;e++){const t=a[e],s=t.color,b=t.intensity,w=t.distance,E=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)o+=s.r*b*x,l+=s.g*b*x,c+=s.b*b*x;else if(t.isLightProbe)for(let e=0;e<9;e++)i.probe[e].addScaledVector(t.sh.coefficients[e],b);else if(t.isDirectionalLight){const e=r.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*x),t.castShadow){const e=t.shadow,r=n.get(t);r.shadowBias=e.bias,r.shadowNormalBias=e.normalBias,r.shadowRadius=e.radius,r.shadowMapSize=e.mapSize,i.directionalShadow[u]=r,i.directionalShadowMap[u]=E,i.directionalShadowMatrix[u]=t.shadow.matrix,m++}i.directional[u]=e,u++}else if(t.isSpotLight){const e=r.get(t);e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(s).multiplyScalar(b*x),e.distance=w,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,i.spot[d]=e;const a=t.shadow;if(t.map&&(i.spotLightMap[A]=t.map,A++,a.updateMatrices(t),t.castShadow&&y++),i.spotLightMatrix[d]=a.matrix,t.castShadow){const e=n.get(t);e.shadowBias=a.bias,e.shadowNormalBias=a.normalBias,e.shadowRadius=a.radius,e.shadowMapSize=a.mapSize,i.spotShadow[d]=e,i.spotShadowMap[d]=E,v++}d++}else if(t.isRectAreaLight){const e=r.get(t);e.color.copy(s).multiplyScalar(b),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),i.rectArea[p]=e,p++}else if(t.isPointLight){const e=r.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*x),e.distance=t.distance,e.decay=t.decay,t.castShadow){const e=t.shadow,r=n.get(t);r.shadowBias=e.bias,r.shadowNormalBias=e.normalBias,r.shadowRadius=e.radius,r.shadowMapSize=e.mapSize,r.shadowCameraNear=e.camera.near,r.shadowCameraFar=e.camera.far,i.pointShadow[h]=r,i.pointShadowMap[h]=E,i.pointShadowMatrix[h]=t.shadow.matrix,g++}i.point[h]=e,h++}else if(t.isHemisphereLight){const e=r.get(t);e.skyColor.copy(t.color).multiplyScalar(b*x),e.groundColor.copy(t.groundColor).multiplyScalar(b*x),i.hemi[f]=e,f++}}p>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=Xa.LTC_FLOAT_1,i.rectAreaLTC2=Xa.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=Xa.LTC_HALF_1,i.rectAreaLTC2=Xa.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=o,i.ambient[1]=l,i.ambient[2]=c;const b=i.hash;b.directionalLength===u&&b.pointLength===h&&b.spotLength===d&&b.rectAreaLength===p&&b.hemiLength===f&&b.numDirectionalShadows===m&&b.numPointShadows===g&&b.numSpotShadows===v&&b.numSpotMaps===A||(i.directional.length=u,i.spot.length=d,i.rectArea.length=p,i.point.length=h,i.hemi.length=f,i.directionalShadow.length=m,i.directionalShadowMap.length=m,i.pointShadow.length=g,i.pointShadowMap.length=g,i.spotShadow.length=v,i.spotShadowMap.length=v,i.directionalShadowMatrix.length=m,i.pointShadowMatrix.length=g,i.spotLightMatrix.length=v+A-y,i.spotLightMap.length=A,i.numSpotLightShadowsWithMaps=y,b.directionalLength=u,b.pointLength=h,b.spotLength=d,b.rectAreaLength=p,b.hemiLength=f,b.numDirectionalShadows=m,b.numPointShadows=g,b.numSpotShadows=v,b.numSpotMaps=A,i.version=nl++)},setupView:function(e,t){let r=0,n=0,l=0,c=0,u=0;const h=t.matrixWorldInverse;for(let d=0,p=e.length;d<p;d++){const t=e[d];if(t.isDirectionalLight){const e=i.directional[r];e.direction.setFromMatrixPosition(t.matrixWorld),a.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(h),r++}else if(t.isSpotLight){const e=i.spot[l];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(h),e.direction.setFromMatrixPosition(t.matrixWorld),a.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(h),l++}else if(t.isRectAreaLight){const e=i.rectArea[c];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(h),o.identity(),s.copy(t.matrixWorld),s.premultiply(h),o.extractRotation(s),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),c++}else if(t.isPointLight){const e=i.point[n];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(h),n++}else if(t.isHemisphereLight){const e=i.hemi[u];e.direction.setFromMatrixPosition(t.matrixWorld),e.direction.transformDirection(h),u++}}},state:i}}function sl(e,t){const r=new al(e,t),n=[],i=[];return{init:function(){n.length=0,i.length=0},state:{lightsArray:n,shadowsArray:i,lights:r},setupLights:function(e){r.setup(n,e)},setupLightsView:function(e){r.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){i.push(e)}}}function ol(e,t){let r=new WeakMap;return{get:function(n,i=0){const a=r.get(n);let s;return void 0===a?(s=new sl(e,t),r.set(n,[s])):i>=a.length?(s=new sl(e,t),a.push(s)):s=a[i],s},dispose:function(){r=new WeakMap}}}class ll extends Mi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Ut,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class cl extends Mi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function ul(e,t,r){let n=new Va;const i=new Fr,a=new Fr,s=new tn,o=new ll({depthPacking:Nt}),l=new cl,c={},u=r.maxTextureSize,d={[f]:m,[m]:f,[g]:g},v=new Ia({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Fr},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),y=v.clone();y.defines.HORIZONTAL_PASS=1;const x=new ia;x.setAttribute("position",new Gi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new wa(x,v),w=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=h;let E=this.type;function S(r,n){const a=t.update(b);v.defines.VSM_SAMPLES!==r.blurSamples&&(v.defines.VSM_SAMPLES=r.blurSamples,y.defines.VSM_SAMPLES=r.blurSamples,v.needsUpdate=!0,y.needsUpdate=!0),null===r.mapPass&&(r.mapPass=new rn(i.x,i.y)),v.uniforms.shadow_pass.value=r.map.texture,v.uniforms.resolution.value=r.mapSize,v.uniforms.radius.value=r.radius,e.setRenderTarget(r.mapPass),e.clear(),e.renderBufferDirect(n,null,a,v,b,null),y.uniforms.shadow_pass.value=r.mapPass.texture,y.uniforms.resolution.value=r.mapSize,y.uniforms.radius.value=r.radius,e.setRenderTarget(r.map),e.clear(),e.renderBufferDirect(n,null,a,y,b,null)}function M(t,r,n,i){let a=null;const s=!0===n.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==s)a=s;else if(a=!0===n.isPointLight?l:o,e.localClippingEnabled&&!0===r.clipShadows&&Array.isArray(r.clippingPlanes)&&0!==r.clippingPlanes.length||r.displacementMap&&0!==r.displacementScale||r.alphaMap&&r.alphaTest>0||r.map&&r.alphaTest>0){const e=a.uuid,t=r.uuid;let n=c[e];void 0===n&&(n={},c[e]=n);let i=n[t];void 0===i&&(i=a.clone(),n[t]=i),a=i}if(a.visible=r.visible,a.wireframe=r.wireframe,a.side=i===p?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:d[r.side],a.alphaMap=r.alphaMap,a.alphaTest=r.alphaTest,a.map=r.map,a.clipShadows=r.clipShadows,a.clippingPlanes=r.clippingPlanes,a.clipIntersection=r.clipIntersection,a.displacementMap=r.displacementMap,a.displacementScale=r.displacementScale,a.displacementBias=r.displacementBias,a.wireframeLinewidth=r.wireframeLinewidth,a.linewidth=r.linewidth,!0===n.isPointLight&&!0===a.isMeshDistanceMaterial){e.properties.get(a).light=n}return a}function _(r,i,a,s,o){if(!1===r.visible)return;if(r.layers.test(i.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&o===p)&&(!r.frustumCulled||n.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,r.matrixWorld);const n=t.update(r),i=r.material;if(Array.isArray(i)){const t=n.groups;for(let l=0,c=t.length;l<c;l++){const c=t[l],u=i[c.materialIndex];if(u&&u.visible){const t=M(r,u,s,o);e.renderBufferDirect(a,null,n,t,r,c)}}}else if(i.visible){const t=M(r,i,s,o);e.renderBufferDirect(a,null,n,t,r,null)}}const l=r.children;for(let e=0,t=l.length;e<t;e++)_(l[e],i,a,s,o)}this.render=function(t,r,o){if(!1===w.enabled)return;if(!1===w.autoUpdate&&!1===w.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),c=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),d=e.state;d.setBlending(A),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);const f=E!==p&&this.type===p,m=E===p&&this.type!==p;for(let g=0,v=t.length;g<v;g++){const l=t[g],c=l.shadow;if(void 0===c){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}if(!1===c.autoUpdate&&!1===c.needsUpdate)continue;i.copy(c.mapSize);const h=c.getFrameExtents();if(i.multiply(h),a.copy(c.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/h.x),i.x=a.x*h.x,c.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/h.y),i.y=a.y*h.y,c.mapSize.y=a.y)),null===c.map||!0===f||!0===m){const e=this.type!==p?{minFilter:de,magFilter:de}:{};null!==c.map&&c.map.dispose(),c.map=new rn(i.x,i.y,e),c.map.texture.name=l.name+".shadowMap",c.camera.updateProjectionMatrix()}e.setRenderTarget(c.map),e.clear();const v=c.getViewportCount();for(let e=0;e<v;e++){const t=c.getViewport(e);s.set(a.x*t.x,a.y*t.y,a.x*t.z,a.y*t.w),d.viewport(s),c.updateMatrices(l,e),n=c.getFrustum(),_(r,o,c.camera,l,this.type)}!0!==c.isPointLightShadow&&this.type===p&&S(c,o),c.needsUpdate=!1}E=this.type,w.needsUpdate=!1,e.setRenderTarget(l,c,h)}}function hl(e,t,r){const n=r.isWebGL2;const i=new function(){let t=!1;const r=new tn;let n=null;const i=new tn(0,0,0,0);return{setMask:function(r){n===r||t||(e.colorMask(r,r,r,r),n=r)},setLocked:function(e){t=e},setClear:function(t,n,a,s,o){!0===o&&(t*=s,n*=s,a*=s),r.set(t,n,a,s),!1===i.equals(r)&&(e.clearColor(t,n,a,s),i.copy(r))},reset:function(){t=!1,n=null,i.set(-1,0,0,0)}}},a=new function(){let t=!1,r=null,n=null,i=null;return{setTest:function(t){t?be(e.DEPTH_TEST):we(e.DEPTH_TEST)},setMask:function(n){r===n||t||(e.depthMask(n),r=n)},setFunc:function(t){if(n!==t){switch(t){case G:e.depthFunc(e.NEVER);break;case z:e.depthFunc(e.ALWAYS);break;case V:e.depthFunc(e.LESS);break;case H:e.depthFunc(e.LEQUAL);break;case Q:e.depthFunc(e.EQUAL);break;case j:e.depthFunc(e.GEQUAL);break;case W:e.depthFunc(e.GREATER);break;case X:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}n=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,r=null,n=null,i=null}}},c=new function(){let t=!1,r=null,n=null,i=null,a=null,s=null,o=null,l=null,c=null;return{setTest:function(r){t||(r?be(e.STENCIL_TEST):we(e.STENCIL_TEST))},setMask:function(n){r===n||t||(e.stencilMask(n),r=n)},setFunc:function(t,r,s){n===t&&i===r&&a===s||(e.stencilFunc(t,r,s),n=t,i=r,a=s)},setOp:function(t,r,n){s===t&&o===r&&l===n||(e.stencilOp(t,r,n),s=t,o=r,l=n)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,r=null,n=null,i=null,a=null,s=null,o=null,l=null,c=null}}},u=new WeakMap,h=new WeakMap;let d={},p={},f=new WeakMap,v=[],Y=null,q=!1,K=null,J=null,Z=null,$=null,ee=null,te=null,re=null,ne=!1,ie=null,ae=null,se=null,oe=null,le=null;const ce=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let ue=!1,he=0;const de=e.getParameter(e.VERSION);-1!==de.indexOf("WebGL")?(he=parseFloat(/^WebGL (\d)/.exec(de)[1]),ue=he>=1):-1!==de.indexOf("OpenGL ES")&&(he=parseFloat(/^OpenGL ES (\d)/.exec(de)[1]),ue=he>=2);let pe=null,fe={};const me=e.getParameter(e.SCISSOR_BOX),ge=e.getParameter(e.VIEWPORT),ve=(new tn).fromArray(me),Ae=(new tn).fromArray(ge);function ye(t,r,i,a){const s=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let l=0;l<i;l++)!n||t!==e.TEXTURE_3D&&t!==e.TEXTURE_2D_ARRAY?e.texImage2D(r+l,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,s):e.texImage3D(r,0,e.RGBA,1,1,a,0,e.RGBA,e.UNSIGNED_BYTE,s);return o}const xe={};function be(t){!0!==d[t]&&(e.enable(t),d[t]=!0)}function we(t){!1!==d[t]&&(e.disable(t),d[t]=!1)}xe[e.TEXTURE_2D]=ye(e.TEXTURE_2D,e.TEXTURE_2D,1),xe[e.TEXTURE_CUBE_MAP]=ye(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),n&&(xe[e.TEXTURE_2D_ARRAY]=ye(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),xe[e.TEXTURE_3D]=ye(e.TEXTURE_3D,e.TEXTURE_3D,1,1)),i.setClear(0,0,0,1),a.setClear(1),c.setClear(0),be(e.DEPTH_TEST),a.setFunc(H),_e(!1),Te(o),be(e.CULL_FACE),Me(A);const Ee={[S]:e.FUNC_ADD,[M]:e.FUNC_SUBTRACT,[_]:e.FUNC_REVERSE_SUBTRACT};if(n)Ee[T]=e.MIN,Ee[C]=e.MAX;else{const e=t.get("EXT_blend_minmax");null!==e&&(Ee[T]=e.MIN_EXT,Ee[C]=e.MAX_EXT)}const Se={[I]:e.ZERO,[B]:e.ONE,[R]:e.SRC_COLOR,[F]:e.SRC_ALPHA,[O]:e.SRC_ALPHA_SATURATE,[N]:e.DST_COLOR,[D]:e.DST_ALPHA,[P]:e.ONE_MINUS_SRC_COLOR,[L]:e.ONE_MINUS_SRC_ALPHA,[k]:e.ONE_MINUS_DST_COLOR,[U]:e.ONE_MINUS_DST_ALPHA};function Me(t,r,n,i,a,s,o,l){if(t!==A){if(!1===q&&(be(e.BLEND),q=!0),t===E)a=a||r,s=s||n,o=o||i,r===J&&a===ee||(e.blendEquationSeparate(Ee[r],Ee[a]),J=r,ee=a),n===Z&&i===$&&s===te&&o===re||(e.blendFuncSeparate(Se[n],Se[i],Se[s],Se[o]),Z=n,$=i,te=s,re=o),K=t,ne=!1;else if(t!==K||l!==ne){if(J===S&&ee===S||(e.blendEquation(e.FUNC_ADD),J=S,ee=S),l)switch(t){case y:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case x:e.blendFunc(e.ONE,e.ONE);break;case b:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case w:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case y:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case x:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case b:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case w:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}Z=null,$=null,te=null,re=null,K=t,ne=l}}else!0===q&&(we(e.BLEND),q=!1)}function _e(t){ie!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),ie=t)}function Te(t){t!==s?(be(e.CULL_FACE),t!==ae&&(t===o?e.cullFace(e.BACK):t===l?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):we(e.CULL_FACE),ae=t}function Ce(t,r,n){t?(be(e.POLYGON_OFFSET_FILL),oe===r&&le===n||(e.polygonOffset(r,n),oe=r,le=n)):we(e.POLYGON_OFFSET_FILL)}return{buffers:{color:i,depth:a,stencil:c},enable:be,disable:we,bindFramebuffer:function(t,r){return p[t]!==r&&(e.bindFramebuffer(t,r),p[t]=r,n&&(t===e.DRAW_FRAMEBUFFER&&(p[e.FRAMEBUFFER]=r),t===e.FRAMEBUFFER&&(p[e.DRAW_FRAMEBUFFER]=r)),!0)},drawBuffers:function(n,i){let a=v,s=!1;if(n)if(a=f.get(i),void 0===a&&(a=[],f.set(i,a)),n.isWebGLMultipleRenderTargets){const t=n.texture;if(a.length!==t.length||a[0]!==e.COLOR_ATTACHMENT0){for(let r=0,n=t.length;r<n;r++)a[r]=e.COLOR_ATTACHMENT0+r;a.length=t.length,s=!0}}else a[0]!==e.COLOR_ATTACHMENT0&&(a[0]=e.COLOR_ATTACHMENT0,s=!0);else a[0]!==e.BACK&&(a[0]=e.BACK,s=!0);s&&(r.isWebGL2?e.drawBuffers(a):t.get("WEBGL_draw_buffers").drawBuffersWEBGL(a))},useProgram:function(t){return Y!==t&&(e.useProgram(t),Y=t,!0)},setBlending:Me,setMaterial:function(t,r){t.side===g?we(e.CULL_FACE):be(e.CULL_FACE);let n=t.side===m;r&&(n=!n),_e(n),t.blending===y&&!1===t.transparent?Me(A):Me(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),a.setFunc(t.depthFunc),a.setTest(t.depthTest),a.setMask(t.depthWrite),i.setMask(t.colorWrite);const s=t.stencilWrite;c.setTest(s),s&&(c.setMask(t.stencilWriteMask),c.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),c.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Ce(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?be(e.SAMPLE_ALPHA_TO_COVERAGE):we(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:_e,setCullFace:Te,setLineWidth:function(t){t!==se&&(ue&&e.lineWidth(t),se=t)},setPolygonOffset:Ce,setScissorTest:function(t){t?be(e.SCISSOR_TEST):we(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+ce-1),pe!==t&&(e.activeTexture(t),pe=t)},bindTexture:function(t,r,n){void 0===n&&(n=null===pe?e.TEXTURE0+ce-1:pe);let i=fe[n];void 0===i&&(i={type:void 0,texture:void 0},fe[n]=i),i.type===t&&i.texture===r||(pe!==n&&(e.activeTexture(n),pe=n),e.bindTexture(t,r||xe[t]),i.type=t,i.texture=r)},unbindTexture:function(){const t=fe[pe];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{e.compressedTexImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(t,r){let n=h.get(r);void 0===n&&(n=new WeakMap,h.set(r,n));let i=n.get(t);void 0===i&&(i=e.getUniformBlockIndex(r,t.name),n.set(t,i))},uniformBlockBinding:function(t,r){const n=h.get(r).get(t);u.get(r)!==n&&(e.uniformBlockBinding(r,n,t.__bindingPointIndex),u.set(r,n))},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===ve.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),ve.copy(t))},viewport:function(t){!1===Ae.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),Ae.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),!0===n&&(e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),d={},pe=null,fe={},p={},f=new WeakMap,v=[],Y=null,q=!1,K=null,J=null,Z=null,$=null,ee=null,te=null,re=null,ne=!1,ie=null,ae=null,se=null,oe=null,le=null,ve.set(0,0,e.canvas.width,e.canvas.height),Ae.set(0,0,e.canvas.width,e.canvas.height),i.reset(),a.reset(),c.reset()}}}function dl(e,t,r,n,i,a,s){const o=i.isWebGL2,l=i.maxTextures,c=i.maxCubemapSize,u=i.maxTextureSize,h=i.maxSamples,d=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,p="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let m;const g=new WeakMap;let v=!1;try{v="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(V){}function A(e,t){return v?new OffscreenCanvas(e,t):Or("canvas")}function y(e,t,r,n){let i=1;if((e.width>n||e.height>n)&&(i=n/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const n=t?Ir:Math.floor,a=n(i*e.width),s=n(i*e.height);void 0===m&&(m=A(a,s));const o=r?A(a,s):m;o.width=a,o.height=s;return o.getContext("2d").drawImage(e,0,0,a,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+s+")."),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function x(e){return Tr(e.width)&&Tr(e.height)}function b(e,t){return e.generateMipmaps&&t&&e.minFilter!==de&&e.minFilter!==ve}function w(t){e.generateMipmap(t)}function E(r,n,i,a,s=!1){if(!1===o)return n;if(null!==r){if(void 0!==e[r])return e[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}let l=n;return n===e.RED&&(i===e.FLOAT&&(l=e.R32F),i===e.HALF_FLOAT&&(l=e.R16F),i===e.UNSIGNED_BYTE&&(l=e.R8)),n===e.RG&&(i===e.FLOAT&&(l=e.RG32F),i===e.HALF_FLOAT&&(l=e.RG16F),i===e.UNSIGNED_BYTE&&(l=e.RG8)),n===e.RGBA&&(i===e.FLOAT&&(l=e.RGBA32F),i===e.HALF_FLOAT&&(l=e.RGBA16F),i===e.UNSIGNED_BYTE&&(l=a===zt&&!1===s?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)),l!==e.R16F&&l!==e.R32F&&l!==e.RG16F&&l!==e.RG32F&&l!==e.RGBA16F&&l!==e.RGBA32F||t.get("EXT_color_buffer_float"),l}function S(e,t,r){return!0===b(e,r)||e.isFramebufferTexture&&e.minFilter!==de&&e.minFilter!==ve?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function M(t){return t===de||t===pe||t===me?e.NEAREST:e.LINEAR}function _(e){const t=e.target;t.removeEventListener("dispose",_),function(e){const t=n.get(e);if(void 0===t.__webglInit)return;const r=e.source,i=g.get(r);if(i){const n=i[t.__cacheKey];n.usedTimes--,0===n.usedTimes&&C(e),0===Object.keys(i).length&&g.delete(r)}n.remove(e)}(t),t.isVideoTexture&&f.delete(t)}function T(t){const r=t.target;r.removeEventListener("dispose",T),function(t){const r=t.texture,i=n.get(t),a=n.get(r);void 0!==a.__webglTexture&&(e.deleteTexture(a.__webglTexture),s.memory.textures--);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let n=0;n<6;n++)e.deleteFramebuffer(i.__webglFramebuffer[n]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[n]);else{if(e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer)for(let t=0;t<i.__webglColorRenderbuffer.length;t++)i.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(i.__webglColorRenderbuffer[t]);i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer)}if(t.isWebGLMultipleRenderTargets)for(let o=0,l=r.length;o<l;o++){const t=n.get(r[o]);t.__webglTexture&&(e.deleteTexture(t.__webglTexture),s.memory.textures--),n.remove(r[o])}n.remove(r),n.remove(t)}(r)}function C(t){const r=n.get(t);e.deleteTexture(r.__webglTexture);const i=t.source;delete g.get(i)[r.__cacheKey],s.memory.textures--}let I=0;function B(t,i){const a=n.get(t);if(t.isVideoTexture&&function(e){const t=s.render.frame;f.get(e)!==t&&(f.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version){const e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void D(a,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}const R={[ce]:e.REPEAT,[ue]:e.CLAMP_TO_EDGE,[he]:e.MIRRORED_REPEAT},P={[de]:e.NEAREST,[pe]:e.NEAREST_MIPMAP_NEAREST,[me]:e.NEAREST_MIPMAP_LINEAR,[ve]:e.LINEAR,[Ae]:e.LINEAR_MIPMAP_NEAREST,[xe]:e.LINEAR_MIPMAP_LINEAR};function F(r,a,s){if(s?(e.texParameteri(r,e.TEXTURE_WRAP_S,R[a.wrapS]),e.texParameteri(r,e.TEXTURE_WRAP_T,R[a.wrapT]),r!==e.TEXTURE_3D&&r!==e.TEXTURE_2D_ARRAY||e.texParameteri(r,e.TEXTURE_WRAP_R,R[a.wrapR]),e.texParameteri(r,e.TEXTURE_MAG_FILTER,P[a.magFilter]),e.texParameteri(r,e.TEXTURE_MIN_FILTER,P[a.minFilter])):(e.texParameteri(r,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(r,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),r!==e.TEXTURE_3D&&r!==e.TEXTURE_2D_ARRAY||e.texParameteri(r,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE),a.wrapS===ue&&a.wrapT===ue||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(r,e.TEXTURE_MAG_FILTER,M(a.magFilter)),e.texParameteri(r,e.TEXTURE_MIN_FILTER,M(a.minFilter)),a.minFilter!==de&&a.minFilter!==ve&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===t.has("EXT_texture_filter_anisotropic")){const s=t.get("EXT_texture_filter_anisotropic");if(a.magFilter===de)return;if(a.minFilter!==me&&a.minFilter!==xe)return;if(a.type===Ce&&!1===t.has("OES_texture_float_linear"))return;if(!1===o&&a.type===Ie&&!1===t.has("OES_texture_half_float_linear"))return;(a.anisotropy>1||n.get(a).__currentAnisotropy)&&(e.texParameterf(r,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),n.get(a).__currentAnisotropy=a.anisotropy)}}function L(t,r){let n=!1;void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",_));const i=r.source;let a=g.get(i);void 0===a&&(a={},g.set(i,a));const o=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(r);if(o!==t.__cacheKey){void 0===a[o]&&(a[o]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,n=!0),a[o].usedTimes++;const i=a[t.__cacheKey];void 0!==i&&(a[t.__cacheKey].usedTimes--,0===i.usedTimes&&C(r)),t.__cacheKey=o,t.__webglTexture=a[o].texture}return n}function D(t,i,s){let l=e.TEXTURE_2D;(i.isDataArrayTexture||i.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),i.isData3DTexture&&(l=e.TEXTURE_3D);const c=L(t,i),h=i.source;r.bindTexture(l,t.__webglTexture,e.TEXTURE0+s);const d=n.get(h);if(h.version!==d.__version||!0===c){r.activeTexture(e.TEXTURE0+s),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,i.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,i.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE);const t=function(e){return!o&&(e.wrapS!==ue||e.wrapT!==ue||e.minFilter!==de&&e.minFilter!==ve)}(i)&&!1===x(i.image);let n=y(i.image,t,!1,u);n=z(i,n);const p=x(n)||o,f=a.convert(i.format,i.colorSpace);let m,g=a.convert(i.type),v=E(i.internalFormat,f,g,i.colorSpace);F(l,i,p);const A=i.mipmaps,M=o&&!0!==i.isVideoTexture,_=void 0===d.__version||!0===c,T=S(i,n,p);if(i.isDepthTexture)v=e.DEPTH_COMPONENT,o?v=i.type===Ce?e.DEPTH_COMPONENT32F:i.type===Te?e.DEPTH_COMPONENT24:i.type===Pe?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT16:i.type===Ce&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),i.format===Ne&&v===e.DEPTH_COMPONENT&&i.type!==Me&&i.type!==Te&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=Te,g=a.convert(i.type)),i.format===ke&&v===e.DEPTH_COMPONENT&&(v=e.DEPTH_STENCIL,i.type!==Pe&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=Pe,g=a.convert(i.type))),_&&(M?r.texStorage2D(e.TEXTURE_2D,1,v,n.width,n.height):r.texImage2D(e.TEXTURE_2D,0,v,n.width,n.height,0,f,g,null));else if(i.isDataTexture)if(A.length>0&&p){M&&_&&r.texStorage2D(e.TEXTURE_2D,T,v,A[0].width,A[0].height);for(let t=0,n=A.length;t<n;t++)m=A[t],M?r.texSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,f,g,m.data):r.texImage2D(e.TEXTURE_2D,t,v,m.width,m.height,0,f,g,m.data);i.generateMipmaps=!1}else M?(_&&r.texStorage2D(e.TEXTURE_2D,T,v,n.width,n.height),r.texSubImage2D(e.TEXTURE_2D,0,0,0,n.width,n.height,f,g,n.data)):r.texImage2D(e.TEXTURE_2D,0,v,n.width,n.height,0,f,g,n.data);else if(i.isCompressedTexture)if(i.isCompressedArrayTexture){M&&_&&r.texStorage3D(e.TEXTURE_2D_ARRAY,T,v,A[0].width,A[0].height,n.depth);for(let t=0,a=A.length;t<a;t++)m=A[t],i.format!==Le?null!==f?M?r.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,m.width,m.height,n.depth,f,m.data,0,0):r.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,v,m.width,m.height,n.depth,0,m.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):M?r.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,m.width,m.height,n.depth,f,g,m.data):r.texImage3D(e.TEXTURE_2D_ARRAY,t,v,m.width,m.height,n.depth,0,f,g,m.data)}else{M&&_&&r.texStorage2D(e.TEXTURE_2D,T,v,A[0].width,A[0].height);for(let t=0,n=A.length;t<n;t++)m=A[t],i.format!==Le?null!==f?M?r.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,f,m.data):r.compressedTexImage2D(e.TEXTURE_2D,t,v,m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):M?r.texSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,f,g,m.data):r.texImage2D(e.TEXTURE_2D,t,v,m.width,m.height,0,f,g,m.data)}else if(i.isDataArrayTexture)M?(_&&r.texStorage3D(e.TEXTURE_2D_ARRAY,T,v,n.width,n.height,n.depth),r.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,n.width,n.height,n.depth,f,g,n.data)):r.texImage3D(e.TEXTURE_2D_ARRAY,0,v,n.width,n.height,n.depth,0,f,g,n.data);else if(i.isData3DTexture)M?(_&&r.texStorage3D(e.TEXTURE_3D,T,v,n.width,n.height,n.depth),r.texSubImage3D(e.TEXTURE_3D,0,0,0,0,n.width,n.height,n.depth,f,g,n.data)):r.texImage3D(e.TEXTURE_3D,0,v,n.width,n.height,n.depth,0,f,g,n.data);else if(i.isFramebufferTexture){if(_)if(M)r.texStorage2D(e.TEXTURE_2D,T,v,n.width,n.height);else{let t=n.width,i=n.height;for(let n=0;n<T;n++)r.texImage2D(e.TEXTURE_2D,n,v,t,i,0,f,g,null),t>>=1,i>>=1}}else if(A.length>0&&p){M&&_&&r.texStorage2D(e.TEXTURE_2D,T,v,A[0].width,A[0].height);for(let t=0,n=A.length;t<n;t++)m=A[t],M?r.texSubImage2D(e.TEXTURE_2D,t,0,0,f,g,m):r.texImage2D(e.TEXTURE_2D,t,v,f,g,m);i.generateMipmaps=!1}else M?(_&&r.texStorage2D(e.TEXTURE_2D,T,v,n.width,n.height),r.texSubImage2D(e.TEXTURE_2D,0,0,0,f,g,n)):r.texImage2D(e.TEXTURE_2D,0,v,f,g,n);b(i,p)&&w(l),d.__version=h.version,i.onUpdate&&i.onUpdate(i)}t.__version=i.version}function U(t,i,s,o,l){const c=a.convert(s.format,s.colorSpace),u=a.convert(s.type),h=E(s.internalFormat,c,u,s.colorSpace);n.get(i).__hasExternalTextures||(l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?r.texImage3D(l,0,h,i.width,i.height,i.depth,0,c,u,null):r.texImage2D(l,0,h,i.width,i.height,0,c,u,null)),r.bindFramebuffer(e.FRAMEBUFFER,t),G(i)?d.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,o,l,n.get(s).__webglTexture,0,O(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,o,l,n.get(s).__webglTexture,0),r.bindFramebuffer(e.FRAMEBUFFER,null)}function N(t,r,n){if(e.bindRenderbuffer(e.RENDERBUFFER,t),r.depthBuffer&&!r.stencilBuffer){let i=e.DEPTH_COMPONENT16;if(n||G(r)){const t=r.depthTexture;t&&t.isDepthTexture&&(t.type===Ce?i=e.DEPTH_COMPONENT32F:t.type===Te&&(i=e.DEPTH_COMPONENT24));const n=O(r);G(r)?d.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,n,i,r.width,r.height):e.renderbufferStorageMultisample(e.RENDERBUFFER,n,i,r.width,r.height)}else e.renderbufferStorage(e.RENDERBUFFER,i,r.width,r.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)}else if(r.depthBuffer&&r.stencilBuffer){const i=O(r);n&&!1===G(r)?e.renderbufferStorageMultisample(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,r.width,r.height):G(r)?d.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,r.width,r.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,r.width,r.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)}else{const t=!0===r.isWebGLMultipleRenderTargets?r.texture:[r.texture];for(let i=0;i<t.length;i++){const s=t[i],o=a.convert(s.format,s.colorSpace),l=a.convert(s.type),c=E(s.internalFormat,o,l,s.colorSpace),u=O(r);n&&!1===G(r)?e.renderbufferStorageMultisample(e.RENDERBUFFER,u,c,r.width,r.height):G(r)?d.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,u,c,r.width,r.height):e.renderbufferStorage(e.RENDERBUFFER,c,r.width,r.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function k(t){const i=n.get(t),a=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(r.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),B(i.depthTexture,0);const a=n.get(i.depthTexture).__webglTexture,s=O(i);if(i.depthTexture.format===Ne)G(i)?d.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0,s):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0);else{if(i.depthTexture.format!==ke)throw new Error("Unknown depthTexture format");G(i)?d.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0,s):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0)}}(i.__webglFramebuffer,t)}else if(a){i.__webglDepthbuffer=[];for(let n=0;n<6;n++)r.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[n]),i.__webglDepthbuffer[n]=e.createRenderbuffer(),N(i.__webglDepthbuffer[n],t,!1)}else r.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),N(i.__webglDepthbuffer,t,!1);r.bindFramebuffer(e.FRAMEBUFFER,null)}function O(e){return Math.min(h,e.samples)}function G(e){const r=n.get(e);return o&&e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==r.__useRenderToTexture}function z(e,r){const n=e.colorSpace,i=e.format,a=e.type;return!0===e.isCompressedTexture||e.format===vr||n!==Vt&&n!==Gt&&(n===zt?!1===o?!0===t.has("EXT_sRGB")&&i===Le?(e.format=vr,e.minFilter=ve,e.generateMipmaps=!1):r=Kr.sRGBToLinear(r):i===Le&&a===we||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),r}this.allocateTextureUnit=function(){const e=I;return e>=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),I+=1,e},this.resetTextureUnits=function(){I=0},this.setTexture2D=B,this.setTexture2DArray=function(t,i){const a=n.get(t);t.version>0&&a.__version!==t.version?D(a,t,i):r.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){const a=n.get(t);t.version>0&&a.__version!==t.version?D(a,t,i):r.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,i){const s=n.get(t);t.version>0&&s.__version!==t.version?function(t,i,s){if(6!==i.image.length)return;const l=L(t,i),u=i.source;r.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);const h=n.get(u);if(u.version!==h.__version||!0===l){r.activeTexture(e.TEXTURE0+s),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,i.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,i.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE);const t=i.isCompressedTexture||i.image[0].isCompressedTexture,n=i.image[0]&&i.image[0].isDataTexture,d=[];for(let e=0;e<6;e++)d[e]=t||n?n?i.image[e].image:i.image[e]:y(i.image[e],!1,!0,c),d[e]=z(i,d[e]);const p=d[0],f=x(p)||o,m=a.convert(i.format,i.colorSpace),g=a.convert(i.type),v=E(i.internalFormat,m,g,i.colorSpace),A=o&&!0!==i.isVideoTexture,M=void 0===h.__version||!0===l;let _,T=S(i,p,f);if(F(e.TEXTURE_CUBE_MAP,i,f),t){A&&M&&r.texStorage2D(e.TEXTURE_CUBE_MAP,T,v,p.width,p.height);for(let t=0;t<6;t++){_=d[t].mipmaps;for(let n=0;n<_.length;n++){const a=_[n];i.format!==Le?null!==m?A?r.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n,0,0,a.width,a.height,m,a.data):r.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n,v,a.width,a.height,0,a.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):A?r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n,0,0,a.width,a.height,m,g,a.data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n,v,a.width,a.height,0,m,g,a.data)}}}else{_=i.mipmaps,A&&M&&(_.length>0&&T++,r.texStorage2D(e.TEXTURE_CUBE_MAP,T,v,d[0].width,d[0].height));for(let t=0;t<6;t++)if(n){A?r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,d[t].width,d[t].height,m,g,d[t].data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,v,d[t].width,d[t].height,0,m,g,d[t].data);for(let n=0;n<_.length;n++){const i=_[n].image[t].image;A?r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n+1,0,0,i.width,i.height,m,g,i.data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n+1,v,i.width,i.height,0,m,g,i.data)}}else{A?r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m,g,d[t]):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,v,m,g,d[t]);for(let n=0;n<_.length;n++){const i=_[n];A?r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n+1,0,0,m,g,i.image[t]):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n+1,v,m,g,i.image[t])}}}b(i,f)&&w(e.TEXTURE_CUBE_MAP),h.__version=u.version,i.onUpdate&&i.onUpdate(i)}t.__version=i.version}(s,t,i):r.bindTexture(e.TEXTURE_CUBE_MAP,s.__webglTexture,e.TEXTURE0+i)},this.rebindTextures=function(t,r,i){const a=n.get(t);void 0!==r&&U(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),void 0!==i&&k(t)},this.setupRenderTarget=function(t){const l=t.texture,c=n.get(t),u=n.get(l);t.addEventListener("dispose",T),!0!==t.isWebGLMultipleRenderTargets&&(void 0===u.__webglTexture&&(u.__webglTexture=e.createTexture()),u.__version=l.version,s.memory.textures++);const h=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,p=x(t)||o;if(h){c.__webglFramebuffer=[];for(let t=0;t<6;t++)c.__webglFramebuffer[t]=e.createFramebuffer()}else{if(c.__webglFramebuffer=e.createFramebuffer(),d)if(i.drawBuffers){const r=t.texture;for(let t=0,i=r.length;t<i;t++){const i=n.get(r[t]);void 0===i.__webglTexture&&(i.__webglTexture=e.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(o&&t.samples>0&&!1===G(t)){const n=d?l:[l];c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=[],r.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let r=0;r<n.length;r++){const i=n[r];c.__webglColorRenderbuffer[r]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,c.__webglColorRenderbuffer[r]);const s=a.convert(i.format,i.colorSpace),o=a.convert(i.type),l=E(i.internalFormat,s,o,i.colorSpace,!0===t.isXRRenderTarget),u=O(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+r,e.RENDERBUFFER,c.__webglColorRenderbuffer[r])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(c.__webglDepthRenderbuffer=e.createRenderbuffer(),N(c.__webglDepthRenderbuffer,t,!0)),r.bindFramebuffer(e.FRAMEBUFFER,null)}}if(h){r.bindTexture(e.TEXTURE_CUBE_MAP,u.__webglTexture),F(e.TEXTURE_CUBE_MAP,l,p);for(let r=0;r<6;r++)U(c.__webglFramebuffer[r],t,l,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+r);b(l,p)&&w(e.TEXTURE_CUBE_MAP),r.unbindTexture()}else if(d){const i=t.texture;for(let a=0,s=i.length;a<s;a++){const s=i[a],o=n.get(s);r.bindTexture(e.TEXTURE_2D,o.__webglTexture),F(e.TEXTURE_2D,s,p),U(c.__webglFramebuffer,t,s,e.COLOR_ATTACHMENT0+a,e.TEXTURE_2D),b(s,p)&&w(e.TEXTURE_2D)}r.unbindTexture()}else{let n=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(o?n=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),r.bindTexture(n,u.__webglTexture),F(n,l,p),U(c.__webglFramebuffer,t,l,e.COLOR_ATTACHMENT0,n),b(l,p)&&w(n),r.unbindTexture()}t.depthBuffer&&k(t)},this.updateRenderTargetMipmap=function(t){const i=x(t)||o,a=!0===t.isWebGLMultipleRenderTargets?t.texture:[t.texture];for(let s=0,o=a.length;s<o;s++){const o=a[s];if(b(o,i)){const i=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,a=n.get(o).__webglTexture;r.bindTexture(i,a),w(i),r.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(o&&t.samples>0&&!1===G(t)){const i=t.isWebGLMultipleRenderTargets?t.texture:[t.texture],a=t.width,s=t.height;let o=e.COLOR_BUFFER_BIT;const l=[],c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=n.get(t),h=!0===t.isWebGLMultipleRenderTargets;if(h)for(let t=0;t<i.length;t++)r.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),r.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);r.bindFramebuffer(e.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer),r.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let r=0;r<i.length;r++){l.push(e.COLOR_ATTACHMENT0+r),t.depthBuffer&&l.push(c);const d=void 0!==u.__ignoreDepthValues&&u.__ignoreDepthValues;if(!1===d&&(t.depthBuffer&&(o|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&(o|=e.STENCIL_BUFFER_BIT)),h&&e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRenderbuffer[r]),!0===d&&(e.invalidateFramebuffer(e.READ_FRAMEBUFFER,[c]),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[c])),h){const t=n.get(i[r]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,s,0,0,a,s,o,e.NEAREST),p&&e.invalidateFramebuffer(e.READ_FRAMEBUFFER,l)}if(r.bindFramebuffer(e.READ_FRAMEBUFFER,null),r.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),h)for(let t=0;t<i.length;t++){r.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,u.__webglColorRenderbuffer[t]);const a=n.get(i[t]).__webglTexture;r.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}r.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=k,this.setupFrameBufferTexture=U,this.useMultisampledRTT=G}function pl(e,t,r){const n=r.isWebGL2;return{convert:function(r,i=Gt){let a;if(r===we)return e.UNSIGNED_BYTE;if(r===Be)return e.UNSIGNED_SHORT_4_4_4_4;if(r===Re)return e.UNSIGNED_SHORT_5_5_5_1;if(r===Ee)return e.BYTE;if(r===Se)return e.SHORT;if(r===Me)return e.UNSIGNED_SHORT;if(r===_e)return e.INT;if(r===Te)return e.UNSIGNED_INT;if(r===Ce)return e.FLOAT;if(r===Ie)return n?e.HALF_FLOAT:(a=t.get("OES_texture_half_float"),null!==a?a.HALF_FLOAT_OES:null);if(r===Fe)return e.ALPHA;if(r===Le)return e.RGBA;if(r===De)return e.LUMINANCE;if(r===Ue)return e.LUMINANCE_ALPHA;if(r===Ne)return e.DEPTH_COMPONENT;if(r===ke)return e.DEPTH_STENCIL;if(r===vr)return a=t.get("EXT_sRGB"),null!==a?a.SRGB_ALPHA_EXT:null;if(r===Oe)return e.RED;if(r===Ge)return e.RED_INTEGER;if(r===ze)return e.RG;if(r===Ve)return e.RG_INTEGER;if(r===He)return e.RGBA_INTEGER;if(r===Qe||r===je||r===We||r===Xe)if(i===zt){if(a=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===a)return null;if(r===Qe)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===je)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===We)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Xe)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(a=t.get("WEBGL_compressed_texture_s3tc"),null===a)return null;if(r===Qe)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===je)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===We)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Xe)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(r===Ye||r===qe||r===Ke||r===Je){if(a=t.get("WEBGL_compressed_texture_pvrtc"),null===a)return null;if(r===Ye)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===qe)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===Ke)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===Je)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(r===Ze)return a=t.get("WEBGL_compressed_texture_etc1"),null!==a?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===$e||r===et){if(a=t.get("WEBGL_compressed_texture_etc"),null===a)return null;if(r===$e)return i===zt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===et)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}if(r===tt||r===rt||r===nt||r===it||r===at||r===st||r===ot||r===lt||r===ct||r===ut||r===ht||r===dt||r===pt||r===ft){if(a=t.get("WEBGL_compressed_texture_astc"),null===a)return null;if(r===tt)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===rt)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===nt)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===it)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===at)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===st)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===ot)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===lt)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===ct)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===ut)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===ht)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===dt)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===pt)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===ft)return i===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}if(r===mt){if(a=t.get("EXT_texture_compression_bptc"),null===a)return null;if(r===mt)return i===zt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}if(r===gt||r===vt||r===At||r===yt){if(a=t.get("EXT_texture_compression_rgtc"),null===a)return null;if(r===mt)return a.COMPRESSED_RED_RGTC1_EXT;if(r===vt)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===At)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===yt)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return r===Pe?n?e.UNSIGNED_INT_24_8:(a=t.get("WEBGL_depth_texture"),null!==a?a.UNSIGNED_INT_24_8_WEBGL:null):void 0!==e[r]?e[r]:null}}}class fl extends Ra{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class ml extends hi{constructor(){super(),this.isGroup=!0,this.type="Group"}}const gl={type:"move"};class vl{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new ml,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new ml,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new un,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new un),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new ml,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new un,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new un),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const r of e.hand.values())this._getHandJoint(t,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,r){let n=null,i=null,a=null;const s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){a=!0;for(const a of e.hand.values()){const e=t.getJointPose(a,r),n=this._getHandJoint(l,a);null!==e&&(n.matrix.fromArray(e.transform.matrix),n.matrix.decompose(n.position,n.rotation,n.scale),n.matrixWorldNeedsUpdate=!0,n.jointRadius=e.radius),n.visible=null!==e}const n=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],s=n.position.distanceTo(i.position),o=.02,c=.005;l.inputState.pinching&&s>o+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(i=t.getPose(e.gripSpace,r),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1));null!==s&&(n=t.getPose(e.targetRaySpace,r),null===n&&null!==i&&(n=i),null!==n&&(s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,n.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(n.linearVelocity)):s.hasLinearVelocity=!1,n.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(n.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(gl)))}return null!==s&&(s.visible=null!==n),null!==o&&(o.visible=null!==i),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const r=new ml;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}class Al extends en{constructor(e,t,r,n,i,a,s,o,l,c){if((c=void 0!==c?c:Ne)!==Ne&&c!==ke)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===r&&c===Ne&&(r=Te),void 0===r&&c===ke&&(r=Pe),super(null,n,i,a,s,o,c,r,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==s?s:de,this.minFilter=void 0!==o?o:de,this.flipY=!1,this.generateMipmaps=!1}}class yl extends Ar{constructor(e,t){super();const r=this;let n=null,i=1,a=null,s="local-floor",o=1,l=null,c=null,u=null,h=null,d=null,p=null;const f=t.getContextAttributes();let m=null,g=null;const v=[],A=[],y=new Set,x=new Map,b=new Ra;b.layers.enable(1),b.viewport=new tn;const w=new Ra;w.layers.enable(2),w.viewport=new tn;const E=[b,w],S=new fl;S.layers.enable(1),S.layers.enable(2);let M=null,_=null;function T(e){const t=A.indexOf(e.inputSource);if(-1===t)return;const r=v[t];void 0!==r&&(r.update(e.inputSource,e.frame,l||a),r.dispatchEvent({type:e.type,data:e.inputSource}))}function C(){n.removeEventListener("select",T),n.removeEventListener("selectstart",T),n.removeEventListener("selectend",T),n.removeEventListener("squeeze",T),n.removeEventListener("squeezestart",T),n.removeEventListener("squeezeend",T),n.removeEventListener("end",C),n.removeEventListener("inputsourceschange",I);for(let e=0;e<v.length;e++){const t=A[e];null!==t&&(A[e]=null,v[e].disconnect(t))}M=null,_=null,e.setRenderTarget(m),d=null,h=null,u=null,n=null,g=null,L.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}function I(e){for(let t=0;t<e.removed.length;t++){const r=e.removed[t],n=A.indexOf(r);n>=0&&(A[n]=null,v[n].disconnect(r))}for(let t=0;t<e.added.length;t++){const r=e.added[t];let n=A.indexOf(r);if(-1===n){for(let e=0;e<v.length;e++){if(e>=A.length){A.push(r),n=e;break}if(null===A[e]){A[e]=r,n=e;break}}if(-1===n)break}const i=v[n];i&&i.connect(r)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=v[e];return void 0===t&&(t=new vl,v[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=v[e];return void 0===t&&(t=new vl,v[e]=t),t.getGripSpace()},this.getHand=function(e){let t=v[e];return void 0===t&&(t=new vl,v[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){s=e,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return u},this.getFrame=function(){return p},this.getSession=function(){return n},this.setSession=async function(c){if(n=c,null!==n){if(m=e.getRenderTarget(),n.addEventListener("select",T),n.addEventListener("selectstart",T),n.addEventListener("selectend",T),n.addEventListener("squeeze",T),n.addEventListener("squeezestart",T),n.addEventListener("squeezeend",T),n.addEventListener("end",C),n.addEventListener("inputsourceschange",I),!0!==f.xrCompatible&&await t.makeXRCompatible(),void 0===n.renderState.layers||!1===e.capabilities.isWebGL2){const r={antialias:void 0!==n.renderState.layers||f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:i};d=new XRWebGLLayer(n,t,r),n.updateRenderState({baseLayer:d}),g=new rn(d.framebufferWidth,d.framebufferHeight,{format:Le,type:we,colorSpace:e.outputColorSpace,stencilBuffer:f.stencil})}else{let r=null,a=null,s=null;f.depth&&(s=f.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,r=f.stencil?ke:Ne,a=f.stencil?Pe:Te);const o={colorFormat:t.RGBA8,depthFormat:s,scaleFactor:i};u=new XRWebGLBinding(n,t),h=u.createProjectionLayer(o),n.updateRenderState({layers:[h]}),g=new rn(h.textureWidth,h.textureHeight,{format:Le,type:we,depthTexture:new Al(h.textureWidth,h.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,r),stencilBuffer:f.stencil,colorSpace:e.outputColorSpace,samples:f.antialias?4:0});e.properties.get(g).__ignoreDepthValues=h.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,a=await n.requestReferenceSpace(s),L.setContext(n),L.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==n)return n.environmentBlendMode};const B=new un,R=new un;function P(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===n)return;S.near=w.near=b.near=e.near,S.far=w.far=b.far=e.far,M===S.near&&_===S.far||(n.updateRenderState({depthNear:S.near,depthFar:S.far}),M=S.near,_=S.far);const t=e.parent,r=S.cameras;P(S,t);for(let n=0;n<r.length;n++)P(r[n],t);2===r.length?function(e,t,r){B.setFromMatrixPosition(t.matrixWorld),R.setFromMatrixPosition(r.matrixWorld);const n=B.distanceTo(R),i=t.projectionMatrix.elements,a=r.projectionMatrix.elements,s=i[14]/(i[10]-1),o=i[14]/(i[10]+1),l=(i[9]+1)/i[5],c=(i[9]-1)/i[5],u=(i[8]-1)/i[0],h=(a[8]+1)/a[0],d=s*u,p=s*h,f=n/(-u+h),m=f*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=s+f,v=o+f,A=d-m,y=p+(n-m),x=l*o/v*g,b=c*o/v*g;e.projectionMatrix.makePerspective(A,y,x,b,g,v),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}(S,b,w):S.projectionMatrix.copy(b.projectionMatrix),function(e,t,r){null===r?e.matrix.copy(t.matrixWorld):(e.matrix.copy(r.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld));e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0);const n=e.children;for(let i=0,a=n.length;i<a;i++)n[i].updateMatrixWorld(!0);e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=2*wr*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,S,t)},this.getCamera=function(){return S},this.getFoveation=function(){if(null!==h||null!==d)return o},this.setFoveation=function(e){o=e,null!==h&&(h.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)},this.getPlanes=function(){return y};let F=null;const L=new Ha;L.setAnimationLoop((function(t,n){if(c=n.getViewerPose(l||a),p=n,null!==c){const t=c.views;null!==d&&(e.setRenderTargetFramebuffer(g,d.framebuffer),e.setRenderTarget(g));let r=!1;t.length!==S.cameras.length&&(S.cameras.length=0,r=!0);for(let n=0;n<t.length;n++){const i=t[n];let a=null;if(null!==d)a=d.getViewport(i);else{const t=u.getViewSubImage(h,i);a=t.viewport,0===n&&(e.setRenderTargetTextures(g,t.colorTexture,h.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(g))}let s=E[n];void 0===s&&(s=new Ra,s.layers.enable(n),s.viewport=new tn,E[n]=s),s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.quaternion,s.scale),s.projectionMatrix.fromArray(i.projectionMatrix),s.projectionMatrixInverse.copy(s.projectionMatrix).invert(),s.viewport.set(a.x,a.y,a.width,a.height),0===n&&(S.matrix.copy(s.matrix),S.matrix.decompose(S.position,S.quaternion,S.scale)),!0===r&&S.cameras.push(s)}}for(let e=0;e<v.length;e++){const t=A[e],r=v[e];null!==t&&void 0!==r&&r.update(t,n,l||a)}if(F&&F(t,n),n.detectedPlanes){r.dispatchEvent({type:"planesdetected",data:n.detectedPlanes});let e=null;for(const t of y)n.detectedPlanes.has(t)||(null===e&&(e=[]),e.push(t));if(null!==e)for(const t of e)y.delete(t),x.delete(t),r.dispatchEvent({type:"planeremoved",data:t});for(const t of n.detectedPlanes)if(y.has(t)){const e=x.get(t);t.lastChangedTime>e&&(x.set(t,t.lastChangedTime),r.dispatchEvent({type:"planechanged",data:t}))}else y.add(t),x.set(t,n.lastChangedTime),r.dispatchEvent({type:"planeadded",data:t})}p=null})),this.setAnimationLoop=function(e){F=e},this.dispose=function(){}}}function xl(e,t){function r(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function n(n,i){n.opacity.value=i.opacity,i.color&&n.diffuse.value.copy(i.color),i.emissive&&n.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(n.map.value=i.map,r(i.map,n.mapTransform)),i.alphaMap&&(n.alphaMap.value=i.alphaMap,r(i.alphaMap,n.alphaMapTransform)),i.bumpMap&&(n.bumpMap.value=i.bumpMap,r(i.bumpMap,n.bumpMapTransform),n.bumpScale.value=i.bumpScale,i.side===m&&(n.bumpScale.value*=-1)),i.normalMap&&(n.normalMap.value=i.normalMap,r(i.normalMap,n.normalMapTransform),n.normalScale.value.copy(i.normalScale),i.side===m&&n.normalScale.value.negate()),i.displacementMap&&(n.displacementMap.value=i.displacementMap,r(i.displacementMap,n.displacementMapTransform),n.displacementScale.value=i.displacementScale,n.displacementBias.value=i.displacementBias),i.emissiveMap&&(n.emissiveMap.value=i.emissiveMap,r(i.emissiveMap,n.emissiveMapTransform)),i.specularMap&&(n.specularMap.value=i.specularMap,r(i.specularMap,n.specularMapTransform)),i.alphaTest>0&&(n.alphaTest.value=i.alphaTest);const a=t.get(i).envMap;if(a&&(n.envMap.value=a,n.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,n.reflectivity.value=i.reflectivity,n.ior.value=i.ior,n.refractionRatio.value=i.refractionRatio),i.lightMap){n.lightMap.value=i.lightMap;const t=!0===e.useLegacyLights?Math.PI:1;n.lightMapIntensity.value=i.lightMapIntensity*t,r(i.lightMap,n.lightMapTransform)}i.aoMap&&(n.aoMap.value=i.aoMap,n.aoMapIntensity.value=i.aoMapIntensity,r(i.aoMap,n.aoMapTransform))}return{refreshFogUniforms:function(t,r){r.color.getRGB(t.fogColor.value,Ta(e)),r.isFog?(t.fogNear.value=r.near,t.fogFar.value=r.far):r.isFogExp2&&(t.fogDensity.value=r.density)},refreshMaterialUniforms:function(e,i,a,s,o){i.isMeshBasicMaterial||i.isMeshLambertMaterial?n(e,i):i.isMeshToonMaterial?(n(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(n(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(n(e,i),function(e,n){e.metalness.value=n.metalness,n.metalnessMap&&(e.metalnessMap.value=n.metalnessMap,r(n.metalnessMap,e.metalnessMapTransform));e.roughness.value=n.roughness,n.roughnessMap&&(e.roughnessMap.value=n.roughnessMap,r(n.roughnessMap,e.roughnessMapTransform));t.get(n).envMap&&(e.envMapIntensity.value=n.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function(e,t,n){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,r(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,r(t.sheenRoughnessMap,e.sheenRoughnessMapTransform)));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,r(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,r(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,r(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===m&&e.clearcoatNormalScale.value.negate()));t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,r(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,r(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform)));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,r(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,r(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,r(t.specularColorMap,e.specularColorMapTransform));t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,r(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,i,o)):i.isMeshMatcapMaterial?(n(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?n(e,i):i.isMeshDistanceMaterial?(n(e,i),function(e,r){const n=t.get(r).light;e.referencePosition.value.setFromMatrixPosition(n.matrixWorld),e.nearDistance.value=n.shadow.camera.near,e.farDistance.value=n.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?n(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,r(t.map,e.mapTransform))}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,n,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*i,t.map&&(e.map.value=t.map,r(t.map,e.uvTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,a,s):i.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,r(t.map,e.mapTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function bl(e,t,r,n){let i={},a={},s=[];const o=r.isWebGL2?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(e,t,r){const n=e.value;if(void 0===r[t]){if("number"==typeof n)r[t]=n;else{const e=Array.isArray(n)?n:[n],i=[];for(let t=0;t<e.length;t++)i.push(e[t].clone());r[t]=i}return!0}if("number"==typeof n){if(r[t]!==n)return r[t]=n,!0}else{const e=Array.isArray(r[t])?r[t]:[r[t]],i=Array.isArray(n)?n:[n];for(let t=0;t<e.length;t++){const r=e[t];if(!1===r.equals(i[t]))return r.copy(i[t]),!0}}return!1}function c(e){const t={boundary:0,storage:0};return"number"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function u(t){const r=t.target;r.removeEventListener("dispose",u);const n=s.indexOf(r.__bindingPointIndex);s.splice(n,1),e.deleteBuffer(i[r.id]),delete i[r.id],delete a[r.id]}return{bind:function(e,t){const r=t.program;n.uniformBlockBinding(e,r)},update:function(r,h){let d=i[r.id];void 0===d&&(!function(e){const t=e.uniforms;let r=0;const n=16;let i=0;for(let a=0,s=t.length;a<s;a++){const e=t[a],s={boundary:0,storage:0},o=Array.isArray(e.value)?e.value:[e.value];for(let t=0,r=o.length;t<r;t++){const e=c(o[t]);s.boundary+=e.boundary,s.storage+=e.storage}if(e.__data=new Float32Array(s.storage/Float32Array.BYTES_PER_ELEMENT),e.__offset=r,a>0){i=r%n;const t=n-i;0!==i&&t-s.boundary<0&&(r+=n-i,e.__offset=r)}r+=s.storage}i=r%n,i>0&&(r+=n-i);e.__size=r,e.__cache={}}(r),d=function(t){const r=function(){for(let e=0;e<o;e++)if(-1===s.indexOf(e))return s.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=r;const n=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,n),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,r,n),n}(r),i[r.id]=d,r.addEventListener("dispose",u));const p=h.program;n.updateUBOMapping(r,p);const f=t.render.frame;a[r.id]!==f&&(!function(t){const r=i[t.id],n=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,r);for(let i=0,s=n.length;i<s;i++){const t=n[i];if(!0===l(t,i,a)){const r=t.__offset,n=Array.isArray(t.value)?t.value:[t.value];let i=0;for(let a=0;a<n.length;a++){const s=n[a],o=c(s);"number"==typeof s?(t.__data[0]=s,e.bufferSubData(e.UNIFORM_BUFFER,r+i,t.__data)):s.isMatrix3?(t.__data[0]=s.elements[0],t.__data[1]=s.elements[1],t.__data[2]=s.elements[2],t.__data[3]=s.elements[0],t.__data[4]=s.elements[3],t.__data[5]=s.elements[4],t.__data[6]=s.elements[5],t.__data[7]=s.elements[0],t.__data[8]=s.elements[6],t.__data[9]=s.elements[7],t.__data[10]=s.elements[8],t.__data[11]=s.elements[0]):(s.toArray(t.__data,i),i+=o.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,r,t.__data)}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(r),a[r.id]=f)},dispose:function(){for(const t in i)e.deleteBuffer(i[t]);s=[],i={},a={}}}}function wl(){const e=Or("canvas");return e.style.display="block",e}class El{constructor(e={}){const{canvas:t=wl(),context:r=null,depth:i=!0,stencil:a=!0,alpha:s=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1}=e;let d;this.isWebGLRenderer=!0,d=null!==r?r.getContextAttributes().alpha:s;let p=null,v=null;const A=[],y=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputColorSpace=zt,this.useLegacyLights=!0,this.toneMapping=J,this.toneMappingExposure=1;const x=this;let b=!1,w=0,E=0,S=null,M=-1,_=null;const T=new tn,C=new tn;let I=null,B=t.width,R=t.height,P=1,F=null,L=null;const D=new tn(0,0,B,R),U=new tn(0,0,B,R);let N=!1;const k=new Va;let O=!1,G=!1,z=null;const V=new Gn,H=new un,Q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function j(){return null===S?P:1}let W,X,Y,q,K,Z,$,ee,te,re,ne,ie,ae,se,oe,le,ce,ue,he,de,pe,fe,me,ge,ve=r;function Ae(e,r){for(let n=0;n<e.length;n++){const i=e[n],a=t.getContext(i,r);if(null!==a)return a}return null}try{const e={alpha:!0,depth:i,stencil:a,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${n}`),t.addEventListener("webglcontextlost",Ee,!1),t.addEventListener("webglcontextrestored",Se,!1),t.addEventListener("webglcontextcreationerror",Me,!1),null===ve){const t=["webgl2","webgl","experimental-webgl"];if(!0===x.isWebGL1Renderer&&t.shift(),ve=Ae(t,e),null===ve)throw Ae(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===ve.getShaderPrecisionFormat&&(ve.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Ge){throw console.error("THREE.WebGLRenderer: "+Ge.message),Ge}function ye(){W=new As(ve),X=new $a(ve,W,e),W.init(X),fe=new pl(ve,W,X),Y=new hl(ve,W,X),q=new bs(ve),K=new Jo,Z=new dl(ve,W,Y,K,X,fe,q),$=new ts(x),ee=new vs(x),te=new Qa(ve,X),me=new Ja(ve,W,te,X),re=new ys(ve,te,q,me),ne=new Ms(ve,re,te,q),he=new Ss(ve,X,Z),le=new es(K),ie=new Ko(x,$,ee,W,X,me,le),ae=new xl(x,K),se=new tl,oe=new ol(W,X),ue=new Ka(x,$,ee,Y,ne,d,l),ce=new ul(x,ne,X),ge=new bl(ve,q,X,Y),de=new Za(ve,W,q,X),pe=new xs(ve,W,q,X),q.programs=ie.programs,x.capabilities=X,x.extensions=W,x.properties=K,x.renderLists=se,x.shadowMap=ce,x.state=Y,x.info=q}ye();const be=new yl(x,ve);function Ee(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function Se(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const e=q.autoReset,t=ce.enabled,r=ce.autoUpdate,n=ce.needsUpdate,i=ce.type;ye(),q.autoReset=e,ce.enabled=t,ce.autoUpdate=r,ce.needsUpdate=n,ce.type=i}function Me(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function _e(e){const t=e.target;t.removeEventListener("dispose",_e),function(e){(function(e){const t=K.get(e).programs;void 0!==t&&(t.forEach((function(e){ie.releaseProgram(e)})),e.isShaderMaterial&&ie.releaseShaderCache(e))})(e),K.remove(e)}(t)}this.xr=be,this.getContext=function(){return ve},this.getContextAttributes=function(){return ve.getContextAttributes()},this.forceContextLoss=function(){const e=W.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=W.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return P},this.setPixelRatio=function(e){void 0!==e&&(P=e,this.setSize(B,R,!1))},this.getSize=function(e){return e.set(B,R)},this.setSize=function(e,r,n=!0){be.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(B=e,R=r,t.width=Math.floor(e*P),t.height=Math.floor(r*P),!0===n&&(t.style.width=e+"px",t.style.height=r+"px"),this.setViewport(0,0,e,r))},this.getDrawingBufferSize=function(e){return e.set(B*P,R*P).floor()},this.setDrawingBufferSize=function(e,r,n){B=e,R=r,P=n,t.width=Math.floor(e*n),t.height=Math.floor(r*n),this.setViewport(0,0,e,r)},this.getCurrentViewport=function(e){return e.copy(T)},this.getViewport=function(e){return e.copy(D)},this.setViewport=function(e,t,r,n){e.isVector4?D.set(e.x,e.y,e.z,e.w):D.set(e,t,r,n),Y.viewport(T.copy(D).multiplyScalar(P).floor())},this.getScissor=function(e){return e.copy(U)},this.setScissor=function(e,t,r,n){e.isVector4?U.set(e.x,e.y,e.z,e.w):U.set(e,t,r,n),Y.scissor(C.copy(U).multiplyScalar(P).floor())},this.getScissorTest=function(){return N},this.setScissorTest=function(e){Y.setScissorTest(N=e)},this.setOpaqueSort=function(e){F=e},this.setTransparentSort=function(e){L=e},this.getClearColor=function(e){return e.copy(ue.getClearColor())},this.setClearColor=function(){ue.setClearColor.apply(ue,arguments)},this.getClearAlpha=function(){return ue.getClearAlpha()},this.setClearAlpha=function(){ue.setClearAlpha.apply(ue,arguments)},this.clear=function(e=!0,t=!0,r=!0){let n=0;e&&(n|=ve.COLOR_BUFFER_BIT),t&&(n|=ve.DEPTH_BUFFER_BIT),r&&(n|=ve.STENCIL_BUFFER_BIT),ve.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Ee,!1),t.removeEventListener("webglcontextrestored",Se,!1),t.removeEventListener("webglcontextcreationerror",Me,!1),se.dispose(),oe.dispose(),K.dispose(),$.dispose(),ee.dispose(),ne.dispose(),me.dispose(),ge.dispose(),ie.dispose(),be.dispose(),be.removeEventListener("sessionstart",Be),be.removeEventListener("sessionend",Re),z&&(z.dispose(),z=null),Pe.stop()},this.renderBufferDirect=function(e,t,r,n,i,a){null===t&&(t=Q);const s=i.isMesh&&i.matrixWorld.determinant()<0,o=function(e,t,r,n,i){!0!==t.isScene&&(t=Q);Z.resetTextureUnits();const a=t.fog,s=n.isMeshStandardMaterial?t.environment:null,o=null===S?x.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:Vt,l=(n.isMeshStandardMaterial?ee:$).get(n.envMap||s),c=!0===n.vertexColors&&!!r.attributes.color&&4===r.attributes.color.itemSize,u=!!n.normalMap&&!!r.attributes.tangent,h=!!r.morphAttributes.position,d=!!r.morphAttributes.normal,p=!!r.morphAttributes.color,f=n.toneMapped?x.toneMapping:J,m=r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color,g=void 0!==m?m.length:0,A=K.get(n),y=v.state.lights;if(!0===O&&(!0===G||e!==_)){const t=e===_&&n.id===M;le.setState(n,e,t)}let b=!1;n.version===A.__version?A.needsLights&&A.lightsStateVersion!==y.state.version||A.outputColorSpace!==o||i.isInstancedMesh&&!1===A.instancing?b=!0:i.isInstancedMesh||!0!==A.instancing?i.isSkinnedMesh&&!1===A.skinning?b=!0:i.isSkinnedMesh||!0!==A.skinning?A.envMap!==l||!0===n.fog&&A.fog!==a?b=!0:void 0===A.numClippingPlanes||A.numClippingPlanes===le.numPlanes&&A.numIntersection===le.numIntersection?(A.vertexAlphas!==c||A.vertexTangents!==u||A.morphTargets!==h||A.morphNormals!==d||A.morphColors!==p||A.toneMapping!==f||!0===X.isWebGL2&&A.morphTargetsCount!==g)&&(b=!0):b=!0:b=!0:b=!0:(b=!0,A.__version=n.version);let w=A.currentProgram;!0===b&&(w=ke(n,t,i));let E=!1,T=!1,C=!1;const I=w.getUniforms(),B=A.uniforms;Y.useProgram(w.program)&&(E=!0,T=!0,C=!0);n.id!==M&&(M=n.id,T=!0);if(E||_!==e){if(I.setValue(ve,"projectionMatrix",e.projectionMatrix),X.logarithmicDepthBuffer&&I.setValue(ve,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),_!==e&&(_=e,T=!0,C=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){const t=I.map.cameraPosition;void 0!==t&&t.setValue(ve,H.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&I.setValue(ve,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||i.isSkinnedMesh)&&I.setValue(ve,"viewMatrix",e.matrixWorldInverse)}if(i.isSkinnedMesh){I.setOptional(ve,i,"bindMatrix"),I.setOptional(ve,i,"bindMatrixInverse");const e=i.skeleton;e&&(X.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),I.setValue(ve,"boneTexture",e.boneTexture,Z),I.setValue(ve,"boneTextureSize",e.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const F=r.morphAttributes;(void 0!==F.position||void 0!==F.normal||void 0!==F.color&&!0===X.isWebGL2)&&he.update(i,r,w);(T||A.receiveShadow!==i.receiveShadow)&&(A.receiveShadow=i.receiveShadow,I.setValue(ve,"receiveShadow",i.receiveShadow));n.isMeshGouraudMaterial&&null!==n.envMap&&(B.envMap.value=l,B.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);T&&(I.setValue(ve,"toneMappingExposure",x.toneMappingExposure),A.needsLights&&(D=C,(L=B).ambientLightColor.needsUpdate=D,L.lightProbe.needsUpdate=D,L.directionalLights.needsUpdate=D,L.directionalLightShadows.needsUpdate=D,L.pointLights.needsUpdate=D,L.pointLightShadows.needsUpdate=D,L.spotLights.needsUpdate=D,L.spotLightShadows.needsUpdate=D,L.rectAreaLights.needsUpdate=D,L.hemisphereLights.needsUpdate=D),a&&!0===n.fog&&ae.refreshFogUniforms(B,a),ae.refreshMaterialUniforms(B,n,P,R,z),Bo.upload(ve,A.uniformsList,B,Z));var L,D;n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Bo.upload(ve,A.uniformsList,B,Z),n.uniformsNeedUpdate=!1);n.isSpriteMaterial&&I.setValue(ve,"center",i.center);if(I.setValue(ve,"modelViewMatrix",i.modelViewMatrix),I.setValue(ve,"normalMatrix",i.normalMatrix),I.setValue(ve,"modelMatrix",i.matrixWorld),n.isShaderMaterial||n.isRawShaderMaterial){const e=n.uniformsGroups;for(let t=0,r=e.length;t<r;t++)if(X.isWebGL2){const r=e[t];ge.update(r,w),ge.bind(r,w)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return w}(e,t,r,n,i);Y.setMaterial(n,s);let l=r.index,c=1;!0===n.wireframe&&(l=re.getWireframeAttribute(r),c=2);const u=r.drawRange,h=r.attributes.position;let d=u.start*c,p=(u.start+u.count)*c;null!==a&&(d=Math.max(d,a.start*c),p=Math.min(p,(a.start+a.count)*c)),null!==l?(d=Math.max(d,0),p=Math.min(p,l.count)):null!=h&&(d=Math.max(d,0),p=Math.min(p,h.count));const f=p-d;if(f<0||f===1/0)return;let m;me.setup(i,n,o,r,l);let g=de;if(null!==l&&(m=te.get(l),g=pe,g.setIndex(m)),i.isMesh)!0===n.wireframe?(Y.setLineWidth(n.wireframeLinewidth*j()),g.setMode(ve.LINES)):g.setMode(ve.TRIANGLES);else if(i.isLine){let e=n.linewidth;void 0===e&&(e=1),Y.setLineWidth(e*j()),i.isLineSegments?g.setMode(ve.LINES):i.isLineLoop?g.setMode(ve.LINE_LOOP):g.setMode(ve.LINE_STRIP)}else i.isPoints?g.setMode(ve.POINTS):i.isSprite&&g.setMode(ve.TRIANGLES);if(i.isInstancedMesh)g.renderInstances(d,f,i.count);else if(r.isInstancedBufferGeometry){const e=void 0!==r._maxInstanceCount?r._maxInstanceCount:1/0,t=Math.min(r.instanceCount,e);g.renderInstances(d,f,t)}else g.render(d,f)},this.compile=function(e,t){function r(e,t,r){!0===e.transparent&&e.side===g&&!1===e.forceSinglePass?(e.side=m,e.needsUpdate=!0,ke(e,t,r),e.side=f,e.needsUpdate=!0,ke(e,t,r),e.side=g):ke(e,t,r)}v=oe.get(e),v.init(),y.push(v),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(v.pushLight(e),e.castShadow&&v.pushShadow(e))})),v.setupLights(x.useLegacyLights),e.traverse((function(t){const n=t.material;if(n)if(Array.isArray(n))for(let i=0;i<n.length;i++){r(n[i],e,t)}else r(n,e,t)})),y.pop(),v=null};let Te=null;function Be(){Pe.stop()}function Re(){Pe.start()}const Pe=new Ha;function Fe(e,t,r,n){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)r=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)v.pushLight(e),e.castShadow&&v.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||k.intersectsSprite(e)){n&&H.setFromMatrixPosition(e.matrixWorld).applyMatrix4(V);const t=ne.update(e),i=e.material;i.visible&&p.push(e,t,i,r,H.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||k.intersectsObject(e))){e.isSkinnedMesh&&e.skeleton.frame!==q.render.frame&&(e.skeleton.update(),e.skeleton.frame=q.render.frame);const t=ne.update(e),i=e.material;if(n&&(null===t.boundingSphere&&t.computeBoundingSphere(),H.copy(t.boundingSphere.center).applyMatrix4(e.matrixWorld).applyMatrix4(V)),Array.isArray(i)){const n=t.groups;for(let a=0,s=n.length;a<s;a++){const s=n[a],o=i[s.materialIndex];o&&o.visible&&p.push(e,t,o,r,H.z,s)}}else i.visible&&p.push(e,t,i,r,H.z,null)}const i=e.children;for(let a=0,s=i.length;a<s;a++)Fe(i[a],t,r,n)}function De(e,t,r,n){const i=e.opaque,a=e.transmissive,s=e.transparent;v.setupLightsView(r),!0===O&&le.setGlobalState(x.clippingPlanes,r),a.length>0&&function(e,t,r,n){if(null===z){const e=X.isWebGL2;z=new rn(1024,1024,{generateMipmaps:!0,type:W.has("EXT_color_buffer_half_float")?Ie:we,minFilter:xe,samples:e&&!0===o?4:0})}const i=x.getRenderTarget();x.setRenderTarget(z),x.clear();const a=x.toneMapping;x.toneMapping=J,Ue(e,r,n),Z.updateMultisampleRenderTarget(z),Z.updateRenderTargetMipmap(z);let s=!1;for(let o=0,l=t.length;o<l;o++){const e=t[o],i=e.object,a=e.geometry,l=e.material,c=e.group;if(l.side===g&&i.layers.test(n.layers)){const e=l.side;l.side=m,l.needsUpdate=!0,Ne(i,r,n,a,l,c),l.side=e,l.needsUpdate=!0,s=!0}}!0===s&&(Z.updateMultisampleRenderTarget(z),Z.updateRenderTargetMipmap(z));x.setRenderTarget(i),x.toneMapping=a}(i,a,t,r),n&&Y.viewport(T.copy(n)),i.length>0&&Ue(i,t,r),a.length>0&&Ue(a,t,r),s.length>0&&Ue(s,t,r),Y.buffers.depth.setTest(!0),Y.buffers.depth.setMask(!0),Y.buffers.color.setMask(!0),Y.setPolygonOffset(!1)}function Ue(e,t,r){const n=!0===t.isScene?t.overrideMaterial:null;for(let i=0,a=e.length;i<a;i++){const a=e[i],s=a.object,o=a.geometry,l=null===n?a.material:n,c=a.group;s.layers.test(r.layers)&&Ne(s,t,r,o,l,c)}}function Ne(e,t,r,n,i,a){e.onBeforeRender(x,t,r,n,i,a),e.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(x,t,r,n,e,a),!0===i.transparent&&i.side===g&&!1===i.forceSinglePass?(i.side=m,i.needsUpdate=!0,x.renderBufferDirect(r,t,n,i,e,a),i.side=f,i.needsUpdate=!0,x.renderBufferDirect(r,t,n,i,e,a),i.side=g):x.renderBufferDirect(r,t,n,i,e,a),e.onAfterRender(x,t,r,n,i,a)}function ke(e,t,r){!0!==t.isScene&&(t=Q);const n=K.get(e),i=v.state.lights,a=v.state.shadowsArray,s=i.state.version,o=ie.getParameters(e,i.state,a,t,r),l=ie.getProgramCacheKey(o);let c=n.programs;n.environment=e.isMeshStandardMaterial?t.environment:null,n.fog=t.fog,n.envMap=(e.isMeshStandardMaterial?ee:$).get(e.envMap||n.environment),void 0===c&&(e.addEventListener("dispose",_e),c=new Map,n.programs=c);let u=c.get(l);if(void 0!==u){if(n.currentProgram===u&&n.lightsStateVersion===s)return Oe(e,o),u}else o.uniforms=ie.getUniforms(e),e.onBuild(r,o,x),e.onBeforeCompile(o,x),u=ie.acquireProgram(o,l),c.set(l,u),n.uniforms=o.uniforms;const h=n.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(h.clippingPlanes=le.uniform),Oe(e,o),n.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),n.lightsStateVersion=s,n.needsLights&&(h.ambientLightColor.value=i.state.ambient,h.lightProbe.value=i.state.probe,h.directionalLights.value=i.state.directional,h.directionalLightShadows.value=i.state.directionalShadow,h.spotLights.value=i.state.spot,h.spotLightShadows.value=i.state.spotShadow,h.rectAreaLights.value=i.state.rectArea,h.ltc_1.value=i.state.rectAreaLTC1,h.ltc_2.value=i.state.rectAreaLTC2,h.pointLights.value=i.state.point,h.pointLightShadows.value=i.state.pointShadow,h.hemisphereLights.value=i.state.hemi,h.directionalShadowMap.value=i.state.directionalShadowMap,h.directionalShadowMatrix.value=i.state.directionalShadowMatrix,h.spotShadowMap.value=i.state.spotShadowMap,h.spotLightMatrix.value=i.state.spotLightMatrix,h.spotLightMap.value=i.state.spotLightMap,h.pointShadowMap.value=i.state.pointShadowMap,h.pointShadowMatrix.value=i.state.pointShadowMatrix);const d=u.getUniforms(),p=Bo.seqWithValue(d.seq,h);return n.currentProgram=u,n.uniformsList=p,u}function Oe(e,t){const r=K.get(e);r.outputColorSpace=t.outputColorSpace,r.instancing=t.instancing,r.skinning=t.skinning,r.morphTargets=t.morphTargets,r.morphNormals=t.morphNormals,r.morphColors=t.morphColors,r.morphTargetsCount=t.morphTargetsCount,r.numClippingPlanes=t.numClippingPlanes,r.numIntersection=t.numClipIntersection,r.vertexAlphas=t.vertexAlphas,r.vertexTangents=t.vertexTangents,r.toneMapping=t.toneMapping}Pe.setAnimationLoop((function(e){Te&&Te(e)})),"undefined"!=typeof self&&Pe.setContext(self),this.setAnimationLoop=function(e){Te=e,be.setAnimationLoop(e),null===e?Pe.stop():Pe.start()},be.addEventListener("sessionstart",Be),be.addEventListener("sessionend",Re),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===b)return;!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===be.enabled&&!0===be.isPresenting&&(!0===be.cameraAutoUpdate&&be.updateCamera(t),t=be.getCamera()),!0===e.isScene&&e.onBeforeRender(x,e,t,S),v=oe.get(e,y.length),v.init(),y.push(v),V.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),k.setFromProjectionMatrix(V),G=this.localClippingEnabled,O=le.init(this.clippingPlanes,G),p=se.get(e,A.length),p.init(),A.push(p),Fe(e,t,0,x.sortObjects),p.finish(),!0===x.sortObjects&&p.sort(F,L),!0===O&&le.beginShadows();const r=v.state.shadowsArray;if(ce.render(r,e,t),!0===O&&le.endShadows(),!0===this.info.autoReset&&this.info.reset(),ue.render(p,e),v.setupLights(x.useLegacyLights),t.isArrayCamera){const r=t.cameras;for(let t=0,n=r.length;t<n;t++){const n=r[t];De(p,e,n,n.viewport)}}else De(p,e,t);null!==S&&(Z.updateMultisampleRenderTarget(S),Z.updateRenderTargetMipmap(S)),!0===e.isScene&&e.onAfterRender(x,e,t),me.resetDefaultState(),M=-1,_=null,y.pop(),v=y.length>0?y[y.length-1]:null,A.pop(),p=A.length>0?A[A.length-1]:null},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return E},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(e,t,r){K.get(e.texture).__webglTexture=t,K.get(e.depthTexture).__webglTexture=r;const n=K.get(e);n.__hasExternalTextures=!0,n.__hasExternalTextures&&(n.__autoAllocateDepthBuffer=void 0===r,n.__autoAllocateDepthBuffer||!0===W.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),n.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){const r=K.get(e);r.__webglFramebuffer=t,r.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,r=0){S=e,w=t,E=r;let n=!0,i=null,a=!1,s=!1;if(e){const r=K.get(e);void 0!==r.__useDefaultFramebuffer?(Y.bindFramebuffer(ve.FRAMEBUFFER,null),n=!1):void 0===r.__webglFramebuffer?Z.setupRenderTarget(e):r.__hasExternalTextures&&Z.rebindTextures(e,K.get(e.texture).__webglTexture,K.get(e.depthTexture).__webglTexture);const o=e.texture;(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture)&&(s=!0);const l=K.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=l[t],a=!0):i=X.isWebGL2&&e.samples>0&&!1===Z.useMultisampledRTT(e)?K.get(e).__webglMultisampledFramebuffer:l,T.copy(e.viewport),C.copy(e.scissor),I=e.scissorTest}else T.copy(D).multiplyScalar(P).floor(),C.copy(U).multiplyScalar(P).floor(),I=N;if(Y.bindFramebuffer(ve.FRAMEBUFFER,i)&&X.drawBuffers&&n&&Y.drawBuffers(e,i),Y.viewport(T),Y.scissor(C),Y.setScissorTest(I),a){const n=K.get(e.texture);ve.framebufferTexture2D(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,ve.TEXTURE_CUBE_MAP_POSITIVE_X+t,n.__webglTexture,r)}else if(s){const n=K.get(e.texture),i=t||0;ve.framebufferTextureLayer(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,n.__webglTexture,r||0,i)}M=-1},this.readRenderTargetPixels=function(e,t,r,n,i,a,s){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=K.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==s&&(o=o[s]),o){Y.bindFramebuffer(ve.FRAMEBUFFER,o);try{const s=e.texture,o=s.format,l=s.type;if(o!==Le&&fe.convert(o)!==ve.getParameter(ve.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===Ie&&(W.has("EXT_color_buffer_half_float")||X.isWebGL2&&W.has("EXT_color_buffer_float"));if(!(l===we||fe.convert(l)===ve.getParameter(ve.IMPLEMENTATION_COLOR_READ_TYPE)||l===Ce&&(X.isWebGL2||W.has("OES_texture_float")||W.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-n&&r>=0&&r<=e.height-i&&ve.readPixels(t,r,n,i,fe.convert(o),fe.convert(l),a)}finally{const e=null!==S?K.get(S).__webglFramebuffer:null;Y.bindFramebuffer(ve.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t,r=0){const n=Math.pow(2,-r),i=Math.floor(t.image.width*n),a=Math.floor(t.image.height*n);Z.setTexture2D(t,0),ve.copyTexSubImage2D(ve.TEXTURE_2D,r,0,0,e.x,e.y,i,a),Y.unbindTexture()},this.copyTextureToTexture=function(e,t,r,n=0){const i=t.image.width,a=t.image.height,s=fe.convert(r.format),o=fe.convert(r.type);Z.setTexture2D(r,0),ve.pixelStorei(ve.UNPACK_FLIP_Y_WEBGL,r.flipY),ve.pixelStorei(ve.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),ve.pixelStorei(ve.UNPACK_ALIGNMENT,r.unpackAlignment),t.isDataTexture?ve.texSubImage2D(ve.TEXTURE_2D,n,e.x,e.y,i,a,s,o,t.image.data):t.isCompressedTexture?ve.compressedTexSubImage2D(ve.TEXTURE_2D,n,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,s,t.mipmaps[0].data):ve.texSubImage2D(ve.TEXTURE_2D,n,e.x,e.y,s,o,t.image),0===n&&r.generateMipmaps&&ve.generateMipmap(ve.TEXTURE_2D),Y.unbindTexture()},this.copyTextureToTexture3D=function(e,t,r,n,i=0){if(x.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const a=e.max.x-e.min.x+1,s=e.max.y-e.min.y+1,o=e.max.z-e.min.z+1,l=fe.convert(n.format),c=fe.convert(n.type);let u;if(n.isData3DTexture)Z.setTexture3D(n,0),u=ve.TEXTURE_3D;else{if(!n.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Z.setTexture2DArray(n,0),u=ve.TEXTURE_2D_ARRAY}ve.pixelStorei(ve.UNPACK_FLIP_Y_WEBGL,n.flipY),ve.pixelStorei(ve.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),ve.pixelStorei(ve.UNPACK_ALIGNMENT,n.unpackAlignment);const h=ve.getParameter(ve.UNPACK_ROW_LENGTH),d=ve.getParameter(ve.UNPACK_IMAGE_HEIGHT),p=ve.getParameter(ve.UNPACK_SKIP_PIXELS),f=ve.getParameter(ve.UNPACK_SKIP_ROWS),m=ve.getParameter(ve.UNPACK_SKIP_IMAGES),g=r.isCompressedTexture?r.mipmaps[0]:r.image;ve.pixelStorei(ve.UNPACK_ROW_LENGTH,g.width),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,g.height),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,e.min.x),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,e.min.y),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,e.min.z),r.isDataTexture||r.isData3DTexture?ve.texSubImage3D(u,i,t.x,t.y,t.z,a,s,o,l,c,g.data):r.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ve.compressedTexSubImage3D(u,i,t.x,t.y,t.z,a,s,o,l,g.data)):ve.texSubImage3D(u,i,t.x,t.y,t.z,a,s,o,l,c,g),ve.pixelStorei(ve.UNPACK_ROW_LENGTH,h),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,d),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,p),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,f),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,m),0===i&&n.generateMipmaps&&ve.generateMipmap(u),Y.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?Z.setTextureCube(e,0):e.isData3DTexture?Z.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?Z.setTexture2DArray(e,0):Z.setTexture2D(e,0),Y.unbindTexture()},this.resetState=function(){w=0,E=0,S=null,Y.reset(),me.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===zt?Dt:Lt}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Dt?zt:Vt}}class Sl extends El{}Sl.prototype.isWebGL1Renderer=!0;class Ml{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Bi(e),this.density=t}clone(){return new Ml(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class _l{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new Bi(e),this.near=t,this.far=r}clone(){return new _l(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Tl extends hi{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class Cl{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=sr,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Er()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let n=0,i=this.stride;n<i;n++)this.array[e+n]=t.array[r+n];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Er()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Er()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Il=new un;class Bl{constructor(e,t,r,n=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=r,this.normalized=n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,r=this.data.count;t<r;t++)Il.fromBufferAttribute(this,t),Il.applyMatrix4(e),this.setXYZ(t,Il.x,Il.y,Il.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)Il.fromBufferAttribute(this,t),Il.applyNormalMatrix(e),this.setXYZ(t,Il.x,Il.y,Il.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)Il.fromBufferAttribute(this,t),Il.transformDirection(e),this.setXYZ(t,Il.x,Il.y,Il.z);return this}setX(e,t){return this.normalized&&(t=Rr(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Rr(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Rr(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Rr(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Br(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Br(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Br(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Br(t,this.array)),t}setXY(e,t,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Rr(t,this.array),r=Rr(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this}setXYZ(e,t,r,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Rr(t,this.array),r=Rr(r,this.array),n=Rr(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,this}setXYZW(e,t,r,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Rr(t,this.array),r=Rr(r,this.array),n=Rr(n,this.array),i=Rr(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,this.data.array[e+3]=i,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const r=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[r+t])}return new Gi(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Bl(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const r=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[r+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class Rl extends Mi{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Bi(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Pl;const Fl=new un,Ll=new un,Dl=new un,Ul=new Fr,Nl=new Fr,kl=new Gn,Ol=new un,Gl=new un,zl=new un,Vl=new Fr,Hl=new Fr,Ql=new Fr;class jl extends hi{constructor(e){if(super(),this.isSprite=!0,this.type="Sprite",void 0===Pl){Pl=new ia;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new Cl(e,5);Pl.setIndex([0,1,2,0,2,3]),Pl.setAttribute("position",new Bl(t,3,0,!1)),Pl.setAttribute("uv",new Bl(t,2,3,!1))}this.geometry=Pl,this.material=void 0!==e?e:new Rl,this.center=new Fr(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ll.setFromMatrixScale(this.matrixWorld),kl.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Dl.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Ll.multiplyScalar(-Dl.z);const r=this.material.rotation;let n,i;0!==r&&(i=Math.cos(r),n=Math.sin(r));const a=this.center;Wl(Ol.set(-.5,-.5,0),Dl,a,Ll,n,i),Wl(Gl.set(.5,-.5,0),Dl,a,Ll,n,i),Wl(zl.set(.5,.5,0),Dl,a,Ll,n,i),Vl.set(0,0),Hl.set(1,0),Ql.set(1,1);let s=e.ray.intersectTriangle(Ol,Gl,zl,!1,Fl);if(null===s&&(Wl(Gl.set(-.5,.5,0),Dl,a,Ll,n,i),Hl.set(0,1),s=e.ray.intersectTriangle(Ol,zl,Gl,!1,Fl),null===s))return;const o=e.ray.origin.distanceTo(Fl);o<e.near||o>e.far||t.push({distance:o,point:Fl.clone(),uv:Ei.getInterpolation(Fl,Ol,Gl,zl,Vl,Hl,Ql,new Fr),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function Wl(e,t,r,n,i,a){Ul.subVectors(e,r).addScalar(.5).multiply(n),void 0!==i?(Nl.x=a*Ul.x-i*Ul.y,Nl.y=i*Ul.x+a*Ul.y):Nl.copy(Ul),e.copy(t),e.x+=Nl.x,e.y+=Nl.y,e.applyMatrix4(kl)}const Xl=new un,Yl=new un;class ql extends hi{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let r=0,n=t.length;r<n;r++){const e=t[r];this.addLevel(e.object.clone(),e.distance,e.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,r=0){t=Math.abs(t);const n=this.levels;let i;for(i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,hysteresis:r,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let r,n;for(r=1,n=t.length;r<n;r++){let n=t[r].distance;if(t[r].object.visible&&(n-=n*t[r].hysteresis),e<n)break}return t[r-1].object}return null}raycast(e,t){if(this.levels.length>0){Xl.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Xl);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Xl.setFromMatrixPosition(e.matrixWorld),Yl.setFromMatrixPosition(this.matrixWorld);const r=Xl.distanceTo(Yl)/e.zoom;let n,i;for(t[0].object.visible=!0,n=1,i=t.length;n<i;n++){let e=t[n].distance;if(t[n].object.visible&&(e-=e*t[n].hysteresis),!(r>=e))break;t[n-1].object.visible=!1,t[n].object.visible=!0}for(this._currentLevel=n-1;n<i;n++)t[n].object.visible=!1}}toJSON(e){const t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];const r=this.levels;for(let n=0,i=r.length;n<i;n++){const e=r[n];t.object.levels.push({object:e.object.uuid,distance:e.distance,hysteresis:e.hysteresis})}return t}}const Kl=new un,Jl=new tn,Zl=new tn,$l=new un,ec=new Gn,tc=new un;class rc extends wa{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Gn,this.bindMatrixInverse=new Gn,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;null===this.boundingBox&&(this.boundingBox=new pn),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let r=0;r<t.count;r++)tc.fromBufferAttribute(t,r),this.applyBoneTransform(r,tc),this.boundingBox.expandByPoint(tc)}computeBoundingSphere(){const e=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new Rn),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let r=0;r<t.count;r++)tc.fromBufferAttribute(t,r),this.applyBoneTransform(r,tc),this.boundingSphere.expandByPoint(tc)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new tn,t=this.geometry.attributes.skinWeight;for(let r=0,n=t.count;r<n;r++){e.fromBufferAttribute(t,r);const n=1/e.manhattanLength();n!==1/0?e.multiplyScalar(n):e.set(1,0,0,0),t.setXYZW(r,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const r=this.skeleton,n=this.geometry;Jl.fromBufferAttribute(n.attributes.skinIndex,e),Zl.fromBufferAttribute(n.attributes.skinWeight,e),Kl.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let i=0;i<4;i++){const e=Zl.getComponent(i);if(0!==e){const n=Jl.getComponent(i);ec.multiplyMatrices(r.bones[n].matrixWorld,r.boneInverses[n]),t.addScaledVector($l.copy(Kl).applyMatrix4(ec),e)}}return t.applyMatrix4(this.bindMatrixInverse)}boneTransform(e,t){return console.warn("THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151."),this.applyBoneTransform(e,t)}}class nc extends hi{constructor(){super(),this.isBone=!0,this.type="Bone"}}class ic extends en{constructor(e=null,t=1,r=1,n,i,a,s,o,l=de,c=de,u,h){super(null,a,s,o,l,c,n,i,u,h),this.isDataTexture=!0,this.image={data:e,width:t,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const ac=new Gn,sc=new Gn;class oc{constructor(e=[],t=[]){this.uuid=Er(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new Gn)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new Gn;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,r=this.boneMatrices,n=this.boneTexture;for(let i=0,a=e.length;i<a;i++){const n=e[i]?e[i].matrixWorld:sc;ac.multiplyMatrices(n,t[i]),ac.toArray(r,16*i)}null!==n&&(n.needsUpdate=!0)}clone(){return new oc(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=Cr(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const r=new ic(t,e,e,Le,Ce);return r.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=r,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,r=this.bones.length;t<r;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let r=0,n=e.bones.length;r<n;r++){const n=e.bones[r];let i=t[n];void 0===i&&(console.warn("THREE.Skeleton: No bone found with UUID:",n),i=new nc),this.bones.push(i),this.boneInverses.push((new Gn).fromArray(e.boneInverses[r]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,r=this.boneInverses;for(let n=0,i=t.length;n<i;n++){const i=t[n];e.bones.push(i.uuid);const a=r[n];e.boneInverses.push(a.toArray())}return e}}class lc extends Gi{constructor(e,t,r,n=1){super(e,t,r),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const cc=new Gn,uc=new Gn,hc=[],dc=new pn,pc=new Gn,fc=new wa,mc=new Rn;class gc extends wa{constructor(e,t,r){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new lc(new Float32Array(16*r),16),this.instanceColor=null,this.count=r,this.boundingBox=null,this.boundingSphere=null;for(let n=0;n<r;n++)this.setMatrixAt(n,pc)}computeBoundingBox(){const e=this.geometry,t=this.count;null===this.boundingBox&&(this.boundingBox=new pn),null===e.boundingBox&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,cc),dc.copy(e.boundingBox).applyMatrix4(cc),this.boundingBox.union(dc)}computeBoundingSphere(){const e=this.geometry,t=this.count;null===this.boundingSphere&&(this.boundingSphere=new Rn),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,cc),mc.copy(e.boundingSphere).applyMatrix4(cc),this.boundingSphere.union(mc)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const r=this.matrixWorld,n=this.count;if(fc.geometry=this.geometry,fc.material=this.material,void 0!==fc.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),mc.copy(this.boundingSphere),mc.applyMatrix4(r),!1!==e.ray.intersectsSphere(mc)))for(let i=0;i<n;i++){this.getMatrixAt(i,cc),uc.multiplyMatrices(r,cc),fc.matrixWorld=uc,fc.raycast(e,hc);for(let e=0,r=hc.length;e<r;e++){const r=hc[e];r.instanceId=i,r.object=this,t.push(r)}hc.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new lc(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}class vc extends Mi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Bi(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Ac=new un,yc=new un,xc=new Gn,bc=new On,wc=new Rn;class Ec extends hi{constructor(e=new ia,t=new vc){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,r=[0];for(let e=1,n=t.count;e<n;e++)Ac.fromBufferAttribute(t,e-1),yc.fromBufferAttribute(t,e),r[e]=r[e-1],r[e]+=Ac.distanceTo(yc);e.setAttribute("lineDistance",new qi(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const r=this.geometry,n=this.matrixWorld,i=e.params.Line.threshold,a=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),wc.copy(r.boundingSphere),wc.applyMatrix4(n),wc.radius+=i,!1===e.ray.intersectsSphere(wc))return;xc.copy(n).invert(),bc.copy(e.ray).applyMatrix4(xc);const s=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s,l=new un,c=new un,u=new un,h=new un,d=this.isLineSegments?2:1,p=r.index,f=r.attributes.position;if(null!==p){for(let r=Math.max(0,a.start),n=Math.min(p.count,a.start+a.count)-1;r<n;r+=d){const n=p.getX(r),i=p.getX(r+1);l.fromBufferAttribute(f,n),c.fromBufferAttribute(f,i);if(bc.distanceSqToSegment(l,c,h,u)>o)continue;h.applyMatrix4(this.matrixWorld);const a=e.ray.origin.distanceTo(h);a<e.near||a>e.far||t.push({distance:a,point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}else{for(let r=Math.max(0,a.start),n=Math.min(f.count,a.start+a.count)-1;r<n;r+=d){l.fromBufferAttribute(f,r),c.fromBufferAttribute(f,r+1);if(bc.distanceSqToSegment(l,c,h,u)>o)continue;h.applyMatrix4(this.matrixWorld);const n=e.ray.origin.distanceTo(h);n<e.near||n>e.far||t.push({distance:n,point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;e<t;e++){const t=r[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}const Sc=new un,Mc=new un;class _c extends Ec{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,r=[];for(let e=0,n=t.count;e<n;e+=2)Sc.fromBufferAttribute(t,e),Mc.fromBufferAttribute(t,e+1),r[e]=0===e?0:r[e-1],r[e+1]=r[e]+Sc.distanceTo(Mc);e.setAttribute("lineDistance",new qi(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Tc extends Ec{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Cc extends Mi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Bi(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Ic=new Gn,Bc=new On,Rc=new Rn,Pc=new un;class Fc extends hi{constructor(e=new ia,t=new Cc){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const r=this.geometry,n=this.matrixWorld,i=e.params.Points.threshold,a=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),Rc.copy(r.boundingSphere),Rc.applyMatrix4(n),Rc.radius+=i,!1===e.ray.intersectsSphere(Rc))return;Ic.copy(n).invert(),Bc.copy(e.ray).applyMatrix4(Ic);const s=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s,l=r.index,c=r.attributes.position;if(null!==l){for(let r=Math.max(0,a.start),i=Math.min(l.count,a.start+a.count);r<i;r++){const i=l.getX(r);Pc.fromBufferAttribute(c,i),Lc(Pc,i,o,n,e,t,this)}}else{for(let r=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);r<i;r++)Pc.fromBufferAttribute(c,r),Lc(Pc,r,o,n,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;e<t;e++){const t=r[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function Lc(e,t,r,n,i,a,s){const o=Bc.distanceSqToPoint(e);if(o<r){const r=new un;Bc.closestPointToPoint(e,r),r.applyMatrix4(n);const l=i.ray.origin.distanceTo(r);if(l<i.near||l>i.far)return;a.push({distance:l,distanceToRay:Math.sqrt(o),point:r,index:t,face:null,object:s})}}class Dc extends en{constructor(e,t,r,n,i,a,s,o,l){super(e,t,r,n,i,a,s,o,l),this.isVideoTexture=!0,this.minFilter=void 0!==a?a:ve,this.magFilter=void 0!==i?i:ve,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Uc extends en{constructor(e,t,r){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=r,this.magFilter=de,this.minFilter=de,this.generateMipmaps=!1,this.needsUpdate=!0}}class Nc extends en{constructor(e,t,r,n,i,a,s,o,l,c,u,h){super(null,a,s,o,l,c,n,i,u,h),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class kc extends Nc{constructor(e,t,r,n,i,a){super(e,t,r,i,a),this.isCompressedArrayTexture=!0,this.image.depth=n,this.wrapR=ue}}class Oc extends en{constructor(e,t,r,n,i,a,s,o,l){super(e,t,r,n,i,a,s,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Gc{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let r,n=this.getPoint(0),i=0;t.push(0);for(let a=1;a<=e;a++)r=this.getPoint(a/e),i+=r.distanceTo(n),t.push(i),n=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let n=0;const i=r.length;let a;a=t||e*r[i-1];let s,o=0,l=i-1;for(;o<=l;)if(n=Math.floor(o+(l-o)/2),s=r[n]-a,s<0)o=n+1;else{if(!(s>0)){l=n;break}l=n-1}if(n=l,r[n]===a)return n/(i-1);const c=r[n];return(n+(a-c)/(r[n+1]-c))/(i-1)}getTangent(e,t){const r=1e-4;let n=e-r,i=e+r;n<0&&(n=0),i>1&&(i=1);const a=this.getPoint(n),s=this.getPoint(i),o=t||(a.isVector2?new Fr:new un);return o.copy(s).sub(a).normalize(),o}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new un,n=[],i=[],a=[],s=new un,o=new Gn;for(let d=0;d<=e;d++){const t=d/e;n[d]=this.getTangentAt(t,new un)}i[0]=new un,a[0]=new un;let l=Number.MAX_VALUE;const c=Math.abs(n[0].x),u=Math.abs(n[0].y),h=Math.abs(n[0].z);c<=l&&(l=c,r.set(1,0,0)),u<=l&&(l=u,r.set(0,1,0)),h<=l&&r.set(0,0,1),s.crossVectors(n[0],r).normalize(),i[0].crossVectors(n[0],s),a[0].crossVectors(n[0],i[0]);for(let d=1;d<=e;d++){if(i[d]=i[d-1].clone(),a[d]=a[d-1].clone(),s.crossVectors(n[d-1],n[d]),s.length()>Number.EPSILON){s.normalize();const e=Math.acos(Sr(n[d-1].dot(n[d]),-1,1));i[d].applyMatrix4(o.makeRotationAxis(s,e))}a[d].crossVectors(n[d],i[d])}if(!0===t){let t=Math.acos(Sr(i[0].dot(i[e]),-1,1));t/=e,n[0].dot(s.crossVectors(i[0],i[e]))>0&&(t=-t);for(let r=1;r<=e;r++)i[r].applyMatrix4(o.makeRotationAxis(n[r],t*r)),a[r].crossVectors(n[r],i[r])}return{tangents:n,normals:i,binormals:a}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class zc extends Gc{constructor(e=0,t=0,r=1,n=1,i=0,a=2*Math.PI,s=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=n,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=s,this.aRotation=o}getPoint(e,t){const r=t||new Fr,n=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const a=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=n;for(;i>n;)i-=n;i<Number.EPSILON&&(i=a?0:n),!0!==this.aClockwise||a||(i===n?i=-n:i-=n);const s=this.aStartAngle+e*i;let o=this.aX+this.xRadius*Math.cos(s),l=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),r=o-this.aX,n=l-this.aY;o=r*e-n*t+this.aX,l=r*t+n*e+this.aY}return r.set(o,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class Vc extends zc{constructor(e,t,r,n,i,a){super(e,t,r,r,n,i,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Hc(){let e=0,t=0,r=0,n=0;function i(i,a,s,o){e=i,t=s,r=-3*i+3*a-2*s-o,n=2*i-2*a+s+o}return{initCatmullRom:function(e,t,r,n,a){i(t,r,a*(r-e),a*(n-t))},initNonuniformCatmullRom:function(e,t,r,n,a,s,o){let l=(t-e)/a-(r-e)/(a+s)+(r-t)/s,c=(r-t)/s-(n-t)/(s+o)+(n-r)/o;l*=s,c*=s,i(t,r,l,c)},calc:function(i){const a=i*i;return e+t*i+r*a+n*(a*i)}}}const Qc=new un,jc=new Hc,Wc=new Hc,Xc=new Hc;class Yc extends Gc{constructor(e=[],t=!1,r="centripetal",n=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=r,this.tension=n}getPoint(e,t=new un){const r=t,n=this.points,i=n.length,a=(i-(this.closed?0:1))*e;let s,o,l=Math.floor(a),c=a-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===c&&l===i-1&&(l=i-2,c=1),this.closed||l>0?s=n[(l-1)%i]:(Qc.subVectors(n[0],n[1]).add(n[0]),s=Qc);const u=n[l%i],h=n[(l+1)%i];if(this.closed||l+2<i?o=n[(l+2)%i]:(Qc.subVectors(n[i-1],n[i-2]).add(n[i-1]),o=Qc),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(s.distanceToSquared(u),e),r=Math.pow(u.distanceToSquared(h),e),n=Math.pow(h.distanceToSquared(o),e);r<1e-4&&(r=1),t<1e-4&&(t=r),n<1e-4&&(n=r),jc.initNonuniformCatmullRom(s.x,u.x,h.x,o.x,t,r,n),Wc.initNonuniformCatmullRom(s.y,u.y,h.y,o.y,t,r,n),Xc.initNonuniformCatmullRom(s.z,u.z,h.z,o.z,t,r,n)}else"catmullrom"===this.curveType&&(jc.initCatmullRom(s.x,u.x,h.x,o.x,this.tension),Wc.initCatmullRom(s.y,u.y,h.y,o.y,this.tension),Xc.initCatmullRom(s.z,u.z,h.z,o.z,this.tension));return r.set(jc.calc(c),Wc.calc(c),Xc.calc(c)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const r=e.points[t];this.points.push((new un).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function qc(e,t,r,n,i){const a=.5*(n-t),s=.5*(i-r),o=e*e;return(2*r-2*n+a+s)*(e*o)+(-3*r+3*n-2*a-s)*o+a*e+r}function Kc(e,t,r,n){return function(e,t){const r=1-e;return r*r*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,r)+function(e,t){return e*e*t}(e,n)}function Jc(e,t,r,n,i){return function(e,t){const r=1-e;return r*r*r*t}(e,t)+function(e,t){const r=1-e;return 3*r*r*e*t}(e,r)+function(e,t){return 3*(1-e)*e*e*t}(e,n)+function(e,t){return e*e*e*t}(e,i)}class Zc extends Gc{constructor(e=new Fr,t=new Fr,r=new Fr,n=new Fr){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=r,this.v3=n}getPoint(e,t=new Fr){const r=t,n=this.v0,i=this.v1,a=this.v2,s=this.v3;return r.set(Jc(e,n.x,i.x,a.x,s.x),Jc(e,n.y,i.y,a.y,s.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class $c extends Gc{constructor(e=new un,t=new un,r=new un,n=new un){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=r,this.v3=n}getPoint(e,t=new un){const r=t,n=this.v0,i=this.v1,a=this.v2,s=this.v3;return r.set(Jc(e,n.x,i.x,a.x,s.x),Jc(e,n.y,i.y,a.y,s.y),Jc(e,n.z,i.z,a.z,s.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class eu extends Gc{constructor(e=new Fr,t=new Fr){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Fr){const r=t;return 1===e?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Fr){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class tu extends Gc{constructor(e=new un,t=new un){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new un){const r=t;return 1===e?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new un){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class ru extends Gc{constructor(e=new Fr,t=new Fr,r=new Fr){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new Fr){const r=t,n=this.v0,i=this.v1,a=this.v2;return r.set(Kc(e,n.x,i.x,a.x),Kc(e,n.y,i.y,a.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class nu extends Gc{constructor(e=new un,t=new un,r=new un){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new un){const r=t,n=this.v0,i=this.v1,a=this.v2;return r.set(Kc(e,n.x,i.x,a.x),Kc(e,n.y,i.y,a.y),Kc(e,n.z,i.z,a.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class iu extends Gc{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Fr){const r=t,n=this.points,i=(n.length-1)*e,a=Math.floor(i),s=i-a,o=n[0===a?a:a-1],l=n[a],c=n[a>n.length-2?n.length-1:a+1],u=n[a>n.length-3?n.length-1:a+2];return r.set(qc(s,o.x,l.x,c.x,u.x),qc(s,o.y,l.y,c.y,u.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const r=e.points[t];this.points.push((new Fr).fromArray(r))}return this}}var au=Object.freeze({__proto__:null,ArcCurve:Vc,CatmullRomCurve3:Yc,CubicBezierCurve:Zc,CubicBezierCurve3:$c,EllipseCurve:zc,LineCurve:eu,LineCurve3:tu,QuadraticBezierCurve:ru,QuadraticBezierCurve3:nu,SplineCurve:iu});class su extends Gc{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new eu(t,e))}getPoint(e,t){const r=e*this.getLength(),n=this.getCurveLengths();let i=0;for(;i<n.length;){if(n[i]>=r){const e=n[i]-r,a=this.curves[i],s=a.getLength(),o=0===s?0:1-e/s;return a.getPointAt(o,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,n=this.curves.length;r<n;r++)t+=this.curves[r].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let r;for(let n=0,i=this.curves;n<i.length;n++){const a=i[n],s=a.isEllipseCurve?2*e:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?e*a.points.length:e,o=a.getPoints(s);for(let e=0;e<o.length;e++){const n=o[e];r&&r.equals(n)||(t.push(n),r=n)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,r=this.curves.length;t<r;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const r=e.curves[t];this.curves.push((new au[r.type]).fromJSON(r))}return this}}class ou extends su{constructor(e){super(),this.type="Path",this.currentPoint=new Fr,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,r=e.length;t<r;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const r=new eu(this.currentPoint.clone(),new Fr(e,t));return this.curves.push(r),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,r,n){const i=new ru(this.currentPoint.clone(),new Fr(e,t),new Fr(r,n));return this.curves.push(i),this.currentPoint.set(r,n),this}bezierCurveTo(e,t,r,n,i,a){const s=new Zc(this.currentPoint.clone(),new Fr(e,t),new Fr(r,n),new Fr(i,a));return this.curves.push(s),this.currentPoint.set(i,a),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),r=new iu(t);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,r,n,i,a){const s=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(e+s,t+o,r,n,i,a),this}absarc(e,t,r,n,i,a){return this.absellipse(e,t,r,r,n,i,a),this}ellipse(e,t,r,n,i,a,s,o){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,r,n,i,a,s,o),this}absellipse(e,t,r,n,i,a,s,o){const l=new zc(e,t,r,n,i,a,s,o);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class lu extends ia{constructor(e=[new Fr(0,-.5),new Fr(.5,0),new Fr(0,.5)],t=12,r=0,n=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:n},t=Math.floor(t),n=Sr(n,0,2*Math.PI);const i=[],a=[],s=[],o=[],l=[],c=1/t,u=new un,h=new Fr,d=new un,p=new un,f=new un;let m=0,g=0;for(let v=0;v<=e.length-1;v++)switch(v){case 0:m=e[v+1].x-e[v].x,g=e[v+1].y-e[v].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case e.length-1:o.push(f.x,f.y,f.z);break;default:m=e[v+1].x-e[v].x,g=e[v+1].y-e[v].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),o.push(d.x,d.y,d.z),f.copy(p)}for(let v=0;v<=t;v++){const i=r+v*c*n,d=Math.sin(i),p=Math.cos(i);for(let r=0;r<=e.length-1;r++){u.x=e[r].x*d,u.y=e[r].y,u.z=e[r].x*p,a.push(u.x,u.y,u.z),h.x=v/t,h.y=r/(e.length-1),s.push(h.x,h.y);const n=o[3*r+0]*d,i=o[3*r+1],c=o[3*r+0]*p;l.push(n,i,c)}}for(let v=0;v<t;v++)for(let t=0;t<e.length-1;t++){const r=t+v*e.length,n=r,a=r+e.length,s=r+e.length+1,o=r+1;i.push(n,a,o),i.push(s,o,a)}this.setIndex(i),this.setAttribute("position",new qi(a,3)),this.setAttribute("uv",new qi(s,2)),this.setAttribute("normal",new qi(l,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new lu(e.points,e.segments,e.phiStart,e.phiLength)}}class cu extends lu{constructor(e=1,t=1,r=4,n=8){const i=new ou;i.absarc(0,-t/2,e,1.5*Math.PI,0),i.absarc(0,t/2,e,0,.5*Math.PI),super(i.getPoints(r),n),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:r,radialSegments:n}}static fromJSON(e){return new cu(e.radius,e.length,e.capSegments,e.radialSegments)}}class uu extends ia{constructor(e=1,t=32,r=0,n=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:n},t=Math.max(3,t);const i=[],a=[],s=[],o=[],l=new un,c=new Fr;a.push(0,0,0),s.push(0,0,1),o.push(.5,.5);for(let u=0,h=3;u<=t;u++,h+=3){const i=r+u/t*n;l.x=e*Math.cos(i),l.y=e*Math.sin(i),a.push(l.x,l.y,l.z),s.push(0,0,1),c.x=(a[h]/e+1)/2,c.y=(a[h+1]/e+1)/2,o.push(c.x,c.y)}for(let u=1;u<=t;u++)i.push(u,u+1,0);this.setIndex(i),this.setAttribute("position",new qi(a,3)),this.setAttribute("normal",new qi(s,3)),this.setAttribute("uv",new qi(o,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new uu(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class hu extends ia{constructor(e=1,t=1,r=1,n=32,i=1,a=!1,s=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:r,radialSegments:n,heightSegments:i,openEnded:a,thetaStart:s,thetaLength:o};const l=this;n=Math.floor(n),i=Math.floor(i);const c=[],u=[],h=[],d=[];let p=0;const f=[],m=r/2;let g=0;function v(r){const i=p,a=new Fr,f=new un;let v=0;const A=!0===r?e:t,y=!0===r?1:-1;for(let e=1;e<=n;e++)u.push(0,m*y,0),h.push(0,y,0),d.push(.5,.5),p++;const x=p;for(let e=0;e<=n;e++){const t=e/n*o+s,r=Math.cos(t),i=Math.sin(t);f.x=A*i,f.y=m*y,f.z=A*r,u.push(f.x,f.y,f.z),h.push(0,y,0),a.x=.5*r+.5,a.y=.5*i*y+.5,d.push(a.x,a.y),p++}for(let e=0;e<n;e++){const t=i+e,n=x+e;!0===r?c.push(n,n+1,t):c.push(n+1,n,t),v+=3}l.addGroup(g,v,!0===r?1:2),g+=v}!function(){const a=new un,v=new un;let A=0;const y=(t-e)/r;for(let l=0;l<=i;l++){const c=[],g=l/i,A=g*(t-e)+e;for(let e=0;e<=n;e++){const t=e/n,i=t*o+s,l=Math.sin(i),f=Math.cos(i);v.x=A*l,v.y=-g*r+m,v.z=A*f,u.push(v.x,v.y,v.z),a.set(l,y,f).normalize(),h.push(a.x,a.y,a.z),d.push(t,1-g),c.push(p++)}f.push(c)}for(let e=0;e<n;e++)for(let t=0;t<i;t++){const r=f[t][e],n=f[t+1][e],i=f[t+1][e+1],a=f[t][e+1];c.push(r,n,a),c.push(n,i,a),A+=6}l.addGroup(g,A,0),g+=A}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new qi(u,3)),this.setAttribute("normal",new qi(h,3)),this.setAttribute("uv",new qi(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hu(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class du extends hu{constructor(e=1,t=1,r=32,n=1,i=!1,a=0,s=2*Math.PI){super(0,e,t,r,n,i,a,s),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:a,thetaLength:s}}static fromJSON(e){return new du(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class pu extends ia{constructor(e=[],t=[],r=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:n};const i=[],a=[];function s(e,t,r,n){const i=n+1,a=[];for(let s=0;s<=i;s++){a[s]=[];const n=e.clone().lerp(r,s/i),o=t.clone().lerp(r,s/i),l=i-s;for(let e=0;e<=l;e++)a[s][e]=0===e&&s===i?n:n.clone().lerp(o,e/l)}for(let s=0;s<i;s++)for(let e=0;e<2*(i-s)-1;e++){const t=Math.floor(e/2);e%2==0?(o(a[s][t+1]),o(a[s+1][t]),o(a[s][t])):(o(a[s][t+1]),o(a[s+1][t+1]),o(a[s+1][t]))}}function o(e){i.push(e.x,e.y,e.z)}function l(t,r){const n=3*t;r.x=e[n+0],r.y=e[n+1],r.z=e[n+2]}function c(e,t,r,n){n<0&&1===e.x&&(a[t]=e.x-1),0===r.x&&0===r.z&&(a[t]=n/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}!function(e){const r=new un,n=new un,i=new un;for(let a=0;a<t.length;a+=3)l(t[a+0],r),l(t[a+1],n),l(t[a+2],i),s(r,n,i,e)}(n),function(e){const t=new un;for(let r=0;r<i.length;r+=3)t.x=i[r+0],t.y=i[r+1],t.z=i[r+2],t.normalize().multiplyScalar(e),i[r+0]=t.x,i[r+1]=t.y,i[r+2]=t.z}(r),function(){const e=new un;for(let r=0;r<i.length;r+=3){e.x=i[r+0],e.y=i[r+1],e.z=i[r+2];const n=u(e)/2/Math.PI+.5,s=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);a.push(n,1-s)}var t;(function(){const e=new un,t=new un,r=new un,n=new un,s=new Fr,o=new Fr,l=new Fr;for(let h=0,d=0;h<i.length;h+=9,d+=6){e.set(i[h+0],i[h+1],i[h+2]),t.set(i[h+3],i[h+4],i[h+5]),r.set(i[h+6],i[h+7],i[h+8]),s.set(a[d+0],a[d+1]),o.set(a[d+2],a[d+3]),l.set(a[d+4],a[d+5]),n.copy(e).add(t).add(r).divideScalar(3);const p=u(n);c(s,d+0,e,p),c(o,d+2,t,p),c(l,d+4,r,p)}})(),function(){for(let e=0;e<a.length;e+=6){const t=a[e+0],r=a[e+2],n=a[e+4],i=Math.max(t,r,n),s=Math.min(t,r,n);i>.9&&s<.1&&(t<.2&&(a[e+0]+=1),r<.2&&(a[e+2]+=1),n<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new qi(i,3)),this.setAttribute("normal",new qi(i.slice(),3)),this.setAttribute("uv",new qi(a,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new pu(e.vertices,e.indices,e.radius,e.details)}}class fu extends pu{constructor(e=1,t=0){const r=(1+Math.sqrt(5))/2,n=1/r;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new fu(e.radius,e.detail)}}const mu=new un,gu=new un,vu=new un,Au=new Ei;class yu extends ia{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const r=4,n=Math.pow(10,r),i=Math.cos(br*t),a=e.getIndex(),s=e.getAttribute("position"),o=a?a.count:s.count,l=[0,0,0],c=["a","b","c"],u=new Array(3),h={},d=[];for(let e=0;e<o;e+=3){a?(l[0]=a.getX(e),l[1]=a.getX(e+1),l[2]=a.getX(e+2)):(l[0]=e,l[1]=e+1,l[2]=e+2);const{a:t,b:r,c:o}=Au;if(t.fromBufferAttribute(s,l[0]),r.fromBufferAttribute(s,l[1]),o.fromBufferAttribute(s,l[2]),Au.getNormal(vu),u[0]=`${Math.round(t.x*n)},${Math.round(t.y*n)},${Math.round(t.z*n)}`,u[1]=`${Math.round(r.x*n)},${Math.round(r.y*n)},${Math.round(r.z*n)}`,u[2]=`${Math.round(o.x*n)},${Math.round(o.y*n)},${Math.round(o.z*n)}`,u[0]!==u[1]&&u[1]!==u[2]&&u[2]!==u[0])for(let e=0;e<3;e++){const t=(e+1)%3,r=u[e],n=u[t],a=Au[c[e]],s=Au[c[t]],o=`${r}_${n}`,p=`${n}_${r}`;p in h&&h[p]?(vu.dot(h[p].normal)<=i&&(d.push(a.x,a.y,a.z),d.push(s.x,s.y,s.z)),h[p]=null):o in h||(h[o]={index0:l[e],index1:l[t],normal:vu.clone()})}}for(const e in h)if(h[e]){const{index0:t,index1:r}=h[e];mu.fromBufferAttribute(s,t),gu.fromBufferAttribute(s,r),d.push(mu.x,mu.y,mu.z),d.push(gu.x,gu.y,gu.z)}this.setAttribute("position",new qi(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class xu extends ou{constructor(e){super(e),this.uuid=Er(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let r=0,n=this.holes.length;r<n;r++)t[r]=this.holes[r].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,r=this.holes.length;t<r;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const r=e.holes[t];this.holes.push((new ou).fromJSON(r))}return this}}const bu=function(e,t,r=2){const n=t&&t.length,i=n?t[0]*r:e.length;let a=wu(e,0,i,r,!0);const s=[];if(!a||a.next===a.prev)return s;let o,l,c,u,h,d,p;if(n&&(a=function(e,t,r,n){const i=[];let a,s,o,l,c;for(a=0,s=t.length;a<s;a++)o=t[a]*n,l=a<s-1?t[a+1]*n:e.length,c=wu(e,o,l,n,!1),c===c.next&&(c.steiner=!0),i.push(Fu(c));for(i.sort(Iu),a=0;a<i.length;a++)r=Bu(i[a],r);return r}(e,t,a,r)),e.length>80*r){o=c=e[0],l=u=e[1];for(let t=r;t<i;t+=r)h=e[t],d=e[t+1],h<o&&(o=h),d<l&&(l=d),h>c&&(c=h),d>u&&(u=d);p=Math.max(c-o,u-l),p=0!==p?32767/p:0}return Su(a,s,r,o,l,p,0),s};function wu(e,t,r,n,i){let a,s;if(i===function(e,t,r,n){let i=0;for(let a=t,s=r-n;a<r;a+=n)i+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return i}(e,t,r,n)>0)for(a=t;a<r;a+=n)s=Hu(a,e[a],e[a+1],s);else for(a=r-n;a>=t;a-=n)s=Hu(a,e[a],e[a+1],s);return s&&Nu(s,s.next)&&(Qu(s),s=s.next),s}function Eu(e,t){if(!e)return e;t||(t=e);let r,n=e;do{if(r=!1,n.steiner||!Nu(n,n.next)&&0!==Uu(n.prev,n,n.next))n=n.next;else{if(Qu(n),n=t=n.prev,n===n.next)break;r=!0}}while(r||n!==t);return t}function Su(e,t,r,n,i,a,s){if(!e)return;!s&&a&&function(e,t,r,n){let i=e;do{0===i.z&&(i.z=Pu(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,r,n,i,a,s,o,l,c=1;do{for(r=e,e=null,a=null,s=0;r;){for(s++,n=r,o=0,t=0;t<c&&(o++,n=n.nextZ,n);t++);for(l=c;o>0||l>0&&n;)0!==o&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,o--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(s>1)}(i)}(e,n,i,a);let o,l,c=e;for(;e.prev!==e.next;)if(o=e.prev,l=e.next,a?_u(e,n,i,a):Mu(e))t.push(o.i/r|0),t.push(e.i/r|0),t.push(l.i/r|0),Qu(e),e=l.next,c=l.next;else if((e=l)===c){s?1===s?Su(e=Tu(Eu(e),t,r),t,r,n,i,a,2):2===s&&Cu(e,t,r,n,i,a):Su(Eu(e),t,r,n,i,a,1);break}}function Mu(e){const t=e.prev,r=e,n=e.next;if(Uu(t,r,n)>=0)return!1;const i=t.x,a=r.x,s=n.x,o=t.y,l=r.y,c=n.y,u=i<a?i<s?i:s:a<s?a:s,h=o<l?o<c?o:c:l<c?l:c,d=i>a?i>s?i:s:a>s?a:s,p=o>l?o>c?o:c:l>c?l:c;let f=n.next;for(;f!==t;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&Lu(i,o,a,l,s,c,f.x,f.y)&&Uu(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function _u(e,t,r,n){const i=e.prev,a=e,s=e.next;if(Uu(i,a,s)>=0)return!1;const o=i.x,l=a.x,c=s.x,u=i.y,h=a.y,d=s.y,p=o<l?o<c?o:c:l<c?l:c,f=u<h?u<d?u:d:h<d?h:d,m=o>l?o>c?o:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,v=Pu(p,f,t,r,n),A=Pu(m,g,t,r,n);let y=e.prevZ,x=e.nextZ;for(;y&&y.z>=v&&x&&x.z<=A;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==i&&y!==s&&Lu(o,u,l,h,c,d,y.x,y.y)&&Uu(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==s&&Lu(o,u,l,h,c,d,x.x,x.y)&&Uu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;y&&y.z>=v;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==i&&y!==s&&Lu(o,u,l,h,c,d,y.x,y.y)&&Uu(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=A;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==s&&Lu(o,u,l,h,c,d,x.x,x.y)&&Uu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Tu(e,t,r){let n=e;do{const i=n.prev,a=n.next.next;!Nu(i,a)&&ku(i,n,n.next,a)&&zu(i,a)&&zu(a,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(a.i/r|0),Qu(n),Qu(n.next),n=e=a),n=n.next}while(n!==e);return Eu(n)}function Cu(e,t,r,n,i,a){let s=e;do{let e=s.next.next;for(;e!==s.prev;){if(s.i!==e.i&&Du(s,e)){let o=Vu(s,e);return s=Eu(s,s.next),o=Eu(o,o.next),Su(s,t,r,n,i,a,0),void Su(o,t,r,n,i,a,0)}e=e.next}s=s.next}while(s!==e)}function Iu(e,t){return e.x-t.x}function Bu(e,t){const r=function(e,t){let r,n=t,i=-1/0;const a=e.x,s=e.y;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){const e=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=a&&e>i&&(i=e,r=n.x<n.next.x?n:n.next,e===a))return r}n=n.next}while(n!==t);if(!r)return null;const o=r,l=r.x,c=r.y;let u,h=1/0;n=r;do{a>=n.x&&n.x>=l&&a!==n.x&&Lu(s<c?a:i,s,l,c,s<c?i:a,s,n.x,n.y)&&(u=Math.abs(s-n.y)/(a-n.x),zu(n,e)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&Ru(r,n)))&&(r=n,h=u)),n=n.next}while(n!==o);return r}(e,t);if(!r)return t;const n=Vu(r,e);return Eu(n,n.next),Eu(r,r.next)}function Ru(e,t){return Uu(e.prev,e,t.prev)<0&&Uu(t.next,e,e.next)<0}function Pu(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Fu(e){let t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function Lu(e,t,r,n,i,a,s,o){return(i-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(n-o)>=(r-s)*(t-o)&&(r-s)*(a-o)>=(i-s)*(n-o)}function Du(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&ku(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(zu(e,t)&&zu(t,e)&&function(e,t){let r=e,n=!1;const i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Uu(e.prev,e,t.prev)||Uu(e,t.prev,t))||Nu(e,t)&&Uu(e.prev,e,e.next)>0&&Uu(t.prev,t,t.next)>0)}function Uu(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Nu(e,t){return e.x===t.x&&e.y===t.y}function ku(e,t,r,n){const i=Gu(Uu(e,t,r)),a=Gu(Uu(e,t,n)),s=Gu(Uu(r,n,e)),o=Gu(Uu(r,n,t));return i!==a&&s!==o||(!(0!==i||!Ou(e,r,t))||(!(0!==a||!Ou(e,n,t))||(!(0!==s||!Ou(r,e,n))||!(0!==o||!Ou(r,t,n)))))}function Ou(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Gu(e){return e>0?1:e<0?-1:0}function zu(e,t){return Uu(e.prev,e,e.next)<0?Uu(e,t,e.next)>=0&&Uu(e,e.prev,t)>=0:Uu(e,t,e.prev)<0||Uu(e,e.next,t)<0}function Vu(e,t){const r=new ju(e.i,e.x,e.y),n=new ju(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Hu(e,t,r,n){const i=new ju(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Qu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function ju(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Wu{static area(e){const t=e.length;let r=0;for(let n=t-1,i=0;i<t;n=i++)r+=e[n].x*e[i].y-e[i].x*e[n].y;return.5*r}static isClockWise(e){return Wu.area(e)<0}static triangulateShape(e,t){const r=[],n=[],i=[];Xu(e),Yu(r,e);let a=e.length;t.forEach(Xu);for(let o=0;o<t.length;o++)n.push(a),a+=t[o].length,Yu(r,t[o]);const s=bu(r,n);for(let o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}}function Xu(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Yu(e,t){for(let r=0;r<t.length;r++)e.push(t[r].x),e.push(t[r].y)}class qu extends ia{constructor(e=new xu([new Fr(.5,.5),new Fr(-.5,.5),new Fr(-.5,-.5),new Fr(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const r=this,n=[],i=[];for(let s=0,o=e.length;s<o;s++){a(e[s])}function a(e){const a=[],s=void 0!==t.curveSegments?t.curveSegments:12,o=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:1;let c=void 0===t.bevelEnabled||t.bevelEnabled,u=void 0!==t.bevelThickness?t.bevelThickness:.2,h=void 0!==t.bevelSize?t.bevelSize:u-.1,d=void 0!==t.bevelOffset?t.bevelOffset:0,p=void 0!==t.bevelSegments?t.bevelSegments:3;const f=t.extrudePath,m=void 0!==t.UVGenerator?t.UVGenerator:Ku;let g,v,A,y,x,b=!1;f&&(g=f.getSpacedPoints(o),b=!0,c=!1,v=f.computeFrenetFrames(o,!1),A=new un,y=new un,x=new un),c||(p=0,u=0,h=0,d=0);const w=e.extractPoints(s);let E=w.shape;const S=w.holes;if(!Wu.isClockWise(E)){E=E.reverse();for(let e=0,t=S.length;e<t;e++){const t=S[e];Wu.isClockWise(t)&&(S[e]=t.reverse())}}const M=Wu.triangulateShape(E,S),_=E;for(let t=0,r=S.length;t<r;t++){const e=S[t];E=E.concat(e)}function T(e,t,r){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().addScaledVector(t,r)}const C=E.length,I=M.length;function B(e,t,r){let n,i,a;const s=e.x-t.x,o=e.y-t.y,l=r.x-e.x,c=r.y-e.y,u=s*s+o*o,h=s*c-o*l;if(Math.abs(h)>Number.EPSILON){const h=Math.sqrt(u),d=Math.sqrt(l*l+c*c),p=t.x-o/h,f=t.y+s/h,m=((r.x-c/d-p)*c-(r.y+l/d-f)*l)/(s*c-o*l);n=p+s*m-e.x,i=f+o*m-e.y;const g=n*n+i*i;if(g<=2)return new Fr(n,i);a=Math.sqrt(g/2)}else{let e=!1;s>Number.EPSILON?l>Number.EPSILON&&(e=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(c)&&(e=!0),e?(n=-o,i=s,a=Math.sqrt(u)):(n=s,i=o,a=Math.sqrt(u/2))}return new Fr(n/a,i/a)}const R=[];for(let t=0,r=_.length,n=r-1,i=t+1;t<r;t++,n++,i++)n===r&&(n=0),i===r&&(i=0),R[t]=B(_[t],_[n],_[i]);const P=[];let F,L=R.concat();for(let t=0,r=S.length;t<r;t++){const e=S[t];F=[];for(let t=0,r=e.length,n=r-1,i=t+1;t<r;t++,n++,i++)n===r&&(n=0),i===r&&(i=0),F[t]=B(e[t],e[n],e[i]);P.push(F),L=L.concat(F)}for(let t=0;t<p;t++){const e=t/p,r=u*Math.cos(e*Math.PI/2),n=h*Math.sin(e*Math.PI/2)+d;for(let t=0,i=_.length;t<i;t++){const e=T(_[t],R[t],n);N(e.x,e.y,-r)}for(let t=0,i=S.length;t<i;t++){const e=S[t];F=P[t];for(let t=0,i=e.length;t<i;t++){const i=T(e[t],F[t],n);N(i.x,i.y,-r)}}}const D=h+d;for(let t=0;t<C;t++){const e=c?T(E[t],L[t],D):E[t];b?(y.copy(v.normals[0]).multiplyScalar(e.x),A.copy(v.binormals[0]).multiplyScalar(e.y),x.copy(g[0]).add(y).add(A),N(x.x,x.y,x.z)):N(e.x,e.y,0)}for(let t=1;t<=o;t++)for(let e=0;e<C;e++){const r=c?T(E[e],L[e],D):E[e];b?(y.copy(v.normals[t]).multiplyScalar(r.x),A.copy(v.binormals[t]).multiplyScalar(r.y),x.copy(g[t]).add(y).add(A),N(x.x,x.y,x.z)):N(r.x,r.y,l/o*t)}for(let t=p-1;t>=0;t--){const e=t/p,r=u*Math.cos(e*Math.PI/2),n=h*Math.sin(e*Math.PI/2)+d;for(let t=0,i=_.length;t<i;t++){const e=T(_[t],R[t],n);N(e.x,e.y,l+r)}for(let t=0,i=S.length;t<i;t++){const e=S[t];F=P[t];for(let t=0,i=e.length;t<i;t++){const i=T(e[t],F[t],n);b?N(i.x,i.y+g[o-1].y,g[o-1].x+r):N(i.x,i.y,l+r)}}}function U(e,t){let r=e.length;for(;--r>=0;){const n=r;let i=r-1;i<0&&(i=e.length-1);for(let e=0,r=o+2*p;e<r;e++){const r=C*e,a=C*(e+1);O(t+n+r,t+i+r,t+i+a,t+n+a)}}}function N(e,t,r){a.push(e),a.push(t),a.push(r)}function k(e,t,i){G(e),G(t),G(i);const a=n.length/3,s=m.generateTopUV(r,n,a-3,a-2,a-1);z(s[0]),z(s[1]),z(s[2])}function O(e,t,i,a){G(e),G(t),G(a),G(t),G(i),G(a);const s=n.length/3,o=m.generateSideWallUV(r,n,s-6,s-3,s-2,s-1);z(o[0]),z(o[1]),z(o[3]),z(o[1]),z(o[2]),z(o[3])}function G(e){n.push(a[3*e+0]),n.push(a[3*e+1]),n.push(a[3*e+2])}function z(e){i.push(e.x),i.push(e.y)}!function(){const e=n.length/3;if(c){let e=0,t=C*e;for(let r=0;r<I;r++){const e=M[r];k(e[2]+t,e[1]+t,e[0]+t)}e=o+2*p,t=C*e;for(let r=0;r<I;r++){const e=M[r];k(e[0]+t,e[1]+t,e[2]+t)}}else{for(let e=0;e<I;e++){const t=M[e];k(t[2],t[1],t[0])}for(let e=0;e<I;e++){const t=M[e];k(t[0]+C*o,t[1]+C*o,t[2]+C*o)}}r.addGroup(e,n.length/3-e,0)}(),function(){const e=n.length/3;let t=0;U(_,t),t+=_.length;for(let r=0,n=S.length;r<n;r++){const e=S[r];U(e,t),t+=e.length}r.addGroup(e,n.length/3-e,1)}()}this.setAttribute("position",new qi(n,3)),this.setAttribute("uv",new qi(i,2)),this.computeVertexNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t,r){if(r.shapes=[],Array.isArray(e))for(let n=0,i=e.length;n<i;n++){const t=e[n];r.shapes.push(t.uuid)}else r.shapes.push(e.uuid);r.options=Object.assign({},t),void 0!==t.extrudePath&&(r.options.extrudePath=t.extrudePath.toJSON());return r}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const r=[];for(let i=0,a=e.shapes.length;i<a;i++){const n=t[e.shapes[i]];r.push(n)}const n=e.options.extrudePath;return void 0!==n&&(e.options.extrudePath=(new au[n.type]).fromJSON(n)),new qu(r,e.options)}}const Ku={generateTopUV:function(e,t,r,n,i){const a=t[3*r],s=t[3*r+1],o=t[3*n],l=t[3*n+1],c=t[3*i],u=t[3*i+1];return[new Fr(a,s),new Fr(o,l),new Fr(c,u)]},generateSideWallUV:function(e,t,r,n,i,a){const s=t[3*r],o=t[3*r+1],l=t[3*r+2],c=t[3*n],u=t[3*n+1],h=t[3*n+2],d=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*a],g=t[3*a+1],v=t[3*a+2];return Math.abs(o-u)<Math.abs(s-c)?[new Fr(s,1-l),new Fr(c,1-h),new Fr(d,1-f),new Fr(m,1-v)]:[new Fr(o,1-l),new Fr(u,1-h),new Fr(p,1-f),new Fr(g,1-v)]}};class Ju extends pu{constructor(e=1,t=0){const r=(1+Math.sqrt(5))/2;super([-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Ju(e.radius,e.detail)}}class Zu extends pu{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Zu(e.radius,e.detail)}}class $u extends ia{constructor(e=.5,t=1,r=32,n=1,i=0,a=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:r,phiSegments:n,thetaStart:i,thetaLength:a},r=Math.max(3,r);const s=[],o=[],l=[],c=[];let u=e;const h=(t-e)/(n=Math.max(1,n)),d=new un,p=new Fr;for(let f=0;f<=n;f++){for(let e=0;e<=r;e++){const n=i+e/r*a;d.x=u*Math.cos(n),d.y=u*Math.sin(n),o.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(d.x/t+1)/2,p.y=(d.y/t+1)/2,c.push(p.x,p.y)}u+=h}for(let f=0;f<n;f++){const e=f*(r+1);for(let t=0;t<r;t++){const n=t+e,i=n,a=n+r+1,o=n+r+2,l=n+1;s.push(i,a,l),s.push(a,o,l)}}this.setIndex(s),this.setAttribute("position",new qi(o,3)),this.setAttribute("normal",new qi(l,3)),this.setAttribute("uv",new qi(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new $u(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class eh extends ia{constructor(e=new xu([new Fr(0,.5),new Fr(-.5,-.5),new Fr(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const r=[],n=[],i=[],a=[];let s=0,o=0;if(!1===Array.isArray(e))l(e);else for(let c=0;c<e.length;c++)l(e[c]),this.addGroup(s,o,c),s+=o,o=0;function l(e){const s=n.length/3,l=e.extractPoints(t);let c=l.shape;const u=l.holes;!1===Wu.isClockWise(c)&&(c=c.reverse());for(let t=0,r=u.length;t<r;t++){const e=u[t];!0===Wu.isClockWise(e)&&(u[t]=e.reverse())}const h=Wu.triangulateShape(c,u);for(let t=0,r=u.length;t<r;t++){const e=u[t];c=c.concat(e)}for(let t=0,r=c.length;t<r;t++){const e=c[t];n.push(e.x,e.y,0),i.push(0,0,1),a.push(e.x,e.y)}for(let t=0,n=h.length;t<n;t++){const e=h[t],n=e[0]+s,i=e[1]+s,a=e[2]+s;r.push(n,i,a),o+=3}}this.setIndex(r),this.setAttribute("position",new qi(n,3)),this.setAttribute("normal",new qi(i,3)),this.setAttribute("uv",new qi(a,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let r=0,n=e.length;r<n;r++){const n=e[r];t.shapes.push(n.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const r=[];for(let n=0,i=e.shapes.length;n<i;n++){const i=t[e.shapes[n]];r.push(i)}return new eh(r,e.curveSegments)}}class th extends ia{constructor(e=1,t=32,r=16,n=0,i=2*Math.PI,a=0,s=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:n,phiLength:i,thetaStart:a,thetaLength:s},t=Math.max(3,Math.floor(t)),r=Math.max(2,Math.floor(r));const o=Math.min(a+s,Math.PI);let l=0;const c=[],u=new un,h=new un,d=[],p=[],f=[],m=[];for(let g=0;g<=r;g++){const d=[],v=g/r;let A=0;0===g&&0===a?A=.5/t:g===r&&o===Math.PI&&(A=-.5/t);for(let r=0;r<=t;r++){const o=r/t;u.x=-e*Math.cos(n+o*i)*Math.sin(a+v*s),u.y=e*Math.cos(a+v*s),u.z=e*Math.sin(n+o*i)*Math.sin(a+v*s),p.push(u.x,u.y,u.z),h.copy(u).normalize(),f.push(h.x,h.y,h.z),m.push(o+A,1-v),d.push(l++)}c.push(d)}for(let g=0;g<r;g++)for(let e=0;e<t;e++){const t=c[g][e+1],n=c[g][e],i=c[g+1][e],s=c[g+1][e+1];(0!==g||a>0)&&d.push(t,n,s),(g!==r-1||o<Math.PI)&&d.push(n,i,s)}this.setIndex(d),this.setAttribute("position",new qi(p,3)),this.setAttribute("normal",new qi(f,3)),this.setAttribute("uv",new qi(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new th(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class rh extends pu{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new rh(e.radius,e.detail)}}class nh extends ia{constructor(e=1,t=.4,r=12,n=48,i=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:r,tubularSegments:n,arc:i},r=Math.floor(r),n=Math.floor(n);const a=[],s=[],o=[],l=[],c=new un,u=new un,h=new un;for(let d=0;d<=r;d++)for(let a=0;a<=n;a++){const p=a/n*i,f=d/r*Math.PI*2;u.x=(e+t*Math.cos(f))*Math.cos(p),u.y=(e+t*Math.cos(f))*Math.sin(p),u.z=t*Math.sin(f),s.push(u.x,u.y,u.z),c.x=e*Math.cos(p),c.y=e*Math.sin(p),h.subVectors(u,c).normalize(),o.push(h.x,h.y,h.z),l.push(a/n),l.push(d/r)}for(let d=1;d<=r;d++)for(let e=1;e<=n;e++){const t=(n+1)*d+e-1,r=(n+1)*(d-1)+e-1,i=(n+1)*(d-1)+e,s=(n+1)*d+e;a.push(t,r,s),a.push(r,i,s)}this.setIndex(a),this.setAttribute("position",new qi(s,3)),this.setAttribute("normal",new qi(o,3)),this.setAttribute("uv",new qi(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new nh(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class ih extends ia{constructor(e=1,t=.4,r=64,n=8,i=2,a=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:r,radialSegments:n,p:i,q:a},r=Math.floor(r),n=Math.floor(n);const s=[],o=[],l=[],c=[],u=new un,h=new un,d=new un,p=new un,f=new un,m=new un,g=new un;for(let A=0;A<=r;++A){const s=A/r*i*Math.PI*2;v(s,i,a,e,d),v(s+.01,i,a,e,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let e=0;e<=n;++e){const i=e/n*Math.PI*2,a=-t*Math.cos(i),s=t*Math.sin(i);u.x=d.x+(a*g.x+s*f.x),u.y=d.y+(a*g.y+s*f.y),u.z=d.z+(a*g.z+s*f.z),o.push(u.x,u.y,u.z),h.subVectors(u,d).normalize(),l.push(h.x,h.y,h.z),c.push(A/r),c.push(e/n)}}for(let A=1;A<=r;A++)for(let e=1;e<=n;e++){const t=(n+1)*(A-1)+(e-1),r=(n+1)*A+(e-1),i=(n+1)*A+e,a=(n+1)*(A-1)+e;s.push(t,r,a),s.push(r,i,a)}function v(e,t,r,n,i){const a=Math.cos(e),s=Math.sin(e),o=r/t*e,l=Math.cos(o);i.x=n*(2+l)*.5*a,i.y=n*(2+l)*s*.5,i.z=n*Math.sin(o)*.5}this.setIndex(s),this.setAttribute("position",new qi(o,3)),this.setAttribute("normal",new qi(l,3)),this.setAttribute("uv",new qi(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ih(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class ah extends ia{constructor(e=new nu(new un(-1,-1,0),new un(-1,1,0),new un(1,1,0)),t=64,r=1,n=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:n,closed:i};const a=e.computeFrenetFrames(t,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const s=new un,o=new un,l=new Fr;let c=new un;const u=[],h=[],d=[],p=[];function f(i){c=e.getPointAt(i/t,c);const l=a.normals[i],d=a.binormals[i];for(let e=0;e<=n;e++){const t=e/n*Math.PI*2,i=Math.sin(t),a=-Math.cos(t);o.x=a*l.x+i*d.x,o.y=a*l.y+i*d.y,o.z=a*l.z+i*d.z,o.normalize(),h.push(o.x,o.y,o.z),s.x=c.x+r*o.x,s.y=c.y+r*o.y,s.z=c.z+r*o.z,u.push(s.x,s.y,s.z)}}!function(){for(let e=0;e<t;e++)f(e);f(!1===i?t:0),function(){for(let e=0;e<=t;e++)for(let r=0;r<=n;r++)l.x=e/t,l.y=r/n,d.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=n;t++){const r=(n+1)*(e-1)+(t-1),i=(n+1)*e+(t-1),a=(n+1)*e+t,s=(n+1)*(e-1)+t;p.push(r,i,s),p.push(i,a,s)}}()}(),this.setIndex(p),this.setAttribute("position",new qi(u,3)),this.setAttribute("normal",new qi(h,3)),this.setAttribute("uv",new qi(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new ah((new au[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class sh extends ia{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],r=new Set,n=new un,i=new un;if(null!==e.index){const a=e.attributes.position,s=e.index;let o=e.groups;0===o.length&&(o=[{start:0,count:s.count,materialIndex:0}]);for(let e=0,l=o.length;e<l;++e){const l=o[e],c=l.start;for(let e=c,o=c+l.count;e<o;e+=3)for(let l=0;l<3;l++){const o=s.getX(e+l),c=s.getX(e+(l+1)%3);n.fromBufferAttribute(a,o),i.fromBufferAttribute(a,c),!0===oh(n,i,r)&&(t.push(n.x,n.y,n.z),t.push(i.x,i.y,i.z))}}}else{const a=e.attributes.position;for(let e=0,s=a.count/3;e<s;e++)for(let o=0;o<3;o++){const s=3*e+o,l=3*e+(o+1)%3;n.fromBufferAttribute(a,s),i.fromBufferAttribute(a,l),!0===oh(n,i,r)&&(t.push(n.x,n.y,n.z),t.push(i.x,i.y,i.z))}}this.setAttribute("position",new qi(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function oh(e,t,r){const n=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==r.has(n)&&!0!==r.has(i)&&(r.add(n),r.add(i),!0)}var lh=Object.freeze({__proto__:null,BoxGeometry:Sa,CapsuleGeometry:cu,CircleGeometry:uu,ConeGeometry:du,CylinderGeometry:hu,DodecahedronGeometry:fu,EdgesGeometry:yu,ExtrudeGeometry:qu,IcosahedronGeometry:Ju,LatheGeometry:lu,OctahedronGeometry:Zu,PlaneGeometry:ja,PolyhedronGeometry:pu,RingGeometry:$u,ShapeGeometry:eh,SphereGeometry:th,TetrahedronGeometry:rh,TorusGeometry:nh,TorusKnotGeometry:ih,TubeGeometry:ah,WireframeGeometry:sh});class ch extends Mi{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Bi(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class uh extends Ia{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class hh extends Mi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Bi(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Bi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kt,this.normalScale=new Fr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class dh extends hh{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Fr(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Sr(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Bi(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Bi(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Bi(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._iridescence=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class ph extends Mi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Bi(16777215),this.specular=new Bi(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Bi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kt,this.normalScale=new Fr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Y,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class fh extends Mi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Bi(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Bi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kt,this.normalScale=new Fr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class mh extends Mi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kt,this.normalScale=new Fr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class gh extends Mi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Bi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Bi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kt,this.normalScale=new Fr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Y,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class vh extends Mi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Bi(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kt,this.normalScale=new Fr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ah extends vc{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function yh(e,t,r){return bh(e)?new e.constructor(e.subarray(t,void 0!==r?r:e.length)):e.slice(t,r)}function xh(e,t,r){return!e||!r&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function bh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function wh(e){const t=e.length,r=new Array(t);for(let n=0;n!==t;++n)r[n]=n;return r.sort((function(t,r){return e[t]-e[r]})),r}function Eh(e,t,r){const n=e.length,i=new e.constructor(n);for(let a=0,s=0;s!==n;++a){const n=r[a]*t;for(let r=0;r!==t;++r)i[s++]=e[n+r]}return i}function Sh(e,t,r,n){let i=1,a=e[0];for(;void 0!==a&&void 0===a[n];)a=e[i++];if(void 0===a)return;let s=a[n];if(void 0!==s)if(Array.isArray(s))do{s=a[n],void 0!==s&&(t.push(a.time),r.push.apply(r,s)),a=e[i++]}while(void 0!==a);else if(void 0!==s.toArray)do{s=a[n],void 0!==s&&(t.push(a.time),s.toArray(r,r.length)),a=e[i++]}while(void 0!==a);else do{s=a[n],void 0!==s&&(t.push(a.time),r.push(s)),a=e[i++]}while(void 0!==a)}const Mh={arraySlice:yh,convertArray:xh,isTypedArray:bh,getKeyframeOrder:wh,sortedArray:Eh,flattenJSON:Sh,subclip:function(e,t,r,n,i=30){const a=e.clone();a.name=t;const s=[];for(let l=0;l<a.tracks.length;++l){const e=a.tracks[l],t=e.getValueSize(),o=[],c=[];for(let a=0;a<e.times.length;++a){const s=e.times[a]*i;if(!(s<r||s>=n)){o.push(e.times[a]);for(let r=0;r<t;++r)c.push(e.values[a*t+r])}}0!==o.length&&(e.times=xh(o,e.times.constructor),e.values=xh(c,e.values.constructor),s.push(e))}a.tracks=s;let o=1/0;for(let l=0;l<a.tracks.length;++l)o>a.tracks[l].times[0]&&(o=a.tracks[l].times[0]);for(let l=0;l<a.tracks.length;++l)a.tracks[l].shift(-1*o);return a.resetDuration(),a},makeClipAdditive:function(e,t=0,r=e,n=30){n<=0&&(n=30);const i=r.tracks.length,a=t/n;for(let s=0;s<i;++s){const t=r.tracks[s],n=t.ValueTypeName;if("bool"===n||"string"===n)continue;const i=e.tracks.find((function(e){return e.name===t.name&&e.ValueTypeName===n}));if(void 0===i)continue;let o=0;const l=t.getValueSize();t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(o=l/3);let c=0;const u=i.getValueSize();i.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=u/3);const h=t.times.length-1;let d;if(a<=t.times[0]){const e=o,r=l-o;d=yh(t.values,e,r)}else if(a>=t.times[h]){const e=h*l+o,r=e+l-o;d=yh(t.values,e,r)}else{const e=t.createInterpolant(),r=o,n=l-o;e.evaluate(a),d=yh(e.resultBuffer,r,n)}if("quaternion"===n){(new cn).fromArray(d).normalize().conjugate().toArray(d)}const p=i.times.length;for(let e=0;e<p;++e){const t=e*u+c;if("quaternion"===n)cn.multiplyQuaternionsFlat(i.values,t,d,0,i.values,t);else{const e=u-2*c;for(let r=0;r<e;++r)i.values[t+r]-=d[r]}}}return e.blendMode=Bt,e}};class _h{constructor(e,t,r,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let r=this._cachedIndex,n=t[r],i=t[r-1];e:{t:{let a;r:{n:if(!(e<n)){for(let a=r+2;;){if(void 0===n){if(e<i)break n;return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===a)break;if(i=n,n=t[++r],e<n)break t}a=t.length;break r}if(e>=i)break e;{const s=t[1];e<s&&(r=2,i=s);for(let a=r-2;;){if(void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(r===a)break;if(n=i,i=t[--r-1],e>=i)break t}a=r,r=0}}for(;r<a;){const n=r+a>>>1;e<t[n]?a=n:r=n+1}if(n=t[r],i=t[r-1],void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===n)return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,i,n)}return this.interpolate_(r,i,e,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,i=e*n;for(let a=0;a!==n;++a)t[a]=r[i+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class Th extends _h{constructor(e,t,r,n){super(e,t,r,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:_t,endingEnd:_t}}intervalChanged_(e,t,r){const n=this.parameterPositions;let i=e-2,a=e+1,s=n[i],o=n[a];if(void 0===s)switch(this.getSettings_().endingStart){case Tt:i=e,s=2*t-r;break;case Ct:i=n.length-2,s=t+n[i]-n[i+1];break;default:i=e,s=r}if(void 0===o)switch(this.getSettings_().endingEnd){case Tt:a=e,o=2*r-t;break;case Ct:a=1,o=r+n[1]-n[0];break;default:a=e-1,o=t}const l=.5*(r-t),c=this.valueSize;this._weightPrev=l/(t-s),this._weightNext=l/(o-r),this._offsetPrev=i*c,this._offsetNext=a*c}interpolate_(e,t,r,n){const i=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(r-t)/(n-t),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,A=(-1-d)*m+(1.5+d)*f+.5*p,y=d*m-d*f;for(let x=0;x!==s;++x)i[x]=g*a[c+x]+v*a[l+x]+A*a[o+x]+y*a[u+x];return i}}class Ch extends _h{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e,t,r,n){const i=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=(r-t)/(n-t),u=1-c;for(let h=0;h!==s;++h)i[h]=a[l+h]*u+a[o+h]*c;return i}}class Ih extends _h{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e){return this.copySampleValue_(e-1)}}class Bh{constructor(e,t,r,n){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=xh(t,this.TimeBufferType),this.values=xh(r,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let r;if(t.toJSON!==this.toJSON)r=t.toJSON(e);else{r={name:e.name,times:xh(e.times,Array),values:xh(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(r.interpolation=t)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new Ih(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Ch(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Th(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Et:t=this.InterpolantFactoryMethodDiscrete;break;case St:t=this.InterpolantFactoryMethodLinear;break;case Mt:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Et;case this.InterpolantFactoryMethodLinear:return St;case this.InterpolantFactoryMethodSmooth:return Mt}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let r=0,n=t.length;r!==n;++r)t[r]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let r=0,n=t.length;r!==n;++r)t[r]*=e}return this}trim(e,t){const r=this.times,n=r.length;let i=0,a=n-1;for(;i!==n&&r[i]<e;)++i;for(;-1!==a&&r[a]>t;)--a;if(++a,0!==i||a!==n){i>=a&&(a=Math.max(a,1),i=a-1);const e=this.getValueSize();this.times=yh(r,i,a),this.values=yh(this.values,i*e,a*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let s=0;s!==i;s++){const t=r[s];if("number"==typeof t&&isNaN(t)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,t),e=!1;break}if(null!==a&&a>t){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,t,a),e=!1;break}a=t}if(void 0!==n&&bh(n))for(let s=0,o=n.length;s!==o;++s){const t=n[s];if(isNaN(t)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,t),e=!1;break}}return e}optimize(){const e=yh(this.times),t=yh(this.values),r=this.getValueSize(),n=this.getInterpolation()===Mt,i=e.length-1;let a=1;for(let s=1;s<i;++s){let i=!1;const o=e[s];if(o!==e[s+1]&&(1!==s||o!==e[0]))if(n)i=!0;else{const e=s*r,n=e-r,a=e+r;for(let s=0;s!==r;++s){const r=t[e+s];if(r!==t[n+s]||r!==t[a+s]){i=!0;break}}}if(i){if(s!==a){e[a]=e[s];const n=s*r,i=a*r;for(let e=0;e!==r;++e)t[i+e]=t[n+e]}++a}}if(i>0){e[a]=e[i];for(let e=i*r,n=a*r,s=0;s!==r;++s)t[n+s]=t[e+s];++a}return a!==e.length?(this.times=yh(e,0,a),this.values=yh(t,0,a*r)):(this.times=e,this.values=t),this}clone(){const e=yh(this.times,0),t=yh(this.values,0),r=new(0,this.constructor)(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Bh.prototype.TimeBufferType=Float32Array,Bh.prototype.ValueBufferType=Float32Array,Bh.prototype.DefaultInterpolation=St;class Rh extends Bh{}Rh.prototype.ValueTypeName="bool",Rh.prototype.ValueBufferType=Array,Rh.prototype.DefaultInterpolation=Et,Rh.prototype.InterpolantFactoryMethodLinear=void 0,Rh.prototype.InterpolantFactoryMethodSmooth=void 0;class Ph extends Bh{}Ph.prototype.ValueTypeName="color";class Fh extends Bh{}Fh.prototype.ValueTypeName="number";class Lh extends _h{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e,t,r,n){const i=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=(r-t)/(n-t);let l=e*s;for(let c=l+s;l!==c;l+=4)cn.slerpFlat(i,0,a,l-s,a,l,o);return i}}class Dh extends Bh{InterpolantFactoryMethodLinear(e){return new Lh(this.times,this.values,this.getValueSize(),e)}}Dh.prototype.ValueTypeName="quaternion",Dh.prototype.DefaultInterpolation=St,Dh.prototype.InterpolantFactoryMethodSmooth=void 0;class Uh extends Bh{}Uh.prototype.ValueTypeName="string",Uh.prototype.ValueBufferType=Array,Uh.prototype.DefaultInterpolation=Et,Uh.prototype.InterpolantFactoryMethodLinear=void 0,Uh.prototype.InterpolantFactoryMethodSmooth=void 0;class Nh extends Bh{}Nh.prototype.ValueTypeName="vector";class kh{constructor(e,t=-1,r,n=It){this.name=e,this.tracks=r,this.duration=t,this.blendMode=n,this.uuid=Er(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,n=1/(e.fps||1);for(let a=0,s=r.length;a!==s;++a)t.push(Oh(r[a]).scale(n));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],r=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let i=0,a=r.length;i!==a;++i)t.push(Bh.toJSON(r[i]));return n}static CreateFromMorphTargetSequence(e,t,r,n){const i=t.length,a=[];for(let s=0;s<i;s++){let e=[],o=[];e.push((s+i-1)%i,s,(s+1)%i),o.push(0,1,0);const l=wh(e);e=Eh(e,1,l),o=Eh(o,1,l),n||0!==e[0]||(e.push(i),o.push(o[0])),a.push(new Fh(".morphTargetInfluences["+t[s].name+"]",e,o).scale(1/r))}return new this(e,-1,a)}static findByName(e,t){let r=e;if(!Array.isArray(e)){const t=e;r=t.geometry&&t.geometry.animations||t.animations}for(let n=0;n<r.length;n++)if(r[n].name===t)return r[n];return null}static CreateClipsFromMorphTargetSequences(e,t,r){const n={},i=/^([\w-]*?)([\d]+)$/;for(let s=0,o=e.length;s<o;s++){const t=e[s],r=t.name.match(i);if(r&&r.length>1){const e=r[1];let i=n[e];i||(n[e]=i=[]),i.push(t)}}const a=[];for(const s in n)a.push(this.CreateFromMorphTargetSequence(s,n[s],t,r));return a}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(e,t,r,n,i){if(0!==r.length){const a=[],s=[];Sh(r,a,s,n),0!==a.length&&i.push(new e(t,a,s))}},n=[],i=e.name||"default",a=e.fps||30,s=e.blendMode;let o=e.length||-1;const l=e.hierarchy||[];for(let c=0;c<l.length;c++){const e=l[c].keys;if(e&&0!==e.length)if(e[0].morphTargets){const t={};let r;for(r=0;r<e.length;r++)if(e[r].morphTargets)for(let n=0;n<e[r].morphTargets.length;n++)t[e[r].morphTargets[n]]=-1;for(const i in t){const t=[],a=[];for(let n=0;n!==e[r].morphTargets.length;++n){const n=e[r];t.push(n.time),a.push(n.morphTarget===i?1:0)}n.push(new Fh(".morphTargetInfluence["+i+"]",t,a))}o=t.length*a}else{const i=".bones["+t[c].name+"]";r(Nh,i+".position",e,"pos",n),r(Dh,i+".quaternion",e,"rot",n),r(Nh,i+".scale",e,"scl",n)}}if(0===n.length)return null;return new this(i,o,n,s)}resetDuration(){let e=0;for(let t=0,r=this.tracks.length;t!==r;++t){const r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function Oh(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Fh;case"vector":case"vector2":case"vector3":case"vector4":return Nh;case"color":return Ph;case"quaternion":return Dh;case"bool":case"boolean":return Rh;case"string":return Uh}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],r=[];Sh(e.keys,t,r,"value"),e.times=t,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const Gh={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class zh{constructor(e,t,r){const n=this;let i,a=!1,s=0,o=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(e){o++,!1===a&&void 0!==n.onStart&&n.onStart(e,s,o),a=!0},this.itemEnd=function(e){s++,void 0!==n.onProgress&&n.onProgress(e,s,o),s===o&&(a=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,r=l.length;t<r;t+=2){const r=l[t],n=l[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return n}return null}}}const Vh=new zh;class Hh{constructor(e){this.manager=void 0!==e?e:Vh,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const r=this;return new Promise((function(n,i){r.load(e,n,t,i)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Qh={};class jh extends Error{constructor(e,t){super(e),this.response=t}}class Wh extends Hh{constructor(e){super(e)}load(e,t,r,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=Gh.get(e);if(void 0!==i)return this.manager.itemStart(e),setTimeout((()=>{t&&t(i),this.manager.itemEnd(e)}),0),i;if(void 0!==Qh[e])return void Qh[e].push({onLoad:t,onProgress:r,onError:n});Qh[e]=[],Qh[e].push({onLoad:t,onProgress:r,onError:n});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,o=this.responseType;fetch(a).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const r=Qh[e],n=t.body.getReader(),i=t.headers.get("Content-Length")||t.headers.get("X-File-Size"),a=i?parseInt(i):0,s=0!==a;let o=0;const l=new ReadableStream({start(e){!function t(){n.read().then((({done:n,value:i})=>{if(n)e.close();else{o+=i.byteLength;const n=new ProgressEvent("progress",{lengthComputable:s,loaded:o,total:a});for(let e=0,t=r.length;e<t;e++){const t=r[e];t.onProgress&&t.onProgress(n)}e.enqueue(i),t()}}))}()}});return new Response(l)}throw new jh(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)})).then((e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,s)));case"json":return e.json();default:if(void 0===s)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(s),r=t&&t[1]?t[1].toLowerCase():void 0,n=new TextDecoder(r);return e.arrayBuffer().then((e=>n.decode(e)))}}})).then((t=>{Gh.add(e,t);const r=Qh[e];delete Qh[e];for(let e=0,n=r.length;e<n;e++){const n=r[e];n.onLoad&&n.onLoad(t)}})).catch((t=>{const r=Qh[e];if(void 0===r)throw this.manager.itemError(e),t;delete Qh[e];for(let e=0,n=r.length;e<n;e++){const n=r[e];n.onError&&n.onError(t)}this.manager.itemError(e)})).finally((()=>{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Xh extends Hh{constructor(e){super(e)}load(e,t,r,n){const i=this,a=new Wh(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(r){try{t(i.parse(JSON.parse(r)))}catch(a){n?n(a):console.error(a),i.manager.itemError(e)}}),r,n)}parse(e){const t=[];for(let r=0;r<e.length;r++){const n=kh.parse(e[r]);t.push(n)}return t}}class Yh extends Hh{constructor(e){super(e)}load(e,t,r,n){const i=this,a=[],s=new Nc,o=new Wh(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(i.withCredentials);let l=0;function c(c){o.load(e[c],(function(e){const r=i.parse(e,!0);a[c]={width:r.width,height:r.height,format:r.format,mipmaps:r.mipmaps},l+=1,6===l&&(1===r.mipmapCount&&(s.minFilter=ve),s.image=a,s.format=r.format,s.needsUpdate=!0,t&&t(s))}),r,n)}if(Array.isArray(e))for(let u=0,h=e.length;u<h;++u)c(u);else o.load(e,(function(e){const r=i.parse(e,!0);if(r.isCubemap){const e=r.mipmaps.length/r.mipmapCount;for(let t=0;t<e;t++){a[t]={mipmaps:[]};for(let e=0;e<r.mipmapCount;e++)a[t].mipmaps.push(r.mipmaps[t*r.mipmapCount+e]),a[t].format=r.format,a[t].width=r.width,a[t].height=r.height}s.image=a}else s.image.width=r.width,s.image.height=r.height,s.mipmaps=r.mipmaps;1===r.mipmapCount&&(s.minFilter=ve),s.format=r.format,s.needsUpdate=!0,t&&t(s)}),r,n);return s}}class qh extends Hh{constructor(e){super(e)}load(e,t,r,n){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,a=Gh.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;const s=Or("img");function o(){c(),Gh.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){c(),n&&n(t),i.manager.itemError(e),i.manager.itemEnd(e)}function c(){s.removeEventListener("load",o,!1),s.removeEventListener("error",l,!1)}return s.addEventListener("load",o,!1),s.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),i.manager.itemStart(e),s.src=e,s}}class Kh extends Hh{constructor(e){super(e)}load(e,t,r,n){const i=new La,a=new qh(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);let s=0;function o(r){a.load(e[r],(function(e){i.images[r]=e,s++,6===s&&(i.needsUpdate=!0,t&&t(i))}),void 0,n)}for(let l=0;l<e.length;++l)o(l);return i}}class Jh extends Hh{constructor(e){super(e)}load(e,t,r,n){const i=this,a=new ic,s=new Wh(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(i.withCredentials),s.load(e,(function(e){const r=i.parse(e);r&&(void 0!==r.image?a.image=r.image:void 0!==r.data&&(a.image.width=r.width,a.image.height=r.height,a.image.data=r.data),a.wrapS=void 0!==r.wrapS?r.wrapS:ue,a.wrapT=void 0!==r.wrapT?r.wrapT:ue,a.magFilter=void 0!==r.magFilter?r.magFilter:ve,a.minFilter=void 0!==r.minFilter?r.minFilter:ve,a.anisotropy=void 0!==r.anisotropy?r.anisotropy:1,void 0!==r.colorSpace?a.colorSpace=r.colorSpace:void 0!==r.encoding&&(a.encoding=r.encoding),void 0!==r.flipY&&(a.flipY=r.flipY),void 0!==r.format&&(a.format=r.format),void 0!==r.type&&(a.type=r.type),void 0!==r.mipmaps&&(a.mipmaps=r.mipmaps,a.minFilter=xe),1===r.mipmapCount&&(a.minFilter=ve),void 0!==r.generateMipmaps&&(a.generateMipmaps=r.generateMipmaps),a.needsUpdate=!0,t&&t(a,r))}),r,n),a}}class Zh extends Hh{constructor(e){super(e)}load(e,t,r,n){const i=new en,a=new qh(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)}),r,n),i}}class $h extends hi{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Bi(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}class ed extends $h{constructor(e,t,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(hi.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Bi(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const td=new Gn,rd=new un,nd=new un;class id{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Fr(512,512),this.map=null,this.mapPass=null,this.matrix=new Gn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Va,this._frameExtents=new Fr(1,1),this._viewportCount=1,this._viewports=[new tn(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,r=this.matrix;rd.setFromMatrixPosition(e.matrixWorld),t.position.copy(rd),nd.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(nd),t.updateMatrixWorld(),td.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(td),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(td)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class ad extends id{constructor(){super(new Ra(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,r=2*wr*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;r===t.fov&&n===t.aspect&&i===t.far||(t.fov=r,t.aspect=n,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class sd extends $h{constructor(e,t,r=0,n=Math.PI/3,i=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(hi.DEFAULT_UP),this.updateMatrix(),this.target=new hi,this.distance=r,this.angle=n,this.penumbra=i,this.decay=a,this.map=null,this.shadow=new ad}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const od=new Gn,ld=new un,cd=new un;class ud extends id{constructor(){super(new Ra(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Fr(4,2),this._viewportCount=6,this._viewports=[new tn(2,1,1,1),new tn(0,1,1,1),new tn(3,1,1,1),new tn(1,1,1,1),new tn(3,0,1,1),new tn(1,0,1,1)],this._cubeDirections=[new un(1,0,0),new un(-1,0,0),new un(0,0,1),new un(0,0,-1),new un(0,1,0),new un(0,-1,0)],this._cubeUps=[new un(0,1,0),new un(0,1,0),new un(0,1,0),new un(0,1,0),new un(0,0,1),new un(0,0,-1)]}updateMatrices(e,t=0){const r=this.camera,n=this.matrix,i=e.distance||r.far;i!==r.far&&(r.far=i,r.updateProjectionMatrix()),ld.setFromMatrixPosition(e.matrixWorld),r.position.copy(ld),cd.copy(r.position),cd.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt(cd),r.updateMatrixWorld(),n.makeTranslation(-ld.x,-ld.y,-ld.z),od.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(od)}}class hd extends $h{constructor(e,t,r=0,n=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=n,this.shadow=new ud}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class dd extends id{constructor(){super(new rs(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class pd extends $h{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(hi.DEFAULT_UP),this.updateMatrix(),this.target=new hi,this.shadow=new dd}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class fd extends $h{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class md extends $h{constructor(e,t,r=10,n=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=r,this.height=n}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class gd{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new un)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const r=e.x,n=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*n),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*r),t.addScaledVector(a[4],r*n*1.092548),t.addScaledVector(a[5],n*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],r*i*1.092548),t.addScaledVector(a[8],.546274*(r*r-n*n)),t}getIrradianceAt(e,t){const r=e.x,n=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*n),t.addScaledVector(a[2],1.023328*i),t.addScaledVector(a[3],1.023328*r),t.addScaledVector(a[4],.858086*r*n),t.addScaledVector(a[5],.858086*n*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],.858086*r*i),t.addScaledVector(a[8],.429043*(r*r-n*n)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){const r=this.coefficients;for(let n=0;n<9;n++)r[n].fromArray(e,t+3*n);return this}toArray(e=[],t=0){const r=this.coefficients;for(let n=0;n<9;n++)r[n].toArray(e,t+3*n);return e}static getBasisAt(e,t){const r=e.x,n=e.y,i=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*i,t[3]=.488603*r,t[4]=1.092548*r*n,t[5]=1.092548*n*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*r*i,t[8]=.546274*(r*r-n*n)}}class vd extends $h{constructor(e=new gd,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class Ad extends Hh{constructor(e){super(e),this.textures={}}load(e,t,r,n){const i=this,a=new Wh(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(r){try{t(i.parse(JSON.parse(r)))}catch(a){n?n(a):console.error(a),i.manager.itemError(e)}}),r,n)}parse(e){const t=this.textures;function r(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}const n=Ad.createMaterialFromType(e.type);if(void 0!==e.uuid&&(n.uuid=e.uuid),void 0!==e.name&&(n.name=e.name),void 0!==e.color&&void 0!==n.color&&n.color.setHex(e.color),void 0!==e.roughness&&(n.roughness=e.roughness),void 0!==e.metalness&&(n.metalness=e.metalness),void 0!==e.sheen&&(n.sheen=e.sheen),void 0!==e.sheenColor&&(n.sheenColor=(new Bi).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(n.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==n.emissive&&n.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==n.specular&&n.specular.setHex(e.specular),void 0!==e.specularIntensity&&(n.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==n.specularColor&&n.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(n.shininess=e.shininess),void 0!==e.clearcoat&&(n.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(n.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.iridescence&&(n.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(n.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(n.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(n.transmission=e.transmission),void 0!==e.thickness&&(n.thickness=e.thickness),void 0!==e.attenuationDistance&&(n.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==n.attenuationColor&&n.attenuationColor.setHex(e.attenuationColor),void 0!==e.fog&&(n.fog=e.fog),void 0!==e.flatShading&&(n.flatShading=e.flatShading),void 0!==e.blending&&(n.blending=e.blending),void 0!==e.combine&&(n.combine=e.combine),void 0!==e.side&&(n.side=e.side),void 0!==e.shadowSide&&(n.shadowSide=e.shadowSide),void 0!==e.opacity&&(n.opacity=e.opacity),void 0!==e.transparent&&(n.transparent=e.transparent),void 0!==e.alphaTest&&(n.alphaTest=e.alphaTest),void 0!==e.depthTest&&(n.depthTest=e.depthTest),void 0!==e.depthWrite&&(n.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(n.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(n.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(n.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(n.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(n.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(n.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(n.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(n.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(n.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(n.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(n.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(n.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(n.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(n.rotation=e.rotation),1!==e.linewidth&&(n.linewidth=e.linewidth),void 0!==e.dashSize&&(n.dashSize=e.dashSize),void 0!==e.gapSize&&(n.gapSize=e.gapSize),void 0!==e.scale&&(n.scale=e.scale),void 0!==e.polygonOffset&&(n.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(n.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(n.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(n.dithering=e.dithering),void 0!==e.alphaToCoverage&&(n.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(n.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(n.forceSinglePass=e.forceSinglePass),void 0!==e.visible&&(n.visible=e.visible),void 0!==e.toneMapped&&(n.toneMapped=e.toneMapped),void 0!==e.userData&&(n.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?n.vertexColors=e.vertexColors>0:n.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const i in e.uniforms){const t=e.uniforms[i];switch(n.uniforms[i]={},t.type){case"t":n.uniforms[i].value=r(t.value);break;case"c":n.uniforms[i].value=(new Bi).setHex(t.value);break;case"v2":n.uniforms[i].value=(new Fr).fromArray(t.value);break;case"v3":n.uniforms[i].value=(new un).fromArray(t.value);break;case"v4":n.uniforms[i].value=(new tn).fromArray(t.value);break;case"m3":n.uniforms[i].value=(new Lr).fromArray(t.value);break;case"m4":n.uniforms[i].value=(new Gn).fromArray(t.value);break;default:n.uniforms[i].value=t.value}}if(void 0!==e.defines&&(n.defines=e.defines),void 0!==e.vertexShader&&(n.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(n.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(n.glslVersion=e.glslVersion),void 0!==e.extensions)for(const i in e.extensions)n.extensions[i]=e.extensions[i];if(void 0!==e.lights&&(n.lights=e.lights),void 0!==e.clipping&&(n.clipping=e.clipping),void 0!==e.size&&(n.size=e.size),void 0!==e.sizeAttenuation&&(n.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(n.map=r(e.map)),void 0!==e.matcap&&(n.matcap=r(e.matcap)),void 0!==e.alphaMap&&(n.alphaMap=r(e.alphaMap)),void 0!==e.bumpMap&&(n.bumpMap=r(e.bumpMap)),void 0!==e.bumpScale&&(n.bumpScale=e.bumpScale),void 0!==e.normalMap&&(n.normalMap=r(e.normalMap)),void 0!==e.normalMapType&&(n.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),n.normalScale=(new Fr).fromArray(t)}return void 0!==e.displacementMap&&(n.displacementMap=r(e.displacementMap)),void 0!==e.displacementScale&&(n.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(n.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(n.roughnessMap=r(e.roughnessMap)),void 0!==e.metalnessMap&&(n.metalnessMap=r(e.metalnessMap)),void 0!==e.emissiveMap&&(n.emissiveMap=r(e.emissiveMap)),void 0!==e.emissiveIntensity&&(n.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(n.specularMap=r(e.specularMap)),void 0!==e.specularIntensityMap&&(n.specularIntensityMap=r(e.specularIntensityMap)),void 0!==e.specularColorMap&&(n.specularColorMap=r(e.specularColorMap)),void 0!==e.envMap&&(n.envMap=r(e.envMap)),void 0!==e.envMapIntensity&&(n.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(n.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(n.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(n.lightMap=r(e.lightMap)),void 0!==e.lightMapIntensity&&(n.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(n.aoMap=r(e.aoMap)),void 0!==e.aoMapIntensity&&(n.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(n.gradientMap=r(e.gradientMap)),void 0!==e.clearcoatMap&&(n.clearcoatMap=r(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(n.clearcoatNormalMap=r(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(n.clearcoatNormalScale=(new Fr).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(n.iridescenceMap=r(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(n.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(n.transmissionMap=r(e.transmissionMap)),void 0!==e.thicknessMap&&(n.thicknessMap=r(e.thicknessMap)),void 0!==e.sheenColorMap&&(n.sheenColorMap=r(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(n.sheenRoughnessMap=r(e.sheenRoughnessMap)),n}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){return new{ShadowMaterial:ch,SpriteMaterial:Rl,RawShaderMaterial:uh,ShaderMaterial:Ia,PointsMaterial:Cc,MeshPhysicalMaterial:dh,MeshStandardMaterial:hh,MeshPhongMaterial:ph,MeshToonMaterial:fh,MeshNormalMaterial:mh,MeshLambertMaterial:gh,MeshDepthMaterial:ll,MeshDistanceMaterial:cl,MeshBasicMaterial:Pi,MeshMatcapMaterial:vh,LineDashedMaterial:Ah,LineBasicMaterial:vc,Material:Mi}[e]}}class yd{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(r){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class xd extends ia{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class bd extends Hh{constructor(e){super(e)}load(e,t,r,n){const i=this,a=new Wh(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(r){try{t(i.parse(JSON.parse(r)))}catch(a){n?n(a):console.error(a),i.manager.itemError(e)}}),r,n)}parse(e){const t={},r={};function n(e,n){if(void 0!==t[n])return t[n];const i=e.interleavedBuffers[n],a=function(e,t){if(void 0!==r[t])return r[t];const n=e.arrayBuffers[t],i=new Uint32Array(n).buffer;return r[t]=i,i}(e,i.buffer),s=kr(i.type,a),o=new Cl(s,i.stride);return o.uuid=i.uuid,t[n]=o,o}const i=e.isInstancedBufferGeometry?new xd:new ia,a=e.data.index;if(void 0!==a){const e=kr(a.type,a.array);i.setIndex(new Gi(e,1))}const s=e.data.attributes;for(const u in s){const t=s[u];let r;if(t.isInterleavedBufferAttribute){const i=n(e.data,t.data);r=new Bl(i,t.itemSize,t.offset,t.normalized)}else{const e=kr(t.type,t.array);r=new(t.isInstancedBufferAttribute?lc:Gi)(e,t.itemSize,t.normalized)}void 0!==t.name&&(r.name=t.name),void 0!==t.usage&&r.setUsage(t.usage),void 0!==t.updateRange&&(r.updateRange.offset=t.updateRange.offset,r.updateRange.count=t.updateRange.count),i.setAttribute(u,r)}const o=e.data.morphAttributes;if(o)for(const u in o){const t=o[u],r=[];for(let i=0,a=t.length;i<a;i++){const a=t[i];let s;if(a.isInterleavedBufferAttribute){const t=n(e.data,a.data);s=new Bl(t,a.itemSize,a.offset,a.normalized)}else{const e=kr(a.type,a.array);s=new Gi(e,a.itemSize,a.normalized)}void 0!==a.name&&(s.name=a.name),r.push(s)}i.morphAttributes[u]=r}e.data.morphTargetsRelative&&(i.morphTargetsRelative=!0);const l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let u=0,h=l.length;u!==h;++u){const e=l[u];i.addGroup(e.start,e.count,e.materialIndex)}const c=e.data.boundingSphere;if(void 0!==c){const e=new un;void 0!==c.center&&e.fromArray(c.center),i.boundingSphere=new Rn(e,c.radius)}return e.name&&(i.name=e.name),e.userData&&(i.userData=e.userData),i}}class wd extends Hh{constructor(e){super(e)}load(e,t,r,n){const i=this,a=""===this.path?yd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;const s=new Wh(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(r){let a=null;try{a=JSON.parse(r)}catch(o){return void 0!==n&&n(o),void console.error("THREE:ObjectLoader: Can't parse "+e+".",o.message)}const s=a.metadata;if(void 0===s||void 0===s.type||"geometry"===s.type.toLowerCase())return void 0!==n&&n(new Error("THREE.ObjectLoader: Can't load "+e)),void console.error("THREE.ObjectLoader: Can't load "+e);i.parse(a,t)}),r,n)}async loadAsync(e,t){const r=""===this.path?yd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const n=new Wh(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials);const i=await n.loadAsync(e,t),a=JSON.parse(i),s=a.metadata;if(void 0===s||void 0===s.type||"geometry"===s.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(a)}parse(e,t){const r=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,n),a=this.parseImages(e.images,(function(){void 0!==t&&t(l)})),s=this.parseTextures(e.textures,a),o=this.parseMaterials(e.materials,s),l=this.parseObject(e.object,i,o,s,r),c=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,c),void 0!==t){let e=!1;for(const t in a)if(a[t].data instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){const t=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),n=this.parseGeometries(e.geometries,r),i=await this.parseImagesAsync(e.images),a=this.parseTextures(e.textures,i),s=this.parseMaterials(e.materials,a),o=this.parseObject(e.object,n,s,a,t),l=this.parseSkeletons(e.skeletons,o);return this.bindSkeletons(o,l),o}parseShapes(e){const t={};if(void 0!==e)for(let r=0,n=e.length;r<n;r++){const n=(new xu).fromJSON(e[r]);t[n.uuid]=n}return t}parseSkeletons(e,t){const r={},n={};if(t.traverse((function(e){e.isBone&&(n[e.uuid]=e)})),void 0!==e)for(let i=0,a=e.length;i<a;i++){const t=(new oc).fromJSON(e[i],n);r[t.uuid]=t}return r}parseGeometries(e,t){const r={};if(void 0!==e){const n=new bd;for(let i=0,a=e.length;i<a;i++){let a;const s=e[i];switch(s.type){case"BufferGeometry":case"InstancedBufferGeometry":a=n.parse(s);break;default:s.type in lh?a=lh[s.type].fromJSON(s,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${s.type}"`)}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),void 0!==s.userData&&(a.userData=s.userData),r[s.uuid]=a}}return r}parseMaterials(e,t){const r={},n={};if(void 0!==e){const i=new Ad;i.setTextures(t);for(let t=0,a=e.length;t<a;t++){const a=e[t];void 0===r[a.uuid]&&(r[a.uuid]=i.parse(a)),n[a.uuid]=r[a.uuid]}}return n}parseAnimations(e){const t={};if(void 0!==e)for(let r=0;r<e.length;r++){const n=e[r],i=kh.parse(n);t[i.uuid]=i}return t}parseImages(e,t){const r=this,n={};let i;function a(e){if("string"==typeof e){const t=e;return function(e){return r.manager.itemStart(e),i.load(e,(function(){r.manager.itemEnd(e)}),void 0,(function(){r.manager.itemError(e),r.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:r.resourcePath+t)}return e.data?{data:kr(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){const r=new zh(t);i=new qh(r),i.setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){const r=e[t],i=r.url;if(Array.isArray(i)){const e=[];for(let t=0,r=i.length;t<r;t++){const r=a(i[t]);null!==r&&(r instanceof HTMLImageElement?e.push(r):e.push(new ic(r.data,r.width,r.height)))}n[r.uuid]=new Jr(e)}else{const e=a(r.url);n[r.uuid]=new Jr(e)}}}return n}async parseImagesAsync(e){const t=this,r={};let n;async function i(e){if("string"==typeof e){const r=e,i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(r)?r:t.resourcePath+r;return await n.loadAsync(i)}return e.data?{data:kr(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){n=new qh(this.manager),n.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t<n;t++){const n=e[t],a=n.url;if(Array.isArray(a)){const e=[];for(let t=0,r=a.length;t<r;t++){const r=a[t],n=await i(r);null!==n&&(n instanceof HTMLImageElement?e.push(n):e.push(new ic(n.data,n.width,n.height)))}r[n.uuid]=new Jr(e)}else{const e=await i(n.url);r[n.uuid]=new Jr(e)}}}return r}parseTextures(e,t){function r(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}const n={};if(void 0!==e)for(let i=0,a=e.length;i<a;i++){const a=e[i];void 0===a.image&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),void 0===t[a.image]&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const s=t[a.image],o=s.data;let l;Array.isArray(o)?(l=new La,6===o.length&&(l.needsUpdate=!0)):(l=o&&o.data?new ic:new en,o&&(l.needsUpdate=!0)),l.source=s,l.uuid=a.uuid,void 0!==a.name&&(l.name=a.name),void 0!==a.mapping&&(l.mapping=r(a.mapping,Ed)),void 0!==a.channel&&(l.channel=a.channel),void 0!==a.offset&&l.offset.fromArray(a.offset),void 0!==a.repeat&&l.repeat.fromArray(a.repeat),void 0!==a.center&&l.center.fromArray(a.center),void 0!==a.rotation&&(l.rotation=a.rotation),void 0!==a.wrap&&(l.wrapS=r(a.wrap[0],Sd),l.wrapT=r(a.wrap[1],Sd)),void 0!==a.format&&(l.format=a.format),void 0!==a.internalFormat&&(l.internalFormat=a.internalFormat),void 0!==a.type&&(l.type=a.type),void 0!==a.colorSpace&&(l.colorSpace=a.colorSpace),void 0!==a.encoding&&(l.encoding=a.encoding),void 0!==a.minFilter&&(l.minFilter=r(a.minFilter,Md)),void 0!==a.magFilter&&(l.magFilter=r(a.magFilter,Md)),void 0!==a.anisotropy&&(l.anisotropy=a.anisotropy),void 0!==a.flipY&&(l.flipY=a.flipY),void 0!==a.generateMipmaps&&(l.generateMipmaps=a.generateMipmaps),void 0!==a.premultiplyAlpha&&(l.premultiplyAlpha=a.premultiplyAlpha),void 0!==a.unpackAlignment&&(l.unpackAlignment=a.unpackAlignment),void 0!==a.userData&&(l.userData=a.userData),n[a.uuid]=l}return n}parseObject(e,t,r,n,i){let a,s,o;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function c(e){if(void 0!==e){if(Array.isArray(e)){const t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n];void 0===r[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),t.push(r[i])}return t}return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),r[e]}}function u(e){return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),n[e]}switch(e.type){case"Scene":a=new Tl,void 0!==e.background&&(Number.isInteger(e.background)?a.background=new Bi(e.background):a.background=u(e.background)),void 0!==e.environment&&(a.environment=u(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?a.fog=new _l(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(a.fog=new Ml(e.fog.color,e.fog.density))),void 0!==e.backgroundBlurriness&&(a.backgroundBlurriness=e.backgroundBlurriness),void 0!==e.backgroundIntensity&&(a.backgroundIntensity=e.backgroundIntensity);break;case"PerspectiveCamera":a=new Ra(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(a.focus=e.focus),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.filmGauge&&(a.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(a.filmOffset=e.filmOffset),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"OrthographicCamera":a=new rs(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"AmbientLight":a=new fd(e.color,e.intensity);break;case"DirectionalLight":a=new pd(e.color,e.intensity);break;case"PointLight":a=new hd(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":a=new md(e.color,e.intensity,e.width,e.height);break;case"SpotLight":a=new sd(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":a=new ed(e.color,e.groundColor,e.intensity);break;case"LightProbe":a=(new vd).fromJSON(e);break;case"SkinnedMesh":s=l(e.geometry),o=c(e.material),a=new rc(s,o),void 0!==e.bindMode&&(a.bindMode=e.bindMode),void 0!==e.bindMatrix&&a.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(a.skeleton=e.skeleton);break;case"Mesh":s=l(e.geometry),o=c(e.material),a=new wa(s,o);break;case"InstancedMesh":s=l(e.geometry),o=c(e.material);const t=e.count,r=e.instanceMatrix,n=e.instanceColor;a=new gc(s,o,t),a.instanceMatrix=new lc(new Float32Array(r.array),16),void 0!==n&&(a.instanceColor=new lc(new Float32Array(n.array),n.itemSize));break;case"LOD":a=new ql;break;case"Line":a=new Ec(l(e.geometry),c(e.material));break;case"LineLoop":a=new Tc(l(e.geometry),c(e.material));break;case"LineSegments":a=new _c(l(e.geometry),c(e.material));break;case"PointCloud":case"Points":a=new Fc(l(e.geometry),c(e.material));break;case"Sprite":a=new jl(c(e.material));break;case"Group":a=new ml;break;case"Bone":a=new nc;break;default:a=new hi}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(a.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.quaternion&&a.quaternion.fromArray(e.quaternion),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.up&&a.up.fromArray(e.up),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(a.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(a.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(a.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&a.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(a.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.frustumCulled&&(a.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(a.renderOrder=e.renderOrder),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.layers&&(a.layers.mask=e.layers),void 0!==e.children){const s=e.children;for(let e=0;e<s.length;e++)a.add(this.parseObject(s[e],t,r,n,i))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const r=t[e];a.animations.push(i[r])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(a.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const r=t[e],n=a.getObjectByProperty("uuid",r.object);void 0!==n&&a.addLevel(n,r.distance,r.hysteresis)}}return a}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){const r=t[e.skeleton];void 0===r?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(r,e.bindMatrix)}}))}}const Ed={UVMapping:ne,CubeReflectionMapping:ie,CubeRefractionMapping:ae,EquirectangularReflectionMapping:se,EquirectangularRefractionMapping:oe,CubeUVReflectionMapping:le},Sd={RepeatWrapping:ce,ClampToEdgeWrapping:ue,MirroredRepeatWrapping:he},Md={NearestFilter:de,NearestMipmapNearestFilter:pe,NearestMipmapLinearFilter:me,LinearFilter:ve,LinearMipmapNearestFilter:Ae,LinearMipmapLinearFilter:xe};class _d extends Hh{constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,a=Gh.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;const s={};s.credentials="anonymous"===this.crossOrigin?"same-origin":"include",s.headers=this.requestHeader,fetch(e,s).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(r){Gh.add(e,r),t&&t(r),i.manager.itemEnd(e)})).catch((function(t){n&&n(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}let Td;class Cd{static getContext(){return void 0===Td&&(Td=new(window.AudioContext||window.webkitAudioContext)),Td}static setContext(e){Td=e}}class Id extends Hh{constructor(e){super(e)}load(e,t,r,n){const i=this,a=new Wh(this.manager);function s(t){n?n(t):console.error(t),i.manager.itemError(e)}a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(e){try{const r=e.slice(0);Cd.getContext().decodeAudioData(r,(function(e){t(e)}),s)}catch(r){s(r)}}),r,n)}}class Bd extends vd{constructor(e,t,r=1){super(void 0,r),this.isHemisphereLightProbe=!0;const n=(new Bi).set(e),i=(new Bi).set(t),a=new un(n.r,n.g,n.b),s=new un(i.r,i.g,i.b),o=Math.sqrt(Math.PI),l=o*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(s).multiplyScalar(o),this.sh.coefficients[1].copy(a).sub(s).multiplyScalar(l)}}class Rd extends vd{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const r=(new Bi).set(e);this.sh.coefficients[0].set(r.r,r.g,r.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const Pd=new Gn,Fd=new Gn,Ld=new Gn;class Dd{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Ra,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Ra,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Ld.copy(e.projectionMatrix);const r=t.eyeSep/2,n=r*t.near/t.focus,i=t.near*Math.tan(br*t.fov*.5)/t.zoom;let a,s;Fd.elements[12]=-r,Pd.elements[12]=r,a=-i*t.aspect+n,s=i*t.aspect+n,Ld.elements[0]=2*t.near/(s-a),Ld.elements[8]=(s+a)/(s-a),this.cameraL.projectionMatrix.copy(Ld),a=-i*t.aspect-n,s=i*t.aspect-n,Ld.elements[0]=2*t.near/(s-a),Ld.elements[8]=(s+a)/(s-a),this.cameraR.projectionMatrix.copy(Ld)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Fd),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Pd)}}class Ud{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Nd(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Nd();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Nd(){return("undefined"==typeof performance?Date:performance).now()}const kd=new un,Od=new cn,Gd=new un,zd=new un;class Vd extends hi{constructor(){super(),this.type="AudioListener",this.context=Cd.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Ud}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(kd,Od,Gd),zd.set(0,0,-1).applyQuaternion(Od),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(kd.x,e),t.positionY.linearRampToValueAtTime(kd.y,e),t.positionZ.linearRampToValueAtTime(kd.z,e),t.forwardX.linearRampToValueAtTime(zd.x,e),t.forwardY.linearRampToValueAtTime(zd.y,e),t.forwardZ.linearRampToValueAtTime(zd.z,e),t.upX.linearRampToValueAtTime(r.x,e),t.upY.linearRampToValueAtTime(r.y,e),t.upZ.linearRampToValueAtTime(r.z,e)}else t.setPosition(kd.x,kd.y,kd.z),t.setOrientation(zd.x,zd.y,zd.z,r.x,r.y,r.z)}}class Hd extends hi{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,null!==this.source&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const Qd=new un,jd=new cn,Wd=new un,Xd=new un;class Yd extends Hd{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,r){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=r,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(Qd,jd,Wd),Xd.set(0,0,1).applyQuaternion(jd);const t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Qd.x,e),t.positionY.linearRampToValueAtTime(Qd.y,e),t.positionZ.linearRampToValueAtTime(Qd.z,e),t.orientationX.linearRampToValueAtTime(Xd.x,e),t.orientationY.linearRampToValueAtTime(Xd.y,e),t.orientationZ.linearRampToValueAtTime(Xd.z,e)}else t.setPosition(Qd.x,Qd.y,Qd.z),t.setOrientation(Xd.x,Xd.y,Xd.z)}}class qd{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let r=0;r<t.length;r++)e+=t[r];return e/t.length}}class Kd{constructor(e,t,r){let n,i,a;switch(this.binding=e,this.valueSize=r,t){case"quaternion":n=this._slerp,i=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*r),this._workIndex=5;break;case"string":case"bool":n=this._select,i=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(5*r);break;default:n=this._lerp,i=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*r)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=i,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const r=this.buffer,n=this.valueSize,i=e*n+n;let a=this.cumulativeWeight;if(0===a){for(let e=0;e!==n;++e)r[i+e]=r[e];a=t}else{a+=t;const e=t/a;this._mixBufferRegion(r,i,0,e,n)}this.cumulativeWeight=a}accumulateAdditive(e){const t=this.buffer,r=this.valueSize,n=r*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,n,0,e,r),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,r=this.buffer,n=e*t+t,i=this.cumulativeWeight,a=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){const e=t*this._origIndex;this._mixBufferRegion(r,n,e,1-i,t)}a>0&&this._mixBufferRegionAdditive(r,n,this._addIndex*t,1,t);for(let o=t,l=t+t;o!==l;++o)if(r[o]!==r[o+t]){s.setValue(r,n);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,n=r*this._origIndex;e.getValue(t,n);for(let i=r,a=n;i!==a;++i)t[i]=t[n+i%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r<t;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[t+r]=this.buffer[e+r]}_select(e,t,r,n,i){if(n>=.5)for(let a=0;a!==i;++a)e[t+a]=e[r+a]}_slerp(e,t,r,n){cn.slerpFlat(e,t,e,t,e,r,n)}_slerpAdditive(e,t,r,n,i){const a=this._workIndex*i;cn.multiplyQuaternionsFlat(e,a,e,t,e,r),cn.slerpFlat(e,t,e,t,e,a,n)}_lerp(e,t,r,n,i){const a=1-n;for(let s=0;s!==i;++s){const i=t+s;e[i]=e[i]*a+e[r+s]*n}}_lerpAdditive(e,t,r,n,i){for(let a=0;a!==i;++a){const i=t+a;e[i]=e[i]+e[r+a]*n}}}const Jd="\\[\\]\\.:\\/",Zd=new RegExp("[\\[\\]\\.:\\/]","g"),$d="[^\\[\\]\\.:\\/]",ep="[^"+Jd.replace("\\.","")+"]",tp=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",$d)+/(WCOD+)?/.source.replace("WCOD",ep)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",$d)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",$d)+"$"),rp=["material","materials","bones","map"];class np{constructor(e,t,r){this.path=t,this.parsedPath=r||np.parseTrackName(t),this.node=np.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new np.Composite(e,t,r):new np(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Zd,"")}static parseTrackName(e){const t=tp.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const e=r.nodeName.substring(n+1);-1!==rp.indexOf(e)&&(r.nodeName=r.nodeName.substring(0,n),r.objectName=e)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(void 0!==r)return r}if(e.children){const r=function(e){for(let n=0;n<e.length;n++){const i=e[n];if(i.name===t||i.uuid===t)return i;const a=r(i.children);if(a)return a}return null},n=r(e.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const r=this.resolvedProperty;for(let n=0,i=r.length;n!==i;++n)e[t++]=r[n]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const r=this.resolvedProperty;for(let n=0,i=r.length;n!==i;++n)r[n]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const r=this.resolvedProperty;for(let n=0,i=r.length;n!==i;++n)r[n]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const r=this.resolvedProperty;for(let n=0,i=r.length;n!==i;++n)r[n]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,r=t.objectName,n=t.propertyName;let i=t.propertyIndex;if(e||(e=np.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(r){let n=t.objectIndex;switch(r){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===n){n=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[r])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[r]}if(void 0!==n){if(void 0===e[n])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[n]}}const a=e[n];if(void 0===a){const r=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+r+"."+n+" but it wasn't found.",e)}let s=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?s=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(s=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===n){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[i]&&(i=e.morphTargetDictionary[i])}o=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=i}else void 0!==a.fromArray&&void 0!==a.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(o=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=n;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}np.Composite=class{constructor(e,t,r){const n=r||np.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,n=this._bindings[r];void 0!==n&&n.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=r.length;n!==i;++n)r[n].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}},np.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},np.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},np.prototype.GetterByBindingType=[np.prototype._getValue_direct,np.prototype._getValue_array,np.prototype._getValue_arrayElement,np.prototype._getValue_toArray],np.prototype.SetterByBindingTypeAndVersioning=[[np.prototype._setValue_direct,np.prototype._setValue_direct_setNeedsUpdate,np.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[np.prototype._setValue_array,np.prototype._setValue_array_setNeedsUpdate,np.prototype._setValue_array_setMatrixWorldNeedsUpdate],[np.prototype._setValue_arrayElement,np.prototype._setValue_arrayElement_setNeedsUpdate,np.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[np.prototype._setValue_fromArray,np.prototype._setValue_fromArray_setNeedsUpdate,np.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class ip{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Er(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let r=0,n=arguments.length;r!==n;++r)e[arguments[r].uuid]=r;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,r=this._paths,n=this._parsedPaths,i=this._bindings,a=i.length;let s,o=e.length,l=this.nCachedObjects_;for(let c=0,u=arguments.length;c!==u;++c){const u=arguments[c],h=u.uuid;let d=t[h];if(void 0===d){d=o++,t[h]=d,e.push(u);for(let e=0,t=a;e!==t;++e)i[e].push(new np(u,r[e],n[e]))}else if(d<l){s=e[d];const o=--l,c=e[o];t[c.uuid]=d,e[d]=c,t[h]=o,e[o]=u;for(let e=0,t=a;e!==t;++e){const t=i[e],a=t[o];let s=t[d];t[d]=a,void 0===s&&(s=new np(u,r[e],n[e])),t[o]=s}}else e[d]!==s&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,n=r.length;let i=this.nCachedObjects_;for(let a=0,s=arguments.length;a!==s;++a){const s=arguments[a],o=s.uuid,l=t[o];if(void 0!==l&&l>=i){const a=i++,c=e[a];t[c.uuid]=l,e[l]=c,t[o]=a,e[a]=s;for(let e=0,t=n;e!==t;++e){const t=r[e],n=t[a],i=t[l];t[l]=n,t[a]=i}}}this.nCachedObjects_=i}uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,n=r.length;let i=this.nCachedObjects_,a=e.length;for(let s=0,o=arguments.length;s!==o;++s){const o=arguments[s].uuid,l=t[o];if(void 0!==l)if(delete t[o],l<i){const s=--i,o=e[s],c=--a,u=e[c];t[o.uuid]=l,e[l]=o,t[u.uuid]=s,e[s]=u,e.pop();for(let e=0,t=n;e!==t;++e){const t=r[e],n=t[s],i=t[c];t[l]=n,t[s]=i,t.pop()}}else{const i=--a,s=e[i];i>0&&(t[s.uuid]=l),e[l]=s,e.pop();for(let e=0,t=n;e!==t;++e){const t=r[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){const r=this._bindingsIndicesByPath;let n=r[e];const i=this._bindings;if(void 0!==n)return i[n];const a=this._paths,s=this._parsedPaths,o=this._objects,l=o.length,c=this.nCachedObjects_,u=new Array(l);n=i.length,r[e]=n,a.push(e),s.push(t),i.push(u);for(let h=c,d=o.length;h!==d;++h){const r=o[h];u[h]=new np(r,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(void 0!==r){const n=this._paths,i=this._parsedPaths,a=this._bindings,s=a.length-1,o=a[s];t[e[s]]=r,a[r]=o,a.pop(),i[r]=i[s],i.pop(),n[r]=n[s],n.pop()}}}class ap{constructor(e,t,r=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=n;const i=t.tracks,a=i.length,s=new Array(a),o={endingStart:_t,endingEnd:_t};for(let l=0;l!==a;++l){const e=i[l].createInterpolant(null);s[l]=e,e.settings=o}this._interpolantSettings=o,this._interpolants=s,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=bt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){const r=this._clip.duration,n=e._clip.duration,i=n/r,a=r/n;e.warp(1,i,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,r){const n=this._mixer,i=n.time,a=this.timeScale;let s=this._timeScaleInterpolant;null===s&&(s=n._lendControlInterpolant(),this._timeScaleInterpolant=s);const o=s.parameterPositions,l=s.sampleValues;return o[0]=i,o[1]=i+r,l[0]=e/a,l[1]=t/a,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,r,n){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const n=(e-i)*r;n<0||0===r?t=0:(this._startTime=null,t=r*n)}t*=this._updateTimeScale(e);const a=this._updateTime(t),s=this._updateWeight(e);if(s>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===Bt)for(let r=0,n=e.length;r!==n;++r)e[r].evaluate(a),t[r].accumulateAdditive(s);else for(let r=0,i=e.length;r!==i;++r)e[r].evaluate(a),t[r].accumulate(n,s)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(null!==r){const n=r.evaluate(e)[0];t*=n,e>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;if(null!==r){t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let n=this.time+e,i=this._loopCount;const a=r===wt;if(0===e)return-1===i?n:a&&1==(1&i)?t-n:n;if(r===xt){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n>=t||n<0){const r=Math.floor(n/t);n-=t*r,i+=Math.abs(r);const s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){const t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:r})}}else this.time=n;if(a&&1==(1&i))return t-n}return n}_setEndings(e,t,r){const n=this._interpolantSettings;r?(n.endingStart=Tt,n.endingEnd=Tt):(n.endingStart=e?this.zeroSlopeAtStart?Tt:_t:Ct,n.endingEnd=t?this.zeroSlopeAtEnd?Tt:_t:Ct)}_scheduleFading(e,t,r){const n=this._mixer,i=n.time;let a=this._weightInterpolant;null===a&&(a=n._lendControlInterpolant(),this._weightInterpolant=a);const s=a.parameterPositions,o=a.sampleValues;return s[0]=i,o[0]=t,s[1]=i+e,o[1]=r,this}}const sp=new Float32Array(1);class op extends Ar{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,n=e._clip.tracks,i=n.length,a=e._propertyBindings,s=e._interpolants,o=r.uuid,l=this._bindingsByRootAndName;let c=l[o];void 0===c&&(c={},l[o]=c);for(let u=0;u!==i;++u){const e=n[u],i=e.name;let l=c[i];if(void 0!==l)++l.referenceCount,a[u]=l;else{if(l=a[u],void 0!==l){null===l._cacheIndex&&(++l.referenceCount,this._addInactiveBinding(l,o,i));continue}const n=t&&t._propertyBindings[u].binding.parsedPath;l=new Kd(np.create(r,i,n),e.ValueTypeName,e.getValueSize()),++l.referenceCount,this._addInactiveBinding(l,o,i),a[u]=l}s[u].resultBuffer=l.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,r=e._clip.uuid,n=this._actionsByClip[r];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,r,t)}const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,r){const n=this._actions,i=this._actionsByClip;let a=i[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{const t=a.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=n.length,n.push(e),a.actionByRoot[r]=e}_removeInactiveAction(e){const t=this._actions,r=t[t.length-1],n=e._cacheIndex;r._cacheIndex=n,t[n]=r,t.pop(),e._cacheIndex=null;const i=e._clip.uuid,a=this._actionsByClip,s=a[i],o=s.knownActions,l=o[o.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,o[c]=l,o.pop(),e._byClipCacheIndex=null;delete s.actionByRoot[(e._localRoot||this._root).uuid],0===o.length&&delete a[i],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let r=0,n=t.length;r!==n;++r){const e=t[r];0==--e.referenceCount&&this._removeInactiveBinding(e)}}_lendAction(e){const t=this._actions,r=e._cacheIndex,n=this._nActiveActions++,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i}_takeBackAction(e){const t=this._actions,r=e._cacheIndex,n=--this._nActiveActions,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i}_addInactiveBinding(e,t,r){const n=this._bindingsByRootAndName,i=this._bindings;let a=n[t];void 0===a&&(a={},n[t]=a),a[r]=e,e._cacheIndex=i.length,i.push(e)}_removeInactiveBinding(e){const t=this._bindings,r=e.binding,n=r.rootNode.uuid,i=r.path,a=this._bindingsByRootAndName,s=a[n],o=t[t.length-1],l=e._cacheIndex;o._cacheIndex=l,t[l]=o,t.pop(),delete s[i],0===Object.keys(s).length&&delete a[n]}_lendBinding(e){const t=this._bindings,r=e._cacheIndex,n=this._nActiveBindings++,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i}_takeBackBinding(e){const t=this._bindings,r=e._cacheIndex,n=--this._nActiveBindings,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let r=e[t];return void 0===r&&(r=new Ch(new Float32Array(2),new Float32Array(2),1,sp),r.__cacheIndex=t,e[t]=r),r}_takeBackControlInterpolant(e){const t=this._controlInterpolants,r=e.__cacheIndex,n=--this._nActiveControlInterpolants,i=t[n];e.__cacheIndex=n,t[n]=e,i.__cacheIndex=r,t[r]=i}clipAction(e,t,r){const n=t||this._root,i=n.uuid;let a="string"==typeof e?kh.findByName(n,e):e;const s=null!==a?a.uuid:e,o=this._actionsByClip[s];let l=null;if(void 0===r&&(r=null!==a?a.blendMode:It),void 0!==o){const e=o.actionByRoot[i];if(void 0!==e&&e.blendMode===r)return e;l=o.knownActions[0],null===a&&(a=l._clip)}if(null===a)return null;const c=new ap(this,a,t,r);return this._bindAction(c,l),this._addInactiveAction(c,s,i),c}existingAction(e,t){const r=t||this._root,n=r.uuid,i="string"==typeof e?kh.findByName(r,e):e,a=i?i.uuid:e,s=this._actionsByClip[a];return void 0!==s&&s.actionByRoot[n]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,n=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let l=0;l!==r;++l){t[l]._update(n,e,i,a)}const s=this._bindings,o=this._nActiveBindings;for(let l=0;l!==o;++l)s[l].apply(a);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,r=e.uuid,n=this._actionsByClip,i=n[r];if(void 0!==i){const e=i.knownActions;for(let r=0,n=e.length;r!==n;++r){const n=e[r];this._deactivateAction(n);const i=n._cacheIndex,a=t[t.length-1];n._cacheIndex=null,n._byClipCacheIndex=null,a._cacheIndex=i,t[i]=a,t.pop(),this._removeInactiveBindingsForAction(n)}delete n[r]}}uncacheRoot(e){const t=e.uuid,r=this._actionsByClip;for(const i in r){const e=r[i].actionByRoot[t];void 0!==e&&(this._deactivateAction(e),this._removeInactiveAction(e))}const n=this._bindingsByRootAndName[t];if(void 0!==n)for(const i in n){const e=n[i];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(e,t){const r=this.existingAction(e,t);null!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}}class lp{constructor(e){this.value=e}clone(){return new lp(void 0===this.value.clone?this.value:this.value.clone())}}let cp=0;class up extends Ar{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:cp++}),this.name="",this.usage=sr,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let r=0,n=t.length;r<n;r++)this.uniforms.push(t[r].clone());return this}clone(){return(new this.constructor).copy(this)}}class hp extends Cl{constructor(e,t,r=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class dp{constructor(e,t,r,n,i){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=r,this.elementSize=n,this.count=i,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}class pp{constructor(e,t,r=0,n=1/0){this.ray=new On(e,t),this.near=r,this.far=n,this.camera=null,this.layers=new Jn,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,r=[]){return mp(e,this,r,t),r.sort(fp),r}intersectObjects(e,t=!0,r=[]){for(let n=0,i=e.length;n<i;n++)mp(e[n],this,r,t);return r.sort(fp),r}}function fp(e,t){return e.distance-t.distance}function mp(e,t,r,n){if(e.layers.test(t.layers)&&e.raycast(t,r),!0===n){const n=e.children;for(let e=0,i=n.length;e<i;e++)mp(n[e],t,r,!0)}}class gp{constructor(e=1,t=0,r=0){return this.radius=e,this.phi=t,this.theta=r,this}set(e,t,r){return this.radius=e,this.phi=t,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,r){return this.radius=Math.sqrt(e*e+t*t+r*r),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(Sr(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class vp{constructor(e=1,t=0,r=0){return this.radius=e,this.theta=t,this.y=r,this}set(e,t,r){return this.radius=e,this.theta=t,this.y=r,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,r){return this.radius=Math.sqrt(e*e+r*r),this.theta=Math.atan2(e,r),this.y=t,this}clone(){return(new this.constructor).copy(this)}}const Ap=new Fr;class yp{constructor(e=new Fr(1/0,1/0),t=new Fr(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=Ap.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ap).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const xp=new un,bp=new un;class wp{constructor(e=new un,t=new un){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){xp.subVectors(e,this.start),bp.subVectors(this.end,this.start);const r=bp.dot(bp);let n=bp.dot(xp)/r;return t&&(n=Sr(n,0,1)),n}closestPointToPoint(e,t,r){const n=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(n).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const Ep=new un;class Sp extends hi{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const r=new ia,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,s=1,o=32;a<o;a++,s++){const e=a/o*Math.PI*2,t=s/o*Math.PI*2;n.push(Math.cos(e),Math.sin(e),1,Math.cos(t),Math.sin(t),1)}r.setAttribute("position",new qi(n,3));const i=new vc({fog:!1,toneMapped:!1});this.cone=new _c(r,i),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Ep.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Ep),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Mp=new un,_p=new Gn,Tp=new Gn;class Cp extends _c{constructor(e){const t=Ip(e),r=new ia,n=[],i=[],a=new Bi(0,0,1),s=new Bi(0,1,0);for(let o=0;o<t.length;o++){const e=t[o];e.parent&&e.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),i.push(a.r,a.g,a.b),i.push(s.r,s.g,s.b))}r.setAttribute("position",new qi(n,3)),r.setAttribute("color",new qi(i,3));super(r,new vc({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,r=this.geometry,n=r.getAttribute("position");Tp.copy(this.root.matrixWorld).invert();for(let i=0,a=0;i<t.length;i++){const e=t[i];e.parent&&e.parent.isBone&&(_p.multiplyMatrices(Tp,e.matrixWorld),Mp.setFromMatrixPosition(_p),n.setXYZ(a,Mp.x,Mp.y,Mp.z),_p.multiplyMatrices(Tp,e.parent.matrixWorld),Mp.setFromMatrixPosition(_p),n.setXYZ(a+1,Mp.x,Mp.y,Mp.z),a+=2)}r.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function Ip(e){const t=[];!0===e.isBone&&t.push(e);for(let r=0;r<e.children.length;r++)t.push.apply(t,Ip(e.children[r]));return t}class Bp extends wa{constructor(e,t,r){super(new th(t,4,2),new Pi({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.color=r,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const Rp=new un,Pp=new Bi,Fp=new Bi;class Lp extends hi{constructor(e,t,r){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="HemisphereLightHelper";const n=new Zu(t);n.rotateY(.5*Math.PI),this.material=new Pi({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const i=n.getAttribute("position"),a=new Float32Array(3*i.count);n.setAttribute("color",new Gi(a,3)),this.add(new wa(n,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");Pp.copy(this.light.color),Fp.copy(this.light.groundColor);for(let e=0,r=t.count;e<r;e++){const n=e<r/2?Pp:Fp;t.setXYZ(e,n.r,n.g,n.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(Rp.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Dp extends _c{constructor(e=10,t=10,r=4473924,n=8947848){r=new Bi(r),n=new Bi(n);const i=t/2,a=e/t,s=e/2,o=[],l=[];for(let u=0,h=0,d=-s;u<=t;u++,d+=a){o.push(-s,0,d,s,0,d),o.push(d,0,-s,d,0,s);const e=u===i?r:n;e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3}const c=new ia;c.setAttribute("position",new qi(o,3)),c.setAttribute("color",new qi(l,3));super(c,new vc({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class Up extends _c{constructor(e=10,t=16,r=8,n=64,i=4473924,a=8947848){i=new Bi(i),a=new Bi(a);const s=[],o=[];if(t>1)for(let c=0;c<t;c++){const r=c/t*(2*Math.PI),n=Math.sin(r)*e,l=Math.cos(r)*e;s.push(0,0,0),s.push(n,0,l);const u=1&c?i:a;o.push(u.r,u.g,u.b),o.push(u.r,u.g,u.b)}for(let c=0;c<r;c++){const t=1&c?i:a,l=e-e/r*c;for(let e=0;e<n;e++){let r=e/n*(2*Math.PI),i=Math.sin(r)*l,a=Math.cos(r)*l;s.push(i,0,a),o.push(t.r,t.g,t.b),r=(e+1)/n*(2*Math.PI),i=Math.sin(r)*l,a=Math.cos(r)*l,s.push(i,0,a),o.push(t.r,t.g,t.b)}}const l=new ia;l.setAttribute("position",new qi(s,3)),l.setAttribute("color",new qi(o,3));super(l,new vc({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const Np=new un,kp=new un,Op=new un;class Gp extends hi{constructor(e,t,r){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="DirectionalLightHelper",void 0===t&&(t=1);let n=new ia;n.setAttribute("position",new qi([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const i=new vc({fog:!1,toneMapped:!1});this.lightPlane=new Ec(n,i),this.add(this.lightPlane),n=new ia,n.setAttribute("position",new qi([0,0,0,0,0,1],3)),this.targetLine=new Ec(n,i),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),Np.setFromMatrixPosition(this.light.matrixWorld),kp.setFromMatrixPosition(this.light.target.matrixWorld),Op.subVectors(kp,Np),this.lightPlane.lookAt(kp),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(kp),this.targetLine.scale.z=Op.length()}}const zp=new un,Vp=new Ba;class Hp extends _c{constructor(e){const t=new ia,r=new vc({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],i=[],a={};function s(e,t){o(e),o(t)}function o(e){n.push(0,0,0),i.push(0,0,0),void 0===a[e]&&(a[e]=[]),a[e].push(n.length/3-1)}s("n1","n2"),s("n2","n4"),s("n4","n3"),s("n3","n1"),s("f1","f2"),s("f2","f4"),s("f4","f3"),s("f3","f1"),s("n1","f1"),s("n2","f2"),s("n3","f3"),s("n4","f4"),s("p","n1"),s("p","n2"),s("p","n3"),s("p","n4"),s("u1","u2"),s("u2","u3"),s("u3","u1"),s("c","t"),s("p","c"),s("cn1","cn2"),s("cn3","cn4"),s("cf1","cf2"),s("cf3","cf4"),t.setAttribute("position",new qi(n,3)),t.setAttribute("color",new qi(i,3)),super(t,r),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update();const l=new Bi(16755200),c=new Bi(16711680),u=new Bi(43775),h=new Bi(16777215),d=new Bi(3355443);this.setColors(l,c,u,h,d)}setColors(e,t,r,n,i){const a=this.geometry.getAttribute("color");a.setXYZ(0,e.r,e.g,e.b),a.setXYZ(1,e.r,e.g,e.b),a.setXYZ(2,e.r,e.g,e.b),a.setXYZ(3,e.r,e.g,e.b),a.setXYZ(4,e.r,e.g,e.b),a.setXYZ(5,e.r,e.g,e.b),a.setXYZ(6,e.r,e.g,e.b),a.setXYZ(7,e.r,e.g,e.b),a.setXYZ(8,e.r,e.g,e.b),a.setXYZ(9,e.r,e.g,e.b),a.setXYZ(10,e.r,e.g,e.b),a.setXYZ(11,e.r,e.g,e.b),a.setXYZ(12,e.r,e.g,e.b),a.setXYZ(13,e.r,e.g,e.b),a.setXYZ(14,e.r,e.g,e.b),a.setXYZ(15,e.r,e.g,e.b),a.setXYZ(16,e.r,e.g,e.b),a.setXYZ(17,e.r,e.g,e.b),a.setXYZ(18,e.r,e.g,e.b),a.setXYZ(19,e.r,e.g,e.b),a.setXYZ(20,e.r,e.g,e.b),a.setXYZ(21,e.r,e.g,e.b),a.setXYZ(22,e.r,e.g,e.b),a.setXYZ(23,e.r,e.g,e.b),a.setXYZ(24,t.r,t.g,t.b),a.setXYZ(25,t.r,t.g,t.b),a.setXYZ(26,t.r,t.g,t.b),a.setXYZ(27,t.r,t.g,t.b),a.setXYZ(28,t.r,t.g,t.b),a.setXYZ(29,t.r,t.g,t.b),a.setXYZ(30,t.r,t.g,t.b),a.setXYZ(31,t.r,t.g,t.b),a.setXYZ(32,r.r,r.g,r.b),a.setXYZ(33,r.r,r.g,r.b),a.setXYZ(34,r.r,r.g,r.b),a.setXYZ(35,r.r,r.g,r.b),a.setXYZ(36,r.r,r.g,r.b),a.setXYZ(37,r.r,r.g,r.b),a.setXYZ(38,n.r,n.g,n.b),a.setXYZ(39,n.r,n.g,n.b),a.setXYZ(40,i.r,i.g,i.b),a.setXYZ(41,i.r,i.g,i.b),a.setXYZ(42,i.r,i.g,i.b),a.setXYZ(43,i.r,i.g,i.b),a.setXYZ(44,i.r,i.g,i.b),a.setXYZ(45,i.r,i.g,i.b),a.setXYZ(46,i.r,i.g,i.b),a.setXYZ(47,i.r,i.g,i.b),a.setXYZ(48,i.r,i.g,i.b),a.setXYZ(49,i.r,i.g,i.b),a.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap;Vp.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Qp("c",t,e,Vp,0,0,-1),Qp("t",t,e,Vp,0,0,1),Qp("n1",t,e,Vp,-1,-1,-1),Qp("n2",t,e,Vp,1,-1,-1),Qp("n3",t,e,Vp,-1,1,-1),Qp("n4",t,e,Vp,1,1,-1),Qp("f1",t,e,Vp,-1,-1,1),Qp("f2",t,e,Vp,1,-1,1),Qp("f3",t,e,Vp,-1,1,1),Qp("f4",t,e,Vp,1,1,1),Qp("u1",t,e,Vp,.7,1.1,-1),Qp("u2",t,e,Vp,-.7,1.1,-1),Qp("u3",t,e,Vp,0,2,-1),Qp("cf1",t,e,Vp,-1,0,1),Qp("cf2",t,e,Vp,1,0,1),Qp("cf3",t,e,Vp,0,-1,1),Qp("cf4",t,e,Vp,0,1,1),Qp("cn1",t,e,Vp,-1,0,-1),Qp("cn2",t,e,Vp,1,0,-1),Qp("cn3",t,e,Vp,0,-1,-1),Qp("cn4",t,e,Vp,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Qp(e,t,r,n,i,a,s){zp.set(i,a,s).unproject(n);const o=t[e];if(void 0!==o){const e=r.getAttribute("position");for(let t=0,r=o.length;t<r;t++)e.setXYZ(o[t],zp.x,zp.y,zp.z)}}const jp=new pn;class Wp extends _c{constructor(e,t=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),i=new ia;i.setIndex(new Gi(r,1)),i.setAttribute("position",new Gi(n,3)),super(i,new vc({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&jp.setFromObject(this.object),jp.isEmpty())return;const t=jp.min,r=jp.max,n=this.geometry.attributes.position,i=n.array;i[0]=r.x,i[1]=r.y,i[2]=r.z,i[3]=t.x,i[4]=r.y,i[5]=r.z,i[6]=t.x,i[7]=t.y,i[8]=r.z,i[9]=r.x,i[10]=t.y,i[11]=r.z,i[12]=r.x,i[13]=r.y,i[14]=t.z,i[15]=t.x,i[16]=r.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=r.x,i[22]=t.y,i[23]=t.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Xp extends _c{constructor(e,t=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new ia;n.setIndex(new Gi(r,1)),n.setAttribute("position",new qi([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(n,new vc({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class Yp extends Ec{constructor(e,t=1,r=16776960){const n=r,i=new ia;i.setAttribute("position",new qi([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),i.computeBoundingSphere(),super(i,new vc({color:n,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const a=new ia;a.setAttribute("position",new qi([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),a.computeBoundingSphere(),this.add(new wa(a,new Pi({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const qp=new un;let Kp,Jp;class Zp extends hi{constructor(e=new un(0,0,1),t=new un(0,0,0),r=1,n=16776960,i=.2*r,a=.2*i){super(),this.type="ArrowHelper",void 0===Kp&&(Kp=new ia,Kp.setAttribute("position",new qi([0,0,0,0,1,0],3)),Jp=new hu(0,.5,1,5,1),Jp.translate(0,-.5,0)),this.position.copy(t),this.line=new Ec(Kp,new vc({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new wa(Jp,new Pi({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(r,i,a)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{qp.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(qp,t)}}setLength(e,t=.2*e,r=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class $p extends _c{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=new ia;r.setAttribute("position",new qi(t,3)),r.setAttribute("color",new qi([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(r,new vc({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,r){const n=new Bi,i=this.geometry.attributes.color.array;return n.set(e),n.toArray(i,0),n.toArray(i,3),n.set(t),n.toArray(i,6),n.toArray(i,9),n.set(r),n.toArray(i,12),n.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class ef{constructor(){this.type="ShapePath",this.color=new Bi,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new ou,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,n){return this.currentPath.quadraticCurveTo(e,t,r,n),this}bezierCurveTo(e,t,r,n,i,a){return this.currentPath.bezierCurveTo(e,t,r,n,i,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e,t){const r=t.length;let n=!1;for(let i=r-1,a=0;a<r;i=a++){let r=t[i],s=t[a],o=s.x-r.x,l=s.y-r.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(r=t[a],o=-o,s=t[i],l=-l),e.y<r.y||e.y>s.y)continue;if(e.y===r.y){if(e.x===r.x)return!0}else{const t=l*(e.x-r.x)-o*(e.y-r.y);if(0===t)return!0;if(t<0)continue;n=!n}}else{if(e.y!==r.y)continue;if(s.x<=e.x&&e.x<=r.x||r.x<=e.x&&e.x<=s.x)return!0}}return n}const r=Wu.isClockWise,n=this.subPaths;if(0===n.length)return[];let i,a,s;const o=[];if(1===n.length)return a=n[0],s=new xu,s.curves=a.curves,o.push(s),o;let l=!r(n[0].getPoints());l=e?!l:l;const c=[],u=[];let h,d,p=[],f=0;u[f]=void 0,p[f]=[];for(let m=0,g=n.length;m<g;m++)a=n[m],h=a.getPoints(),i=r(h),i=e?!i:i,i?(!l&&u[f]&&f++,u[f]={s:new xu,p:h},u[f].s.curves=a.curves,l&&f++,p[f]=[]):p[f].push({h:a,p:h[0]});if(!u[0])return function(e){const t=[];for(let r=0,n=e.length;r<n;r++){const n=e[r],i=new xu;i.curves=n.curves,t.push(i)}return t}(n);if(u.length>1){let e=!1,r=0;for(let t=0,n=u.length;t<n;t++)c[t]=[];for(let n=0,i=u.length;n<i;n++){const i=p[n];for(let a=0;a<i.length;a++){const s=i[a];let o=!0;for(let i=0;i<u.length;i++)t(s.p,u[i].p)&&(n!==i&&r++,o?(o=!1,c[i].push(s)):e=!0);o&&c[n].push(s)}}r>0&&!1===e&&(p=c)}for(let m=0,g=u.length;m<g;m++){s=u[m].s,o.push(s),d=p[m];for(let e=0,t=d.length;e<t;e++)s.holes.push(d[e].h)}return o}}class tf extends Sa{constructor(e,t,r,n,i,a){console.warn("THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry."),super(e,t,r,n,i,a)}}class rf extends cu{constructor(e,t,r,n){console.warn("THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry."),super(e,t,r,n)}}class nf extends uu{constructor(e,t,r,n){console.warn("THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry."),super(e,t,r,n)}}class af extends du{constructor(e,t,r,n,i,a,s){console.warn("THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry."),super(e,t,r,n,i,a,s)}}class sf extends hu{constructor(e,t,r,n,i,a,s,o){console.warn("THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry."),super(e,t,r,n,i,a,s,o)}}class of extends fu{constructor(e,t){console.warn("THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry."),super(e,t)}}class lf extends qu{constructor(e,t){console.warn("THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry."),super(e,t)}}class cf extends Ju{constructor(e,t){console.warn("THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry."),super(e,t)}}class uf extends lu{constructor(e,t,r,n){console.warn("THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry."),super(e,t,r,n)}}class hf extends Zu{constructor(e,t){console.warn("THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry."),super(e,t)}}class df extends ja{constructor(e,t,r,n){console.warn("THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry."),super(e,t,r,n)}}class pf extends pu{constructor(e,t,r,n){console.warn("THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry."),super(e,t,r,n)}}class ff extends $u{constructor(e,t,r,n,i,a){console.warn("THREE.RingBufferGeometry has been renamed to THREE.RingGeometry."),super(e,t,r,n,i,a)}}class mf extends eh{constructor(e,t){console.warn("THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry."),super(e,t)}}class gf extends th{constructor(e,t,r,n,i,a,s){console.warn("THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry."),super(e,t,r,n,i,a,s)}}class vf extends rh{constructor(e,t){console.warn("THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry."),super(e,t)}}class Af extends nh{constructor(e,t,r,n,i){console.warn("THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry."),super(e,t,r,n,i)}}class yf extends ih{constructor(e,t,r,n,i,a){console.warn("THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry."),super(e,t,r,n,i,a)}}class xf extends ah{constructor(e,t,r,n,i){console.warn("THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry."),super(e,t,r,n,i)}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:n}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=n)}}]);