1!function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){return i(t[a][1][e]||e)}),u,u.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";t.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},{}],2:[function(e,t,n){"use strict";t.exports=function(e){if(Array.isArray(e))return e}},{}],3:[function(e,t,n){"use strict";t.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},{}],4:[function(e,t,n){"use strict";function r(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}t.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,l,"next",e)}function l(e){r(a,i,o,s,l,"throw",e)}s(void 0)}))}}},{}],5:[function(e,t,n){"use strict";t.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},{}],6:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}t.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},{}],7:[function(e,t,n){"use strict";t.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{}],8:[function(e,t,n){"use strict";var r=e("./superPropBase");function i(e,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(e,t,n){var i=r(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}},i(e,n,o||e)}t.exports=i},{"./superPropBase":18}],9:[function(e,t,n){"use strict";function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}t.exports=r},{}],10:[function(e,t,n){"use strict";var r=e("./setPrototypeOf");t.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},{"./setPrototypeOf":16}],11:[function(e,t,n){"use strict";t.exports=function(e){return e&&e.__esModule?e:{default:e}}},{}],12:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/typeof");function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}t.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}},{"@babel/runtime/helpers/typeof":19}],13:[function(e,t,n){"use strict";t.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}},{}],14:[function(e,t,n){"use strict";t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},{}],15:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/typeof"),i=e("./assertThisInitialized");t.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}},{"./assertThisInitialized":3,"@babel/runtime/helpers/typeof":19}],16:[function(e,t,n){"use strict";function r(e,n){return t.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,n)}t.exports=r},{}],17:[function(e,t,n){"use strict";var r=e("./arrayWithHoles"),i=e("./iterableToArrayLimit"),o=e("./unsupportedIterableToArray"),a=e("./nonIterableRest");t.exports=function(e,t){return r(e)||i(e,t)||o(e,t)||a()}},{"./arrayWithHoles":2,"./iterableToArrayLimit":13,"./nonIterableRest":14,"./unsupportedIterableToArray":20}],18:[function(e,t,n){"use strict";var r=e("./getPrototypeOf");t.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}},{"./getPrototypeOf":9}],19:[function(e,t,n){"use strict";function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(e){return typeof e}:t.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}t.exports=r},{}],20:[function(e,t,n){"use strict";var r=e("./arrayLikeToArray");t.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},{"./arrayLikeToArray":1}],21:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof")),i=function(e){var t,n=Object.prototype,i=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";
vendor: 4,157 bytes, line 1
1function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),a=new R(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===m){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var l=h(e,t,n);if("normal"===l.type){if(r=n.done?m:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=m,n.method="throw",n.arg=l.arg)}}}(e,n,a),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d="suspendedStart",p="suspendedYield",f="executing",m="completed",v={};function g(){}function y(){}function x(){}var b={};b[a]=function(){return this};var _=Object.getPrototypeOf,w=_&&_(_(A([])));w&&w!==n&&i.call(w,a)&&(b=w);var S=x.prototype=g.prototype=Object.create(b);function M(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function n(o,a,s,l){var c=h(e[o],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"===(0,r.default)(d)&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,l)}))}l(c.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}}function E(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=h(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function A(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function n(){for(;++r<e.length;)if(i.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:P}}function P(){return{value:t,done:!0}}return y.prototype=S.constructor=x,x.constructor=y,y.displayName=c(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,c(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},e.awrap=function(e){return{__await:e}},M(T.prototype),T.prototype[s]=function(){return this},e.AsyncIterator=T,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new T(u(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},M(S),c(S,l,"Generator"),S[a]=function(){return this},S.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=A,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEac
1h(L),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;L(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}("object"===(void 0===t?"undefined":(0,r.default)(t))?t.exports:{});try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},{"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":19}],22:[function(e,t,n){"use strict";t.exports=e("regenerator-runtime")},{"regenerator-runtime":21}],23:[function(e,t,n){"use strict";var r,i=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof"));r=function(e){var t={},n=/[^\s\u00a0]/,r=e.Pos;function i(e){var t=e.search(n);return-1==t?0:t}function o(e,t){var n=e.getMode();return!1!==n.useInnerComments&&n.innerMode?e.getModeAt(t):n}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=t);for(var n=this,i=1/0,o=this.listSelections(),a=null,s=o.length-1;s>=0;s--){var l=o[s].from(),c=o[s].to();l.line>=i||(c.line>=i&&(c=r(i,0)),i=l.line,null==a?n.uncomment(l,c,e)?a="un":(n.lineComment(l,c,e),a="line"):"un"==a?n.uncomment(l,c,e):n.lineComment(l,c,e))}})),e.defineExtension("lineComment",(function(e,a,s){s||(s=t);var l=this,c=o(l,e),u=l.getLine(e.line);if(null!=u&&(h=e,d=u,!/\bstring\b/.test(l.getTokenTypeAt(r(h.line,0)))||/^[\'\"\`]/.test(d))){var h,d,p=s.lineComment||c.lineComment;if(p){var f=Math.min(0!=a.ch||a.line==e.line?a.line+1:a.line,l.lastLine()+1),m=null==s.padding?" ":s.padding,v=s.commentBlankLines||e.line==a.line;l.operation((function(){if(s.indent){for(var t=null,o=e.line;o<f;++o){var a=(c=l.getLine(o)).slice(0,i(c));(null==t||t.length>a.length)&&(t=a)}for(o=e.line;o<f;++o){var c=l.getLine(o),u=t.length;(v||n.test(c))&&(c.slice(0,u)!=t&&(u=i(c)),l.replaceRange(t+p+m,r(o,0),r(o,u)))}}else for(o=e.line;o<f;++o)(v||n.test(l.getLine(o)))&&l.replaceRange(p+m,r(o,0))}))}else(s.blockCommentStart||c.blockCommentStart)&&(s.fullLines=!0,l.blockComment(e,a,s))}})),e.defineExtension("blockComment",(function(e,i,a){a||(a=t);var s=this,l=o(s,e),c=a.blockCommentStart||l.blockCommentStart,u=a.blockCommentEnd||l.blockCommentEnd;if(c&&u){if(!/\bcomment\b/.test(s.getTokenTypeAt(r(e.line,0)))){var h=Math.min(i.line,s.lastLine());h!=e.line&&0==i.ch&&n.test(s.getLine(h))&&--h;var d=null==a.padding?" ":a.padding;e.line>h||s.operation((function(){if(0!=a.fullLines){var t=n.test(s.getLine(h));s.replaceRange(d+u,r(h)),s.replaceRange(c+d,r(e.line,0));var o=a.blockCommentLead||l.blockCommentLead;if(null!=o)for(var p=e.line+1;p<=h;++p)(p!=h||t)&&s.replaceRange(o+d,r(p,0))}else s.replaceRange(u,i),s.replaceRange(c,e)}))}}else(a.lineComment||l.lineComment)&&0!=a.fullLines&&s.lineComment(e,i,a)})),e.defineExtension("uncomment",(function(e,i,a){a||(a=t);var s,l=this,c=o(l,e),u=Math.min(0!=i.ch||i.line==e.line?i.line:i.line-1,l.lastLine()
vendor: 6,624 bytes, line 1
1),h=Math.min(e.line,u),d=a.lineComment||c.lineComment,p=[],f=null==a.padding?" ":a.padding;e:if(d){for(var m=h;m<=u;++m){var v=l.getLine(m),g=v.indexOf(d);if(g>-1&&!/comment/.test(l.getTokenTypeAt(r(m,g+1)))&&(g=-1),-1==g&&n.test(v))break e;if(g>-1&&n.test(v.slice(0,g)))break e;p.push(v)}if(l.operation((function(){for(var e=h;e<=u;++e){var t=p[e-h],n=t.indexOf(d),i=n+d.length;n<0||(t.slice(i,i+f.length)==f&&(i+=f.length),s=!0,l.replaceRange("",r(e,n),r(e,i)))}})),s)return!0}var y=a.blockCommentStart||c.blockCommentStart,x=a.blockCommentEnd||c.blockCommentEnd;if(!y||!x)return!1;var b=a.blockCommentLead||c.blockCommentLead,_=l.getLine(h),w=_.indexOf(y);if(-1==w)return!1;var S=u==h?_:l.getLine(u),M=S.indexOf(x,u==h?w+y.length:0),T=r(h,w+1),E=r(u,M+1);if(-1==M||!/comment/.test(l.getTokenTypeAt(T))||!/comment/.test(l.getTokenTypeAt(E))||l.getRange(T,E,"\n").indexOf(x)>-1)return!1;var C=_.lastIndexOf(y,e.ch),L=-1==C?-1:_.slice(0,e.ch).indexOf(x,C+y.length);if(-1!=C&&-1!=L&&L+x.length!=e.ch)return!1;L=S.indexOf(x,i.ch);var R=S.slice(i.ch).lastIndexOf(y,L-i.ch);return C=-1==L||-1==R?-1:i.ch+R,(-1==L||-1==C||C==i.ch)&&(l.operation((function(){l.replaceRange("",r(u,M-(f&&S.slice(M-f.length,M)==f?f.length:0)),r(u,M+x.length));var e=w+y.length;if(f&&_.slice(e,e+f.length)==f&&(e+=f.length),l.replaceRange("",r(h,w),r(h,e)),b)for(var t=h+1;t<=u;++t){var i=l.getLine(t),o=i.indexOf(b);if(-1!=o&&!n.test(i.slice(0,o))){var a=o+b.length;f&&i.slice(a,a+f.length)==f&&(a+=f.length),l.replaceRange("",r(t,o),r(t,a))}}})),!0)}))},"object"==(void 0===n?"undefined":(0,i.default)(n))&&"object"==(void 0===t?"undefined":(0,i.default)(t))?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":27,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":19}],24:[function(e,t,n){"use strict";var r,i=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof"));r=function(e){function t(t,n,r){var i,o=t.getWrapperElement();return(i=o.appendChild(document.createElement("div"))).className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),e.addClass(o,"dialog-opened"),i}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",(function(r,i,o){o||(o={}),n(this,null);var a=t(this,r,o.bottom),s=!1,l=this;function c(t){if("string"==typeof t)h.value=t;else{if(s)return;s=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),l.focus(),o.onClose&&o.onClose(a)}}var u,h=a.getElementsByTagName("input")[0];return h?(h.focus(),o.value&&(h.value=o.value,!1!==o.selectValueOnOpen&&h.select()),o.onInput&&e.on(h,"input",(function(e){o.onInput(e,h.value,c)})),o.onKeyUp&&e.on(h,"keyup",(function(e){o.onKeyUp(e,h.value,c)})),e.on(h,"keydown",(function(t){o&&o.onKeyDown&&o.onKeyDown(t,h.value,c)||((27==t.keyCode||!1!==o.closeOnEnter&&13==t.keyCode)&&(h.blur(),e.e_stop(t),c()),13==t.keyCode&&i(h.value,t))})),!1!==o.closeOnBlur&&e.on(h,"blur",c)):(u=a.getElementsByTagName("button")[0])&&(e.on(u,"click",(function(){c(),l.focus()})),!1!==o.closeOnBlur&&e.on(u,"blur",c),u.focus()),c})),e.defineExtension("openConfirm",(function(r,i,o){n(this,null);var a=t(this,r,o&&o.bottom),s=a.getElementsByTagName("button"),l=!1,c=this,u=1;function h(){l||(l=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),c.focus())}s[0].focus();for(var d=0;d<s.length;++d){var p=s[d];!function(t){e.on(p,"click",(function(n){e.e_preventDefault(n),h(),t&&t(c)}))}(i[d]),e.on(p,"blur",(function(){--u,setTimeout((function(){u<=0&&h()}),200)})),e.on(p,"focus",(function(){++u}))}})),e.defineExtension("openNotification",(function(r,i){n(this,c);var o,a=t(this,r,i&&i.bottom),s=!1,l=i&&void 0!==i.duration?i.duration:5e3;function c(){s||(s=!0,clearTimeout(o),e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a))}return e.on(a,"click",(function(t){e.e_preventDefault(t),c()})),l&&(o=setTimeout(c,l)),c}))},"object"==(void 0===n?"undefined":(0,i.default)(n))&&"object"==(void 0===t?"undefined":(0,i.default)(t))?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":27,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":19}],25:[function(e,t,n){"use strict";var r,i=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof"));r=function(e){function t(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function n(e){return e.state.search||(e.state.search=new t)}function r(e){return"string"==typeof e&&e==e.toLowerCase()}function i(e,t,n){return e.getSearchCursor(t,n,{caseFold:r(t),multiline:!0})}function o(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function a(e){return e.replace(/\\([nrt\\])/g,(function(e,t){return"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"==t?"\\":e}))}function s(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(e){}else e=a(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function l(e,t,n){t.queryText=n,t.query=s(n),e.removeOverlay(t.overlay,r(t.query)),t.overlay=function(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);if(n&&n.index==t.pos)return t.pos+=n[0].length||1,"searching";n?t.pos=n.index:t.skipToEnd()}}}(t.query,r(t.query)),e.addOverlay(t.overlay),e.showMatchesOnScrollbar&&(t.annotate&&(t.annotate.clear(),t.annotate=null),t.annotate=e.showMatchesOnScrollbar(t.query,r(t.query)))}function c(t,r,i,a){var s=n(t);if(s.query)return u(t,r);var c=t.getSelection()||s.lastQuery;if(c instanceof RegExp&&"x^"==c.source&&(c=null),i&&t.openDialog){var p=null,f=function(n,r){e.e_stop(r),n&&(n!=s.queryText&&(l(t,s,n),s.posFrom=s.posTo=t.getCursor()),p&&(p.style.opacity=1),u(t,r.shiftKey,(function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((p=r).style.opacity=.4)})))};!function(e,t,n,r,i){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){h(e)},onKeyDown:i})}(t,d(t),c,f,(function(r,i){var o=e.keyName(r),a=t.getOption("extraKeys"),s=a&&a[o]||e.keyM
1ap[t.getOption("keyMap")][o];"findNext"==s||"findPrev"==s||"findPersistentNext"==s||"findPersistentPrev"==s?(e.e_stop(r),l(t,n(t),i),t.execCommand(s)):"find"!=s&&"findPersistent"!=s||(e.e_stop(r),f(i,r))})),a&&c&&(l(t,s,c),u(t,r))}else o(t,d(t),"Search for:",c,(function(e){e&&!s.query&&t.operation((function(){l(t,s,e),s.posFrom=s.posTo=t.getCursor(),u(t,r)}))}))}function u(t,r,o){t.operation((function(){var a=n(t),s=i(t,a.query,r?a.posFrom:a.posTo);(s.find(r)||(s=i(t,a.query,r?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0))).find(r))&&(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),o&&o(s.from(),s.to()))}))}function h(e){e.operation((function(){var t=n(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))}))}function d(e){return'<span class="CodeMirror-search-label">'+e.phrase("Search:")+'</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use /re/ syntax for regexp search)")+"</span>"}function p(e,t,n){e.operation((function(){for(var r=i(e,t);r.findNext();)if("string"!=typeof t){var o=e.getRange(r.from(),r.to()).match(t);r.replace(n.replace(/\$(\d)/g,(function(e,t){return o[t]})))}else r.replace(n)}))}function f(e,t){if(!e.getOption("readOnly")){var r=e.getSelection()||n(e).lastQuery,l='<span class="CodeMirror-search-label">'+(t?e.phrase("Replace all:"):e.phrase("Replace:"))+"</span>";o(e,l+function(e){return' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use /re/ syntax for regexp search)")+"</span>"}(e),l,r,(function(n){n&&(n=s(n),o(e,function(e){return'<span class="CodeMirror-search-label">'+e.phrase("With:")+'</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>'}(e),e.phrase("Replace with:"),"",(function(r){if(r=a(r),t)p(e,n,r);else{h(e);var o=i(e,n,e.getCursor("from")),s=function t(){var a,s=o.from();!(a=o.findNext())&&(o=i(e,n),!(a=o.findNext())||s&&o.from().line==s.line&&o.from().ch==s.ch)||(e.setSelection(o.from(),o.to()),e.scrollIntoView({from:o.from(),to:o.to()}),function(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}(e,function(e){return'<span class="CodeMirror-search-label">'+e.phrase("Replace?")+"</span> <button>"+e.phrase("Yes")+"</button> <button>"+e.phrase("No")+"</button> <button>"+e.phrase("All")+"</button> <button>"+e.phrase("Stop")+"</button> "}(e),e.phrase("Replace?"),[function(){l(a)},t,function(){p(e,n,r)}]))},l=function(e){o.replace("string"==typeof n?r:r.replace(/\$(\d)/g,(function(t,n){return e[n]}))),s()};s()}})))}))}}e.commands.find=function(e){h(e),c(e)},e.commands.findPersistent=function(e){h(e),c(e,!1,!0)},e.commands.findPersistentNext=function(e){c(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){c(e,!0,!0,!0)},e.commands.findNext=c,e.commands.findPrev=function(e){c(e,!0)},e.commands.clearSearch=h,e.commands.replace=f,e.commands.replaceAll=function(e){f(e,!0)}},"object"==(void 0===n?"undefined":(0,i.default)(n))&&"object"==(void 0===t?"undefined":(0,i.default)(t))?r(e("../../lib/codemirror"),e("./searchcursor"),e("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],r):r(CodeMirror)},{"../../lib/codemirror":27,"../dialog/dialog":24,"./searchcursor":26,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":19}],26:[function(e,t,n){"use strict";var r,i=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof"));r=function(e){var t,n,r=e.Pos;function o(e,t){for(var n=function(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}(e),r=n,i=0;i<t.length;i++)-1==r.indexOf(t.charAt(i))&&(r+=t.charAt(i));return n==r?e:new RegExp(e.source,r)}function a(e,t,n){t=o(t,"g");for(var i=n.line,a=n.ch,s=e.lastLine();i<=s;i++,a=0){t.lastIndex=a;var l=e.getLine(i),c=t.exec(l);if(c)return{from:r(i,c.index),to:r(i,c.index+c[0].length),match:c}}}function s(e,t,n){if(!function(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}(t))return a(e,t,n);t=o(t,"gm");for(var i,s=1,l=n.line,c=e.lastLine();l<=c;){for(var u=0;u<s&&!(l>c);u++){var h=e.getLine(l++);i=null==i?h:i+"\n"+h}s*=2,t.lastIndex=n.ch;var d=t.exec(i);if(d){var p=i.slice(0,d.index).split("\n"),f=d[0].split("\n"),m=n.line+p.length-1,v=p[p.length-1].length;return{from:r(m,v),to:r(m+f.length-1,1==f.length?v+f[0].length:f[f.length-1].length),match:d}}}}function l(e,t){for(var n,r=0;;){t.lastIndex=r;var i=t.exec(e);if(!i)return n;if((r=(n=i).index+(n[0].length||1))==e.length)return n}}
vendor: 8,966 bytes, line 1
1function c(e,t,n){t=o(t,"g");for(var i=n.line,a=n.ch,s=e.firstLine();i>=s;i--,a=-1){var c=e.getLine(i);a>-1&&(c=c.slice(0,a));var u=l(c,t);if(u)return{from:r(i,u.index),to:r(i,u.index+u[0].length),match:u}}}function u(e,t,n){t=o(t,"gm");for(var i,a=1,s=n.line,c=e.firstLine();s>=c;){for(var u=0;u<a;u++){var h=e.getLine(s--);i=null==i?h.slice(0,n.ch):h+"\n"+i}a*=2;var d=l(i,t);if(d){var p=i.slice(0,d.index).split("\n"),f=d[0].split("\n"),m=s+p.length,v=p[p.length-1].length;return{from:r(m,v),to:r(m+f.length-1,1==f.length?v+f[0].length:f[f.length-1].length),match:d}}}}function h(e,t,n,r){if(e.length==t.length)return n;for(var i=0,o=n+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,s=r(e.slice(0,a)).length;if(s==n)return a;s>n?o=a:i=a+1}}function d(e,i,o,a){if(!i.length)return null;var s=a?t:n,l=s(i).split(/\r|\n\r?/);e:for(var c=o.line,u=o.ch,d=e.lastLine()+1-l.length;c<=d;c++,u=0){var p=e.getLine(c).slice(u),f=s(p);if(1==l.length){var m=f.indexOf(l[0]);if(-1==m)continue e;return o=h(p,f,m,s)+u,{from:r(c,h(p,f,m,s)+u),to:r(c,h(p,f,m+l[0].length,s)+u)}}var v=f.length-l[0].length;if(f.slice(v)==l[0]){for(var g=1;g<l.length-1;g++)if(s(e.getLine(c+g))!=l[g])continue e;var y=e.getLine(c+l.length-1),x=s(y),b=l[l.length-1];if(x.slice(0,b.length)==b)return{from:r(c,h(p,f,v,s)+u),to:r(c+l.length-1,h(y,x,b.length,s))}}}}function p(e,i,o,a){if(!i.length)return null;var s=a?t:n,l=s(i).split(/\r|\n\r?/);e:for(var c=o.line,u=o.ch,d=e.firstLine()-1+l.length;c>=d;c--,u=-1){var p=e.getLine(c);u>-1&&(p=p.slice(0,u));var f=s(p);if(1==l.length){var m=f.lastIndexOf(l[0]);if(-1==m)continue e;return{from:r(c,h(p,f,m,s)),to:r(c,h(p,f,m+l[0].length,s))}}var v=l[l.length-1];if(f.slice(0,v.length)==v){var g=1;for(o=c-l.length+1;g<l.length-1;g++)if(s(e.getLine(o+g))!=l[g])continue e;var y=e.getLine(c+1-l.length),x=s(y);if(x.slice(x.length-l[0].length)==l[0])return{from:r(c+1-l.length,h(y,x,y.length-l[0].length,s)),to:r(c,h(p,f,v.length,s))}}}}function f(e,t,n,l){var h;this.atOccurrence=!1,this.doc=e,n=n?e.clipPos(n):r(0,0),this.pos={from:n,to:n},"object"==(0,i.default)(l)?h=l.caseFold:(h=l,l=null),"string"==typeof t?(null==h&&(h=!1),this.matches=function(n,r){return(n?p:d)(e,t,r,h)}):(t=o(t,"gm"),l&&!1===l.multiline?this.matches=function(n,r){return(n?c:a)(e,t,r)}:this.matches=function(n,r){return(n?u:s)(e,t,r)})}String.prototype.normalize?(t=function(e){return e.normalize("NFD").toLowerCase()},n=function(e){return e.normalize("NFD")}):(t=function(e){return e.toLowerCase()},n=function(e){return e}),f.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){for(var n=this.matches(t,this.doc.clipPos(t?this.pos.from:this.pos.to));n&&0==e.cmpPos(n.from,n.to);)t?n.from.ch?n.from=r(n.from.line,n.from.ch-1):n=n.from.line==this.doc.firstLine()?null:this.matches(t,this.doc.clipPos(r(n.from.line-1))):n.to.ch<this.doc.getLine(n.to.line).length?n.to=r(n.to.line,n.to.ch+1):n=n.to.line==this.doc.lastLine()?null:this.matches(t,r(n.to.line+1,0));if(n)return this.pos=n,this.atOccurrence=!0,this.pos.match||!0;var i=r(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:i,to:i},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,n){return new f(this.doc,e,t,n)})),e.defineDocExtension("getSearchCursor",(function(e,t,n){return new f(this,e,t,n)})),e.defineExtension("selectMatches",(function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)}))},"object"==(void 0===n?"undefined":(0,i.default)(n))&&"object"==(void 0===t?"undefined":(0,i.default)(t))?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":27,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":19}],27:[function(e,t,n){"use strict";var r,i=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof"));r=function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),s=r||o||a,l=s&&(r?document.documentMode||6:+(a||o)[1]),c=!a&&/WebKit\//.test(e),u=c&&/Qt\/\d+\.\d+/.test(e),h=!a&&/Chrome\//.test(e),d=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),m=/PhantomJS/.test(e),v=!a&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),y=v||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),x=v||/Mac/.test(t),b=/\bCrOS\b/.test(e),_=/win/i.test(t),w=d&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,c=!0);var S=x&&(u||d&&(null==w||w<12.11)),M=n||s&&l>=9;function T(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E,C=function(e,t){var n=e.className,r=T(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function L(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function R(e,t){return L(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function P(e,t,n,r){var i=A(e,t,n,r);return i.setAttribute("role","presentation"),i}function I(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function O(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function D(e,t){var n=e.className;T(t).test(n)||(e.className+=(n?" ":"")+t)}function N(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!T(n[r]).test(t)&&(t+=" "+n[r]);return t}E=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var k=function(e){e.select()};function z(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function B(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function F(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}v?k=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(k=function(e){try{e.select()}catch(e){}});var G=function(){this.id=null,this.f=null,this.time=0,this.handler=z(this.onTimeout,this)};function H(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}G.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},G.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var U={toString:function(){return"CodeMirror.Pass"}},W={scroll:!1},V={origin:"*mouse"},j={origin:"+move"};function X(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var q=[""];function Y(e){for(;q.length<=e;)q.push(K(q)+" ");return q[e]}function K(e){return e[e.length-1]}function Z(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function J(){}function Q(e,t){var n;return Object.create?n=Object.create(e):(J.prototype=e,n=new J),t&&B(t,n),n}var $=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||e>"Â"&&(e.toUpperCase()!=e.toLowerCase()||$.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0
vendor: 4,702 bytes, line 1
1a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return e.charCodeAt(0)>=768&&re.test(e)}function oe(e,t,n){for(;(n<0?t>0:t<e.length)&&ie(e.charAt(t));)t+=n;return t}function ae(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var se=null;function le(e,t,n){var r;se=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:se=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:se=i)}return null!=r?r:se}var ce=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var c,u=a.length,h=[],d=0;d<u;++d)h.push((c=a.charCodeAt(d))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var p=0,f=l;p<u;++p){var m=h[p];"m"==m?h[p]=f:f=m}for(var v=0,g=l;v<u;++v){var y=h[v];"1"==y&&"r"==g?h[v]="n":n.test(y)&&(g=y,"r"==y&&(h[v]="R"))}for(var x=1,b=h[0];x<u-1;++x){var _=h[x];"+"==_&&"1"==b&&"1"==h[x+1]?h[x]="1":","!=_||b!=h[x+1]||"1"!=b&&"n"!=b||(h[x]=b),b=_}for(var w=0;w<u;++w){var S=h[w];if(","==S)h[w]="N";else if("%"==S){var M=void 0;for(M=w+1;M<u&&"%"==h[M];++M);for(var T=w&&"!"==h[w-1]||M<u&&"1"==h[M]?"1":"N",E=w;E<M;++E)h[E]=T;w=M-1}}for(var C=0,L=l;C<u;++C){var R=h[C];"L"==L&&"1"==R?h[C]="L":n.test(R)&&(L=R)}for(var A=0;A<u;++A)if(t.test(h[A])){var P=void 0;for(P=A+1;P<u&&t.test(h[P]);++P);for(var I="L"==(A?h[A-1]:l),O=I==("L"==(P<u?h[P]:l))?I?"L":"R":l,D=A;D<P;++D)h[D]=O;A=P-1}for(var N,k=[],z=0;z<u;)if(r.test(h[z])){var B=z;for(++z;z<u&&r.test(h[z]);++z);k.push(new o(0,B,z))}else{var F=z,G=k.length;for(++z;z<u&&"L"!=h[z];++z);for(var H=F;H<z;)if(i.test(h[H])){F<H&&k.splice(G,0,new o(1,F,H));var U=H;for(++H;H<z&&i.test(h[H]);++H);k.splice(G,0,new o(2,U,H)),F=H}else++H;F<z&&k.splice(G,0,new o(1,F,z))}return"ltr"==s&&(1==k[0].level&&(N=a.match(/^\s+/))&&(k[0].from=N[0].length,k.unshift(new o(0,0,N[0].length))),1==K(k).level&&(N=a.match(/\s+$/))&&(K(k).to-=N[0].length,k.push(new o(0,u-N[0].length,u)))),"rtl"==s?k.reverse():k}}();function ue(e,t){var n=e.order;return null==n&&(n=e.order=ce(e.text,t)),n}var he=[],de=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||he).concat(n)}};function pe(e,t){return e._handlers&&e._handlers[t]||he}function fe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=H(i,n);o>
vendor: 4,133 bytes, line 1
1-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function me(e,t){var n=pe(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function ve(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),me(e,n||t.type,e,t),we(t)||t.codemirrorIgnore}function ge(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==H(n,t[r])&&n.push(t[r])}function ye(e,t){return pe(e,t).length>0}function xe(e){e.prototype.on=function(e,t){de(this,e,t)},e.prototype.off=function(e,t){fe(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function _e(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function we(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Se(e){be(e),_e(e)}function Me(e){return e.target||e.srcElement}function Te(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),x&&e.ctrlKey&&1==t&&(t=3),t}var Ee,Ce,Le=function(){if(s&&l<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Re(e){if(null==Ee){var t=A("span","â");R(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ee=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&l<8))}var n=Ee?A("span","â"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ae(e){if(null!=Ce)return Ce;var t=R(e,document.createTextNode("AØ®A")),n=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return L(e),!(!n||n.left==n.right)&&(Ce=r.right-n.right<3)}var Pe,Ie=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Oe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},De="oncopy"in(Pe=A("div"))||(Pe.setAttribute("oncopy","return;"),"function"==typeof Pe.oncopy),Ne=null,ke={},ze={};function Be(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ke[e]=t}function Fe(e){if("string"==typeof e&&ze.hasOwnProperty(e))e=ze[e];else if(e&&"string"==typeof e.name&&ze.hasOwnProperty(e.name)){var t=ze[e.name];"string"==typeof t&&(t={name:t}),(e=Q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Fe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Fe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ge(e,t){t=Fe(t);var n=ke[t.name];if(!n)return Ge(e,"text/plain");var r=n(e,t);if(He.hasOwnProperty(t.name)){var i=He[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var He={};function Ue(e,t){B(t,He.hasOwnProperty(e)?He[e]:He[e]={})}function We(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ve(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function je(e,t,n){return!e.startState||e.startState(t,n)}var Xe=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function qe(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Ye(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;
vendor: 7,617 bytes, line 1
1i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function Ke(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Ze(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Je(e){if(null==e.parent)return null;for(var t=e.parent,n=H(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Qe(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return n+a}function $e(e,t){return t>=e.first&&t<e.first+e.size}function et(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function tt(e,t,n){if(void 0===n&&(n=null),!(this instanceof tt))return new tt(e,t,n);this.line=e,this.ch=t,this.sticky=n}function nt(e,t){return e.line-t.line||e.ch-t.ch}function rt(e,t){return e.sticky==t.sticky&&0==nt(e,t)}function it(e){return tt(e.line,e.ch)}function ot(e,t){return nt(e,t)<0?t:e}function at(e,t){return nt(e,t)<0?e:t}function st(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function lt(e,t){if(t.line<e.first)return tt(e.first,0);var n=e.first+e.size-1;return t.line>n?tt(n,qe(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?tt(e.line,t):n<0?tt(e.line,0):e}(t,qe(e,t.line).text.length)}function ct(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=lt(e,t[r]);return n}Xe.prototype.eol=function(){return this.pos>=this.string.length},Xe.prototype.sol=function(){return this.pos==this.lineStart},Xe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Xe.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Xe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Xe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Xe.prototype.skipToEnd=function(){this.pos=this.string.length},Xe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Xe.prototype.backUp=function(e){this.pos-=e},Xe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Xe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Xe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Xe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},ht=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function dt(e,t,n,r){var i=[e.state.modeGen],o={};_t(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,c=0;n.state=!0,_t(e,t.text,s.mode,n,(function(e,t){for(var n=l;c<e;){var r=i[l];r>e&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function pt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=ft(e,Je(t)),i=t.text.length>e.options.maxHighlightLength&&We(e.doc.mode,r.state),o=dt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ft(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new ht(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=qe(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ut?c.lookAhead:0)<=o.modeFrontier))return s;var u=F(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(e,t,n),a=o>r.first&&qe(r,o-1).stateAfter,s=a?ht.fromSaved(r,a,o):new ht(r,je(r.mode),o);return r.iter(o,t,(function(n){mt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function mt(e,t,n,r){var i=e.doc.mode,o=new Xe(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&vt(i,n.state);!o.eol();)gt(i,o,n.state),o.start=o.pos}function vt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ve(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function gt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ve(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ht.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ht.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ht.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ht.fromSaved=function(e,t,n){return t instanceof ut?new ht(e,We(e.mode,t.state),n,t.lookAhead):new ht(e,We(e.mode,t),n)},ht.prototype.save=function(e){var t=!1!==e?We(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var yt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function xt(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=qe(a,(t=lt(a,t)).line),c=ft(e,t.line,n),u=new Xe(l.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=gt(s,u,c.state),r&&o.push(new yt(u,i,We(a.mode,c.state)));return r?o:new yt(u,i,c.state)}function bt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function _t(e,t,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,h=new Xe(t,e.options.tabSize,r),d=e.options.addModeClass&&[null];for(""==t&&bt(vt(n,r.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,a&&mt(e,t,r,h.pos),h.pos=t.length,l=null):l=bt(gt(n,h,r.state,d),o),d){var p=d[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;c<h.start;)i(c=Math.min(h.start,c+5e3),u);u=l}h.start=h.pos}for(;c<h.pos;
vendor: 4,537 bytes, line 1
1){var f=Math.min(h.pos,c+5e3);i(f,u),c=f}}var wt=!1,St=!1;function Mt(e,t,n){this.marker=e,this.from=t,this.to=n}function Tt(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Et(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Ct(e,t){if(t.full)return null;var n=$e(e,t.from.line)&&qe(e,t.from.line).markedSpans,r=$e(e,t.to.line)&&qe(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==nt(t.from,t.to),s=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Mt(a,o.from,s?null:o.to))}}return r}(n,i,a),l=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Mt(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}(r,o,a),c=1==t.text.length,u=K(t.text).length+(c?i:0);if(s)for(var h=0;h<s.length;++h){var d=s[h];if(null==d.to){var p=Tt(l,d.marker);p?c&&(d.to=null==p.to?null:p.to+u):d.to=i}}if(l)for(var f=0;f<l.length;++f){var m=l[f];null!=m.to&&(m.to+=u),null==m.from?Tt(s,m.marker)||(m.from=u,c&&(s||(s=[])).push(m)):(m.from+=u,c&&(s||(s=[])).push(m))}s&&(s=Lt(s)),l&&l!=s&&(l=Lt(l));var v=[s];if(!c){var g,y=t.text.length-2;if(y>0&&s)for(var x=0;x<s.length;++x)null==s[x].to&&(g||(g=[])).push(new Mt(s[x].marker,null,null));for(var b=0;b<y;++b)v.push(g);v.push(l)}return v}function Lt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Rt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function At(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Pt(e){return e.inclusiveLeft?-1:0}function It(e){return e.inclusiveRight?1:0}function Ot(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=nt(r.from,i.from)||Pt(e)-Pt(t);if(o)return-o;var a=nt(r.to,i.to)||It(e)-It(t);return a||t.id-e.id}function Dt(e,t){var n,r=St&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||Ot(n,i.marker)<0)&&(n=i.marker);return n}function Nt(e){return Dt(e,!0)}function kt(e){return Dt(e,!1)}function zt(e,t){var n,r=St&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Ot(n,o.marker)<0)&&(n=o.marker)}return n}function Bt(e,t,n,r,i){var o=qe(e,t),a=St&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=nt(c.from,n)||Pt(l.marker)-Pt(i),h=nt(c.to,r)||It(l.marker)-It(i);if(!(u>=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?nt(c.to,n)>=0:nt(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?nt(c.from,r)<=0:nt(c.from,r)<0)))return!0}}}function Ft(e){for(var t;t=Nt(e);)e=t.find(-1,!0).line;return e}function Gt(e,t){var n=qe(e,t),r=Ft(n);return n==r?t:Je(r)}function Ht(e,t){if(t>e.lastLine())return t;var n,r=qe(e,t);if(!Ut(e,r))return t;for(;n=kt(r);)r=n.find(1,!0).line;return Je(r)+1}function Ut(e,t){var n=St&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Wt(e,t,r))return!0}}function Wt(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Wt(e,r.line,Tt(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Wt(e,t,i))return!0}function Vt(e){for(var t=0,n=(e=Ft(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function jt(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Nt(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=kt(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}
vendor: 4,868 bytes, line 1
1function Xt(e){var t=e.display,n=e.doc;t.maxLine=qe(n,n.first),t.maxLineLength=jt(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=jt(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var qt=function(e,t,n){this.text=e,At(this,t),this.height=n?n(this):1};function Yt(e){e.parent=null,Rt(e)}qt.prototype.lineNo=function(){return Je(this)},xe(qt);var Kt={},Zt={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Zt:Kt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Qt(e,t){var n=P("span",null,null,c?"padding-right: .1px":null),r={pre:P("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=en,Ae(e.display.measure)&&(a=ue(o,e.doc.direction))&&(r.addToken=tn(r.addToken,a)),r.map=[],rn(o,r,pt(e,o,t!=e.display.externalMeasured&&Je(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=N(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=N(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Re(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(c){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return me(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=N(r.pre.className,r.textClass||"")),r}function $t(e){var t=A("span","â¢","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function en(e,t,n,r,i,o,a){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(t,e.trailingSpace):t,h=e.cm.state.specialChars,d=!1;if(h.test(t)){c=document.createDocumentFragment();for(var p=0;;){h.lastIndex=p;var f=h.exec(t),m=f?f.index-p:t.length-p;if(m){var v=document.createTextNode(u.slice(p,p+m));s&&l<9?c.appendChild(A("span",[v])):c.appendChild(v),e.map.push(e.pos,e.pos+m,v),e.col+=m,e.pos+=m}if(!f)break;p+=m+1;var g=void 0;if("\t"==f[0]){var y=e.cm.options.tabSize,x=y-e.col%y;(g=c.appendChild(A("span",Y(x),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=x}else"\r"==f[0]||"\n"==f[0]?((g=c.appendChild(A("span","\r"==f[0]?"â":"â¤","cm-invalidchar"))).setAttribute("cm-text",f[0]),e.col+=1):((g=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),s&&l<9?c.appendChild(A("span",[g])):c.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),s&&l<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||d||o){var b=n||"";r&&(b+=r),i&&(b+=i);var _=A("span",[c],b,o);if(a)for(var w in a)a.hasOwnProperty(w)&&"style"!=w&&"class"!=w&&_.setAttribute(w,a[w]);return e.content.appendChild(_)}e.content.appendChild(c)}}function tn(e,t){return function(n,r,i,o,a,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var h=void 0,d=0;d<t.length&&!((h=t[d]).to>c&&h.from<=c);d++);if(h.to>=u)return e(n,r,i,o,a,s,l);e(n,r.slice(0,h.to-c),i,o,null,s,l),o=null,r=r.slice(h.to-c),c=h.to}}}function nn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function rn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,h,d,p=i.length,f=0,m=1,v="",g=0;;){if(g==f){l=c=u=s="",d=null,h=null,g=1/0;for(var y=[],x=void 0,b=0;b<r.length;++b){var _=r[b],w=_.marker;if("bookmark"==w.type&&_.from==f&&w.widgetNode)y.push(w);else if(_.from<=f&&(null==_.to||_.to>f||w.collapsed&&_.to==f&&_.from==f)){if(null!=_.to&&_.to!=f&&g>_.to&&(g=_.to,c=""),w.className&&(l+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&_.from==f&&(u+=" "+w.startStyle),w.endStyle&&_.to==g&&(x||(x=[])).push(w.endStyle,_.to),w.title&&((d||(d={})).title=w.title),w.attributes)for(var S in w.attributes)(d||(d={}))[S]=w.attributes[S];w.collapsed&&(!h||Ot(h.marker,w)<0)&&(h=_)}else _.from>f&&g>_.from&&(g=_.from)}if(x)for(var M=0;M<x.length;M+=2)x[M+1]==g&&(c+=" "+x[M]);if(!h||h.from==f)for(var T=0;T<y.length;++T)nn(t,0,y[T]);if(h&&(h.from||0)==f){if(nn(t,(null==h.to?p+1:h.to)-f,h.marker,null==h.from),null==h.to)return;h.to==f&&(h=!1)}}if(f>=p)break;for(var E=Math.min(p,g);;){if(v){var C=f+v.length;
vendor: 13,546 bytes, line 1
1if(!h){var L=C>E?v.slice(0,E-f):v;t.addToken(t,L,a?a+l:l,u,f+L.length==g?c:"",s,d)}if(C>=E){v=v.slice(E-f),f=E;break}f=C,u=""}v=i.slice(o,o=n[m++]),a=Jt(n[m++],t.cm.options)}}else for(var R=1;R<n.length;R+=2)t.addToken(t,i.slice(o,o=n[R]),Jt(n[R+1],t.cm.options))}function on(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=kt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Je(K(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Ut(e,t)}function an(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new on(e.doc,qe(e.doc,o),o);r=o+a.size,i.push(a)}return i}var sn=null,ln=null;function cn(e,t){var n=pe(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);sn?r=sn.delayedCallbacks:ln?r=ln:(r=ln=[],setTimeout(un,0));for(var o=function(e){r.push((function(){return n[e].apply(null,i)}))},a=0;a<n.length;++a)o(a)}}function un(){var e=ln;ln=null;for(var t=0;t<e.length;++t)e[t]()}function hn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?fn(e,t):"gutter"==o?vn(e,t,n,r):"class"==o?mn(e,t):"widget"==o&&gn(e,t,r)}t.changes=null}function dn(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),s&&l<8&&(e.node.style.zIndex=2)),e.node}function pn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Qt(e,t)}function fn(e,t){var n=t.text.className,r=pn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,mn(e,t)):n&&(t.text.className=n)}function mn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=dn(t);t.background=r.insertBefore(A("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?dn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function vn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=dn(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=dn(t),s=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(A("div",et(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(A("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function gn(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,"CodeMirror-linewidget"==r.className&&t.node.removeChild(r);xn(e,t,n)}function yn(e,t,n,r){var i=pn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),mn(e,t),vn(e,t,n,r),xn(e,t,r),t.node}function xn(e,t,n){if(bn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)bn(e,t.rest[r],t,n,!1)}function bn(e,t,n,r,i){if(t.widgets)for(var o=dn(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=A("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),_n(l,c,n,r),e.display.input.setUneditable(c),i&&l.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),cn(l,"redraw")}}function _n(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function wn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!I(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),R(t.display.measure,A("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Sn(e,t){for(var n=Me(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Mn(e){return e.lineSpace.offsetTop}function Tn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function En(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=R(e.measure,A("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Cn(e){return 30-e.display.nativeBarWidth}function Ln(e){return e.display.scroller.clientWidth-Cn(e)-e.display.barWidth}function Rn(e){return e.display.scroller.clientHeight-Cn(e)-e.display.barHeight}function An(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(Je(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Pn(e,t,n,r){return Dn(e,On(e,t),n,r)}function In(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[hr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function On(e,t){var n=Je(t),r=In(e,n);r&&!r.text?r=null:r&&r.changes&&(hn(e,r,n,ar(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=Je(t=Ft(t)),r=e.display.externalMeasured=new on(e.doc,t,n);r.lineN=n;var i=r.built=Qt(e,r);return r.text=i.pre,R(e.display.lineMeasure,i.pre),r}(e,t));var i=An(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Dn(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,i=r&&Ln(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=zn(t.map,n,r),a=o.node,c=o.start,u=o.end,h=o.collapse;if(3==a.nodeType){for(var d=0;d<4;d++){for(;c&&ie(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+u));)++u;if((i=s&&l<9&&0==c&&u==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Bn(E(a,c,u).getClientRects(),r)).left||i.right||0==c)break;u=c,c-=1,h="right"}s&&l<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Ne)return Ne;var t=R(e,A("span","x")),n=t.getBoundingClientRect(),r=E(t,0,1).getBoundingClientRect();return Ne=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var p;c>0&&(h=r="right"),i=e.options.lineWrapping&&(p=a.getClientRects()).length>1?p["right"==r?p.length-1:0]:a.getBoundingClientRect()}if(s&&l<9&&!c&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+or(e.display),top:f.top,bottom:f.bottom}:kn}for(var m=i.top-t.rect.top,v=i.bottom-t.rect.top,g=(m+v)/2,y=t.view.measure.heights,x=0;x<y.length-1&&!(g<y[x]);x++);var b=x?y[x-1]:0,_=y[x],w={left:("right"==h?i.right:i.left)-t.rect.left,right:("left"==h?i.left:i.right)-t.rect.left,top:b,bottom:_};return i.left||i.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=m,w.rbottom=v),w}(e,t,n,r)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Nn,kn={left:0,right:0,top:0,bottom:0};function zn(e,t,n){for(var r,i,o,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(i=0,o=1,a="left"):t<l?o=1+(i=t-s):(c==e.length-3||t==l&&e[c+3]>t)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function Bn(e,t){var n=kn;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Fn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Gn(e){e.display.externalMeasure=null,L(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Fn(e.display.view[t])}function Hn(e){Gn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Un(){return h&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Wn(){return h&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Vn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=wn(e.widgets[n]));return t}function jn(e,t,n,r,i){if(!i){var o=Vn(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=Vt(t);if("local"==r?a+=Mn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Wn());var l=s.left+("window"==r?0:Un());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function Xn(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Un(),i-=Wn();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function qn(e,t,n,r,i){return r||(r=qe(e.doc,t.line)),jn(e,r,Pn(e,r,t.ch,i),n)}function Yn(e,t,n,r,i,o){function a(t,a){var s=Dn(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,jn(e,r,s,n)}r=r||qe(e.doc,t.line),i||(i=On(e,r));var s=ue(r,e.doc.direction),l=t.ch,c=t.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var h=le(s,l,c),d=se,p=u(l,h,"before"==c);return null!=d&&(p.other=u(l,d,"before"!=c)),p}function Kn(e,t){var n=0;t=lt(e.doc,t),e.options.lineWrapping||(n=or(e.display)*t.ch);var r=qe(e.doc,t.line),i=Vt(r)+Mn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Zn(e,t,n,r,i){var o=tt(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Jn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Zn(r.first,0,null,-1,-1);var i=Qe(r,n),o=r.first+r.size-1;if(i>o)return Zn(r.first+r.size-1,qe(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=qe(r,i);;){var s=tr(e,a,i,t,n),l=zt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=qe(r,i=c.line)}}function Qn(e,t,n,r){r-=Vn(t);var i=t.text.length,o=ae((function(t){return Dn(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=ae((function(t){return Dn(e,n,t).top>r}),o,i)}}function $n(e,t,n,r){return n||(n=On(e,t)),Qn(e,t,n,jn(e,t,Dn(e,n,r),"line").top)}function er(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function tr(e,t,n,r,i){i-=Vt(t);var o=On(e,t),a=Vn(t),s=0,l=t.text.length,c=!0,u=ue(t,e.doc.direction);if(u){var h=(e.options.lineWrapping?rr:nr)(e,t,n,o,u,r,i);s=(c=1!=h.level)?h.from:h.to-1,l=c?h.to:h.from-1}var d,p,f=null,m=null,v=ae((function(t){var n=Dn(e,o,t);return n.top+=a,n.bottom+=a,!!er(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(f=t,m=n),!0)}),s,l),g=!1;if(m){var y=r-m.left<m.right-r,x=y==c;v=f+(x?0:1),p=x?"after":"before",d=y?m.left:m.right}else{c||v!=l&&v!=s||v++,p=0==v?"after":v==t.text.length?"before":Dn(e,o,v-(c?1:0)).bottom+a<=i==c?"after":"before";var b=Yn(e,tt(n,v,p),"line",t,o);d=b.left,g=i<b.top?-1:i>=b.bottom?1:0}return Zn(n,v=oe(t.text,v,1),p,g,r-d)}function nr(e,t,n,r,i,o,a){var s=ae((function(s){var l=i[s],c=1!=l.level;return er(Yn(e,tt(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>
vendor: 4,146 bytes, line 1
10){var c=1!=l.level,u=Yn(e,tt(n,c?l.from:l.to,c?"after":"before"),"line",t,r);er(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l}function rr(e,t,n,r,i,o,a){var s=Qn(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,h=null,d=0;d<i.length;d++){var p=i[d];if(!(p.from>=c||p.to<=l)){var f=Dn(e,r,1!=p.level?Math.min(c,p.to)-1:Math.max(l,p.from)).right,m=f<o?o-f+1e9:f-o;(!u||h>m)&&(u=p,h=m)}}return u||(u=i[i.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function ir(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Nn){Nn=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Nn.appendChild(document.createTextNode("x")),Nn.appendChild(A("br"));Nn.appendChild(document.createTextNode("x"))}R(e.measure,Nn);var n=Nn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),L(e.measure),n||1}function or(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t],"CodeMirror-line-like");R(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function ar(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:sr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function sr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function lr(e){var t=ir(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/or(e.display)-3);return function(i){if(Ut(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function cr(e){var t=e.doc,n=lr(e);t.iter((function(e){var t=n(e);t!=e.height&&Ze(e,t)}))}function ur(e,t,n,r){var i=e.display;if(!n&&"true"==Me(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(t){return null}var l,c=Jn(e,o,a);if(r&&1==c.xRel&&(l=qe(e.doc,c.line).text).length==c.ch){var u=F(l,l.length,e.options.tabSize)-l.length;c=tt(c.line,Math.max(0,Math.round((o-En(e.display).left)/or(e.display))-u))}return c}function hr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function dr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)St&&Gt(e.doc,t)<i.viewTo&&fr(e);else if(n<=i.viewFrom)St&&Ht(e.doc,n+r)>i.viewFrom?fr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)fr(e);else if(t<=i.viewFrom){var o=mr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):fr(e)}else if(n>=i.viewTo){var a=mr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):fr(e)}else{var s=mr(e,t,t,-1),l=mr(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(an(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):fr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function pr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[hr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==H(a,n)&&a.push(n)}}}function fr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function mr(e,t,n,r){var i,o=hr(e,t),a=e.display.view;if(!St||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;Gt(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}
vendor: 36,737 bytes, line 1
1function vr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function gr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function yr(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&xr(e,s.head,i),l||_r(e,s,o)}}return r}function xr(e,t,n){var r=Yn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(A("div","Â ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(A("div","Â ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function br(e,t){return e.top-t.top||e.left-t.left}function _r(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=En(e.display),s=a.left,l=Math.max(r.sizerWidth,Ln(e)-r.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(r-t)+"px"))}function h(t,n,r){var o,a,h=qe(i,t),d=h.text.length;function p(n,r){return qn(e,tt(t,n),"div",h,r)}function f(t,n,r){var i=$n(e,h,null,t),o="ltr"==n==("after"==r)?"left":"right";return p("after"==r?i.begin:i.end-(/\s/.test(h.text.charAt(i.end-1))?2:1),o)[o]}var m=ue(h,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?d:r,(function(e,t,i,h){var v="ltr"==i,g=p(e,v?"left":"right"),y=p(t-1,v?"right":"left"),x=null==n&&0==e,b=null==r&&t==d,_=0==h,w=!m||h==m.length-1;if(y.top-g.top<=3){var S=(c?b:x)&&w,M=(c?x:b)&&_?s:(v?g:y).left,T=S?l:(v?y:g).right;u(M,g.top,T-M,g.bottom)}else{var E,C,L,R;v?(E=c&&x&&_?s:g.left,C=c?l:f(e,i,"before"),L=c?s:f(t,i,"after"),R=c&&b&&w?l:y.right):(E=c?f(e,i,"before"):s,C=!c&&x&&_?l:g.right,L=!c&&b&&w?s:y.left,R=c?f(t,i,"after"):l),u(E,g.top,C-E,g.bottom),g.bottom<y.top&&u(s,g.bottom,null,y.top),u(L,y.top,R-L,y.bottom)}(!o||br(g,o)<0)&&(o=g),br(y,o)<0&&(o=y),(!a||br(g,a)<0)&&(a=g),br(y,a)<0&&(a=y)})),{start:o,end:a}}var d=t.from(),p=t.to();if(d.line==p.line)h(d.line,d.ch,p.ch);else{var f=qe(i,d.line),m=qe(i,p.line),v=Ft(f)==Ft(m),g=h(d.line,d.ch,v?f.text.length+1:null).end,y=h(p.line,v?0:null,p.ch).start;v&&(g.top<y.top-2?(u(g.right,g.top,null,g.bottom),u(s,y.top,y.left,y.bottom)):u(g.right,g.top,y.left-g.right,g.bottom)),g.bottom<y.top&&u(s,g.bottom,null,y.top)}n.appendChild(o)}function wr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Sr(e){e.state.focused||(e.display.input.focus(),Tr(e))}function Mr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Er(e))}),100)}function Tr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(me(e,"focus",e,t),e.state.focused=!0,D(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),c&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),wr(e))}function Er(e,t){e.state.delayingBlurEvent||(e.state.focused&&(me(e,"blur",e,t),e.state.focused=!1,C(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Cr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=e.options.lineWrapping,a=void 0,c=0;if(!i.hidden){if(s&&l<8){var u=i.node.offsetTop+i.node.offsetHeight;a=u-n,n=u}else{var h=i.node.getBoundingClientRect();a=h.bottom-h.top,!o&&i.text.firstChild&&(c=i.text.firstChild.getBoundingClientRect().right-h.left-1)}var d=i.line.height-a;if((d>.005||d<-.005)&&(Ze(i.line,a),Lr(i.line),i.rest))for(var p=0;p<i.rest.length;p++)Lr(i.rest[p]);if(c>e.display.sizerWidth){var f=Math.ceil(c/or(e.display));f>e.display.maxLineLength&&(e.display.maxLineLength=f,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Lr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Rr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Mn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=Qe(t,r),a=Qe(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=Qe(t,Vt(qe(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=Qe(t,Vt(qe(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function Ar(e,t){var n=e.display,r=ir(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Rn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Tn(n),l=t.top<r,c=t.bottom>s-r;if(t.top<i)a.scrollTop=l?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,d=Ln(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),p=t.right-t.left>d;return p&&(t.right=t.left+d),t.left<10?a.scrollLeft=0:t.left<h?a.scrollLeft=Math.max(0,t.left-(p?0:10)):t.right>d+h-3&&(a.scrollLeft=t.right+(p?0:10)-d),a}function Pr(e,t){null!=t&&(Dr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Ir(e){Dr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Or(e,t,n){null==t&&null==n||Dr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Dr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Nr(e,Kn(e,t.from),Kn(e,t.to),t.margin))}function Nr(e,t,n,r){var i=Ar(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Or(e,i.scrollLeft,i.scrollTop)}function kr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||ci(e,{top:t}),zr(e,t,!0),n&&ci(e),ii(e,100))}function zr(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Br(e,t,n,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,di(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Fr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Tn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Cn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Gr=function(e,t,n){this.cm=n;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),de(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),de(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Gr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Gr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Gr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Gr.prototype.zeroWidthHack=function(){var e=x&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new G,this.disableVert=new G},Gr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},Gr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Hr=function(){};function Ur(e,t){t||(t=Fr(e));var n=e.display.barWidth,r=e.display.barHeight;Wr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Cr(e),Wr(e,Fr(e)),n=e.display.barWidth,r=e.display.barHeight}function Wr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Hr.prototype.update=function(){return{bottom:0,right:0}},Hr.prototype.setScrollLeft=function(){},Hr.prototype.setScrollTop=function(){},Hr.prototype.clear=function(){};var Vr={native:Gr,null:Hr};function jr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&C(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Vr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),de(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Br(e,t):kr(e,t)}),e),e.display.scrollbars.addClass&&D(e.display.wrapper,e.display.scrollbars.addClass)}var Xr=0;function qr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Xr},t=e.curOp,sn?sn.ops.push(t):t.ownsGroup=sn={ops:[t],delayedCallbacks:[]}}function Yr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{sn=null,t(n)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)Kr(t[n]);for(var r=0;r<t.length;r++)Zr(t[r]);for(var i=0;i<t.length;i++)Jr(t[i]);for(var o=0;o<t.length;o++)Qr(t[o]);for(var a=0;a<t.length;a++)$r(t[a])}(e)}))}function Kr(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Cn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Cn(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Xt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ai(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Zr(e){e.updatedDisplay=e.mustUpdate&&si(e.cm,e.update)}function Jr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Cr(t),e.barMeasure=Fr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Pn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Cn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ln(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Qr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Br(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==O();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ur(t,e.barMeasure),e.updatedDisplay&&hi(t,e.barMeasure),e.selectionChanged&&wr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Sr(e.cm)}function $r(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&li(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&zr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Br(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!ve(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!m){var o=A("div","â",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Mn(e.display))+"px;\n height: "+(t.bottom-t.top+Cn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?tt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?tt(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=Yn(e,t),l=n&&n!=t?Yn(e,n):s,c=Ar(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=c.scrollTop&&(kr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Br(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(a=!0)),!a)break}return i}(t,lt(r,e.scrollToPos.from),lt(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||me(i[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&me(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&me(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ei(e,t){if(e.curOp)return t();qr(e);try{return t()}finally{Yr(e)}}function ti(e,t){return function(){if(e.curOp)return t.apply(e,arguments);qr(e);try{return t.apply(e,arguments)}finally{Yr(e)}}}function ni(e){return function(){if(this.curOp)return e.apply(this,arguments);qr(this);try{return e.apply(this,arguments)}finally{Yr(this)}}}function ri(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);qr(t);try{return e.apply(this,arguments)}finally{Yr(t)}}}function ii(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,z(oi,e))}function oi(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ft(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?We(t.mode,r.state):null,l=dt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var h=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!h&&d<a.length;++d)h=a[d]!=o.styles[d];h&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&mt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ii(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&ei(e,(function(){for(var t=0;t<i.length;t++)pr(e,i[t],"text")}))}}var ai=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Rr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ln(e),this.force=n,this.dims=ar(e),this.events=[]};function si(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return fr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==vr(e))return!1;pi(e)&&(fr(e),t.dims=ar(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),St&&(o=Gt(e.doc,o),a=Ht(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=an(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=an(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(hr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(an(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,hr(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=Vt(qe(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=vr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=O();if(!t||!I(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&I(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return l>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return c&&x&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var l=r.view,u=r.viewFrom,h=0;h<l.length;h++){var d=l[h];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;a!=d.node;)a=s(a);var p=i&&null!=t&&t<=u&&d.lineNumber;d.changes&&(H(d.changes,"gutter")>-1&&(p=!1),hn(e,d,u,n)),p&&(L(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(et(e.options,u)))),a=d.node.nextSibling}else{var f=yn(e,d,u,n);o.insertBefore(f,a)}u+=d.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=O()&&(e.activeElt.focus(),e.anchorNode&&I(document.body,e.anchorNode)&&I(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),L(n.cursorDiv),L(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ii(e,400)),n.updateLineNumbers=null,!0}function li(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ln(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Tn(e.display)-Rn(e),n.top)}),t.visible=Rr(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&si(e,t);r=!1){Cr(e);var i=Fr(e);gr(e),Ur(e,i),hi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ci(e,t){var n=new ai(e,t);if(si(e,n)){Cr(e),li(e,n);var r=Fr(e);gr(e),Ur(e,r),hi(e,r),n.finish()}}function ui(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function hi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Cn(e)+"px"}function di(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=sr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function pi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=et(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(A("div",[A("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ui(e.display),!0}return!1}function fi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function mi(e){var t=e.gutters,n=e.gutterSpecs;L(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,s=t.appendChild(A("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ui(e)}function vi(e){mi(e.display),dr(e),di(e)}function gi(e,t,r,i){var o=this;this.input=r,o.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=P("div",null,"CodeMirror-code"),o.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=A("div",null,"CodeMirror-cursors"),o.measure=A("div",null,"CodeMirror-measure"),o.lineMeasure=A("div",null,"CodeMirror-measure"),o.lineSpace=P("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var a=P("div",[o.lineSpace],"CodeMirror-lines");o.mover=A("div",[a],null,"position: relative"),o.sizer=A("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=A("div",null,null,"position: absolute; height: 30px; width: 1px;"),o.gutters=A("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=A("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=A("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),s&&l<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),c||n&&y||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=fi(i.gutters,i.lineNumbers),mi(o),r.init(o)}ai.prototype.signal=function(e,t){ye(e,t)&&this.events.push(arguments)},ai.prototype.finish=function(){for(var e=0;e<this.events.length;e++)me.apply(null,this.events[e])};var yi=0,xi=null;function bi(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function _i(e){var t=bi(e);return t.x*=xi,t.y*=xi,t}function wi(e,t){var r=bi(t),i=r.x,o=r.y,a=e.display,s=a.scroller,l=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&l||o&&u){if(o&&x&&c)e:for(var h=t.target,p=a.view;h!=s;h=h.parentNode)for(var f=0;f<p.length;f++)if(p[f].node==h){e.display.currentWheelTarget=h;break e}if(i&&!n&&!d&&null!=xi)return o&&u&&kr(e,Math.max(0,s.scrollTop+o*xi)),Br(e,Math.max(0,s.scrollLeft+i*xi)),(!o||o&&u)&&be(t),void(a.wheelStartX=null);if(o&&null!=xi){var m=o*xi,v=e.doc.scrollTop,g=v+a.wrapper.clientHeight;m<0?v=Math.max(0,v+m-50):g=Math.min(e.doc.height,g+m+50),ci(e,{top:v,bottom:g})}yi<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(xi=(xi*yi+n)/(yi+1),++yi)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}s?xi=-.53:n?xi=15:h?xi=-.7:p&&(xi=-1/3);var Si=function(e,t){this.ranges=e,this.primIndex=t};Si.prototype.primary=function(){return this.ranges[this.primIndex]},Si.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!rt(n.anchor,r.anchor)||!rt(n.head,r.head))return!1}return!0},Si.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Mi(it(this.ranges[t].anchor),it(this.ranges[t].head));return new Si(e,this.primIndex)},Si.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Si.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(nt(t,r.from())>=0&&nt(e,r.to())<=0)return n}return-1};var Mi=function(e,t){this.anchor=e,this.head=t};function Ti(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return nt(e.from(),t.from())})),n=H(t,i);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],l=nt(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var c=at(s.from(),a.from()),u=ot(s.to(),a.to()),h=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new Mi(h?u:c,h?c:u))}}return new Si(t,n)}function Ei(e,t){return new Si([new Mi(e,t||e)],0)}function Ci(e){return e.text?tt(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Li(e,t){if(nt(e,t.from)<0)return e;if(nt(e,t.to)<=0)return Ci(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ci(t).ch-t.to.ch),tt(n,r)}function Ri(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Mi(Li(i.anchor,t),Li(i.head,t)))}return Ti(e.cm,n,e.sel.primIndex)}function Ai(e,t,n){return e.line==t.line?tt(n.line,e.ch-t.ch+n.ch):tt(n.line+(e.line-t.line),e.ch)}function Pi(e){e.doc.mode=Ge(e.options,e.doc.modeOption),Ii(e)}function Ii(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ii(e,100),e.state.modeGen++,e.curOp&&dr(e)}function Oi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==K(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Di(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Rt(e),At(e,n);var i=r?r(e):1;i!=e.height&&Ze(e,i)}(e,n,i,r),cn(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new qt(c[o],i(o),r));return n}var s=t.from,l=t.to,c=t.text,u=qe(e,s.line),h=qe(e,l.line),d=K(c),p=i(c.length-1),f=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Oi(e,t)){var m=a(0,c.length-1);o(h,h.text,p),f&&e.remove(s.line,f),m.length&&e.insert(s.line,m)}else if(u==h)if(1==c.length)o(u,u.text.slice(0,s.ch)+d+u.text.slice(l.ch),p);else{var v=a(1,c.length-1);v.push(new qt(d+u.text.slice(l.ch),p,r)),o(u,u.text.slice(0,s.ch)+c[0],i(0)),e.insert(s.line+1,v)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+h.text.slice(l.ch),i(0)),e.remove(s.line+1,f);else{o(u,u.text.slice(0,s.ch)+c[0],i(0)),o(h,d+h.text.slice(l.ch),p);var g=a(1,c.length-1);f>1&&e.remove(s.line+1,f-1),e.insert(s.line+1,g)}cn(e,"change",e,t)}function Ni(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;a<r.linked.length;++a){var s=r.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;n&&!l||(t(s.doc,l),e(s.doc,r,l))}}}(e,null,!0)}function ki(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,cr(e),Pi(e),zi(e),e.options.lineWrapping||Xt(e),e.options.mode=t.modeOption,dr(e)}function zi(e){("rtl"==e.doc.direction?D:C)(e.display.lineDiv,"CodeMirror-rtl")}function Bi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Fi(e,t){var n={from:it(t.from),to:Ci(t),text:Ye(e,t.from,t.to)};return Vi(e,n,t.from.line,t.to.line+1),Ni(e,(function(e){return Vi(e,n,t.from.line,t.to.line+1)}),!0),n}function Gi(e){for(;e.length&&K(e).ranges;)e.pop()}function Hi(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Gi(e.done),K(e.done)):e.done.length&&!K(e.done).ranges?K(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}(i,i.lastOp==r)))a=K(o.changes),0==nt(t.from,t.to)&&0==nt(t.from,a.to)?a.to=Ci(t):o.changes.push(Fi(e,t));else{var l=K(i.done);for(l&&l.ranges||Wi(e.sel,i.done),o={changes:[Fi(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||me(e,"historyAdded")}function Ui(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,K(i.done),t))?i.done[i.done.length-1]=t:Wi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Gi(i.undone)}function Wi(e,t){var n=K(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Vi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function ji(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Xi(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(ji(n[i]));return r}(e,t),r=Ct(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else a&&(n[i]=a)}return n}function qi(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?Si.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var h in c)(u=h.match(/^spans_(\d+)$/))&&H(t,Number(u[1]))>-1&&(K(s)[h]=c[h],delete c[h])}}}return r}function Yi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=nt(t,i)<0;o!=nt(n,i)<0?(i=t,t=n):o!=nt(t,n)<0&&(t=n)}return new Mi(i,t)}return new Mi(n||t,t)}function Ki(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),eo(e,new Si([Yi(e.sel.primary(),t,n,i)],0),r)}function Zi(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Yi(e.sel.ranges[o],t[o],null,i);eo(e,Ti(e.cm,r,e.sel.primIndex),n)}function Ji(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,eo(e,Ti(e.cm,i,e.sel.primIndex),r)}function Qi(e,t,n,r){eo(e,Ei(t,n),r)}function $i(e,t,n){var r=e.history.done,i=K(r);i&&i.ranges?(r[r.length-1]=t,to(e,t,n)):eo(e,t,n)}function eo(e,t,n){to(e,t,n),Ui(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function to(e,t,n){(ye(e,"beforeSelectionChange")||e.cm&&ye(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new Mi(lt(e,t[n].anchor),lt(e,t[n].head))},origin:n&&n.origin};return me(e,"beforeSelectionChange",e,r),e.cm&&me(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Ti(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(nt(t.primary().head,e.sel.primary().head)<0?-1:1);no(e,io(e,t,r,!0)),n&&!1===n.scroll||!e.cm||Ir(e.cm)}function no(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ge(e.cm)),cn(e,"cursorActivity",e))}function ro(e){no(e,io(e,e.sel,null,!1))}function io(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=ao(e,a.anchor,s&&s.anchor,n,r),c=ao(e,a.head,s&&s.head,n,r);(i||l!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Mi(l,c))}return i?Ti(e.cm,i,t.primIndex):t}function oo(e,t,n,r,i){var o=qe(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(i&&(me(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var h=l.find(r<0?1:-1),d=void 0;if((r<0?u:c)&&(h=so(e,h,-r,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(d=nt(h,n))&&(r<0?d<0:d>0))return oo(e,h,t,r,i)}var p=l.find(r<0?-1:1);return(r<0?c:u)&&(p=so(e,p,r,p.line==t.line?o:null)),p?oo(e,p,t,r,i):null}}return t}function ao(e,t,n,r,i){var o=r||1,a=oo(e,t,n,o,i)||!i&&oo(e,t,n,o,!0)||oo(e,t,n,-o,i)||!i&&oo(e,t,n,-o,!0);return a||(e.cantEdit=!0,tt(e.first,0))}function so(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?lt(e,tt(t.line-1)):null:n>0&&t.ch==(r||qe(e,t.line)).text.length?t.line<e.first+e.size-1?tt(t.line+1,0):null:new tt(t.line,t.ch+n)}function lo(e){e.setSelection(tt(e.firstLine(),0),tt(e.lastLine()
vendor: 1,464 bytes, line 1
1),W)}function co(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=lt(e,t)),n&&(r.to=lt(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),me(e,"beforeChange",e,r),e.cm&&me(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function uo(e,t,n){if(e.cm){if(!e.cm.curOp)return ti(e.cm,uo)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"))||(t=co(e,t,!0))){var r=wt&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=H(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var c=i[l];if(!(nt(c.to,s.from)<0||nt(c.from,s.to)>0)){var u=[l,1],h=nt(c.from,s.from),d=nt(c.to,s.to);(h<0||!a.inclusiveLeft&&!h)&&u.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)ho(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else ho(e,t)}}function ho(e,t){if(1!=t.text.length||""!=t.text[0]||0!=nt(t.from,t.to)){var n=Ri(e,t);Hi(e,t,n,e.cm?e.cm.curOp.id:NaN),mo(e,t,n,Ct(e,t));var r=[];
vendor: 6,365 bytes, line 1
1Ni(e,(function(e,n){n||-1!=H(r,e.history)||(xo(e.history,t),r.push(e.history)),mo(e,t,null,Ct(e,t))}))}}function po(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c<s.length&&(i=s[c],n?!i.ranges||i.equals(e.sel):i.ranges);c++);if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(Wi(i,l),n&&!i.equals(e.sel))return void eo(e,i,{clearRedo:!1});a=i}var u=[];Wi(a,l),l.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var h=ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"),d=function(n){var r=i.changes[n];if(r.origin=t,h&&!co(e,r,!1))return s.length=0,{};u.push(Fi(e,r));var o=n?Ri(e,r):K(s);mo(e,r,o,Xi(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:Ci(r)});var a=[];Ni(e,(function(e,t){t||-1!=H(a,e.history)||(xo(e.history,r),a.push(e.history)),mo(e,r,null,Xi(e,r))}))},p=i.changes.length-1;p>=0;--p){var f=d(p);if(f)return f.v}}}}function fo(e,t){if(0!=t&&(e.first+=t,e.sel=new Si(Z(e.sel.ranges,(function(e){return new Mi(tt(e.anchor.line+t,e.anchor.ch),tt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){dr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)pr(e.cm,r,"gutter")}}function mo(e,t,n,r){if(e.cm&&!e.cm.curOp)return ti(e.cm,mo)(e,t,n,r);if(t.to.line<e.first)fo(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);fo(e,i),t={from:tt(e.first,0),to:tt(t.to.line+i,t.to.ch),text:[K(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:tt(o,qe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ye(e,t.from,t.to),n||(n=Ri(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=Je(Ft(qe(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ge(e),Di(r,t,n,lr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=jt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=qe(e,r).stateAfter;if(i&&(!(i instanceof ut)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,o.line),ii(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?dr(e):o.line!=a.line||1!=t.text.length||Oi(e.doc,t)?dr(e,o.line,a.line+1,c):pr(e,o.line,"text");var u=ye(e,"changes"),h=ye(e,"change");if(h||u){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};h&&cn(e,"change",e,d),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,r):Di(e,t,r),to(e,n,W),e.cantEdit&&ao(e,tt(e.firstLine(),0))&&(e.cantEdit=!1)}}function vo(e,t,n,r,i){var o;r||(r=n),nt(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),uo(e,{from:n,to:r,text:t,origin:i})}function go(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function yo(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)go(o.ranges[s].anchor,t,n,r),go(o.ranges[s].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=tt(c.from.line+r,c.from.ch),c.to=tt(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function xo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;yo(e.done,n,r,i),yo(e.undone,n,r,i)}function bo(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=qe(e,st(e,t)):i=Je(t),null==i?null:(r(o,i)&&e.cm&&pr(e.cm,i,n),o)}function _o(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function wo(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Mi.prototype.from=function(){return at(this.anchor,this.head)},Mi.prototype.to=function(){return ot(this.anchor,this.head)},Mi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},_o.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Yt(i),cn(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},wo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var n=this;this.size-=t;for(var r=0;r<this.children.length;++r){var i=n.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e),s=i.height;if(i.removeInner(e,a),n.height-=s-i.height,o==a&&(n.children.splice(r--,1),i.parent=null),0==(t-=a))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof _o))){var l=[];this.collapse(l),this.children=[new _o(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){var r=this;this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var o=r.children[i],a=o.chunkSize();if(e<=a){if(o.insertInner(e,t,n),o.lines&&o.lines.length>50){for(var s=o.lines.length%25+25,l=s;l<o.lines.length;){var c=new _o(o.lines.slice(l,l+=25));o.height-=c.height,r.children.splice(++i,0,c),c.parent=r}o.lines=o.lines.slice(0,s),r.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new wo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=H(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new wo(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;
vendor: 2,222 bytes, line 1
1if(0==(t-=a))break;e=0}else e-=o}}};var So=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function Mo(e,t,n){Vt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Pr(e,n)}So.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Je(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=wn(this);Ze(n,Math.max(0,n.height-o)),e&&(ei(e,(function(){Mo(e,n,-o),pr(e,r,"widget")})),cn(e,"lineWidgetCleared",e,this,r))}},So.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=wn(this)-t;i&&(Ut(this.doc,r)||Ze(r,r.height+i),n&&ei(n,(function(){n.curOp.forceUpdate=!0,Mo(n,r,i),cn(n,"lineWidgetChanged",n,e,Je(r))})))},xe(So);var To=0,Eo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++To};function Co(e,t,n,r,i){if(r&&r.shared)return function(e,t,n,r,i){(r=B(r)).shared=!1;var o=[Co(e,t,n,r,i)],a=o[0],s=r.widgetNode;return Ni(e,(function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(Co(e,lt(e,t),lt(e,n),r,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=K(o)})),new Lo(o,a)}(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return ti(e.cm,Co)(e,t,n,r,i);var o=new Eo(e,i),a=nt(t,n);if(r&&B(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=P("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Bt(e,t.line,t,n,o)||t.line!=n.line&&Bt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");St=!0}o.addToHistory&&Hi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(e){c&&o.collapsed&&!c.options.lineWrapping&&Ft(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&Ze(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Mt(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Ut(e,t)&&Ze(t,0)})),o.clearOnEnter&&de(o,"beforeCursorEnter",(function(){return o.clear()}
vendor: 4,203 bytes, line 1
1)),o.readOnly&&(wt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++To,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)dr(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)pr(c,u,"text");o.atomic&&ro(c.doc),cn(c,"markerAdded",c,o)}return o}Eo.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,n=t&&!t.curOp;if(n&&qr(t),ye(this,"clear")){var r=this.find();r&&cn(this,"clear",r.from,r.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var s=e.lines[a],l=Tt(s.markedSpans,e);t&&!e.collapsed?pr(t,Je(s),"text"):t&&(null!=l.to&&(o=Je(s)),null!=l.from&&(i=Je(s))),s.markedSpans=Et(s.markedSpans,l),null==l.from&&e.collapsed&&!Ut(e.doc,s)&&t&&Ze(s,ir(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=Ft(e.lines[c]),h=jt(u);h>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=h,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&dr(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&ro(t.doc)),t&&cn(t,"markerCleared",t,this,i,o),n&&Yr(t),this.parent&&this.parent.clear()}},Eo.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Tt(o.markedSpans,this);if(null!=a.from&&(n=tt(t?o:Je(o),a.from),-1==e))return n;if(null!=a.to&&(r=tt(t?o:Je(o),a.to),1==e))return r}return n&&{from:n,to:r}},Eo.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&ei(r,(function(){var i=t.line,o=Je(t.line),a=In(r,o);if(a&&(Fn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Ut(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var l=wn(n)-s;l&&Ze(i,i.height+l)}cn(r,"markerChanged",r,e)}))},Eo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=H(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Eo.prototype.detachLine=function(e){if(this.lines.splice(H(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},xe(Eo);var Lo=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Ro(e){return e.findMarks(tt(e.first,0),e.clipPos(tt(e.lastLine())),(function(e){return e.parent}))}function Ao(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Ni(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==H(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}Lo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();cn(this,"clear")}},Lo.prototype.find=function(e,t){return this.primary.find(e,t)},xe(Lo);var Po=0,Io=function e(t,n,r,i,o){if(!(this instanceof e))return new e(t,n,r,i,o);null==r&&(r=0),wo.call(this,[new _o([new qt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var a=tt(r,0);this.sel=Ei(a),this.history=new Bi(null),this.id=++Po,this.modeOption=n,this.lineSep=i,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),Di(this,{from:a,to:a,text:t}),eo(this,Ei(a),W)};(Io.prototype=Q(wo.prototype,{constructor:Io,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ke(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ri((function(e){var t=tt(this.first,0),n=this.first+this.size-1;uo(this,{from:t,to:tt(n,qe(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Or(this.cm,0,0),eo(this,Ei(t),W)}
vendor: 9,736 bytes, line 1
1)),replaceRange:function(e,t,n,r){vo(this,e,t=lt(this,t),n=n?lt(this,n):t,r)},getRange:function(e,t,n){var r=Ye(this,lt(this,e),lt(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if($e(this,e))return qe(this,e)},getLineNumber:function(e){return Je(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=qe(this,e)),Ft(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return lt(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ri((function(e,t,n){Qi(this,lt(this,"number"==typeof e?tt(e,t||0):e),null,n)})),setSelection:ri((function(e,t,n){Qi(this,lt(this,e),lt(this,t||e),n)})),extendSelection:ri((function(e,t,n){Ki(this,lt(this,e),t&<(this,t),n)})),extendSelections:ri((function(e,t){Zi(this,ct(this,e),t)})),extendSelectionsBy:ri((function(e,t){Zi(this,ct(this,Z(this.sel.ranges,e)),t)})),setSelections:ri((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Mi(lt(this,e[i].anchor),lt(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),eo(this,Ti(this.cm,r,t),n)}})),addSelection:ri((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Mi(lt(this,e),lt(this,t||e))),eo(this,Ti(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Ye(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Ye(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:ri((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&"end"!=t&&function(e,t,n){for(var r=[],i=tt(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=Ai(s.from,i,o),c=Ai(Ci(s),i,o);if(i=s.to,o=c,"around"==n){var u=e.sel.ranges[a],h=nt(u.head,u.anchor)<0;r[a]=new Mi(h?c:l,h?l:c)}else r[a]=new Mi(l,l)}return new Si(r,e.sel.primIndex)}(this,r,t),l=r.length-1;l>=0;l--)uo(this,r[l]);s?$i(this,s):this.cm&&Ir(this.cm)})),undo:ri((function(){po(this,"undo")})),redo:ri((function(){po(this,"redo")})),undoSelection:ri((function(){po(this,"undo",!0)})),redoSelection:ri((function(){po(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new Bi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:qi(this.history.done),undone:qi(this.history.undone)}},setHistory:function(e){var t=this.history=new Bi(this.history.maxGeneration);t.done=qi(e.done.slice(0),null,!0),t.undone=qi(e.undone.slice(0),null,!0)},setGutterMarker:ri((function(e,t,n){return bo(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&ne(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:ri((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&bo(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,ne(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!$e(this,e))return null;if(t=e,!(e=qe(this,e)))return null}else if(null==(t=Je(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ri((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(T(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:ri((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(T(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:ri((function(e,t,n){return function(e,t,n,r){var i=new So(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),bo(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Ut(e,t)){var r=Vt(t)<e.scrollTop;Ze(t,t.height+wn(i)),r&&Pr(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&cn(o,"lineWidgetAdded",o,i,"number"==typeof t?t:Je(t)),i}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Co(this,lt(this,e),lt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Co(this,e=lt(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=qe(this,(e=lt(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=lt(this,e),t=lt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&i==e.line&&e.ch>=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),lt(this,tt(n,t))},indexFromPos:function(e){var t=(e=lt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Io(Ke(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Io(Ke(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(nt(o,a)){var s=Co(e,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,Ro(this)),r},unlinkDoc:function(e){var t=this;if(e instanceof La&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n)if(t.linked[n].doc==e){t.linked.splice(n,1),e.unlinkDoc(t),Ao(Ro(t));break}if(e.history==this.history){var r=[e.id];Ni(e,(function(e){return r.push(e.id)}),!0),e.history=new Bi(null),e.history.done=qi(this.history.done,r),e.history.undone=qi(this.history.undone,r)}},iterLinkedDocs:function(e){Ni(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ie(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ri((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&ei(t=this.cm,(function(){zi(t),dr(t)})))}))})).eachLine=Io.prototype.iter;var Oo=0;function Do(e){var t=this;if(No(t),!ve(t,e)&&!Sn(t.display,e)){be(e),s&&(Oo=+new Date);var n=ur(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(e,r){if(!t.options.allowDropFileTypes||-1!=H(t.options.allowDropFileTypes,e.type)){var s=new FileReader;s.onload=ti(t,(function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++a==i){var l={from:n=lt(t.doc,n),to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};uo(t.doc,l),$i(t.doc,Ei(n,Ci(l)))}})),s.readAsText(e)}},c=0;c<i;++c)l(r[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var u=e.dataTransfer.getData("Text");if(u){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),to(t.doc,Ei(n,n)),h)for(var d=0;d<h.length;++d)vo(t.doc,"",h[d].anchor,h[d].head,"drag");t.replaceSelection(u,"around","paste"),t.display.input.focus()}}catch(e){}}}}
vendor: 6,292 bytes, line 1
1function No(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ko(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var zo=!1;function Bo(){var e;zo||(de(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,ko(Fo)}),100))})),de(window,"blur",(function(){return ko(Er)})),zo=!0)}function Fo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Go={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ho=0;Ho<10;Ho++)Go[Ho+48]=Go[Ho+96]=String(Ho);for(var Uo=65;Uo<=90;Uo++)Go[Uo]=String.fromCharCode(Uo);for(var Wo=1;Wo<=12;Wo++)Go[Wo+111]=Go[Wo+63235]="F"+Wo;var Vo={};function jo(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Xo(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Z(n.split(" "),jo),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var c in t)e[c]=t[c];return e}function qo(e,t,n,r){var i=(t=Jo(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return qo(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=qo(e,t.fallthrough[o],n,r);if(a)return a}}}function Yo(e){var t="string"==typeof e?e:Go[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ko(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&"Cmd"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Zo(e,t){if(d&&34==e.keyCode&&e.char)return!1;var n=Go[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Ko(n,e,t))}function Jo(e){return"string"==typeof e?Vo[e]:e}function Qo(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&nt(o.from,K(r).to)<=0;){var a=r.pop();if(nt(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}ei(e,(function(){for(var t=r.length-1;t>=0;t--)vo(e.doc,"",r[t].from,r[t].to,"+delete");Ir(e)}))}function $o(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function ea(e,t,n){var r=$o(e,t.ch,n);return null==r?null:new tt(t.line,r,n<0?"after":"before")}function ta(e,t,n,r,i){if(e){var o=ue(n,t.doc.direction);if(o){var a,s=i<0?K(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=On(t,n);a=i<0?n.text.length-1:0;var u=Dn(t,c,a).top;a=ae((function(e){return Dn(t,c,e).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=$o(n,a,1))}else a=i<0?s.to:s.from;return new tt(r,a,l)}}return new tt(r,i<0?n.text.length:0,i<0?"before":"after")}Vo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Vo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Vo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Vo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Vo.default=x?Vo.macDefault:Vo.pcDefault;var na={selectAll:lo,singleSelection:function(e){return e.setSelection(e.getCursor("anch
1or"),e.getCursor("head"),W)},killLine:function(e){return Qo(e,(function(t){if(t.empty()){var n=qe(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:tt(t.head.line+1,0)}:{from:t.head,to:tt(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Qo(e,(function(t){return{from:tt(t.from().line,0),to:lt(e.doc,tt(t.to().line+1,0))}}))},delLineLeft:function(e){return Qo(e,(function(e){return{from:tt(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Qo(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Qo(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(tt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(tt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return ra(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ia(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=qe(e.doc,t),r=function(e){for(var t;t=kt(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=Je(r)),ta(!0,e,n,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),j)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),j)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ia(e,t.head):r}),j)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=F(e.getLine(o.line),o.ch,r);t.push(Y(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ei(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=qe(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new tt(i.line,i.ch-1)),i.ch>0)i=new tt(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),tt(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=qe(e.doc,i.line-1).text;a&&(i=new tt(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),tt(i.line-1,a.length-1),i,"+transpose"))}n.push(new Mi(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return ei(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Ir(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};
vendor: 4,894 bytes, line 1
1function ra(e,t){var n=qe(e.doc,t),r=Ft(n);return r!=n&&(t=Je(r)),ta(!0,e,r,t,1)}function ia(e,t){var n=ra(e,t.line),r=qe(e.doc,n.line),i=ue(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return tt(n.line,a?0:o,n.sticky)}return n}function oa(e,t,n){if("string"==typeof t&&!(t=na[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=U}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var aa=new G;function sa(e,t,n,r){var i=e.state.keySeq;if(i){if(Yo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:aa.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),la(e,i+" "+t,n,r))return!0}return la(e,t,n,r)}function la(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=qo(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&qo(t,e.options.extraKeys,n,e)||qo(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&cn(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(be(n),wr(e)),!!i}function ca(e,t){var n=Zo(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?sa(e,"Shift-"+n,t,(function(t){return oa(e,t,!0)}))||sa(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return oa(e,t)})):sa(e,n,t,(function(t){return oa(e,t)})))}var ua=null;function ha(e){var t=this;if(t.curOp.focus=O(),!ve(t,e)){s&&l<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=ca(t,e);d&&(ua=r?n:null,r||88!=n||De||!(x?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(C(t,"CodeMirror-crosshair"),fe(document,"keyup",n),fe(document,"mouseover",n))}D(t,"CodeMirror-crosshair"),de(document,"keyup",n),de(document,"mouseover",n)}(t)}}function da(e){16==e.keyCode&&(this.doc.sel.shift=!1),ve(this,e)}function pa(e){var t=this;if(!(Sn(t.display,e)||ve(t,e)||e.ctrlKey&&!e.altKey||x&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==ua)return ua=null,void be(e);if(!d||e.which&&!(e.which<10)||!ca(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(e,t,n){return sa(e,"'"+n+"'",t,(function(t){return oa(e,t,!0)}))}(t,e,i)||t.display.input.onKeyPress(e))}}}var fa,ma,va=function(e,t,n){this.time=e,this.pos=t,this.button=n};function ga(e){var t=this,n=t.display;if(!(ve(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,Sn(n,e))c||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!ba(t,e)){var r=ur(t,e),i=Te(e),o=r?function(e,t){var n=+new Date;return ma&&ma.compare(n,e,t)?(fa=ma=null,"triple"):fa&&fa.compare(n,e,t)?(ma=new va(n,e,t),fa=null,"double"):(fa=new va(n,e,t),ma=null,"single")}(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),sa(e,Ko(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=na[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=U}finally{e.state.suppressEdits=!1}return r}))}(t,i,r,o,e)||(1==i?r?function(e,t,n,r){s?setTimeout(z(Sr,e),0):e.curOp.focus=O();var i,o=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=x?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(x?n.altKey:n.ctrlKey)),i}(e,n,r),a=e.doc.sel;e.options.dragDrop&&Le&&!e.isReadOnly()&&"single"==n&&(i=a.contains(t))>-1&&(nt((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(nt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,a=ti(e,(function(t){c&&(i.scroller.draggable=!1),e.state.draggingText=!1,fe(i.wrapper.ownerDocument,"mouseup",a),fe(i.wrapper.ownerDocument,"mousemove",u),fe(i.scroller,"dragstart",h),fe(i.scroller,"drop",a),o||(be(t),r.addNew||Ki(e.doc,n,null,null,r.extend),c||s&&9==l?setTimeout((function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()}),20):i.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return o=!0};c&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),de(i.wrapper.ownerDocument,"mouseup",a),de(i.wrapper.ownerDocument,"mousemove",u),de(i.scroller,"dragstart",h),de(i.scroller,"drop",a),Mr(e),setTimeout((function(){return i.input.focus()}),20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;be(t);var a,s,l=o.sel,c=l.ranges;
vendor: 10,058 bytes, line 1
1if(r.addNew&&!r.extend?(s=o.sel.contains(n),a=s>-1?c[s]:new Mi(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new Mi(n,n)),n=ur(e,t,!0,!0),s=-1;else{var u=ya(e,n,r.unit);a=r.extend?Yi(a,u.anchor,u.head,r.extend):u}r.addNew?-1==s?(s=c.length,eo(o,Ti(e,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==r.unit&&!r.extend?(eo(o,Ti(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Ji(o,s,a,V):(s=0,eo(o,new Si([a],0),V),l=o.sel);var h=n;function d(t){if(0!=nt(h,t))if(h=t,"rectangle"==r.unit){for(var i=[],c=e.options.tabSize,u=F(qe(o,n.line).text,n.ch,c),d=F(qe(o,t.line).text,t.ch,c),p=Math.min(u,d),f=Math.max(u,d),m=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=v;m++){var g=qe(o,m).text,y=X(g,p,c);p==f?i.push(new Mi(tt(m,y),tt(m,y))):g.length>y&&i.push(new Mi(tt(m,y),tt(m,X(g,f,c))))}i.length||i.push(new Mi(n,n)),eo(o,Ti(e,l.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x,b=a,_=ya(e,t,r.unit),w=b.anchor;nt(_.anchor,w)>0?(x=_.head,w=at(b.from(),_.anchor)):(x=_.anchor,w=ot(b.to(),_.head));var S=l.ranges.slice(0);S[s]=function(e,t){var n=t.anchor,r=t.head,i=qe(e.doc,n.line);if(0==nt(n,r)&&n.sticky==r.sticky)return t;var o=ue(i);if(!o)return t;var a=le(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=le(o,r.ch,r.sticky),h=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?h<0:h>0}var d=o[c+(l?-1:0)],p=l==(1==d.level),f=p?d.from:d.to,m=p?"after":"before";return n.ch==f&&n.sticky==m?t:new Mi(new tt(n.line,f,m),r)}(e,new Mi(lt(o,w),x)),eo(o,Ti(e,S,s),V)}}var p=i.wrapper.getBoundingClientRect(),f=0;function m(t){var n=++f,a=ur(e,t,!0,"rectangle"==r.unit);if(a)if(0!=nt(a,h)){e.curOp.focus=O(),d(a);var s=Rr(i,o);(a.line>=s.to||a.line<s.from)&&setTimeout(ti(e,(function(){f==n&&m(t)})),150)}else{var l=t.clientY<p.top?-20:t.clientY>p.bottom?20:0;l&&setTimeout(ti(e,(function(){f==n&&(i.scroller.scrollTop+=l,m(t))})),50)}}function v(t){e.state.selectingText=!1,f=1/0,t&&(be(t),i.input.focus()),fe(i.wrapper.ownerDocument,"mousemove",g),fe(i.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var g=ti(e,(function(e){0!==e.buttons&&Te(e)?m(e):v(e)})),y=ti(e,v);e.state.selectingText=y,de(i.wrapper.ownerDocument,"mousemove",g),de(i.wrapper.ownerDocument,"mouseup",y)}(e,r,t,o)}(t,r,o,e):Me(e)==n.scroller&&be(e):2==i?(r&&Ki(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(M?t.display.input.onContextMenu(e):Mr(t)))}}function ya(e,t,n){if("char"==n)return new Mi(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Mi(tt(t.line,0),lt(e.doc,tt(t.line+1,0)));var r=n(e,t);return new Mi(r.from,r.to)}function xa(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&be(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!ye(e,n))return we(t);o-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i)return me(e,n,e,Qe(e.doc,o),e.display.gutterSpecs[l].className,t),we(t)}}function ba(e,t){return xa(e,t,"gutterClick",!0)}function _a(e,t){Sn(e.display,t)||function(e,t){return!!ye(e,"gutterContextMenu")&&xa(e,t,"gutterContextMenu",!1)}(e,t)||ve(e,t,"contextmenu")||M||e.display.input.onContextMenu(t)}function wa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hn(e)}va.prototype.compare=function(e,t,n){return this.time+400>e&&0==nt(t,this.pos)&&n==this.button};var Sa={toString:function(){return"CodeMirror.Init"}},Ma={},Ta={};function Ea(e,t,n){if(!t!=!(n&&n!=Sa)){var r=e.display.dragFunctions,i=t?de:fe;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Ca(e){e.options.lineWrapping?(D(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(C(e.display.wrapper,"CodeMirror-wrap"),Xt(e)),cr(e),dr(e),Hn(e),setTimeout((function(){return Ur(e)}),100)}function La(e,t){var n=this;if(!(this instanceof La))return new La(e,t);this.options=t=t?B(t):{},B(Ma,t,!1);var r=t.value;"string"==typeof r?r=new Io(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new La.inputStyles[t.inputStyle](this),o=this.display=new gi(e,r,i,t);for(var a in o.wrapper.CodeMirror=this,wa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),jr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new G,keySeq:null,specialChars:null},t.autofocus&&!y&&o.input.focus(),s&&l<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;de(t.scroller,"mousedown",ti(e,ga)),de(t.scroller,"dblclick",s&&l<11?ti(e,(function(t){if(!ve(e,t)){var n=ur(e,t);if(n&&!ba(e,t)&&!Sn(e.display,t)){be(t);var r=e.findWordAt(n);Ki(e.doc,r.anchor,r.head)}}})):function(t){return ve(e,t)||be(t)}),de(t.scroller,"contextmenu",(function(t){return _a(e,t)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function a(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}de(t.scroller,"touchstart",(function(i){if(!ve(e,i)&&!o(i)&&!ba(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),de(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),de(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Sn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,s=e.coordsChar(t.activeTouch,"page");o=!r.prev||a(r,r.prev)?new Mi(s,s):!r.prev.prev||a(r,r.prev.prev)?e.findWordAt(s):new Mi(tt(s.line,0),lt(e.doc,tt(s.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),be(n)}i()})),de(t.scroller,"touchcancel",i),de(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(kr(e,t.scroller.scrollTop),Br(e,t.scroller.scrollLeft,!0),me(e,"scroll",e))})),de(t.scroller,"mousewheel",(function(t){return wi(e,t)})),de(t.scroller,"DOMMouseScroll",(function(t){return wi(e,t)})),de(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ve(e,t)||Se(t)},over:function(t){ve(e,t)||(function(e,t){var n=ur(e,t);if(n){var r=document.createDocumentFragment();xr(e,n,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),R(e.display.dragCursor,r)}}(e,t),Se(t))},start:function(t){return function(e,t){if(s&&(!e.state.draggingText||+new Date-Oo<100))Se(t);else if(!ve(e,t)&&!Sn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(e,t)},drop:ti(e,Do),leave:function(t){ve(e,t)||No(e)}};var c=t.input.getField();de(c,"keyup",(function(t){return da.call(e,t)})),de(c,"keydown",ti(e,ha)),de(c,"keypress",ti(e,pa)),de(c,"focus",(function(t){return Tr(e,t)})),de(c,"blur",(function(t){return Er(e,t)}))}(this),Bo(),qr(this),this.curOp.forceUpdate=!0,ki(this,r),t.autofocus&&!y||this.hasFocus()?setTimeout(z(Tr,this),20):Er(this),Ta)Ta.hasOwnProperty(a)&&Ta[a](n,t[a],Sa);pi(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Ra.length;++u)Ra[u](n);Yr(this),c&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}La.defaults=Ma,La.optionHandlers=Ta;var Ra=[];function Aa(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=ft(e,t).state:n="prev");var a=e.options.tabSize,s=qe(o,t),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==U||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?F(qe(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var h="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,h+="\t";if(d<c&&(h+=Y(c-d)),h!=u)return vo(o,h,tt(t,0),tt(t,u.length),"+input"),s.stateAfter=null,!0;for(var f=0;f<o.sel.ranges.length;f++){var m=o.sel.ranges[f];if(m.head.line==t&&m.head.ch<u.length){var v=tt(t,u.length);Ji(o,f,new Mi(v,v));break}}}La.defineInitHook=function(e){return Ra.push(e)};var Pa=null;function Ia(e){Pa=e}function Oa(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,s="paste"==i||e.state.pasteIncoming>a,l=Ie(t),c=null;if(s&&r.ranges.length>1)if(Pa&&Pa.text.join("\n")==t){if(r.ranges.length%Pa.text.length==0){c=[];for(var u=0;u<Pa.text.length;u++)c.push(o.splitLines(Pa.text[u]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=Z(l,(function(e){return[e]})));for(var h=e.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var p=r.ranges[d],f=p.from(),m=p.to();p.empty()&&(n&&n>
vendor: 9,256 bytes, line 1
10?f=tt(f.line,f.ch-n):e.state.overwrite&&!s?m=tt(m.line,Math.min(qe(o,m.line).text.length,m.ch+K(l).length)):s&&Pa&&Pa.lineWise&&Pa.text.join("\n")==t&&(f=m=tt(f.line,0)));var v={from:f,to:m,text:c?c[d%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};uo(e.doc,v),cn(e,"inputRead",e,v)}t&&!s&&Na(e,t),Ir(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Da(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||ei(t,(function(){return Oa(t,n,0,null,"paste")})),!0}function Na(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=Aa(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(qe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Aa(e,i.head.line,"smart"));a&&cn(e,"electricInput",e,i.head.line)}}}function ka(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:tt(i,0),head:tt(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function za(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ba(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return c?e.style.width="1000px":e.setAttribute("wrap","off"),v&&(e.style.border="1px solid black"),za(e),t}function Fa(e,t,n,r,i){var o=t,a=n,s=qe(e,t.line);function l(r){var o,a;if(null==(o=i?function(e,t,n,r){var i=ue(t,e.doc.direction);if(!i)return ea(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=le(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return ea(t,n,r);var s,l=function(e,n){return $o(t,e instanceof tt?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(s=s||On(e,t),$n(e,t,s,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var h=1==a.level==r<0,d=l(n,h?1:-1);if(null!=d&&(h?d<=a.to&&d<=u.end:d>=a.from&&d>=u.begin)){var p=h?"before":"after";return new tt(n.line,d,p)}}var f=function(e,t,r){for(var o=function(e,t){return t?new tt(n.line,l(e,1),"before"):new tt(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],s=t>0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c<a.to)return o(c,s);if(c=s?a.from:l(a.to,-1),r.begin<=c&&c<r.end)return o(c,s)}},m=f(o+r,r,u);if(m)return m;var v=r>0?u.end:l(u.begin,-1);return null==v||r>0&&v==t.text.length||!(m=f(r>0?0:i.length-1,r,c(v)))?null:m}(e.cm,s,t,n):ea(s,t,n))){if(r||(a=t.line+n)<e.first||a>=e.first+e.size||(t=new tt(a,t.ch,t.sticky),!(s=qe(e,a))))return!1;t=ta(i,e.cm,s,t.line,n)}else t=o;return!0}if("char"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var c=null,u="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(n<0)||l(!d);d=!1){var p=s.text.charAt(t.ch)||"\n",f=te(p,h)?"w":u&&"\n"==p?"n":!u||/\s/.test(p)?null:"p";if(!u||d||f||(f="s"),c&&c!=f){n<0&&(n=1,l(),t.sticky="after");break}if(f&&(c=f),n>0&&!l(!d))break}var m=ao(e,t,o,a,!0);return rt(o,m)&&(m.hitSide=!0),m}function Ga(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*ir(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Jn(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Ha=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new G,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ua(e,t){var n=In(e,t.line);if(!n||n.hidden)return null;var r=qe(e.doc,t.line),i=An(n,r,t.line),o=ue(r,e.doc.direction),a="left";o&&(a=le(o,t.ch)%2?"right":"left");var s=zn(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Wa(e,t){return t&&(e.bad=!0),e}function Va(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Wa(e.clipPos(tt(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return ja(o,t,n)}}function ja(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!I(r,t))return Wa(tt(Je(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?K(e.rest):e.line;return Wa(tt(Je(o),o.text.length),i)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?l.map:c[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==n){var u=Je(i<0?e.line:e.rest[i]),h=o[a]+r;return(r<0||s!=t)&&(h=o[a+(r?1:0)]),tt(u,h)}}}var h=u(a,s,n);if(h)return Wa(h,i);for(var d=s.nextSibling,p=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(h=u(d,d.firstChild,0))return Wa(tt(h.line,h.ch-p),i);p+=d.textContent.length}for(var f=s.previousSibling,m=n;f;f=f.previousSibling){if(h=u(f,f.firstChild,-1))return Wa(tt(h.line,h.ch+m),i);m+=f.textContent.length}}Ha.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){if(!ve(r,e)){if(r.somethingSelected())Ia({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=ka(r);Ia({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,W),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var o=Pa.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=Ba(),s=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=Pa.text.join("\n");var l=document.activeElement;k(s),setTimeout((function(){r.display.lineSpace.removeChild(a),l.focus(),l==i&&n.showPrimarySelection()}),50)}}za(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),de(i,"paste",(function(e){ve(r,e)||Da(e,r)||l<=11&&setTimeout(ti(r,(function(){return t.updateFromDOM()})),20)})),de(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),de(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),de(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),de(i,"touchstart",(function(){return n.forceCompositionEnd()})),de(i,"input",(function(){t.composing||t.readFromDOMSoon()})),de(i,"copy",o),de(i,"cut",o)},Ha.prototype.prepareSelection=function(){var e=yr(this.cm,!1);return e.focus=this.cm.state.focused,e},Ha.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ha.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ha.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=Va(t,e.anchorNode,e.anchorOffset),s=Va(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=nt(at(a,s),i)||0!=nt(ot(a,s),o)){var l=t.display.view,c=i.line>=t.display.viewFrom&&Ua(t,i)||{node:l[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&Ua(t,o);if(!u){var h=l[l.length-1].measure,d=h.maps?h.maps[h.maps.length-1]:h.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(c&&u){var p,f=e.rangeCount&&e.getRangeAt(0);try{p=E(c.node,c.offset,u.offset,u.node)}catch(e){}p&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),f&&null==e.anchorNode?e.addRange(f):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ha.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Ha.prototype.showMultipleSelections=function(e){R(this.cm.display.cursorDiv,e.cursors),R(this.cm.display.selectionDiv,e.selection)},Ha.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ha.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return I(this.div,t)}
vendor: 2,779 bytes, line 1
1,Ha.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ha.prototype.blur=function(){this.div.blur()},Ha.prototype.getField=function(){return this.div},Ha.prototype.supportsTouch=function(){return!0},Ha.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():ei(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Ha.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ha.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&h&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Va(t,e.anchorNode,e.anchorOffset),r=Va(t,e.focusNode,e.focusOffset);n&&r&&ei(t,(function(){eo(t.doc,Ei(n,r),W),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Ha.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=tt(a.line-1,qe(r.doc,a.line-1).length)),s.ch==qe(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=tt(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=hr(r,a.line))?(t=Je(i.view[0].line),n=i.view[0].node):(t=Je(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,c,u=hr(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=Je(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var h=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(e){return function(t){return t.id==e}}function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function h(e){e&&(u(),o+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void h(n);var o,p=t.getAttribute("cm-marker");if(p){var f=e.findMarks(tt(r,0),tt(i+1,0),c(+p));return void(f.length&&(o=f[0].find(0))&&h(Ye(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;
vendor: 4,665 bytes, line 1
1m&&u();for(var v=0;v<t.childNodes.length;v++)d(t.childNodes[v]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),m&&(a=!0)}else 3==t.nodeType&&h(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;d(t),t!=n;)t=t.nextSibling,l=!1;return o}(r,n,c,t,l)),d=Ye(r.doc,tt(t,0),tt(l,qe(r.doc,l).text.length));h.length>1&&d.length>1;)if(K(h)==K(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),t++}for(var p=0,f=0,m=h[0],v=d[0],g=Math.min(m.length,v.length);p<g&&m.charCodeAt(p)==v.charCodeAt(p);)++p;for(var y=K(h),x=K(d),b=Math.min(y.length-(1==h.length?p:0),x.length-(1==d.length?p:0));f<b&&y.charCodeAt(y.length-f-1)==x.charCodeAt(x.length-f-1);)++f;if(1==h.length&&1==d.length&&t==a.line)for(;p&&p>a.ch&&y.charCodeAt(y.length-f-1)==x.charCodeAt(x.length-f-1);)p--,f++;h[h.length-1]=y.slice(0,y.length-f).replace(/^\u200b+/,""),h[0]=h[0].slice(p).replace(/\u200b+$/,"");var _=tt(t,p),w=tt(l,d.length?K(d).length-f:0);return h.length>1||h[0]||nt(_,w)?(vo(r.doc,h,_,w,"+input"),!0):void 0},Ha.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ha.prototype.reset=function(){this.forceCompositionEnd()},Ha.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ha.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Ha.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||ei(this.cm,(function(){return dr(e.cm)}))},Ha.prototype.setUneditable=function(e){e.contentEditable="false"},Ha.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ti(this.cm,Oa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ha.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ha.prototype.onContextMenu=function(){},Ha.prototype.resetPosition=function(){},Ha.prototype.needsContentAttribute=!0;var Xa=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new G,this.hasSelection=!1,this.composing=null};Xa.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ve(r,e)){if(r.somethingSelected())Ia({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=ka(r);Ia({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,W):(n.prevInput="",i.value=t.text.join("\n"),k(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),v&&(i.style.width="0px"),de(i,"input",(function(){s&&l>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),de(i,"paste",(function(e){ve(r,e)||Da(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),de(i,"cut",o),de(i,"copy",o),de(e.scroller,"paste",(function(t){if(!Sn(e,t)&&!ve(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),de(e.lineSpace,"selectstart",(function(t){Sn(e,t)||be(t)})),de(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),de(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Xa.prototype.createField=function(e){this.wrapper=Ba(),this.textarea=this.wrapper.firstChild},Xa.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=yr(e);if(e.options.moveInputWithCursor){var i=Yn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Xa.prototype.showSelection=function(e){var t=this.cm.display;R(t.cursorDiv,e.cursors),R(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Xa.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&k(this.textarea),s&&l>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&l>=9&&(this.hasSelection=null))}},Xa.prototype.getField=function(){return this.textarea},Xa.prototype.supportsTouch=function(){return!1}
vendor: 15,918 bytes, line 1
1,Xa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||O()!=this.textarea))try{this.textarea.focus()}catch(e){}},Xa.prototype.blur=function(){this.textarea.blur()},Xa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Xa.prototype.receivedFocus=function(){this.slowPoll()},Xa.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Xa.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Xa.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Oe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(s&&l>=9&&this.hasSelection===i||x&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="â"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,c=Math.min(r.length,i.length);a<c&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return ei(t,(function(){Oa(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Xa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Xa.prototype.onKeyPress=function(){s&&l>=9&&(this.hasSelection=null),this.fastPoll()},Xa.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=ur(n,e),a=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ti(n,eo)(n.doc,Ei(o),W);var u,h=i.style.cssText,p=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",c&&(u=window.scrollY),r.input.focus(),c&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),s&&l>=9&&m(),M?(Se(e),de(window,"mouseup",(function e(){fe(window,"mouseup",e),setTimeout(v,20)}))):setTimeout(v,50)}function m(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="â"+(e?i.value:"");i.value="â",i.value=o,t.prevInput=e?"":"â",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=h,s&&l<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),null!=i.selectionStart)){(!s||s&&l<9)&&m();var e=0;r.detectingSelectAll=setTimeout((function o(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"â"==t.prevInput?ti(n,lo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())}),200)}}},Xa.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Xa.prototype.setUneditable=function(){},Xa.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Sa&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Sa,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Pi(e)}),!0),n("indentUnit",2,Pi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Ii(e),Hn(e),dr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(tt(r,o))}r++}));for(var i=n.length-1;i>=0;i--)vo(e.doc,t,n[i],tt(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Sa&&e.refresh()})),n("specialCharPlaceholder",$t,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!_),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){wa(e),vi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Jo(t),i=n!=Sa&&Jo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ca,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=fi(t,e.options.lineNumbers),vi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?sr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Ur(e)}),!0),n("scrollbarStyle","native",(function(e){jr(e),Ur(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=fi(e.options.gutters,t),vi(e)}),!0),n("firstLineNumber",1,vi,!0),n("lineNumberFormatter",(function(e){return e}),vi,!0),n("showCursorWhenSelecting",!1,gr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Er(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Ea),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gr,!0),n("singleCursorHeightPerLine",!0,gr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ii,!0),n("addModeClass",!1,Ii,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Ii,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(La),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ti(this,t[e])(this,n,i),me(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Jo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:ni((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,dr(this)})),removeOverlay:ni((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void dr(this)}})),indentLine:ni((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),$e(this.doc,e)&&Aa(this,e,t,n)})),indentSelection:ni((function(e){for(var t=this,n=this.doc.sel.ranges,r=-1,i=0;i<n.length;i++){var o=n[i];if(o.empty())o.head.line>r&&(Aa(t,o.head.line,e,!0),r=o.head.line,i==t.doc.sel.primIndex&&Ir(t));else{var a=o.from(),s=o.to(),l=Math.max(r,a.line);r=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1;for(var c=l;c<r;++c)Aa(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&n.length==u.length&&u[i].from().ch>0&&Ji(t.doc,i,new Mi(a,u[i].to()),W)}}})),getTokenAt:function(e,t){return xt(this,e,t)},getLineTokens:function(e,t){return xt(this,tt(e),t,!0)},getTokenTypeAt:function(e){e=lt(this.doc,e);var t,n=pt(this,qe(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var s=i[o[t][a]];s&&r.push(s)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var l=0;l<i._global.length;l++){var c=i._global[l];c.pred(o,this)&&-1==H(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return ft(this,(e=st(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Yn(this,null==e?n.head:"object"==(0,i.default)(e)?lt(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return qn(this,lt(this.doc,e),t||"page")},coordsChar:function(e,t){return Jn(this,(e=Xn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Xn(this,{top:e,left:0},t||"page").top,Qe(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=qe(this.doc,e)}else r=e;return jn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Vt(r):0)},defaultTextHeight:function(){return ir(this.display)},defaultCharWidth:function(){return or(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,a,s,l=this.display,c=(e=Yn(this,lt(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var h=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(c=e.bottom),u+t.offsetWidth>d&&(u=d-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(o=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(s=Ar(o,a)).scrollTop&&kr(o,s.scrollTop),null!=s.scrollLeft&&Br(o,s.scrollLeft))},triggerOnKeyDown:ni(ha),triggerOnKeyPress:ni(pa),triggerOnKeyUp:da,triggerOnMouseDown:ni(ga),execCommand:function(e){if(na.hasOwnProperty(e))return na[e].call(null,this)},triggerElectric:ni((function(e){Na(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=lt(this.doc,e),a=0;a<t&&!(o=Fa(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:ni((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Fa(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),j)})),deleteH:ni((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Qo(this,(function(n){var i=Fa(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=lt(this.doc,e),s=0;s<t;++s){var l=Yn(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Ga(this,l,i,n)).hitSide)break}return a},moveV:ni((function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var s=Yn(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var l=Ga(n,s,e,t);return"page"==t&&a==r.sel.primary()&&Pr(n,qn(n,l,"div").top-s.top),l}),j),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(e){var t=qe(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),a=te(o,i)?function(e){return te(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};n>0&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new Mi(tt(e.line,n),tt(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?D(this.display.cursorDiv,"CodeMirror-overwrite"):C(this.display.cursorDiv,"CodeMirror-overwrite"),me(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==O()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ni((function(e,t){Or(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Cn(this)-this.display.barHeight,width:e.scrollWidth-Cn(this)-this.display.barWidth,clientHeight:Rn(this),clientWidth:Ln(this)}},scrollIntoView:ni((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:tt(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Dr(e),e.curOp.scrollToPos=t}(this,e):Nr(this,e.from,e.to,e.margin)})),setSize:ni((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Gn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){pr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,me(this,"refresh",this)})),operation:function(e){return ei(this,e)},startOperation:function(){return qr(this)},endOperation:function(){return Yr(this)},refresh:ni((function(){var e=this.display.cachedTextHeight;dr(this),this.curOp.forceUpdate=!0,Hn(this),Or(this,this.doc.scrollLeft,this.doc.scrollTop),ui(this.display),(null==e||Math.abs(e-ir(this.display))>.5)&&cr(this),me(this,"refresh",this)})),swapDoc:ni((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),ki(this,e),Hn(this),this.display.input.reset(),Or(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,cn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}}
1,xe(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(La);var qa="iter insert remove copy getEditor constructor".split(" ");for(var Ya in Io.prototype)Io.prototype.hasOwnProperty(Ya)&&H(qa,Ya)<0&&(La.prototype[Ya]=function(e){return function(){return e.apply(this.doc,arguments)}}(Io.prototype[Ya]));return xe(Io),La.inputStyles={textarea:Xa,contenteditable:Ha},La.defineMode=function(e){La.defaults.mode||"null"==e||(La.defaults.mode=e),Be.apply(this,arguments)},La.defineMIME=function(e,t){ze[e]=t},La.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),La.defineMIME("text/plain","null"),La.defineExtension=function(e,t){La.prototype[e]=t},La.defineDocExtension=function(e,t){Io.prototype[e]=t},La.fromTextArea=function(e,t){if((t=t?B(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=O();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(de(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(fe(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=La((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=fe,e.on=de,e.wheelEventPixels=_i,e.Doc=Io,e.splitLines=Ie,e.countColumn=F,e.findColumn=X,e.isWordChar=ee,e.Pass=U,e.signal=me,e.Line=qt,e.changeEnd=Ci,e.scrollbarModel=Vr,e.Pos=tt,e.cmpPos=nt,e.modes=ke,e.mimeModes=ze,e.resolveMode=Fe,e.getMode=Ge,e.modeExtensions=He,e.extendMode=Ue,e.copyState=We,e.startState=je,e.innerMode=Ve,e.commands=na,e.keyMap=Vo,e.keyName=Zo,e.isModifierKey=Yo,e.lookupKey=qo,e.normalizeKeyMap=Xo,e.StringStream=Xe,e.SharedTextMarker=Lo,e.TextMarker=Eo,e.LineWidget=So,e.e_preventDefault=be,e.e_stopPropagation=_e,e.e_stop=Se,e.addClass=D,e.contains=I,e.rmClass=C,e.keyNames=Go}(La),La.version="5.49.2",La},"object"===(void 0===n?"undefined":(0,i.default)(n))&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(void 0).CodeMirror=r()},{"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":19}],28:[function(e,t,n){"use strict";var r,i=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof"));r=function(e){function t(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.info=r,this.align=i,this.prev=o}function n(e,n,r,i){var o=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=r&&(o=e.context.indented),e.context=new t(o,n,r,i,null,e.context)}function r(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}
1"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function i(e,t,n){return"variable"==t.prevToken||"type"==t.prevToken||!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0}function o(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function a(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function s(e,t){return"function"==typeof e?e(t):e.propertyIsEnumerable(t)}e.defineMode("clike",(function(a,l){var c,u,h=a.indentUnit,d=l.statementIndentUnit||h,p=l.dontAlignCalls,f=l.keywords||{},m=l.types||{},v=l.builtin||{},g=l.blockKeywords||{},y=l.defKeywords||{},x=l.atoms||{},b=l.hooks||{},_=l.multiLineStrings,w=!1!==l.indentStatements,S=!1!==l.indentSwitch,M=l.namespaceSeparator,T=l.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,E=l.numberStart||/[\d\.]/,C=l.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,L=l.isOperatorChar||/[+\-*&%=<>!?|\/]/,R=l.isIdentifierChar||/[\w\$_\xa1-\uffff]/,A=l.isReservedIdentifier||!1;function P(e,t){var n,r=e.next();if(b[r]){var i=b[r](e,t);if(!1!==i)return i}if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){for(var r,i=!1,o=!1;null!=(r=e.next());){if(r==n&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i&&!_)&&(t.tokenize=null),"string"}),t.tokenize(e,t);if(T.test(r))return c=r,null;if(E.test(r)){if(e.backUp(1),e.match(C))return"number";e.next()}if("/"==r){if(e.eat("*"))return t.tokenize=I,I(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(L.test(r)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(L););return"operator"}if(e.eatWhile(R),M)for(;e.match(M);)e.eatWhile(R);var o=e.current();return s(f,o)?(s(g,o)&&(c="newstatement"),s(y,o)&&(u=!0),"keyword"):s(m,o)?"type":s(v,o)||A&&A(o)?(s(g,o)&&(c="newstatement"),"builtin"):s(x,o)?"atom":"variable"}function I(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function O(e,t){l.typeFirstDefinitions&&e.eol()&&o(t.context)&&(t.typeAtEndOfLine=i(e,t,e.pos))}return{startState:function(e){return{tokenize:null,context:new t((e||0)-h,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var a=t.context;if(e.sol()&&(null==a.align&&(a.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return O(e,t),null;c=u=null;var s=(t.tokenize||P)(e,t);if("comment"==s||"meta"==s)return s;if(null==a.align&&(a.align=!0),";"==c||":"==c||","==c&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)r(t);else if("{"==c)n(t,e.column(),"}");else if("["==c)n(t,e.column(),"]");else if("("==c)n(t,e.column(),")");else if("}"==c){for(;"statement"==a.type;)a=r(t);for("}"==a.type&&(a=r(t));"statement"==a.type;)a=r(t)}else c==a.type?r(t):w&&(("}"==a.type||"top"==a.type)&&";"!=c||"statement"==a.type&&"newstatement"==c)&&n(t,e.column(),"statement",e.current());if("variable"==s&&("def"==t.prevToken||l.typeFirstDefinitions&&i(e,t,e.start)&&o(t.context)&&e.match(/^\s*\(/,!1))&&(s="def"),b.token){var h=b.token(e,t,s);void 0!==h&&(s=h)}return"def"==s&&!1===l.styleDefs&&(s="variable"),t.startOfLine=!1,t.prevToken=u?"def":s||c,O(e,t),s},indent:function(t,n){if(t.tokenize!=P&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var r=t.context,i=n&&n.charAt(0),o=i==r.type;if("statement"==r.type&&"}"==i&&(r=r.prev),l.dontIndentStatements)for(;"statement"==r.type&&l.dontIndentStatements.test(r.info);)r=r.prev;if(b.indent){var a=b.indent(t,r,n,h);if("number"==typeof a)return a}var s=r.prev&&"switch"==r.prev.info;if(l.allmanIndentation&&/[{(]/.test(i)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==i?0:d):!r.align||p&&")"==r.type?")"!=r.type||o?r.indented+(o?0:h)+(o||!s||/^(?:case|default)\b/.test(n)?0:h):r.indented+d:r.column+(o?0:1)},electricInput:S?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}}));var l="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",c="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_
1cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",u="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",h="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",d=a("int long char short double float unsigned signed void bool"),p=a("SEL instancetype id Class Protocol BOOL");function f(e){return s(d,e)||/.+_t$/.test(e)}function m(e){return f(e)||s(p,e)}var v="case do else for if switch while struct enum union",g="struct enum union";function y(e,t){if(!t.startOfLine)return!1;for(var n,r=null;n=e.peek();){if("\\"==n&&e.match(/^.$/)){r=y;break}if("/"==n&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=r,"meta"}function x(e,t){return"type"==t.prevToken&&"type"}function b(e){return!(!e||e.length<2||"_"!=e[0]||"_"!=e[1]&&e[1]===e[1].toLowerCase())}function _(e){return e.eatWhile(/[\w\.']/),"number"}function w(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);return!!n&&(t.cpp11RawStringDelim=n[1],t.tokenize=T,T(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function S(e){var t=/(\w+)::~?(\w+)$/.exec(e);return t&&t[1]==t[2]}function M(e,t){for(var n;null!=(n=e.next());)if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function T(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return e.match(new RegExp(".*?\\)"+n+'"'))?t.tokenize=null:e.skipToEnd(),"string"}function E(t,n){"string"==typeof t&&(t=[t]);var r=[];function i(e){if(e)for(var t in e)e.hasOwnProperty(t)&&r.push(t)}i(n.keywords),i(n.types),i(n.builtin),i(n.atoms),r.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],r));for(var o=0;o<t.length;++o)e.defineMIME(t[o],n)}function C(e,t){for(var n=!1;!e.eol();){if(!n&&e.match('"""')){t.tokenize=null;break}n="\\"==e.next()&&!n}return"string"}function L(e){return function(t,n){for(var r;r=t.next();){if("*"==r&&t.eat("/")){if(1==e){n.tokenize=null;break}return n.tokenize=L(e-1),n.tokenize(t,n)}if("/"==r&&t.eat("*"))return n.tokenize=L(e+1),n.tokenize(t,n)}return"comment"}}E(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:a(l),types:f,blockKeywords:a(v),defKeywords:a(g),typeFirstDefinitions:!0,atoms:a("NULL true false"),isReservedIdentifier:b,hooks:{"#":y,"*":x},modeProps:{fold:["brace","include"]}}),E(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:a(l+" "+c),types:f,blockKeywords:a(v+" class try catch"),defKeywords:a(g+" class namespace"),typeFirstDefinitions:!0,atoms:a("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:b,hooks:{"#":y,"*":x,u:w,U:w,L:w,R:w,0:_,1:_,2:_,3:_,4:_,5:_,6:_,7:_,8:_,9:_,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&S(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),E("text/x-java",{name:"clike",keywords:a("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:a("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:a("catch class do else finally for if switch try while"),defKeywords:a("class interface enum @interface"),typeFirstDefinitions:!0,atoms:a("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return!e.match("interface",!1)&&(e.eatWhile(/[\w\$_]/),"meta")}},modeProps:{fold:["brace","import"]}
vendor: 8,428 bytes, line 1
1}),E("text/x-csharp",{name:"clike",keywords:a("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:a("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:a("catch class do else finally for foreach if struct switch try while"),defKeywords:a("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=M,M(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),E("text/x-scala",{name:"clike",keywords:a("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:a("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:a("catch class enum do else finally for forSome if match switch try while"),defKeywords:a("class enum def object package trait type val var"),atoms:a("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=C,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,n){var r=n.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(n.context=new t(r.indented,r.column,r.type,r.info,null,r.prev),"operator")},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=L(1),t.tokenize(e,t))}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}}),E("text/x-kotlin",{name:"clike",keywords:a("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:a("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:a("catch class do else finally for if where try while enum"),defKeywords:a("class val var object interface fun"),atoms:a("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,t){return"."==t.prevToken?"variable":"operator"},'"':function(e,t){var n;return t.tokenize=(n=e.match('""'),function(e,t){for(var r,i=!1,o=!1;!e.eol();){if(!n&&!i&&e.match('"')){o=!0;break}if(n&&e.match('"""')){o=!0;break}r=e.next(),!i&&"$"==r&&e.match("{")&&e.skipTo("}"),i=!i&&"\\"==r&&!n}return!o&&n||(t.tokenize=null),"string"}),t.tokenize(e,t)},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=L(1),t.tokenize(e,t))},indent:function(e,t,n,r){var i=n&&n.charAt(0);return"}"!=e.prevToken&&")"!=e.prevToken||""!=n?"operator"==e.prevToken&&"}"!=n&&"}"!=e.context.type||"variable"==e.prevToken&&"."==i||("}"==e.prevToken||")"==e.prevToken)&&"."==i?2*r+t.indented:t.align&&"}"==t.type?t.indented+(e.context.type==(n||"").charAt(0)?0:r):void 0:e.indented}},modeProps:{closeBrackets:{triples:'"'}}}),E(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:a("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:a("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:a("for while do if else struct"),builtin:a("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:a("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":y},modeProps:{fold:["brace","include"]}}),E("text/x-nesc",{name:"clike",keywords:a(l+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:f,blockKeywords:a(v),atoms:a("null true false"),hooks:{"#":y},modeProps:{fold:["brace","include"]}}),E("text/x-objectivec",{name:"clike",keywords:a(l+" "+u),types:m,builtin:a(h),blockKeywords:a(v+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:a(g+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:a("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:b,hooks:{"#":y,"*":
1x},modeProps:{fold:["brace","include"]}}),E("text/x-objectivec++",{name:"clike",keywords:a(l+" "+u+" "+c),types:m,builtin:a(h),blockKeywords:a(v+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:a(g+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:a("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:b,hooks:{"#":y,"*":x,u:w,U:w,L:w,R:w,0:_,1:_,2:_,3:_,4:_,5:_,6:_,7:_,8:_,9:_,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&S(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),E("text/x-squirrel",{name:"clike",keywords:a("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:f,blockKeywords:a("case catch class else for foreach if switch try while"),defKeywords:a("function local class"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"#":y},modeProps:{fold:["brace","include"]}});var R=null;function A(e){return function(t,n){for(var r,i=!1,o=!1;!t.eol();){if(!i&&t.match('"')&&("single"==e||t.match('""'))){o=!0;break}if(!i&&t.match("``")){R=A(e),o=!0;break}r=t.next(),i="single"==e&&!i&&"\\"==r}return o&&(n.tokenize=null),"string"}}E("text/x-ceylon",{name:"clike",keywords:a("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:a("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:a("class dynamic function interface module object package value"),builtin:a("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:a("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=A(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!R||!e.match("`"))&&(t.tokenize=R,R=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){if(("variable"==n||"type"==n)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})},"object"==(void 0===n?"undefined":(0,i.default)(n))&&"object"==(void 0===t?"undefined":(0,i.default)(t))?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":27,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":19}],29:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){if(r=(n=window.getComputedStyle)?n(e):e.currentStyle)return r[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},{}],30:[function(e,t,n){"use strict";t.exports=function(e){"string"==typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),n=[],r=0;r<e.length-1;r++)n.push(e[r],t[r]||"");return n.push(e[r]),n.join("")}},{}],31:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof"));!function(e,i){"object"===(void 0===n?"undefined":(0,r.default)(n))&&void 0!==t?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((e=e||self).window=e.window||{})}(void 0,(function(e){function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e} 2/*! 3 * GSAP 3.0.5 4 * https://greensock.com 5 * 6 * @license Copyright 2008-2020, GreenSock. All rights reserved. 7 * Subject to the terms at https://greensock.com/standard-license or for 8 * Club GreenSock members, the agreement issued with that membership. 9 * @author: Jack Doyle, [email protected] 10 */var i,o,a,s,l,c,u,h,d,p,f,m,v,g,y,x,b,_,w,S,M,T,E,C,L,R={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},A={duration:.5,overwrite:!1,delay:0},P=1e8,I=1e-8,O=2*Math.PI,D=O/4,N=0,k=Math.sqrt,z=Math.cos,B=Math.sin,F=function(e){return"string"==typeof e},G=function(e){return"function"==typeof e},H=function(e){return"number"==typeof e},U=function(e){return void 0===e},W=function(e){return"object"===(0,r.default)(e)},V=function(e){return!1!==e},j=function(){return"undefined"!=typeof window},X=function(e){return G(e)||F(e)},q=Array.isArray,Y=/(?:-?\.?\d|\.)+/gi,K=/[-+=\.]*\d+[\.e\-\+]*\d*[e\-\+]*\d*/gi,Z=/[-+=\.]*\d+(?:\.|e-|e)*\d*/gi,J=/\(([^()]+)\)/i,Q=/[\+-]=-?[\.\d]+/,$=/[#\-+\.]*\b[a-z\d-=+%.]+/gi,ee={},te={},ne=function(e){return(te=Le(e,ee))&&rn},re=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},ie=function(e,t){return!t&&console.warn(e)},oe=function(e,t){return e&&(ee[e]=t)&&te&&(te[e]=t)||ee},ae=function(){return 0},se={},le=[],ce={},ue={},he={},de=30,pe=[],fe="onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",me=function(e){var t,n,r=e[0];if(W(r)||G(r)||(e=[e]),!(t=(r._gsap||{}).harness)){for(n=pe.length;n--&&!pe[n].targetTest(r););t=pe[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new Lt(e[n],t)))||e.splice(n,1);return e},ve=function(e){return e._gsap||me(Ze(e))[0]._gsap},ge=function(e,t){var n=e[t];return G(n)?e[t]():U(n)&&e.getAttribute(t)||n}
10,ye=function(e,t){return(e=e.split(",")).forEach(t)||e},xe=function(e){return Math.round(1e4*e)/1e4},be=function(e,t){for(var n=t.length,r=0;e.indexOf(t[r])<0&&++r<n;);return r<n},_e=function(e,t,n){var r,i=H(e[1]),o=(i?2:1)+(t<2?0:1),a=e[o];return i&&(a.duration=e[1]),1===t?(a.runBackwards=1,a.immediateRender=V(a.immediateRender)):2===t&&(r=e[o-1],a.startAt=r,a.immediateRender=V(a.immediateRender)),a.parent=n,a},we=function(){var e,t,n=le.length,r=le.slice(0);for(ce={},le.length=0,e=0;e<n;e++)(t=r[e])&&t._lazy&&(t.render(t._lazy[0],t._lazy[1],!0)._lazy=0)},Se=function(e,t,n,r){le.length&&we(),e.render(t,n,r),le.length&&we()},Me=function(e){var t=parseFloat(e);return t||0===t?t:e},Te=function(e){return e},Ee=function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e},Ce=function(e,t){for(var n in t)n in e||"duration"===n||"ease"===n||(e[n]=t[n])},Le=function(e,t){for(var n in t)e[n]=t[n];return e},Re=function e(t,n){for(var r in n)t[r]=W(n[r])?e(t[r]||(t[r]={}),n[r]):n[r];return t},Ae=function(e,t){var n,r={};for(n in e)n in t||(r[n]=e[n]);return r},Pe=function(e,t,n,r){void 0===n&&(n="_first"),void 0===r&&(r="_last");var i=t._prev,o=t._next;i?i._next=o:e[n]===t&&(e[n]=o),o?o._prev=i:e[r]===t&&(e[r]=i),t._dp=e,t._next=t._prev=t.parent=null},Ie=function(e,t){!e.parent||t&&!e.parent.autoRemoveChildren||e.parent.remove(e),e._act=0},Oe=function(e){for(var t=e;t;)t._dirty=1,t=t.parent;return e},De=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},Ne=function e(t){return!t||t._ts&&e(t.parent)},ke=function(e){return e._repeat?ze(e._tTime,e=e.duration()+e._rDelay)*e:0},ze=function(e,t){return(e/=t)&&~~e===e?~~e-1:~~e},Be=function(e,t){return(e-t._start)*t._ts+(t._ts>0?0:t._dirty?t.totalDuration():t._tDur)},Fe=function(e,t,n){if(t.parent&&Ie(t),t._start=n+t._delay,t._end=t._start+(t.totalDuration()/t._ts||0),function(e,t,n,r,i){void 0===n&&(n="_first"),void 0===r&&(r="_last");var o,a=e[r];if(i)for(o=t[i];a&&a[i]>o;)a=a._prev;a?(t._next=a._next,a._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[r]=t,t._prev=a,t.parent=e}(e,t,"_first","_last",e._sort?"_start":0),e._recent=t,t._time||!t._dur&&t._initted){var r=(e.rawTime()-t._start)*t._ts;(!t._dur||je(0,t.totalDuration(),r)-t._tTime>I)&&t.render(r,!0)}if(Oe(e),e._dp&&e._time>=e._dur&&e._ts&&e._dur<e.duration())for(var i=e;i._dp;)i.totalTime(i._tTime,!0),i=i._dp;return e},Ge=function(e,t,n,r){return Nt(e,t),e._initted?!n&&e._pt&&(e._dur&&!1!==e.vars.lazy||!e._dur&&e.vars.lazy)&&c!==vt.frame?(le.push(e),e._lazy=[t,r],1):void 0:1},He=function(e){if(e instanceof At)return Oe(e);var t=e._repeat;return e._tDur=t?t<0?1e12:xe(e._dur*(t+1)+e._rDelay*t):e._dur,Oe(e.parent),e},Ue={_start:0,endTime:ae},We=function e(t,n,r){var i,o,a=t.labels,s=t._recent||Ue,l=t.duration()>=P?s.endTime(!1):t._dur;return F(n)&&(isNaN(n)||n in a)?"<"===(i=n.charAt(0))||">"===i?("<"===i?s._start:s.endTime(s._repeat>=0))+(parseFloat(n.substr(1))||0):(i=n.indexOf("="))<0?(n in a||(a[n]=l),a[n]):(o=+(n.charAt(i-1)+n.substr(i+1)),i>1?e(t,n.substr(0,i-1))+o:l+o):null==n?l:+n},Ve=function(e,t){return e||0===e?t(e):t},je=function(e,t,n){return n<e?e:n>t?t:n},Xe=function(e){return(e+"").substr((parseFloat(e)+"").length)},qe=[].slice,Ye=function(e){return e&&W(e)&&"length"in e&&(!e.length||e.length-1 in e&&W(e[0]))&&!e.nodeType&&e!==o},Ke=function(e,t,n){return void 0===n&&(n=[]),e.forEach((function(e){var r;return F(e)&&!t||Ye(e)?(r=n).push.apply(r,Ze(e)):n.push(e)}))||n},Ze=function(e,t){return!F(e)||t||!a&>()?q(e)?Ke(e,t):Ye(e)?qe.call(e,0):e?[e]:[]:qe.call(s.querySelectorAll(e),0)},Je=function(e){if(G(e))return e;var t=W(e)?e:{each:e},n=St(t.ease),r=t.from||0,i=parseFloat(t.base)||0,o={},a=r>0&&r<1,s=isNaN(r)||a,l=t.axis,c=r,u=r;return F(r)?c=u={center:.5,edges:.5,end:1}[r]||0:!a&&s&&(c=r[0],u=r[1]),function(e,a,h){var d,p,f,m,v,g,y,x,b,_=(h||t).length,w=o[_];if(!w){if(!(b="auto"===t.grid?0:(t.grid||[1,P])[1])){for(y=-P;y<(y=h[b++].getBoundingClientRect().left)&&b<_;);b--}for(w=o[_]=[],d=s?Math.min(b,_)*c-.5:r%b,p=s?_*u/b-.5:r/b|0,y=0,x=P,g=0;g<_;g++)f=g%b-d,m=p-(g/b|0),w[g]=v=l?Math.abs("y"===l?m:f):k(f*f+m*m),v>y&&(y=v),v<x&&(x=v);w.max=y-x,w.min=x,w.v=_=(parseFloat(t.amount)||parseFloat(t.each)*(b>_?_-1:l?"y"===l?_/b:b:Math.max(b,_/b))||0)*("edges"===r?-1:1),w.b=_<0?i-_:i,w.u=Xe(t.amount||t.each)||0,n=n&&_<0?wt(n):n}return _=(w[e]-w.min)/w.max||0,xe(w.b+(n?n(_):_)*w.v)+w.u}},Qe=function(e){var t=e<1?Math.pow(10,(e+"").length-2):1;return function(n){return~~(Math.round(parseFloat(n)/e)*e*t)/t+(H(n)?0:Xe(n))}},$e=function(e,t){var n,r,i=q(e);return!i&&W(e)&&(n=i=e.radius||P,e.values?(e=Ze(e.values),(r=!H(e[0]))&&(n*=n)):e=Qe(e.increment)),Ve(t,i?G(e)?function(t){return r=e(t),Math.abs(r-t)<=n?r:t}:function(t){for(var i,o,a=parseFloat(r?t.x:t),s=parseFloat(r?t.y:0),l=P,c=0,u=e.length;u--;)(i=r?(i=e[u].x-a)*i+(o=e[u].y-s)*o:Math.abs(e[u]-a))<l&&(l=i,c=u);return c=!n||l<=n?e[c]:t,r||c===t||H(t)?c:c+Xe(t)}:Qe(e))},et=function(e,t,n,r){return Ve(q(e)?!t:!0===n?!!(n=0):!r,(function(){return q(e)?e[~~(Math.random()*e.length)]:(n=n||1e-5)&&(r=n<1?Math.pow(10,(n+"").length-2):1)&&~~(Math.round((e+Math.random()*(t-e))/n)*n*r)/r}))},tt=function(e,t,n){return Ve(n,(function(n){return e[~~t(n)]}))},nt=function(e){for(var t,n,r,i,o=0,a="";~(t=e.indexOf("random(",o));)r=e.indexOf(")",t),i="["===e.charAt(t+7),n=e.substr(t+7,r-t-7).match(i?$:Y),a+=e.substr(o,t-o)+et(i?n:+n[0],+n[1],+n[2]||1e-5),o=r+1;return a+e.substr(o,e.length-o)},rt=function(e,t,n,r,i){var o=t-e,a=r-n;return Ve(i,(function(t){return n+(t-e)/o*a}))},it=function(e,t,n){var r,i,o,a=e.labels,s=P;
10for(r in a)(i=a[r]-t)<0==!!n&&i&&s>(i=Math.abs(i))&&(o=r,s=i);return o},ot=function(e,t,n){var r,i,o=e.vars,a=o[t];if(a)return r=o[t+"Params"],i=o.callbackScope||e,n&&le.length&&we(),r?a.apply(i,r):a.call(i)},at=function(e){return Ie(e),e.progress()<1&&ot(e,"onInterrupt"),e},st=function(e){var t=(e=!e.name&&e.default||e).name,n=G(e),r=t&&!n&&e.init?function(){this._props=[]}:e,i={init:ae,render:Yt,add:Ot,kill:Zt,modifier:Kt,rawVars:0},o={targetTest:0,get:0,getSetter:Vt,aliases:{},register:0};if(gt(),e!==r){if(ue[t])return;Ee(r,Ee(Ae(e,i),o)),Le(r.prototype,Le(i,Ae(e,o))),ue[r.prop=t]=r,e.targetTest&&(pe.push(r),se[t]=1),t=("css"===t?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}oe(t,r),e.register&&e.register(rn,r,$t)},lt=255,ct={aqua:[0,lt,lt],lime:[0,lt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,lt],navy:[0,0,128],white:[lt,lt,lt],olive:[128,128,0],yellow:[lt,lt,0],orange:[lt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[lt,0,0],pink:[lt,192,203],cyan:[0,lt,lt],transparent:[lt,lt,lt,0]},ut=function(e,t,n){return(6*(e=e<0?e+1:e>1?e-1:e)<1?t+(n-t)*e*6:e<.5?n:3*e<2?t+(n-t)*(2/3-e)*6:t)*lt+.5|0},ht=function(e,t){var n,r,i,o,a,s,l,c,u,h,d=e?H(e)?[e>>16,e>>8<,e<]:0:ct.black;if(!d){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),ct[e])d=ct[e];else if("#"===e.charAt(0))4===e.length&&(n=e.charAt(1),r=e.charAt(2),i=e.charAt(3),e="#"+n+n+r+r+i+i),d=[(e=parseInt(e.substr(1),16))>>16,e>>8<,e<];else if("hsl"===e.substr(0,3))if(d=h=e.match(Y),t){if(~e.indexOf("="))return e.match(K)}else o=+d[0]%360/360,a=+d[1]/100,n=2*(s=+d[2]/100)-(r=s<=.5?s*(a+1):s+a-s*a),d.length>3&&(d[3]*=1),d[0]=ut(o+1/3,n,r),d[1]=ut(o,n,r),d[2]=ut(o-1/3,n,r);else d=e.match(Y)||ct.transparent;d=d.map(Number)}return t&&!h&&(n=d[0]/lt,r=d[1]/lt,i=d[2]/lt,s=((l=Math.max(n,r,i))+(c=Math.min(n,r,i)))/2,l===c?o=a=0:(u=l-c,a=s>.5?u/(2-l-c):u/(l+c),o=l===n?(r-i)/u+(r<i?6:0):l===r?(i-n)/u+2:(n-r)/u+4,o*=60),d[0]=o+.5|0,d[1]=100*a+.5|0,d[2]=100*s+.5|0),d},dt=function(e,t){var n,r,i,o=(e+"").match(pt),a=0,s="";if(!o)return e;for(n=0;n<o.length;n++)r=o[n],a+=(i=e.substr(a,e.indexOf(r,a)-a)).length+r.length,3===(r=ht(r,t)).length&&r.push(1),s+=i+(t?"hsla("+r[0]+","+r[1]+"%,"+r[2]+"%,"+r[3]:"rgba("+r.join(","))+")";return s+e.substr(a)},pt=function(){var e,t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b";for(e in ct)t+="|"+e+"\\b";return new RegExp(t+")","gi")}(),ft=/hsl[a]?\(/,mt=function(e){var t,n=e.join(" ");pt.lastIndex=0,pt.test(n)&&(t=ft.test(n),e[0]=dt(e[0],t),e[1]=dt(e[1],t))},vt=(v=Date.now,g=500,y=33,x=v(),b=x,w=_=1/60,M=function e(t){var n,r,i=v()-b,o=!0===t;i>g&&(x+=i-y),b+=i,m.time=(b-x)/1e3,((n=m.time-w)>0||o)&&(m.frame++,w+=n+(n>=_?.004:_-n),r=1),o||(d=p(e)),r&&S.forEach((function(e){return e(m.time,i,m.frame,t)}))},m={time:0,frame:0,tick:function(){M(!0)},wake:function(){l&&(!a&&j()&&(o=a=window,s=o.document||{},ee.gsap=rn,(o.gsapVersions||(o.gsapVersions=[])).push(rn.version),ne(te||o.GreenSockGlobals||!o.gsap&&o||{}),f=o.requestAnimationFrame),d&&m.sleep(),p=f||function(e){return setTimeout(e,1e3*(w-m.time)+1|0)},h=1,M(2))},sleep:function(){(f?o.cancelAnimationFrame:clearTimeout)(d),h=0,p=ae},lagSmoothing:function(e,t){g=e||1e8,y=Math.min(t,g,0)},fps:function(e){_=1/(e||60),w=m.time+_},add:function(e){S.indexOf(e)<0&&S.push(e),gt()},remove:function(e){var t;~(t=S.indexOf(e))&&S.splice(t,1)},_listeners:S=[]}),gt=function(){return!h&&vt.wake()},yt={},xt=/^[\d.\-M][\d.\-,\s]/,bt=/["']/g,_t=function(e){for(var t,n,r,i={},o=e.substr(1,e.length-3).split(":"),a=o[0],s=1,l=o.length;s<l;s++)n=o[s],t=s!==l-1?n.lastIndexOf(","):n.length,r=n.substr(0,t),i[a]=isNaN(r)?r.replace(bt,"").trim():+r,a=n.substr(t+1).trim();return i},wt=function(e){return function(t){return 1-e(1-t)}},St=function(e,t){return e&&(G(e)?e:yt[e]||function(e){var t=(e+"").split("("),n=yt[t[0]];return n&&t.length>1&&n.config?n.config.apply(null,~e.indexOf("{")?[_t(t[1])]:J.exec(e)[1].split(",").map(Me)):yt._CE&&xt.test(e)?yt._CE("",e):n}(e))||t},Mt=function(e,t,n,r){void 0===n&&(n=function(e){return 1-t(1-e)}),void 0===r&&(r=function(e){return e<.5?t(2*e)/2:1-t(2*(1-e))/2});var i,o={easeIn:t,easeOut:n,easeInOut:r};return ye(e,(function(e){for(var t in yt[e]=ee[e]=o,yt[i=e.toLowerCase()]=n,o)yt[i+("easeIn"===t?".in":"easeOut"===t?".out":".inOut")]=yt[e+"."+t]=o[t]})),o},Tt=function(e){return function(t){return t<.5?(1-e(1-2*t))/2:.5+e(2*(t-.5))/2}},Et=function e(t,n,r){var i=n>=1?n:1,o=(r||(t?.3:.45))/(n<1?n:1),a=o/O*(Math.asin(1/i)||0),s=function(e){return 1===e?1:i*Math.pow(2,-10*e)*B((e-a)*o)+1},l="out"===t?s:"in"===t?function(e){return 1-s(1-e)}:Tt(s);return o=O/o,l.config=function(n,r){return e(t,n,r)},l},Ct=function e(t,n){void 0===n&&(n=1.70158);var r=function(e){return--e*e*((n+1)*e+n)+1},i="out"===t?r:"in"===t?function(e){return 1-r(1-e)}:Tt(r);return i.config=function(n){return e(t,n)},i};ye("Linear,Quad,Cubic,Quart,Quint,Strong",(function(e,t){var n=t<5?t+1:t;Mt(e+",Power"+(n-1),t?function(e){return Math.pow(e,n)}:function(e){return e},(function(e){return 1-Math.pow(1-e,n)}),(function(e){return e<.5?Math.pow(2*e,n)/2:1-Math.pow(2*(1-e),n)/2}))}
10)),yt.Linear.easeNone=yt.none=yt.Linear.easeIn,Mt("Elastic",Et("in"),Et("out"),Et()),T=7.5625,C=1/(E=2.75),Mt("Bounce",(function(e){return 1-L(1-e)}),L=function(e){return e<C?T*e*e:e<.7272727272727273?T*Math.pow(e-1.5/E,2)+.75:e<.9090909090909092?T*(e-=2.25/E)*e+.9375:T*Math.pow(e-2.625/E,2)+.984375}),Mt("Expo",(function(e){return e?Math.pow(2,10*(e-1)):0})),Mt("Circ",(function(e){return-(k(1-e*e)-1)})),Mt("Sine",(function(e){return 1-z(e*D)})),Mt("Back",Ct("in"),Ct("out"),Ct()),yt.SteppedEase=yt.steps=ee.SteppedEase={config:function(e,t){void 0===e&&(e=1);var n=1/e,r=e+(t?0:1),i=t?1:0;return function(e){return((r*je(0,.99999999,e)|0)+i)*n}}},A.ease=yt["quad.out"];var Lt=function(e,t){this.id=N++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:ge,this.set=t?t.getSetter:Vt},Rt=function(){function e(e,t){var n=e.parent||i;this.vars=e,this._dur=this._tDur=+e.duration||0,this._delay=+e.delay||0,(this._repeat=e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase,He(this)),this._ts=1,this.data=e.data,h||vt.wake(),n&&Fe(n,this,t||0===t?t:n._time),e.reversed&&this.reversed(!0),e.paused&&this.paused(!0)}var t=e.prototype;return t.delay=function(e){return e||0===e?(this._delay=e,this):this._delay},t.duration=function(e){var t=arguments.length,n=this._repeat,r=n>0?n*((t?e:this._dur)+this._rDelay):0;return t?this.totalDuration(n<0?e:e+r):this.totalDuration()&&this._dur},t.totalDuration=function(e){if(!arguments.length)return this._tDur;var t=this._repeat,n=(e||this._rDelay)&&t<0;return this._tDur=n?1e12:e,this._dur=n?e:(e-t*this._rDelay)/(t+1),this._dirty=0,Oe(this.parent),this},t.totalTime=function(e,t){if(gt(),!arguments.length)return this._tTime;var n,r=this.parent||this._dp;if(r&&r.smoothChildTiming&&this._ts){for(n=this._start,this._start=r._time-(this._ts>0?e/this._ts:((this._dirty?this.totalDuration():this._tDur)-e)/-this._ts),this._end+=this._start-n,r._dirty||Oe(r);r.parent;)r.parent._time!==r._start+(r._ts>0?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;this.parent||Fe(this._dp,this,this._start-this._delay)}return this._tTime===e&&(this._dur||t)||(this._ts||(this._pTime=e),Se(this,e,t)),this},t.time=function(e,t){return arguments.length?this.totalTime(Math.min(this.totalDuration(),e+ke(this))%this._dur||(e?this._dur:0),t):this._time},t.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this._tTime/this.totalDuration()},t.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?e:1-e)+ke(this),t):this.duration()?this._time/this._dur:this.ratio},t.iteration=function(e,t){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(e-1)*n,t):this._repeat?ze(this._tTime,n)+1:1},t.timeScale=function(e){return arguments.length?null!==this._pauseTS?(this._pauseTS=e,this):(this._ts=e,De(this.totalTime(this.parent?Be(this.parent._time,this):this._tTime,!0))):this._ts||this._pauseTS||0},t.paused=function(e){var t=!this._ts;return arguments.length?(t!==e&&(e?(this._pauseTS=this._ts,this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(this._ts=this._pauseTS||1,this._pauseTS=null,e=this._tTime||this._pTime,1===this.progress()&&(this._tTime-=I),this.totalTime(e,!0))),this):t},t.startTime=function(e){return arguments.length?(this.parent&&this.parent._sort&&Fe(this.parent,this,e-this._delay),this):this._start},t.endTime=function(e){return this._start+(V(e)?this.totalDuration():this.duration())/Math.abs(this._ts)},t.rawTime=function(e){var t=this.parent||this._dp;return t?e&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Be(t.rawTime(e),this):this._tTime:this._tTime},t.repeat=function(e){return arguments.length?(this._repeat=e,He(this)):this._repeat},t.repeatDelay=function(e){return arguments.length?(this._rDelay=e,He(this)):this._rDelay},t.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},t.seek=function(e,t){return this.totalTime(We(this,e),V(t))},t.restart=function(e,t){return this.play().totalTime(e?-this._delay:0,V(t))},t.play=function(e,t){return null!=e&&this.seek(e,t),this.reversed(!1).paused(!1)},t.reverse=function(e,t){return null!=e&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},t.pause=function(e,t){return null!=e&&this.seek(e,t),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(e){var t=this._ts||this._pauseTS||0;return arguments.length?(e!==this.reversed()&&(this[null===this._pauseTS?"_ts":"_pauseTS"]=Math.abs(t)*(e?-1:1),this.totalTime(this._tTime,!0)),this):t<0},t.invalidate=function(){return this._initted=0,this},t.isActive=function(e){var t,n=this.parent||this._dp,r=this._start;return!(n&&!(this._ts&&(this._initted||!e)&&n.isActive(e)&&(t=n.rawTime(!0))>=r&&t<this.endTime(!0)-I))},t.eventCallback=function(e,t,n){var r=this.vars;return arguments.length>
101?(t?(r[e]=t,n&&(r[e+"Params"]=n),"onUpdate"===e&&(this._onUpdate=t)):delete r[e],this):r[e]},t.then=function(e){var t=this;return new Promise((function(n){var r=e||Te,i=function(){var e=t.then;t.then=null,(r=r(t))&&(r.then||r===t)&&(t._prom=r,t.then=e),n(r),t.then=e};t._initted&&1===t.totalProgress()&&t._ts>=0||!t._tTime&&t._ts<0?i():t._prom=i}))},t.kill=function(){at(this)},e}();Ee(Rt.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:0,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_pauseTS:null});var At=function(e){function n(t,n){var r;return void 0===t&&(t={}),(r=e.call(this,t,n)||this).labels={},r.smoothChildTiming=V(t.smoothChildTiming),r.autoRemoveChildren=!!t.autoRemoveChildren,r._sort=V(t.sortChildren),r}t(n,e);var r=n.prototype;return r.to=function(e,t,n){return new Ft(e,_e(arguments,0,this),We(this,H(t)?arguments[3]:n)),this},r.from=function(e,t,n){return new Ft(e,_e(arguments,1,this),We(this,H(t)?arguments[3]:n)),this},r.fromTo=function(e,t,n,r){return new Ft(e,_e(arguments,2,this),We(this,H(t)?arguments[4]:r)),this},r.set=function(e,t,n){return t.duration=0,t.parent=this,t.repeatDelay||(t.repeat=0),t.immediateRender=!!t.immediateRender,new Ft(e,t,We(this,n)),this},r.call=function(e,t,n){return Fe(this,Ft.delayedCall(0,e,t),We(this,n))},r.staggerTo=function(e,t,n,r,i,o,a){return n.duration=t,n.stagger=n.stagger||r,n.onComplete=o,n.onCompleteParams=a,n.parent=this,new Ft(e,n,We(this,i)),this},r.staggerFrom=function(e,t,n,r,i,o,a){return n.runBackwards=1,n.immediateRender=V(n.immediateRender),this.staggerTo(e,t,n,r,i,o,a)},r.staggerFromTo=function(e,t,n,r,i,o,a,s){return r.startAt=n,r.immediateRender=V(r.immediateRender),this.staggerTo(e,t,r,i,o,a,s)},r.render=function(e,t,n){var r,o,a,s,l,c,u,h,d,p,f,m=this._time,v=this._dirty?this.totalDuration():this._tDur,g=this._dur,y=e>v-I&&e>=0&&this!==i?v:e<I?0:e,x=this._zTime<0!=e<0&&(this._initted||!g);if(y!==this._tTime||n||x){if(x&&(g||(m=this._zTime),!e&&t||(this._zTime=e)),r=y,d=this._start,c=0===(h=this._ts),m!==this._time&&g&&(r+=this._time-m),this._repeat&&(f=this._yoyo,l=g+this._rDelay,((r=xe(y%l))>g||v===y)&&(r=g),(s=~~(y/l))&&s===y/l&&(r=g,s--),f&&1&s&&(r=g-r),s!==(p=ze(this._tTime,l))&&!this._lock)){var b=f&&1&p,_=b===(f&&1&s);if(s<p&&(b=!b),m=b?0:g,this._lock=1,this.render(m,t,!g)._lock=0,!t&&this.parent&&ot(this,"onRepeat"),m!==this._time||c!==!this._ts
10)return this;if(_&&(this._lock=2,m=b?g+1e-4:-1e-4,this.render(m,!0)),this._lock=0,!this._ts&&!c)return this}if(this._hasPause&&!this._forcing&&this._lock<2&&(u=function(e,t,n){var r;if(n>t)for(r=e._first;r&&r._start<=n;){if(!r._dur&&"isPause"===r.data&&r._start>t)return r;r=r._next}else for(r=e._last;r&&r._start>=n;){if(!r._dur&&"isPause"===r.data&&r._start<t)return r;r=r._prev}}(this,xe(m),xe(r)))&&(y-=r-(r=u._start)),this._tTime=y,this._time=r,this._act=!h,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1),m||!r||t||ot(this,"onStart"),r>=m&&e>=0)for(o=this._first;o;){if(a=o._next,(o._act||r>=o._start)&&o._ts&&u!==o){if(o.parent!==this)return this.render(e,t,n);if(o.render(o._ts>0?(r-o._start)*o._ts:(o._dirty?o.totalDuration():o._tDur)+(r-o._start)*o._ts,t,n),r!==this._time||!this._ts&&!c){u=0;break}}o=a}else{o=this._last;for(var w=e<0?e:r;o;){if(a=o._prev,(o._act||w<=o._end)&&o._ts&&u!==o){if(o.parent!==this)return this.render(e,t,n);if(o.render(o._ts>0?(w-o._start)*o._ts:(o._dirty?o.totalDuration():o._tDur)+(w-o._start)*o._ts,t,n),r!==this._time||!this._ts&&!c){u=0;break}}o=a}}if(u&&!t&&(this.pause(),u.render(r>=m?0:-1e-8)._zTime=r>=m?1:-1,this._ts))return this._start=d,this.render(e,t,n);this._onUpdate&&!t&&ot(this,"onUpdate",!0),(y===v||!y&&this._ts<0)&&(d!==this._start&&Math.abs(h)===Math.abs(this._ts)||(!r||v>=this.totalDuration())&&((e||!g)&&(y&&this._ts>0||!y&&this._ts<0)&&Ie(this,1),t||e<0&&!m||(ot(this,y===v?"onComplete":"onReverseComplete",!0),this._prom&&this._prom())))}return this},r.add=function(e,t){var n=this;if(H(t)||(t=We(this,t)),!(e instanceof Rt)){if(q(e))return e.forEach((function(e){return n.add(e,t)})),Oe(this);if(F(e))return this.addLabel(e,t);if(!G(e))return this;e=Ft.delayedCall(0,e)}return this!==e?Fe(this,e,t):this},r.getChildren=function(e,t,n,r){void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===r&&(r=-P);for(var i=[],o=this._first;o;)o._start>=r&&(o instanceof Ft?t&&i.push(o):(n&&i.push(o),e&&i.push.apply(i,o.getChildren(!0,t,n)))),o=o._next;return i},r.getById=function(e){for(var t=this.getChildren(1,1,1),n=t.length;n--;)if(t[n].vars.id===e)return t[n]},r.remove=function(e){return F(e)?this.removeLabel(e):G(e)?this.killTweensOf(e):(Pe(this,e),e===this._recent&&(this._recent=this._last),Oe(this))},r.totalTime=function(t,n){return arguments.length?(this._forcing=1,this.parent||this._dp||!this._ts||(this._start=vt.time-(this._ts>0?t/this._ts:(this.totalDuration()-t)/-this._ts)),e.prototype.totalTime.call(this,t,n),this._forcing=0,this):this._tTime},r.addLabel=function(e,t){return this.labels[e]=We(this,t),this},r.removeLabel=function(e){return delete this.labels[e],this},r.addPause=function(e,t,n){var r=Ft.delayedCall(0,t||ae,n);return r.data="isPause",this._hasPause=1,Fe(this,r,We(this,e))},r.removePause=function(e){var t=this._first;for(e=We(this,e);t;)t._start===e&&"isPause"===t.data&&Ie(t),t=t._next},r.killTweensOf=function(e,t,n){for(var r=this.getTweensOf(e,n),i=r.length;i--;)Pt!==r[i]&&r[i].kill(e,t);return this},r.getTweensOf=function(e,t){for(var n,r=[],i=Ze(e),o=this._first;o;)o instanceof Ft?!be(o._targets,i)||t&&!o.isActive("started"===t)||r.push(o):(n=o.getTweensOf(i,t)).length&&r.push.apply(r,n),o=o._next;return r},r.tweenTo=function(e,t){var n=this,r=We(n,e),i=t&&t.startAt,o=Ft.to(n,Ee({ease:"none",lazy:!1,time:r,duration:Math.abs(r-(i&&"time"in i?i.time:n._time))/n.timeScale()||I,onStart:function(){n.pause();var e=Math.abs(r-n._time)/n.timeScale();o._dur!==e&&(o._dur=e,o.render(o._time,!0,!0)),t&&t.onStart&&t.onStart.apply(o,t.onStartParams||[])}},t));return o},r.tweenFromTo=function(e,t,n){return this.tweenTo(t,Ee({startAt:{time:We(this,e)}},n))},r.recent=function(){return this._recent},r.nextLabel=function(e){return void 0===e&&(e=this._time),it(this,We(this,e))},r.previousLabel=function(e){return void 0===e&&(e=this._time),it(this,We(this,e),1)},r.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+I)},r.shiftChildren=function(e,t,n){void 0===n&&(n=0);for(var r,i=this._first,o=this.labels;i;)i._start>=n&&(i._start+=e),i=i._next;if(t)for(r in o)o[r]>=n&&(o[r]+=e);return Oe(this)},r.invalidate=function(){var t=this._first;for(this._lock=0;t;
10)t.invalidate(),t=t._next;return e.prototype.invalidate.call(this)},r.clear=function(e){void 0===e&&(e=!0);for(var t,n=this._first;n;)t=n._next,this.remove(n),n=t;return this._time=this._tTime=0,e&&(this.labels={}),Oe(this)},r.totalDuration=function(e){var t,n,r=0,o=this,a=o._last,s=P,l=o._repeat,c=l*o._rDelay||0,u=l<0;if(!arguments.length){if(o._dirty){for(;a;)t=a._prev,a._dirty&&a.totalDuration(),a._start>s&&o._sort&&a._ts&&!o._lock?(o._lock=1,Fe(o,a,a._start-a._delay),o._lock=0):s=a._start,a._start<0&&a._ts&&(r-=a._start,(!o.parent&&!o._dp||o.parent&&o.parent.smoothChildTiming)&&(o._start+=a._start/o._ts,o._time-=a._start,o._tTime-=a._start),o.shiftChildren(-a._start,!1,-1e20),s=0),(n=a._end=a._start+a._tDur/Math.abs(a._ts||a._pauseTS||I))>r&&a._ts&&(r=xe(n)),a=t;o._dur=o===i&&o._time>r?o._time:Math.min(P,r),o._tDur=u&&(o._dur||c)?1e12:Math.min(P,r*(l+1)+c),o._end=o._start+(o._tDur/Math.abs(o._ts||o._pauseTS||I)||0),o._dirty=0}return o._tDur}return u?o:o.timeScale(o.totalDuration()/e)},n.updateRoot=function(e){if(i._ts&&(Se(i,Be(e,i)),c=vt.frame),vt.frame>=de){de+=R.autoSleep||120;var t=i._first;if((!t||!t._ts)&&R.autoSleep&&vt._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||vt.sleep()}}},n}(Rt);Ee(At.prototype,{_lock:0,_hasPause:0,_forcing:0});var Pt,It=function(e,t,n,r,i,o,a){var s,l,c,u,h,d,p,f,m=new $t(this._pt,e,t,0,1,qt,null,i),v=0,g=0;for(m.b=n,m.e=r,n+="",(p=~(r+="").indexOf("random("))&&(r=nt(r)),o&&(o(f=[n,r],e,t),n=f[0],r=f[1]),l=n.match(Z)||[];s=Z.exec(r);)u=s[0],h=r.substring(v,s.index),c?c=(c+1)%5:"rgba("===h.substr(-5)&&(c=1),u!==l[g++]&&(d=parseFloat(l[g-1])||0,m._pt={_next:m._pt,p:h||1===g?h:",",s:d,c:"="===u.charAt(1)?parseFloat(u.substr(2))*("-"===u.charAt(0)?-1:1):parseFloat(u)-d,m:c&&c<4?Math.round:0},v=Z.lastIndex);return m.c=v<r.length?r.substring(v,r.length):"",m.fp=a,(Q.test(r)||p)&&(m.e=0),this._pt=m,m},Ot=function(e,t,n,r,i,o,a,s,l){G(r)&&(r=r(i||0,e,o));var c,u=e[t],h="get"!==n?n:G(u)?l?e[t.indexOf("set")||!G(e["get"+t.substr(3)])?t:"get"+t.substr(3)](l):e[t]():u,d=G(u)?l?Ut:Ht:Gt;if(F(r)&&(~r.indexOf("random(")&&(r=nt(r)),"="===r.charAt(1)&&(r=parseFloat(h)+parseFloat(r.substr(2))*("-"===r.charAt(0)?-1:1)+(Xe(h)||0))),h!==r)return isNaN(h+r)?(!u&&!(t in e)&&re(t,r),It.call(this,e,t,h,r,d,s||R.stringFilter,l)):(c=new $t(this._pt,e,t,+h||0,r-(h||0),"boolean"==typeof u?Xt:jt,0,d),l&&(c.fp=l),a&&c.modifier(a,this,e),this._pt=c)},Dt=function(e,t,n,r,i,o){var a,s,l,c;if(ue[e]&&!1!==(a=new ue[e]).init(i,a.rawVars?t[e]:function(e,t,n,r,i){if(G(e)&&(e=kt(e,i,t,n,r)),!W(e)||e.style&&e.nodeType||q(e))return F(e)?kt(e,i,t,n,r):e;var o,a={};for(o in e)a[o]=kt(e[o],i,t,n,r);return a}(t[e],r,i,o,n),n,r,o)&&(n._pt=s=new $t(n._pt,i,e,0,1,a.render,a,0,a.priority),n!==u))for(l=n._ptLookup[n._targets.indexOf(i)],c=a._props.length;c--;)l[a._props[c]]=s;return a},Nt=function e(t,n){var r,o,a,s,l,c,u,h,d,p,f,m,v=t.vars,g=v.ease,y=v.startAt,x=v.immediateRender,b=v.lazy,_=v.onUpdate,w=v.onUpdateParams,S=v.callbackScope,M=v.runBackwards,T=v.yoyoEase,E=v.keyframes,C=v.autoRevert,L=t._dur,R=t._startAt,P=t._targets,O=t.parent,D=O&&"nested"===O.data?O.parent._targets:P,N="auto"===t._overwrite,k=t.timeline;if(!k||E&&g||(g="none"),t._ease=St(g,A.ease),t._yEase=T?wt(St(!0===T?g:T,A.ease)):0,T&&t._yoyo&&!t._repeat&&(T=t._yEase,t._yEase=t._ease,t._ease=T),!k){if(R&&R.render(-1,!0).kill(),y){if(Ie(t._startAt=Ft.set(P,Ee({data:"isStart",overwrite:!1,parent:O,immediateRender:!0,lazy:V(b),startAt:null,delay:0,onUpdate:_,onUpdateParams:w,callbackScope:S,stagger:0},y))),x)if(n>0)!C&&(t._startAt=0);else if(L)return}else if(M&&L)if(R)!C&&(t._startAt=0);else if(n&&(x=!1),Ie(t._startAt=Ft.set(P,Le(Ae(v,se),{overwrite:!1,data:"isFromStart",lazy:x&&V(b),immediateRender:x,stagger:0,parent:O}))),x){if(!n)return}else e(t._startAt,I);for(r=Ae(v,se),t._pt=0,m=(h=P[0]?ve(P[0]).harness:0)&&v[h.prop],b=L&&V(b)||b&&!L,o=0;o<P.length;o++){if(u=(l=P[o])._gsap||me(P)[o]._gsap,t._ptLookup[o]=p={},ce[u.id]&&we(),f=D===P?o:D.indexOf(l),h&&!1!==(d=new h).init(l,m||r,t,f,D)&&(t._pt=s=new $t(t._pt,l,d.name,0,1,d.render,d,0,d.priority),d._props.forEach((function(e){p[e]=s})),d.priority&&(c=1)),!h||m)for(a in r)ue[a]&&(d=Dt(a,r,t,f,l,D))?d.priority&&(c=1):p[a]=s=Ot.call(t,l,a,"get",r[a],f,D,0,v.stringFilter);t._op&&t._op[o]&&t.kill(l,t._op[o]),N&&t._pt&&(Pt=t,i.killTweensOf(l,p,"started"),Pt=0),t._pt&&b&&(ce[u.id]=1)}c&&Qt(t),t._onInit&&t._onInit(t)}t._from=!k&&!!v.runBackwards,t._onUpdate=_,t._initted=1},kt=function(e,t,n,r,i){return G(e)?e.call(t,n,r,i):F(e)&&~e.indexOf("random(")?nt(e):e},zt=fe+",repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase",Bt=(zt+",id,stagger,delay,duration,paused").split(","),Ft=function(e){function r(t,r,o){var a;"number"==typeof r&&(o.duration=r,r=o,o=null);var s,l,c,u,h,d,p,f,m=(a=e.call(this,function(e){var t=e.parent||i,n=e.keyframes?Ce:Ee;if(V(e.inherit))for(;t;)n(e,t.vars.defaults),t=t.parent;return e}(r),o)||this).vars,v=m.duration,g=m.delay,y=m.immediateRender,x=m.stagger,b=m.overwrite,_=m.keyframes,w=m.defaults,S=q(t)&&H(t[0])?[t]:Ze(t);if(a._targets=S.length?me(S):ie("GSAP target "+t+" not found. https://greensock.com",!R.nullTargetWarn)||[],a._ptLookup=[],a._over
10write=b,_||x||X(v)||X(g)){if(r=a.vars,(s=a.timeline=new At({data:"nested",defaults:w||{}})).kill(),s.parent=n(a),_)Ee(s.vars.defaults,{ease:"none"}),_.forEach((function(e){return s.to(S,e,">")}));else{if(u=S.length,p=x?Je(x):ae,W(x))for(h in x)~zt.indexOf(h)&&(f||(f={}),f[h]=x[h]);for(l=0;l<u;l++){for(h in c={},r)Bt.indexOf(h)<0&&(c[h]=r[h]);c.stagger=0,f&&Le(c,f),r.yoyoEase&&!r.repeat&&(c.yoyoEase=r.yoyoEase),d=S[l],c.duration=+kt(v,n(a),l,d,S),c.delay=(+kt(g,n(a),l,d,S)||0)-a._delay,!x&&1===u&&c.delay&&(a._delay=g=c.delay,a._start+=g,c.delay=0),s.to(d,c,p(l,d,S))}v=g=0}v||a.duration(v=s.duration())}else a.timeline=0;return!0===b&&(Pt=n(a),i.killTweensOf(S),Pt=0),(y||!v&&!_&&a._start===a.parent._time&&V(y)&&Ne(n(a))&&"nested"!==a.parent.data)&&(a._tTime=-1e-8,a.render(Math.max(0,-g))),a}t(r,e);var o=r.prototype;return o.render=function(e,t,n){var r,i,o,a,s,l,c,u,h,d=this._time,p=this._tDur,f=this._dur,m=e>p-I&&e>=0?p:e<I?0:e;if(f){if(m!==this._tTime||!e||n||this._startAt&&this._zTime<0!=e<0){if(r=m,u=this.timeline,this._repeat){if(a=f+this._rDelay,(r=xe(m%a))>f&&(r=f),(o=~~(m/a))&&o===m/a&&(r=f,o--),(l=this._yoyo&&1&o)&&(h=this._yEase,r=f-r),s=ze(this._tTime,a),r===d&&!n&&this._initted)return this;o!==s&&this.vars.repeatRefresh&&!this._lock&&(this._lock=n=1,this.render(a*o,!0).invalidate()._lock=0)}if(!this._initted&&Ge(this,r,n,t))return this._tTime=0,this;for(this._tTime=m,this._time=r,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=c=(h||this._ease)(r/f),this._from&&(this.ratio=c=1-c),d||!r||t||ot(this,"onStart"),i=this._pt;i;)i.r(c,i.d),i=i._next;u&&u.render(e<0?e:!r&&l?-1e-8:u._dur*c,t,n)||this._startAt&&(this._zTime=e),this._onUpdate&&!t&&(e<0&&this._startAt&&this._startAt.render(e,!0,n),ot(this,"onUpdate")),this._repeat&&o!==s&&this.vars.onRepeat&&!t&&this.parent&&ot(this,"onRepeat"),m!==p&&m||this._tTime!==m||(e<0&&this._startAt&&!this._onUpdate&&this._startAt.render(e,!0,n),(e||!f)&&(m&&this._ts>0||!m&&this._ts<0)&&Ie(this,1),t||e<0&&!d||(ot(this,m===p?"onComplete":"onReverseComplete",!0),this._prom&&this._prom()))}}else!function(e,t,n,r){var i,o=e._zTime<0?0:1,a=t<0?0:1,s=e._rDelay,l=0;if(s&&e._repeat&&(l=je(0,e._tDur,t),ze(l,s)!==ze(e._tTime,s)&&(o=1-a,e.vars.repeatRefresh&&e._initted&&e.invali
10date())),(e._initted||!Ge(e,t,r,n))&&(a!==o||r||e._zTime===I||!t&&e._zTime)){for(e._zTime=t||(n?I:0),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=l,n||ot(e,"onStart"),i=e._pt;i;)i.r(a,i.d),i=i._next;!a&&e._startAt&&!e._onUpdate&&e._start&&e._startAt.render(t,!0,r),e._onUpdate&&!n&&ot(e,"onUpdate"),l&&e._repeat&&!n&&e.parent&&ot(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===a&&(e.ratio&&Ie(e,1),n||(ot(e,e.ratio?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}}(this,e,t,n);return this},o.targets=function(){return this._targets},o.invalidate=function(){return this._pt=this._op=this._startAt=this._onUpdate=this._act=this._lazy=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(),e.prototype.invalidate.call(this)},o.kill=function(e,t){if(void 0===t&&(t="all"),!(e||t&&"all"!==t)&&(this._lazy=0,this.parent))return at(this);if(this.timeline)return this.timeline.killTweensOf(e,t,Pt&&!0!==Pt.vars.overwrite),this;var n,r,i,o,a,s,l,c=this._targets,u=e?Ze(e):c,h=this._ptLookup,d=this._pt;if((!t||"all"===t)&&function(e,t){for(var n=e.length,r=n===t.length;r&&n--&&e[n]===t[n];);return n<0}(c,u))return at(this);for(n=this._op=this._op||[],"all"!==t&&(F(t)&&(a={},ye(t,(function(e){return a[e]=1})),t=a),t=function(e,t){var n,r,i,o,a=e[0]?ve(e[0]).harness:0,s=a&&a.aliases;if(!s)return t;for(r in n=Le({},t),s)if(r in n)for(i=(o=s[r].split(",")).length;i--;)n[o[i]]=n[r];return n}(c,t)),l=c.length;l--;)if(~u.indexOf(c[l]))for(a in r=h[l],"all"===t?(n[l]=t,o=r,i={}):(i=n[l]=n[l]||{},o=t),o)(s=r&&r[a])&&("kill"in s.d&&!0!==s.d.kill(a)||Pe(this,s,"_pt"),delete r[a]),"all"!==i&&(i[a]=1);return this._initted&&!this._pt&&d&&at(this),this},r.to=function(e,t){return new r(e,t,arguments[2])},r.from=function(e,t){return new r(e,_e(arguments,1))},r.delayedCall=function(e,t,n,i){return new r(t,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:t,onReverseComplete:t,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:i})},r.fromTo=function(e,t,n){return new r(e,_e(arguments,2))},r.set=function(e,t){return t.duration=0,t.repeatDelay||(t.repeat=0),new r(e,t)},r.killTweensOf=function(e,t,n){return i.killTweensOf(e,t,n)},r}(Rt);Ee(Ft.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ye("staggerTo,staggerFrom,staggerFromTo",(function(e){Ft[e]=function(){var t=new At,n=Ze(arguments);return n.splice("staggerFromTo"===e?5:4,0,0),t[e].apply(t,n)}}));var Gt=function(e,t,n){return e[t]=n},Ht=function(e,t,n){return e[t](n)},Ut=function(e,t,n,r){return e[t](r.fp,n)},Wt=function(e,t,n){return e.setAttribute(t,n)},Vt=function(e,t){return G(e[t])?Ht:U(e[t])&&e.setAttribute?Wt:Gt},jt=function(e,t){return t.set(t.t,t.p,Math.round(1e4*(t.s+t.c*e))/1e4,t)},Xt=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},qt=function(e,t){var n=t._pt,r="";if(!e&&t.b)r=t.b;else if(1===e&&t.e)r=t.e;else{for(;n;)r=n.p+(n.m?n.m(n.s+n.c*e):Math.round(1e4*(n.s+n.c*e))/1e4)+r,n=n._next;r+=t.c}t.set(t.t,t.p,r,t)},Yt=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},Kt=function(e,t,n,r){for(var i,o=this._pt;o;)i=o._next,o.p===r&&o.modifier(e,t,n),o=i},Zt=function(e){for(var t,n,r=this._pt;r;)n=r._next,r.p===e&&!r.op||r.op===e?Pe(this,r,"_pt"):r.dep||(t=1),r=n;return!t},Jt=function(e,t,n,r){r.mSet(e,t,r.m.call(r.tween,n,r.mt),r)},Qt=function(e){for(var t,n,r,i,o=e._pt;o;){for(t=o._next,n=r;n&&n.pr>o.pr;)n=n._next;(o._prev=n?n._prev:i)?o._prev._next=o:r=o,(o._next=n)?n._prev=o:i=o,o=t}e._pt=r},$t=function(){function e(e,t,n,r,i,o,a,s,l){this.t=t,this.s=r,this.c=i,this.p=n,this.r=o||jt,this.d=a||this,this.set=s||Gt,this.pr=l||0,this._next=e,e&&(e._prev=this)}return e.prototype.modifier=function(e,t,n){this.mSet=this.mSet||this.set,this.set=Jt,this.m=e,this.mt=n,this.tween=t},e}();ye(fe+",parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert",(function(e){se[e]=1,"on"===e.substr(0,2)&&(se[e+"Params"]=1)})),ee.TweenMax=ee.TweenLite=Ft,ee.TimelineLite=ee.TimelineMax=At,i=new At({sortChildren:!1,defaults:A,autoRemoveChildren:!0,id:"root"}),R.stringFilter=mt;var en={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.forEach((function(e){return st(e)}))},timeline:function(e){return new At(e)},getTweensOf:function(e,t){return i.getTweensOf(e,t)},getProperty:function(e,t,n,r){F(e)&&(e=Ze(e)[0]);var i=ve(e||{}).get,o=n?Te:Me;return"native"===n&&(n=""),e?t?o((ue[t]&&ue[t].get||i)(e,t,n,r)):function(t,n,r){return o((ue[t]&&ue[t].get||i)(e,t,n,r))}:e}
vendor: 14,726 bytes, line 10
10,quickSetter:function(e,t,n){if((e=Ze(e)).length>1){var r=e.map((function(e){return rn.quickSetter(e,t,n)})),i=r.length;return function(e){for(var t=i;t--;)r[t](e)}}e=e[0]||{};var o=ue[t],a=ve(e),s=o?function(t){var r=new o;u._pt=0,r.init(e,n?t+n:t,u,0,[e]),r.render(1,r),u._pt&&Yt(1,u)}:a.set(e,t);return o?s:function(r){return s(e,t,n?r+n:r,a,1)}},isTweening:function(e){return i.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=St(e.ease,A.ease)),Re(A,e||{})},config:function(e){return Re(R,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,r=e.plugins,i=e.defaults,o=e.extendTimeline;(r||"").split(",").forEach((function(e){return e&&!ue[e]&&!ee[e]&&ie(t+" effect requires "+e+" plugin.")})),he[t]=function(e,t){return n(Ze(e),Ee(t||{},i))},o&&(At.prototype[t]=function(e,n,r){return this.add(he[t](e,W(n)?n:(r=n)&&{}),r)})},registerEase:function(e,t){yt[e]=St(t)},parseEase:function(e,t){return arguments.length?St(e,t):yt},getById:function(e){return i.getById(e)},exportRoot:function(e,t){void 0===e&&(e={});var n,r,o=new At(e);for(o.smoothChildTiming=V(e.smoothChildTiming),i.remove(o),o._dp=0,o._time=o._tTime=i._time,n=i._first;n;)r=n._next,!t&&!n._dur&&n instanceof Ft&&n.vars.onComplete===n._targets[0]||Fe(o,n,n._start-n._delay),n=r;return Fe(i,o,0),o},utils:{wrap:function e(t,n,r){var i=n-t;return q(t)?tt(t,e(0,t.length),n):Ve(r,(function(e){return(i+(e-t)%i)%i+t}))},wrapYoyo:function e(t,n,r){var i=n-t,o=2*i;return q(t)?tt(t,e(0,t.length-1),n):Ve(r,(function(e){return t+((e=(o+(e-t)%o)%o)>i?o-e:e)}))},distribute:Je,random:et,snap:$e,normalize:function(e,t,n){return rt(e,t,0,1,n)},getUnit:Xe,clamp:function(e,t,n){return Ve(n,(function(n){return je(e,t,n)}))},splitColor:ht,toArray:Ze,mapRange:rt,pipe:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduce((function(e,t){return t(e)}),e)}},unitize:function(e,t){return function(n){return e(parseFloat(n))+(t||Xe(n))}},interpolate:function e(t,n,r,i){var o=isNaN(t+n)?0:function(e){return(1-e)*t+e*n};if(!o){var a,s,l,c,u,h=F(t),d={};if(!0===r&&(i=1)&&(r=null),h)t={p:t},n={p:n};else if(q(t)&&!q(n)){for(l=[],c=t.length,u=c-2,s=1;s<c;s++)l.push(e(t[s-1],t[s]));c--,o=function(e){e*=c;var t=Math.min(u,~~e);return l[t](e-t)},r=n}else i||(t=Le(q(t)?[]:{},t));if(!l){for(a in n)Ot.call(d,t,a,"get",n[a]);o=function(e){return Yt(e,d)||(h?t.p:t)}}}return Ve(r,o)}},install:ne,effects:he,ticker:vt,updateRoot:At.updateRoot,plugins:ue,globalTimeline:i,core:{PropTween:$t,globals:oe,Tween:Ft,Timeline:At,Animation:Rt,getCache:ve}};ye("to,from,fromTo,delayedCall,set,killTweensOf",(function(e){return en[e]=Ft[e]})),vt.add(At.updateRoot),u=en.to({},{duration:0});var tn=function(e,t){for(var n=e._pt;n&&n.p!==t&&n.op!==t&&n.fp!==t;)n=n._next;return n},nn=function(e,t){return{name:e,rawVars:1,init:function(e,n,r){r._onInit=function(e){var r,i;if(F(n)&&(r={},ye(n,(function(e){return r[e]=1})),n=r),t){for(i in r={},n)r[i]=t(n[i]);n=r}!function(e,t){var n,r,i,o=e._targets;for(n in t)for(r=o.length;r--;)(i=e._ptLookup[r][n])&&(i=i.d)&&(i._pt&&(i=tn(i,n)),i&&i.modifier&&i.modifier(t[n],e,o[r],n))}(e,n)}}}},rn=en.registerPlugin({name:"attr",init:function(e,t,n,r,i){for(var o in t)this.add(e,"setAttribute",(e.getAttribute(o)||0)+"",t[o],r,i,0,0,o),this._props.push(o)}},{name:"endArray",init:function(e,t){for(var n=t.length;n--;)this.add(e,n,e[n]||0,t[n])}},nn("roundProps",Qe),nn("modifiers"),nn("snap",$e))||en;Ft.version=At.version=rn.version="3.0.5",l=1,j()&>();var on,an,sn,ln,cn,un,hn,dn,pn,fn,mn,vn=yt.Power0,gn=yt.Power1,yn=yt.Power2,xn=yt.Power3,bn=yt.Power4,_n=yt.Linear,wn=yt.Quad,Sn=yt.Cubic,Mn=yt.Quart,Tn=yt.Quint,En=yt.Strong,Cn=yt.Elastic,Ln=yt.Back,Rn=yt.SteppedEase,An=yt.Bounce,Pn=yt.Sine,In=yt.Expo,On=yt.Circ,Dn={},Nn=180/Math.PI,kn=Math.PI/180,zn=Math.atan2,Bn=/([A-Z])/g,Fn=/[-+=\.]*\d+[\.e-]*\d*[a-z%]*/g,Gn=/(?:left|right|width|margin|padding|x)/i,Hn=/[\s,\(]\S/,Un={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Wn=function(e,t){return t.set(t.t,t.p,~~(1e3*(t.s+t.c*e))/1e3+t.u,t)},Vn=function(e,t){return t.set(t.t,t.p,1===e?t.e:~~(1e3*(t.s+t.c*e))/1e3+t.u,t)},jn=function(e,t){return t.set(t.t,t.p,e?~~(1e3*(t.s+t.c*e))/1e3+t.u:t.b,t)},Xn=function(e,t){var n=t.s+t.c*e;t.set(t.t,t.p,~~(n+(n<0?-.5:.5))+t.u,t)},qn=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},Yn=function(e,t){return t.set(t.t,t.p,1!==e?t.b:t.e,t)},Kn=function(e,t,n){return e.style[t]=n},Zn=function(e,t,n){return e.style.setProperty(t,n)},Jn=function(e,t,n){return e._gsap[t]=n},Qn=function(e,t,n){return e._gsap.scaleX=e._gsap.scaleY=n},$n=function(e,t,n,r,i){var o=e._gsap;o.scaleX=o.scaleY=n,o.renderTransform(i,o)},er=function(e,t,n,r,i){var o=e._gsap;o[t]=n,o.renderTransform(i,o)},tr="transform",nr=tr+"Origin",rr=function(e,t){var n=an.createElementNS?an.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):an.createElement(e);return n.style?n:an.createElement(e)},ir=function e(t,n,r){var i=getComputedStyle(t);return i[n]||i.getPropertyValue(n.replace(Bn,"-$1").toLowerCase())||i.getPropertyValue(n)||!r&&e(t,ar(n)||n,1)||""},or="O,Moz,ms,Ms,Webkit".split(","),ar=function(e,t){var n=(t||cn).style,r=5;if(e in n)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);r--&&!(or[r]+e in n););return r<0?null:(3===r?"ms":r>=0?or[r]:"")+e},sr=function(){"undefined"!=typeof window&&(on=window,an=on.document,sn=an.documentElement,cn=rr("div")||{style:{}},un=rr("div"),tr=ar(tr),nr=ar(nr),cn.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",dn=!!ar("perspective"),ln=1)},lr=function e(t){var n,r=rr("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,o=this.nextSibling,a=this.style.cssText;if(sn.appendChild(r),r.appendChild(this),this.style.display="block",t)try{n=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=e}catch(e){}else this._gsapBBox&&(n=this._gsapBBox());return o?i.insertBefore(this,o):i.appendChild(this),sn.removeChild(r),this.style.cssText=a,n},cr=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},ur=function(e){var t;try{t=e.getBBox()}catch(n){t=lr.call(e,!0)}return!t||t.width||t.x||t.y?t:{x:+cr(e,["x","cx","x1"])||0,y:+cr(e,["y","cy","y1"])||0,width:0,height:0}},hr=function(e){return!(!e.getCTM||e.parentNode&&!e.ownerSVGElement||!ur(e))},dr=function(e,t){if(t){var n=e.style;t in Dn&&(t=tr),n.removeProperty?("ms"!==t.substr(0,2)&&"webkit"!==t.substr(0,6)||(t="-"+t),n.removeProperty(t.replace(Bn,"-$1").toLowerCase())):n.removeAttribute(t)}},pr=function(e,t,n,r,i,o){var a=new $t(e._pt,t,n,0,1,o?Yn:qn);return e._pt=a,a.b=r,a.e=i,e._props.push(n),a},fr={deg:1,rad:1,turn:1},mr=function(e,t,n,r){var i,o,a,s,l=parseFloat(n)||0,c=(n+"").trim().substr((l+"").length)||"px",u=cn.style,h=Gn.test(t),d="svg"===e.tagName.toLowerCase(),p=(d?"client":"offset")+(h?"Width":"Height"),f=100,m="px"===r;return r===c||!l||fr[r]||fr[c]?l:(s=e.getCTM&&hr(e),"%"===r&&Dn[t]?xe(l/(s?e.getBBox()[h?"width":"height"]:e[p])*f):(u[h?"width":"height"]=f+(m?c:r),o="em"===r&&e.appendChild&&!d?e:e.parentNode,s&&(o=(e.ownerSVGElement||{}).parentNode),o&&o!==an&&o.appendChild||(o=an.body),(a=o._gsap)&&"%"===r&&a.width&&h&&a.time===vt.time?xe(l/a.width*f):(o.appendChild(cn),i=cn[p],o.removeChild(cn),h&&"%"===r&&((a=ve(o)).time=vt.time,a.width=o[p]),xe(m?i*l/f:f/i*l))))},vr=function(e,t,n,r){var i;return ln||sr(),t in Un&&"transform"!==t&&~(t=Un[t]).indexOf(",")&&(t=t.split(",")[0]),Dn[t]&&"transform"!==t?(i=Cr(e,r),i="transformOrigin"!==t?i[t]:Lr(ir(e,nr))+i.zOrigin+"px"):(!(i=e.style[t])||"auto"===i||r||~(i+"").indexOf("calc("))&&(i=ir(e,t)||ge(e,t)||("opacity"===t?1:0)),n?mr(e,t,i,n)+n:i},gr=function(e,t,n,r){var i,o,a,s,l,c,u,h,d,p,f,m,v=new $t(this._pt,e.style,t,0,1,qt),g=0,y=0;if(v.b=n,v.e=r,n+="","auto"===(r+="")&&(e.style[t]=r,r=ir(e,t)||r,e.style[t]=n),mt(i=[n,r]),r=i[1],!!(c=(n=i[0]).indexOf("rgba("))!=!!(u=r.indexOf("rgba("))&&(c?n=n.substr(c)+" "+n.substr(0,c-1):r=r.substr(u)+" "+r.substr(0,u-1)),a=n.match(Fn)||[],(r.match(Fn)||[]).length){for(;o=Fn.exec(r);)u=o[0],d=r.substring(g,o.index),l?l=(l+1)%5:"rgba("===d.substr(-5)&&(l=1),u!==(c=a[y++]||"")&&(s=parseFloat(c)||0,f=c.substr((s+"").length),(m="="===u.charAt(1)?+(u.charAt(0)+"1"):0)&&(u=u.substr(2)),h=parseFloat(u),p=u.substr((h+"").length),g=Fn.lastIndex-p.length,p||(p=p||R.units[t]||f,g===r.length&&(r+=p,v.e+=p)),f!==p&&(s=mr(e,t,c,p)||0),v._pt={_next:v._pt,p:d||1===y?d:",",s:s,c:m?m*h:h-s,m:l&&l<4?Math.round:0});v.c=g<r.length?r.substring(g,r.length):""}else v.r="display"===t&&"none"===r?Yn:qn;return Q.test(r)&&(v.e=0),this._pt=v,v},yr={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},xr=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var n,r,i,o=t.t,a=o.style,s=t.u;if("all"===s||!0===s)a.cssText="",r=1;else for(i=(s=s.split(",")).length;--i>-1;)n=s[i],Dn[n]&&(r=1,n="transformOrigin"===n?nr:tr),dr(o,n);r&&(dr(o,tr),(r=o._gsap)&&(r.svg&&o.removeAttribute("transform"),Cr(o,1)))}},br={clearProps:function(e,t,n,r,i){if("isFromStart"!==i.data){var o=e._pt=new $t(e._pt,t,n,0,0,xr);return o.u=r,o.pr=-10,o.tween=i,e._props.push(n),1}}},_r=[1,0,0,1,0,0],wr={},Sr=function(e){return"matrix(1, 0, 0, 1, 0, 0)"===e||"none"===e||!e},Mr=function(e){var t=ir(e,tr);return Sr(t)?_r:t.substr(7).match(K).map(xe)},Tr=function(e,t){var n,r,i,o,a=e._gsap,s=e.style,l=Mr(e);return a.svg&&e.getAttribute("transform")?"1,0,0,1,0,0"===(l=[(i=e.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?_r:l:(l!==_r||e.offsetParent||e===sn||a.svg||(i=s.display,s.display="block",(n=e.parentNode)&&e.offsetParent||(o=1,r=e.nextSibling,sn.appendChild(e)),l=Mr(e),i?s.display=i:dr(e,"display"),o&&(r?n.insertBefore(e,r):n?n.appendChild(e):sn.removeChild(e))),t&&l.length>6?[l[0],l[1],l[4],l[5],l[12],l[13]]:l)},Er=function(e,t,n,r,i,o){var a,s,l,c=e._gsap,u=i||Tr(e,!0),h=c.xOrigin||0,d=c.yOrigin||0,p=c.xOffset||0,f=c.yOffset||0,m=u[0],v=u[1],g=u[2],y=u[3],x=u[4],b=u[5],_=t.split(" "),w=parseFloat(_[0])||0,S=parseFloat(_[1])||0;n?u!==_r&&(s=m*y-v*g)&&(l=w*(-v/s)+S*(m/s)-(m*b-v*x)/s,w=w*(y/s)+S*(-g/s)+(g*b-y*x)/s,S=l):(w=(a=ur(e)).x+(~_[0].indexOf("%")?w/100*a.width:w),S=a.y+(~(_[1]||_[0]).indexOf("%")?S/100*a.height:S)),r||!1!==r&&c.smooth?(x=w-h,b=S-d,c.xOffset=p+(x*m+b*g)-x,c.yOffset=f+(x*v+b*y)-b):c.xOffset=c.yOffset=0,c.xOrigin=w,c.yOrigin=S,c.smooth=!!r,c.origin=t,c.originIsAbsolute=!!n,e.style[nr]="0px 0px",o&&(pr(o,c,"xOrigin",h,w),pr(o,c,"yOrigin",d,S),pr(o,c,"xOffset",p,c.xOffset),pr(o,c,"yOffset",f,c.yOffset))},Cr=function(e,t){var n=e._gsap||new Lt(e);if("x"in n&&!t&&!n.uncache)return n;var r,i,o,a,s,l,c,u,h,d,p,f,m,v,g,y,x,b,_,w,S,M,T,E,C,L,A,P,I,O,D=e.style,N=n.scaleX<0,k=n.xOrigin||0,z=n.yOrigin||0,B="px",F="deg",G=ir(e,nr)||"0";return r=i=o=l=c=u=h=d=p=0,a=s=1,n.svg=!(!e.getCTM||!hr(e)),f=Tr(e,n.svg),n.svg&&Er(e,G,n.originIsAbsolute,!1!==n.smooth,f),f!==_r&&(y=f[0],x=f[1],b=f[2],_=f[3],r=w=f[4],i=S=f[5],6===f.length?(a=Math.sqrt(y*y+x*x),s=Math.sqrt(_*_+b*b),l=y||x?zn(x,y)*Nn:0,h=b||_?zn(b,_)*Nn+l:0,n.svg&&(r-=k-(k*y+z*b),i-=z-(k*x+z*_))):(O=f[6],P=f[7],C=f[8],L=f[9],A=f[10],I=f[11],r=f[12],i=f[13],o=f[14],c=(m=zn(O,A))*Nn,m&&(M=w*(v=Math.cos(-m))+C*(g=Math.sin(-m)),T=S*v+L*g,E=O*v+A*g,C=w*-g+C*v,L=S*-g+L*v,A=O*-g+A*v,I=P*-g+I*v,w=M,S=T,O=E),u=(m=zn(-b,A))*Nn,m&&(v=Math.cos(-m),I=_*(g=Math.sin(-m))+I*v,y=M=y*v-C*g,x=T=x*v-L*g,b=E=b*v-A*g),l=(m=zn(x,y))*Nn,m&&(M=y*(v=Math.cos(m))+x*(g=Math.sin(m)),T=w*v+S*g,x=x*v-y*g,S=S*v-w*g,y=M,w=T),c&&Math.abs(c)+Math.abs(l)>359.9&&(c=l=0,u=180-u),a=xe(Math.sqrt(y*y+x*x+b*b)),s=xe(Math.sqrt(S*S+O*O)),m=zn(w,S),h=Math.abs(m)>2e-4?m*Nn:0,p=I?1/(I<0?-I:I):0),n.svg&&(f=e.getAttribute("transform"),n.forceCSS=e.setAttribute("transform","")||!Sr(ir(e,tr)),f&&e.setAttribute("transform",f))),Math.abs(h)>90&&Math.abs(h)<270&&(N?(a*=-1,h+=l<=0?180:-180,l+=l<=0?180:-180):(s*=-1,h+=h<=0?180:-180)),n.x=((n.xPercent=r&&Math.round(e.offsetWidth/2)===Math.round(-r)?-50:0)?0:r)+B,n.y=((n.yPercent=i&&Math.round(e.offsetHeight/2)===Math.round(-i)?-50:0)?0:i)+B,n.z=o+B,n.scaleX=xe(a),n.scaleY=xe(s),n.rotation=xe(l)+F,n.rotationX=xe(c)+F,n.rotationY=xe(u)+F,n.skewX=h+F,n.skewY=d+F,n.transformPerspective=p+B,(n.zOrigin=parseFloat(G.split(" ")[2])||0)&&(D[nr]=Lr(G)),n.xOffset=n.yOffset=0,n.force3D=R.force3D,n.renderTransform=n.svg?Nr:dn?Dr:Ar,n.uncache=0,n},Lr=function(e){return(e=e.split(" "))[0]+" "+e[1]},Rr=function(e,t,n){var r=Xe(t);return xe(parseFloat(t)+parseFloat(mr(e,"x",n+"px",r)))+r},Ar=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Dr(e,t)},Pr="0deg",Ir="0px",Or=") ",Dr=function(e,t){var n=t||this,r=n.xPercent,i=n.yPercent,o=n.x,a=n.y,s=n.z,l=n.rotation,c=n.rotationY,u=n.rotationX,h=n.skewX,d=n.skewY,p=n.scaleX,f=n.scaleY,m=n.transformPerspective,v=n.force3D,g=n.target,y=n.zOrigin,x="",b="auto"===v&&e&&1!==e||!0===v;if(y&&(u!==Pr||c!==Pr)){var _,w=parseFloat(c)*kn,S=Math.sin(w),M=Math.cos(w);w=parseFloat(u)*kn,_=Math.cos(w),o=Rr(g,o,S*_*-y),a=Rr(g,a,-Math.sin(w)*-y),s=Rr(g,s,M*_*-y+y)}(r||i)&&(x="translate("+r+"%, "+i+"%) "),(b||o!==Ir||a!==Ir||s!==Ir)&&(x+=s!==Ir||b?"translate3d("+o+", "+a+", "+s+") ":"translate("+o+", "+a+Or),m!==Ir&&(x+="perspective("+m+Or),l!==Pr&&(x+="rotate("+l+Or),c!==Pr&&(x+="rotateY("+c+Or),u!==Pr&&(x+="rotateX("+u+Or),h===Pr&&d===Pr||(x+="skew("+h+", "+d+Or),1===p&&1===f||(x+="scale("+p+", "+f+Or),g.style[tr]=x||"translate(0, 0)"},Nr=function(e,t){var n,r,i,o,a,s=t||this,l=s.xPercent,c=s.yPercent,u=s.x,h=s.y,d=s.rotation,p=s.skewX,f=s.skewY,m=s.scaleX,v=s.scaleY,g=s.target,y=s.xOrigin,x=s.yOrigin,b=s.xOffset,_=s.yOffset,w=s.forceCSS,S=parseFloat(u),M=parseFloat(h);d=parseFloat(d),p=parseFloat(p),(f=parseFloat(f))&&(p+=f=parseFloat(f),d+=f),d||p?(d*=kn,p*=kn,n=Math.cos(d)*m,r=Math.sin(d)*m,i=Math.sin(d-p)*-v,o=Math.cos(d-p)*v,p&&(f*=kn,a=Math.tan(p-f),i*=a=Math.sqrt(1+a*a),o*=a,f&&(a=Math.tan(f),n*=a=Math.sqrt(1+a*a),r*=a)),n=xe(n),r=xe(r),i=xe(i),o=xe(o)):(n=m,o=v,r=i=0),(S&&!~(u+"").indexOf("px")||M&&!~(h+"").indexOf("px"))&&(S=mr(g,"x",u,"px"),M=mr(g,"y",h,"px")),(y||x||b||_)&&(S=xe(S+y-(y*n+x*i)+b),M=xe(M+x-(y*r+x*o)+_)),(l||c)&&(a=g.getBBox(),S=xe(S+l/100*a.width),M=xe(M+c/100*a.height)),a="matrix("+n+","+r+","+i+","+o+","+S+","+M+")",g.setAttribute("transform",a),w&&(g.style[tr]=a)},kr=function(e,t,n,r,i,o){var a,s,l=360,c=F(i),u=parseFloat(i)*(c&&~i.indexOf("rad")?Nn:1),h=o?u*o:u-r,d=r+h+"deg";return c&&("short"===(a=i.split("_")[1])&&(h%=l)!==h%180&&(h+=h<0?l:-360),"cw"===a&&h<0?h=(h+36e9)%l-~~(h/l)*l:"ccw"===a&&h>0&&(h=(h-36e9)%l-~~(h/l)*l)),e._pt=s=new $t(e._pt,t,n,r,h,Vn),s.e=d,s.u="deg",e._props.push(n),s},zr=function(e,t,n){var r,i,o,a,s,l,c,u=un.style,h=n._gsap;
10for(i in u.cssText=getComputedStyle(n).cssText+";position:absolute;display:block;",u[tr]=t,an.body.appendChild(un),r=Cr(un,1),Dn)(o=h[i])!==(a=r[i])&&"perspective"!==i&&(s=Xe(o)!==(c=Xe(a))?mr(n,i,o,c):parseFloat(o),l=parseFloat(a),e._pt=new $t(e._pt,h,i,s,l-s,Wn),e._pt.u=c,e._props.push(i));an.body.removeChild(un)},Br={name:"css",register:sr,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,i,o){var a,s,l,c,u,h,d,p,f,m,v,g,y,x,b,_,w,S,M,T=this._props,E=e.style;for(d in ln||sr(),t)if("autoRound"!==d&&(s=t[d],!ue[d]||!Dt(d,t,n,i,e,o)))if(u=(0,r.default)(s),h=br[d],"function"===u&&(s=s.call(n,i,e,o),u=(0,r.default)(s)),"string"===u&&~s.indexOf("random(")&&(s=nt(s)),h)h(this,e,d,s,n)&&(b=1);else if("--"===d.substr(0,2))this.add(E,"setProperty",getComputedStyle(e).getPropertyValue(d)+"",s+"",i,o,0,0,d);else{if(a=vr(e,d),c=parseFloat(a),(m="string"===u&&"="===s.charAt(1)?+(s.charAt(0)+"1"):0)&&(s=s.substr(2)),l=parseFloat(s),d in Un&&("autoAlpha"===d&&(1===c&&"hidden"===vr(e,"visibility")&&l&&(c=0),pr(this,E,"visibility",c?"inherit":"hidden",l?"inherit":"hidden",!l)),"scale"!==d&&"transform"!==d&&~(d=Un[d]).indexOf(",")&&(d=d.split(",")[0])),v=d in Dn)if(g||(y=e._gsap,x=!1!==t.smoothOrigin&&y.smooth,(g=this._pt=new $t(this._pt,E,tr,0,1,y.renderTransform,y,0,-1)).dep=1),"scale"===d)this._pt=new $t(this._pt,y,"scaleY",y.scaleY,m?m*l:l-y.scaleY),T.push("scaleY",d),d+="X";else{if("transformOrigin"===d){w=void 0,S=void 0,M=void 0,w=(_=s).split(" "),S=w[0],M=w[1]||"50%","top"!==S&&"bottom"!==S&&"left"!==M&&"right"!==M||(_=S,S=M,M=_),w[0]=yr[S]||S,w[1]=yr[M]||M,s=w.join(" "),y.svg?Er(e,s,0,x,0,this):((f=parseFloat(s.split(" ")[2]))!==y.zOrigin&&pr(this,y,"zOrigin",y.zOrigin,f),pr(this,E,d,Lr(a),Lr(s)));continue}if("svgOrigin"===d){Er(e,s,1,x,0,this);continue}if(d in wr){kr(this,y,d,c,s,m);continue}if("smoothOrigin"===d){pr(this,y,"smooth",y.smooth,s);continue}if("force3D"===d){y[d]=s;continue}if("transform"===d){zr(this,s,e);continue}}else d in E||(d=ar(d)||d);if(v||(l||0===l)&&(c||0===c)&&!Hn.test(s)&&d in E)(p=(a+"").substr((c+"").length))!==(f=(s+"").substr((l+"").length)||(d in R.units?R.units[d]:p))&&(c=mr(e,d,a,f)),this._pt=new $t(this._pt,v?y:E,d,c,m?m*l:l-c,"px"!==f||!1===t.autoRound||v?Wn:Xn),this._pt.u=f||0,p!==f&&(this._pt.b=a,this._pt.r=jn);else if(d in E)gr.call(this,e,d,a,s);else{if(!(d in e)){re(d,s);continue}this.add(e,d,e[d],s,i,o)}T.push(d)}b&&Qt(this)},get:vr,aliases:Un,getSetter:function(e,t,n){return t in Dn&&t!==nr&&(e._gsap.x||vr(e,"x"))?n&&hn===n?"scale"===t?Qn:Jn:(hn=n||{})&&("scale"===t?$n:er):e.style&&!U(e.style[t])?Kn:~t.indexOf("-")?Zn:Vt(e,t)}};rn.utils.checkPrefix=ar,mn=ye((pn="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(fn="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(e){Dn[e]=1})),ye(fn,(function(e){R.units[e]="deg",wr[e]=1})),Un[mn[13]]=pn+","+fn,ye("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,9:rotateX,10:rotateY",(function(e){var t=e.split(":");Un[t[1]]=mn[t[0]]})),ye("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(e){R.units[e]="px"})),rn.registerPlugin(Br);var Fr=rn.registerPlugin(Br)||rn;e.Back=Ln,e.Bounce=An,e.CSSPlugin=Br,e.Circ=On,e.Cubic=Sn,e.Elastic=Cn,e.Expo=In,e.Linear=_n,e.Power0=vn,e.Power1=gn,e.Power2=yn,e.Power3=xn,e.Power4=bn,e.Quad=wn,e.Quart=Mn,e.Quint=Tn,e.Sine=Pn,e.SteppedEase=Rn,e.Strong=En,e.TimelineLite=At,e.TimelineMax=At,e.TweenLite=Ft,e.TweenMax=Ft,e.default=Fr,e.gsap=Fr,"undefined"==typeof window||window!==e?Object.defineProperty(e,"__esModule",{value:!0}):delete window.default}))},{"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":19}],32:[function(e,t,n){"use strict";!function(e){function n(){this._listeners=[],this.dispatchCount=0}var r=n.prototype;r.add=s,r.addOnce=function(t,n,r,a){if(!t)throw i;var l=this,c=function(){return l.remove.call(l,t,n),t.apply(n,o.call(arguments,0))};1===(a=o.call(arguments,0)).length&&a.push(e);a.splice(2,0,c),s.apply(l,a)},r.remove=function(e,t){if(!e)return this._listeners.length=0,!0;var n,r=this._listeners,i=r.length;for(;i--;)if((n=r[i]).f===e&&(!t||n.c===t))return n.j=0,r.splice(i,1),!0;return!1},r.dispatch=function(e){e=o.call(arguments,0),this.dispatchCount++;var t,n,r=this.dispatchCount,i=this._listeners,a=i.length;for(;a--;)if((t=i[a])&&t.j<r&&(t.j=r,!1===t.r.apply(t.c,t.a.concat(e)))){n=t;break}i=this._listeners,a=i.length;for(;a--;)i[a].j=0;return n};var i="Callback function is missing!",o=Array.prototype.slice;function a(e){e.sort((function(e,t){return e=e.p,(t=t.p)<e?1:e>t?-1:0}))}function s(e,t,n,r){if(!e)throw i;n=n||0;for(var s,l,c,u=this._listeners,h=u.length;h--;)if((s=u[h]).f===e&&s.c===t)return!1;"function"==typeof n&&(l=n,n=r,c=4),u.unshift({f:e,c:t,p:n,r:l||e,a:o.call(arguments,c||3),j:0}),a(u)}void 0!==t&&(t.exports=n)}()},{}],33:[function(e,t,n){"use strict";
10t.exports=function(e,t,n){if(null!=e)for(var r=-1,i=e.length;++r<i&&!1!==t.call(n,e[r],r,e););}},{}],34:[function(e,t,n){"use strict";var r=e("../random/randInt");t.exports=function(e){var t,n=[];if(null==e)return n;for(var i=-1,o=e.length;++i<o;)i?(t=r(0,i),n[i]=n[t],n[t]=e[i]):n[0]=e[0];return n}},{"../random/randInt":60}],35:[function(e,t,n){"use strict";var r=e("./kindOf"),i=e("./isPlainObject"),o=e("../object/mixIn");t.exports=function(e){switch(r(e)){case"Object":return i(a=e)?o({},a):a;case"Array":return e.slice();case"RegExp":return n="",n+=(t=e).multiline?"m":"",n+=t.global?"g":"",n+=t.ignoreCase?"i":"",new RegExp(t.source,n);case"Date":return new Date(+e);default:return e}var t,n,a}},{"../object/mixIn":54,"./isPlainObject":43,"./kindOf":45}],36:[function(e,t,n){"use strict";var r=e("./clone"),i=e("../object/forOwn"),o=e("./kindOf"),a=e("./isPlainObject");function s(e,t){switch(o(e)){case"Object":return function(e,t){if(a(e)){var n={};return i(e,(function(e,n){this[n]=s(e,t)}),n),n}return t?t(e):e}(e,t);case"Array":return function(e,t){var n=[],r=-1,i=e.length;for(;++r<i;)n[r]=s(e[r],t);return n}(e,t);default:return r(e)}}t.exports=s},{"../object/forOwn":50,"./clone":35,"./isPlainObject":43,"./kindOf":45}],37:[function(e,t,n){"use strict";var r=e("./isKind"),i=Array.isArray||function(e){return r(e,"Array")};t.exports=i},{"./isKind":40}],38:[function(e,t,n){"use strict";var r=e("./isKind");t.exports=function(e){return r(e,"Boolean")}},{"./isKind":40}],39:[function(e,t,n){"use strict";var r=e("./isNumber");t.exports=function(e){return r(e)&&e%1==0}},{"./isNumber":41}],40:[function(e,t,n){"use strict";var r=e("./kindOf");t.exports=function(e,t){return r(e)===t}},{"./kindOf":45}],41:[function(e,t,n){"use strict";var r=e("./isKind");t.exports=function(e){return r(e,"Number")}},{"./isKind":40}],42:[function(e,t,n){"use strict";var r=e("./isKind");t.exports=function(e){return r(e,"Object")}},{"./isKind":40}],43:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof"));t.exports=function(e){return!!e&&"object"===(0,r.default)(e)&&e.constructor===Object}},{"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":19}],44:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof"));t.exports=function(e){switch((0,r.default)(e)){case"string":case"number":case"boolean":return!0}return null==e}},{"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":19}],45:[function(e,t,n){"use strict";t.exports=function(e){return Object.prototype.toString.call(e).slice(8,-1)}},{}],46:[function(e,t,n){"use strict";t.exports=function(e){return null==e?"":e.toString()}},{}],47:[function(e,t,n){"use strict";t.exports=2147483647},{}],48:[function(e,t,n){"use strict";t.exports=-2147483648},{}],49:[function(e,t,n){"use strict";var r,i,o=e("./hasOwn");function a(e,t,n,r){return e.call(r,t[n],n,t)}t.exports=function(e,t,n){var s,l=0;for(s in null==r&&function(){for(var e in i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],r=!0,{toString:null})r=!1}(),e)if(!1===a(t,e,s,n))break;if(r)for(var c=e.constructor,u=!!c&&e===c.prototype;(s=i[l++])&&("constructor"===s&&(u||!o(e,s))||e[s]===Object.prototype[s]||!1!==a(t,e,s,n)););}},{"./hasOwn":52}],50:[function(e,t,n){"use strict";var r=e("./hasOwn"),i=e("./forIn");t.exports=function(e,t,n){i(e,(function(i,o){if(r(e,o))return t.call(n,e[o],o,e)}))}},{"./forIn":49,"./hasOwn":52}],51:[function(e,t,n){"use strict";e("../lang/isPrimitive");t.exports=function(e,t){for(var n=t.split("."),r=n.pop();t=n.shift();)if(null==(e=e[t]))return;return e[r]}},{"../lang/isPrimitive":44}],52:[function(e,t,n){"use strict";t.exports=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},{}],53:[function(e,t,n){"use strict";var r=e("./hasOwn"),i=e("../lang/deepClone"),o=e("../lang/isObject");t.exports=function e(){var t,n,a,s,l=1;for(s=i(arguments[0]);a=arguments[l++];)for(t in a)r(a,t)&&(n=a[t],o(n)&&o(s[t])?s[t]=e(s[t],n):s[t]=i(n));return s}},{"../lang/deepClone":36,"../lang/isObject":42,"./hasOwn":52}],54:[function(e,t,n){"use strict";var r=e("./forOwn");function i(e,t){this[t]=e}t.exports=function(e,t){for(var n,o=0,a=arguments.length;++o<a;)null!=(n=arguments[o])&&r(n,i,e);return e}},{"./forOwn":50}],55:[function(e,t,n){"use strict";var r=e("../string/typecast"),i=e("../lang/isArray"),o=e("../object/hasOwn");t.exports=function(e,t){for(var n,a,s,l,c=(e||"").replace("?","").split("&"),u=-1,h={};a=c[++u];)n=a.indexOf("="),l=a.substring(0,n),s=decodeURIComponent(a.substring(n+1)),!1!==t&&(s=r(s)),o(h,l)?i(h[l])?h[l].push(s):h[l]=[h[l],s]:h[l]=s;return h}},{"../lang/isArray":37,"../object/hasOwn":52,"../string/typecast":66}],56:[function(e,t,n){"use strict";var r=e("../object/forOwn"),i=e("../lang/isArray"),o=e("../array/forEach");t.exports=function(e){var t,n,a=[];return r(e,(function(e,r){i(e)?(t=r+"=",n=new RegExp("&"+r+"+=$"),o(e,(function(e){t+=encodeURIComponent(e)+"&"+r+"="})),a.push(t.replace(n,""))):a.push(r+"="+encodeURIComponent(e))})),a.length?"?"+a.join("&"):""}},{"../array/forEach":33,"../lang/isArray":37,"../object/forOwn":50}],57:[function(e,t,n){"use strict";
10t.exports=function(e){var t=/\?[a-zA-Z0-9\=\&\%\$\-\_\.\+\!\*\'\(\)\,]+/.exec(e);return t?decodeURIComponent(t[0].replace(/\+/g," ")):""}},{}],58:[function(e,t,n){"use strict";var r=e("./decode"),i=e("./getQuery");t.exports=function(e,t){return r(i(e),t)}},{"./decode":55,"./getQuery":57}],59:[function(e,t,n){"use strict";var r=e("./random"),i=e("../number/MIN_INT"),o=e("../number/MAX_INT");t.exports=function(e,t){return(e=null==e?i:e)+((t=null==t?o:t)-e)*r()}},{"../number/MAX_INT":47,"../number/MIN_INT":48,"./random":61}],60:[function(e,t,n){"use strict";var r=e("../number/MIN_INT"),i=e("../number/MAX_INT"),o=e("./rand");t.exports=function(e,t){return e=null==e?r:~~e,t=null==t?i:~~t,Math.round(o(e-.5,t+.499999999999))}},{"../number/MAX_INT":47,"../number/MIN_INT":48,"./rand":59}],61:[function(e,t,n){"use strict";function r(){return r.get()}r.get=Math.random,t.exports=r},{}],62:[function(e,t,n){"use strict";t.exports=[" ","\n","\r","\t","\f","\v","Â ","á","á ","â","â","â","â","â","â
","â","â","â","â","â","\u2028","\u2029","â¯","â","ã"]},{}],63:[function(e,t,n){"use strict";var r=e("../lang/toString"),i=e("./WHITE_SPACES");t.exports=function(e,t){e=r(e),t=t||i;for(var n,o,a=0,s=e.length,l=t.length,c=!0;c&&a<s;)for(c=!1,n=-1,o=e.charAt(a);++n<l;)if(o===t[n]){c=!0,a++;break}return a>=s?"":e.substr(a,s)}},{"../lang/toString":46,"./WHITE_SPACES":62}],64:[function(e,t,n){"use strict";var r=e("../lang/toString"),i=e("./WHITE_SPACES");t.exports=function(e,t){e=r(e),t=t||i;for(var n,o,a=e.length-1,s=t.length,l=!0;l&&a>=0;)for(l=!1,n=-1,o=e.charAt(a);++n<s;)if(o===t[n]){l=!0,a--;break}return a>=0?e.substring(0,a+1):""}},{"../lang/toString":46,"./WHITE_SPACES":62}],65:[function(e,t,n){"use strict";var r=e("../lang/toString"),i=e("./WHITE_SPACES"),o=e("./ltrim"),a=e("./rtrim");t.exports=function(e,t){return e=r(e),o(a(e,t=t||i),t)}},{"../lang/toString":46,"./WHITE_SPACES":62,"./ltrim":63,"./rtrim":64}],66:[function(e,t,n){"use strict";var r;t.exports=function(e){return null===e||"null"===e?null:"true"===e||"false"!==e&&(e===r||"undefined"===e?r:""===e||isNaN(e)?e:parseFloat(e))}},{}],67:[function(e,t,n){"use strict";t.exports=e("./src/quickLoader"),e("./src/types/JSONPItem"),e("./src/types/JSONItem"),e("./src/types/TextItem"),e("./src/types/AudioItem"),e("./src/types/VideoItem"),e("./src/types/AnyItem"),e("./src/types/ImageItem"),e("./src/types/XHRItem")},{"./src/quickLoader":68,"./src/types/AnyItem":70,"./src/types/AudioItem":71,"./src/types/ImageItem":72,"./src/types/JSONItem":73,"./src/types/JSONPItem":74,"./src/types/TextItem":75,"./src/types/VideoItem":76,"./src/types/XHRItem":77}],68:[function(e,t,n){"use strict";var r,i=e("min-signal");function o(){this.isLoading=!1,this.totalWeight=0,this.loadedWeight=0,this.itemUrls={},this.itemList=[],this.loadingSignal=new i,this.crossOriginMap={},this.queue=[],this.activeItems=[],this.maxActiveItems=4}var a=o.prototype;a.addChunk=function(e,t){var n,r,i,o,a,s=m(e,t);for(n=0,i=s.length;n<i;n++)for(a=s[n],r=0,o=a.items.length;r<o;r++)this.add(a.items[r],{type:a.type});return s},a.setCrossOrigin=function(e,t){this.crossOriginMap[e]=t},a.add=function(e,t){var n=s[e];n||(n=this._createItem(e,t&&t.type?t.type:v(e).type,t));t&&t.onLoad&&n.onLoaded.addOnce(t.onLoad);this.itemUrls[e]||(this.itemUrls[e]=n,this.itemList.push(n),this.totalWeight+=n.weight);return n},a.load=function(e,t){var n=s[e];n||(n=this._createItem(e,t&&t.type?t.type:v(e).type,t));t&&t.onLoad&&n.onLoaded.addOnce(t.onLoad);l[e]?n.dispatch():n.isStartLoaded||n.load();return n},a.start=function(e){e&&this.loadingSignal.add(e);this.isLoading=!0;var t=this.itemList.length;if(t){var n,i=this.itemList.splice(0,this.itemList.length);for(var o in this.itemUrls)delete this.itemUrls[o];for(var a=0;a<t;a++){n=i[a];var s=!!l[n.url];n.onLoaded.addOnce(p,this,-1024,n,i,s),n.hasLoading&&n.loadingSignal.add(h,this,-1024,n,i,r),s?n.dispatch(p):n.isStartLoaded||this.queue.push(n)}this.queue.length&&this.loadNext()}else p.call(this,r,this.itemList)},a.loadNext=function(){if(this.queue.length&&this.activeItems.length<this.maxActiveItems){var e=this.queue.shift();this.activeItems.push(e),this.loadNext(),e.load()}},a._createItem=function(e,t,n){if(!(n=n||{}).crossOrigin)for(var r in this.crossOriginMap)if(0===e.indexOf(r)){n.crossOrigin=this.crossOriginMap[r];break}return new u[t](e,n)},a._onLoading=h,a.VERSION="0.1.17",a.register=function(e){u[e.type]||(c.push(e),u[e.type]=e)},a.retrieveAll=m,a.retrieve=v,a.testExtensions=g,a.create=y,a.check=function(){var e=[],t=[];for(var n in s)e.push(n),l[n]||t.push(s[n]);console.log({added:e,notLoaded:t})};var s=a.addedItems={},l=a.loadedItems={},c=a.ITEM_CLASS_LIST=[],u=a.ITEM_CLASSES={};t.exports=y();function h(e,t,n,i,o){e&&!e.isLoaded&&1===e.getCombinedPercent(i)||(o===r&&(this.loadedWeight=d(t),o=this.loadedWeight/this.totalWeight),(n=n||this.loadingSignal).dispatch(o,e))}function d(e){for(var t=0,n=0,r=e.length;n<r;n++)t+=e[n].loadedWeight;return t}function p(e,t,n){if(this.loadedWeight=d(t),!n)for(var r=this.activeItems,o=r.length;o--;)if(r[o]===e){r.splice(o,1);break}var a=this.loadingSignal;this.loadedWeight===this.totalWeight?(this.isLoading=!1,this.loadedWeight=0,this.totalWeight=0,this.loadingSignal=new i,this._onLoading(e,t,a,1,1),e&&e.noCache&&f(e)):(this._onLoading(e,t,a,1,this.loadedWeight/this.totalWeight),e&&e.noCache&&f(e),n||this.loadNext())}function f(e){var t=e.url;e.content=r,s[t]=r,l[t]=r}function m(e,t){var n,r,i=e.length,o=[];if(i&&"string"!=typeof e)for(n=0;n<i;
10n++)(r=v(e[n],t))&&(o=o.concat(r));else(r=v(e,t))&&(o=o.concat(r));return o}function v(e,t){var n,i,o,a,s;if(t)o=(a=u[t]).retrieve(e);else for(n=0,i=c.length;n<i;n++){if(s=(a=c[n]).type,"string"==typeof e){if(g(e,a)){o=[e];break}}else if((o=a.retrieve(e))&&o.length&&"string"==typeof o[0]&&g(o[0],a))break;o=r,s=r}if(o)return{type:t||s,items:o}}function g(e,t){if(e){for(var n=function(e){return e.split(".").pop().split(/#|\?/)[0]}(e),r=t.extensions,i=r.length;i--;)if(n===r[i])return!0;return!1}}function y(){return new o}},{"min-signal":32}],69:[function(e,t,n){"use strict";var r=e("min-signal"),i=e("../quickLoader");function o(e,t){if(e){for(var n in this.url=e,this.loadedWeight=0,this.weight=1,this.postPercent=0,t)this[n]=t[n];this.type||(this.type=this.constructor.type),this.hasLoading&&(this.loadingSignal=new r,this.loadingSignal.add(s,this),this.onLoading&&this.loadingSignal.add(this.onLoading)),this.onPost?(this.onPostLoadingSignal=new r,this.onPostLoadingSignal.add(this._onPostLoading,this),this.postWeightRatio=this.postWeightRatio||.1):this.postWeightRatio=0;var o=this;this.boundOnLoad=function(){o._onLoad()},this.onLoaded=new r,i.addedItems[e]=this}}t.exports=o;var a=o.prototype;function s(e){this.loadedWeight=this.weight*this.getCombinedPercent(e)}a.load=function(){this.isStartLoaded=!0},a._onLoad=function(){this.onPost?this.onPost.call(this,this.content,this.onPostLoadingSignal):this._onLoadComplete()},a._onLoading=s,a._onPostLoading=function(e){this.postPercent=e,this.hasLoading&&this.loadingSignal.dispatch(1);1===e&&this._onLoadComplete()},a._onLoadComplete=function(){this.isLoaded=!0,this.loadedWeight=this.weight,i.loadedItems[this.url]=this,this.onLoaded.dispatch(this.content)},a.getCombinedPercent=function(e){return e*(1-this.postWeightRatio)+this.postWeightRatio*this.postPercent},a.dispatch=function(){this.hasLoading&&this.loadingSignal.remove();this.onLoaded.dispatch(this.content)},o.extensions=[],o.retrieve=function(){return!1}},{"../quickLoader":68,"min-signal":32}],70:[function(e,t,n){"use strict";var r=e("./AbstractItem"),i=e("../quickLoader");function o(e,t){e&&(a.constructor.call(this,e,t),!this.loadFunc&&console&&console[console.error||console.log]("require loadFunc in the config object."))}t.exports=o,o.type="any",o.extensions=[],i.register(o),o.retrieve=function(){return!1};var a=r.prototype,s=o.prototype=new r;s.constructor=o,s.load=function(){var e=this;this.loadFunc(this.url,(function(t){e.content=t,a._onLoad.call(e)}),this.loadingSignal)}},{"../quickLoader":68,"./AbstractItem":69}],71:[function(e,t,n){"use strict";var r,i=e("./AbstractItem"),o=e("../quickLoader");function a(e,t){if(e){this.loadThrough=!t||t.loadThrough===r||t.loadThrough,s.constructor.apply(this,arguments);try{this.content=this.content||new Audio}catch(e){this.content=this.content||document.createElement("audio")}this.crossOrigin&&(this.content.crossOrigin=this.crossOrigin)}}t.exports=a,a.type="audio",a.extensions=["mp3","ogg"],o.register(a),a.retrieve=function(e){return!1};var s=i.prototype,l=a.prototype=new i;l.constructor=a,l.load=function(){s.load.apply(this,arguments);var e=this,t=e.content;t.src=this.url,this.loadThrough?t.addEventListener("canplaythrough",this.boundOnLoad,!1):t.addEventListener("canplay",this.boundOnLoad,!1);t.load()},l._onLoad=function(){if(this.content.removeEventListener("canplaythrough",this.boundOnLoad,!1),this.content.removeEventListener("canplay",this.boundOnLoad,!1),this.isLoaded)return;s._onLoad.call(this)}},{"../quickLoader":68,"./AbstractItem":69}],72:[function(e,t,n){"use strict";var r=e("./AbstractItem"),i=e("computed-style"),o=e("../quickLoader");function a(e,t){e&&(s.constructor.apply(this,arguments),this.content=this.content||new Image,this.crossOrigin&&(this.content.crossOrigin=this.crossOrigin))}t.exports=a;var s=r.prototype,l=a.prototype=new r;l.constructor=a,l.load=function(){s.load.apply(this,arguments);var e=this.content;e.onload=this.boundOnLoad,e.src=this.url},l._onLoad=function(){delete this.content.onload,this.width=this.content.width,this.height=this.content.height,s._onLoad.call(this)},a.retrieve=function(e){if(e.nodeType&&e.style){var t=[];"img"===e.nodeName.toLowerCase()&&e.src.indexOf(";")<0&&t.push(e.src),i(e,"background-image").replace(/s?url\(\s*?['"]?([^;]*?)['"]?\s*?\)/g,(function(e,n){t.push(n)}));for(var n=t.length;n--;)0===t[n].indexOf("data:")&&t.splice(n,1);return!!t.length&&t}return"string"==typeof e&&[e]},a.type="image",a.extensions=["jpg","gif","png"],o.register(a)},{"../quickLoader":68,"./AbstractItem":69,"computed-style":29}],73:[function(require,module,exports){"use strict";var TextItem=require("./TextItem"),quickLoader=require("../quickLoader");function JSONItem(e){e&&_super.constructor.apply(this,arguments)}module.exports=JSONItem,JSONItem.type="json",JSONItem.extensions=["json"],quickLoader.register(JSONItem),JSONItem.retrieve=function(){return!1};var _super=TextItem.prototype,_p=JSONItem.prototype=new TextItem;function _onLoad(){this.content||(this.content=window.JSON&&window.JSON.parse?JSON.parse(this.xmlhttp.responseText.toString()):eval(this.xmlhttp.responseText.toString())),_super._onLoad.call(this)}_p.constructor=JSONItem,_p._onLoad=_onLoad},{"../quickLoader":68,"./TextItem":75}],74:[function(e,t,n){"use strict";var r=e("./AbstractItem"),i=e("../quickLoader");function o(){return"_jsonp"+(new Date).getTime()+~~(1e8*Math.random())}function a(e){e&&s.constructor.apply(this,arguments)}t.exports=a,a.type="jsonp",a.extensions=[],i.register(a),a.retrieve=function(e){return"string"==typeof e&&e.indexOf("=")>-1&&[e]};var s=r.prototype,l=a.prototype=new r;l.constructor=a,l.load=function(e){s.load.apply(this,arguments);var t=this,n=this.url.lastIndexOf("=")+1,r=this.url.substr(0,n),i=this.url.substr(n);0===i.length?(i=o(),this.jsonpCallback=e):this.jsonpCallback=this.jsonpCallback||window[i];window[i]=function(e){a.parentNode&&a.parentNode.removeChild(a),t.content=e,t._onLoad()};var a=document.createElement("script");a.type="text/javascript",a.src=r+i,document.getElementsByTagName("head")[0].appendChild(a)}},{"../quickLoader":68,"./AbstractItem":69}],75:[function(e,t,n){"use strict";var r=e("./XHRItem"),i=e("../quickLoader");function o(e,t){e&&(t.responseType="text",a.constructor.apply(this,arguments))}t.exports=o,o.type="text",o.extensions=["html","txt","svg"],i.register(o),o.retrieve=function(){return!1};var a=r.prototype,s=o.prototype=new r;s.constructor=o,s._onLoad=function(){this.content||(this.content=this.xmlhttp.responseText);a._onLoad.apply(this,arguments)}},{"../quickLoader":68,"./XHRItem":77}],76:[function(e,t,n){"use strict";var r,i=e("./AbstractItem"),o=e("../quickLoader");function a(e,t){if(e){this.loadThrough=!t||t.loadThrough===r||t.loadThrough,s.constructor.apply(this,arguments);try{this.content=this.content||new Video}catch(e){this.content=this.content||document.createElement("video")}this.crossOrigin&&(this.content.crossOrigin=this.crossOrigin)}}t.exports=a,a.type="video",a.extensions=["mp4","webm","ogv"],o.register(a),a.retrieve=function(e){return!1};var s=i.prototype,l=a.prototype=new i;l.constructor=a,l.load=function(){s.load.apply(this,arguments);var e=this.content;e.preload="auto",e.src=this.url,this.loadThrough?e.addEventListener("canplaythrough",this.boundOnLoad,!1):e.addEventListener("canplay",this.boundOnLoad,!1);e.load()},l._onLoad=function(){if(this.content.removeEventListener("canplaythrough",this.boundOnLoad),this.content.removeEventListener("canplay",this.boundOnLoad),this.isLoaded)return;s._onLoad.call(this)}},{"../quickLoader":68,"./AbstractItem":69}],77:[function(e,t,n){"use strict";var r=e("./AbstractItem"),i=e("../quickLoader"),o=!!window.XMLHttpRequest;function a(e){e&&(s.constructor.apply(this,arguments),this.responseType=this.responseType||"",this.method=this.method||"GET")}t.exports=a,a.type="xhr",a.extensions=[],i.register(a),a.retrieve=function(){return!1};var s=r.prototype,l=a.prototype=new r;l.constructor=a,l.load=function(){s.load.apply(this,arguments);var e,t=this;e=this.xmlhttp=o?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");this.hasLoading&&(e.onprogress=function(e){t._onXmlHttpProgress(e)});e.onreadystatechange=function(){t._onXmlHttpChange()},e.open(this.method,this.url,!0),this.xmlhttp.responseType=this.responseType,o?e.send(null):e.send()},l._onXmlHttpChange=function(){4===this.xmlhttp.readyState&&200===this.xmlhttp.status&&this._onLoad(this.xmlhttp)}
10,l._onXmlHttpProgress=function(e){this.loadingSignal.dispatch(e.loaded/e.total)},l._onLoad=function(){this.content||(this.content=this.xmlhttp.response);this.xmlhttp=undefined,s._onLoad.call(this)}},{"../quickLoader":68,"./AbstractItem":69}],78:[function(e,t,n){(function(n){(function(){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof")),i=256,o=[],a=void 0===n?window:n,s=Math.pow(i,6),l=Math.pow(2,52),c=2*l,u=255,h=Math.random;function d(e){var t,n=e.length,r=this,o=0,a=r.i=r.j=0,s=r.S=[];for(n||(e=[n++]);o<i;)s[o]=o++;for(o=0;o<i;o++)s[o]=s[a=u&a+e[o%n]+(t=s[o])],s[a]=t;(r.g=function(e){for(var t,n=0,o=r.i,a=r.j,s=r.S;e--;)t=s[o=u&o+1],n=n*i+s[u&(s[o]=s[a=u&a+t])+(s[a]=t)];return r.i=o,r.j=a,n})(i)}function p(e,t){var n,i=[],o=(0,r.default)(e)[0];if(t&&"o"==o)for(n in e)try{i.push(p(e[n],t-1))}catch(e){}return i.length?i:"s"==o?e:e+"\0"}function f(e,t){for(var n,r=e+"",i=0;i<r.length;)t[u&i]=u&(n^=19*t[u&i])+r.charCodeAt(i++);return v(t)}function m(e){try{return a.crypto.getRandomValues(e=new
10Uint8Array(i)),v(e)}catch(e){return[+new Date,a,a.navigator&&a.navigator.plugins,a.screen,v(o)]}}function v(e){return String.fromCharCode.apply(0,e)}t.exports=function(e,n){if(n&&!0===n.global)return n.global=!1,Math.random=t.exports(e,n),n.global=!0,Math.random;var r=n&&n.entropy||!1,a=[],u=(f(p(r?[e,v(o)]:0 in arguments?e:m(),3),a),new d(a));return f(v(u.S),o),function(){for(var e=u.g(6),t=s,n=0;e<l;)e=(e+n)*i,t*=i,n=u.g(1);for(;e>=c;)e/=2,t/=2,n>>>=1;return(e+n)/t}},t.exports.resetGlobal=function(){Math.random=h},f(Math.random(),o)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":19}],79:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof"));!function(e,i){"object"===(void 0===n?"undefined":(0,r.default)(n))&&void 0!==t?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((e="undefined"!=typeof globalThis?globalThis:e||self).THREE={})}(void 0,(function(e){void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t});var t=100,n=300,i=301,o=302,a=303,s=304,l=306,c=307,u=1e3,h=1001,d=1002,p=1003,f=1004,m=1005,v=1006,g=1007,y=1008,x=1009,b=1012,_=1014,w=1015,S=1016,M=1020,T=1022,E=1023,C=1026,L=1027,R=33776,A=33777,P=33778,I=33779,O=35840,D=35841,N=35842,k=35843,z=37492,B=37496,F=2300,G=2301,H=2302,U=2400,W=2401,V=2402,j=2500,X=2501,q=3e3,Y=3001,K=3007,Z=3002,J=3004,Q=3005,$=3006,ee=7680,te=35044,ne=35048,re="300 es";function ie(){}Object.assign(ie.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e)}}}});for(var oe=[],ae=0;ae<256;ae++)oe[ae]=(ae<16?"0":"")+ae.toString(16);var se=1234567,le={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(oe[255&e]+oe[e>>8&255]+oe[e>>16&255]+oe[e>>24&255]+"-"+oe[255&t]+oe[t>>8&255]+"-"+oe[t>>16&15|64]+oe[t>>24&255]+"-"+oe[63&n|128]+oe[n>>8&255]+"-"+oe[n>>16&255]+oe[n>>24&255]+oe[255&r]+oe[r>>8&255]+oe[r>>16&255]+oe[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(se=e%2147483647),((se=16807*se%2147483647)-1)/2147483646},degToRad:function(e){return e*le.DEG2RAD},radToDeg:function(e){return e*le.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){var o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),c=o((t+r)/2),u=a((t+r)/2),h=o((t-r)/2),d=a((t-r)/2),p=o((r-t)/2),f=a((r-t)/2);switch(i){case"XYX":e.set(s*u,l*h,l*d,s*c);break;case"YZY":e.set(l*d,s*u,l*h,s*c);break;case"ZXZ":e.set(l*h,l*d,s*u,s*c);break;case"XZX":e.set(s*u,l*f,l*p,s*c);break;case"YXY":e.set(l*p,s*u,l*f,s*c);break;case"ZYZ":e.set(l*f,l*p,s*u,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};function ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ue(e,t,n){return t&&ce(e.prototype,t),n&&ce(e,n),e}function he(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function de(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var pe,fe=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=0),Object.defineProperty(this,"isVector2",{value:!0}),this.x=e,this.y=t}var t=e.prototype;return t.set=function(e,t){return this.x=e,this.y=t,this},t.setScalar=function(e){return this.x=e,this.y=e,this},t.setX=function(e){return this.x=e,this},t.setY=function(e){return this.y=e,this},t.setComponent=function(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},t.getComponent=function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},t.clone=function(){return new this.constructor(this.x,this.y)},t.copy=function(e){return this.x=e.x,this.y=e.y,this},t.add=function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},t.addScalar=function(e){return this.x+=e,this.y+=e,this},t.addVectors=function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},t.addScaledVector=function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},t.sub=function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.
10y,this)},t.subScalar=function(e){return this.x-=e,this.y-=e,this},t.subVectors=function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},t.multiply=function(e){return this.x*=e.x,this.y*=e.y,this},t.multiplyScalar=function(e){return this.x*=e,this.y*=e,this},t.divide=function(e){return this.x/=e.x,this.y/=e.y,this},t.divideScalar=function(e){return this.multiplyScalar(1/e)},t.applyMatrix3=function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},t.min=function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},t.max=function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},t.clamp=function(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},t.clampScalar=function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},t.clampLength=function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},t.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},t.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},t.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},t.roundToZero=function(){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},t.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.dot=function(e){return this.x*e.x+this.y*e.y},t.cross=function(e){return this.x*e.y-this.y*e.x},t.lengthSq=function(){return this.x*this.x+this.y*this.y},t.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)},t.normalize=function(){return this.divideScalar(this.length()||1)},t.angle=function(){var e=Math.atan2(-this.y,-this.x)+Math.PI;return e},t.distanceTo=function(e){return Math.sqrt(this.distanceToSquared(e))},t.distanceToSquared=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},t.manhattanDistanceTo=function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},t.setLength=function(e){return this.normalize().multiplyScalar(e)},t.lerp=function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},t.lerpVectors=function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this},t.equals=function(e){return e.x===this.x&&e.y===this.y},t.fromArray=function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},t.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},t.fromBufferAttribute=function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},t.rotateAround=function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*n-o*r+e.x,this.y=i*r+o*n+e.y,this},t.random=function(){return this.x=Math.random(),this.y=Math.random(),this},ue(e,[{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}}]),e}(),me=function(){function e(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}var t=e.prototype;return t.set=function(e,t,n,r,i,o,a,s,l){var c=this.elements;return c[0]=e,c[1]=r,c[2]=a,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=o,c[8]=l,this},t.identity=function(){return this.set(1,0,0,0,1,0,0,0,1),this},t.clone=function(){return(new this.constructor).fromArray(this.elements)},t.copy=function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},t.extractBasis=function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this},t.setFromMatrix4=function(e){var 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},t.multiply=function(e){return this.multiplyMatrices(this,e)},t.premultiply=function(e){return this.multiplyMatrices(e,this)},t.multiplyMatrices=function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[3],s=n[6],l=n[1],c=n[4],u=n[7],h=n[2],d=n[5
10],p=n[8],f=r[0],m=r[3],v=r[6],g=r[1],y=r[4],x=r[7],b=r[2],_=r[5],w=r[8];return i[0]=o*f+a*g+s*b,i[3]=o*m+a*y+s*_,i[6]=o*v+a*x+s*w,i[1]=l*f+c*g+u*b,i[4]=l*m+c*y+u*_,i[7]=l*v+c*x+u*w,i[2]=h*f+d*g+p*b,i[5]=h*m+d*y+p*_,i[8]=h*v+d*x+p*w,this},t.multiplyScalar=function(e){var 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},t.determinant=function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*o*c-t*a*l-n*i*c+n*a*s+r*i*l-r*o*s},t.getInverse=function(e,t){void 0!==t&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var n=e.elements,r=this.elements,i=n[0],o=n[1],a=n[2],s=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],p=d*l-c*h,f=c*u-d*s,m=h*s-l*u,v=i*p+o*f+a*m;if(0===v)return this.set(0,0,0,0,0,0,0,0,0);var g=1/v;return r[0]=p*g,r[1]=(a*h-d*o)*g,r[2]=(c*o-a*l)*g,r[3]=f*g,r[4]=(d*i-a*u)*g,r[5]=(a*s-c*i)*g,r[6]=m*g,r[7]=(o*u-h*i)*g,r[8]=(l*i-o*s)*g,this},t.transpose=function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},t.getNormalMatrix=function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},t.transposeIntoArray=function(e){var 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},t.setUvTransform=function(e,t,n,r,i,o,a){var s=Math.cos(i),l=Math.sin(i);this.set(n*s,n*l,-n*(s*o+l*a)+o+e,-r*l,r*s,-r*(-l*o+s*a)+a+t,0,0,1)},t.scale=function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},t.rotate=function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],l=r[4],c=r[7];return r[0]=t*i+n*s,r[3]=t*o+n*l,r[6]=t*a+n*c,r[1]=-n*i+t*s,r[4]=-n*o+t*l,r[7]=-n*a+t*c,this},t.translate=function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},t.equals=function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},t.fromArray=function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},t.toArray=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e},e}(),ve={getDataURL:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===pe&&(pe=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),pe.width=e.width,pe.height=e.height;var n=pe.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=pe}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},ge=0;function ye(e,t,n,r,i,o,a,s,l,c){Object.defineProperty(this,"id",{value:ge++}),this.uuid=le.generateUUID(),this.name="",this.image=void 0!==e?e:ye.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:ye.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:h,this.wrapT=void 0!==r?r:h,this.magFilter=void 0!==i?i:v,this.minFilter=void 0!==o?o:y,this.anisotropy=void 0!==l?l:1,this.format=void 0!==a?a:E,this.internalFormat=null,this.type=void 0!==s?s:x,this.offset=new fe(0,0),this.repeat=new fe(1,1),this.center=new fe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new me,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:q,this.version=0,this.onUpdate=null}ye.DEFAULT_IMAGE=void 0,ye.DEFAULT_MAPPING=n,ye.prototype=Object.assign(Object.create(ie.prototype),{constructor:ye,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.t
10ype,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=le.generateUUID()),!t&&void 0===e.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var o=0,a=r.length;o<a;o++)i.push(ve.getDataURL(r[o]))}else i=ve.getDataURL(r);e.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping!==n)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case u:e.x=e.x-Math.floor(e.x);break;case h:e.x=e.x<0?0:1;break;case d: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 u:e.y=e.y-Math.floor(e.y);break;case h:e.y=e.y<0?0:1;break;case d:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(ye.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});var xe=function(){function e(e,t,n,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=1),Object.defineProperty(this,"isVector4",{value:!0}),this.x=e,this.y=t,this.z=n,this.w=r}var t=e.prototype;return t.set=function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},t.setScalar=function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},t.setX=function(e){return this.x=e,this},t.setY=function(e){return this.y=e,this},t.setZ=function(e){return this.z=e,this},t.setW=function(e){return this.w=e,this},t.setComponent=function(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},t.getComponent=function(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)}},t.clone=function(){return new this.constructor(this.x,this.y,this.z,this.w)},t.copy=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},t.add=function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},t.addScalar=function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},t.addVectors=function(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},t.addScaledVector=function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},t.sub=function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},t.subScalar=function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},t.subVectors=function(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},t.multiplyScalar=function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},t.applyMatrix4=function(e){var t=this.x,n=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*i,this},t.divideScalar=function(e){return this.multiplyScalar(1/e)},t.setAxisAngleFromQuaternion=function(e){this.w=2*Math.acos(e.w);var 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},t.setAxisAngleFromRotationMatrix=function(e){var t,n,r,i,o=.01,a=.1,s=e.elements,l=s[0],c=s[4],u=s[8],h=s[1],d=s[5],p=s[9],f=s[2],m=s[6],v=s[10];if(Math.abs(c-h)<o&&Math.abs(u-f)<o&&Math.abs(p-m)<o){if(Math.abs(c+h)<a&&Math.abs(u+f)<a&&Math.abs(p+m)<a&&Math.abs(l+d+v-3)<a)return this.set(1,0,0,0),this;t=Math.PI;var g=(l+1)/2,y=(d+1)/2,x=(v+1)/2,b=(c+h)/4,_=(u+f)/4,w=(p+m)/4;return g>y&&g>x?g<o?(n=0,r=.707106781,i=.707106781):(r=b/(n=Math.sqrt(g)),i=_/n):y>x?y<o?(n=.707106781,r=0,i=.707106781):(n=b/(r=Math.sqrt(y)),i=w/r):x<o?(n=.707106781,r=.707106781,i=0):(n=_/(i=Math.sqrt(x)),r=w/i),this.set(n,r,i,t),this}var S=Math.sqrt((m-p)*(m-p)+(u-f)*(u-f)+(h-c)*(h-c));return Math.abs(S)<.001&&(S=1),this.x=(m-p)/S,this.y=(u-f)/S,this.z=(h-c)/S,this.w=Math.acos((l+d+v-1)/2),this},t.min=function(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},t.max=function(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},t.clamp=function(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},t.clampScalar=function(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},t.clampLength=function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},t.floor=function(){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},t.ceil=function(){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},t.round=function(){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},t.roundToZero=function(){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},t.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},t.dot=function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},t.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},t.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},t.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},t.normalize=function(){return this.divideScalar(this.length()||1)},t.setLength=function(e){return this.normalize().multiplyScalar(e)},t.lerp=function(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},t.lerpVectors=function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w
10)*n,this},t.equals=function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},t.fromArray=function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},t.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},t.fromBufferAttribute=function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this},t.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this},ue(e,[{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}}]),e}();function be(e,t,n){this.width=e,this.height=t,this.scissor=new xe(0,0,e,t),this.scissorTest=!1,this.viewport=new xe(0,0,e,t),n=n||{},this.texture=new ye(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:v,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function _e(e,t,n){be.call(this,e,t,n),this.samples=4}be.prototype=Object.assign(Object.create(ie.prototype),{constructor:be,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),_e.prototype=Object.assign(Object.create(be.prototype),{constructor:_e,isWebGLMultisampleRenderTarget:!0,copy:function(e){return be.prototype.copy.call(this,e),this.samples=e.samples,this}});var we=function(){function e(e,t,n,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=1),Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=e,this._y=t,this._z=n,this._w=r}e.slerp=function(e,t,n,r){return n.copy(e).slerp(t,r)},e.slerpFlat=function(e,t,n,r,i,o,a){var s=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3],h=i[o+0],d=i[o+1],p=i[o+2],f=i[o+3];if(u!==f||s!==h||l!==d||c!==p){var m=1-a,v=s*h+l*d+c*p+u*f,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,v*g);m=Math.sin(m*b)/x,a=Math.sin(a*b)/x}var _=a*g;if(s=s*m+h*_,l=l*m+d*_,c=c*m+p*_,u=u*m+f*_,m===1-a){var w=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=w,l*=w,c*=w,u*=w}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u},e.multiplyQuaternionsFlat=function(e,t,n,r,i,o){var a=n[r],s=n[r+1],l=n[r+2],c=n[r+3],u=i[o],h=i[o+1],d=i[o+2],p=i[o+3];return e[t]=a*p+c*u+s*d-l*h,e[t+1]=s*p+c*h+l*u-a*d,e[t+2]=l*p+c*d+a*h-s*u,e[t+3]=c*p-a*u-s*h-l*d,e};var t=e.prototype;return t.set=function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this},t.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},t.copy=function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},t.setFromEuler=function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,o=e._order,a=Math.cos,s=Math.sin,l=a(n/2),c=a(r/2),u=a(i/2),h=s(n/2),d=s(r/2),p=s(i/2);switch(o){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: "+o)}return!1!==t&&this._onChangeCallback(),this},t.setFromAxisAngle=function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},t.setFromRotationMatrix=function(e){var t=e.elements,n=t[0],r=t[4],i=t[8],o=t[1],a=t[5],s=t[9],l=t[2],c=t[6],u=t[10],h=n+a+u;if(h>0){var d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(c-s)*d,this._y=(i-l)*d,this._z=(o-r)*d}else if(n>a&&n>u){var p=2*Math.sqrt(1+n-a-u);this._w=(c-s)/p,this._x=.25*p,this._y=(r+o)/p,this._z=(i+l)/p}else if(a>u){var f=2*Math.sqrt(1+a-n-u);this._w=(i-l)/f,this._x=(r+o)/f,this._y=.25*f,this._z=(s+c)/f}else{var m=2*Math.sqrt(1+u-n-a);this._w=(o-r)/m,this._x=(i+l)/m,this._y=(s+c)/m,this._z=.25*m}return this._onChangeCallback(),this},t.setFromUnitVectors=function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>
10Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()},t.angleTo=function(e){return 2*Math.acos(Math.abs(le.clamp(this.dot(e),-1,1)))},t.rotateTowards=function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this},t.identity=function(){return this.set(0,0,0,1)},t.inverse=function(){return this.conjugate()},t.conjugate=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},t.dot=function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},t.lengthSq=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},t.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},t.normalize=function(){var 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},t.multiply=function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},t.premultiply=function(e){return this.multiplyQuaternions(e,this)},t.multiplyQuaternions=function(e,t){var n=e._x,r=e._y,i=e._z,o=e._w,a=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+o*a+r*l-i*s,this._y=r*c+o*s+i*a-n*l,this._z=i*c+o*l+n*s-r*a,this._w=o*c-n*a-r*s-i*l,this._onChangeCallback(),this},t.slerp=function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var l=1-t;return this._w=l*o+t*this._w,this._x=l*n+t*this._x,this._y=l*r+t*this._y,this._z=l*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=r*h+this._y*d,this._z=i*h+this._z*d,this._onChangeCallback(),this},t.equals=function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},t.fromArray=function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},t.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},t.fromBufferAttribute=function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this},t._onChange=function(e){return this._onChangeCallback=e,this},t._onChangeCallback=function(){},ue(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}]),e}(),Se=function(){function e(e,t,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),Object.defineProperty(this,"isVector3",{value:!0}),this.x=e,this.y=t,this.z=n}var t=e.prototype;return t.set=function(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this},t.setScalar=function(e){return this.x=e,this.y=e,this.z=e,this},t.setX=function(e){return this.x=e,this},t.setY=function(e){return this.y=e,this},t.setZ=function(e){return this.z=e,this},t.setComponent=function(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},t.getComponent=function(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)}},t.clone=function(){return new this.constructor(this.x,this.y,this.z)},t.copy=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},t.add=function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},t.addScalar=function(e){return this.x+=e,this.y+=e,this.z+=e,this},t.addVectors=function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},t.addScaledVector=function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},t.sub=function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.
10y,this.z-=e.z,this)},t.subScalar=function(e){return this.x-=e,this.y-=e,this.z-=e,this},t.subVectors=function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},t.multiply=function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},t.multiplyScalar=function(e){return this.x*=e,this.y*=e,this.z*=e,this},t.multiplyVectors=function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},t.applyEuler=function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Te.setFromEuler(e))},t.applyAxisAngle=function(e,t){return this.applyQuaternion(Te.setFromAxisAngle(e,t))},t.applyMatrix3=function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},t.applyNormalMatrix=function(e){return this.applyMatrix3(e).normalize()},t.applyMatrix4=function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*o,this},t.applyQuaternion=function(e){var t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=e.w,l=s*t+o*r-a*n,c=s*n+a*t-i*r,u=s*r+i*n-o*t,h=-i*t-o*n-a*r;return this.x=l*s+h*-i+c*-a-u*-o,this.y=c*s+h*-o+u*-i-l*-a,this.z=u*s+h*-a+l*-o-c*-i,this},t.project=function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},t.unproject=function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},t.transformDirection=function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},t.divide=function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},t.divideScalar=function(e){return this.multiplyScalar(1/e)},t.min=function(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},t.max=function(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},t.clamp=function(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},t.clampScalar=function(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},t.clampLength=function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},t.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},t.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},t.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},t.roundToZero=function(){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},t.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},t.dot=function(e){return this.x*e.x+this.y*e.y+this.z*e.z},t.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z},t.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},t.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},t.normalize=function(){return this.divideScalar(this.length()||1)},t.setLength=function(e){return this.normalize().multiplyScalar(e)},t.lerp=function(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},t.lerpVectors=function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this},t.cross=function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},t.crossVectors=function(e,t){var n=e.x,r=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this},t.projectOnVector=function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)},t.projectOnPlane=function(e){return Me.copy(this).projectOnVector(e),this.sub(Me)},t.reflect=function(e){return this.sub(Me.copy(e).multiplyScalar(2*this.dot(e)))},t.angleTo=function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(le.clamp(n,-1,1))},t.distanceTo=function(e){return Math.sqrt(this.distanceToSquared(e))},t.distanceToSquared=function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},t.manhattanDistanceTo=function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},t.setFromSpherical=function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},t.setFromSphericalCoords=function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this},t.setFromCylindrical=function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},t.setFromCylindricalCoords=function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},t.setFromMatrixPosition=function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},t.setFromMatrixScale=function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},t.setFromMatrixColumn=function(e,t){return this.fromArray(e.elements,4*t)},t.setFromMatrix3Column=function(e,t){return this.fromArray(e.elements,3*t)},t.equals=function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},t.fromArray=function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},t.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},t.fromBufferAttribute=function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this},t.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},e}(),Me=new Se,Te=new we,Ee=function(){function e(e,t){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==e?e:new Se(1/0,1/0,1/0),this.max=void 0!==t?t:new Se(-1/0,-1/0,-1/0)}var t=e.prototype;return t.set=function(e,t){return this.min.copy(e),this.max.copy(t),this},t.setFromArray=function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,l=e.length;s<l;s+=3){var c=e[s],u=e[s+1],h=e[s+2];c<t&&(t=c),u<n&&(n=u),h<r&&(r=h),c>i&&(i=c),u>o&&(o=u),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this},t.setFromBufferAttribute=function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,l=e.count;s<l;s++){var c=e.getX(s),u=e.getY(s),h=e.getZ(s);c<t&&(t=c),u<n&&(n=u),h<r&&(r=h),c>i&&(i=c),u>o&&(o=u),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this},t.setFromPoints=function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},t.setFromCenterAndSize=function(e,t){var n=Re.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},t.setFromObject=function(e){return this.makeEmpty(),this.expandByObject(e)},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){return this.min.copy(e.min),this.max.copy(e.max),this},t.makeEmpty=function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},t.isEmpty=function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},t.getCenter=function(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new Se),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},t.getSize=function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new Se),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},t.expandByPoint=function(e){return this.min.min(e),this.max.max(e),this},t.expandByVector=function(e){return this.min.sub(e),this.max.add(e),this},t.expandByScalar=function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},t.expandByObject=function(e){e.updateWorldMatrix(!1,!1);var t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),Ae.copy(t.boundingBox),Ae.applyMatrix4(e.matrixWorld),this.union(Ae));for(var n=e.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);return this},t.containsPoint=function(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)},t.containsBox=function(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},t.getParameter=function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Se),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))},t.intersectsBox=function(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)},t.intersectsSphere=function(e){return this.clampPoint(e.center,Re),Re.distanceToSquared(e.center)<=e.radius*e.radiu
10s},t.intersectsPlane=function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},t.intersectsTriangle=function(e){if(this.isEmpty())return!1;this.getCenter(ze),Be.subVectors(this.max,ze),Pe.subVectors(e.a,ze),Ie.subVectors(e.b,ze),Oe.subVectors(e.c,ze),De.subVectors(Ie,Pe),Ne.subVectors(Oe,Ie),ke.subVectors(Pe,Oe);var t=[0,-De.z,De.y,0,-Ne.z,Ne.y,0,-ke.z,ke.y,De.z,0,-De.x,Ne.z,0,-Ne.x,ke.z,0,-ke.x,-De.y,De.x,0,-Ne.y,Ne.x,0,-ke.y,ke.x,0];return!!Ce(t,Pe,Ie,Oe,Be)&&(!!Ce(t=[1,0,0,0,1,0,0,0,1],Pe,Ie,Oe,Be)&&(Fe.crossVectors(De,Ne),Ce(t=[Fe.x,Fe.y,Fe.z],Pe,Ie,Oe,Be)))},t.clampPoint=function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Se),t.copy(e).clamp(this.min,this.max)},t.distanceToPoint=function(e){return Re.copy(e).clamp(this.min,this.max).sub(e).length()},t.getBoundingSphere=function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(Re).length(),e},t.intersect=function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},t.union=function(e){return this.min.min(e.min),this.max.max(e.max),this},t.applyMatrix4=function(e){return this.isEmpty()||(Le[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Le[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Le[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Le[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Le[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Le[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Le[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Le[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Le)),this},t.translate=function(e){return this.min.add(e),this.max.add(e),this},t.equals=function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},e}();function Ce(e,t,n,r,i){for(var o=0,a=e.length-3;o<=a;o+=3){Ge.fromArray(e,o);var s=i.x*Math.abs(Ge.x)+i.y*Math.abs(Ge.y)+i.z*Math.abs(Ge.z),l=t.dot(Ge),c=n.dot(Ge),u=r.dot(Ge);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}var Le=[new Se,new Se,new Se,new Se,new Se,new Se,new Se,new Se],Re=new Se,Ae=new Ee,Pe=new Se,Ie=new Se,Oe=new Se,De=new Se,Ne=new Se,ke=new Se,ze=new Se,Be=new Se,Fe=new Se,Ge=new Se,He=new Ee,Ue=function(){function e(e,t){this.center=void 0!==e?e:new Se,this.radius=void 0!==t?t:-1}var t=e.prototype;return t.set=function(e,t){return this.center.copy(e),this.radius=t,this},t.setFromPoints=function(e,t){var n=this.center;void 0!==t?n.copy(t):He.setFromPoints(e).getCenter(n);for(var r=0,i=0,o=e.length;i<o;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){return this.center.copy(e.center),this.radius=e.radius,this},t.isEmpty=function(){return this.radius<0},t.makeEmpty=function(){return this.center.set(0,0,0),this.radius=-1,this},t.containsPoint=function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},t.distanceToPoint=function(e){return e.distanceTo(this.center)-this.radius},t.intersectsSphere=function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},t.intersectsBox=function(e){return e.intersectsSphere(this)},t.intersectsPlane=function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},t.clampPoint=function(e,t){var n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new Se),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},t.getBoundingBox=function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new Ee),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}
10,t.applyMatrix4=function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},t.translate=function(e){return this.center.add(e),this},t.equals=function(e){return e.center.equals(this.center)&&e.radius===this.radius},e}(),We=new Se,Ve=new Se,je=new Se,Xe=new Se,qe=new Se,Ye=new Se,Ke=new Se,Ze=function(){function e(e,t){this.origin=void 0!==e?e:new Se,this.direction=void 0!==t?t:new Se(0,0,-1)}var t=e.prototype;return t.set=function(e,t){return this.origin.copy(e),this.direction.copy(t),this},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},t.at=function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Se),t.copy(this.direction).multiplyScalar(e).add(this.origin)},t.lookAt=function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},t.recast=function(e){return this.origin.copy(this.at(e,We)),this},t.closestPointToPoint=function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Se),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)},t.distanceToPoint=function(e){return Math.sqrt(this.distanceSqToPoint(e))},t.distanceSqToPoint=function(e){var t=We.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(We.copy(this.direction).multiplyScalar(t).add(this.origin),We.distanceToSquared(e))},t.distanceSqToSegment=function(e,t,n,r){Ve.copy(e).add(t).multiplyScalar(.5),je.copy(t).sub(e).normalize(),Xe.copy(this.origin).sub(Ve);var i,o,a,s,l=.5*e.distanceTo(t),c=-this.direction.dot(je),u=Xe.dot(this.direction),h=-Xe.dot(je),d=Xe.lengthSq(),p=Math.abs(1-c*c);if(p>0)if(o=c*u-h,s=l*p,(i=c*h-u)>=0)if(o>=-s)if(o<=s){var f=1/p;a=(i*=f)*(i+c*(o*=f)+2*u)+o*(c*i+o+2*h)+d}else o=l,a=-(i=Math.max(0,-(c*o+u)))*i+o*(o+2*h)+d;else o=-l,a=-(i=Math.max(0,-(c*o+u)))*i+o*(o+2*h)+d;else o<=-s?a=-(i=Math.max(0,-(-c*l+u)))*i+(o=i>0?-l:Math.min(Math.max(-l,-h),l))*(o+2*h)+d:o<=s?(i=0,a=(o=Math.min(Math.max(-l,-h),l))*(o+2*h)+d):a=-(i=Math.max(0,-(c*l+u)))*i+(o=i>0?l:Math.min(Math.max(-l,-h),l))*(o+2*h)+d;else o=c>0?-l:l,a=-(i=Math.max(0,-(c*o+u)))*i+o*(o+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(je).multiplyScalar(o).add(Ve),a},t.intersectSphere=function(e,t){We.subVectors(e.center,this.origin);var n=We.dot(this.direction),r=We.dot(We)-n*n,i=e.radius*e.radius;if(r>i)return null;var o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,t):this.at(a,t)},t.intersectsSphere=function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},t.distanceToPlane=function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},t.intersectPlane=function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},t.intersectsPlane=function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},t.intersectBox=function(e,t){var n,r,i,o,a,s,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(n=(e.min.x-h.x)*l,r=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,r=(e.min.x-h.x)*l),c>=0?(i=(e.min.y-h.y)*c,o=(e.max.y-h.y)*c):(i=(e.max.y-h.y)*c,o=(e.min.y-h.y)*c),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),u>=0?(a=(e.min.z-h.z)*u,s=(e.max.z-h.z)*u):(a=(e.max.z-h.z)*u,s=(e.min.z-h.z)*u),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,t)))},t.intersectsBox=function(e){return null!==this.intersectBox(e,We)},t.intersectTriangle=function(e,t,n,r,i){qe.subVectors(t,e),Ye.subVectors(n,e),Ke.crossVectors(qe,Ye);var o,a=this.direction.dot(Ke);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}Xe.subVectors(this.origin,e);var s=o*this.direction.dot(Ye.crossVectors(Xe,Ye));if(s<0)return null;var l=o*this.direction.dot(qe.cross(Xe));if(l<0)return null;if(s+l>a)return null;var c=-o*Xe.dot(Ke);return c<0?null:this.at(c/a,i)}
10,t.applyMatrix4=function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},t.equals=function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)},e}(),Je=function(){function e(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}var t=e.prototype;return t.set=function(e,t,n,r,i,o,a,s,l,c,u,h,d,p,f,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=r,v[1]=i,v[5]=o,v[9]=a,v[13]=s,v[2]=l,v[6]=c,v[10]=u,v[14]=h,v[3]=d,v[7]=p,v[11]=f,v[15]=m,this},t.identity=function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},t.clone=function(){return(new e).fromArray(this.elements)},t.copy=function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},t.copyPosition=function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},t.extractBasis=function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},t.makeBasis=function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},t.extractRotation=function(e){var t=this.elements,n=e.elements,r=1/Qe.setFromMatrixColumn(e,0).length(),i=1/Qe.setFromMatrixColumn(e,1).length(),o=1/Qe.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},t.makeRotationFromEuler=function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){var h=o*c,d=o*u,p=a*c,f=a*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=d+p*l,t[5]=h-f*l,t[9]=-a*s,t[2]=f-h*l,t[6]=p+d*l,t[10]=o*s}else if("YXZ"===e.order){var m=s*c,v=s*u,g=l*c,y=l*u;t[0]=m+y*a,t[4]=g*a-v,t[8]=o*l,t[1]=o*u,t[5]=o*c,t[9]=-a,t[2]=v*a-g,t[6]=y+m*a,t[10]=o*s}else if("ZXY"===e.order){var x=s*c,b=s*u,_=l*c,w=l*u;t[0]=x-w*a,t[4]=-o*u,t[8]=_+b*a,t[1]=b+_*a,t[5]=o*c,t[9]=w-x*a,t[2]=-o*l,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){var S=o*c,M=o*u,T=a*c,E=a*u;t[0]=s*c,t[4]=T*l-M,t[8]=S*l+E,t[1]=s*u,t[5]=E*l+S,t[9]=M*l-T,t[2]=-l,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){var C=o*s,L=o*l,R=a*s,A=a*l;t[0]=s*c,t[4]=A-C*u,t[8]=R*u+L,t[1]=u,t[5]=o*c,t[9]=-a*c,t[2]=-l*c,t[6]=L*u+R,t[10]=C-A*u}else if("XZY"===e.order){var P=o*s,I=o*l,O=a*s,D=a*l;t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=P*u+D,t[5]=o*c,t[9]=I*u-O,t[2]=O*u-I,t[6]=a*c,t[10]=D*u+P}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},t.makeRotationFromQuaternion=function(e){return this.compose(et,e,tt)},t.lookAt=function(e,t,n){var r=this.elements;return it.subVectors(e,t),0===it.lengthSq()&&(it.z=1),it.normalize(),nt.crossVectors(n,it),0===nt.lengthSq()&&(1===Math.abs(n.z)?it.x+=1e-4:it.z+=1e-4,it.normalize(),nt.crossVectors(n,it)),nt.normalize(),rt.crossVectors(it,nt),r[0]=nt.x,r[4]=rt.x,r[8]=it.x,r[1]=nt.y,r[5]=rt.y,r[9]=it.y,r[2]=nt.z,r[6]=rt.z,r[10]=it.z,this},t.multiply=function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},t.premultiply=function(e){return this.multiplyMatrices(e,this)},t.multiplyMatrices=function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[4],s=n[8],l=n[12],c=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],v=n[14],g=n[3],y=n[7],x=n[11],b=n[15],_=r[0],w=r[4],S=r[8],M=r[12],T=r[1],E=r[5],C=r[9],L=r[13],R=r[2],A=r[6],P=r[10],I=r[14],O=r[3],D=r[7],N=r[11],k=r[15];return i[0]=o*_+a*T+s*R+l*O,i[4]=o*w+a*E+s*A+l*D,i[8]=o*S+a*C+s*P+l*N,i[12]=o*M+a*L+s*I+l*k,i[1]=c*_+u*T+h*R+d*O,i[5]=c*w+u*E+h*A+d*D,i[9]=c*S+u*C+h*P+d*N,i[13]=c*M+u*L+h*I+d*k,i[2]=p*_+f*T+m*R+v*O,i[6]=p*w+f*E+m*A+v*D,i[10]=p*S+f*C+m*P+v*N,i[14]=p*M+f*L+m*I+v*k,i[3]=g*_+y*T+x*R+b*O,i[7]=g*w+y*E+x*A+b*D,i[11]=g*S+y*C+x*P+b*N,i[15]=g*M+y*L+x*I+b*k,this},t.multiplyScalar=function(e){var 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},t.determinant=function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],o=e[1],a=e[5],s=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+i*s*u-r*l*u-i*a*h+n*l*h+r*a*d-n*s*d)+e[7]*(+t*s*d-t*l*h+i*o*h-r*o*d+r*l*c-i*s*c)+e[11]*(+t*l*u-t*a*d-i*o*u+n*o*d+i*a*c-n*l*c)+e[15]*(-r*a*c-t*s*u+t*a*h+r*o*u-n*o*h+n*s*c)},t.transpose=function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},t.setPosition=function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this},t.getInverse=function(e,t){void 0!==t&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var n=this.elements,r=e.elements,i=r[0],o=r[1],a=r[2],s=r[3],l=r[4],c=r[5],u=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],v=r[12],g=r[13],y=r[14],x=r[15],b=p*y*h-g*f*h+g*u*m-c*y*m-p*u*x+c*f*x,_=v*f*h-d*y*h-v*u*m+l*y*m+d*u*x-l*f*x,w=d*g*h-v*p*h+v*c*m-l*g*m-d*c*x+l*p*x,S=v*p*u-d*g*u-v*c*f+l*g*f+d*c*y-l*p*y,M=i*b+o*_+a*w+s*S;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var T=1/M;
10return n[0]=b*T,n[1]=(g*f*s-p*y*s-g*a*m+o*y*m+p*a*x-o*f*x)*T,n[2]=(c*y*s-g*u*s+g*a*h-o*y*h-c*a*x+o*u*x)*T,n[3]=(p*u*s-c*f*s-p*a*h+o*f*h+c*a*m-o*u*m)*T,n[4]=_*T,n[5]=(d*y*s-v*f*s+v*a*m-i*y*m-d*a*x+i*f*x)*T,n[6]=(v*u*s-l*y*s-v*a*h+i*y*h+l*a*x-i*u*x)*T,n[7]=(l*f*s-d*u*s+d*a*h-i*f*h-l*a*m+i*u*m)*T,n[8]=w*T,n[9]=(v*p*s-d*g*s-v*o*m+i*g*m+d*o*x-i*p*x)*T,n[10]=(l*g*s-v*c*s+v*o*h-i*g*h-l*o*x+i*c*x)*T,n[11]=(d*c*s-l*p*s-d*o*h+i*p*h+l*o*m-i*c*m)*T,n[12]=S*T,n[13]=(d*g*a-v*p*a+v*o*f-i*g*f-d*o*y+i*p*y)*T,n[14]=(v*c*a-l*g*a-v*o*u+i*g*u+l*o*y-i*c*y)*T,n[15]=(l*p*a-d*c*a+d*o*u-i*p*u-l*o*f+i*c*f)*T,this},t.scale=function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},t.getMaxScaleOnAxis=function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},t.makeTranslation=function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},t.makeRotationX=function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},t.makeRotationY=function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},t.makeRotationZ=function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},t.makeRotationAxis=function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,o=e.x,a=e.y,s=e.z,l=i*o,c=i*a;return this.set(l*o+n,l*a-r*s,l*s+r*a,0,l*a+r*s,c*a+n,c*s-r*o,0,l*s-r*a,c*s+r*o,i*s*s+n,0,0,0,0,1),this},t.makeScale=function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},t.makeShear=function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},t.compose=function(e,t,n){var r=this.elements,i=t._x,o=t._y,a=t._z,s=t._w,l=i+i,c=o+o,u=a+a,h=i*l,d=i*c,p=i*u,f=o*c,m=o*u,v=a*u,g=s*l,y=s*c,x=s*u,b=n.x,_=n.y,w=n.z;return r[0]=(1-(f+v))*b,r[1]=(d+x)*b,r[2]=(p-y)*b,r[3]=0,r[4]=(d-x)*_,r[5]=(1-(h+v))*_,r[6]=(m+g)*_,r[7]=0,r[8]=(p+y)*w,r[9]=(m-g)*w,r[10]=(1-(h+f))*w,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this},t.decompose=function(e,t,n){var r=this.elements,i=Qe.set(r[0],r[1],r[2]).length(),o=Qe.set(r[4],r[5],r[6]).length(),a=Qe.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],$e.copy(this);var s=1/i,l=1/o,c=1/a;return $e.elements[0]*=s,$e.elements[1]*=s,$e.elements[2]*=s,$e.elements[4]*=l,$e.elements[5]*=l,$e.elements[6]*=l,$e.elements[8]*=c,$e.elements[9]*=c,$e.elements[10]*=c,t.setFromRotationMatrix($e),n.x=i,n.y=o,n.z=a,this},t.makePerspective=function(e,t,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),u=(n+r)/(n-r),h=-(o+i)/(o-i),d=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},t.makeOrthographic=function(e,t,n,r,i,o){var a=this.elements,s=1/(t-e),l=1/(n-r),c=1/(o-i),u=(t+e)*s,h=(n+r)*l,d=(o+i)*c;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},t.equals=function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},t.fromArray=function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},t.toArray=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e},e}(),Qe=new Se,$e=new Je,et=new Se(0,0,0),tt=new Se(1,1,1),nt=new Se,rt=new Se,it=new Se,ot=function(){function e(t,n,r,i){void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=e.DefaultOrder),Object.defineProperty(this,"isEuler",{value:!0}),this._x=t,this._y=n,this._z=r,this._order=i}var t=e.prototype;return t.set=function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this},t.clone=function(){return new this.constructor(this._x,this._y,this._z,this._order)},t.copy=function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},t.setFromRotationMatrix=function(e,t,n){var r=le.clamp,i=e.elements,o=i[0],a=i[4],s=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],p=i[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,o),this._z=0);break;
10case"ZXY":this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this},t.setFromQuaternion=function(e,t,n){return at.makeRotationFromQuaternion(e),this.setFromRotationMatrix(at,t,n)},t.setFromVector3=function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},t.reorder=function(e){return st.setFromEuler(this),this.setFromQuaternion(st,e)},t.equals=function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},t.fromArray=function(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},t.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},t.toVector3=function(e){return e?e.set(this._x,this._y,this._z):new Se(this._x,this._y,this._z)},t._onChange=function(e){return this._onChangeCallback=e,this},t._onChangeCallback=function(){},ue(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}]),e}();ot.DefaultOrder="XYZ",ot.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var at=new Je,st=new we,lt=function(){function e(){this.mask=1}var t=e.prototype;return t.set=function(e){this.mask=1<<e|0},t.enable=function(e){this.mask|=1<<e|0},t.enableAll=function(){this.mask=-1},t.toggle=function(e){this.mask^=1<<e|0},t.disable=function(e){this.mask&=~(1<<e|0)},t.disableAll=function(){this.mask=0},t.test=function(e){return 0!=(this.mask&e.mask)},e}(),ct=0,ut=new Se,ht=new we,dt=new Je,pt=new Se,ft=new Se,mt=new Se,vt=new we,gt=new Se(1,0,0),yt=new Se(0,1,0),xt=new Se(0,0,1),bt={type:"added"},_t={type:"removed"};function wt(){Object.defineProperty(this,"id",{value:ct++}),this.uuid=le.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=wt.DefaultUp.clone();
vendor: 5,250 bytes, line 10
10var e=new Se,t=new ot,n=new we,r=new Se(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Je},normalMatrix:{value:new me}}),this.matrix=new Je,this.matrixWorld=new Je,this.matrixAutoUpdate=wt.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new lt,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}wt.DefaultUp=new Se(0,1,0),wt.DefaultMatrixAutoUpdate=!0,wt.prototype=Object.assign(Object.create(ie.prototype),{constructor:wt,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,t){return ht.setFromAxisAngle(e,t),this.quaternion.multiply(ht),this},rotateOnWorldAxis:function(e,t){return ht.setFromAxisAngle(e,t),this.quaternion.premultiply(ht),this},rotateX:function(e){return this.rotateOnAxis(gt,e)},rotateY:function(e){return this.rotateOnAxis(yt,e)},rotateZ:function(e){return this.rotateOnAxis(xt,e)},translateOnAxis:function(e,t){return ut.copy(e).applyQuaternion(this.quaternion),this.position.add(ut.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(gt,e)},translateY:function(e){return this.translateOnAxis(yt,e)},translateZ:function(e){return this.translateOnAxis(xt,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(dt.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?pt.copy(e):pt.set(e,t,n);var r=this.parent;this.updateWorldMatrix(!0,!1),ft.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?dt.lookAt(ft,pt,this.up):dt.lookAt(pt,ft,this.up),this.quaternion.setFromRotationMatrix(dt),r&&(dt.extractRotation(r.matrixWorld),ht.setFromRotationMatrix(dt),this.quaternion.premultiply(ht.inverse()))},add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);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(bt)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(_t)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),dt.getInverse(this.matrixWorld),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),dt.multiply(e.parent.matrixWorld)),e.applyMatrix4(dt),e.updateWorldMatrix(!1,!1),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new Se),this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new we),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ft,e,mt),e},getWorldScale:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new Se),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ft,vt,e),e},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new Se),this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix
10):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var r=this.children,i=0,o=r.length;i<o;i++)r[i].updateWorldMatrix(!1,!0)},toJSON:function(e){var t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var a=o.shapes;if(Array.isArray(a))for(var s=0,l=a.length;s<l;s++){var c=a[s];i(e.shapes,c)}else i(e.shapes,a)}}if(void 0!==this.material)if(Array.isArray(this.material)){for(var u=[],h=0,d=this.material.length;h<d;h++)u.push(i(e.materials,this.material[h]));r.material=u}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(var p=0;p<this.children.length;p++)r.children.push(this.children[p].toJSON(e).object)}if(t){var f=x(e.geometries),m=x(e.materials),v=x(e.textures),g=x(e.images),y=x(e.shapes);f.length>0&&(n.geometries=f),m.length>0&&(n.materials=m),v.length>0&&(n.textures=v),g.length>0&&(n.images=g),y.length>0&&(n.shapes=y)}return n.object=r,n;function x(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}});var St=new Se,Mt=new Se,Tt=new me,Et=function(){function e(e,t){Object.defineProperty(this,"isPlane",{value:!0}),this.normal=void 0!==e?e:new Se(1,0,0),this.constant=void 0!==t?t:0}var t=e.prototype;return t.set=function(e,t){return this.normal.copy(e),this.constant=t,this},t.setComponents=function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},t.setFromNormalAndCoplanarPoint=function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},t.setFromCoplanarPoints=function(e,t,n){var r=St.subVectors(n,t).cross(Mt.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},t.normalize=function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},t.negate=function(){return this.constant*=-1,this.normal.negate(),this},t.distanceToPoint=function(e){return this.normal.dot(e)+this.constant},t.distanceToSphere=function(e){return this.distanceToPoint(e.center)-e.radius},t.projectPoint=function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new Se),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},t.intersectLine=function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new Se);var n=e.delta(St),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;
10var i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?void 0:t.copy(n).multiplyScalar(i).add(e.start)},t.intersectsLine=function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},t.intersectsBox=function(e){return e.intersectsPlane(this)},t.intersectsSphere=function(e){return e.intersectsPlane(this)},t.coplanarPoint=function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Se),e.copy(this.normal).multiplyScalar(-this.constant)},t.applyMatrix4=function(e,t){var n=t||Tt.getNormalMatrix(e),r=this.coplanarPoint(St).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this},t.translate=function(e){return this.constant-=e.dot(this.normal),this},t.equals=function(e){return e.normal.equals(this.normal)&&e.constant===this.constant},e}(),Ct=new Se,Lt=new Se,Rt=new Se,At=new Se,Pt=new Se,It=new Se,Ot=new Se,Dt=new Se,Nt=new Se,kt=new Se,zt=function(){function e(e,t,n){this.a=void 0!==e?e:new Se,this.b=void 0!==t?t:new Se,this.c=void 0!==n?n:new Se}e.getNormal=function(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Se),r.subVectors(n,t),Ct.subVectors(e,t),r.cross(Ct);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},e.getBarycoord=function(e,t,n,r,i){Ct.subVectors(r,t),Lt.subVectors(n,t),Rt.subVectors(e,t);var o=Ct.dot(Ct),a=Ct.dot(Lt),s=Ct.dot(Rt),l=Lt.dot(Lt),c=Lt.dot(Rt),u=o*l-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new Se),0===u)return i.set(-2,-1,-1);var h=1/u,d=(l*s-a*c)*h,p=(o*c-a*s)*h;return i.set(1-d-p,p,d)},e.containsPoint=function(e,t,n,r){return this.getBarycoord(e,t,n,r,At),At.x>=0&&At.y>=0&&At.x+At.y<=1},e.getUV=function(e,t,n,r,i,o,a,s){return this.getBarycoord(e,t,n,r,At),s.set(0,0),s.addScaledVector(i,At.x),s.addScaledVector(o,At.y),s.addScaledVector(a,At.z),s},e.isFrontFacing=function(e,t,n,r){return Ct.subVectors(n,t),Lt.subVectors(e,t),Ct.cross(Lt).dot(r)<0};var t=e.prototype;return t.set=function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},t.setFromPointsAndIndices=function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},t.getArea=function(){return Ct.subVectors(this.c,this.b),Lt.subVectors(this.a,this.b),.5*Ct.cross(Lt).length()},t.getMidpoint=function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Se),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},t.getNormal=function(t){return e.getNormal(this.a,this.b,this.c,t)},t.getPlane=function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Et),e.setFromCoplanarPoints(this.a,this.b,this.c)},t.getBarycoord=function(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)},t.getUV=function(t,n,r,i,o){return e.getUV(t,this.a,this.b,this.c,n,r,i,o)},t.containsPoint=function(t){return e.containsPoint(t,this.a,this.b,this.c)},t.isFrontFacing=function(t){return e.isFrontFacing(this.a,this.b,this.c,t)},t.intersectsBox=function(e){return e.intersectsTriangle(this)},t.closestPointToPoint=function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Se);var n,r,i=this.a,o=this.b,a=this.c;Pt.subVectors(o,i),It.subVectors(a,i),Dt.subVectors(e,i);var s=Pt.dot(Dt),l=It.dot(Dt);if(s<=0&&l<=0)return t.copy(i);Nt.subVectors(e,o);var c=Pt.dot(Nt),u=It.dot(Nt);if(c>=0&&u<=c)return t.copy(o);var h=s*u-c*l;if(h<=0&&s>=0&&c<=0)return n=s/(s-c),t.copy(i).addScaledVector(Pt,n);kt.subVectors(e,a);var d=Pt.dot(kt),p=It.dot(kt);if(p>=0&&d<=p)return t.copy(a);var f=d*l-s*p;if(f<=0&&l>=0&&p<=0)return r=l/(l-p),t.copy(i).addScaledVector(It,r);var m=c*p-d*u;if(m<=0&&u-c>=0&&d-p>=0)return Ot.subVectors(a,o),r=(u-c)/(u-c+(d-p)),t.copy(o).addScaledVector(Ot,r);var v=1/(m+f+h);return n=f*v,r=h*v,t.copy(i).addScaledVector(Pt,n).addScaledVector(It,r)},t.equals=function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)},e}(),Bt={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},Ft={h:0,s:0,l:0},Gt={h:0,s:0,l:0};function Ht(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function Ut(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}
10function Wt(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var Vt=function(){function e(e,t,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}var t=e.prototype;return t.set=function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},t.setScalar=function(e){return this.r=e,this.g=e,this.b=e,this},t.setHex=function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},t.setRGB=function(e,t,n){return this.r=e,this.g=t,this.b=n,this},t.setHSL=function(e,t,n){if(e=le.euclideanModulo(e,1),t=le.clamp(t,0,1),n=le.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Ht(i,r,e+1/3),this.g=Ht(i,r,e),this.b=Ht(i,r,e-1/3)}return this},t.setStyle=function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,l=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(a,s,l)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var c=n[1],u=c.length;if(3===u)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this},t.setColorName=function(e){var t=Bt[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},t.clone=function(){return new this.constructor(this.r,this.g,this.b)},t.copy=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},t.copyGammaToLinear=function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},t.copyLinearToGamma=function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},t.convertGammaToLinear=function(e){return this.copyGammaToLinear(this,e),this},t.convertLinearToGamma=function(e){return this.copyLinearToGamma(this,e),this},t.copySRGBToLinear=function(e){return this.r=Ut(e.r),this.g=Ut(e.g),this.b=Ut(e.b),this},t.copyLinearToSRGB=function(e){return this.r=Wt(e.r),this.g=Wt(e.g),this.b=Wt(e.b),this},t.convertSRGBToLinear=function(){return this.copySRGBToLinear(this),this},t.convertLinearToSRGB=function(){return this.copyLinearToSRGB(this),this},t.getHex=function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},t.getHexString=function(){return("000000"+this.getHex().toString(16)).slice(-6)},t.getHSL=function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,r=this.r,i=this.g,o=this.b,a=Math.max(r,i,o),s=Math.min(r,i,o),l=(s+a)/2;if(s===a)t=0,n=0;else{var c=a-s;switch(n=l<=.5?c/(a+s):c/(2-a-s),a){case r:t=(i-o)/c+(i<o?6:0);break;case i:t=(o-r)/c+2;break;case o:t=(r-i)/c+4}t/=6}return e.h=t,e.s=n,e.l=l,e},t.getStyle=function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},t.offsetHSL=function(e,t,n){return this.getHSL(Ft),Ft.h+=e,Ft.s+=t,Ft.l+=n,this.setHSL(Ft.h,Ft.s,Ft.l),this},t.add=function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},t.addColors=function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},t.addScalar=function(e){return this.r+=e,this.g+=e,this.b+=e,this},t.sub=function(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},t.multiply=function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},t.multiplyScalar=function(e){return this.r*=e,this.g*=e,this.b*=e,this},t.lerp=function(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},t.lerpHSL=function(e,t){this.getHSL(Ft),e.getHSL(Gt);var n=le.lerp(Ft.h,Gt.h,t),r=le.lerp(Ft.s,Gt.s,t),i=le.lerp(Ft.l,Gt.l,t);return this.setHSL(n,r,i),this},t.equals=function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},t.fromArray=function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},t.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},t.fromBufferAttribute=function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this},t.toJSON=function(){return this.getHex()},e}();Vt.NAMES=Bt,Vt.prototype.r=1,Vt.prototype.g=1,Vt.prototype.b=1;var jt=function(){function e(e,t,n,r,i,o){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new Se,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new Vt,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==o?o:0}var t=e.prototype;return t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(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(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(var r=0,i=e.vertexColors.length;r<i;r++)this.vertexColors[r]=e.vertexColors[r].clone();return this},e}(),Xt=0;function qt(){Object.defineProperty(this,"id",{value:Xt++}),this.uuid=le.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=t,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ee,this.stencilZFail=ee,this.stencilZPass=ee,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.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function Yt(e){qt.call(this),this.type="MeshBasicMaterial",this.color=new Vt(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=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(e)}qt.prototype=Object.assign(Object.create(ie.prototype),{constructor:qt,isMaterial:!0,onBeforeCompile:function(){},customProgramCacheKey:function(){return this.onBeforeCompile.toString()},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}
vendor: 4,476 bytes, line 10
10if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&
vendor: 8,169 bytes, line 10
10(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),o=r(e.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(qt.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Yt.prototype=Object.create(qt.prototype),Yt.prototype.constructor=Yt,Yt.prototype.isMeshBasicMaterial=!0,Yt.prototype.copy=function(e){return qt.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var Kt=new Se,Zt=new fe;function Jt(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=te,this.updateRange={offset:0,count:-1},this.version=0}function Qt(e,t,n){Jt.call(this,new Int8Array(e),t,n)}function $t(e,t,n){Jt.call(this,new Uint8Array(e),t,n)}function en(e,t,n){Jt.call(this,new Uint8ClampedArray(e),t,n)}function tn(e,t,n){Jt.call(this,new Int16Array(e),t,n)}function nn(e,t,n){Jt.call(this,new Uint16Array(e),t,n)}function rn(e,t,n){Jt.call(this,new Int32Array(e),t,n)}function on(e,t,n){Jt.call(this,new Uint32Array(e),t,n)}function an(e,t,n){Jt.call(this,new Float32Array(e),t,n)}function sn(e,t,n){Jt.call(this,new Float64Array(e),t,n)}Object.defineProperty(Jt.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Jt.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),o=new Vt),t[n++]=o.r,t[n++]=o.g,t[n++]=o.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new fe),t[n++]=o.x,t[n++]=o.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new Se),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new xe),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n++]=o.w}return this},applyMatrix3:function(e){if(2===this.itemSize)for(var t=0,n=this.count;t<n;t++)Zt.fromBufferAttribute(this,t),Zt.applyMatrix3(e),this.setXY(t,Zt.x,Zt.y);else if(3===this.itemSize)for(var r=0,i=this.count;r<i;r++)Kt.fromBufferAttribute(this,r),Kt.applyMatrix3(e),this.setXYZ(r,Kt.x,Kt.y,Kt.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)Kt.x=this.getX(t),Kt.y=this.getY(t),Kt.z=this.getZ(t),Kt.applyMatrix4(e),this.setXYZ(t,Kt.x,Kt.y,Kt.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)Kt.x=this.getX(t),Kt.y=this.getY(t),Kt.z=this.getZ(t),Kt.applyNormalMatrix(e),this.setXYZ(t,Kt.x,Kt.y,Kt.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)Kt.x=this.getX(t),Kt.y=this.getY(t),Kt.z=this.getZ(t),Kt.transformDirection(e),this.setXYZ(t,Kt.x,Kt.y,Kt.z);return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),Qt.prototype=Object.create(Jt.prototype),Qt.prototype.constructor=Qt,$t.prototype=Object.create(Jt.prototype),$t.prototype.constructor=$t,en.prototype=Object.create(Jt.prototype),en.prototype.constructor=en,tn.prototype=Object.create(Jt.prototype),tn.prototype.constructor=tn,nn.prototype=Object.create(Jt.prototype),nn.prototype.constructor=nn,rn.prototype=Object.create(Jt.prototype),rn.prototype.constructor=rn,on.prototype=Object.create(Jt.prototype),on.prototype.constructor=on,an.prototype=Object.create(Jt.prototype),an.prototype.constructor=an,sn.prototype=Object.create(Jt.prototype),sn.prototype.constructor=sn;var ln=function(){function e(){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}var t=e.prototype;return t.computeGroups=function(e){var t,n,r=[],i=void 0,o=e.faces;for(n=0;n<o.length;n++){var a=o[n];a.materialIndex!==i&&(i=a.materialIndex,void 0!==t&&(t.count=3*n-t.start,r.pu
10sh(t)),t={start:3*n,materialIndex:i})}void 0!==t&&(t.count=3*n-t.start,r.push(t)),this.groups=r},t.fromGeometry=function(e){var t,n=e.faces,r=e.vertices,i=e.faceVertexUvs,o=i[0]&&i[0].length>0,a=i[1]&&i[1].length>0,s=e.morphTargets,l=s.length;if(l>0){t=[];for(var c=0;c<l;c++)t[c]={name:s[c].name,data:[]};this.morphTargets.position=t}var u,h=e.morphNormals,d=h.length;if(d>0){u=[];for(var p=0;p<d;p++)u[p]={name:h[p].name,data:[]};this.morphTargets.normal=u}var f=e.skinIndices,m=e.skinWeights,v=f.length===r.length,g=m.length===r.length;r.length>0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var y=0;y<n.length;y++){var x=n[y];this.vertices.push(r[x.a],r[x.b],r[x.c]);var b=x.vertexNormals;if(3===b.length)this.normals.push(b[0],b[1],b[2]);else{var _=x.normal;this.normals.push(_,_,_)}var w=x.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var S=x.color;this.colors.push(S,S,S)}if(!0===o){var M=i[0][y];void 0!==M?this.uvs.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",y),this.uvs.push(new fe,new fe,new fe))}if(!0===a){var T=i[1][y];void 0!==T?this.uvs2.push(T[0],T[1],T[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",y),this.uvs2.push(new fe,new fe,new fe))}for(var E=0;E<l;E++){var C=s[E].vertices;t[E].data.push(C[x.a],C[x.b],C[x.c])}for(var L=0;L<d;L++){var R=h[L].vertexNormals[y];u[L].data.push(R.a,R.b,R.c)}v&&this.skinIndices.push(f[x.a],f[x.b],f[x.c]),g&&this.skinWeights.push(m[x.a],m[x.b],m[x.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},e}();function cn(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}var un=1,hn=new Je,dn=new wt,pn=new Se,fn=new Ee,mn=new Ee,vn=new Se;function gn(){Object.defineProperty(this,"id",{value:un+=2}),this.uuid=le.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}gn.prototype=Object.assign(Object.create(ie.prototype),{constructor:gn,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){return Array.isArray(e)?this.index=new(cn(e)>65535?on:nn)(e,1):this.index=e,this},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new me).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return hn.makeRotationX(e),this.applyMatrix4(hn),this},rotateY:function(e){return hn.makeRotationY(e),this.applyMatrix4(hn),this},rotateZ:function(e){return hn.makeRotationZ(e),this.applyMatrix4(hn),this},translate:function(e,t,n){return hn.makeTranslation(e,t,n),this.applyMatrix4(hn),this},scale:function(e,t,n){return hn.makeScale(e,t,n),this.applyMatrix4(hn),this},lookAt:function(e){return dn.lookAt(e),dn.updateMatrix(),this.applyMatrix4(dn.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(pn).negate(),this.translate(pn.x,pn.y,pn.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new an(3*t.vertices.length,3),r=new an(3*t.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new an(t.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&
10(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new an(t,3)),this},updateFromObject:function(e){var t=e.geometry;if(e.isMesh){var n=t.__directGeometry;if(!0===t.elementsNeedUpdate&&(n=void 0,t.elementsNeedUpdate=!1),void 0===n)return this.fromGeometry(t);n.verticesNeedUpdate=t.verticesNeedUpdate,n.normalsNeedUpdate=t.normalsNeedUpdate,n.colorsNeedUpdate=t.colorsNeedUpdate,n.uvsNeedUpdate=t.uvsNeedUpdate,n.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=n}if(!0===t.verticesNeedUpdate){var r=this.attributes.position;void 0!==r&&(r.copyVector3sArray(t.vertices),r.needsUpdate=!0),t.verticesNeedUpdate=!1}if(!0===t.normalsNeedUpdate){var i=this.attributes.normal;void 0!==i&&(i.copyVector3sArray(t.normals),i.needsUpdate=!0),t.normalsNeedUpdate=!1}if(!0===t.colorsNeedUpdate){var o=this.attributes.color;void 0!==o&&(o.copyColorsArray(t.colors),o.needsUpdate=!0),t.colorsNeedUpdate=!1}if(t.uvsNeedUpdate){var a=this.attributes.uv;void 0!==a&&(a.copyVector2sArray(t.uvs),a.needsUpdate=!0),t.uvsNeedUpdate=!1}if(t.lineDistancesNeedUpdate){var s=this.attributes.lineDistance;void 0!==s&&(s.copyArray(t.lineDistances),s.needsUpdate=!0),t.lineDistancesNeedUpdate=!1}return t.groupsNeedUpdate&&(t.computeGroups(e.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new ln).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.setAttribute("position",new Jt(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.setAttribute("normal",new Jt(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.setAttribute("color",new Jt(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new Jt(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var o=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new Jt(o,2).copyVector2sArray(e.uvs2))}for(var a in this.groups=e.groups,e.morphTargets){for(var s=[],l=e.morphTargets[a],c=0,u=l.length;c<u;c++){var h=l[c],d=new an(3*h.data.length,3);d.name=h.name,s.push(d.copyVector3sArray(h.data))}this.morphAttributes[a]=s}if(e.skinIndices.length>0){var p=new an(4*e.skinIndices.length,4);this.setAttribute("skinIndex",p.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var f=new an(4*e.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Ee);var 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 "fal
10se".',this),void this.boundingBox.set(new Se(-1/0,-1/0,-1/0),new Se(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n<r;n++){var i=t[n];fn.setFromBufferAttribute(i),this.morphTargetsRelative?(vn.addVectors(this.boundingBox.min,fn.min),this.boundingBox.expandByPoint(vn),vn.addVectors(this.boundingBox.max,fn.max),this.boundingBox.expandByPoint(vn)):(this.boundingBox.expandByPoint(fn.min),this.boundingBox.expandByPoint(fn.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:function(){null===this.boundingSphere&&(this.boundingSphere=new Ue);var 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 "fal
10se".',this),void this.boundingSphere.set(new Se,1/0);if(e){var n=this.boundingSphere.center;if(fn.setFromBufferAttribute(e),t)for(var r=0,i=t.length;r<i;r++){var o=t[r];mn.setFromBufferAttribute(o),this.morphTargetsRelative?(vn.addVectors(fn.min,mn.min),fn.expandByPoint(vn),vn.addVectors(fn.max,mn.max),fn.expandByPoint(vn)):(fn.expandByPoint(mn.min),fn.expandByPoint(mn.max))}fn.getCenter(n);for(var a=0,s=0,l=e.count;s<l;s++)vn.fromBufferAttribute(e,s),a=Math.max(a,n.distanceToSquared(vn));if(t)for(var c=0,u=t.length;c<u;c++)for(var h=t[c],d=this.morphTargetsRelative,p=0,f=h.count;p<f;p++)vn.fromBufferAttribute(h,p),d&&(pn.fromBufferAttribute(e,p),vn.add(pn)),a=Math.max(a,n.distanceToSquared(vn));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.getAttribute("position");if(void 0!==t){var n=this.getAttribute("normal");if(void 0===n)n=new Jt(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(var r=0,i=n.count;r<i;r++)n.setXYZ(r,0,0,0);var o=new Se,a=new Se,s=new Se,l=new Se,c=new Se,u=new Se,h=new Se,d=new Se;if(e)for(var p=0,f=e.count;p<f;p+=3){var m=e.getX(p+0),v=e.getX(p+1),g=e.getX(p+2);o.fromBufferAttribute(t,m),a.fromBufferAttribute(t,v),s.fromBufferAttribute(t,g),h.subVectors(s,a),d.subVectors(o,a),h.cross(d),l.fromBufferAttribute(n,m),c.fromBufferAttribute(n,v),u.fromBufferAttribute(n,g),l.add(h),c.add(h),u.add(h),n.setXYZ(m,l.x,l.y,l.z),n.setXYZ(v,c.x,c.y,c.z),n.setXYZ(g,u.x,u.y,u.z)}else for(var y=0,x=t.count;y<x;y+=3)o.fromBufferAttribute(t,y+0),a.fromBufferAttribute(t,y+1),s.fromBufferAttribute(t,y+2),h.subVectors(s,a),d.subVectors(o,a),h.cross(d),n.setXYZ(y+0,h.x,h.y,h.z),n.setXYZ(y+1,h.x,h.y,h.z),n.setXYZ(y+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==e.attributes[r])for(var i=n[r].array,o=e.attributes[r],a=o.array,s=o.itemSize*t,l=Math.min(a.length,i.length-s),c=0,u=s;c<l;c++,u++)i[u]=a[c];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)vn.fromBufferAttribute(e,t),vn.normalize(),e.setXYZ(t,vn.x,vn.y,vn.z)},toNonIndexed:function(){function e(e,t){for(var n=e.array,r=e.itemSize,i=e.normalized,o=new n.constructor(t.length*r),a=0,s=0,l=0,c=t.length;l<c;l++){a=t[l]*r;for(var u=0;u<r;u++)o[s++]=n[a++]}return new Jt(o,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new gn,n=this.index.array,r=this.attributes;for(var i in r){var o=e(r[i],n);t.setAttribute(i,o)}var a=this.morphAttributes;for(var s in a){for(var l=[],c=a[s],u=0,h=c.length;u<h;u++){var d=e(c[u],n);l.push(d)}t.morphAttributes[s]=l}t.morphTargetsRelative=this.morphTargetsRelative;for(var p=this.groups,f=0,m=p.length;f<m;f++){var v=p[f];t.addGroup(v.start,v.count,v.materialIndex)}return t},toJSON:function(){var 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){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var o in i){var a=i[o],s=a.toJSON(e.data);""!==a.name&&(s.name=a.name),e.data.attributes[o]=s}var l={},c=!1;for(var u in this.morphAttributes){for(var h=this.morphAttributes[u],d=[],p=0,f=h.length;p<f;p++){var m=h[p],v=m.toJSON(e.data);""!==m.name&&(v.name=m.name),d.push(v)}d.length>0&&(l[u]=d,c=!0)}c&&(e.data.morphAttributes=l,e.data.morphTargetsRelative=this.morphTargetsRelative);var g=this.groups;g.length>0&&(e.data.groups=JSON.parse(JSON.stringify(g)));var y=this.boundingSphere;return null!==y&&(e.data.boundingSphere={center:y.center.toArray(),radius:y.radius}),e},clone:function(){return(new gn).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var n=e.index;null!==n&&this.setIndex(n.clone(t));var r=e.attributes;for(var i in r){var o=r[i];this.setAttribute(i,o.clone(t))}var a=e.morphAttributes;for(var s in a){for(var l=[],c=a[s],u=0,h=c.length;u<h;u++)l.push(c[u].clone(t));this.morphAttributes[s]=l}this.morphTargetsRelative=e.morphTargetsRelative;for(var d=e.groups,p=0,f=d.length;p<f;p++){var m=d[p];this.addGroup(m.start,m.count,m.materialIndex)}var v=e.boundingBox;null!==v&&(this.boundingBox=v.clone());var g=e.boundingSphere;return null!==g&&(this.boundingSphere=g.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var yn=new Je,xn=new Ze,bn=new Ue,_n=new Se,wn=new Se,Sn=new Se,Mn=new Se,Tn=new Se,En=new Se,Cn=new Se,Ln=new Se,Rn=new Se,An=new fe,Pn=new fe,In=new fe,On=new Se,Dn=new Se;function Nn(e,t){wt.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new gn,this.material=void 0!==t?t:new Yt,this.updateMorphTargets()}
10function kn(e,t,n,r,i,o,a,s){if(null===(1===t.side?r.intersectTriangle(a,o,i,!0,s):r.intersectTriangle(i,o,a,2!==t.side,s)))return null;Dn.copy(s),Dn.applyMatrix4(e.matrixWorld);var l=n.ray.origin.distanceTo(Dn);return l<n.near||l>n.far?null:{distance:l,point:Dn.clone(),object:e}}function zn(e,t,n,r,i,o,a,s,l,c,u,h){_n.fromBufferAttribute(i,c),wn.fromBufferAttribute(i,u),Sn.fromBufferAttribute(i,h);var d=e.morphTargetInfluences;if(t.morphTargets&&o&&d){Cn.set(0,0,0),Ln.set(0,0,0),Rn.set(0,0,0);for(var p=0,f=o.length;p<f;p++){var m=d[p],v=o[p];0!==m&&(Mn.fromBufferAttribute(v,c),Tn.fromBufferAttribute(v,u),En.fromBufferAttribute(v,h),a?(Cn.addScaledVector(Mn,m),Ln.addScaledVector(Tn,m),Rn.addScaledVector(En,m)):(Cn.addScaledVector(Mn.sub(_n),m),Ln.addScaledVector(Tn.sub(wn),m),Rn.addScaledVector(En.sub(Sn),m)))}_n.add(Cn),wn.add(Ln),Sn.add(Rn)}e.isSkinnedMesh&&(e.boneTransform(c,_n),e.boneTransform(u,wn),e.boneTransform(h,Sn));var g=kn(e,t,n,r,_n,wn,Sn,On);if(g){s&&(An.fromBufferAttribute(s,c),Pn.fromBufferAttribute(s,u),In.fromBufferAttribute(s,h),g.uv=zt.getUV(On,_n,wn,Sn,An,Pn,In,new fe)),l&&(An.fromBufferAttribute(l,c),Pn.fromBufferAttribute(l,u),In.fromBufferAttribute(l,h),g.uv2=zt.getUV(On,_n,wn,Sn,An,Pn,In,new fe));var y=new jt(c,u,h);zt.getNormal(_n,wn,Sn,y.normal),g.face=y}return g}Nn.prototype=Object.assign(Object.create(wt.prototype),{constructor:Nn,isMesh:!0,copy:function(e){return wt.prototype.copy.call(this,e),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:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i<o;i++){var a=r[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=i}}}}else{var s=e.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n,r=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),bn.copy(r.boundingSphere),bn.applyMatrix4(o),!1!==e.ray.intersectsSphere(bn)&&(yn.getInverse(o),xn.copy(e.ray).applyMatrix4(yn),null===r.boundingBox||!1!==xn.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var a=r.index,s=r.attributes.position,l=r.morphAttributes.position,c=r.morphTargetsRelative,u=r.attributes.uv,h=r.attributes.uv2,d=r.groups,p=r.drawRange;if(null!==a)if(Array.isArray(i))for(var f=0,m=d.length;f<m;f++)for(var v=d[f],g=i[v.materialIndex],y=Math.max(v.start,p.start),x=Math.min(v.start+v.count,p.start+p.count);y<x;y+=3){var b=a.getX(y),_=a.getX(y+1),w=a.getX(y+2);(n=zn(this,g,e,xn,s,l,c,u,h,b,_,w))&&(n.faceIndex=Math.floor(y/3),n.face.materialIndex=v.materialIndex,t.push(n))}else for(var S=Math.max(0,p.start),M=Math.min(a.count,p.start+p.count);S<M;S+=3){var T=a.getX(S),E=a.getX(S+1),C=a.getX(S+2);(n=zn(this,i,e,xn,s,l,c,u,h,T,E,C))&&(n.faceIndex=Math.floor(S/3),t.push(n))}else if(void 0!==s)if(Array.isArray(i))for(var L=0,R=d.length;L<R;L++)for(var A=d[L],P=i[A.materialIndex],I=Math.max(A.start,p.start),O=Math.min(A.start+A.count,p.start+p.count);I<O;I+=3){(n=zn(this,P,e,xn,s,l,c,u,h,I,I+1,I+2))&&(n.faceIndex=Math.floor(I/3),n.face.materialIndex=A.materialIndex,t.push(n))}else for(var D=Math.max(0,p.start),N=Math.min(s.count,p.start+p.count);D<N;D+=3){(n=zn(this,i,e,xn,s,l,c,u,h,D,D+1,D+2))&&(n.faceIndex=Math.floor(D/3),t.push(n))}}else if(r.isGeometry){var k,z=Array.isArray(i),B=r.vertices,F=r.faces,G=r.faceVertexUvs[0];G.length>0&&(k=G);for(var H=0,U=F.length;H<U;H++){var W=F[H],V=z?i[W.materialIndex]:i;if(void 0!==V){var j=B[W.a],X=B[W.b],q=B[W.c];if(n=kn(this,V,e,xn,j,X,q,On)){if(k&&k[H]){var Y=k[H];An.copy(Y[0]),Pn.copy(Y[1]),In.copy(Y[2]),n.uv=zt.getUV(On,j,X,q,An,Pn,In,new fe)}n.face=W,n.faceIndex=H,t.push(n)}}}}}});var Bn=function(e){function t(t,n,r,i,o,a){var s;void 0===t&&(t=1),void 0===n&&(n=1),void 0===r&&(r=1),void 0===i&&(i=1),void 0===o&&(o=1),void 0===a&&(a=1),(s=e.call(this)||this).type="BoxBufferGeometry",s.parameters={width:t,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:a};var l=de(s);i=Math.floor(i),o=Math.floor(o),a=Math.floor(a);var c=[],u=[],h=[],d=[],p=0,f=0;function m(e,t,n,r,i,o,a,s,m,v,g){for(var y=o/m,x=a/v,b=o/2,_=a/2,w=s/2,S=m+1,M=v+1,T=0,E=0,C=new Se,L=0;L<M;L++)for(var R=L*x-_,A=0;A<S;A++){var P=A*y-b;C[e]=P*r,C[t]=R*i,C[n]=w,u.push(C.x,C.y,C.z),C[e]=0,C[t]=0,C[n]=s>0?1:-1,h.push(C.x,C.y,C.z),d.push(A/m),d.push(1-L/v),T+=1}for(var I=0;I<v;I++)for(var O=0;O<m;O++){var D=p+O+S*I,N=p+O+S*(I+1),k=p+(O+1)+S*(I+1),z=p+(O+1)+S*I;c.push(D,N,z),c.push(N,k,z),E+=6}l.addGroup(f,E,g),f+=E,p+=T}return m("z","y","x",-1,-1,r,n,t,a,o,0),m("z","y","x",1,-1,r,n,-t,a,o,1),m("x","z","y",1,1,t,r,n,i,a,2),m("x","z","y",1,-1,t,r,-n,i,a,3),m("x","y","z",1,-1,t,n,r,i,o,4),m("x","y","z",-1,-1,t,n,-r,i,o,5),s.setIndex(c),s.setAttribute("position",new an(u,3)),s.setAttribute("normal",new an(h,3)),s.setAttribute("uv",new an(d,2)),s}return he(t,e),t}(gn);function Fn(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}function Gn(e){for(var t={},n=0;n<e.length;n++){var r=Fn(e[n]);for(var i in r)t[i]=r[i]}return t}var Hn={clone:Fn,merge:Gn};function Un(e){qt.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},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.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function Wn(){wt.call(this),this.type="Camera",this.matrixWorldInverse=new Je,this.projectionMatrix=new Je,this.projectionMatrixInverse=new Je}function Vn(e,t,n,r){Wn.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}Un.prototype=Object.create(qt.prototype),Un.prototype.constructor=Un,Un.prototype.isShaderMaterial=!0,Un.prototype.copy=function(e){return qt.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Fn(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this},Un.prototype.toJSON=function(e){var t=qt.prototype.toJSON.call(this,e);for(var n in t.glslVersion=this.glslVersion,t.uniforms={},this.uniforms){var 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;var i={};for(var o in this.extensions)!0===this.extensions[o]&&(i[o]=!0);return Object.keys(i).length>0&&(t.extensions=i),t},Wn.prototype=Object.assign(Object.create(wt.prototype),{constructor:Wn,isCamera:!0,copy:function(e,t){return wt.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Se),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){wt.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){wt.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Vn.prototype=Object.assign(Object.create(Wn.prototype),{constructor:Vn,isPerspectiveCamera:!0,copy:function(e,t){return Wn.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*le.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*le.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e}
10,getEffectiveFOV:function(){return 2*le.RAD2DEG*Math.atan(Math.tan(.5*le.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*le.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/a,t-=o.offsetY*n/s,r*=o.width/a,n*=o.height/s}var l=this.filmOffset;0!==l&&(i+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=wt.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var jn=90;function Xn(e,t,n){if(wt.call(this),this.type="CubeCamera",!0===n.isWebGLCubeRenderTarget){this.renderTarget=n;var r=new Vn(jn,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Se(1,0,0)),this.add(r);var i=new Vn(jn,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Se(-1,0,0)),this.add(i);var o=new Vn(jn,1,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new Se(0,1,0)),this.add(o);var a=new Vn(jn,1,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new Se(0,-1,0)),this.add(a);var s=new Vn(jn,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new Se(0,0,1)),this.add(s);var l=new Vn(jn,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Se(0,0,-1)),this.add(l),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var c=e.xr.enabled,u=e.getRenderTarget();e.xr.enabled=!1;var h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=h,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(u),e.xr.enabled=c},this.clear=function(e,t,r,i){for(var o=e.getRenderTarget(),a=0;a<6;a++)e.setRenderTarget(n,a),e.clear(t,r,i);e.setRenderTarget(o)}}else console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.")}function qn(e,t,n,r,o,a,s,l,c,u){e=void 0!==e?e:[],t=void 0!==t?t:i,s=void 0!==s?s:T,ye.call(this,e,t,n,r,o,a,s,l,c,u),this.flipY=!1,this._needsFlipEnvMap=!0}function Yn(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),be.call(this,e,e,t),t=t||{},this.texture=new qn(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture._needsFlipEnvMap=!1}function Kn(e,t,n,r,i,o,a,s,l,c,u,h){ye.call(this,null,o,a,s,l,c,r,i,u,h),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:p,this.minFilter=void 0!==c?c:p,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Xn.prototype=Object.create(wt.prototype),Xn.prototype.constructor=Xn,qn.prototype=Object.create(ye.prototype),qn.prototype.constructor=qn,qn.prototype.isCubeTexture=!0,Object.defineProperty(qn.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),Yn.prototype=Object.create(be.prototype),Yn.prototype.constructor=Yn,Yn.prototype.isWebGLCubeRenderTarget=!0,Yn.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=E,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;var n={tEquirect:{value:null}},r="\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t#include <begin_vertex>\n\t\t\t\t#include <project_vertex>\n\n\t\t\t}\n\t\t",i="\n\n\t\t\tuniform sampler2D tEquirect;\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t}\n\t\t",o=new Bn(5,5,5),a=new Un({name:"CubemapFromEquirect",uniforms:Fn(n),vertexShader:r,fragmentShader:i,side:1,blending:0});a.uniforms.tEquirect.value=t;var s=new Nn(o,a),l=t.minFilter;return t.minFilter===y&&(t.minFilter=v),new Xn(1,10,this).update(e,s),t.minFilter=l,s.geometry.dispose(),s.material.dispose(),this},Kn.prototype=Object.create(ye.prototype),Kn.prototype.constructor=Kn,Kn.prototype.isDataTexture=!0;var Zn=new Ue,Jn=new Se,Qn=function(){function e(e,t,n,r,i,o){this.planes=[void 0!==e?e:new Et,void 0!==t?t:new Et,void 0!==n?n:new Et,void 0!==r?r:new Et,void 0!==i?i:new Et,void 0!==o?o:new Et]}var t=e.prototype;return t.set=function(e,t,n,r,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){for(var t=this.planes,n=0;n<6;
10n++)t[n].copy(e.planes[n]);return this},t.setFromProjectionMatrix=function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],c=n[6],u=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],v=n[13],g=n[14],y=n[15];return t[0].setComponents(a-r,u-s,f-h,y-m).normalize(),t[1].setComponents(a+r,u+s,f+h,y+m).normalize(),t[2].setComponents(a+i,u+l,f+d,y+v).normalize(),t[3].setComponents(a-i,u-l,f-d,y-v).normalize(),t[4].setComponents(a-o,u-c,f-p,y-g).normalize(),t[5].setComponents(a+o,u+c,f+p,y+g).normalize(),this},t.intersectsObject=function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Zn.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Zn)},t.intersectsSprite=function(e){return Zn.center.set(0,0,0),Zn.radius=.7071067811865476,Zn.applyMatrix4(e.matrixWorld),this.intersectsSphere(Zn)},t.intersectsSphere=function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(n)<r)return!1}return!0},t.intersectsBox=function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(Jn.x=r.normal.x>0?e.max.x:e.min.x,Jn.y=r.normal.y>0?e.max.y:e.min.y,Jn.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Jn)<0)return!1}return!0},t.containsPoint=function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0},e}();function $n(){var e=null,t=!1,n=null,r=null;function i(t,o){n(t,o),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function er(e,t){var n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){var o=r.get(t);(!o||o.version<t.version)&&r.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version})}else{t.isInterleavedBufferAttribute&&(t=t.data);var a=r.get(t);void 0===a?r.set(t,function(t,n){var r=t.array,i=t.usage,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();var a=5126;return r instanceof Float32Array?a=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?a=5123:r instanceof Int16Array?a=5122:r instanceof Uint32Array?a=5125:r instanceof Int32Array?a=5124:r instanceof Int8Array?a=5120:r instanceof Uint8Array&&(a=5121),{buffer:o,type:a,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(t,i)):a.version<t.version&&(!function(t,r,i){var o=r.array,a=r.updateRange;e.bindBuffer(i,t),-1===a.count?e.bufferSubData(i,0,o):(n?e.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o,a.offset,a.count):e.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o.subarray(a.offset,a.offset+a.count)),a.count=-1)}(a.buffer,t,i),a.version=t.version)}}}}var tr=function(e){function t(t,n,r,i){var o;(o=e.call(this)||this).type="PlaneBufferGeometry",o.parameters={width:t,height:n,widthSegments:r,heightSegments:i};for(var a=(t=t||1)/2,s=(n=n||1)/2,l=Math.floor(r)||1,c=Math.floor(i)||1,u=l+1,h=c+1,d=t/l,p=n/c,f=[],m=[],v=[],g=[],y=0;y<h;y++)for(var x=y*p-s,b=0;b<u;b++){var _=b*d-a;m.push(_,-x,0),v.push(0,0,1),g.push(b/l),g.push(1-y/c)}for(var w=0;w<c;w++)for(var S=0;S<l;S++){var M=S+u*w,T=S+u*(w+1),E=S+1+u*(w+1),C=S+1+u*w;f.push(M,T,C),f.push(T,E,C)}return o.setIndex(f),o.setAttribute("position",new an(m,3)),o.setAttribute("normal",new an(v,3)),o.setAttribute("uv",new an(g,2)),o}return he(t,e),t}(gn),nr
vendor: 3,852 bytes, line 10
10={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\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:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\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\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );
vendor: 4,528 bytes, line 10
10\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}
vendor: 10,750 bytes, line 10
10\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + dis
vendor: 22,913 bytes, line 10
10placementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(
10\t\t0, 1,\t\t
vendor: 19,094 bytes, line 10
100 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
vendor: 9,151 bytes, line 10
10\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.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\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
vendor: 7,258 bytes, line 10
10\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(
10\t1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,\t1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,\t
vendor: 33,369 bytes, line 10
101.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",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}",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 <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}",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}",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 <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}",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}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\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}",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 <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <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}",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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_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 <cube_uv_reflection_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\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\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 <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <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 <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_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 <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <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 <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\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 <fog_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\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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 <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 <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\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\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_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 <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\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#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\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_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 <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\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\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#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\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#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\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <transmissionmap_pars_fragment>\n#include <bsdfs>\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 <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_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#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\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 <transmissionmap_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 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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#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\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#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\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}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#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\n#include <packing>\n#include <uv_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}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#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\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 <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#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\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_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\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_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>\nvoid main() {\n\t#include <color_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}",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 <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_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 <shadowmap_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 <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\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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}"},
vendor: 590 bytes, line 10
10rr={common:{diffuse:{value:new Vt(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new me},uv2Transform:{value:new me},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new fe(1,1)}}
vendor: 4,817 bytes, line 10
10,displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Vt(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:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{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 Vt(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new me}},sprite:{diffuse:{value:new Vt(15658734)},opacity:{value:1},center:{value:new fe(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new me}}},ir={basic:{uniforms:Gn([rr.common,rr.specularmap,rr.envmap,rr.aomap,rr.lightmap,rr.fog]),vertexShader:nr.meshbasic_vert,fragmentShader:nr.meshbasic_frag},lambert:{uniforms:Gn([rr.common,rr.specularmap,rr.envmap,rr.aomap,rr.lightmap,rr.emissivemap,rr.fog,rr.lights,{emissive:{value:new Vt(0)}}]),vertexShader:nr.meshlambert_vert,fragmentShader:nr.meshlambert_frag},phong:{uniforms:Gn([rr.common,rr.specularmap,rr.envmap,rr.aomap,rr.lightmap,rr.emissivemap,rr.bumpmap,rr.normalmap,rr.displacementmap,rr.fog,rr.lights,{emissive:{value:new Vt(0)},specular:{value:new Vt(1118481)},shininess:{value:30}}]),vertexShader:nr.meshphong_vert,fragmentShader:nr.meshphong_frag},standard:{uniforms:Gn([rr.common,rr.envmap,rr.aomap,rr.lightmap,rr.emissivemap,rr.bumpmap,rr.normalmap,rr.displacementmap,rr.roughnessmap,rr.metalnessmap,rr.fog,rr.lights,{emissive:{value:new Vt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:nr.meshphysical_vert,fragmentShader:nr.meshphysical_frag},toon:{uniforms:Gn([rr.common,rr.aomap,rr.lightmap,rr.emissivemap,rr.bumpmap,rr.normalmap,rr.displacementmap,rr.gradientmap,rr.fog,rr.lights,{emissive:{value:new Vt(0)}}]),vertexShader:nr.meshtoon_vert,fragmentShader:nr.meshtoon_frag},matcap:{uniforms:Gn([rr.common,rr.bumpmap,rr.normalmap,rr.displacementmap,rr.fog,{matcap:{value:null}}]),vertexShader:nr.meshmatcap_vert,fragmentShader:nr.meshmatcap_frag},points:{uniforms:Gn([rr.points,rr.fog]),vertexShader:nr.points_vert,fragmentShader:nr.points_frag},dashed:{uniforms:Gn([rr.common,rr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:nr.linedashed_vert,fragmentShader:nr.linedashed_frag},depth:{uniforms:Gn([rr.common,rr.displacementmap]),vertexShader:nr.depth_vert,fragmentShader:nr.depth_frag},normal:{uniforms:Gn([rr.common,rr.bumpmap,rr.normalmap,rr.displacementmap,{opacity:{value:1}}]),vertexShader:nr.normal_vert,fragmentShader:nr.normal_frag},sprite:{uniforms:Gn([rr.sprite,rr.fog]),vertexShader:nr.sprite_vert,fragmentShader:nr.sprite_frag},background:{uniforms:{uvTransform:{value:new me},t2D:{value:null}},vertexShader:nr.background_vert,fragmentShader:nr.background_frag},cube:{uniforms:Gn([rr.envmap,{opacity:{value:1}}]),vertexShader:nr.cube_vert,fragmentShader:nr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:nr.equirect_vert,fragmentShader:nr.equirect_frag},distanceRGBA:{uniforms:Gn([rr.common,rr.displacementmap,{referencePosition:{value:new Se},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:nr.distanceRGBA_vert,fragmentShader:nr.distanceRGBA_frag},shadow:{uniforms:Gn([rr.lights,rr.fog,{color:{value:new Vt(0)},opacity:{value:1}}]),vertexShader:nr.shadow_vert,fragmentShader:nr.shadow_frag}};function or(e,t,n,r,i){var o,a,s=new Vt(0),c=0,u=null,h=0,d=null;function p(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return s},setClearColor:function(e,t){s.set(e),p(s,c=void 0!==t?t:1)},getClearAlpha:function(){return c},setClearAlpha:function(e){p(s,c=e)},render:function(n,i,f,m){var v=!0===i.isScene?i.background:null;
10v&&v.isTexture&&(v=t.get(v));var g=e.xr,y=g.getSession&&g.getSession();y&&"additive"===y.environmentBlendMode&&(v=null),null===v?p(s,c):v&&v.isColor&&(p(v,1),m=!0),(e.autoClear||m)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),v&&(v.isCubeTexture||v.isWebGLCubeRenderTarget||v.mapping===l)?(void 0===a&&((a=new Nn(new Bn(1,1,1),new Un({name:"BackgroundCubeMaterial",uniforms:Fn(ir.cube.uniforms),vertexShader:ir.cube.vertexShader,fragmentShader:ir.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(a)),v.isWebGLCubeRenderTarget&&(v=v.texture),a.material.uniforms.envMap.value=v,a.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v._needsFlipEnvMap?-1:1,u===v&&h===v.version&&d===e.toneMapping||(a.material.needsUpdate=!0,u=v,h=v.version,d=e.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null)):v&&v.isTexture&&(void 0===o&&((o=new Nn(new tr(2,2),new Un({name:"BackgroundMaterial",uniforms:Fn(ir.background.uniforms),vertexShader:ir.background.vertexShader,fragmentShader:ir.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=v,!0===v.matrixAutoUpdate&&v.updateMatrix(),o.material.uniforms.uvTransform.value.copy(v.matrix),u===v&&h===v.version&&d===e.toneMapping||(o.material.needsUpdate=!0,u=v,h=v.version,d=e.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null))}}}function ar(e,t,n,r){var i=e.getParameter(34921),o=r.isWebGL2?null:t.get("OES_vertex_array_object"),a=r.isWebGL2||null!==o,s={},l=d(null),c=l;function u(t){return r.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function h(t){return r.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function d(e){for(var t=[],n=[],r=[],o=0;o<i;o++)t[o]=0,n[o]=0,r[o]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:r,object:e,attributes:{},index:null}}function p(){for(var e=c.newAttributes,t=0,n=e.length;t<n;t++)e[t]=0}function f(e){m(e,0)}function m(n,i){var o=c.newAttributes,a=c.enabledAttributes,s=c.attributeDivisors;(o[n]=1,0===a[n]&&(e.enableVertexAttribArray(n),a[n]=1),s[n]!==i)&&((r.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),s[n]=i)}function v(){for(var t=c.newAttributes,n=c.enabledAttributes,r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function g(t,n,i,o,a,s){!0!==r.isWebGL2||5124!==i&&5125!==i?e.vertexAttribPointer(t,n,i,o,a,s):e.vertexAttribIPointer(t,n,i,a,s)}function y(){x(),c!==l&&u((c=l).object)}function x(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(i,l,h,y,x){var b=!1;if(a){var _=function(t,n,i){var a=!0===i.wireframe,l=s[t.id];void 0===l&&(l={},s[t.id]=l);var c=l[n.id];void 0===c&&(c={},l[n.id]=c);var u=c[a];void 0===u&&(u=d(r.isWebGL2?e.createVertexArray():o.createVertexArrayOES()),c[a]=u);return u}(y,h,l);c!==_&&u((c=_).object),(b=function(e,t){var n=c.attributes,r=e.attributes;if(Object.keys(n).length!==Object.keys(r).length)return!0;for(var i in r){var o=n[i],a=r[i];if(void 0===o)return!0;if(o.attribute!==a)return!0;if(o.data!==a.data)return!0}return c.index!==t}(y,x))&&function(e,t){var n={},r=e.attributes;for(var i in r){var o=r[i],a={};a.attribute=o,o.data&&(a.data=o.data),n[i]=a}c.attributes=n,c.index=t}(y,x)}else{var w=!0===l.wireframe;c.geometry===y.id&&c.program===h.id&&c.wireframe===w||(c.geometry=y.id,c.program=h.id,c.wireframe=w,b=!0)}!0===i.isInstancedMesh&&(b=!0),null!==x&&n.update(x,34963),b&&(!function(i,o,a,s){if(!1===r.isWebGL2&&(i.isInstancedMesh||s.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;p();var l=s.attributes,c=a.getAttributes(),u=o.defaultAttributeValues;for(var h in c){var d=c[h];if(d>=0){var y=l[h];if(void 0!==y){var x=y.normalized,b=y.itemSize,_=n.get(y);if(void 0===_)continue;var w=_.buffer,S=_.type,M=_.bytesPerElement;if(y.isInterleavedBufferAttribute){var T=y.data,E=T.stride,C=y.offset;T&&T.isInstancedInterleavedBuffer?(m(d,T.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=T.meshPerAttribute*T.count)):f(d),e.bindBuffer(34962,w),g(d,b,S,x,E*M,C*M)}else y.isInstancedBufferAttribute?(m(d,y.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=y.meshPerAttribute*y.count)):f(d),e.bindBuffer(34962,w),g(d,b,S,x,0,0)}else if("instanceMatrix"===h){var L=n.get(i.instanceMatrix);if(void 0===L)continue;var R=L.buffer,A=L.type;m(d+0,1),m(d+1,1),m(d+2,1),m(d+3,1),e.bindBuffer(34962,R),e.vertexAttribPointer(d+0,4,A,!1,64,0),e.vertexAttribPointer(d+1,4,A,!1,64,16),e.vertexAttribPointer(d+2,4,A,!1,64,32),e.vertexAttribPointer(d+3,4,A,!1,64,48)}else if("instanceColor"===h){var P=n.get(i.instanceColor);if(void 0===P)continue;var I=P.buffer,O=P.type;m(d,1),e.bindBuffer(34962,I),e.vertexAttribPointer(d,3,O,!1,12,0)}else if(void 0!==u){var D=u[h];if(void 0!==D)switch(D.length){case 2:e.vertexAttrib2fv(d,D);break;case 3:e.vertexAttrib3fv(d,D);break;case 4:e.vertexAttrib4fv(d,D);break;default:e.vertexAttrib1fv(d,D)}}}}v()}(i,l,h,y),null!==x&&e.bindBuffer(34963,n.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){for(var e in y(),s){var t=s[e];for(var n in t){var r=t[n];for(var i in r)h(r[i].object),delete r[i];delete t[n]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0!==s[e.id]){var t=s[e.id];for(var n in t){var r=t[n];for(var i in r)h(r[i].object),delete r[i];delete t[n]}delete s[e.id]}},releaseStatesOfProgram:function(e){for(var t in s){var n=s[t];if(void 0!==n[e.id]){var r=n[e.id];for(var i in r)h(r[i].object),delete r[i];delete n[e.id]}}},initAttributes:p,enableAttribute:f,disableUnusedAttributes:v}}function sr(e,t,n,r){var i,o=r.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i,1)},this.renderInstances=function(r,a,s){if(0!==s){var l,c;if(o)l=e,c="drawArraysInstanced";
10else if(c="drawArraysInstancedANGLE",null===(l=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](i,r,a,s),n.update(a,i,s)}}}function lr(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,a=void 0!==n.precision?n.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var l=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),u=e.getParameter(35660),h=e.getParameter(3379),d=e.getParameter(34076),p=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),v=e.getParameter(36349),g=u>0,y=o||!!t.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y,maxSamples:o?e.getParameter(36183):0}}function cr(e){var t=this,n=null,r=0,i=!1,o=!1,a=new Et,s=new me,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){var o=null!==e?e.length:0,c=null;if(0!==o){if(c=l.value,!0!==i||null===c){var u=r+4*o,h=n.matrixWorldInverse;s.getNormalMatrix(h),(null===c||c.length<u)&&(c=new Float32Array(u));for(var d=0,p=r;d!==o;++d,p+=4)a.copy(e[d]).applyMatrix4(h,s),a.normal.toArray(c,p),c[p+3]=a.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=o,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,o){var a=0!==e.length||t||0!==r||i;return i=t,n=u(e,o,0),r=e.length,a},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,c()},this.setState=function(t,a,s){var h=t.clippingPlanes,d=t.clipIntersection,p=t.clipShadows,f=e.get(t);if(!i||null===h||0===h.length||o&&!p)o?u(null):c();else{var m=o?0:r,v=4*m,g=f.clippingState||null;l.value=g,g=u(h,a,v,s);for(var y=0;y!==v;++y)g[y]=n[y];f.clippingState=g,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=m}}}function ur(e){var t=new WeakMap;function n(e,t){return t===a?e.mapping=i:t===s&&(e.mapping=o),e}return{get:function(r){if(r&&r.isTexture){var i=r.mapping;if(i===a||i===s){if(t.has(r))return n(t.get(r).texture,r.mapping);var o=r.image;if(o&&o.height>0){var l=e.getRenderList(),c=e.getRenderTarget(),u=e.getRenderState(),h=new Yn(o.height/2);return h.fromEquirectangularTexture(e,r),t.set(r,h),e.setRenderTarget(c),e.setRenderList(l),e.setRenderState(u),n(h.texture,r.mapping)}return null}}return r},dispose:function(){t=new WeakMap}}}function hr(e){var t={};return{has:function(n){if(void 0!==t[n])return null!==t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,null!==r},get:function(e){return this.has(e)||console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t[e]}}}function dr(e,t,n,r){var i=new WeakMap,o=new WeakMap;function a(e){var s=e.target,l=i.get(s);for(var c in null!==l.index&&t.remove(l.index),l.attributes)t.remove(l.attributes[c]);s.removeEventListener("dispose",a),i.delete(s);var u=o.get(l);u&&(t.remove(u),o.delete(l)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){var n=[],r=e.index,i=e.attributes.position,a=0;if(null!==r){var s=r.array;a=r.version;for(var l=0,c=s.length;l<c;l+=3){var u=s[l+0],h=s[l+1],d=s[l+2];n.push(u,h,h,d,d,u)}}else{var p=i.array;a=i.version;for(var f=0,m=p.length/3-1;f<m;f+=3){var v=f+0,g=f+1,y=f+2;n.push(v,g,g,y,y,v)}}var x=new(cn(n)>65535?on:nn)(n,1);x.version=a;var b=o.get(e);b&&t.remove(b),o.set(e,x)}return{get:function(e,t){var r=i.get(t);return r||(t.addEventListener("dispose",a),t.isBufferGeometry?r=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new gn).setFromObject(e)),r=t._bufferGeometry),i.set(t,r),n.memory.geometries++,r)},update:function(e){var n=e.attributes;for(var r in n)t.update(n[r],34962);var i=e.morphAttributes;for(var o in i)for(var a=i[o],s=0,l=a.length;s<l;s++)t.update(a[s],34962)},getWireframeAttribute:function(e){var t=o.get(e);if(t){var n=e.index;null!==n&&t.version<n.version&&s(e)}else s(e);return o.get(e)}}}function pr(e,t,n,r){var i,o,a,s=r.isWebGL2;this.setMode=function(e){i=e},this.setIndex=function(e){o=e.type,a=e.bytesPerElement},this.render=function(t,r){e.drawElements(i,r,o,t*a),n.update(r,i,1)},this.renderInstances=function(r,l,c){if(0!==c){var u,h;if(s)u=e,h="drawElementsInstanced";
10else if(h="drawElementsInstancedANGLE",null===(u=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[h](i,l,o,r*a,c),n.update(l,i,c)}}}function fr(e){var 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(e,n,r){switch(t.calls++,n){case 4:t.triangles+=r*(e/3);break;case 1:t.lines+=r*(e/2);break;case 3:t.lines+=r*(e-1);break;case 2:t.lines+=r*e;break;case 0:t.points+=r*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function mr(e,t){return e[0]-t[0]}function vr(e,t){return Math.abs(t[1])-Math.abs(e[1])}function gr(e){for(var t={},n=new Float32Array(8),r=[],i=0;i<8;i++)r[i]=[i,0];return{update:function(i,o,a,s){var l=i.morphTargetInfluences,c=void 0===l?0:l.length,u=t[o.id];if(void 0===u){u=[];for(var h=0;h<c;h++)u[h]=[h,0];t[o.id]=u}for(var d=0;d<c;d++){var p=u[d];p[0]=d,p[1]=l[d]}u.sort(vr);for(var f=0;f<8;f++)f<c&&u[f][1]?(r[f][0]=u[f][0],r[f][1]=u[f][1]):(r[f][0]=Number.MAX_SAFE_INTEGER,r[f][1]=0);r.sort(mr);for(var m=a.morphTargets&&o.morphAttributes.position,v=a.morphNormals&&o.morphAttributes.normal,g=0,y=0;y<8;y++){var x=r[y],b=x[0],_=x[1];b!==Number.MAX_SAFE_INTEGER&&_?(m&&o.getAttribute("morphTarget"+y)!==m[b]&&o.setAttribute("morphTarget"+y,m[b]),v&&o.getAttribute("morphNormal"+y)!==v[b]&&o.setAttribute("morphNormal"+y,v[b]),n[y]=_,g+=_):(m&&void 0!==o.getAttribute("morphTarget"+y)&&o.deleteAttribute("morphTarget"+y),v&&void 0!==o.getAttribute("morphNormal"+y)&&o.deleteAttribute("morphNormal"+y),n[y]=0)}var w=o.morphTargetsRelative?1:1-g;s.getUniforms().setValue(e,"morphTargetBaseInfluence",w),s.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function yr(e,t,n,r){var i=new WeakMap;return{update:function(e){var o=r.render.frame,a=e.geometry,s=t.get(e,a);return i.get(s)!==o&&(a.isGeometry&&s.updateFromObject(e),t.update(s),i.set(s,o)),e.isInstancedMesh&&(n.update(e.instanceMatrix,34962),null!==e.instanceColor&&n.update(e.instanceColor,34962)),s},dispose:function(){i=new WeakMap}}}function xr(e,t,n,r){ye.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=p,this.minFilter=p,this.wrapR=h,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function br(e,t,n,r){ye.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=p,this.minFilter=p,this.wrapR=h,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}ir.physical={uniforms:Gn([ir.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new fe(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Vt(0)},transmission:{value:0},transmissionMap:{value:null}}]),vertexShader:nr.meshphysical_vert,fragmentShader:nr.meshphysical_frag},xr.prototype=Object.create(ye.prototype),xr.prototype.constructor=xr,xr.prototype.isDataTexture2DArray=!0,br.prototype=Object.create(ye.prototype),br.prototype.constructor=br,br.prototype.isDataTexture3D=!0;var _r=new ye,wr=new xr,Sr=new br,Mr=new qn,Tr=[],Er=[],Cr=new Float32Array(16),Lr=new Float32Array(9),Rr=new Float32Array(4);function Ar(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,o=Tr[i];if(void 0===o&&(o=new Float32Array(i),Tr[i]=o),0!==t){r.toArray(o,0);for(var a=1,s=0;a!==t;++a)s+=n,e[a].toArray(o,s)}return o}function Pr(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function Ir(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function Or(e,t){var n=Er[t];void 0===n&&(n=new Int32Array(t),Er[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function Dr(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Nr(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Pr(n,t))return;e.uniform2fv(this.addr,t),Ir(n,t)}}function kr(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(Pr(n,t))return;e.uniform3fv(this.addr,t),Ir(n,t)}}function zr(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Pr(n,t))return;e.uniform4fv(this.addr,t),Ir(n,t)}}function Br(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(Pr(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Ir(n,t)}else{if(Pr(n,r))return;Rr.set(r),e.uniformMatrix2fv(this.addr,!1,Rr),Ir(n,r)}}function Fr(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(Pr(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Ir(n,t)}else{if(Pr(n,r))return;Lr.set(r),e.uniformMatrix3fv(this.addr,!1,Lr),Ir(n,r)}}function Gr(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(Pr(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Ir(n,t)}else{if(Pr(n,r))return;Cr.set(r),e.uniformMatrix4fv(this.addr,!1,Cr),Ir(n,r)}}function Hr(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(t||_r,i)}function Ur(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||wr,i)}function Wr(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||Sr,i)}function Vr(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(t||Mr,i)}function jr(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Xr(e,t){var n=this.cache;Pr(n,t)||(e.uniform2iv(this.addr,t),Ir(n,t))}function qr(e,t){var n=this.cache;Pr(n,t)||(e.uniform3iv(this.addr,t),Ir(n,t))}function Yr(e,t){var n=this.cache;Pr(n,t)||(e.uniform4iv(this.addr,t),Ir(n,t))}function Kr(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Zr(e,t){e.uniform1fv(this.addr,t)}function Jr(e,t){e.uniform1iv(this.addr,t)}function Qr(e,t){e.uniform2iv(this.addr,t)}function $r(e,t){e.uniform3iv(this.addr,t)}function ei(e,t){e.uniform4iv(this.addr,t)}function ti(e,t){var n=Ar(t,this.size,2);e.uniform2fv(this.addr,n)}function ni(e,t){var n=Ar(t,this.size,3);e.uniform3fv(this.addr,n)}function ri(e,t){var n=Ar(t,this.size,4);e.uniform4fv(this.addr,n)}function ii(e,t){var n=Ar(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function oi(e,t){var n=Ar(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function ai(e,t){var n=Ar(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function si(e,t,n){var r=t.length,i=Or(n,r);e.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.safeSetTexture2D(t[o]||_r,i[o])}
vendor: 4,096 bytes, line 10
10function li(e,t,n){var r=t.length,i=Or(n,r);e.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.safeSetTextureCube(t[o]||Mr,i[o])}function ci(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return Dr;case 35664:return Nr;case 35665:return kr;case 35666:return zr;case 35674:return Br;case 35675:return Fr;case 35676:return Gr;case 5124:case 35670:return jr;case 35667:case 35671:return Xr;case 35668:case 35672:return qr;case 35669:case 35673:return Yr;case 5125:return Kr;case 35678:case 36198:case 36298:case 36306:case 35682:return Hr;case 35679:case 36299:case 36307:return Wr;case 35680:case 36300:case 36308:case 36293:return Vr;case 36289:case 36303:case 36311:case 36292:return Ur}}(t.type)}function ui(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Zr;case 35664:return ti;case 35665:return ni;case 35666:return ri;case 35674:return ii;case 35675:return oi;case 35676:return ai;case 5124:case 35670:return Jr;case 35667:case 35671:return Qr;case 35668:case 35672:return $r;case 35669:case 35673:return ei;case 35678:case 36198:case 36298:case 36306:case 35682:return si;case 35680:case 36300:case 36308:case 36293:return li}}(t.type)}function hi(e){this.id=e,this.seq=[],this.map={}}ui.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Ir(t,e)},hi.prototype.setValue=function(e,t,n){for(var r=this.seq,i=0,o=r.length;i!==o;++i){var a=r[i];a.setValue(e,t[a.id],n)}};var di=/([\w\d_]+)(\])?(\[|\.)?/g;function pi(e,t){e.seq.push(t),e.map[t.id]=t}function fi(e,t,n){var r=e.name,i=r.length;for(di.lastIndex=0;;){var o=di.exec(r),a=di.lastIndex,s=o[1],l="]"===o[2],c=o[3];if(l&&(s|=0),void 0===c||"["===c&&a+2===i){pi(n,void 0===c?new ci(s,e,t):new ui(s,e,t));break}var u=n.map[s];void 0===u&&pi(n,u=new hi(s)),n=u}}function mi(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),r=0;r<n;++r){var i=e.getActiveUniform(t,r);fi(i,e.getUniformLocation(t,i.name),this)}}function vi(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}mi.prototype.setValue=function(e,t,n,r){var i=this.map[t];void 0!==i&&i.setValue(e,n,r)},mi.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},mi.upload=function(e,t,n,r){for(var i=0,o=t.length;i!==o;++i){var a=t[i],s=n[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,r)}},mi.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var o=e[r];o.id in t&&n.push(o)}return n};var gi=0;function yi(e){switch(e){case q:return["Linear","( value )"];case Y:return["sRGB","( value )"];case Z:return["RGBE","( value )"];case J:return["RGBM","( value, 7.0 )"];case Q:return["RGBM","( value, 16.0 )"];case $:return["RGBD","( value, 256.0 )"];case K:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function xi(e,t,n){var r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();return r&&""===i?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+i+function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}(e.getShaderSource(t))}function bi(e,t){var n=yi(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function _i(e,t){var n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="OptimizedCineon";break;case 4:n="ACESFilmic";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function wi(e){return""!==e}function Si(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).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_L
10IGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Mi(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var Ti=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ei(e){return e.replace(Ti,Ci)}function Ci(e,t){var n=nr[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Ei(n)}var Li=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Ri=/#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 Ai(e){return e.replace(Ri,Ii).replace(Li,Pi)}function Pi(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Ii(e,t,n,r)}function Ii(e,t,n,r){for(var i="",o=parseInt(t);o<parseInt(n);o++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return i}function Oi(e){var 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 Di(e,t,n,r){var a,s,u,h,d,p=e.getContext(),f=n.defines,m=n.vertexShader,v=n.fragmentShader,g=function(e){var t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}(n),y=function(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case i:case o:t="ENVMAP_TYPE_CUBE";break;case l:case c:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),x=function(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case o:case c:t="ENVMAP_MODE_REFRACTION"}return t}(n),b=function(e){var t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(n),_=e.gammaFactor>0?e.gammaFactor:1,w=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||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.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(wi).join("\n")}(n),S=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(f),M=p.createProgram(),T=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?((a=[S].filter(wi).join("\n")).length>0&&(a+="\n"),(s=[w,S].filter(wi).join("\n")).length>0&&(s+="\n")):(a=[Oi(n),"#define SHADER_NAME "+n.shaderName,S,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+_,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+x:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alph
vendor: 4,258 bytes, line 10
10aMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+g:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\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(wi).join("\n"),s=[w,Oi(n),"#define SHADER_NAME "+n.shaderName,S,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+_,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+y:"",n.envMap?"#define "+x:"",n.envMap?"#define "+b:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+g:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?nr.tonemapping_pars_fragment:"",0!==n.toneMapping?_i("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",nr.encodings_pars_fragment,n.map?bi("mapTexelToLinear",n.mapEncoding):"",n.matcap?bi("matc
10apTexelToLinear",n.matcapEncoding):"",n.envMap?bi("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?bi("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?bi("lightMapTexelToLinear",n.lightMapEncoding):"",(u="linearToOutputTexel",h=n.outputEncoding,d=yi(h),"vec4 "+u+"( vec4 value ) { return LinearTo"+d[0]+d[1]+"; }"),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(wi).join("\n")),m=Mi(m=Si(m=Ei(m),n),n),v=Mi(v=Si(v=Ei(v),n),n),m=Ai(m),v=Ai(v),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(T="#version 300 es\n",a=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+a,s=["#define varying in",n.glslVersion===re?"":"out highp vec4 pc_fragColor;",n.glslVersion===re?"":"#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"+s);var E,C,L=T+s+v,R=vi(p,35633,T+a+m),A=vi(p,35632,L);if(p.attachShader(M,R),p.attachShader(M,A),void 0!==n.index0AttributeName?p.bindAttribLocation(M,0,n.index0AttributeName):!0===n.morphTargets&&p.bindAttribLocation(M,0,"position"),p.linkProgram(M),e.debug.checkShaderErrors){var P=p.getProgramInfoLog(M).trim(),I=p.getShaderInfoLog(R).trim(),O=p.getShaderInfoLog(A).trim(),D=!0,N=!0;if(!1===p.getProgramParameter(M,35714)){D=!1;var k=xi(p,R,"vertex"),z=xi(p,A,"fragment");console.error("THREE.WebGLProgram: shader error: ",p.getError(),"35715",p.getProgramParameter(M,35715),"gl.getProgramInfoLog",P,k,z)}else""!==P?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",P):""!==I&&""!==O||(N=!1);N&&(this.diagnostics={runnable:D,programLog:P,vertexShader:{log:I,prefix:a},fragmentShader:{log:O,prefix:s}})}return p.deleteShader(R),p.deleteShader(A),this.getUniforms=function(){return void 0===E&&(E=new mi(p,M)),E},this.getAttributes=function(){return void 0===C&&(C=function(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i<r;i++){var o=e.getActiveAttrib(t,i).name;n[o]=e.getAttribLocation(t,o)}return n}(p,M)),C},this.destroy=function(){r.releaseStatesOfProgram(this),p.deleteProgram(M),this.program=void 0},this.name=n.shaderName,this.id=gi++,this.cacheKey=t,this.usedTimes=1,this.program=M,this.vertexShader=R,this.fragmentShader=A,this}function Ni(e,t,n,r,i,o){var a=[],s=r.isWebGL2,u=r.logarithmicDepthBuffer,h=r.floatVertexTextures,d=r.maxVertexUniforms,p=r.vertexTextures,f=r.precision,m={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"},v=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmissionMap"];function g(e){var t;return e?e.isTexture?t=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding):t=q,t}return{getParameters:function(i,a,v,y,x){var b,_,w=y.fog,S=i.isMeshStandardMaterial?y.environment:null,M=t.get(i.envMap||S),T=m[i.type],E=x.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(h)return 1024;var n=d,r=Math.floor((n-20)/4),i=Math.min(r,t.length);return i<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+i+"."),0):i}(x):0;if(null!==i.precision&&(f=r.getMaxPrecision(i.precision))!==i.precision&&console.warn("THREE.WebGLProgram.getParameters:",i.precision,"not supported, using",f,"instead."),T){var C=ir[T];b=C.vertexShader,_=C.fragmentShader}else b=i.vertexShader,_=i.fragmentShader;var L=e.getRenderTarget();return{isWebGL2:s,shaderID:T,shaderName:i.type,vertexShader:b,fragmentShader:_,defines:i.defines,isRawShaderMaterial:!0===i.isRawShaderMaterial,glslVersion:i.glslVersion,precision:f,instancing:!0===x.isInstancedMesh,instancingColor:!0===x.isInstancedMesh&&null!==x.instanceColor,supportsVertexTextures:p,outputEncoding:null!==L?g(L.texture):e.outputEncoding,map:!!i.map,mapEncoding:g(i.map),matcap:!!i.matcap,matc
10apEncoding:g(i.matcap),envMap:!!M,envMapMode:M&&M.mapping,envMapEncoding:g(M),envMapCubeUV:!!M&&(M.mapping===l||M.mapping===c),lightMap:!!i.lightMap,lightMapEncoding:g(i.lightMap),aoMap:!!i.aoMap,emissiveMap:!!i.emissiveMap,emissiveMapEncoding:g(i.emissiveMap),bumpMap:!!i.bumpMap,normalMap:!!i.normalMap,objectSpaceNormalMap:1===i.normalMapType,tangentSpaceNormalMap:0===i.normalMapType,clearcoatMap:!!i.clearcoatMap,clearcoatRoughnessMap:!!i.clearcoatRoughnessMap,clearcoatNormalMap:!!i.clearcoatNormalMap,displacementMap:!!i.displacementMap,roughnessMap:!!i.roughnessMap,metalnessMap:!!i.metalnessMap,specularMap:!!i.specularMap,alphaMap:!!i.alphaMap,gradientMap:!!i.gradientMap,sheen:!!i.sheen,transmissionMap:!!i.transmissionMap,combine:i.combine,vertexTangents:i.normalMap&&i.vertexTangents,vertexColors:i.vertexColors,vertexUvs:!!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatMap||i.clearcoatRoughnessMap||i.clearcoatNormalMap||i.displacementMap||i.transmissionMap),uvsVertexOnly:!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatNormalMap||i.transmissionMap||!i.displacementMap),fog:!!w,useFog:i.fog,fogExp2:w&&w.isFogExp2,flatShading:i.flatShading,sizeAttenuation:i.sizeAttenuation,logarithmicDepthBuffer:u,skinning:i.skinning&&E>0,maxBones:E,useVertexTexture:h,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&v.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(!1===t.isRawShaderMaterial){for(var i=0;i<v.length;i++)n.push(t[v[i]]);n.push(e.outputEncoding),n.push(e.gammaFactor)}return n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){var t,n=m[e.type];if(n){var r=ir[n];t=Hn.clone(r.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,n){for(var r,o=0,s=a.length;o<s;o++){var l=a[o];if(l.cacheKey===n){++(r=l).usedTimes;break}}return void 0===r&&(r=new Di(e,n,t,i),a.push(r)),r},releaseProgram:function(e){if(0==--e.usedTimes){var t=a.indexOf(e);a[t]=a[a.length-1],a.pop(),e.destroy()}},programs:a}}function ki(){var e=new WeakMap;return{get:function(t){var n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function zi(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id: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 Bi(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 Fi(e){var t=[],n=0,r=[],i=[],o={id:-1};function a(r,i,a,s,l,c){var u=t[n],h=e.get(a);return void 0===u?(u={id:r.id,object:r,geometry:i,material:a,program:h.program||o,groupOrder:s,renderOrder:r.renderOrder,z:l,group:c},t[n]=u):(u.id=r.id,u.object=r,u.geometry=i,u.material=a,u.program=h.program||o,u.groupOrder=s,u.renderOrder=r.renderOrder,u.z=l,u.group=c),n++,u}return{opaque:r,transparent:i,init:function(){n=0,r.length=0,i.length=0},push:function(e,t,n,o,s,l){var c=a(e,t,n,o,s,l);(!0===n.transparent?i:r).push(c)},unshift:function(e,t,n,o,s,l){var c=a(e,t,n,o,s,l);(!0===n.transparent?i:r).unshift(c)},finish:function(){for(var e=n,r=t.length;e<r;e++){var i=t[e];
10if(null===i.id)break;i.id=null,i.object=null,i.geometry=null,i.material=null,i.program=null,i.group=null}},sort:function(e,t){r.length>1&&r.sort(e||zi),i.length>1&&i.sort(t||Bi)}}}function Gi(e){var t=new WeakMap;return{get:function(n,r){var i,o=t.get(n);return void 0===o?(i=new Fi(e),t.set(n,new WeakMap),t.get(n).set(r,i)):void 0===(i=o.get(r))&&(i=new Fi(e),o.set(r,i)),i},dispose:function(){t=new WeakMap}}}function Hi(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new Se,color:new Vt};break;case"SpotLight":n={position:new Se,direction:new Se,color:new Vt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Se,color:new Vt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Se,skyColor:new Vt,groundColor:new Vt};break;case"RectAreaLight":n={color:new Vt,position:new Se,halfWidth:new Se,halfHeight:new Se}}return e[t.id]=n,n}}}var Ui=0;function Wi(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Vi(){for(var e,t=new Hi,n=(e={},{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},i=0;i<9;i++)r.probe.push(new Se);var o=new Se,a=new Je,s=new Je;return{setup:function(e,i,l){for(var c=0,u=0,h=0,d=0;d<9;d++)r.probe[d].set(0,0,0);var p=0,f=0,m=0,v=0,g=0,y=0,x=0,b=0,_=l.matrixWorldInverse;e.sort(Wi);for(var w=0,S=e.length;w<S;w++){var M=e[w],T=M.color,E=M.intensity,C=M.distance,L=M.shadow&&M.shadow.map?M.shadow.map.texture:null;if(M.isAmbientLight)c+=T.r*E,u+=T.g*E,h+=T.b*E;else if(M.isLightProbe)for(var R=0;R<9;R++)r.probe[R].addScaledVector(M.sh.coefficients[R],E);else if(M.isDirectionalLight){var A=t.get(M);if(A.color.copy(M.color).multiplyScalar(M.intensity),A.direction.setFromMatrixPosition(M.matrixWorld),o.setFromMatrixPosition(M.target.matrixWorld),A.direction.sub(o),A.direction.transformDirection(_),M.castShadow){var P=M.shadow,I=n.get(M);I.shadowBias=P.bias,I.shadowNormalBias=P.normalBias,I.shadowRadius=P.radius,I.shadowMapSize=P.mapSize,r.directionalShadow[p]=I,r.directionalShadowMap[p]=L,r.directionalShadowMatrix[p]=M.shadow.matrix,y++}r.directional[p]=A,p++}else if(M.isSpotLight){var O=t.get(M);if(O.position.setFromMatrixPosition(M.matrixWorld),O.position.applyMatrix4(_),O.color.copy(T).multiplyScalar(E),O.distance=C,O.direction.setFromMatrixPosition(M.matrixWorld),o.setFromMatrixPosition(M.target.matrixWorld),O.direction.sub(o),O.direction.transformDirection(_),O.coneCos=Math.cos(M.angle),O.penumbraCos=Math.cos(M.angle*(1-M.penumbra)),O.decay=M.decay,M.castShadow){var D=M.shadow,N=n.get(M);N.shadowBias=D.bias,N.shadowNormalBias=D.normalBias,N.shadowRadius=D.radius,N.shadowMapSize=D.mapSize,r.spotShadow[m]=N,r.spotShadowMap[m]=L,r.spotShadowMatrix[m]=M.shadow.matrix,b++}r.spot[m]=O,m++}else if(M.isRectAreaLight){var k=t.get(M);k.color.copy(T).multiplyScalar(E),k.position.setFromMatrixPosition(M.matrixWorld),k.position.applyMatrix4(_),s.identity(),a.copy(M.matrixWorld),a.premultiply(_),s.extractRotation(a),k.halfWidth.set(.5*M.width,0,0),k.halfHeight.set(0,.5*M.height,0),k.halfWidth.applyMatrix4(s),k.halfHeight.applyMatrix4(s),r.rectArea[v]=k,v++}else if(M.isPointLight){var z=t.get(M);if(z.position.setFromMatrixPosition(M.matrixWorld),z.position.applyMatrix4(_),z.color.copy(M.color).multiplyScalar(M.intensity),z.distance=M.distance,z.decay=M.decay,M.castShadow){var B=M.shadow,F=n.get(M);F.shadowBias=B.bias,F.shadowNormalBias=B.normalBias,F.shadowRadius=B.radius,F.shadowMapSize=B.mapSize,F.shadowCameraNear=B.camera.near,F.shadowCameraFar=B.camera.far,r.pointShadow[f]=F,r.pointShadowMap[f]=L,r.pointShadowMatrix[f]=M.shadow.matrix,x++}r.point[f]=z,f++}else if(M.isHemisphereLight){var G=t.get(M);G.direction.setFromMatrixPosition(M.matrixWorld),G.direction.transformDirection(_),G.direction.normalize(),G.skyColor.copy(M.color).multiplyScalar(E),G.groundColor.copy(M.groundColor).multiplyScalar(E),r.hemi[g]=G,g++}}v>0&&(r.rectAreaLTC1=rr.LTC_1,r.rectAreaLTC2=rr.LTC_2),r.ambient[0]=c,r.ambient[1]=u,r.ambient[2]=h;var H=r.hash;H.directionalLength===p&&H.pointLength===f&&H.spotLength===m&&H.rectAreaLength===v&&H.hemiLength===g&&H.numDirectionalShadows===y&&H.numPointShadows===x&&H.numSpotShadows===b||(r.directional.length=p,r.spot.length=m,r.rectArea.length=v,r.point.length=f,r.hemi.length=g,r.directionalShadow.length=y,r.directionalShadowMap.length=y,r.pointShadow.length=x,r.pointShadowMap.length=x,r.spotShadow.length=b,r.spotShadowMap.length=b,r.directionalShadowMatrix.length=y,r.pointShadowMatrix.length=x,r.spotShadowMatrix.length=b,H.directionalLength=p,H.pointLength=f,H.spotLength=m,H.rectAreaLength=v,H.hemiLength=g,H.numDirectionalShadows=y,H.numPointShadows=x,H.numSpotShadows=b,r.version=Ui++)},state:r}}function ji(){var e=new Vi,t=[],n=[];return{init:function(){t.length=0,n.length=0},state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:function(r){e.setup(t,n,r)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)}}}function Xi(){var e=new WeakMap;return{get:function(t,n){var r;return!1===e.has(t)?(r=new ji,e.set(t,new WeakMap),e.get(t).set(n,r)):!1===e.get(t).has(n)?(r=new ji,e.get(t).set(n,r)):r=e.get(t).get(n),r},dispose:function(){e=new WeakMap}}}function qi(e){qt.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function Yi(e){qt.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Se,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}qi.prototype=Object.create(qt.prototype),qi.prototype.constructor=qi,qi.prototype.isMeshDepthMaterial=!0,qi.prototype.copy=function(e){return qt.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,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},Yi.prototype=Object.create(qt.prototype),Yi.prototype.constructor=Yi,Yi.prototype.isMeshDistanceMaterial=!0,Yi.prototype.copy=function(e){return qt.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};function Ki(e,t,n){var r=new Qn,i=new fe,o=new fe,a=new xe,s=[],l=[],c={},u={0:1,1:0,2:2},h=new Un({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new fe},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\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );
10\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 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, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=h.clone();d.defines.HORIZONAL_PASS=1;var f=new gn;f.setAttribute("position",new Jt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var m=new Nn(f,h),g=this;function y(n,r){var i=t.update(m);h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,h,m,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,d,m,null)}function x(e,t,n){var r=e<<0|t<<1|n<<2,i=s[r];return void 0===i&&(i=new qi({depthPacking:3201,morphTargets:e,skinning:t}),s[r]=i),i}function b(e,t,n){var r=e<<0|t<<1|n<<2,i=l[r];return void 0===i&&(i=new Yi({morphTargets:e,skinning:t}),l[r]=i),i}function _(t,n,r,i,o,a,s){var l=null,h=x,d=t.customDepthMaterial;if(!0===i.isPointLight&&(h=b,d=t.customDistanceMaterial),void 0===d){var p=!1;!0===r.morphTargets&&(p=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var f=!1;!0===t.isSkinnedMesh&&(!0===r.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),l=h(p,f,!0===t.isInstancedMesh)}else l=d;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var m=l.uuid,v=r.uuid,g=c[m];void 0===g&&(g={},c[m]=g);var y=g[v];void 0===y&&(y=l.clone(),g[v]=y),l=y}return l.visible=r.visible,l.wireframe=r.wireframe,l.side=3===s?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:u[r.side],l.clipShadows=r.clipShadows,l.clippingPlanes=r.clippingPlanes,l.clipIntersection=r.clipIntersection,l.wireframeLinewidth=r.wireframeLinewidth,l.linewidth=r.linewidth,!0===i.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(i.matrixWorld),l.nearDistance=o,l.farDistance=a),l}function w(n,i,o,a,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var l=t.update(n),c=n.material;if(Array.isArray(c))for(var u=l.groups,h=0,d=u.length;h<d;h++){var p=u[h],f=c[p.materialIndex];if(f&&f.visible){var m=_(n,l,f,a,o.near,o.far,s);e.renderBufferDirect(o,null,l,m,n,p)}}else if(c.visible){var v=_(n,l,c,a,o.near,o.far,s);e.renderBufferDirect(o,null,l,v,n,null)}}for(var g=n.children,y=0,x=g.length;y<x;y++)w(g[y],i,o,a,s)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,s,l){if(!1!==g.enabled&&(!1!==g.autoUpdate||!1!==g.needsUpdate)&&0!==t.length){var c=e.getRenderTarget(),u=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),d=e.state;d.setBlending(0),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(var f=0,m=t.length;f<m;f++){var x=t[f],b=x.shadow;if(void 0!==b){if(!1!==b.autoUpdate||!1!==b.needsUpdate){i.copy(b.mapSize);var _=b.getFrameExtents();if(i.multiply(_),o.copy(b.mapSize),(i.x>n||i.y>n)&&(i.x>n&&(o.x=Math.floor(n/_.x),i.x=o.x*_.x,b.mapSize.x=o.x),i.y>n&&(o.y=Math.floor(n/_.y),i.y=o.y*_.y,b.mapSize.y=o.y)),null===b.map&&!b.isPointLightShadow&&3===this.type){var S={minFilter:v,magFilter:v,format:E};b.map=new be(i.x,i.y,S),b.map.texture.name=x.name+".shadowMap",b.mapPass=new be(i.x,i.y,S),b.camera.updateProjectionMatrix()}if(null===b.map){var M={minFilter:p,magFilter:p,format:E};b.map=new be(i.x,i.y,M),b.map.texture.name=x.name+".shadowMap",b.camera.updateProjectionMatrix()}e.setRenderTarget(b.map),e.clear();
10for(var T=b.getViewportCount(),C=0;C<T;C++){var L=b.getViewport(C);a.set(o.x*L.x,o.y*L.y,o.x*L.z,o.y*L.w),d.viewport(a),b.updateMatrices(x,C),r=b.getFrustum(),w(s,l,b.camera,x,this.type)}b.isPointLightShadow||3!==this.type||y(b,l),b.needsUpdate=!1}}else console.warn("THREE.WebGLShadowMap:",x,"has no shadow.")}g.needsUpdate=!1,e.setRenderTarget(c,u,h)}}}function Zi(e,n,r){var i,o,a=r.isWebGL2;var s=new function(){var t=!1,n=new xe,r=null,i=new xe(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,o,a,s){!0===s&&(t*=a,r*=a,o*=a),n.set(t,r,o,a),!1===i.equals(n)&&(e.clearColor(t,r,o,a),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},l=new function(){var t=!1,n=null,r=null,i=null;return{setTest:function(e){e?k(2929):z(2929)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case 0:e.depthFunc(512);break;case 1:e.depthFunc(519);break;case 2:e.depthFunc(513);break;case 3:e.depthFunc(515);break;case 4:e.depthFunc(514);break;case 5:e.depthFunc(518);break;case 6:e.depthFunc(516);break;case 7:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},c=new function(){var t=!1,n=null,r=null,i=null,o=null,a=null,s=null,l=null,c=null;return{setTest:function(e){t||(e?k(2960):z(2960))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,a){r===t&&i===n&&o===a||(e.stencilFunc(t,n,a),r=t,i=n,o=a)},setOp:function(t,n,r){a===t&&s===n&&l===r||(e.stencilOp(t,n,r),a=t,s=n,l=r)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,r=null,i=null,o=null,a=null,s=null,l=null,c=null}}},u={},h=null,d=null,p=null,f=null,m=null,v=null,g=null,y=null,x=null,b=!1,_=null,w=null,S=null,M=null,T=null,E=e.getParameter(35661),C=!1,L=0,R=e.getParameter(7938);-1!==R.indexOf("WebGL")?(L=parseFloat(/^WebGL\ ([0-9])/.exec(R)[1]),C=L>=1):-1!==R.indexOf("OpenGL ES")&&(L=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(R)[1]),C=L>=2);var A=null,P={},I=new xe,O=new xe;function D(t,n,r){var i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var a=0;a<r;a++)e.texImage2D(n+a,0,6408,1,1,0,6408,5121,i);return o}var N={};function k(t){!0!==u[t]&&(e.enable(t),u[t]=!0)}function z(t){!1!==u[t]&&(e.disable(t),u[t]=!1)}N[3553]=D(3553,3553,1),N[34067]=D(34067,34069,6),s.setClear(0,0,0,1),l.setClear(1),c.setClear(0),k(2929),l.setFunc(3),U(!1),W(1),k(2884),H(0);var B=((i={})[100]=32774,i[101]=32778,i[102]=32779,i);if(a)B[103]=32775,B[104]=32776;else{var F=n.get("EXT_blend_minmax");null!==F&&(B[103]=F.MIN_EXT,B[104]=F.MAX_EXT)}var G=((o={})[200]=0,o[201]=1,o[202]=768,o[204]=770,o[210]=776,o[208]=774,o[206]=772,o[203]=769,o[205]=771,o[209]=775,o[207]=773,o);function H(n,r,i,o,a,s,l,c){if(0!==n){if(d||(k(3042),d=!0),5===n)a=a||r,s=s||i,l=l||o,r===f&&a===g||(e.blendEquationSeparate(B[r],B[a]),f=r,g=a),i===m&&o===v&&s===y&&l===x||(e.blendFuncSeparate(G[i],G[o],G[s],G[l]),m=i,v=o,y=s,x=l),p=n,b=null;else if(n!==p||c!==b){if(f===t&&g===t||(e.blendEquation(32774),f=t,g=t),c)switch(n){case 1:e.blendFuncSeparate(1,771,1,771);break;case 2:e.blendFunc(1,1);break;case 3:e.blendFuncSeparate(0,0,769,771);break;case 4:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",n)}else switch(n){case 1:e.blendFuncSeparate(770,771,1,771);break;case 2:e.blendFunc(770,1);break;case 3:e.blendFunc(0,769);break;case 4:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",n)}m=null,v=null,y=null,x=null,p=n,b=c}}else d&&(z(3042),d=!1)}function U(t){_!==t&&(t?e.frontFace(2304):e.frontFace(2305),_=t)}function W(t){0!==t?(k(2884),t!==w&&(1===t?e.cullFace(1029):2===t?e.cullFace(1028):e.cullFace(1032))):z(2884),w=t}function V(t,n,r){t?(k(32823),M===n&&T===r||(e.polygonOffset(n,r),M=n,T=r)):z(32823)}function j(t){void 0===t&&(t=33984+E-1),A!==t&&(e.activeTexture(t),A=t)}return{buffers:{color:s,depth:l,stencil:c},enable:k,disable:z,useProgram:function(t){return h!==t&&(e.useProgram(t),h=t,!0)},setBlending:H,setMaterial:function(e,t){2===e.side?z(2884):k(2884);var n=1===e.side;t&&(n=!n),U(n),1===e.blending&&!1===e.transparent?H(0):H(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),l.setFu
vendor: 2,119 bytes, line 10
10nc(e.depthFunc),l.setTest(e.depthTest),l.setMask(e.depthWrite),s.setMask(e.colorWrite);var r=e.stencilWrite;c.setTest(r),r&&(c.setMask(e.stencilWriteMask),c.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),c.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),V(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)},setFlipSided:U,setCullFace:W,setLineWidth:function(t){t!==S&&(C&&e.lineWidth(t),S=t)},setPolygonOffset:V,setScissorTest:function(e){e?k(3089):z(3089)},activeTexture:j,bindTexture:function(t,n){null===A&&j();var r=P[A];void 0===r&&(r={type:void 0,texture:void 0},P[A]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||N[t]),r.type=t,r.texture=n)},unbindTexture:function(){var t=P[A];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(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===I.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),I.copy(t))},viewport:function(t){!1===O.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),O.copy(t))},reset:function(){u={},A=null,P={},h=null,p=null,_=null,w=null,s.reset(),l.reset(),c.reset()}}}function Ji(e,t,n,r,i,o,a){var s,l,c,u=i.isWebGL2,d=i.maxTextures,g=i.maxCubemapSize,y=i.maxTextureSize,x=i.maxSamples,R=new WeakMap,A=!1;try{A="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function P(e,t){return A?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function I(e,t,n,r){var i=1;if((e.width>r||e.height>r)&&(i=r/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){var o=t?le.floorPowerOfTwo:Math.floor,a=o(i*e.width),s=o(i*e.height);
10void 0===c&&(c=P(a,s));var l=n?P(a,s):c;return l.width=a,l.height=s,l.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+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function O(e){return le.isPowerOfTwo(e.width)&&le.isPowerOfTwo(e.height)}function D(e,t){return e.generateMipmaps&&t&&e.minFilter!==p&&e.minFilter!==v}function N(t,n,i,o){e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function k(n,r,i){if(!1===u)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||t.get("EXT_color_buffer_float"),o}function z(e){return e===p||e===f||e===m?9728:9729}function B(t){var n=t.target;n.removeEventListener("dispose",B),function(t){var n=r.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),r.remove(t)}(n),n.isVideoTexture&&R.delete(n),a.memory.textures--}function F(t){var n=t.target;n.removeEventListener("dispose",F),function(t){var n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(var o=0;o<6;o++)e.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[o]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(t.texture),r.remove(t)}(n),a.memory.textures--}var G=0;function H(e,t){var i=r.get(e);if(e.isVideoTexture&&function(e){var t=a.render.frame;R.get(e)!==t&&(R.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){var o=e.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void q(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function U(t,i){var a=r.get(t);t.version>0&&a.__version!==t.version?function(t,r,i){if(6!==r.image.length)return;X(t,r),n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,r.flipY);for(var a=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),s=r.image[0]&&r.image[0].isDataTexture,l=[],c=0;c<6;c++)l[c]=a||s?s?r.image[c].image:r.image[c]:I(r.image[c],!1,!0,g);var h,d=l[0],p=O(d)||u,f=o.convert(r.format),m=o.convert(r.type),v=k(r.internalFormat,f,m);if(j(34067,r,p),a){for(var y=0;y<6;y++){h=l[y].mipmaps;for(var x=0;x<h.length;x++){var b=h[x];r.format!==E&&r.format!==T?null!==f?n.compressedTexImage2D(34069+y,x,v,b.width,b.height,0,b.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+y,x,v,b.width,b.height,0,f,m,b.data)}}t.__maxMipLevel=h.length-1}else{h=r.mipmaps;for(var _=0;_<6;_++)if(s){n.texImage2D(34069+_,0,v,l[_].width,l[_].height,0,f,m,l[_].data);for(var w=0;w<h.length;w++){var S=h[w].image[_].image;n.texImage2D(34069+_,w+1,v,S.width,S.height,0,f,m,S.data)}}else{n.texImage2D(34069+_,0,v,f,m,l[_]);for(var M=0;M<h.length;M++){var C=h[M];n.texImage2D(34069+_,M+1,v,f,m,C.image[_])}}t.__maxMipLevel=h.length}D(r,p)&&N(34067,r,d.width,d.height);t.__version=r.version,r.onUpdate&&r.onUpdate(r)}(a,t,i):(n.activeTexture(33984+i),n.bindTexture(34067,a.__webglTexture))}var W=((s={})[1e3]=10497,s[1001]=33071,s[1002]=33648,s),V=((l={})[1003]=9728,l[1004]=9984,l[1005]=9986,l[1006]=9729,l[1007]=9985,l[1008]=9987,l);function j(n,o,a){a?(e.texParameteri(n,10242,W[o.wrapS]),e.texParameteri(n,10243,W[o.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,W[o.wrapR]),e.texParameteri(n,10240,V[o.magFilter]),e.texParameteri(n,10241,V[o.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),o.wrapS===
10h&&o.wrapT===h||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,z(o.magFilter)),e.texParameteri(n,10241,z(o.minFilter)),o.minFilter!==p&&o.minFilter!==v&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=t.get("EXT_texture_filter_anisotropic");if(s){if(o.type===w&&null===t.get("OES_texture_float_linear"))return;if(o.type===S&&null===(u||t.get("OES_texture_half_float_linear")))return;(o.anisotropy>1||r.get(o).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function X(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",B),t.__webglTexture=e.createTexture(),a.memory.textures++)}function q(t,r,i){var a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),X(t,r),n.activeTexture(33984+i),n.bindTexture(a,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);var s,l=function(e){return!u&&(e.wrapS!==h||e.wrapT!==h||e.minFilter!==p&&e.minFilter!==v)}(r)&&!1===O(r.image),c=I(r.image,l,!1,y),d=O(c)||u,f=o.convert(r.format),m=o.convert(r.type),g=k(r.internalFormat,f,m);j(a,r,d);var x=r.mipmaps;if(r.isDepthTexture)g=6402,u?g=r.type===w?36012:r.type===_?33190:r.type===M?35056:33189:r.type===w&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===C&&6402===g&&r.type!==b&&r.type!==_&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=b,m=o.convert(r.type)),r.format===L&&6402===g&&(g=34041,r.type!==M&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=M,m=o.convert(r.type))),n.texImage2D(3553,0,g,c.width,c.height,0,f,m,null);else if(r.isDataTexture)if(x.length>0&&d){for(var S=0,R=x.length;S<R;S++)s=x[S],n.texImage2D(3553,S,g,s.width,s.height,0,f,m,s.data);r.generateMipmaps=!1,t.__maxMipLevel=x.length-1}else n.texImage2D(3553,0,g,c.width,c.height,0,f,m,c.data),t.__maxMipLevel=0;else if(r.isCompressedTexture){for(var A=0,P=x.length;A<P;A++)s=x[A],r.format!==E&&r.format!==T?null!==f?n.compressedTexImage2D(3553,A,g,s.width,s.height,0,s.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,A,g,s.width,s.height,0,f,m,s.data);t.__maxMipLevel=x.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,g,c.width,c.height,c.depth,0,f,m,c.data),t.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,g,c.width,c.height,c.depth,0,f,m,c.data),t.__maxMipLevel=0;else if(x.length>0&&d){for(var z=0,B=x.length;z<B;z++)s=x[z],n.texImage2D(3553,z,g,f,m,s);r.generateMipmaps=!1,t.__maxMipLevel=x.length-1}else n.texImage2D(3553,0,g,f,m,c),t.__maxMipLevel=0;D(r,d)&&N(a,r,c.width,c.height),t.__version=r.version,r.onUpdate&&r.onUpdate(r)}function Y(t,i,a,s){var l=o.convert(i.texture.format),c=o.convert(i.texture.type),u=k(i.texture.internalFormat,l,c);n.texImage2D(s,0,u,i.width,i.height,0,l,c,null),e.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,a,s,r.get(i.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function K(t,n,r){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){var i=33189;if(r){var a=n.depthTexture;a&&a.isDepthTexture&&(a.type===w?i=36012:a.type===_&&(i=33190));var s=J(n);e.renderbufferStorageMultisample(36161,s,i,n.width,n.height)}else e.renderbufferStorage(36161,i,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){if(r){var l=J(n);e.renderbufferStorageMultisample(36161,l,35056,n.width,n.height)}else e.renderbufferStorage(36161,34041,n.width,n.height);e.framebufferRenderbuffer(36160,33306,36161,t)}else{var c=o.convert(n.texture.format),u=o.convert(n.texture.type),h=k(n.texture.internalFormat,c,u);if(r){var d=J(n);e.renderbufferStorageMultisample(36161,d,h,n.width,n.height)}else e.renderbufferStorage(36161,h,n.width,n.height)}e.bindRenderbuffer(36161,null)}
10function Z(t){var n=r.get(t),i=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),H(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===C)e.framebufferTexture2D(36160,36096,3553,i,0);else{if(n.depthTexture.format!==L)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,i,0)}}(n.__webglFramebuffer,t)}else if(i){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)e.bindFramebuffer(36160,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=e.createRenderbuffer(),K(n.__webglDepthbuffer[o],t,!1)}else e.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),K(n.__webglDepthbuffer,t,!1);e.bindFramebuffer(36160,null)}function J(e){return u&&e.isWebGLMultisampleRenderTarget?Math.min(x,e.samples):0}var Q=!1,$=!1;this.allocateTextureUnit=function(){var e=G;return e>=d&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+d),G+=1,e},this.resetTextureUnits=function(){G=0},this.setTexture2D=H,this.setTexture2DArray=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?q(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?q(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=U,this.setupRenderTarget=function(t){var i=r.get(t),s=r.get(t.texture);t.addEventListener("dispose",F),s.__webglTexture=e.createTexture(),a.memory.textures++;var l=!0===t.isWebGLCubeRenderTarget,c=!0===t.isWebGLMultisampleRenderTarget,h=O(t)||u;if(!u||t.texture.format!==T||t.texture.type!==w&&t.texture.type!==S||(t.texture.format=E,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),l){i.__webglFramebuffer=[];for(var d=0;d<6;d++)i.__webglFramebuffer[d]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),c)if(u){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var p=o.convert(t.texture.format),f=o.convert(t.texture.type),m=k(t.texture.internalFormat,p,f),v=J(t);e.renderbufferStorageMultisample(36161,v,m,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),K(i.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){n.bindTexture(34067,s.__webglTexture),j(34067,t.texture,h);for(var g=0;g<6;g++)Y(i.__webglFramebuffer[g],t,36064,34069+g);D(t.texture,h)&&N(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,s.__webglTexture),j(3553,t.texture,h),Y(i.__webglFramebuffer,t,36064,3553),D(t.texture,h)&&N(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&Z(t)},this.updateRenderTargetMipmap=function(e){var t=e.texture;if(D(t,O(e)||u)){var i=e.isWebGLCubeRenderTarget?34067:3553,o=r.get(t).__webglTexture;n.bindTexture(i,o),N(i,t,e.width,e.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(u){var n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var i=t.width,o=t.height,a=16384;t.depthBuffer&&(a|=256),t.stencilBuffer&&(a|=1024),e.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===Q&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),Q=!0),e=e.texture),H(e,t)}
10,this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===$&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),$=!0),e=e.texture),U(e,t)}}function Qi(e,t,n){var r=n.isWebGL2;return{convert:function(e){var n;if(e===x)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1019===e)return 33635;if(1010===e)return 5120;if(1011===e)return 5122;if(e===b)return 5123;if(1013===e)return 5124;if(e===_)return 5125;if(e===w)return 5126;if(e===S)return r?5131:null!==(n=t.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(1021===e)return 6406;if(e===T)return 6407;if(e===E)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(e===C)return 6402;if(e===L)return 34041;if(1028===e)return 6403;if(1029===e)return 36244;if(1030===e)return 33319;if(1031===e)return 33320;if(1032===e)return 36248;if(1033===e)return 36249;if(e===R||e===A||e===P||e===I){if(null===(n=t.get("WEBGL_compressed_texture_s3tc")))return null;if(e===R)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===A)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===P)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===I)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===O||e===D||e===N||e===k){if(null===(n=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(e===O)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===D)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===N)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===k)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===e)return null!==(n=t.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===z||e===B)&&null!==(n=t.get("WEBGL_compressed_texture_etc"))){if(e===z)return n.COMPRESSED_RGB8_ETC2;if(e===B)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e||37840===e||37841===e||37842===e||37843===e||37844===e||37845===e||37846===e||37847===e||37848===e||37849===e||37850===e||37851===e||37852===e||37853===e?null!==(n=t.get("WEBGL_compressed_texture_astc"))?e:null:36492===e?null!==(n=t.get("EXT_texture_compression_bptc"))?e:null:e===M?r?34042:null!==(n=t.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function $i(e){Vn.call(this),this.cameras=e||[]}function eo(){wt.call(this),this.type="Group"}function to(){this._targetRay=null,this._grip=null,this._hand=null}function no(e,t){var n=this,r=null,i=1,o=null,a="local-floor",s=null,l=[],c=new Map,u=new Vn;u.layers.enable(1),u.viewport=new xe;var h=new Vn;h.layers.enable(2),h.viewport=new xe;var d=[u,h],p=new $i;p.layers.enable(1),p.layers.enable(2);var f=null,m=null;function v(e){var t=c.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function g(){c.forEach((function(e,t){e.disconnect(t)})),c.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),M.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function y(e){o=e,M.setContext(r),M.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function x(e){for(var t=r.inputSources,n=0;n<l.length;n++)c.set(t[n],l[n]);for(var i=0;i<e.removed.length;i++){var o=e.removed[i],a=c.get(o);a&&(a.dispatchEvent({type:"disconnected",data:o}),c.delete(o))}for(var s=0;s<e.added.length;s++){var u=e.added[s],h=c.get(u);h&&h.dispatchEvent({type:"connected",data:u})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(e){var t=l[e];return void 0===t&&(t=new to,l[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){var t=l[e];return void 0===t&&(t=new to,l[e]=t),t.getGripSpace()},this.getHand=function(e){var t=l[e];return void 0===t&&(t=new to,l[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){a=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o}
10,this.getSession=function(){return r},this.setSession=function(e){if(null!==(r=e)){r.addEventListener("select",v),r.addEventListener("selectstart",v),r.addEventListener("selectend",v),r.addEventListener("squeeze",v),r.addEventListener("squeezestart",v),r.addEventListener("squeezeend",v),r.addEventListener("end",g);var n=t.getContextAttributes();!0!==n.xrCompatible&&t.makeXRCompatible();var o={antialias:n.antialias,alpha:n.alpha,depth:n.depth,stencil:n.stencil,framebufferScaleFactor:i},s=new XRWebGLLayer(r,t,o);r.updateRenderState({baseLayer:s}),r.requestReferenceSpace(a).then(y),r.addEventListener("inputsourceschange",x)}};var b=new Se,_=new Se;function w(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}this.getCamera=function(e){p.near=h.near=u.near=e.near,p.far=h.far=u.far=e.far,f===p.near&&m===p.far||(r.updateRenderState({depthNear:p.near,depthFar:p.far}),f=p.near,m=p.far);var t=e.parent,n=p.cameras;w(p,t);for(var i=0;i<n.length;i++)w(n[i],t);e.matrixWorld.copy(p.matrixWorld);for(var o=e.children,a=0,s=o.length;a<s;a++)o[a].updateMatrixWorld(!0);return 2===n.length?function(e,t,n){b.setFromMatrixPosition(t.matrixWorld),_.setFromMatrixPosition(n.matrixWorld);var r=b.distanceTo(_),i=t.projectionMatrix.elements,o=n.projectionMatrix.elements,a=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],c=(i[9]-1)/i[5],u=(i[8]-1)/i[0],h=(o[8]+1)/o[0],d=a*u,p=a*h,f=r/(-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.getInverse(e.matrixWorld);var v=a+f,g=s+f,y=d-m,x=p+(r-m),w=l*s/g*v,S=c*s/g*v;e.projectionMatrix.makePerspective(y,x,w,S,v,g)}(p,u,h):p.projectionMatrix.copy(u.projectionMatrix),p};var S=null;var M=new $n;M.setAnimationLoop((function(t,n){if(null!==(s=n.getViewerPose(o))){var i=s.views,a=r.renderState.baseLayer;e.setFramebuffer(a.framebuffer);var c=!1;i.length!==p.cameras.length&&(p.cameras.length=0,c=!0);for(var u=0;u<i.length;u++){var h=i[u],f=a.getViewport(h),m=d[u];m.matrix.fromArray(h.transform.matrix),m.projectionMatrix.fromArray(h.projectionMatrix),m.viewport.set(f.x,f.y,f.width,f.height),0===u&&p.matrix.copy(m.matrix),!0===c&&p.cameras.push(m)}}for(var v=r.inputSources,g=0;g<l.length;g++){var y=l[g],x=v[g];y.update(x,n,o)}S&&S(t,n)})),this.setAnimationLoop=function(e){S=e},this.dispose=function(){}}function ro(e){function t(t,n){t.opacity.value=n.opacity,n.color&&t.diffuse.value.copy(n.color),n.emissive&&t.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(t.map.value=n.map),n.alphaMap&&(t.alphaMap.value=n.alphaMap),n.specularMap&&(t.specularMap.value=n.specularMap);var r,i,o=e.get(n).envMap;if(o){t.envMap.value=o,t.flipEnvMap.value=o.isCubeTexture&&o._needsFlipEnvMap?-1:1,t.reflectivity.value=n.reflectivity,t.refractionRatio.value=n.refractionRatio;var a=e.get(o).__maxMipLevel;void 0!==a&&(t.maxMipLevel.value=a)}n.lightMap&&(t.lightMap.value=n.lightMap,t.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(t.aoMap.value=n.aoMap,t.aoMapIntensity.value=n.aoMapIntensity),n.map?r=n.map:n.specularMap?r=n.specularMap:n.displacementMap?r=n.displacementMap:n.normalMap?r=n.normalMap:n.bumpMap?r=n.bumpMap:n.roughnessMap?r=n.roughnessMap:n.metalnessMap?r=n.metalnessMap:n.alphaMap?r=n.alphaMap:n.emissiveMap?r=n.emissiveMap:n.clearcoatMap?r=n.clearcoatMap:n.clearcoatNormalMap?r=n.clearcoatNormalMap:n.clearcoatRoughnessMap&&(r=n.clearcoatRoughnessMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix)),n.aoMap?i=n.aoMap:n.lightMap&&(i=n.lightMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uv2Transform.value.copy(i.matrix))}function n(t,n){t.roughness.value=n.roughness,t.metalness.value=n.metalness,n.roughnessMap&&(t.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(t.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap),n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,1===n.side&&(t.bumpScale.value*=-1)),n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),1===n.side&&t.normalScale.value.negate()),n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias),e.get(n).envMap&&(t.envMapIntensity.value=n.envMapIntensity)}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,r,i,o){r.isMeshBasicMaterial?t(e,r):r.isMeshLambertMaterial?(t(e,r),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(e,r)):r.isMeshToonMaterial?(t(e,r),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap);t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshPhongMaterial?(t(e,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshStandardMaterial?(t(e,r),r.isMeshPhysicalMaterial?function(e,t){n(e,t),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen);t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap);t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap);t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,1===t.side&&e.clearcoatNormalScale.value.negate());e.transmission.value=t.transmission,t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap)}
10(e,r):n(e,r)):r.isMeshMatcapMaterial?(t(e,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDepthMaterial?(t(e,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDistanceMaterial?(t(e,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,r)):r.isMeshNormalMaterial?(t(e,r),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,r)):r.isPointsMaterial?function(e,t,n,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*r,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var i;t.map?i=t.map:t.alphaMap&&(i=t.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,r,i,o):r.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);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(e,r):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function io(e){var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,o=void 0===e.stencil||e.stencil,a=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,l=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,c=void 0!==e.powerPreference?e.powerPreference:"default",u=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,h=null,d=null;this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=q,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var p=this,f=!1,m=null,v=0,g=0,y=null,b=null,_=-1,M=null,T=null,C=new xe,L=new xe,R=null,A=t.width,P=t.height,I=1,O=null,D=null,N=new xe(0,0,A,P),k=new xe(0,0,A,P),z=!1,B=new Qn,F=!1,G=!1,H=new Je,U=new Se,W={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function V(){return null===y?I:1}var j,X,Y,K,Z,J,Q,$,ee,te,ne,re,ie,oe,ae,se,ce,ue,he,de,pe,me=n;function ve(e,n){for(var r=0;r<e.length;r++){var i=e[r],o=t.getContext(i,n);if(null!==o)return o}return null}try{var ge={alpha:r,depth:i,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if(t.addEventListener("webglcontextlost",Me,!1),t.addEventListener("webglcontextrestored",Te,!1),null===me){var ye=["webgl2","webgl","experimental-webgl"];if(!0===p.isWebGL1Renderer&&ye.shift(),null===(me=ve(ye,ge)))throw ve(ye)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===me.getShaderPrecisionFormat&&(me.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function be(){j=new hr(me),!1===(X=new lr(me,j,e)).isWebGL2&&(j.get("WEBGL_depth_texture"),j.get("OES_texture_float"),j.get("OES_texture_half_float"),j.get("OES_texture_half_float_linear"),j.get("OES_standard_derivatives"),j.get("OES_element_index_uint"),j.get("OES_vertex_array_object"),j.get("ANGLE_instanced_arrays")),j.get("OES_texture_float_linear"),de=new Qi(me,j,X),(Y=new Zi(me,j,X)).scissor(L.copy(k).multiplyScalar(I).floor()),Y.viewport(C.copy(N).multiplyScalar(I).floor()),K=new fr(me),Z=new ki,J=new Ji(me,j,Y,Z,X,de,K),Q=new ur(p),$=new er(me,X),pe=new ar(me,j,$,X),ee=new dr(me,$,K,pe),te=new yr(me,ee,$,K),ce=new gr(me),ae=new cr(Z),ne=new Ni(p,Q,j,X,pe,ae),re=ne
vendor: 3,706 bytes, line 10
10w ro(Z),ie=new Gi(Z),oe=new Xi,se=new or(p,Q,Y,te,s),ue=new sr(me,j,K,X),he=new pr(me,j,K,X),K.programs=ne.programs,p.capabilities=X,p.extensions=j,p.properties=Z,p.renderLists=ie,p.state=Y,p.info=K}be();var _e=new no(p,me);this.xr=_e;var we=new Ki(p,te,X.maxTextureSize);function Me(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),f=!0}function Te(){console.log("THREE.WebGLRenderer: Context Restored."),f=!1,be()}function Ee(e){var t=e.target;t.removeEventListener("dispose",Ee),function(e){Ce(e),Z.remove(e)}(t)}function Ce(e){var t=Z.get(e).program;void 0!==t&&ne.releaseProgram(t)}this.shadowMap=we,this.getContext=function(){return me},this.getContextAttributes=function(){return me.getContextAttributes()},this.forceContextLoss=function(){var e=j.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=j.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(e){void 0!==e&&(I=e,this.setSize(A,P,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new fe),e.set(A,P)},this.setSize=function(e,n,r){_e.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(A=e,P=n,t.width=Math.floor(e*I),t.height=Math.floor(n*I),!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new fe),e.set(A*I,P*I).floor()},this.setDrawingBufferSize=function(e,n,r){A=e,P=n,I=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new xe),e.copy(C)},this.getViewport=function(e){return e.copy(N)},this.setViewport=function(e,t,n,r){e.isVector4?N.set(e.x,e.y,e.z,e.w):N.set(e,t,n,r),Y.viewport(C.copy(N).multiplyScalar(I).floor())},this.getScissor=function(e){return e.copy(k)},this.setScissor=function(e,t,n,r){e.isVector4?k.set(e.x,e.y,e.z,e.w):k.set(e,t,n,r),Y.scissor(L.copy(k).multiplyScalar(I).floor())},this.getScissorTest=function(){return z},this.setScissorTest=function(e){Y.setScissorTest(z=e)},this.setOpaqueSort=function(e){O=e},this.setTransparentSort=function(e){D=e},this.getClearColor=function(){return se.getClearColor()},this.setClearColor=function(){se.setClearColor.apply(se,arguments)},this.getClearAlpha=function(){return se.getClearAlpha()},this.setClearAlpha=function(){se.setClearAlpha.apply(se,arguments)},this.clear=function(e,t,n){var r=0;(void 0===e||e)&&(r|=16384),(void 0===t||t)&&(r|=256),(void 0===n||n)&&(r|=1024),me.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Me,!1),t.removeEventListener("webglcontextrestored",Te,!1),ie.dispose(),oe.dispose(),Z.dispose(),Q.dispose(),te.dispose(),pe.dispose(),_e.dispose(),Re.stop()},this.renderBufferImmediate=function(e,t){pe.initAttributes();var n=Z.get(e);e.hasPositions&&!n.position&&(n.position=me.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=me.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=me.createBuffer()),e.hasColors&&!n.color&&(n.color=me.createBuffer());var r=t.getAttributes();e.hasPositions&&(me.bindBuffer(34962,n.position),me.bufferData(34962,e.positionArray,35048),pe.enableAttribute(r.position),me.vertexAttribPointer(r.position,3,5126,!1,0,0)),e.hasNormals&&
10(me.bindBuffer(34962,n.normal),me.bufferData(34962,e.normalArray,35048),pe.enableAttribute(r.normal),me.vertexAttribPointer(r.normal,3,5126,!1,0,0)),e.hasUvs&&(me.bindBuffer(34962,n.uv),me.bufferData(34962,e.uvArray,35048),pe.enableAttribute(r.uv),me.vertexAttribPointer(r.uv,2,5126,!1,0,0)),e.hasColors&&(me.bindBuffer(34962,n.color),me.bufferData(34962,e.colorArray,35048),pe.enableAttribute(r.color),me.vertexAttribPointer(r.color,3,5126,!1,0,0)),pe.disableUnusedAttributes(),me.drawArrays(4,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,r,i,o){null===t&&(t=W);var a=i.isMesh&&i.matrixWorld.determinant()<0,s=De(e,t,r,i);Y.setMaterial(r,a);var l=n.index,c=n.attributes.position;if(null===l){if(void 0===c||0===c.count)return}else if(0===l.count)return;var u,h=1;!0===r.wireframe&&(l=ee.getWireframeAttribute(n),h=2),(r.morphTargets||r.morphNormals)&&ce.update(i,n,r,s),pe.setup(i,r,s,n,l);var d=ue;null!==l&&(u=$.get(l),(d=he).setIndex(u));var p=null!==l?l.count:c.count,f=n.drawRange.start*h,m=n.drawRange.count*h,v=null!==o?o.start*h:0,g=null!==o?o.count*h:1/0,y=Math.max(f,v),x=Math.min(p,f+m,v+g)-1,b=Math.max(0,x-y+1);if(0!==b){if(i.isMesh)!0===r.wireframe?(Y.setLineWidth(r.wireframeLinewidth*V()),d.setMode(1)):d.setMode(4);else if(i.isLine){var _=r.linewidth;void 0===_&&(_=1),Y.setLineWidth(_*V()),i.isLineSegments?d.setMode(1):i.isLineLoop?d.setMode(2):d.setMode(3)}else i.isPoints?d.setMode(0):i.isSprite&&d.setMode(4);if(i.isInstancedMesh)d.renderInstances(y,b,i.count);else if(n.isInstancedBufferGeometry){var w=Math.min(n.instanceCount,n._maxInstanceCount);d.renderInstances(y,b,w)}else d.render(y,b)}},this.compile=function(e,t){(d=oe.get(e,t)).init(),e.traverse((function(e){e.isLight&&(d.pushLight(e),e.castShadow&&d.pushShadow(e))})),d.setupLights(t);var n=new WeakMap;e.traverse((function(t){var r=t.material;if(r)if(Array.isArray(r))for(var i=0;i<r.length;i++){var o=r[i];!1===n.has(o)&&(Oe(o,e,t),n.set(o))}else!1===n.has(r)&&(Oe(r,e,t),n.set(r))}))};var Le=null;var Re=new $n;function Ae(e,t,n,r){if(!1!==e.visible){if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)d.pushLight(e),e.castShadow&&d.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||B.intersectsSprite(e)){r&&U.setFromMatrixPosition(e.matrixWorld).applyMatrix4(H);var i=te.update(e),o=e.material;o.visible&&h.push(e,i,o,n,U.z,null)}}else if(e.isImmediateRenderObject)r&&U.setFromMatrixPosition(e.matrixWorld).applyMatrix4(H),h.push(e,null,e.material,n,U.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==K.render.frame&&(e.skeleton.update(),e.skeleton.frame=K.render.frame),!e.frustumCulled||B.intersectsObject(e))){r&&U.setFromMatrixPosition(e.matrixWorld).applyMatrix4(H);var a=te.update(e),s=e.material;if(Array.isArray(s))for(var l=a.groups,c=0,u=l.length;c<u;c++){var p=l[c],f=s[p.materialIndex];f&&f.visible&&h.push(e,a,f,n,U.z,p)}else s.visible&&h.push(e,a,s,n,U.z,null)}for(var m=e.children,v=0,g=m.length;v<g;v++)Ae(m[v],t,n,r)}}function Pe(e,t,n){for(var r=!0===t.isScene?t.overrideMaterial:null,i=0,o=e.length;i<o;i++){var a=e[i],s=a.object,l=a.geometry,c=null===r?a.material:r,u=a.group;if(n.isArrayCamera){T=n;for(var h=n.cameras,p=0,f=h.length;p<f;p++){var m=h[p];
10s.layers.test(m.layers)&&(Y.viewport(C.copy(m.viewport)),d.setupLights(m),Ie(s,t,m,l,c,u))}}else T=null,Ie(s,t,n,l,c,u)}}function Ie(e,t,n,r,i,o){if(e.onBeforeRender(p,t,n,r,i,o),d=oe.get(t,T||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var a=De(n,t,i,e);Y.setMaterial(i),pe.reset(),function(e,t){e.render((function(e){p.renderBufferImmediate(e,t)}))}(e,a)}else p.renderBufferDirect(n,t,r,i,e,o);e.onAfterRender(p,t,n,r,i,o),d=oe.get(t,T||n)}function Oe(e,t,n){!0!==t.isScene&&(t=W);var r=Z.get(e),i=d.state.lights,o=d.state.shadowsArray,a=i.state.version,s=ne.getParameters(e,i.state,o,t,n),l=ne.getProgramCacheKey(s),c=r.program,u=!0;if(void 0===c)e.addEventListener("dispose",Ee);else if(c.cacheKey!==l)Ce(e);else if(r.lightsStateVersion!==a)u=!1;else{if(void 0!==s.shaderID){var h=e.isMeshStandardMaterial?t.environment:null;return void(r.envMap=Q.get(e.envMap||h))}u=!1}u&&(s.uniforms=ne.getUniforms(e),e.onBeforeCompile(s,p),c=ne.acquireProgram(s,l),r.program=c,r.uniforms=s.uniforms,r.outputEncoding=s.outputEncoding);var f=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(r.numClippingPlanes=ae.numPlanes,r.numIntersection=ae.numIntersection,f.clippingPlanes=ae.uniform),r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=Q.get(e.envMap||r.environment),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=a,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.ltc_1.value=i.state.rectAreaLTC1,f.ltc_2.value=i.state.rectAreaLTC2,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var m=r.program.getUniforms(),v=mi.seqWithValue(m.seq,f);r.uniformsList=v}function De(e,t,n,r){!0!==t.isScene&&(t=W),J.resetTextureUnits();var i=t.fog,o=n.isMeshStandardMaterial?t.environment:null,a=null===y?p.outputEncoding:y.texture.encoding,s=Q.get(n.envMap||o),l=Z.get(n),c=d.state.lights;if(!0===F&&(!0===G||e!==M)){var u=e===M&&n.id===_;ae.setState(n,e,u)}n.version===l.__version?n.fog&&l.fog!==i||l.environment!==o||l.needsLights&&l.lightsStateVersion!==c.state.version?Oe(n,t,r):void 0===l.numClippingPlanes||l.numClippingPlanes===ae.numPlanes&&l.numIntersection===ae.numIntersection?(l.outputEncoding!==a||l.envMap!==s)&&Oe(n,t,r):Oe(n,t,r):(Oe(n,t,r),l.__version=n.version);var h,f,m=!1,v=!1,g=!1,x=l.program,b=x.getUniforms(),S=l.uniforms;if(Y.useProgram(x.program)&&(m=!0,v=!0,g=!0),n.id!==_&&(_=n.id,v=!0),m||M!==e){if(b.setValue(me,"projectionMatrix",e.projectionMatrix),X.logarithmicDepthBuffer&&b.setValue(me,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),M!==e&&(M=e,v=!0,g=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var T=b.map.cameraPosition;void 0!==T&&T.setValue(me,U.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&b.setValue(me,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||n.skinning)&&b.setValue(me,"viewMatrix",e.matrixWorldInverse)}if(n.skinning){b.setOptional(me,r,"bindMatrix"),b.setOptional(me,r,"bindMatrixInverse");var C=r.skeleton;if(C){var L=C.bones;if(X.floatVertexTextures){if(void 0===C.boneTexture){var R=Math.sqrt(4*L.length);R=le.ceilPowerOfTwo(R),R=Math.max(R,4);var A=new Float32Array(R*R*4);A.set(C.boneMatrices);var O=new Kn(A,R,R,E,w);C.boneMatrices=A,C.boneTexture=O,C.boneTextureSize=R}b.setValue(me,"boneTexture",C.boneTexture,J),b.setValue(me,"boneTextureSize",C.boneTextureSize)}else b.setOptional(me,C,"boneMatrices")}}return(v||l.receiveShadow!==r.receiveShadow)&&(l.receiveShadow=r.receiveShadow,b.setValue(me,"re
10ceiveShadow",r.receiveShadow)),v&&(b.setValue(me,"toneMappingExposure",p.toneMappingExposure),l.needsLights&&(f=g,(h=S).ambientLightColor.needsUpdate=f,h.lightProbe.needsUpdate=f,h.directionalLights.needsUpdate=f,h.directionalLightShadows.needsUpdate=f,h.pointLights.needsUpdate=f,h.pointLightShadows.needsUpdate=f,h.spotLights.needsUpdate=f,h.spotLightShadows.needsUpdate=f,h.rectAreaLights.needsUpdate=f,h.hemisphereLights.needsUpdate=f),i&&n.fog&&re.refreshFogUniforms(S,i),re.refreshMaterialUniforms(S,n,I,P),mi.upload(me,l.uniformsList,S,J)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(mi.upload(me,l.uniformsList,S,J),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&b.setValue(me,"center",r.center),b.setValue(me,"modelViewMatrix",r.modelViewMatrix),b.setValue(me,"normalMatrix",r.normalMatrix),b.setValue(me,"modelMatrix",r.matrixWorld),x}Re.setAnimationLoop((function(e){_e.isPresenting||Le&&Le(e)})),"undefined"!=typeof window&&Re.setContext(window),this.setAnimationLoop=function(e){Le=e,_e.setAnimationLoop(e),null===e?Re.stop():Re.start()},this.render=function(e,t){var n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),void 0===t||!0===t.isCamera){if(!0!==f){pe.resetDefaultState(),_=-1,M=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),!0===_e.enabled&&!0===_e.isPresenting&&(t=_e.getCamera(t)),!0===e.isScene&&e.onBeforeRender(p,e,t,n||y),(d=oe.get(e,t)).init(),H.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),B.setFromProjectionMatrix(H),G=this.localClippingEnabled,F=ae.init(this.clippingPlanes,G,t),(h=ie.get(e,t)).init(),Ae(e,t,0,p.sortObjects),h.finish(),!0===p.sortObjects&&h.sort(O,D),!0===F&&ae.beginShadows();var i=d.state.shadowsArray;we.render(i,e,t),d.setupLights(t),!0===F&&ae.endShadows(),!0===this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),se.render(h,e,t,r);var o=h.opaque,a=h.transparent;o.length>0&&Pe(o,e,t),a.length>0&&Pe(a,e,t),!0===e.isScene&&e.onAfterRender(p,e,t),null!==y&&(J.updateRenderTargetMipmap(y),J.updateMultisampleRenderTarget(y)),Y.buffers.depth.setTest(!0),Y.buffers.depth.setMask(!0),Y.buffers.color.setMask(!0),Y.setPolygonOffset(!1),h=null,d=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){m!==e&&null===y&&me.bindFramebuffer(36160,e),m=e},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return g},this.getRenderList=function(){return h},this.setRenderList=function(e){h=e},this.getRenderState=function(){return d},this.setRenderState=function(e){d=e},this.getRenderTarget=function(){return y},this.setRenderTarget=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=0),y=e,v=t,g=n,e&&void 0===Z.get(e).__webglFramebuffer&&J.setupRenderTarget(e);var r=m,i=!1;if(e){var o=Z.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=o[t],i=!0):r=e.isWebGLMultisampleRenderTarget?Z.get(e).__webglMultisampledFramebuffer:o,C.copy(e.viewport),L.copy(e.scissor),R=e.scissorTest}else C.copy(N).multiplyScalar(I).floor(),L.copy(k).multiplyScalar(I).floor(),R=z;if(b!==r&&(me.bindFramebuffer(36160,r),b=r),Y.viewport(C),Y.scissor(L),Y.setScissorTest(R),i){var a=Z.get(e.texture);me.framebufferTexture2D(36160,36064,34069+t,a.__webglTexture,n)}},this.readRenderTargetPixels=function(e,t,n,r,i,o,a){if(e&&e.isWebGLRenderTarget){var s=Z.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){var l=!1;s!==b&&(me.bindFramebuffer(36160,s),l=!0);try{var c=e.texture,u=c.format,h=c.type;if(u!==E&&de.convert(u)!==me.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===x||de.convert(h)===me.getParameter(35738)||h===w&&(X.isWebGL2||j.get("OES_texture_float")||j.get("WEBGL_color_buffer_float"))||h===S&&(X.isWebG
10L2?j.get("EXT_color_buffer_float"):j.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===me.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&me.readPixels(t,n,r,i,de.convert(u),de.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&me.bindFramebuffer(36160,b)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(t.image.width*r),o=Math.floor(t.image.height*r),a=de.convert(t.format);J.setTexture2D(t,0),me.copyTexImage2D(3553,n,a,e.x,e.y,i,o,0),Y.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r){void 0===r&&(r=0);var i=t.image.width,o=t.image.height,a=de.convert(n.format),s=de.convert(n.type);J.setTexture2D(n,0),me.pixelStorei(37440,n.flipY),me.pixelStorei(37441,n.premultiplyAlpha),me.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?me.texSubImage2D(3553,r,e.x,e.y,i,o,a,s,t.image.data):t.isCompressedTexture?me.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):me.texSubImage2D(3553,r,e.x,e.y,a,s,t.image),0===r&&n.generateMipmaps&&me.generateMipmap(3553),Y.unbindTexture()},this.initTexture=function(e){J.setTexture2D(e,0),Y.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function oo(e){io.call(this,e)}$i.prototype=Object.assign(Object.create(Vn.prototype),{constructor:$i,isArrayCamera:!0}),eo.prototype=Object.assign(Object.create(wt.prototype),{constructor:eo,isGroup:!0}),Object.assign(to.prototype,{constructor:to,getHandSpace:function(){if(null===this._hand&&(this._hand=new eo,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints=[],this._hand.inputState={pinching:!1},window.XRHand))for(var e=0;e<=window.XRHand.LITTLE_PHALANX_TIP;e++){var t=new eo;t.matrixAutoUpdate=!1,t.visible=!1,this._hand.joints.push(t),this._hand.add(t)}return this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new eo,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new eo,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},disconnect:function(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:function(e,t,n){var r=null,i=null,o=null,a=this._targetRay,s=this._grip,l=this._hand;if(e)if(l&&e.hand){o=!0;for(var c=0;c<=window.XRHand.LITTLE_PHALANX_TIP;c++)if(e.hand[c]){var u=t.getJointPose(e.hand[c],n),h=l.joints[c];null!==u&&(h.matrix.fromArray(u.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.jointRadius=u.radius),h.visible=null!==u;var d=l.joints[window.XRHand.INDEX_PHALANX_TIP],p=l.joints[window.XRHand.THUMB_PHALANX_TIP],f=d.position.distanceTo(p.position);l.inputState.pinching&&f>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&f<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}}else null!==a&&null!==(r=t.getPose(e.targetRaySpace,n))&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale)),null!==s&&e.gripSpace&&null!==(i=t.getPose(e.gripSpace,n))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale));return null!==a&&(a.visible=null!==r),null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==o),this}}),Object.assign(no.prototype,ie.prototype),oo.prototype=Object.assign(Object.create(io.prototype),{constructor:oo,isWebGL1Renderer:!0});var ao=function(){function e(e,t){Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new Vt(e),this.density=void 0!==t?t:25e-5}var t=e.prototype;return t.clone=function(){return new e(this.color,this.density)},t.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},e}(),so=function(){function e(e,t,n){Object.defineProperty(this,"isFog",{value:!0}),this.name="",this.color=new Vt(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}var t=e.prototype;return t.clone=function(){return new e(this.color,this.near,this.far)},t.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},e}(),lo=function(e){function t(){var t;return t=e.call(this)||this,Object.defineProperty(de(t),"isScene",{value:!0}),t.type="Scene",t.background=null,t.environment=null,t.fog=null,t.overrideMaterial=null,t.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:de(t)})),t}he(t,e);var n=t.prototype;return n.copy=function(t,n){return e.prototype.copy.call(this,t,n),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},n.toJSON=function(t){var n=e.prototype.toJSON.call(this,t);return null!==this.background&&(n.object.background=this.background.toJSON(t)),null!==this.environment&&(n.object.environment=this.environment.toJSON(t)),null!==this.fog&&(n.object.fog=this.fog.toJSON()),n},t}(wt);function co(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=te,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=le.generateUUID()}Object.defineProperty(co.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(co.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=le.generateUUID()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);var t=new co(new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),this.stride);return t.setUsage(this.usage),t},onUpload:function(e){return this.onUploadCallback=e,this},toJSON:function(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=le.generateUUID()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}});var uo,ho=new Se;function po(e,t,n,r){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}function fo(e){qt.call(this),this.type="SpriteMaterial",this.color=new Vt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}Object.defineProperties(po.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}},needsUpdate:{set:function(e){this.data.needsUpdate=e}}}),Object.assign(po.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)ho.x=this.getX(t),ho.y=this.getY(t),ho.z=this.getZ(t),ho.applyMatrix4(e),this.setXYZ(t,ho.x,ho.y,ho.z);return this},setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this},clone:function(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");for(var t=[],n=0;n<this.count;n++)for(var r=n*this.data.stride+this.offset,i=0;i<this.itemSize;i++)t.push(this.data.array[r+i]);return new Jt(new this.array.constructor(t),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 po(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)},toJSON:function(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");for(var t=[],n=0;n<this.count;n++)for(var r=n*this.data.stride+this.offset,i=0;i<this.itemSize;i++)t.push(this.data.array[r+i]);return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,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}}}),fo.prototype=Object.create(qt.prototype),fo.prototype.constructor=fo,fo.prototype.isSpriteMaterial=!0,fo.prototype.copy=function(e){return qt.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this};var mo=new Se,vo=new Se,go=new Se,yo=new fe,xo=new fe,bo=new Je,_o=new Se,wo=new Se,So=new Se,Mo=new fe,To=new fe,Eo=new fe;function Co(e){if(wt.call(this),this.type="Sprite",void 0===uo){uo=new gn;var t=new co(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);uo.setIndex([0,1,2,0,2,3]),uo.setAttribute("position",new po(t,3,0,!1)),uo.setAttribute("uv",new po(t,2,3,!1))}this.geometry=uo,this.material=void 0!==e?e:new fo,this.center=new fe(.5,.5)}function Lo(e,t,n,r,i,o){yo.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(xo.x=o*yo.x-i*yo.y,xo.y=i*yo.x+o*yo.y):xo.copy(yo),e.copy(t),e.x+=xo.x,e.y+=xo.y,e.applyMatrix4(bo)}Co.prototype=Object.assign(Object.create(wt.prototype),{constructor:Co,isSprite:!0,raycast:function(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),vo.setFromMatrixScale(this.matrixWorld),bo.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),go.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&vo.multiplyScalar(-go.z);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var o=this.center;Lo(_o.set(-.5,-.5,0),go,o,vo,n,r),Lo(wo.set(.5,-.5,0),go,o,vo,n,r),Lo(So.set(.5,.5,0),go,o,vo,n,r),Mo.set(0,0),To.set(1,0),Eo.set(1,1);var a=e.ray.intersectTriangle(_o,wo,So,!1,mo);if(null!==a||(Lo(wo.set(-.5,.5,0),go,o,vo,n,r),To.set(0,1),null!==(a=e.ray.intersectTriangle(_o,So,wo,!1,mo)))){var s=e.ray.origin.distanceTo(mo);s<e.near||s>e.far||t.push({distance:s,point:mo.clone(),uv:zt.getUV(mo,_o,wo,So,Mo,To,Eo,new fe),face:null,object:this})}},copy:function(e){return wt.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}});var Ro,Ao,Po,Io,Oo,Do=new Se,No=new Se;function ko(){wt.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function zo(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Nn.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Je,this.bindMatrixInverse=new Je}ko.prototype=Object.assign(Object.create(wt.prototype),{constructor:ko,isLOD:!0,copy:function(e){wt.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);var n,r=this.levels;for(n=0;n<r.length&&!(t<r[n].distance);n++);return r.splice(n,0,{distance:t,object:e}),this.add(e),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(e){var t=this.levels;if(t.length>0){var n,r;for(n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null},raycast:function(e,t){if(this.levels.length>0){Do.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(Do);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){Do.setFromMatrixPosition(e.matrixWorld),No.setFromMatrixPosition(this.matrixWorld);var n,r,i=Do.distanceTo(No)/e.zoom;for(t[0].object.visible=!0,n=1,r=t.length;n<r&&i>=t[n].distance;n++)t[n-1].object.visible=!1,t[n].object.visible=!0;for(this._currentLevel=n-1;n<r;n++)t[n].object.visible=!1}},toJSON:function(e){var t=wt.prototype.toJSON.call(this,e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var o=n[r];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}),zo.prototype=Object.assign(Object.create(Nn.prototype),{constructor:zo,isSkinnedMesh:!0,copy:function(e){return Nn.prototype.copy.call(this,e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this},bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new xe,t=this.geometry.attributes.skinWeight,n=0,r=t.count;n<r;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var i=1/e.manhattanLength();i!==1/0?e.multiplyScalar(i):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){Nn.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},boneTransform:(Ro=new Se,Ao=new xe,Po=new xe,Io=new Se,Oo=new Je,function(e,t){var n=this.skeleton,r=this.geometry;Ao.fromBufferAttribute(r.attributes.skinIndex,e),Po.fromBufferAttribute(r.attributes.skinWeight,e),Ro.fromBufferAttribute(r.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(var i=0;i<4;i++){var o=Po.getComponent(i);if(0!==o){var a=Ao.getComponent(i);Oo.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),t.addScaledVector(Io.copy(Ro).applyMatrix4(Oo),o)}}
10return t.applyMatrix4(this.bindMatrixInverse)})});var Bo=new Je,Fo=new Je;function Go(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new Je)}}function Ho(){wt.call(this),this.type="Bone"}Object.assign(Go.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new Je;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){for(var e=0,t=this.bones.length;e<t;e++){var n=this.bones[e];n&&n.matrixWorld.getInverse(this.boneInverses[e])}for(var r=0,i=this.bones.length;r<i;r++){var o=this.bones[r];o&&(o.parent&&o.parent.isBone?(o.matrix.getInverse(o.parent.matrixWorld),o.matrix.multiply(o.matrixWorld)):o.matrix.copy(o.matrixWorld),o.matrix.decompose(o.position,o.quaternion,o.scale))}},update:function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,o=e.length;i<o;i++){var a=e[i]?e[i].matrixWorld:Fo;Bo.multiplyMatrices(a,t[i]),Bo.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)},clone:function(){return new Go(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),Ho.prototype=Object.assign(Object.create(wt.prototype),{constructor:Ho,isBone:!0});var Uo=new Je,Wo=new Je,Vo=[],jo=new Nn;function Xo(e,t,n){Nn.call(this,e,t),this.instanceMatrix=new Jt(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}function qo(e){qt.call(this),this.type="LineBasicMaterial",this.color=new Vt(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}Xo.prototype=Object.assign(Object.create(Nn.prototype),{constructor:Xo,isInstancedMesh:!0,copy:function(e){return Nn.prototype.copy.call(this,e),this.instanceMatrix.copy(e.instanceMatrix),this.count=e.count,this},setColorAt:function(e,t){null===this.instanceColor&&(this.instanceColor=new Jt(new Float32Array(3*this.count),3)),t.toArray(this.instanceColor.array,3*e)},getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)},raycast:function(e,t){var n=this.matrixWorld,r=this.count;if(jo.geometry=this.geometry,jo.material=this.material,void 0!==jo.material)for(var i=0;i<r;i++){this.getMatrixAt(i,Uo),Wo.multiplyMatrices(n,Uo),jo.matrixWorld=Wo,jo.raycast(e,Vo);for(var o=0,a=Vo.length;o<a;o++){var s=Vo[o];s.instanceId=i,s.object=this,t.push(s)}Vo.length=0}},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e)},updateMorphTargets:function(){}}),qo.prototype=Object.create(qt.prototype),qo.prototype.constructor=qo,qo.prototype.isLineBasicMaterial=!0,qo.prototype.copy=function(e){return qt.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this};var Yo=new Se,Ko=new Se,Zo=new Je,Jo=new Ze,Qo=new Ue;function $o(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),wt.call(this),this.type="Line",this.geometry=void 0!==e?e:new gn,this.material=void 0!==t?t:new qo,this.updateMorphTargets()}$o.prototype=Object.assign(Object.create(wt.prototype),{constructor:$o,isLine:!0,copy:function(e){return wt.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)Yo.fromBufferAttribute(t,r-1),Ko.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=Yo.distanceTo(Ko);e.setAttribute("lineDistance",new an(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var o=e.vertices,a=e.lineDistances;a[0]=0;for(var s=1,l=o.length;s<l;s++)a[s]=a[s-1],a[s]+=o[s-1].distanceTo(o[s])}return this},raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Qo.copy(n.boundingSphere),Qo.applyMatrix4(r),Qo.radius+=i,!1!==e.ray.intersectsSphere(Qo)){Zo.getInverse(r),Jo.copy(e.ray).applyMatrix4(Zo);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,s=new Se,l=new Se,c=new Se,u=new Se,h=this.isLineSegments?2:1;if(n.isBufferGeometry){var d=n.index,p=n.attributes.position;if(null!==d)for(var f=d.array,m=0,v=f.length-1;m<v;m+=h){var g=f[m],y=f[m+1];if(s.fromBufferAttribute(p,g),l.fromBufferAttribute(p,y),!(Jo.distanceSqToSegment(s,l,u,c)>a)){u.applyMatrix4(this.matrixWorld);var x=e.ray.origin.distanceTo(u);x<e.near||x>e.far||t.push({distance:x,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else for(var b=0,_=p.count-1;b<_;b+=h){if(s.fromBufferAttribute(p,b),l.fromBufferAttribute(p,b+1),!(Jo.distanceSqToSegment(s,l,u,c)>a)){u.applyMatrix4(this.matrixWorld);var w=e.ray.origin.distanceTo(u);w<e.near||w>e.far||t.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}}else if(n.isGeometry)for(var S=n.vertices,M=S.length,T=0;T<M-1;T+=h){if(!(Jo.distanceSqToSegment(S[T],S[T+1],u,c)>a)){u.applyMatrix4(this.matrixWorld);var E=e.ray.origin.distanceTo(u);E<e.near||E>e.far||t.push({distance:E,point:c.clone().applyMatrix4(this.matrixWorld),index:T,face:null,faceIndex:null,object:this})}}}},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i<o;i++){var a=r[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=i}}}}else{var s=e.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});var ea=new Se,ta=new Se;function na(e,t){$o.call(this,e,t),this.type="LineSegments"}function ra(e,t){$o.call(this,e,t),this.type="LineLoop"}function ia(e){qt.call(this),this.type="PointsMaterial",this.color=new Vt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}na.prototype=Object.assign(Object.create($o.prototype),{constructor:na,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;r<i;r+=2)ea.fromBufferAttribute(t,r),ta.fromBufferAttribute(t,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+ea.distanceTo(ta);e.setAttribute("lineDistance",new an(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry)for(var o=e.vertices,a=e.lineDistances,s=0,l=o.length;s<l;s+=2)ea.copy(o[s]),ta.copy(o[s+1]),a[s]=0===s?0:a[s-1],a[s+1]=a[s]+ea.distanceTo(ta);return this}}),ra.prototype=Object.assign(Object.create($o.prototype),{constructor:ra,isLineLoop:!0}),ia.prototype=Object.create(qt.prototype),ia.prototype.constructor=ia,ia.prototype.isPointsMaterial=!0,ia.prototype.copy=function(e){return qt.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this};var oa=new Je,aa=new Ze,sa=new Ue,la=new Se;function ca(e,t){wt.call(this),this.type="Points",this.geometry=void 0!==e?e:new gn,this.material=void 0!==t?t:new ia,this.updateMorphTargets()}function ua(e,t,n,r,i,o,a){var s=aa.distanceSqToPoint(e);if(s<n){var l=new Se;aa.closestPointToPoint(e,l),l.applyMatrix4(r);var c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:t,face:null,object:a})}}function ha(e,t,n,r,i,o,a,s,l){ye.call(this,e,t,n,r,i,o,a,s,l),this.format=void 0!==a?a:T,this.minFilter=void 0!==o?o:v,this.magFilter=void 0!==i?i:v,this.generateMipmaps=!1;var c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}function da(e,t,n,r,i,o,a,s,l,c,u,h){ye.call(this,null,o,a,s,l,c,r,i,u,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function pa(e,t,n,r,i,o,a,s,l){ye.call(this,e,t,n,r,i,o,a,s,l),this.needsUpdate=!0}function fa(e,t,n,r,i,o,a,s,l,c){if((c=void 0!==c?c:C)!==C&&c!==L)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===C&&(n=b),void 0===n&&c===L&&(n=M),ye.call(this,null,r,i,o,a,s,c,n,l),this.image={width:e,height:t},this.magFilter=void 0!==a?a:p,this.minFilter=void 0!==s?s:p,this.flipY=!1,this.generateMipmaps=!1}ca.prototype=Object.assign(Object.create(wt.prototype),{constructor:ca,isPoints:!0,copy:function(e){return wt.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),sa.copy(n.boundingSphere),sa.applyMatrix4(r),sa.radius+=i,!1!==e.ray.intersectsSphere(sa)){oa.getInverse(r),aa.copy(e.ray).applyMatrix4(oa);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o;if(n.isBufferGeometry){var s=n.index,l=n.attributes.position;if(null!==s)for(var c=s.array,u=0,h=c.length;u<h;u++){var d=c[u];la.fromBufferAttribute(l,d),ua(la,d,a,r,e,t,this)}else for(var p=0,f=l.count;p<f;p++)la.fromBufferAttribute(l,p),ua(la,p,a,r,e,t,this)}else for(var m=n.vertices,v=0,g=m.length;v<g;v++)ua(m[v],v,a,r,e,t,this)}},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i<o;i++){var a=r[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=i}}}}else{var s=e.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),ha.prototype=Object.assign(Object.create(ye.prototype),{constructor:ha,isVideoTexture:!0,update:function(){var e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),da.prototype=Object.create(ye.prototype),da.prototype.constructor=da,da.prototype.isCompressedTexture=!0,pa.prototype=Object.create(ye.prototype),pa.prototype.constructor=pa,pa.prototype.isCanvasTexture=!0,fa.prototype=Object.create(ye.prototype),fa.prototype.constructor=fa,fa.prototype.isDepthTexture=!0;var ma=0,va=new Je,ga=new wt,ya=new Se;function xa(){Object.defineProperty(this,"id",{value:ma+=2}),this.uuid=le.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}xa.prototype=Object.assign(Object.create(ie.prototype),{constructor:xa,isGeometry:!0,applyMatrix4:function(e){for(var t=(new me).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(e)}for(var i=0,o=this.faces.length;i<o;i++){var a=this.faces[i];
10a.normal.applyMatrix3(t).normalize();for(var s=0,l=a.vertexNormals.length;s<l;s++)a.vertexNormals[s].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return va.makeRotationX(e),this.applyMatrix4(va),this},rotateY:function(e){return va.makeRotationY(e),this.applyMatrix4(va),this},rotateZ:function(e){return va.makeRotationZ(e),this.applyMatrix4(va),this},translate:function(e,t,n){return va.makeTranslation(e,t,n),this.applyMatrix4(va),this},scale:function(e,t,n){return va.makeScale(e,t,n),this.applyMatrix4(va),this},lookAt:function(e){return ga.lookAt(e),ga.updateMatrix(),this.applyMatrix4(ga.matrix),this},fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index:void 0,r=e.attributes;if(void 0===r.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=r.position,o=r.normal,a=r.color,s=r.uv,l=r.uv2;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var c=0;c<i.count;c++)t.vertices.push((new Se).fromBufferAttribute(i,c)),void 0!==a&&t.colors.push((new Vt).fromBufferAttribute(a,c));function u(e,n,r,i){var c=void 0===a?[]:[t.colors[e].clone(),t.colors[n].clone(),t.colors[r].clone()],u=void 0===o?[]:[(new Se).fromBufferAttribute(o,e),(new Se).fromBufferAttribute(o,n),(new Se).fromBufferAttribute(o,r)],h=new jt(e,n,r,u,c,i);t.faces.push(h),void 0!==s&&t.faceVertexUvs[0].push([(new fe).fromBufferAttribute(s,e),(new fe).fromBufferAttribute(s,n),(new fe).fromBufferAttribute(s,r)]),void 0!==l&&t.faceVertexUvs[1].push([(new fe).fromBufferAttribute(l,e),(new fe).fromBufferAttribute(l,n),(new fe).fromBufferAttribute(l,r)])}var h=e.groups;if(h.length>0)for(var d=0;d<h.length;d++)for(var p=h[d],f=p.start,m=f,v=f+p.count;m<v;m+=3)void 0!==n?u(n.getX(m),n.getX(m+1),n.getX(m+2),p.materialIndex):u(m,m+1,m+2,p.materialIndex);else if(void 0!==n)for(var g=0;g<n.count;g+=3)u(n.getX(g),n.getX(g+1),n.getX(g+2));else for(var y=0;y<i.count;y+=3)u(y,y+1,y+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ya).negate(),this.translate(ya.x,ya.y,ya.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,r=new Je;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix4(r),this},computeFaceNormals:function(){for(var e=new Se,t=new Se,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],o=this.vertices[i.a],a=this.vertices[i.b],s=this.vertices[i.c];e.subVectors(s,a),t.subVectors(o,a),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){void 0===e&&(e=!0);for(var t=new Array(this.vertices.length),n=0,r=this.vertices.length;n<r;n++)t[n]=new Se;if(e)for(var i=new Se,o=new Se,a=0,s=this.faces.length;a<s;a++){var l=this.faces[a],c=this.vertices[l.a],u=this.vertices[l.b],h=this.vertices[l.c];i.subVectors(h,u),o.subVectors(c,u),i.cross(o),t[l.a].add(i),t[l.b].add(i),t[l.c].add(i)}else{this.computeFaceNormals();for(var d=0,p=this.faces.length;d<p;d++){var f=this.faces[d];t[f.a].add(f.normal),t[f.b].add(f.normal),t[f.c].add(f.normal)}}for(var m=0,v=this.vertices.length;m<v;m++)t[m].normalize();for(var g=0,y=this.faces.length;g<y;g++){var x=this.faces[g],b=x.vertexNormals;3===b.length?(b[0].copy(t[x.a]),b[1].copy(t[x.b]),b[2].copy(t[x.c])):(b[0]=t[x.a].clone(),b[1]=t[x.b].clone(),b[2]=t[x.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var e=0,t=this.faces.length;e<t;e++){var n=this.faces[e],r=n.vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var e=0,t=this.faces.length;e<t;e++){var n=this.faces[e];
10n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]);for(var r=0,i=n.vertexNormals.length;r<i;r++)n.__originalVertexNormals[r]?n.__originalVertexNormals[r].copy(n.vertexNormals[r]):n.__originalVertexNormals[r]=n.vertexNormals[r].clone()}var o=new xa;o.faces=this.faces;for(var a=0,s=this.morphTargets.length;a<s;a++){if(!this.morphNormals[a]){this.morphNormals[a]={},this.morphNormals[a].faceNormals=[],this.morphNormals[a].vertexNormals=[];for(var l=this.morphNormals[a].faceNormals,c=this.morphNormals[a].vertexNormals,u=0,h=this.faces.length;u<h;u++){var d=new Se,p={a:new Se,b:new Se,c:new Se};l.push(d),c.push(p)}}var f=this.morphNormals[a];o.vertices=this.morphTargets[a].vertices,o.computeFaceNormals(),o.computeVertexNormals();for(var m=0,v=this.faces.length;m<v;m++){var g=this.faces[m],y=f.faceNormals[m],x=f.vertexNormals[m];y.copy(g.normal),x.a.copy(g.vertexNormals[0]),x.b.copy(g.vertexNormals[1]),x.c.copy(g.vertexNormals[2])}}for(var b=0,_=this.faces.length;b<_;b++){var w=this.faces[b];
10w.normal=w.__originalFaceNormal,w.vertexNormals=w.__originalVertexNormals}},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Ee),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Ue),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var r,i=this.vertices.length,o=this.vertices,a=e.vertices,s=this.faces,l=e.faces,c=this.colors,u=e.colors;void 0===n&&(n=0),void 0!==t&&(r=(new me).getNormalMatrix(t));for(var h=0,d=a.length;h<d;h++){var p=a[h].clone();void 0!==t&&p.applyMatrix4(t),o.push(p)}for(var f=0,m=u.length;f<m;f++)c.push(u[f].clone());for(var v=0,g=l.length;v<g;v++){var y=l[v],x=void 0,b=void 0,_=y.vertexNormals,w=y.vertexColors,S=new jt(y.a+i,y.b+i,y.c+i);S.normal.copy(y.normal),void 0!==r&&S.normal.applyMatrix3(r).normalize();for(var M=0,T=_.length;M<T;M++)x=_[M].clone(),void 0!==r&&x.applyMatrix3(r).normalize(),S.vertexNormals.push(x);S.color.copy(y.color);for(var E=0,C=w.length;E<C;E++)b=w[E],S.vertexColors.push(b.clone());S.materialIndex=y.materialIndex+n,s.push(S)}for(var L=0,R=e.faceVertexUvs.length;L<R;L++){var A=e.faceVertexUvs[L];void 0===this.faceVertexUvs[L]&&(this.faceVertexUvs[L]=[]);for(var P=0,I=A.length;P<I;P++){for(var O=A[P],D=[],N=0,k=O.length;N<k;N++)D.push(O[N].clone());this.faceVertexUvs[L].push(D)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(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:function(){for(var e={},t=[],n=[],r=Math.pow(10,4),i=0,o=this.vertices.length;i<o;i++){var a=this.vertices[i],s=Math.round(a.x*r)+"_"+Math.round(a.y*r)+"_"+Math.round(a.z*r);void 0===e[s]?(e[s]=i,t.push(this.vertices[i]),n[i]=t.length-1):n[i]=n[e[s]]}for(var l=[],c=0,u=this.faces.length;c<u;c++){var h=this.faces[c];h.a=n[h.a],h.b=n[h.b],h.c=n[h.c];for(var d=[h.a,h.b,h.c],p=0;p<3;p++)if(d[p]===d[(p+1)%3]){l.push(c);break}}for(var f=l.length-1;f>=0;f--){var m=l[f];this.faces.splice(m,1);for(var v=0,g=this.faceVertexUvs.length;v<g;v++)this.faceVertexUvs[v].splice(m,1)}var y=this.vertices.length-t.length;return this.vertices=t,y},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new Se(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));var r,i,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];o&&o.length===t&&(r=[]),a&&a.length===t&&(i=[]);for(var s=0;s<t;s++){var l=e[s]._id;r&&r.push(o[l]),i&&i.push(a[l])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var 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){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var r=[],i=0;i<this.vertices.length;i++){var o=this.vertices[i];r.push(o.x,o.y,o.z)}for(var a=[],s=[],l={},c=[],u={},h=[],d={},p=0;p<this.faces.length;p++){var f=this.faces[p],m=void 0!==this.faceVertexUvs[0][p],v=f.normal.length()>0,g=f.vertexNormals.length>0,y=1!==f.color.r||1!==f.color.g||1!==f.color.b,x=f.vertexColors.length>0,b=0;if(b=M(b,0,0),b=M(b,1,!0),b=M(b,2,!1),b=M(b,3,m),b=M(b,4,v),b=M(b,5,g),b=M(b,6,y),b=M(b,7,x),a.push(b),a.push(f.a,f.b,f.c),a.push(f.materialIndex),m){var _=this.faceVertexUvs[0][p];a.push(C(_[0]),C(_[1]),C(_[2]))}if(v&&a.push(T(f.normal)),g){var w=f.vertexNormals;a.push(T(w[0]),T(w[1]),T(w[2]))}if(y&&a.push(E(f.color)),x){var S=f.vertexColors;a.push(E(S[0]),E(S[1]),E(S[2]))}}function M(e,t,n){return n?e|1<<t:e&~(1<<t)}function T(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==l[t]||(l[t]=s.length/3,s.push(e.x,e.y,e.z)),l[t]}function E(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==u[t]||(u[t]=c.length,c.push(e.getHex())),u[t]}function C(e){var t=e.x.toString()+e.y.toString();return void 0!==d[t]||(d[t]=h.length/2,h.push(e.x,e.y)),d[t]}return e.data={},e.data.vertices=r,e.data.normals=s,c.length>0&&(e.data.colors=c),h.length>0&&(e.data.uvs=[h]),e.data.faces=a,e},clone:function(){return(new xa).copy(this)},copy:function(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;for(var t=e.vertices,n=0,r=t.length;n<r;n++)this.vertices.push(t[n].clone());for(var i=e.colors,o=0,a=i.length;o<a;o++)this.colors.push(i[o].clone());for(var s=e.faces,l=0,c=s.length;l<c;l++)this.faces.push(s[l].clone());for(var u=0,h=e.faceVertexUvs.length;u<h;u++){var d=e.faceVertexUvs[u];void 0===this.faceVertexUvs[u]&&(this.faceVertexUvs[u]=[]);for(var p=0,f=d.length;p<f;p++){for(var m=d[p],v=[],g=0,y=m.length;g<y;g++){var x=m[g];v.push(x.clone())}this.faceVertexUvs[u].push(v)}}for(var b=e.morphTargets,_=0,w=b.length;_<w;_++){var S={};if(S.name=b[_].name,void 0!==b[_].vertices){S.vertices=[];for(var M=0,T=b[_].vertices.length;M<T;M++)S.vertices.push(b[_].vertices[M].clone())}if(void 0!==b[_].normals){S.normals=[];for(var E=0,C=b[_].normals.length;E<C;E++)S.normals.push(b[_].normals[E].clone())}this.morphTargets.push(S)}for(var L=e.morphNormals,R=0,A=L.length;R<A;R++){var P={};if(void 0!==L[R].vertexNormals){P.vertexNormals=[];for(var I=0,O=L[R].vertexNormals.length;I<O;I++){var D=L[R].vertexNormals[I],N={};N.a=D.a.clone(),N.b=D.b.clone(),N.c=D.c.clone(),P.vertexNormals.push(N)}}if(void 0!==L[R].faceNormals){P.faceNormals=[];for(var k=0,z=L[R].faceNormals.length;k<z;k++)P.faceNormals.push(L[R].faceNormals[k].clone())}this.morphNormals.push(P)}for(var B=e.skinWeights,F=0,G=B.length;F<G;F++)this.skinWeights.push(B[F].clone());for(var H=e.skinIndices,U=0,W=H.length;U<W;U++)this.skinIndices.push(H[U].clone());for(var V=e.lineDistances,j=0,X=V.length;j<X;j++)this.lineDistances.push(V[j]);var q=e.boundingBox;null!==q&&(this.boundingBox=q.clone());var Y=e.boundingSphere;return null!==Y&&(this.boundingSphere=Y.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},dispose:function(){this.dispatchEvent({type:"dispose"})}});var ba=function(e){function t(t,n,r,i,o,a){var s;return(s=e.call(this)||this).type="BoxGeometry",s.parameters={width:t,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:a},s.fromBufferGeometry(new Bn(t,n,r,i,o,a)),s.mergeVertices(),s}return he(t,e),t}(xa),_a=function(e){function t(t,n,r,i){var o;(o=e.call(this)||this).type="CircleBufferGeometry",o.parameters={radiu
10s:t,segments:n,thetaStart:r,thetaLength:i},t=t||1,n=void 0!==n?Math.max(3,n):8,r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI;var a=[],s=[],l=[],c=[],u=new Se,h=new fe;s.push(0,0,0),l.push(0,0,1),c.push(.5,.5);for(var d=0,p=3;d<=n;d++,p+=3){var f=r+d/n*i;u.x=t*Math.cos(f),u.y=t*Math.sin(f),s.push(u.x,u.y,u.z),l.push(0,0,1),h.x=(s[p]/t+1)/2,h.y=(s[p+1]/t+1)/2,c.push(h.x,h.y)}for(var m=1;m<=n;m++)a.push(m,m+1,0);return o.setIndex(a),o.setAttribute("position",new an(s,3)),o.setAttribute("normal",new an(l,3)),o.setAttribute("uv",new an(c,2)),o}return he(t,e),t}(gn),wa=function(e){function t(t,n,r,i){var o;return(o=e.call(this)||this).type="CircleGeometry",o.parameters={radius:t,segments:n,thetaStart:r,thetaLength:i},o.fromBufferGeometry(new _a(t,n,r,i)),o.mergeVertices(),o}return he(t,e),t}(xa),Sa=function(e){function t(t,n,r,i,o,a,s,l){var c;(c=e.call(this)||this).type="CylinderBufferGeometry",c.parameters={radiusTop:t,radiusBottom:n,height:r,radialSegments:i,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:l};var u=de(c);t=void 0!==t?t:1,n=void 0!==n?n:1,r=r||1,i=Math.floor(i)||8,o=Math.floor(o)||1,a=void 0!==a&&a,s=void 0!==s?s:0,l=void 0!==l?l:2*Math.PI;var h=[],d=[],p=[],f=[],m=0,v=[],g=r/2,y=0;function x(e){for(var r=m,o=new fe,a=new Se,c=0,v=!0===e?t:n,x=!0===e?1:-1,b=1;b<=i;b++)d.push(0,g*x,0),p.push(0,x,0),f.push(.5,.5),m++;for(var _=m,w=0;w<=i;w++){var S=w/i*l+s,M=Math.cos(S),T=Math.sin(S);a.x=v*T,a.y=g*x,a.z=v*M,d.push(a.x,a.y,a.z),p.push(0,x,0),o.x=.5*M+.5,o.y=.5*T*x+.5,f.push(o.x,o.y),m++}for(var E=0;E<i;E++){var C=r+E,L=_+E;!0===e?h.push(L,L+1,C):h.push(L+1,L,C),c+=3}u.addGroup(y,c,!0===e?1:2),y+=c}return function(){for(var e=new Se,a=new Se,c=0,x=(n-t)/r,b=0;b<=o;b++){for(var _=[],w=b/o,S=w*(n-t)+t,M=0;M<=i;M++){var T=M/i,E=T*l+s,C=Math.sin(E),L=Math.cos(E);a.x=S*C,a.y=-w*r+g,a.z=S*L,d.push(a.x,a.y,a.z),e.set(C,x,L).normalize(),p.push(e.x,e.y,e.z),f.push(T,1-w),_.push(m++)}v.push(_)}for(var R=0;R<i;R++)for(var A=0;A<o;A++){var P=v[A][R],I=v[A+1][R],O=v[A+1][R+1],D=v[A][R+1];h.push(P,I,D),h.push(I,O,D),c+=6}u.addGroup(y,c,0),y+=c}(),!1===a&&(t>0&&x(!0),n>0&&x(!1)),c.setIndex(h),c.setAttribute("position",new an(d,3)),c.setAttribute("normal",new an(p,3)),c.setAttribute("uv",new an(f,2)),c}return he(t,e),t}(gn),Ma=function(e){function t(t,n,r,i,o,a,s,l){var c;return(c=e.call(this)||this).type="CylinderGeometry",c.parameters={radiusTop:t,radiusBottom:n,height:r,radialSegments:i,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:l},c.fromBufferGeometry(new Sa(t,n,r,i,o,a,s,l)),c.mergeVertices(),c}return he(t,e),t}(xa),Ta=function(e){function t(t,n,r,i,o,a,s){var l;return(l=e.call(this,0,t,n,r,i,o,a,s)||this).type="ConeGeometry",l.parameters={radius:t,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s},l}return he(t,e),t}(Ma),Ea=function(e){function t(t,n,r,i,o,a,s){var l;return(l=e.call(this,0,t,n,r,i,o,a,s)||this).type="ConeBufferGeometry",l.parameters={radius:t,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s},l}return he(t,e),t}(Sa),Ca=function(e){function t(t,n,r,i){var o;(o=e.call(this)||this).type="PolyhedronBufferGeometry",o.parameters={vertices:t,indices:n,radius:r,detail:i},r=r||1;var a=[],s=[];function l(e,t,n,r){for(var i=r+1,o=[],a=0;a<=i;a++){o[a]=[];for(var s=e.clone().lerp(n,a/i),l=t.clone().lerp(n,a/i),u=i-a,h=0;h<=u;h++)o[a][h]=0===h&&a===i?s:s.clone().lerp(l,h/u)}for(var d=0;d<i;d++)for(var p=0;p<2*(i-d)-1;p++){var f=Math.floor(p/2);p%2==0?(c(o[d][f+1]),c(o[d+1][f]),c(o[d][f])):(c(o[d][f+1]),c(o[d+1][f+1]),c(o[d+1][f]))}}function c(e){a.push(e.x,e.y,e.z)}function u(e,n){var r=3*e;n.x=t[r+0],n.y=t[r+1],n.z=t[r+2]}function h(e,t,n,r){r<0&&1===e.x&&(s[t]=e.x-1),0===n.x&&0===n.z&&(s[t]=r/2/Math.PI+.5)}function d(e){return Math.atan2(e.z,-e.x)}function p(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}return function(e){for(var t=new Se,r=new Se,i=new Se,o=0;o<n.length;o+=3)u(n[o+0],t),u(n[o+1],r),u(n[o+2],i),l(t,r,i,e)}(i=i||0),function(e){for(var t=new Se,n=0;n<a.length;n+=3)t.x=a[n+0],t.y=a[n+1],t.z=a[n+2],t.normalize().multiplyScalar(e),a[n+0]=t.x,a[n+1]=t.y,a[n+2]=t.z}(r),function(){for(var e=new Se,t=0;t<a.length;t+=3){e.x=a[t+0],e.y=a[t+1],e.z=a[t+2];var n=d(e)/2/Math.PI+.5,r=p(e)/Math.PI+.5;s.push(n,1-r)}(function(){for(var e=new Se,t=new Se,n=new Se,r=new Se,i=new fe,o=new fe,l=new fe,c=0,u=0;c<a.length;c+=9,u+=6){e.set(a[c+0],a[c+1],a[c+2]),t.set(a[c+3],a[c+4],a[c+5]),n.set(a[c+6],a[c+7],a[c+8]),i.set(s[u+0],s[u+1]),o.set(s[u+2],s[u+3]),l.set(s[u+4],s[u+5]),r.copy(e).add(t).add(n).divideScalar(3);var p=d(r);h(i,u+0,e,p),h(o,u+2,t,p),h(l,u+4,n,p)}})(),function(){for(var e=0;e<s.length;e+=6){var t=s[e+0],n=s[e+2],r=s[e+4],i=Math.max(t,n,r),o=Math.min(t,n,r);i>
10.9&&o<.1&&(t<.2&&(s[e+0]+=1),n<.2&&(s[e+2]+=1),r<.2&&(s[e+4]+=1))}}()}(),o.setAttribute("position",new an(a,3)),o.setAttribute("normal",new an(a.slice(),3)),o.setAttribute("uv",new an(s,2)),0===i?o.computeVertexNormals():o.normalizeNormals(),o}return he(t,e),t}(gn),La=function(e){function t(t,n){var r,i=(1+Math.sqrt(5))/2,o=1/i,a=[-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,-o,-i,0,-o,i,0,o,-i,0,o,i,-o,-i,0,-o,i,0,o,-i,0,o,i,0,-i,0,-o,i,0,-o,-i,0,o,i,0,o];return(r=e.call(this,a,[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],t,n)||this).type="DodecahedronBufferGeometry",r.parameters={radius:t,detail:n},r}return he(t,e),t}(Ca),Ra=function(e){function t(t,n){var r;return(r=e.call(this)||this).type="DodecahedronGeometry",r.parameters={radius:t,detail:n},r.fromBufferGeometry(new La(t,n)),r.mergeVertices(),r}return he(t,e),t}(xa),Aa=new Se,Pa=new Se,Ia=new Se,Oa=new zt,Da=function(e){function t(t,n){var r;(r=e.call(this)||this).type="EdgesGeometry",r.parameters={thresholdAngle:n},n=void 0!==n?n:1,t.isGeometry&&(t=(new gn).fromGeometry(t));for(var i=Math.pow(10,4),o=Math.cos(le.DEG2RAD*n),a=t.getIndex(),s=t.getAttribute("position"),l=a?a.count:s.count,c=[0,0,0],u=["a","b","c"],h=new Array(3),d={},p=[],f=0;f<l;f+=3){a?(c[0]=a.getX(f),c[1]=a.getX(f+1),c[2]=a.getX(f+2)):(c[0]=f,c[1]=f+1,c[2]=f+2);var m=Oa.a,v=Oa.b,g=Oa.c;if(m.fromBufferAttribute(s,c[0]),v.fromBufferAttribute(s,c[1]),g.fromBufferAttribute(s,c[2]),Oa.getNormal(Ia),h[0]=Math.round(m.x*i)+","+Math.round(m.y*i)+","+Math.round(m.z*i),h[1]=Math.round(v.x*i)+","+Math.round(v.y*i)+","+Math.round(v.z*i),h[2]=Math.round(g.x*i)+","+Math.round(g.y*i)+","+Math.round(g.z*i),h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(var y=0;y<3;y++){var x=(y+1)%3,b=h[y],_=h[x],w=Oa[u[y]],S=Oa[u[x]],M=b+"_"+_,T=_+"_"+b;T in d&&d[T]?(Ia.dot(d[T].normal)<=o&&(p.push(w.x,w.y,w.z),p.push(S.x,S.y,S.z)),d[T]=null):M in d||(d[M]={index0:c[y],index1:c[x],normal:Ia.clone()})}}for(var E in d)if(d[E]){var C=d[E],L=C.index0,R=C.index1;Aa.fromBufferAttribute(s,L),Pa.fromBufferAttribute(s,R),p.push(Aa.x,Aa.y,Aa.z),p.push(Pa.x,Pa.y,Pa.z)}return r.setAttribute("position",new an(p,3)),r}return he(t,e),t}(gn),Na=function(e,t,n){n=n||2;var r,i,o,a,s,l,c,u=t&&t.length,h=u?t[0]*n:e.length,d=ka(e,0,h,n,!0),p=[];if(!d||d.next===d.prev)return p;if(u&&(d=function(e,t,n,r){var i,o,a,s=[];for(i=0,o=t.length;i<o;i++)(a=ka(e,t[i]*r,i<o-1?t[i+1]*r:e.length,r,!1))===a.next&&(a.steiner=!0),s.push(qa(a));for(s.sort(Wa),i=0;i<s.length;i++)Va(s[i],n),n=za(n,n.next);return n}(e,t,d,n)),e.length>80*n){r=o=e[0],i=a=e[1];for(var f=n;f<h;f+=n)(s=e[f])<r&&(r=s),(l=e[f+1])<i&&(i=l),s>o&&(o=s),l>a&&(a=l);c=0!==(c=Math.max(o-r,a-i))?1/c:0}return Ba(d,p,n,r,i,c),p};function ka(e,t,n,r,i){var o,a;if(i===function(e,t,n,r){for(var i=0,o=t,a=n-r;o<n;o+=r)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}(e,t,n,r)>0)for(o=t;o<n;o+=r)a=rs(o,e[o],e[o+1],a);else for(o=n-r;o>=t;o-=r)a=rs(o,e[o],e[o+1],a);return a&&Ja(a,a.next)&&(is(a),a=a.next),a}function za(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!Ja(r,r.next)&&0!==Za(r.prev,r,r.next))r=r.next;else{if(is(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function Ba(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=Xa(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,l,c=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t<c&&(s++,r=r.nextZ);t++);for(l=c;s>0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}(e,r,i,o);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?Ga(e,r,i,o):Fa(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),is(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?Ba(e=Ha(za(e),t,n),t,n,r,i,o,2):2===a&&Ua(e,t,n,r,i,o):Ba(za(e),t,n,r,i,o,1);break}}}function Fa(e){var t=e.prev,n=e,r=e.next;if(Za(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Ya(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Za(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ga(e,t,n,r){var i=e.prev,o=e,a=e.next;if(Za(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,l=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,c=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=Xa(s,l,t,n,r),d=Xa(c,u,t,n,r),p=e.prevZ,f=e.nextZ;p&&p.z>=h&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&Ya(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Za(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&Ya(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Za(f.prev,f,f.next)>=0)return!1;
10f=f.nextZ}for(;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&Ya(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Za(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&Ya(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Za(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Ha(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!Ja(i,o)&&Qa(i,r,r.next,o)&&ts(i,o)&&ts(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),is(r),is(r.next),r=e=o),r=r.next}while(r!==e);return za(r)}function Ua(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Ka(a,s)){var l=ns(a,s);return a=za(a,a.next),l=za(l,l.next),Ba(a,t,n,r,i,o),void Ba(l,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function Wa(e,t){return e.x-t.x}function Va(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===a)return n;var l,c=n,u=n.x,h=n.y,d=1/0;r=n;do{i>=r.x&&r.x>=u&&i!==r.x&&Ya(o<h?i:a,o,u,h,o<h?a:i,o,r.x,r.y)&&(l=Math.abs(o-r.y)/(i-r.x),ts(r,e)&&(l<d||l===d&&(r.x>n.x||r.x===n.x&&ja(n,r)))&&(n=r,d=l)),r=r.next}while(r!==c);return n}(e,t)){var n=ns(t,e);za(t,t.next),za(n,n.next)}}function ja(e,t){return Za(e.prev,e,t.prev)<0&&Za(t.next,e,e.next)<0}function Xa(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function qa(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Ya(e,t,n,r,i,o,a,s){return(i-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function Ka(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Qa(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(ts(e,t)&&ts(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Za(e.prev,e,t.prev)||Za(e,t.prev,t))||Ja(e,t)&&Za(e.prev,e,e.next)>0&&Za(t.prev,t,t.next)>0)}function Za(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Ja(e,t){return e.x===t.x&&e.y===t.y}function Qa(e,t,n,r){var i=es(Za(e,t,n)),o=es(Za(e,t,r)),a=es(Za(n,r,e)),s=es(Za(n,r,t));return i!==o&&a!==s||(!(0!==i||!$a(e,n,t))||(!(0!==o||!$a(e,r,t))||(!(0!==a||!$a(n,e,r))||!(0!==s||!$a(n,t,r)))))}function $a(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function es(e){return e>0?1:e<0?-1:0}function ts(e,t){return Za(e.prev,e,e.next)<0?Za(e,t,e.next)>=0&&Za(e,e.prev,t)>=0:Za(e,t,e.prev)<0||Za(e,e.next,t)<0}function ns(e,t){var n=new os(e.i,e.x,e.y),r=new os(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function rs(e,t,n,r){var i=new os(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function is(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 os(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var as={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n},isClockWise:function(e){return as.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];ss(e),ls(n,e);var o=e.length;t.forEach(ss);for(var a=0;a<t.length;a++)r.push(o),o+=t[a].length,ls(n,t[a]);for(var s=Na(n,r),l=0;l<s.length;l+=3)i.push(s.slice(l,l+3));return i}};function ss(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function ls(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}var cs=function(e){function t(t,n){var r;(r=e.call(this)||this).type="ExtrudeBufferGeometry",r.parameters={shapes:t,options:n},t=Array.isArray(t)?t:[t];for(var i=de(r),o=[],a=[],s=0,l=t.length;s<l;s++){c(t[s])}function c(e){var t=[],r=void 0!==n.curveSegments?n.curveSegments:12,s=void 0!==n.steps?n.steps:1,l=void 0!==n.depth?n.depth:100,c=void 0===n.bevelEnabled||n.bevelEnabled,u=void 0!==n.bevelThickness?n.bevelThickness:6,h=void 0!==n.bevelSize?n.bevelSize:u-2,d=void 0!==n.bevelOffset?n.bevelOffset:0,p=void 0!==n.bevelSegments?n.bevelSegments:3,f=n.extrudePath,m=void 0!==n.UVGenerator?n.UVGenerator:us;void 0!==n.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=n.amount);var v,g,y,x,b,_=!1;f&&(v=f.getSpacedPoints(s),_=!0,c=!1,g=f.computeFrenetFrames(s,!1),y=new Se,x=new Se,b=new Se),c||(p=0,u=0,h=0,d=0);var w=e.extractPoints(r),S=w.shape,M=w.holes;if(!as.isClockWise(S)){S=S.reverse();for(var T=0,E=M.length;T<E;T++){var C=M[T];as.isClockWise(C)&&(M[T]=C.reverse())}}for(var L=as.triangulateShape(S,M),R=S,A=0,P=M.length;A<P;A++){var I=M[A];
10S=S.concat(I)}function O(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var D=S.length,N=L.length;function k(e,t,n){var r,i,o,a=e.x-t.x,s=e.y-t.y,l=n.x-e.x,c=n.y-e.y,u=a*a+s*s,h=a*c-s*l;if(Math.abs(h)>Number.EPSILON){var d=Math.sqrt(u),p=Math.sqrt(l*l+c*c),f=t.x-s/d,m=t.y+a/d,v=((n.x-c/p-f)*c-(n.y+l/p-m)*l)/(a*c-s*l),g=(r=f+a*v-e.x)*r+(i=m+s*v-e.y)*i;if(g<=2)return new fe(r,i);o=Math.sqrt(g/2)}else{var y=!1;a>Number.EPSILON?l>Number.EPSILON&&(y=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(c)&&(y=!0),y?(r=-s,i=a,o=Math.sqrt(u)):(r=a,i=s,o=Math.sqrt(u/2))}return new fe(r/o,i/o)}for(var z=[],B=0,F=R.length,G=F-1,H=B+1;B<F;B++,G++,H++)G===F&&(G=0),H===F&&(H=0),z[B]=k(R[B],R[G],R[H]);for(var U,W=[],V=z.concat(),j=0,X=M.length;j<X;j++){var q=M[j];U=[];for(var Y=0,K=q.length,Z=K-1,J=Y+1;Y<K;Y++,Z++,J++)Z===K&&(Z=0),J===K&&(J=0),U[Y]=k(q[Y],q[Z],q[J]);W.push(U),V=V.concat(U)}for(var Q=0;Q<p;Q++){for(var $=Q/p,ee=u*Math.cos($*Math.PI/2),te=h*Math.sin($*Math.PI/2)+d,ne=0,re=R.length;ne<re;ne++){var ie=O(R[ne],z[ne],te);Oe(ie.x,ie.y,-ee)}for(var oe=0,ae=M.length;oe<ae;oe++){var se=M[oe];U=W[oe];for(var le=0,ce=se.length;le<ce;le++){var ue=O(se[le],U[le],te);Oe(ue.x,ue.y,-ee)}}}for(var he=h+d,de=0;de<D;de++){var pe=c?O(S[de],V[de],he):S[de];_?(x.copy(g.normals[0]).multiplyScalar(pe.x),y.copy(g.binormals[0]).multiplyScalar(pe.y),b.copy(v[0]).add(x).add(y),Oe(b.x,b.y,b.z)):Oe(pe.x,pe.y,0)}for(var me=1;me<=s;me++)for(var ve=0;ve<D;ve++){var ge=c?O(S[ve],V[ve],he):S[ve];_?(x.copy(g.normals[me]).multiplyScalar(ge.x),y.copy(g.binormals[me]).multiplyScalar(ge.y),b.copy(v[me]).add(x).add(y),Oe(b.x,b.y,b.z)):Oe(ge.x,ge.y,l/s*me)}for(var ye=p-1;ye>=0;ye--){for(var xe=ye/p,be=u*Math.cos(xe*Math.PI/2),_e=h*Math.sin(xe*Math.PI/2)+d,we=0,Me=R.length;we<Me;we++){var Te=O(R[we],z[we],_e);Oe(Te.x,Te.y,l+be)}for(var Ee=0,Ce=M.length;Ee<Ce;Ee++){var Le=M[Ee];U=W[Ee];for(var Re=0,Ae=Le.length;Re<Ae;Re++){var Pe=O(Le[Re],U[Re],_e);_?Oe(Pe.x,Pe.y+v[s-1].y,v[s-1].x+be):Oe(Pe.x,Pe.y,l+be)}}}function Ie(e,t){for(var n=e.length;--n>=0;){var r=n,i=n-1;i<0&&(i=e.length-1);for(var o=0,a=s+2*p;o<a;o++){var l=D*o,c=D*(o+1);Ne(t+r+l,t+i+l,t+i+c,t+r+c)}}}function Oe(e,n,r){t.push(e),t.push(n),t.push(r)}function De(e,t,n){ke(e),ke(t),ke(n);var r=o.length/3,a=m.generateTopUV(i,o,r-3,r-2,r-1);ze(a[0]),ze(a[1]),ze(a[2])}function Ne(e,t,n,r){ke(e),ke(t),ke(r),ke(t),ke(n),ke(r);var a=o.length/3,s=m.generateSideWallUV(i,o,a-6,a-3,a-2,a-1);ze(s[0]),ze(s[1]),ze(s[3]),ze(s[1]),ze(s[2]),ze(s[3])}function ke(e){o.push(t[3*e+0]),o.push(t[3*e+1]),o.push(t[3*e+2])}function ze(e){a.push(e.x),a.push(e.y)}!function(){var e=o.length/3;if(c){for(var t=0,n=D*t,r=0;r<N;r++){var a=L[r];De(a[2]+n,a[1]+n,a[0]+n)}n=D*(t=s+2*p);for(var l=0;l<N;l++){var u=L[l];De(u[0]+n,u[1]+n,u[2]+n)}}else{for(var h=0;h<N;h++){var d=L[h];De(d[2],d[1],d[0])}for(var f=0;f<N;f++){var m=L[f];De(m[0]+D*s,m[1]+D*s,m[2]+D*s)}}i.addGroup(e,o.length/3-e,0)}(),function(){var e=o.length/3,t=0;Ie(R,t),t+=R.length;for(var n=0,r=M.length;n<r;n++){var a=M[n];Ie(a,t),t+=a.length}i.addGroup(e,o.length/3-e,1)}()}return r.setAttribute("position",new an(o,3)),r.setAttribute("uv",new an(a,2)),r.computeVertexNormals(),r}return he(t,e),t.prototype.toJSON=function(){var e=gn.prototype.toJSON.call(this);return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(var r=0,i=e.length;r<i;r++){var o=e[r];n.shapes.push(o.uuid)}else n.shapes.push(e.uuid);void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,e)},t}(gn),us={generateTopUV:function(e,t,n,r,i){var o=t[3*n],a=t[3*n+1],s=t[3*r],l=t[3*r+1],c=t[3*i],u=t[3*i+1];return[new fe(o,a),new fe(s,l),new fe(c,u)]},generateSideWallUV:function(e,t,n,r,i,o){var a=t[3*n],s=t[3*n+1],l=t[3*n+2],c=t[3*r],u=t[3*r+1],h=t[3*r+2],d=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*o],v=t[3*o+1],g=t[3*o+2];return Math.abs(s-u)<.01?[new fe(a,1-l),new fe(c,1-h),new fe(d,1-f),new fe(m,1-g)]:[new fe(s,1-l),new fe(u,1-h),new fe(p,1-f),new fe(v,1-g)]}};var hs=function(e){function t(t,n){var r;return(r=e.call(this)||this).type="ExtrudeGeometry",r.parameters={shapes:t,options:n},r.fromBufferGeometry(new cs(t,n)),r.mergeVertices(),r}return he(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(var r=0,i=e.length;r<i;r++){var o=e[r];n.shapes.push(o.uuid)}else n.shapes.push(e.uuid);void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,t)},t}(xa);var ds=function(e){function t(t,n){var r,i=(1+Math.sqrt(5))/2,o=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1];return(r=e.call(this,o,[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],t,n)||this).type="IcosahedronBufferGeometry",r.parameters={radiu
10s:t,detail:n},r}return he(t,e),t}(Ca),ps=function(e){function t(t,n){var r;return(r=e.call(this)||this).type="IcosahedronGeometry",r.parameters={radius:t,detail:n},r.fromBufferGeometry(new ds(t,n)),r.mergeVertices(),r}return he(t,e),t}(xa),fs=function(e){function t(t,n,r,i){var o;(o=e.call(this)||this).type="LatheBufferGeometry",o.parameters={points:t,segments:n,phiStart:r,phiLength:i},n=Math.floor(n)||12,r=r||0,i=i||2*Math.PI,i=le.clamp(i,0,2*Math.PI);for(var a=[],s=[],l=[],c=1/n,u=new Se,h=new fe,d=0;d<=n;d++)for(var p=r+d*c*i,f=Math.sin(p),m=Math.cos(p),v=0;v<=t.length-1;v++)u.x=t[v].x*f,u.y=t[v].y,u.z=t[v].x*m,s.push(u.x,u.y,u.z),h.x=d/n,h.y=v/(t.length-1),l.push(h.x,h.y);for(var g=0;g<n;g++)for(var y=0;y<t.length-1;y++){var x=y+g*t.length,b=x,_=x+t.length,w=x+t.length+1,S=x+1;a.push(b,_,S),a.push(_,w,S)}if(o.setIndex(a),o.setAttribute("position",new an(s,3)),o.setAttribute("uv",new an(l,2)),o.computeVertexNormals(),i===2*Math.PI)for(var M=o.attributes.normal.array,T=new Se,E=new Se,C=new Se,L=n*t.length*3,R=0,A=0;R<t.length;R++,A+=3)T.x=M[A+0],T.y=M[A+1],T.z=M[A+2],E.x=M[L+A+0],E.y=M[L+A+1],E.z=M[L+A+2],C.addVectors(T,E).normalize(),M[A+0]=M[L+A+0]=C.x,M[A+1]=M[L+A+1]=C.y,M[A+2]=M[L+A+2]=C.z;return o}return he(t,e),t}(gn),ms=function(e){function t(t,n,r,i){var o;return(o=e.call(this)||this).type="LatheGeometry",o.parameters={points:t,segments:n,phiStart:r,phiLength:i},o.fromBufferGeometry(new fs(t,n,r,i)),o.mergeVertices(),o}return he(t,e),t}(xa),vs=function(e){function t(t,n){var r;return(r=e.call(this,[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],t,n)||this).type="OctahedronBufferGeometry",r.parameters={radius:t,detail:n},r}return he(t,e),t}(Ca),gs=function(e){function t(t,n){var r;return(r=e.call(this)||this).type="OctahedronGeometry",r.parameters={radius:t,detail:n},r.fromBufferGeometry(new vs(t,n)),r.mergeVertices(),r}return he(t,e),t}(xa);function ys(e,t,n){gn.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r=[],i=[],o=[],a=[],s=1e-5,l=new Se,c=new Se,u=new Se,h=new Se,d=new Se;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");for(var p=t+1,f=0;f<=n;f++)for(var m=f/n,v=0;v<=t;v++){var g=v/t;e(g,m,c),i.push(c.x,c.y,c.z),g-s>=0?(e(g-s,m,u),h.subVectors(c,u)):(e(g+s,m,u),h.subVectors(u,c)),m-s>=0?(e(g,m-s,u),d.subVectors(c,u)):(e(g,m+s,u),d.subVectors(u,c)),l.crossVectors(h,d).normalize(),o.push(l.x,l.y,l.z),a.push(g,m)}for(var y=0;y<n;y++)for(var x=0;x<t;x++){var b=y*p+x,_=y*p+x+1,w=(y+1)*p+x+1,S=(y+1)*p+x;r.push(b,_,S),r.push(_,w,S)}this.setIndex(r),this.setAttribute("position",new an(i,3)),this.setAttribute("normal",new an(o,3)),this.setAttribute("uv",new an(a,2))}function xs(e,t,n){xa.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new ys(e,t,n)),this.mergeVertices()}ys.prototype=Object.create(gn.prototype),ys.prototype.constructor=ys,xs.prototype=Object.create(xa.prototype),xs.prototype.constructor=xs;var bs=function(e){function t(t,n,r,i){var o;return(o=e.call(this)||this).type="PlaneGeometry",o.parameters={width:t,height:n,widthSegments:r,heightSegments:i},o.fromBufferGeometry(new tr(t,n,r,i)),o.mergeVertices(),o}return he(t,e),t}(xa),_s=function(e){function t(t,n,r,i){var o;return(o=e.call(this)||this).type="PolyhedronGeometry",o.parameters={vertices:t,indices:n,radius:r,detail:i},o.fromBufferGeometry(new Ca(t,n,r,i)),o.mergeVertices(),o}return he(t,e),t}(xa),ws=function(e){function t(t,n,r,i,o,a){var s;(s=e.call(this)||this).type="RingBufferGeometry",s.parameters={innerRadius:t,outerRadius:n,thetaSegments:r,phiSegments:i,thetaStart:o,thetaLength:a},t=t||.5,n=n||1,o=void 0!==o?o:0,a=void 0!==a?a:2*Math.PI,r=void 0!==r?Math.max(3,r):8;for(var l=[],c=[],u=[],h=[],d=t,p=(n-t)/(i=void 0!==i?Math.max(1,i):1),f=new Se,m=new fe,v=0;v<=i;v++){for(var g=0;g<=r;g++){var y=o+g/r*a;f.x=d*Math.cos(y),f.y=d*Math.sin(y),c.push(f.x,f.y,f.z),u.push(0,0,1),m.x=(f.x/n+1)/2,m.y=(f.y/n+1)/2,h.push(m.x,m.y)}d+=p}for(var x=0;x<i;x++)for(var b=x*(r+1),_=0;_<r;_++){var w=_+b,S=w,M=w+r+1,T=w+r+2,E=w+1;l.push(S,M,E),l.push(M,T,E)}return s.setIndex(l),s.setAttribute("position",new an(c,3)),s.setAttribute("normal",new an(u,3)),s.setAttribute("uv",new an(h,2)),s}return he(t,e),t}(gn),Ss=function(e){function t(t,n,r,i,o,a){var s;return(s=e.call(this)||this).type="RingGeometry",s.parameters={innerRadius:t,outerRadius:n,thetaSegments:r,phiSegments:i,thetaStart:
10o,thetaLength:a},s.fromBufferGeometry(new ws(t,n,r,i,o,a)),s.mergeVertices(),s}return he(t,e),t}(xa),Ms=function(e){function t(t,n){var r;(r=e.call(this)||this).type="ShapeBufferGeometry",r.parameters={shapes:t,curveSegments:n},n=n||12;var i=[],o=[],a=[],s=[],l=0,c=0;if(!1===Array.isArray(t))h(t);else for(var u=0;u<t.length;u++)h(t[u]),r.addGroup(l,c,u),l+=c,c=0;function h(e){var t=o.length/3,r=e.extractPoints(n),l=r.shape,u=r.holes;!1===as.isClockWise(l)&&(l=l.reverse());for(var h=0,d=u.length;h<d;h++){var p=u[h];!0===as.isClockWise(p)&&(u[h]=p.reverse())}for(var f=as.triangulateShape(l,u),m=0,v=u.length;m<v;m++){var g=u[m];l=l.concat(g)}for(var y=0,x=l.length;y<x;y++){var b=l[y];o.push(b.x,b.y,0),a.push(0,0,1),s.push(b.x,b.y)}for(var _=0,w=f.length;_<w;_++){var S=f[_],M=S[0]+t,T=S[1]+t,E=S[2]+t;i.push(M,T,E),c+=3}}return r.setIndex(i),r.setAttribute("position",new an(o,3)),r.setAttribute("normal",new an(a,3)),r.setAttribute("uv",new an(s,2)),r}return he(t,e),t.prototype.toJSON=function(){var e=gn.prototype.toJSON.call(this);return function(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)},t}(gn);var Ts=function(e){function t(t,n){var i;return(i=e.call(this)||this).type="ShapeGeometry","object"===(0,r.default)(n)&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),n=n.curveSegments),i.parameters={shapes:t,curveSegments:n},i.fromBufferGeometry(new Ms(t,n)),i.mergeVertices(),i}return he(t,e),t.prototype.toJSON=function(){var e=xa.prototype.toJSON.call(this);return function(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)},t}(xa);var Es=function(e){function t(t,n,r,i,o,a,s){var l;(l=e.call(this)||this).type="SphereBufferGeometry",l.parameters={radius:t,widthSegments:n,heightSegments:r,phiStart:i,phiLength:o,thetaStart:a,thetaLength:s},t=t||1,n=Math.max(3,Math.floor(n)||8),r=Math.max(2,Math.floor(r)||6),i=void 0!==i?i:0,o=void 0!==o?o:2*Math.PI,a=void 0!==a?a:0,s=void 0!==s?s:Math.PI;for(var c=Math.min(a+s,Math.PI),u=0,h=[],d=new Se,p=new Se,f=[],m=[],v=[],g=[],y=0;y<=r;y++){var x=[],b=y/r,_=0;0==y&&0==a?_=.5/n:y==r&&c==Math.PI&&(_=-.5/n);for(var w=0;w<=n;w++){var S=w/n;d.x=-t*Math.cos(i+S*o)*Math.sin(a+b*s),d.y=t*Math.cos(a+b*s),d.z=t*Math.sin(i+S*o)*Math.sin(a+b*s),m.push(d.x,d.y,d.z),p.copy(d).normalize(),v.push(p.x,p.y,p.z),g.push(S+_,1-b),x.push(u++)}h.push(x)}for(var M=0;M<r;M++)for(var T=0;T<n;T++){var E=h[M][T+1],C=h[M][T],L=h[M+1][T],R=h[M+1][T+1];(0!==M||a>0)&&f.push(E,C,R),(M!==r-1||c<Math.PI)&&f.push(C,L,R)}return l.setIndex(f),l.setAttribute("position",new an(m,3)),l.setAttribute("normal",new an(v,3)),l.setAttribute("uv",new an(g,2)),l}return he(t,e),t}(gn),Cs=function(e){function t(t,n,r,i,o,a,s){var l;return(l=e.call(this)||this).type="SphereGeometry",l.parameters={radius:t,widthSegments:n,heightSegments:r,phiStart:i,phiLength:o,thetaStart:a,thetaLength:s},l.fromBufferGeometry(new Es(t,n,r,i,o,a,s)),l.mergeVertices(),l}return he(t,e),t}(xa),Ls=function(e){function t(t,n){var r;return(r=e.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,n)||this).type="TetrahedronBufferGeometry",r.parameters={radius:t,detail:n},r}return he(t,e),t}(Ca),Rs=function(e){function t(t,n){var r;return(r=e.call(this)||this).type="TetrahedronGeometry",r.parameters={radius:t,detail:n},r.fromBufferGeometry(new Ls(t,n)),r.mergeVertices(),r}return he(t,e),t}(xa),As=function(e){function t(t,n){var r,i=(n=n||{}).font;if(!i||!i.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new gn||de(r);var o=i.generateShapes(t,n.size);return n.depth=void 0!==n.height?n.height:50,void 0===n.bevelThickness&&(n.bevelThickness=10),void 0===n.bevelSize&&(n.bevelSize=8),void 0===n.bevelEnabled&&(n.bevelEnabled=!1),(r=e.call(this,o,n)||this).type="TextBufferGeometry",r}return he(t,e),t}(cs),Ps=function(e){function t(t,n){var r;return(r=e.call(this)||this).type="TextGeometry",r.parameters={text:t,parameters:n},r.fromBufferGeometry(new As(t,n)),r.mergeVertices(),r}return he(t,e),t}(xa),Is=function(e){function t(t,n,r,i,o){var a;(a=e.call(this)||this).type="TorusBufferGeometry",a.parameters={radiu
10s:t,tube:n,radialSegments:r,tubularSegments:i,arc:o},t=t||1,n=n||.4,r=Math.floor(r)||8,i=Math.floor(i)||6,o=o||2*Math.PI;for(var s=[],l=[],c=[],u=[],h=new Se,d=new Se,p=new Se,f=0;f<=r;f++)for(var m=0;m<=i;m++){var v=m/i*o,g=f/r*Math.PI*2;d.x=(t+n*Math.cos(g))*Math.cos(v),d.y=(t+n*Math.cos(g))*Math.sin(v),d.z=n*Math.sin(g),l.push(d.x,d.y,d.z),h.x=t*Math.cos(v),h.y=t*Math.sin(v),p.subVectors(d,h).normalize(),c.push(p.x,p.y,p.z),u.push(m/i),u.push(f/r)}for(var y=1;y<=r;y++)for(var x=1;x<=i;x++){var b=(i+1)*y+x-1,_=(i+1)*(y-1)+x-1,w=(i+1)*(y-1)+x,S=(i+1)*y+x;s.push(b,_,S),s.push(_,w,S)}return a.setIndex(s),a.setAttribute("position",new an(l,3)),a.setAttribute("normal",new an(c,3)),a.setAttribute("uv",new an(u,2)),a}return he(t,e),t}(gn),Os=function(e){function t(t,n,r,i,o){var a;return(a=e.call(this)||this).type="TorusGeometry",a.parameters={radius:t,tube:n,radialSegments:r,tubularSegments:i,arc:o},a.fromBufferGeometry(new Is(t,n,r,i,o)),a.mergeVertices(),a}return he(t,e),t}(xa),Ds=function(e){function t(t,n,r,i,o,a){var s;(s=e.call(this)||this).type="TorusKnotBufferGeometry",s.parameters={radius:t,tube:n,tubularSegments:r,radialSegments:i,p:o,q:a},t=t||1,n=n||.4,r=Math.floor(r)||64,i=Math.floor(i)||8,o=o||2,a=a||3;for(var l=[],c=[],u=[],h=[],d=new Se,p=new Se,f=new Se,m=new Se,v=new Se,g=new Se,y=new Se,x=0;x<=r;++x){var b=x/r*o*Math.PI*2;P(b,o,a,t,f),P(b+.01,o,a,t,m),g.subVectors(m,f),y.addVectors(m,f),v.crossVectors(g,y),y.crossVectors(v,g),v.normalize(),y.normalize();for(var _=0;_<=i;++_){var w=_/i*Math.PI*2,S=-n*Math.cos(w),M=n*Math.sin(w);d.x=f.x+(S*y.x+M*v.x),d.y=f.y+(S*y.y+M*v.y),d.z=f.z+(S*y.z+M*v.z),c.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),u.push(p.x,p.y,p.z),h.push(x/r),h.push(_/i)}}for(var T=1;T<=r;T++)for(var E=1;E<=i;E++){var C=(i+1)*(T-1)+(E-1),L=(i+1)*T+(E-1),R=(i+1)*T+E,A=(i+1)*(T-1)+E;l.push(C,L,A),l.push(L,R,A)}function P(e,t,n,r,i){var o=Math.cos(e),a=Math.sin(e),s=n/t*e,l=Math.cos(s);i.x=r*(2+l)*.5*o,i.y=r*(2+l)*a*.5,i.z=r*Math.sin(s)*.5}return s.setIndex(l),s.setAttribute("position",new an(c,3)),s.setAttribute("normal",new an(u,3)),s.setAttribute("uv",new an(h,2)),s}return he(t,e),t}(gn),Ns=function(e){function t(t,n,r,i,o,a,s){var l;return(l=e.call(this)||this).type="TorusKnotGeometry",l.parameters={radius:t,tube:n,tubularSegments:r,radialSegments:i,p:o,q:a},void 0!==s&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),l.fromBufferGeometry(new Ds(t,n,r,i,o,a)),l.mergeVertices(),l}return he(t,e),t}(xa),ks=function(e){function t(t,n,r,i,o){var a;(a=e.call(this)||this).type="TubeBufferGeometry",a.parameters={path:t,tubularSegments:n,radius:r,radialSegments:i,closed:o},n=n||64,r=r||1,i=i||8,o=o||!1;var s=t.computeFrenetFrames(n,o);a.tangents=s.tangents,a.normals=s.normals,a.binormals=s.binormals;var l=new Se,c=new Se,u=new fe,h=new Se,d=[],p=[],f=[],m=[];function v(e){h=t.getPointAt(e/n,h);for(var o=s.normals[e],a=s.binormals[e],u=0;u<=i;u++){var f=u/i*Math.PI*2,m=Math.sin(f),v=-Math.cos(f);c.x=v*o.x+m*a.x,c.y=v*o.y+m*a.y,c.z=v*o.z+m*a.z,c.normalize(),p.push(c.x,c.y,c.z),l.x=h.x+r*c.x,l.y=h.y+r*c.y,l.z=h.z+r*c.z,d.push(l.x,l.y,l.z)}}return function(){for(var e=0;e<n;e++)v(e);v(!1===o?n:0),function(){for(var e=0;e<=n;e++)for(var t=0;t<=i;t++)u.x=e/n,u.y=t/i,f.push(u.x,u.y)}(),function(){for(var e=1;e<=n;e++)for(var t=1;t<=i;t++){var r=(i+1)*(e-1)+(t-1),o=(i+1)*e+(t-1),a=(i+1)*e+t,s=(i+1)*(e-1)+t;m.push(r,o,s),m.push(o,a,s)}}()}(),a.setIndex(m),a.setAttribute("position",new an(d,3)),a.setAttribute("normal",new an(p,3)),a.setAttribute("uv",new an(f,2)),a}return he(t,e),t.prototype.toJSON=function(){var e=gn.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},t}(gn),zs=function(e){function t(t,n,r,i,o,a){var s;(s=e.call(this)||this).type="TubeGeometry",s.parameters={path:t,tubularSegments:n,radius:r,radialSegments:i,closed:o},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var l=new ks(t,n,r,i,o);return s.tangents=l.tangents,s.normals=l.normals,s.binormals=l.binormals,s.fromBufferGeometry(l),s.mergeVertices(),s}return he(t,e),t}(xa),Bs=function(e){function t(t){var n;(n=e.call(this)||this).type="WireframeGeometry";var r=[],i=[0,0],o={},a=["a","b","c"];if(t&&t.isGeometry){for(var s=t.faces,l=0,c=s.length;l<c;l++)for(var u=s[l],h=0;h<3;h++){var d=u[a[h]],p=u[a[(h+1)%3]];i[0]=Math.min(d,p),i[1]=Math.max(d,p);var f=i[0]+","+i[1];void 0===o[f]&&(o[f]={index1:i[0],index2:i[1]})}for(var m in o){var v=o[m],g=t.vertices[v.index1];r.push(g.x,g.y,g.z),g=t.vertices[v.index2],r.push(g.x,g.y,g.z)}}else if(t&&t.isBufferGeometry){var y=new Se;if(null!==t.index){var x=t.attributes.position,b=t.index,_=t.groups;0===_.length&&(_=[{start:0,count:b.count,materialIndex:0}]);for(var w=0,S=_.length;w<S;++w)for(var M=_[w],T=M.start,E=T,C=T+M.count;E<C;E+=3)for(var L=0;L<3;L++){var R=b.getX(E+L),A=b.getX(E+(L+1)%3);
10i[0]=Math.min(R,A),i[1]=Math.max(R,A);var P=i[0]+","+i[1];void 0===o[P]&&(o[P]={index1:i[0],index2:i[1]})}for(var I in o){var O=o[I];y.fromBufferAttribute(x,O.index1),r.push(y.x,y.y,y.z),y.fromBufferAttribute(x,O.index2),r.push(y.x,y.y,y.z)}}else for(var D=t.attributes.position,N=0,k=D.count/3;N<k;N++)for(var z=0;z<3;z++){var B=3*N+z;y.fromBufferAttribute(D,B),r.push(y.x,y.y,y.z);var F=3*N+(z+1)%3;y.fromBufferAttribute(D,F),r.push(y.x,y.y,y.z)}}return n.setAttribute("position",new an(r,3)),n}return he(t,e),t}(gn),Fs=Object.freeze({__proto__:null,BoxGeometry:ba,BoxBufferGeometry:Bn,CircleGeometry:wa,CircleBufferGeometry:_a,ConeGeometry:Ta,ConeBufferGeometry:Ea,CylinderGeometry:Ma,CylinderBufferGeometry:Sa,DodecahedronGeometry:Ra,DodecahedronBufferGeometry:La,EdgesGeometry:Da,ExtrudeGeometry:hs,ExtrudeBufferGeometry:cs,IcosahedronGeometry:ps,IcosahedronBufferGeometry:ds,LatheGeometry:ms,LatheBufferGeometry:fs,OctahedronGeometry:gs,OctahedronBufferGeometry:vs,ParametricGeometry:xs,ParametricBufferGeometry:ys,PlaneGeometry:bs,PlaneBufferGeometry:tr,PolyhedronGeometry:_s,PolyhedronBufferGeometry:Ca,RingGeometry:Ss,RingBufferGeometry:ws,ShapeGeometry:Ts,ShapeBufferGeometry:Ms,SphereGeometry:Cs,SphereBufferGeometry:Es,TetrahedronGeometry:Rs,TetrahedronBufferGeometry:Ls,TextGeometry:Ps,TextBufferGeometry:As,TorusGeometry:Os,TorusBufferGeometry:Is,TorusKnotGeometry:Ns,TorusKnotBufferGeometry:Ds,TubeGeometry:zs,TubeBufferGeometry:ks,WireframeGeometry:Bs});function Gs(e){qt.call(this),this.type="ShadowMaterial",this.color=new Vt(0),this.transparent=!0,this.setValues(e)}function Hs(e){Un.call(this,e),this.type="RawShaderMaterial"}function Us(e){qt.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Vt(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 Vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new fe(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.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(e)}function Ws(e){Us.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new fe(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(e){this.reflectivity=le.clamp(2.5*(e-1)/(e+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.setValues(e)}function Vs(e){qt.call(this),this.type="MeshPhongMaterial",this.color=new Vt(16777215),this.specular=new Vt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function js(e){qt.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Vt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new fe(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.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Xs(e){qt.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function qs(e){qt.call(this),this.type="MeshLambertMaterial",this.color=new Vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Ys(e){qt.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Vt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Ks(e){qo.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}Gs.prototype=Object.create(qt.prototype),Gs.prototype.constructor=Gs,Gs.prototype.isShadowMaterial=!0,Gs.prototype.copy=function(e){return qt.prototype.copy.call(this,e),this.color.copy(e.color),this},Hs.prototype=Object.create(Un.prototype),Hs.prototype.constructor=Hs,Hs.prototype.isRawShaderMaterial=!0,Us.prototype=Object.create(qt.prototype),Us.prototype.constructor=Us,Us.prototype.isMeshStandardMaterial=!0,Us.prototype.copy=function(e){return qt.prototype.copy.call(this,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.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.vertexTangents=e.vertexTangents,this},Ws.prototype=Object.create(Us.prototype),Ws.prototype.constructor=Ws,Ws.prototype.isMeshPhysicalMaterial=!0,Ws.prototype.copy=function(e){return Us.prototype.copy.call(this,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.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new Vt).copy(e.sheen):this.sheen=null,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this},Vs.prototype=Object.create(qt.prototype),Vs.prototype.constructor=Vs,Vs.prototype.isMeshPhongMaterial=!0,Vs.prototype.copy=function(e){return qt.prototype.copy.call(this,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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},js.prototype=Object.create(qt.prototype),js.prototype.constructor=js,js.prototype.isMeshToonMaterial=!0,js.prototype.copy=function(e){return qt.prototype.copy.call(this,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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Xs.prototype=Object.create(qt.prototype),Xs.prototype.constructor=Xs,Xs.prototype.isMeshNormalMaterial=!0,Xs.prototype.copy=function(e){return qt.prototype.copy.call(this,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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},qs.prototype=Object.create(qt.prototype),qs.prototype.constructor=qs,qs.prototype.isMeshLambertMaterial=!0,qs.prototype.copy=function(e){return qt.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Ys.prototype=Object.create(qt.prototype),Ys.prototype.constructor=Ys,Ys.prototype.isMeshMat
10capMaterial=!0,Ys.prototype.copy=function(e){return qt.prototype.copy.call(this,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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Ks.prototype=Object.create(qo.prototype),Ks.prototype.constructor=Ks,Ks.prototype.isLineDashedMaterial=!0,Ks.prototype.copy=function(e){return qo.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Zs=Object.freeze({__proto__:null,ShadowMaterial:Gs,SpriteMaterial:fo,RawShaderMaterial:Hs,ShaderMaterial:Un,PointsMaterial:ia,MeshPhysicalMaterial:Ws,MeshStandardMaterial:Us,MeshPhongMaterial:Vs,MeshToonMaterial:js,MeshNormalMaterial:Xs,MeshLambertMaterial:qs,MeshDepthMaterial:qi,MeshDistanceMaterial:Yi,MeshBasicMaterial:Yt,MeshMatcapMaterial:Ys,LineDashedMaterial:Ks,LineBasicMaterial:qo,Material:qt}),Js={arraySlice:function(e,t,n){return Js.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),r=0;r!==t;++r)n[r]=r;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),o=0,a=0;a!==r;++o)for(var s=n[o]*t,l=0;l!==t;++l)i[a++]=e[s+l];return i},flattenJSON:function(e,t,n,r){for(var i=1,o=e[0];void 0!==o&&void 0===o[r];)o=e[i++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[r])&&(t.push(o.time),n.push.apply(n,a)),o=e[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[r])&&(t.push(o.time),a.toArray(n,n.length)),o=e[i++]}while(void 0!==o);else do{void 0!==(a=o[r])&&(t.push(o.time),n.push(a)),o=e[i++]}while(void 0!==o)}},subclip:function(e,t,n,r,i){i=i||30;var o=e.clone();o.name=t;for(var a=[],s=0;s<o.tracks.length;++s){for(var l=o.tracks[s],c=l.getValueSize(),u=[],h=[],d=0;d<l.times.length;++d){var p=l.times[d]*i;if(!(p<n||p>=r)){u.push(l.times[d]);for(var f=0;f<c;++f)h.push(l.values[d*c+f])}}0!==u.length&&(l.times=Js.convertArray(u,l.times.constructor),l.values=Js.convertArray(h,l.values.constructor),a.push(l))}o.tracks=a;for(var m=1/0,v=0;v<o.tracks.length;++v)m>o.tracks[v].times[0]&&(m=o.tracks[v].times[0]);for(var g=0;g<o.tracks.length;++g)o.tracks[g].shift(-1*m);return o.resetDuration(),o},makeClipAdditive:function(e,t,n,r){void 0===t&&(t=0),void 0===n&&(n=e),(void 0===r||r<=0)&&(r=30);for(var i=n.tracks.length,o=t/r,a=function(t){var r=n.tracks[t],i=r.ValueTypeName;if("bool"===i||"string"===i)return"continue";var a=e.tracks.find((function(e){return e.name===r.name&&e.ValueTypeName===i}));if(void 0===a)return"continue";var s=0,l=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=l/3);var c=0,u=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=u/3);var h=r.times.length-1,d=void 0;if(o<=r.times[0]){var p=s,f=l-s;d=Js.arraySlice(r.values,p,f)}else if(o>=r.times[h]){var m=h*l+s,v=m+l-s;d=Js.arraySlice(r.values,m,v)}else{var g=r.createInterpolant(),y=s,x=l-s;g.evaluate(o),d=Js.arraySlice(g.resultBuffer,y,x)}"quaternion"===i&&(new we).fromArray(d).normalize().conjugate().toArray(d);for(var b=a.times.length,_=0;_<b;++_){var w=_*u+c;if("quaternion"===i)we.multiplyQuaternionsFlat(a.values,w,d,0,a.values,w);else for(var S=u-2*c,M=0;M<S;++M)a.values[w+M]-=d[M]}},s=0;s<i;++s)a(s);return e.blendMode=X,e}};function Qs(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function $s(e,t,n,r){Qs.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function el(e,t,n,r){Qs.call(this,e,t,n,r)}function tl(e,t,n,r){Qs.call(this,e,t,n,r)}function nl(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Js.convertArray(t,this.TimeBufferType),this.values=Js.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function rl(e,t,n){nl.call(this,e,t,n)}function il(e,t,n,r){nl.call(this,e,t,n,r)}function ol(e,t,n,r){nl.call(this,e,t,n,r)}function al(e,t,n,r){Qs.call(this,e,t,n,r)}function sl(e,t,n,r){nl.call(this,e,t,n,r)}function ll(e,t,n,r){nl.call(this,e,t,n,r)}function cl(e,t,n,r){nl.call(this,e,t,n,r)}function ul(e,t,n,r){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.blendMode=void 0!==r?r:j,this.uuid=le.generateUUID(),this.duration<0&&this.resetDuration()}function hl(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ol;
vendor: 12,928 bytes, line 10
10case"vector":case"vector2":case"vector3":case"vector4":return cl;case"color":return il;case"quaternion":return sl;case"bool":case"boolean":return rl;case"string":return ll}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){var n=[],r=[];Js.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}Object.assign(Qs.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var o;n:{r:if(!(e<r)){for(var a=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===a)break;if(i=r,e<(r=t[++n]))break t}o=t.length;break n}if(e>=i)break e;var s=t[1];e<s&&(n=2,i=s);for(var l=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===l)break;if(r=i,e>=(i=t[--n-1]))break t}o=n,n=0}for(;n<o;){var c=n+o>>>1;e<t[c]?o=c:n=c+1}if(r=t[n],void 0===(i=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,o=0;o!==r;++o)t[o]=n[i+o];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Qs.prototype,{beforeStart_:Qs.prototype.copySampleValue_,afterEnd_:Qs.prototype.copySampleValue_}),$s.prototype=Object.assign(Object.create(Qs.prototype),{constructor:$s,DefaultSettings_:{endingStart:U,endingEnd:U},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,o=e+1,a=r[i],s=r[o];if(void 0===a)switch(this.getSettings_().endingStart){case W:i=e,a=2*t-n;break;case V:a=t+r[i=r.length-2]-r[i+1];break;default:i=e,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case W:o=e,s=2*n-t;break;case V:o=1,s=n+r[1]-r[0];break;default:o=e-1,s=t}var l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-a),this._weightNext=l/(s-n),this._offsetPrev=i*c,this._offsetNext=o*c},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,l=s-a,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-t)/(r-t),f=p*p,m=f*p,v=-h*m+2*h*f-h*p,g=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f,b=0;b!==a;++b)i[b]=v*o[c+b]+g*o[l+b]+y*o[s+b]+x*o[u+b];return i}}),el.prototype=Object.assign(Object.create(Qs.prototype),{constructor:el,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,l=s-a,c=(n-t)/(r-t),u=1-c,h=0;h!==a;++h)i[h]=o[l+h]*u+o[s+h]*c;return i}}),tl.prototype=Object.assign(Object.create(Qs.prototype),{constructor:tl,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(nl,{toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:Js.convertArray(e.times,Array),values:Js.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}}),Object.assign(nl.prototype,{constructor:nl,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:G,InterpolantFactoryMethodDiscrete:function(e){return new tl(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new el(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new $s(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case F:t=this.InterpolantFactoryMethodDiscrete;break;case G:t=this.InterpolantFactoryMethodLinear;break;case H:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return F;case this.InterpolantFactoryMethodLinear:return G;case this.InterpolantFactoryMethodSmooth:return H}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,i=0,o=r-1;i!==r&&n[i]<e;)++i;for(;-1!==o&&n[o]>t;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=Js.arraySlice(n,i,o),this.values=Js.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),e=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),e=!1;break}o=s}if(void 0!==r&&Js.isTypedArray(r))for(var l=0,c=r.length;l!==c;++l){var u=r[l];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,u),e=!1;break}}return e},optimize:function(){for(var e=Js.arraySlice(this.times),t=Js.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===H,i=e.length-1,o=1,a=1;a<i;++a){var s=!1,l=e[a];if(l!==e[a+1]&&(1!==a||l!==l[0]))if(r)s=!0;else for(var c=a*n,u=c-n,h=c+n,d=0;d!==n;++d){var p=t[c+d];if(p!==t[u+d]||p!==t[h+d]){s=!0;break}}if(s){if(a!==o){e[o]=e[a];for(var f=a*n,m=o*n,v=0;v!==n;++v)t[m+v]=t[f+v]}++o}}if(i>0){e[o]=e[i];for(var g=i*n,y=o*n,x=0;x!==n;++x)t[y+x]=t[g+x];++o}return o!==e.length?(this.times=Js.arraySlice(e,0,o),this.values=Js.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this},clone:function(){var e=Js.arraySlice(this.times,0),t=Js.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),rl.prototype=Object.assign(Object.create(nl.prototype),{constructor:rl,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:F,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),il.prototype=Object.assign(Object.create(nl.prototype),{constructor:il,ValueTypeName:"color"}),ol.prototype=Object.assign(Object.create(nl.prototype),{constructor:ol,ValueTypeName:"number"}),al.prototype=Object.assign(Object.create(Qs.prototype),{constructor:al,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(n-t)/(r-t),l=e*a,c=l+a;l!==c;l+=4)we.slerpFlat(i,0,o,l-a,o,l,s);return i}}),sl.prototype=Object.assign(Object.create(nl.prototype),{constructor:sl,ValueTypeName:"quaternion",DefaultInterpolation:G,InterpolantFactoryMethodLinear:function(e){return new al(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),ll.prototype=Object.assign(Object.create(nl.prototype),{constructor:ll,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:F,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),cl.prototype=Object.assign(Object.create(nl.prototype),{constructor:cl,ValueTypeName:"vector"}),Object.assign(ul,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,o=n.length;i!==o;++i)t.push(hl(n[i]).scale(r));return new ul(e.name,e.duration,t,e.blendMode)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode},i=0,o=n.length;i!==o;++i)t.push(nl.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,o=[],a=0;a<i;a++){var s=[],l=[];s.push((a+i-1)%i,a,(a+1)%i),l.push(0,1,0);var c=Js.getKeyframeOrder(s);s=Js.sortedArray(s,1,c),l=Js.sortedArray(l,1,c),r||0!==s[0]||(s.push(i),l.push(l[0])),o.push(new ol(".morphTargetInfluences["+t[a].name+"]",s,l).scale(1/n))}return new ul(e,-1,o)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,o=0,a=e.length;o<a;o++){var s=e[o],l=s.name.match(i);if(l&&l.length>1){var c=l[1],u=r[c];u||(r[c]=u=[]),u.push(s)}}var h=[];for(var d in r)h.push(ul.CreateFromMorphTargetSequence(d,r[d],t,n));return h},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var o=[],a=[];Js.flattenJSON(n,o,a,r),0!==o.length&&i.push(new e(t,o,a))}},r=[],i=e.name||"default",o=e.fps||30,a=e.blendMode,s=e.length||-1,l=e.hierarchy||[],c=0;c<l.length;c++){var u=l[c].keys;if(u&&0!==u.length)if(u[0].morphTargets){var h={},d=void 0;for(d=0;d<u.length;d++)if(u[d].morphTargets)for(var p=0;p<u[d].morphTargets.length;p++)h[u[d].morphTargets[p]]=-1;for(var f in h){for(var m=[],v=[],g=0;g!==u[d].morphTargets.length;++g){var y=u[d];m.push(y.time),v.push(y.morphTarget===f?1:0)}r.push(new ol(".morphTargetInfluence["+f+"]",m,v))}s=h.length*(o||1)}else{var x=".bones["+t[c].name+"]";n(cl,x+".position",u,"pos",r),n(sl,x+".quaternion",u,"rot",r),n(cl,x+".scale",u,"scl",r)}}return 0===r.length?null:new ul(i,s,r,a)}}),Object.assign(ul.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new ul(this.name,this.duration,e,this.blendMode)}});var dl={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={}}};function pl(e,t,n){var r=this,i=!1,o=0,a=0,s=void 0,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){a++,!1===i&&void 0!==r.onStart&&r.onStart(e,o,a),i=!0},this.itemEnd=function(e){o++,void 0!==r.onProgress&&r.onProgress(e,o,a),o===a&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){var t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=l.length;t<n;t+=2){var r=l[t],i=l[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return i}return null}}var fl=new pl;function ml(e){this.manager=void 0!==e?e:fl,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}Object.assign(ml.prototype,{load:function(){},loadAsync:function(e,t){var n=this;return new Promise((function(r,i){n.load(e,r,t,i)}))},parse:function(){},setCrossOrigin:function(e){return this.crossOrigin=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}});var vl={};function gl(e){ml.call(this,e)}function yl(e){ml.call(this,e)}function xl(e){ml.call(this,e)}function bl(e){ml.call(this,e)}function _l(e){ml.call(this,e)}function wl(e){ml.call(this,e)}function Sl(e){ml.call(this,e)}function Ml(){this.type="Curve",this.arcLengthDivisions=200}function Tl(e,t,n,r,i,o,a,s){Ml.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function El(e,t,n,r,i,o){Tl.call(this,e,t,n,n,r,i,o),this.type="ArcCurve"}function Cl(){var e=0,t=0,n=0,r=0;function i(i,o,a,s){e=i,t=a,n=-3*i+3*o-2*a-s,r=2*i-2*o+a+s}return{initCatmullRom:function(e,t,n,r,o){i(t,n,o*(n-e),o*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,o,a,s){var l=(t-e)/o-(n-e)/(o+a)+(n-t)/a,c=(n-t)/a-(r-t)/(a+s)+(r-n)/s;i(t,n,l*=a,c*=a)},calc:function(i){var o=i*i;
10return e+t*i+n*o+r*(o*i)}}}gl.prototype=Object.assign(Object.create(ml.prototype),{constructor:gl,load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,o=dl.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;if(void 0===vl[e]){var a,s=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(s){var l=s[1],c=!!s[2],u=s[3];u=decodeURIComponent(u),c&&(u=atob(u));try{var h,d=(this.responseType||"").toLowerCase();switch(d){case"arraybuffer":case"blob":for(var p=new Uint8Array(u.length),f=0;f<u.length;f++)p[f]=u.charCodeAt(f);h="blob"===d?new Blob([p.buffer],{type:l}):p.buffer;break;case"document":var m=new DOMParser;h=m.parseFromString(u,l);break;case"json":h=JSON.parse(u);break;default:h=u}setTimeout((function(){t&&t(h),i.manager.itemEnd(e)}),0)}catch(t){setTimeout((function(){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}),0)}}else{for(var v in vl[e]=[],vl[e].push({onLoad:t,onProgress:n,onError:r}),(a=new XMLHttpRequest).open("GET",e,!0),a.addEventListener("load",(function(t){var n=this.response,r=vl[e];if(delete vl[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),dl.add(e,n);for(var o=0,a=r.length;o<a;o++){var s=r[o];s.onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else{for(var l=0,c=r.length;l<c;l++){var u=r[l];u.onError&&u.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}}),!1),a.addEventListener("progress",(function(t){for(var n=vl[e],r=0,i=n.length;r<i;r++){var o=n[r];o.onProgress&&o.onProgress(t)}}),!1),a.addEventListener("error",(function(t){var n=vl[e];delete vl[e];for(var r=0,o=n.length;r<o;r++){var a=n[r];a.onError&&a.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),!1),a.addEventListener("abort",(function(t){var n=vl[e];delete vl[e];for(var r=0,o=n.length;r<o;r++){var a=n[r];a.onError&&a.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),!1),void 0!==this.responseType&&(a.responseType=this.responseType),void 0!==this.withCredentials&&(a.withCredentials=this.withCredentials),a.overrideMimeType&&a.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)a.setRequestHeader(v,this.requestHeader[v]);a.send(null)}return i.manager.itemStart(e),a}vl[e].push({onLoad:t,onProgress:n,onError:r})},setResponseType:function(e){return this.responseType=e,this},setMimeType:function(e){return this.mimeType=e,this}}),yl.prototype=Object.assign(Object.create(ml.prototype),{constructor:yl,load:function(e,t,n,r){var i=this,o=new gl(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var r=ul.parse(e[n]);t.push(r)}return t}}),xl.prototype=Object.assign(Object.create(ml.prototype),{constructor:xl,load:function(e,t,n,r){var i=this,o=[],a=new da;a.image=o;var s=new gl(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(i.withCredentials);var l=0;function c(c){s.load(e[c],(function(e){var n=i.parse(e,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(l+=1)&&(1===n.mipmapCount&&(a.minFilter=v),a.format=n.format,a.needsUpdate=!0,t&&t(a))}),n,r)}if(Array.isArray(e))for(var u=0,h=e.length;u<h;++u)c(u);else s.load(e,(function(e){var n=i.parse(e,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){o[s]={mipmaps:[]};for(var l=0;l<n.mipmapCount;l++)o[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+l]),o[s].format=n.format,o[s].width=n.width,o[s].height=n.height}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=v),a.format=n.format,a.needsUpdate=!0,t&&t(a)}),n,r);return a}}),bl.prototype=Object.assign(Object.create(ml.prototype),{constructor:bl,load:function(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,o=dl.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;var a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){a.removeEventListener("load",s,!1),a.removeEventListener("error",l,!1),dl.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){a.removeEventListener("load",s,!1),a.removeEventListener("error",l,!1),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}return a.addEventListener("load",s,!1),a.addEventListener("error",l,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(e),a.src=e,a}}),_l.prototype=Object.assign(Object.create(ml.prototype),{constructor:_l,load:function(e,t,n,r){var i=new qn,o=new bl(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;function s(n){o.load(e[n],(function(e){i.images[n]=e,6===++a&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(var l=0;l<e.length;++l)s(l);return i}}),wl.prototype=Object.assign(Object.create(ml.prototype),{constructor:wl,load:function(e,t,n,r){var i=this,o=new Kn,a=new gl(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(i.withCredentials),a.load(e,(function(e){var n=i.parse(e);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:h,o.wrapT=void 0!==n.wrapT?n.wrapT:h,o.magFilter=void 0!==n.magFilter?n.magFilter:v,o.minFilter=void 0!==n.minFilter?n.minFilter:v,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(o.format=n.format),void 0!==n.t
10ype&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps,o.minFilter=y),1===n.mipmapCount&&(o.minFilter=v),o.needsUpdate=!0,t&&t(o,n))}),n,r),o}}),Sl.prototype=Object.assign(Object.create(ml.prototype),{constructor:Sl,load:function(e,t,n,r){var i=new ye,o=new bl(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,(function(n){i.image=n;var r=e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);i.format=r?T:E,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}),Object.assign(Ml.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n=[],r=this.getPoint(0),i=0;n.push(0);for(var o=1;o<=e;o++)i+=(t=this.getPoint(o/e)).distanceTo(r),n.push(i),r=t;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,o=r.length;n=t||e*r[o-1];for(var a,s=0,l=o-1;s<=l;)if((a=r[i=Math.floor(s+(l-s)/2)]-n)<0)s=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(r[i=l]===n)return i/(o-1);var c=r[i];return(i+(n-c)/(r[i+1]-c))/(o-1)},getTangent:function(e,t){var n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);var o=this.getPoint(r),a=this.getPoint(i),s=t||(o.isVector2?new fe:new Se);return s.copy(a).sub(o).normalize(),s},getTangentAt:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){for(var n=new Se,r=[],i=[],o=[],a=new Se,s=new Je,l=0;l<=e;l++){var c=l/e;r[l]=this.getTangentAt(c,new Se),r[l].normalize()}i[0]=new Se,o[0]=new Se;var u=Number.MAX_VALUE,h=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=u&&(u=h,n.set(1,0,0)),d<=u&&(u=d,n.set(0,1,0)),p<=u&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),o[0].crossVectors(r[0],i[0]);for(var f=1;f<=e;f++){if(i[f]=i[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(r[f-1],r[f]),a.length()>Number.EPSILON){a.normalize();var m=Math.acos(le.clamp(r[f-1].dot(r[f]),-1,1));i[f].applyMatrix4(s.makeRotationAxis(a,m))}o[f].crossVectors(r[f],i[f])}if(!0===t){var v=Math.acos(le.clamp(i[0].dot(i[e]),-1,1));v/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(v=-v);for(var g=1;g<=e;g++)i[g].applyMatrix4(s.makeRotationAxis(r[g],v*g)),o[g].crossVectors(r[g],i[g])}return{tangents:r,normals:i,binormals:o}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),Tl.prototype=Object.create(Ml.prototype),Tl.prototype.constructor=Tl,Tl.prototype.isEllipseCurve=!0,Tl.prototype.getPoint=function(e,t){for(var n=t||new fe,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=o?0:r),!0!==this.aClockwise||o||(i===r?i=-r:i-=r);var a=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var c=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,d=l-this.aY;s=h*c-d*u+this.aX,l=h*u+d*c+this.aY}return n.set(s,l)},Tl.prototype.copy=function(e){return Ml.prototype.copy.call(this,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},Tl.prototype.toJSON=function(){var e=Ml.prototype.toJSON.call(this);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},Tl.prototype.fromJSON=function(e){return Ml.prototype.fromJSON.call(this,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},El.prototype=Object.create(Tl.prototype),El.prototype.constructor=El,El.prototype.isArcCurve=!0;var Ll=new Se,Rl=new Cl,Al=new Cl,Pl=new Cl;function Il(e,t,n,r){Ml.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=void 0!==r?r:.5}function Ol(e,t,n,r,i){var o=.5*(r-t),a=.5*(i-n),s=e*e;
vendor: 22,389 bytes, line 10
10return(2*n-2*r+o+a)*(e*s)+(-3*n+3*r-2*o-a)*s+o*e+n}function Dl(e,t,n,r){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function Nl(e,t,n,r,i){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}function kl(e,t,n,r){Ml.call(this),this.type="CubicBezierCurve",this.v0=e||new fe,this.v1=t||new fe,this.v2=n||new fe,this.v3=r||new fe}function zl(e,t,n,r){Ml.call(this),this.type="CubicBezierCurve3",this.v0=e||new Se,this.v1=t||new Se,this.v2=n||new Se,this.v3=r||new Se}function Bl(e,t){Ml.call(this),this.type="LineCurve",this.v1=e||new fe,this.v2=t||new fe}function Fl(e,t){Ml.call(this),this.type="LineCurve3",this.v1=e||new Se,this.v2=t||new Se}function Gl(e,t,n){Ml.call(this),this.type="QuadraticBezierCurve",this.v0=e||new fe,this.v1=t||new fe,this.v2=n||new fe}function Hl(e,t,n){Ml.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new Se,this.v1=t||new Se,this.v2=n||new Se}function Ul(e){Ml.call(this),this.type="SplineCurve",this.points=e||[]}Il.prototype=Object.create(Ml.prototype),Il.prototype.constructor=Il,Il.prototype.isCatmullRomCurve3=!0,Il.prototype.getPoint=function(e,t){var n,r,i=t||new Se,o=this.points,a=o.length,s=(a-(this.closed?0:1))*e,l=Math.floor(s),c=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/a)+1)*a:0===c&&l===a-1&&(l=a-2,c=1),this.closed||l>0?n=o[(l-1)%a]:(Ll.subVectors(o[0],o[1]).add(o[0]),n=Ll);var u=o[l%a],h=o[(l+1)%a];if(this.closed||l+2<a?r=o[(l+2)%a]:(Ll.subVectors(o[a-1],o[a-2]).add(o[a-1]),r=Ll),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(n.distanceToSquared(u),d),f=Math.pow(u.distanceToSquared(h),d),m=Math.pow(h.distanceToSquared(r),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),Rl.initNonuniformCatmullRom(n.x,u.x,h.x,r.x,p,f,m),Al.initNonuniformCatmullRom(n.y,u.y,h.y,r.y,p,f,m),Pl.initNonuniformCatmullRom(n.z,u.z,h.z,r.z,p,f,m)}else"catmullrom"===this.curveType&&(Rl.initCatmullRom(n.x,u.x,h.x,r.x,this.tension),Al.initCatmullRom(n.y,u.y,h.y,r.y,this.tension),Pl.initCatmullRom(n.z,u.z,h.z,r.z,this.tension));return i.set(Rl.calc(c),Al.calc(c),Pl.calc(c)),i},Il.prototype.copy=function(e){Ml.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Il.prototype.toJSON=function(){var e=Ml.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},Il.prototype.fromJSON=function(e){Ml.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new Se).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},kl.prototype=Object.create(Ml.prototype),kl.prototype.constructor=kl,kl.prototype.isCubicBezierCurve=!0,kl.prototype.getPoint=function(e,t){var n=t||new fe,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Nl(e,r.x,i.x,o.x,a.x),Nl(e,r.y,i.y,o.y,a.y)),n},kl.prototype.copy=function(e){return Ml.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},kl.prototype.toJSON=function(){var e=Ml.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},kl.prototype.fromJSON=function(e){return Ml.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},zl.prototype=Object.create(Ml.prototype),zl.prototype.constructor=zl,zl.prototype.isCubicBezierCurve3=!0,zl.prototype.getPoint=function(e,t){var n=t||new Se,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Nl(e,r.x,i.x,o.x,a.x),Nl(e,r.y,i.y,o.y,a.y),Nl(e,r.z,i.z,o.z,a.z)),n},zl.prototype.copy=function(e){return Ml.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},zl.prototype.toJSON=function(){var e=Ml.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},zl.prototype.fromJSON=function(e){return Ml.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Bl.prototype=Object.create(Ml.prototype),Bl.prototype.constructor=Bl,Bl.prototype.isLineCurve=!0,Bl.prototype.getPoint=function(e,t){var n=t||new fe;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Bl.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Bl.prototype.getTangent=function(e,t){var n=t||new fe;return n.copy(this.v2).sub(this.v1).normalize(),n},Bl.prototype.copy=function(e){return Ml.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Bl.prototype.toJSON=function(){var e=Ml.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Bl.prototype.fromJSON=function(e){return Ml.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Fl.prototype=Object.create(Ml.prototype),Fl.prototype.constructor=Fl,Fl.prototype.isLineCurve3=!0,Fl.prototype.getPoint=function(e,t){var n=t||new Se;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Fl.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Fl.prototype.copy=function(e){return Ml.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Fl.prototype.toJSON=function(){var e=Ml.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Fl.prototype.fromJSON=function(e){return Ml.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Gl.prototype=Object.create(Ml.prototype),Gl.prototype.constructor=Gl,Gl.prototype.isQuadraticBezierCurve=!0,Gl.prototype.getPoint=function(e,t){var n=t||new fe,r=this.v0,i=this.v1,o=this.v2;return n.set(Dl(e,r.x,i.x,o.x),Dl(e,r.y,i.y,o.y)),n},Gl.prototype.copy=function(e){return Ml.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Gl.prototype.toJSON=function(){var e=Ml.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Gl.prototype.fromJSON=function(e){return Ml.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Hl.prototype=Object.create(Ml.prototype),Hl.prototype.constructor=Hl,Hl.prototype.isQuadraticBezierCurve3=!0,Hl.prototype.getPoint=function(e,t){var n=t||new Se,r=this.v0,i=this.v1,o=this.v2;return n.set(Dl(e,r.x,i.x,o.x),Dl(e,r.y,i.y,o.y),Dl(e,r.z,i.z,o.z)),n},Hl.prototype.copy=function(e){return Ml.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Hl.prototype.toJSON=function(){var e=Ml.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Hl.prototype.fromJSON=function(e){return Ml.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Ul.prototype=Object.create(Ml.prototype),Ul.prototype.constructor=Ul,Ul.prototype.isSplineCurve=!0,Ul.prototype.getPoint=function(e,t){var n=t||new fe,r=this.points,i=(r.length-1)*e,o=Math.floor(i),a=i-o,s=r[0===o?o:o-1],l=r[o],c=r[o>r.length-2?r.length-1:o+1],u=r[o>r.length-3?r.length-1:o+2];return n.set(Ol(a,s.x,l.x,c.x,u.x),Ol(a,s.y,l.y,c.y,u.y)),n},Ul.prototype.copy=function(e){Ml.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},Ul.prototype.toJSON=function(){var e=Ml.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},Ul.prototype.fromJSON=function(e){Ml.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new fe).fromArray(r))}return this};var Wl=Object.freeze({__proto__:null,ArcCurve:El,CatmullRomCurve3:Il,CubicBezierCurve:kl,CubicBezierCurve3:zl,EllipseCurve:Tl,LineCurve:Bl,LineCurve3:Fl,QuadraticBezierCurve:Gl,QuadraticBezierCurve3:Hl,SplineCurve:Ul});function Vl(){Ml.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function jl(e){Vl.call(this),this.type="Path",this.currentPoint=new fe,e&&this.setFromPoints(e)}function Xl(e){jl.call(this,e),this.uuid=le.generateUUID(),this.type="Shape",this.holes=[]}function ql(e,t){wt.call(this),this.type="Light",this.color=new Vt(e),this.intensity=void 0!==t?t:1}function Yl(e,t,n){ql.call(this,e,n),this.type="HemisphereLight",this.position.copy(wt.DefaultUp),this.updateMatrix(),this.groundColor=new Vt(t)}function Kl(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new fe(512,512),this.map=null,this.mapPass=null,this.matrix=new Je,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Qn,this._frameExtents=new fe(1,1),this._viewportCount=1,this._viewports=[new xe(0,0,1,1)]}function Zl(){Kl.call(this,new Vn(50,1,.5,500)),this.focus=1}function Jl(e,t,n,r,i,o){ql.call(this,e,t),this.type="SpotLight",this.position.copy(wt.DefaultUp),this.updateMatrix(),this.target=new wt,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==o?o:1,this.shadow=new Zl}function Ql(){Kl.call(this,new Vn(90,1,.5,500)),this._frameExtents=new fe(4,2),this._viewportCount=6,this._viewports=[new xe(2,1,1,1),new xe(0,1,1,1),new xe(3,1,1,1),new xe(1,1,1,1),new xe(3,0,1,1),new xe(1,0,1,1)],this._cubeDirections=[new Se(1,0,0),new Se(-1,0,0),new Se(0,0,1),new Se(0,0,-1),new Se(0,1,0),new Se(0,-1,0)],this._cubeUps=[new Se(0,1,0),new Se(0,1,0),new Se(0,1,0),new Se(0,1,0),new Se(0,0,1),new Se(0,0,-1)]}function $l(e,t,n,r){ql.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Ql}function ec(e,t,n,r,i,o){Wn.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==i?i:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function tc(){Kl.call(this,new ec(-5,5,5,-5,.5,500))}function nc(e,t){ql.call(this,e,t),this.type="DirectionalLight",this.position.copy(wt.DefaultUp),this.updateMatrix(),this.target=new wt,this.shadow=new tc}function rc(e,t){ql.call(this,e,t),this.type="AmbientLight"}function ic(e,t,n,r){ql.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}Vl.prototype=Object.assign(Object.create(Ml.prototype),{constructor:Vl,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Bl(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],r=0,i=this.curves;r<i.length;r++)for(var o=i[r],a=o&&o.isEllipseCurve?2*e:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,s=o.getPoints(a),l=0;l<s.length;l++){var c=s[l];t&&t.equals(c)||(n.push(c),t=c)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){Ml.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=Ml.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){Ml.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Wl[r.type]).fromJSON(r))}return this}}),jl.prototype=Object.assign(Object.create(Vl.prototype),{constructor:jl,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this},moveTo:function(e,t){return this.currentPoint.set(e,t),this},lineTo:function(e,t){var n=new Bl(this.currentPoint.clone(),new fe(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,r){var i=new Gl(this.currentPoint.clone(),new fe(e,t),new fe(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(e,t,n,r,i,o){var a=new kl(this.currentPoint.clone(),new fe(e,t),new fe(n,r),new fe(i,o));return this.curves.push(a),this.currentPoint.set(i,o),this},splineThru:function(e){var t=new Ul([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,r,i,o){var a=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+a,t+s,n,r,i,o),this},absarc:function(e,t,n,r,i,o){return this.absellipse(e,t,n,n,r,i,o),this},ellipse:function(e,t,n,r,i,o,a,s){var l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,n,r,i,o,a,s),this},absellipse:function(e,t,n,r,i,o,a,s){var l=new Tl(e,t,n,r,i,o,a,s);if(this.curves.length>0){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var u=l.getPoint(1);return this.currentPoint.copy(u),this},copy:function(e){return Vl.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=Vl.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Vl.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Xl.prototype=Object.assign(Object.create(jl.prototype),{constructor:Xl,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){jl.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=jl.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){jl.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new jl).fromJSON(r))}return this}}),ql.prototype=Object.assign(Object.create(wt.prototype),{constructor:ql,isLight:!0,copy:function(e){return wt.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=wt.prototype.toJSON.call(this,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}}),Yl.prototype=Object.assign(Object.create(ql.prototype),{constructor:Yl,isHemisphereLight:!0,copy:function(e){return ql.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(Kl.prototype,{_projScreenMatrix:new Je,_lightPositionWorld:new Se,_lookTarget:new Se,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,o=this._lightPositionWorld;o.setFromMatrixPosition(e.matrixWorld),t.position.copy(o),i.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(i),t.updateMatrixWorld(),r.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var 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}}),Zl.prototype=Object.assign(Object.create(Kl.prototype),{constructor:Zl,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=2*le.RAD2DEG*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),Kl.prototype.updateMatrices.call(this,e)}}),Jl.prototype=Object.assign(Object.create(ql.prototype),{constructor:Jl,isSpotLight:!0,copy:function(e){return ql.prototype.copy.call(this,e),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}}),Ql.prototype=Object.assign(Object.create(Kl.prototype),{constructor:Ql,isPointLightShadow:!0,updateMatrices:function(e,t){void 0===t&&(t=0);var n=this.camera,r=this.matrix,i=this._lightPositionWorld,o=this._lookTarget,a=this._projScreenMatrix;i.setFromMatrixPosition(e.matrixWorld),n.position.copy(i),o.copy(n.position),o.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(o),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),a.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(a)}}),$l.prototype=Object.assign(Object.create(ql.prototype),{constructor:$l,isPointLight:!0,copy:function(e){return ql.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),ec.prototype=Object.assign(Object.create(Wn.prototype),{constructor:ec,isOrthographicCamera:!0,copy:function(e,t){return Wn.prototype.copy.call(this,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:function(e,t,n,r,i,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,o=n+e,a=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o=(i+=l*this.view.offsetX)+l*this.view.width,s=(a-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=wt.prototype.toJSON.call(this,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}}),tc.prototype=Object.assign(Object.create(Kl.prototype),{constructor:tc,isDirectionalLightShadow:!0,updateMatrices:function(e){Kl.prototype.updateMatrices.call(this,e)}}),nc.prototype=Object.assign(Object.create(ql.prototype),{constructor:nc,isDirectionalLight:!0,copy:function(e){return ql.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),rc.prototype=Object.assign(Object.create(ql.prototype),{constructor:rc,isAmbientLight:!0}),ic.prototype=Object.assign(Object.create(ql.prototype),{constructor:ic,isRectAreaLight:!0,copy:function(e){return ql.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=ql.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}});var oc=function(){function e(){Object.defineProperty(this,"isSphericalHarmonics3",{value:!0}),this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new Se)}var t=e.prototype;return t.set=function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this},t.zero=function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this},t.getAt=function(e,t){var n=e.x,r=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*i),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],n*r*1.092548),t.addScaledVector(o[5],r*i*1.092548),t.addScaledVector(o[6],.315392*(3*i*i-1)),t.addScaledVector(o[7
10],n*i*1.092548),t.addScaledVector(o[8],.546274*(n*n-r*r)),t},t.getIrradianceAt=function(e,t){var n=e.x,r=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],1.023328*r),t.addScaledVector(o[2],1.023328*i),t.addScaledVector(o[3],1.023328*n),t.addScaledVector(o[4],.858086*n*r),t.addScaledVector(o[5],.858086*r*i),t.addScaledVector(o[6],.743125*i*i-.247708),t.addScaledVector(o[7],.858086*n*i),t.addScaledVector(o[8],.429043*(n*n-r*r)),t},t.add=function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},t.addScaledSH=function(e,t){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this},t.scale=function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this},t.lerp=function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this},t.equals=function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0},t.copy=function(e){return this.set(e.coefficients)},t.clone=function(){return(new this.constructor).copy(this)},t.fromArray=function(e,t){void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this},t.toArray=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+3*r);return e},e.getBasisAt=function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)},e}();function ac(e,t){ql.call(this,void 0,t),this.type="LightProbe",this.sh=void 0!==e?e:new oc}function sc(e){ml.call(this,e),this.textures={}}ac.prototype=Object.assign(Object.create(ql.prototype),{constructor:ac,isLightProbe:!0,copy:function(e){return ql.prototype.copy.call(this,e),this.sh.copy(e.sh),this},fromJSON:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this},toJSON:function(e){var t=ql.prototype.toJSON.call(this,e);return t.object.sh=this.sh.toArray(),t}}),sc.prototype=Object.assign(Object.create(ml.prototype),{constructor:sc,load:function(e,t,n,r){var i=this,o=new gl(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new Zs[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=(new Vt).setHex(e.sheen)),void 0!==e.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.morphNormals&&
10(r.morphNormals=e.morphNormals),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.vertexTangents&&(r.vertexTangents=e.vertexTangents),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(var i in e.uniforms){var o=e.uniforms[i];switch(r.uniforms[i]={},o.type){case"t":r.uniforms[i].value=n(o.value);break;case"c":r.uniforms[i].value=(new Vt).setHex(o.value);break;case"v2":r.uniforms[i].value=(new fe).fromArray(o.value);break;case"v3":r.uniforms[i].value=(new Se).fromArray(o.value);break;case"v4":r.uniforms[i].value=(new xe).fromArray(o.value);break;case"m3":r.uniforms[i].value=(new me).fromArray(o.value);break;case"m4":r.uniforms[i].value=(new Je).fromArray(o.value);break;default:r.uniforms[i].value=o.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var a in e.extensions)r.extensions[a]=e.extensions[a];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new fe).fromArray(s)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new fe).fromArray(e.clearcoatNormalScale)),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),r},setTextures:function(e){return this.textures=e,this}});var lc={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}};function cc(){gn.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function uc(e,t,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Jt.call(this,e,t,n),this.meshPerAttribute=r||1}function hc(e){ml.call(this,e)}cc.prototype=Object.assign(Object.create(gn.prototype),{constructor:cc,isInstancedBufferGeometry:!0,copy:function(e){return gn.prototype.copy.call(this,e),this.instanceCount=e.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=gn.prototype.toJSON.call(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}),uc.prototype=Object.assign(Object.create(Jt.prototype),{constructor:uc,isInstancedBufferAttribute:!0,copy:function(e){return Jt.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=Jt.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),hc.prototype=Object.assign(Object.create(ml.prototype),{constructor:hc,load:function(e,t,n,r){var i=this,o=new gl(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)},parse:function(e){var t={},n={};function r(e,r){if(void 0!==t[r])return t[r];var i=e.interleavedBuffers[r],o=function(e,t){if(void 0!==n[t])return n[t];var r=e.arrayBuffers[t],i=new Uint32Array(r).buffer;return n[t]=i,i}(e,i.buffer),a=new co(new pc[i.type](o),i.stride);return a.uuid=i.uuid,t[r]=a,a}var i=e.isInstancedBufferGeometry?new cc:new gn,o=e.data.index;if(void 0!==o){var a=new pc[o.type](o.array);i.setIndex(new Jt(a,1))}var s=e.data.attributes;for(var l in s){var c=s[l],u=void 0;
10if(c.isInterleavedBufferAttribute){u=new po(r(e.data,c.data),c.itemSize,c.offset,c.normalized)}else{var h=new pc[c.type](c.array);u=new(c.isInstancedBufferAttribute?uc:Jt)(h,c.itemSize,c.normalized)}void 0!==c.name&&(u.name=c.name),i.setAttribute(l,u)}var d=e.data.morphAttributes;if(d)for(var p in d){for(var f=d[p],m=[],v=0,g=f.length;v<g;v++){var y=f[v],x=void 0;if(y.isInterleavedBufferAttribute)x=new po(r(e.data,y.data),y.itemSize,y.offset,y.normalized);else x=new Jt(new pc[y.type](y.array),y.itemSize,y.normalized);void 0!==y.name&&(x.name=y.name),m.push(x)}i.morphAttributes[p]=m}e.data.morphTargetsRelative&&(i.morphTargetsRelative=!0);var b=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==b)for(var _=0,w=b.length;_!==w;++_){var S=b[_];i.addGroup(S.start,S.count,S.materialIndex)}var M=e.data.boundingSphere;if(void 0!==M){var T=new Se;void 0!==M.center&&T.fromArray(M.center),i.boundingSphere=new Ue(T,M.radius)}return e.name&&(i.name=e.name),e.userData&&(i.userData=e.userData),i}});var dc,pc={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array},fc=function(e){function t(t){return e.call(this,t)||this}he(t,e);var n=t.prototype;return n.load=function(e,t,n,r){var i=this,o=""===this.path?lc.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;var a=new gl(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){var o=null;try{o=JSON.parse(n)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?i.parse(o,t):console.error("THREE.ObjectLoader: Can't load "+e)}),n,r)},n.parse=function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),i=this.parseImages(e.images,(function(){void 0!==t&&t(s)})),o=this.parseTextures(e.textures,i),a=this.parseMaterials(e.materials,o),s=this.parseObject(e.object,r,a);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},n.parseShape=function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var i=(new Xl).fromJSON(e[n]);t[i.uuid]=i}return t},n.parseGeometries=function(e,t){var n,r={};if(void 0!==e)for(var i=new hc,o=0,a=e.length;o<a;o++){var s=void 0,l=e[o];switch(l.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new Fs[l.type](l.width,l.height,l.widthSegments,l.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new Fs[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new Fs[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new Fs[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new Fs[l.type](l.radius,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new Fs[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new Fs[l.type](l.radius,l.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new Fs[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new Fs[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new Fs[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);break;case"TubeGeometry":case"TubeBufferGeometry":s=new Fs[l.type]((new Wl[l.path.type]).fromJSON(l.path),l.tubularSegments,l.radius,l.radialSegments,l.closed);break;case"LatheGeometry":case"LatheBufferGeometry":s=new Fs[l.type](l.points,l.segments,l.phiStart,l.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new Fs[l.type](l.vertices,l.indices,l.radius,l.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":n=[];for(var c=0,u=l.shapes.length;c<u;c++){var h=t[l.shapes[c]];n.push(h)}s=new Fs[l.type](n,l.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":n=[];for(var d=0,p=l.shapes.length;d<p;d++){var f=t[l.shapes[d]];n.push(f)}var m=l.options.extrudePath;void 0!==m&&(l.options.extrudePath=(new Wl[m.type]).fromJSON(m)),s=new Fs[l.type](n,l.options);break;case"BufferGeometry":case"InstancedBufferGeometry":s=i.parse(l);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+l.type+'"');continue}s.uuid=l.uuid,void 0!==l.name&&(s.name=l.name),!0===s.isBufferGeometry&&void 0!==l.userData&&(s.userData=l.userData),r[l.uuid]=s}return r},n.parseMaterials=function(e,t){var n={},r={};if(void 0!==e){var i=new sc;i.setTextures(t);for(var o=0,a=e.length;o<a;o++){var s=e[o];if("MultiMaterial"===s.type){for(var l=[],c=0;c<s.materials.length;c++){var u=s.materials[c];void 0===n[u.uuid]&&(n[u.uuid]=i.parse(u)),l.push(n[u.uuid])}r[s.uuid]=l}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},n.parseAnimations=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=ul.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),t.push(i)}return t},n.parseImages=function(e,t){var n,r=this,i={};function o(e){return r.manager.itemStart(e),n.load(e,(function(){r.manager.itemEnd(e)}),void 0,(function(){r.manager.itemError(e),r.manager.itemEnd(e)}))}if(void 0!==e&&e.length>0){var a=new pl(t);(n=new bl(a)).setCrossOrigin(this.crossOrigin);for(var s=0,l=e.length;s<l;s++){var c=e[s],u=c.url;if(Array.isArray(u)){i[c.uuid]=[];for(var h=0,d=u.length;h<d;h++){var p=u[h],f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:r.resourcePath+p;i[c.uuid].push(o(f))}}else{var m=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:r.resourcePath+c.url;i[c.uuid]=o(m)}}}return i},n.parseTextures=function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}
10var r={};if(void 0!==e)for(var i=0,o=e.length;i<o;i++){var 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);var s=void 0;(s=Array.isArray(t[a.image])?new qn(t[a.image]):new ye(t[a.image])).needsUpdate=!0,s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),void 0!==a.mapping&&(s.mapping=n(a.mapping,mc)),void 0!==a.offset&&s.offset.fromArray(a.offset),void 0!==a.repeat&&s.repeat.fromArray(a.repeat),void 0!==a.center&&s.center.fromArray(a.center),void 0!==a.rotation&&(s.rotation=a.rotation),void 0!==a.wrap&&(s.wrapS=n(a.wrap[0],vc),s.wrapT=n(a.wrap[1],vc)),void 0!==a.format&&(s.format=a.format),void 0!==a.type&&(s.type=a.type),void 0!==a.encoding&&(s.encoding=a.encoding),void 0!==a.minFilter&&(s.minFilter=n(a.minFilter,gc)),void 0!==a.magFilter&&(s.magFilter=n(a.magFilter,gc)),void 0!==a.anisotropy&&(s.anisotropy=a.anisotropy),void 0!==a.flipY&&(s.flipY=a.flipY),void 0!==a.premultiplyAlpha&&(s.premultiplyAlpha=a.premultiplyAlpha),void 0!==a.unpackAlignment&&(s.unpackAlignment=a.unpackAlignment),r[a.uuid]=s}return r},n.parseObject=function(e,t,n){var r,i,o;function a(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function s(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var o=e[r];void 0===n[o]&&console.warn("THREE.ObjectLoader: Undefined material",o),t.push(n[o])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":r=new lo,void 0!==e.background&&Number.isInteger(e.background)&&(r.background=new Vt(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?r.fog=new so(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(r.fog=new ao(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new Vn(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(r.focus=e.focus),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.filmGauge&&(r.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(r.filmOffset=e.filmOffset),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new ec(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"AmbientLight":r=new rc(e.color,e.intensity);break;case"DirectionalLight":r=new nc(e.color,e.intensity);break;case"PointLight":r=new $l(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new ic(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new Jl(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new Yl(e.color,e.groundColor,e.intensity);break;case"LightProbe":r=(new ac).fromJSON(e);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":r=new Nn(i=a(e.geometry),o=s(e.material));break;case"InstancedMesh":i=a(e.geometry),o=s(e.material);var l=e.count,c=e.instanceMatrix;(r=new Xo(i,o,l)).instanceMatrix=new Jt(new Float32Array(c.array),16);break;case"LOD":r=new ko;break;case"Line":r=new $o(a(e.geometry),s(e.material),e.mode);break;case"LineLoop":r=new ra(a(e.geometry),s(e.material));break;case"LineSegments":r=new na(a(e.geometry),s(e.material));break;case"PointCloud":case"Points":r=new ca(a(e.geometry),s(e.material));break;case"Sprite":r=new Co(s(e.material));break;case"Group":r=new eo;break;default:r=new wt}if(r.uuid=e.uuid,void 0!==e.name&&(r.name=e.name),void 0!==e.matrix?(r.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(r.matrixAutoUpdate=e.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==e.position&&r.position.fromArray(e.position),void 0!==e.rotation&&r.rotation.fromArray(e.rotation),void 0!==e.quaternion&&r.quaternion.fromArray(e.quaternion),void 0!==e.scale&&r.scale.fromArray(e.scale)),void 0!==e.castShadow&&(r.castShadow=e.castShadow),void 0!==e.receiveShadow&&(r.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(r.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(r.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(r.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&r.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(r.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.frustumCulled&&(r.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(r.renderOrder=e.renderOrder),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.layers&&(r.layers.mask=e.layers
10),void 0!==e.children)for(var u=e.children,h=0;h<u.length;h++)r.add(this.parseObject(u[h],t,n));if("LOD"===e.type){void 0!==e.autoUpdate&&(r.autoUpdate=e.autoUpdate);for(var d=e.levels,p=0;p<d.length;p++){var f=d[p],m=r.getObjectByProperty("uuid",f.object);void 0!==m&&r.addLevel(m,f.distance)}}return r},n.setTexturePath=function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)},t}(ml),mc={UVMapping:n,CubeReflectionMapping:i,CubeRefractionMapping:o,EquirectangularReflectionMapping:a,EquirectangularRefractionMapping:s,CubeUVReflectionMapping:l,CubeUVRefractionMapping:c},vc={RepeatWrapping:u,ClampToEdgeWrapping:h,MirroredRepeatWrapping:d},gc={NearestFilter:p,NearestMipmapNearestFilter:f,NearestMipmapLinearFilter:m,LinearFilter:v,LinearMipmapNearestFilter:g,LinearMipmapLinearFilter:y};function yc(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),ml.call(this,e),this.options={premultiplyAlpha:"none"}}function xc(){this.type="ShapePath",this.color=new Vt,this.subPaths=[],this.currentPath=null}function bc(e){this.type="Font",this.data=e}function _c(e,t,n,r,i){var o=i.glyphs[e]||i.glyphs["?"];if(o){var a,s,l,c,u,h,d,p,f=new xc;if(o.o)for(var m=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),v=0,g=m.length;v<g;){switch(m[v++]){case"m":a=m[v++]*t+n,s=m[v++]*t+r,f.moveTo(a,s);break;case"l":a=m[v++]*t+n,s=m[v++]*t+r,f.lineTo(a,s);break;case"q":l=m[v++]*t+n,c=m[v++]*t+r,u=m[v++]*t+n,h=m[v++]*t+r,f.quadraticCurveTo(u,h,l,c);break;case"b":l=m[v++]*t+n,c=m[v++]*t+r,u=m[v++]*t+n,h=m[v++]*t+r,d=m[v++]*t+n,p=m[v++]*t+r,f.bezierCurveTo(u,h,d,p,l,c)}}return{offsetX:o.ha*t,path:f}}console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".")}function wc(e){ml.call(this,e)}yc.prototype=Object.assign(Object.create(ml.prototype),{constructor:yc,isImageBitmapLoader:!0,setOptions:function(e){return this.options=e,this},load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,o=dl.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;var a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",fetch(e,a).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,i.options)})).then((function(n){dl.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}),Object.assign(xc.prototype,{moveTo:function(e,t){return this.currentPath=new jl,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this},lineTo:function(e,t){return this.currentPath.lineTo(e,t),this},quadraticCurveTo:function(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this},bezierCurveTo:function(e,t,n,r,i,o){return this.currentPath.bezierCurveTo(e,t,n,r,i,o),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],o=new Xl;o.curves=i.curves,t.push(o)}return t}function r(e,t){for(var n=t.length,r=!1,i=n-1,o=0;o<n;i=o++){var a=t[i],s=t[o],l=s.x-a.x,c=s.y-a.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(a=t[o],l=-l,s=t[i],c=-c),e.y<a.y||e.y>s.y)continue;if(e.y===a.y){if(e.x===a.x)return!0}else{var u=c*(e.x-a.x)-l*(e.y-a.y);if(0===u)return!0;if(u<0)continue;r=!r}}else{if(e.y!==a.y)continue;if(s.x<=e.x&&e.x<=a.x||a.x<=e.x&&e.x<=s.x)return!0}}return r}var i,o,a,s=as.isClockWise,l=this.subPaths;if(0===l.length)return[];if(!0===t)return n(l);var c=[];if(1===l.length)return o=l[0],(a=new Xl).curves=o.curves,c.push(a),c;var u=!s(l[0].getPoints());u=e?!u:u;var h,d,p=[],f=[],m=[],v=0;f[v]=void 0,m[v]=[];for(var g=0,y=l.length;g<y;g++)i=s(h=(o=l[g]).getPoints()),(i=e?!i:i)?(!u&&f[v]&&v++,f[v]={s:new Xl,p:h},f[v].s.curves=o.curves,u&&v++,m[v]=[]):m[v].push({h:o,p:h[0]});if(!f[0])return n(l);if(f.length>1){for(var x=!1,b=[],_=0,w=f.length;_<w;_++)p[_]=[];for(var S=0,M=f.length;S<M;S++)for(var T=m[S],E=0;E<T.length;E++){for(var C=T[E],L=!0,R=0;R<f.length;R++)r(C.p,f[R].p)&&(S!==R&&b.push({froms:S,tos:R,hole:E}),L?(L=!1,p[R].push(C)):x=!0);L&&p[S].push(C)}b.length>0&&(x||(m=p))}for(var A=0,P=f.length;A<P;A++){a=f[A].s,c.push(a);for(var I=0,O=(d=m[A]).length;I<O;I++)a.holes.push(d[I].h)}return c}}),Object.assign(bc.prototype,{isFont:!0,generateShapes:function(e,t){void 0===t&&(t=100);for(var n=[],r=function(e,t,n){for(var r=Array.from?Array.from(e):String(e).split(""),i=t/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,a=[],s=0,l=0,c=0;c<r.length;c++){var u=r[c];if("\n"===u)s=0,l-=o;else{var h=_c(u,i,s,l,n);s+=h.offsetX,a.push(h.path)}}return a}(e,t,this.data),i=0,o=r.length;i<o;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),wc.prototype=Object.assign(Object.create(ml.prototype),{constructor:wc,load:function(e,t,n,r){var i=this,o=new gl(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}
10var r=i.parse(n);t&&t(r)}),n,r)},parse:function(e){return new bc(e)}});var Sc={getContext:function(){return void 0===dc&&(dc=new(window.AudioContext||window.webkitAudioContext)),dc},setContext:function(e){dc=e}};function Mc(e){ml.call(this,e)}function Tc(e,t,n){ac.call(this,void 0,n);var r=(new Vt).set(e),i=(new Vt).set(t),o=new Se(r.r,r.g,r.b),a=new Se(i.r,i.g,i.b),s=Math.sqrt(Math.PI),l=s*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(s),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(l)}function Ec(e,t){ac.call(this,void 0,t);var n=(new Vt).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}Mc.prototype=Object.assign(Object.create(ml.prototype),{constructor:Mc,load:function(e,t,n,r){var i=this,o=new gl(i.manager);o.setResponseType("arraybuffer"),o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{var o=n.slice(0);Sc.getContext().decodeAudioData(o,(function(e){t(e)}))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}}),Tc.prototype=Object.assign(Object.create(ac.prototype),{constructor:Tc,isHemisphereLightProbe:!0,copy:function(e){return ac.prototype.copy.call(this,e),this},toJSON:function(e){return ac.prototype.toJSON.call(this,e)}}),Ec.prototype=Object.assign(Object.create(ac.prototype),{constructor:Ec,isAmbientLightProbe:!0,copy:function(e){return ac.prototype.copy.call(this,e),this},toJSON:function(e){return ac.prototype.toJSON.call(this,e)}});var Cc=new Je,Lc=new Je;function Rc(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Vn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Vn,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}}Object.assign(Rc.prototype,{update:function(e){var 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;var n,r,i=e.projectionMatrix.clone(),o=t.eyeSep/2,a=o*t.near/t.focus,s=t.near*Math.tan(le.DEG2RAD*t.fov*.5)/t.zoom;Lc.elements[12]=-o,Cc.elements[12]=o,n=-s*t.aspect+a,r=s*t.aspect+a,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(i),n=-s*t.aspect-a,r=s*t.aspect-a,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Lc),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Cc)}});var Ac=function(){function e(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}var t=e.prototype;return t.start=function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},t.stop=function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},t.getElapsedTime=function(){return this.getDelta(),this.elapsedTime},t.getDelta=function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e},e}(),Pc=new Se,Ic=new we,Oc=new Se,Dc=new Se,Nc=function(e){function t(){var t;return(t=e.call(this)||this).type="AudioListener",t.context=Sc.getContext(),t.gain=t.context.createGain(),t.gain.connect(t.context.destination),t.filter=null,t.timeDelta=0,t._clock=new Ac,t}he(t,e);var n=t.prototype;return n.getInput=function(){return this.gain},n.removeFilter=function(){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},n.getFilter=function(){return this.filter},n.setFilter=function(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},n.getMasterVolume=function(){return this.gain.gain.value},n.setMasterVolume=function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},n.updateMatrixWorld=function(t){e.prototype.updateMatrixWorld.call(this,t);var n=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Pc,Ic,Oc),Dc.set(0,0,-1).applyQuaternion(Ic),n.positionX){var i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(Pc.x,i),n.positionY.linearRampToValueAtTime(Pc.y,i),n.positionZ.linearRampToValueAtTime(Pc.z,i
10),n.forwardX.linearRampToValueAtTime(Dc.x,i),n.forwardY.linearRampToValueAtTime(Dc.y,i),n.forwardZ.linearRampToValueAtTime(Dc.z,i),n.upX.linearRampToValueAtTime(r.x,i),n.upY.linearRampToValueAtTime(r.y,i),n.upZ.linearRampToValueAtTime(r.z,i)}else n.setPosition(Pc.x,Pc.y,Pc.z),n.setOrientation(Dc.x,Dc.y,Dc.z,r.x,r.y,r.z)},t}(wt),kc=function(e){function t(t){var n;return(n=e.call(this)||this).type="Audio",n.listener=t,n.context=t.context,n.gain=n.context.createGain(),n.gain.connect(t.getInput()),n.autoplay=!1,n.buffer=null,n.detune=0,n.loop=!1,n.loopStart=0,n.loopEnd=0,n.offset=0,n.duration=void 0,n.playbackRate=1,n.isPlaying=!1,n.hasPlaybackControl=!0,n.source=null,n.sourceType="empty",n._startedAt=0,n._progress=0,n._connected=!1,n.filters=[],n}he(t,e);var n=t.prototype;return n.getOutput=function(){return this.gain},n.setNodeSource=function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},n.setMediaElementSource=function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},n.setMediaStreamSource=function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this},n.setBuffer=function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},n.play=function(e){if(void 0===e&&(e=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var 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()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},n.pause=function(){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.")},n.stop=function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},n.connect=function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var 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},n.disconnect=function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var 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},n.getFilters=function(){return this.filters},n.setFilters=function(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},n.setDetune=function(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},n.getDetune=function(){return this.detune},n.getFilter=function(){return this.getFilters()[0]},n.setFilter=function(e){return this.setFilters(e?[e]:[])},n.setPlaybackRate=function(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.")},n.getPlaybackRate=function(){return this.playbackRate},n.onEnded=function(){this.isPlaying=!1},n.getLoop=function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},n.setLoop=function(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.")},n.setLoopStart=function(e){return this.loopStart=e,this},n.setLoopEnd=function(e){return this.loopEnd=e,this},n.getVolume=function(){return this.gain.gain.value},n.setVolume=function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},t}(wt),zc=new Se,Bc=new we,Fc=new Se,Gc=new Se,Hc=function(e){function t(t){var n;return(n=e.call(this,t)||this).panner=n.context.createPanner(),n.panner.panningModel="HRTF",n.panner.connect(n.gain),n}he(t,e);var n=t.prototype;return n.getOutput=function(){return this.panner},n.getRefDistance=function(){return this.panner.refDistance},n.setRefDistance=function(e){return this.panner.refDistance=e,this},n.getRolloffFactor=function(){return this.panner.rolloffFactor},n.setRolloffFactor=function(e){return this.panner.rolloffFactor=e,this},n.getDistanceModel=function(){return this.panner.distanceModel},n.setDistanceModel=function(e){return this.panner.distanceModel=e,this},n.getMaxDistance=function(){return this.panner.maxDistance},n.setMaxDistance=function(e){return this.panner.maxDistance=e,this},n.setDirectionalCone=function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},n.updateMatrixWorld=function(t){if(e.prototype.updateMatrixWorld.call(this,t),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(zc,Bc,Fc),Gc.set(0,0,1).applyQuaternion(Bc);var n=this.panner;if(n.positionX){var r=this.context.currentTime+this.listener.timeDelta;n.positionX.linearRampToValueAtTime(zc.x,r),n.positionY.linearRampToValueAtTime(zc.y,r),n.positionZ.linearRampToValueAtTime(zc.z,r),n.orientationX.linearRampToValueAtTime(Gc.x,r),n.orientationY.linearRampToValueAtTime(Gc.y,r),n.orientationZ.linearRampToValueAtTime(Gc.z,r)}else n.setPosition(zc.x,zc.y,zc.z),n.setOrientation(Gc.x,Gc.y,Gc.z)}},t}(kc),Uc=function(){function e(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}var t=e.prototype;return t.getFrequencyData=function(){return this.analyser.getByteFrequencyData(this.data),this.data},t.getAverageFrequency=function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length},e}();
10function Wc(e,t,n){var r,i,o;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,i=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}Object.assign(Wc.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==r;++a)n[i+a]=n[a];o=t}else{var s=t/(o+=t);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=o},accumulateAdditive:function(e){var t=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){var s=t*this._origIndex;this._mixBufferRegion(n,r,s,1-i,t)}o>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(var l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(var i=n,o=r;i!==o;++i)t[i]=t[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,n=e;n<t;n++)this.buffer[n]=0},_setAdditiveIdentityQuaternion:function(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1},_setAdditiveIdentityOther:function(){for(var e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize,n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]},_select:function(e,t,n,r,i){if(r>=.5)for(var o=0;o!==i;++o)e[t+o]=e[n+o]},_slerp:function(e,t,n,r){we.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,i){var o=this._workIndex*i;we.multiplyQuaternionsFlat(e,o,e,t,e,n),we.slerpFlat(e,t,e,t,e,o,r)},_lerp:function(e,t,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=t+a;e[s]=e[s]*o+e[n+a]*r}},_lerpAdditive:function(e,t,n,r,i){for(var o=0;o!==i;++o){var a=t+o;e[a]=e[a]+e[n+o]*r}}});var Vc="\\[\\]\\.:\\/",jc=new RegExp("[\\[\\]\\.:\\/]","g"),Xc="[^\\[\\]\\.:\\/]",qc="[^"+Vc.replace("\\.","")+"]",Yc=/((?:WC+[\/:])*)/.source.replace("WC",Xc),Kc=/(WCOD+)?/.source.replace("WCOD",qc),Zc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Xc),Jc=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Xc),Qc=new RegExp("^"+Yc+Kc+Zc+Jc+"$"),$c=["material","materials","bones"];function eu(e,t,n){var r=n||tu.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function tu(e,t,n){this.path=t,this.parsedPath=n||tu.parseTrackName(t),this.node=tu.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function nu(){this.uuid=le.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}Object.assign(eu.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(tu,{Composite:eu,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new tu.Composite(e,t,n):new tu(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(jc,"")},parseTrackName:function(e){var t=Qc.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==$c.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function e(n){for(var r=0;r<n.length;r++){var i=n[r];if(i.name===t||i.uuid===t)return i;var o=e(i.children);if(o)return o}return null}(e.children);if(r)return r}return null}}),Object.assign(tu.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=tu.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var o=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as no
10de 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(var a=0;a<e.length;a++)if(e[a].name===o){o=a;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==o){if(void 0===e[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[o]}}var s=e[r];if(void 0!==s){var l=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var c=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",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])}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][l]}else{var u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(tu.prototype,{_getValue_unbound:tu.prototype.getValue,_setValue_unbound:tu.prototype.setValue}),Object.assign(nu.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,o=i.length,a=void 0,s=e.length,l=this.nCachedObjects_,c=0,u=arguments.length;c!==u;++c){var h=arguments[c],d=h.uuid,p=t[d];if(void 0===p){p=s++,t[d]=p,e.push(h);for(var f=0,m=o;f!==m;++f)i[f].push(new tu(h,n[f],r[f]))}else if(p<l){a=e[p];var v=--l,g=e[v];t[g.uuid]=p,e[p]=g,t[d]=v,e[v]=h;for(var y=0,x=o;y!==x;++y){var b=i[y],_=b[v],w=b[p];b[p]=_,void 0===w&&(w=new tu(h,n[y],r[y])),b[v]=w}}else e[p]!==a&&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:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],l=s.uuid,c=t[l];if(void 0!==c&&c>=i){var u=i++,h=e[u];t[h.uuid]=c,e[c]=h,t[l]=u,e[u]=s;for(var d=0,p=r;d!==p;++d){var f=n[d],m=f[u],v=f[c];f[c]=m,f[u]=v}}}this.nCachedObjects_=i},uncache:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,o=e.length,a=0,s=arguments.length;a!==s;++a){var l=arguments[a],c=l.uuid,u=t[c];if(void 0!==u)if(delete t[c],u<i){var h=--i,d=e[h],p=--o,f=e[p];t[d.uuid]=u,e[u]=d,t[f.uuid]=h,e[h]=f,e.pop();for(var m=0,v=r;m!==v;++m){var g=n[m],y=g[h],x=g[p];g[u]=y,g[h]=x,g.pop()}}else{var b=--o,_=e[b];t[_.uuid]=u,e[u]=_,e.pop();for(var w=0,S=r;w!==S;++w){var M=n[w];M[u]=M[b],M.pop()}}}this.nCachedObjects_=i},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var o=this._paths,a=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,u=new Array(l);r=i.length,n[e]=r,o.push(e),a.push(t),i.push(u);for(var h=c,d=s.length;h!==d;++h){var p=s[h];u[h]=new tu(p,e,t)}return u},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];t[e[a]]=n,o[n]=s,o.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}});var ru=function(){function e(e,t,n,r){this._mixer=e,this._clip=t,this._localRoot=n||null,this.blendMode=r||t.blendMode;for(var i=t.tracks,o=i.length,a=new Array(o),s={endingStart:U,endingEnd:U},l=0;l!==o;++l){var c=i[l].createInterpolant(null);a[l]=c,c.settings=s}this._interpolantSettings=s,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}var t=e.prototype;return t.play=function(){return this._mixer._activateAction(this),this},t.stop=function(){return this._mixer._deactivateAction(this),this.reset()},t.reset=function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},t.isRunning=function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},t.isScheduled=function(){return this._mixer._isActiveAction(this)},t.startAt=function(e){return this._startTime=e,this},t.setLoop=function(e,t){return this.loop=e,this.repetitions=t,this},t.setEffectiveWeight=function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},t.getEffectiveWeight=function(){return this._effectiveWeight}
10,t.fadeIn=function(e){return this._scheduleFading(e,0,1)},t.fadeOut=function(e){return this._scheduleFading(e,1,0)},t.crossFadeFrom=function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,o=i/r,a=r/i;e.warp(1,o,t),this.warp(a,1,t)}return this},t.crossFadeTo=function(e,t,n){return e.crossFadeFrom(this,t,n)},t.stopFading=function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},t.setEffectiveTimeScale=function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},t.getEffectiveTimeScale=function(){return this._effectiveTimeScale},t.setDuration=function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},t.syncWith=function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},t.halt=function(e){return this.warp(this._effectiveTimeScale,0,e)},t.warp=function(e,t,n){var r=this._mixer,i=r.time,o=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/o,l[1]=t/o,this},t.stopWarping=function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},t.getMixer=function(){return this._mixer},t.getClip=function(){return this._clip},t.getRoot=function(){return this._localRoot||this._mixer._root},t._update=function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var o=(e-i)*n;if(o<0||0===n)return;this._startTime=null,t=n*o}t*=this._updateTimeScale(e);var a=this._updateTime(t),s=this._updateWeight(e);if(s>0){var l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case X:for(var u=0,h=l.length;u!==h;++u)l[u].evaluate(a),c[u].accumulateAdditive(s);break;case j:default:for(var d=0,p=l.length;d!==p;++d)l[d].evaluate(a),c[d].accumulate(r,s)}}}else this._updateWeight(e)},t._updateWeight=function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},t._updateTimeScale=function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},t._updateTime=function(e){var t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,o=2202===n;if(0===e)return-1===i?r:o&&1==(1&i)?t-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),r>=t||r<0){var a=Math.floor(r/t);r-=t*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var l=e<0;this._setEndings(l,!l,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&1==(1&i))return t-r}return r},t._setEndings=function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=W,r.endingEnd=W):(r.endingStart=e?this.zeroSlopeAtStart?W:U:V,r.endingEnd=t?this.zeroSlopeAtEnd?W:U:V)},t._scheduleFading=function(e,t,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=t,a[1]=i+e,s[1]=n,this},e}();function iu(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}iu.prototype=Object.assign(Object.create(ie.prototype),{constructor:iu,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,o=e._propertyBindings,a=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName,c=l[s];void 0===c&&(c={},l[s]=c);for(var u=0;u!==i;++u){var h=r[u],d=h.name,p=c[d];if(void 0!==p)o[u]=p;
vendor: 8,080 bytes, line 10
10else{if(void 0!==(p=o[u])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=t&&t._propertyBindings[u].binding.parsedPath;++(p=new Wc(tu.create(n,d,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),o[u]=p}a[u].resultBuffer=p.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var 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:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r=this._actions,i=this._actionsByClip,o=i[t];if(void 0===o)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=o;else{var a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,o=this._actionsByClip,a=o[i],s=a.knownActions,l=s[s.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,s[c]=l,s.pop(),e._byClipCacheIndex=null,delete a.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete o[i],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,i=this._bindings,o=r[t];void 0===o&&(o={},r[t]=o),o[n]=e,e._cacheIndex=i.length,i.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,o=this._bindingsByRootAndName,a=o[r],s=t[t.length-1],l=e._cacheIndex;s._cacheIndex=l,t[l]=s,t.pop(),delete a[i],0===Object.keys(a).length&&delete o[r]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&((n=new el(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t,n){var r=t||this._root,i=r.uuid,o="string"==typeof e?ul.findByName(r,e):e,a=null!==o?o.uuid:e,s=this._actionsByClip[a],l=null;if(void 0===n&&(n=null!==o?o.blendMode:j),void 0!==s){var c=s.actionByRoot[i];if(void 0!==c&&c.blendMode===n)return c;l=s.knownActions[0],null===o&&(o=l._clip)}if(null===o)return null;var u=new ru(this,o,t,n);return this._bindAction(u,l),this._addInactiveAction(u,a,i),u},existingAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?ul.findByName(n,e):e,o=i?i.uuid:e,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[r]||null},stopAllAction:function(){for(var e=this._actions,t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1,a=0;a!==n;++a){t[a]._update(r,e,i,o)}for(var s=this._bindings,l=this._nActiveBindings,c=0;c!==l;++c)s[c].apply(o);return this},setTime:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var o=i.knownActions,a=0,s=o.length;a!==s;++a){var l=o[a];this._deactivateAction(l);var c=l._cacheIndex,u=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,u._cacheIndex=c,t[c]=u,t.pop(),this._removeInactiveBindingsForAction(l)}delete r[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var o=this._bindingsByRootAndName[t];if(void 0!==o)for(var a in o){var s=o[a];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}});var ou=function(){function e(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}return e.prototype.clone=function(){return new e(void 0===this.value.clone?this.value:this.value.clone())},e}();function au(e,t,n){co.call(this,e,t),this.meshPerAttribute=n||1}function su(e,t,n,r,i){this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,this.count=i,this.version=0}function lu(e,t,n,r){this.ray=new Ze(e,t),this.near=n||0,this.far=r||1/0,this.camera=null,this.layers=new lt,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function cu(e,t){return e.distance-t.distance}function uu(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===r)for(var i=e.children,o=0,a=i.length;o<a;o++)uu(i[o],t,n,!0)}au.prototype=Object.assign(Object.create(co.prototype),{constructor:au,isInstancedInterleavedBuffer:!0,copy:function(e){return co.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},clone:function(e){var t=co.prototype.clone.call(this,e);return t.meshPerAttribute=this.meshPerAttribute,t},toJSON:function(e){var t=co.prototype.toJSON.call(this,e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}),Object.defineProperty(su.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(su.prototype,{isGLBufferAttribute:!0,setBuffer:function(e){return this.buffer=e,this},setType:function(e,t){return this.type=e,this.elementSize=t,this},setItemSize:function(e){return this.itemSize=e,this},setCount:function(e){return this.count=e,this}}),Object.assign(lu.prototype,{set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){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&&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:
10Unsupported camera type.")},intersectObject:function(e,t,n){var r=n||[];return uu(e,this,r,t),r.sort(cu),r},intersectObjects:function(e,t,n){var r=n||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,o=e.length;i<o;i++)uu(e[i],this,r,t);return r.sort(cu),r}});var hu=function(){function e(e,t,n){return void 0===e&&(e=1),void 0===t&&(t=0),void 0===n&&(n=0),this.radius=e,this.phi=t,this.theta=n,this}var t=e.prototype;return t.set=function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},t.makeSafe=function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this},t.setFromVector3=function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},t.setFromCartesianCoords=function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(le.clamp(t/this.radius,-1,1))),this},e}(),du=function(){function e(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}var t=e.prototype;return t.set=function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},t.setFromVector3=function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},t.setFromCartesianCoords=function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this},e}(),pu=new fe,fu=function(){function e(e,t){Object.defineProperty(this,"isBox2",{value:!0}),this.min=void 0!==e?e:new fe(1/0,1/0),this.max=void 0!==t?t:new fe(-1/0,-1/0)}var t=e.prototype;return t.set=function(e,t){return this.min.copy(e),this.max.copy(t),this},t.setFromPoints=function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},t.setFromCenterAndSize=function(e,t){var n=pu.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){return this.min.copy(e.min),this.max.copy(e.max),this},t.makeEmpty=function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},t.isEmpty=function(){return this.max.x<this.min.x||this.max.y<this.min.y},t.getCenter=function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new fe),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},t.getSize=function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new fe),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},t.expandByPoint=function(e){return this.min.min(e),this.max.max(e),this},t.expandByVector=function(e){return this.min.sub(e),this.max.add(e),this},t.expandByScalar=function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},t.containsPoint=function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},t.containsBox=function(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},t.getParameter=function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new fe),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},t.intersectsBox=function(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)},t.clampPoint=function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new fe),t.copy(e).clamp(this.min,this.max)},t.distanceToPoint=function(e){return pu.copy(e).clamp(this.min,this.max).sub(e).length()},t.intersect=function(e){return this.min.max(e.min),this.max.min(e.max),this},t.union=function(e){return this.min.min(e.min),this.max.max(e.max),this},t.translate=function(e){return this.min.add(e),this.max.add(e),this},t.equals=function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},e}(),mu=new Se,vu=new Se,gu=function(){function e(e,t){this.start=void 0!==e?e:new Se,this.end=void 0!==t?t:new Se}var t=e.prototype;return t.set=function(e,t){return this.start.copy(e),this.end.copy(t),this},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){return this.start.copy(e.start),this.end.copy(e.end),this},t.getCenter=function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Se),e.addVectors(this.start,this.end).multiplyScalar(.5)},t.delta=function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Se),e.subVectors(this.end,this.start)},t.distanceSq=function(){return this.start.distanceToSquared(this.end)},t.distance=function(){return this.start.distanceTo(this.end)},t.at=function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at(
10) target is now required"),t=new Se),this.delta(t).multiplyScalar(e).add(this.start)},t.closestPointToPointParameter=function(e,t){mu.subVectors(e,this.start),vu.subVectors(this.end,this.start);var n=vu.dot(vu),r=vu.dot(mu)/n;return t&&(r=le.clamp(r,0,1)),r},t.closestPointToPoint=function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Se),this.delta(n).multiplyScalar(r).add(this.start)},t.applyMatrix4=function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},t.equals=function(e){return e.start.equals(this.start)&&e.end.equals(this.end)},e}();function yu(e){wt.call(this),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}yu.prototype=Object.create(wt.prototype),yu.prototype.constructor=yu,yu.prototype.isImmediateRenderObject=!0;var xu=new Se,bu=function(e){function t(t,n){var r;(r=e.call(this)||this).light=t,r.light.updateMatrixWorld(),r.matrix=t.matrixWorld,r.matrixAutoUpdate=!1,r.color=n;for(var i=new gn,o=[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],a=0,s=1;a<32;a++,s++){var l=a/32*Math.PI*2,c=s/32*Math.PI*2;o.push(Math.cos(l),Math.sin(l),1,Math.cos(c),Math.sin(c),1)}i.setAttribute("position",new an(o,3));var u=new qo({fog:!1,toneMapped:!1});return r.cone=new na(i,u),r.add(r.cone),r.update(),r}he(t,e);var n=t.prototype;return n.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},n.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),xu.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(xu),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)},t}(wt),_u=new Se,wu=new Je,Su=new Je,Mu=function(e){function t(t){for(var n,r=Tu(t),i=new gn,o=[],a=[],s=new Vt(0,0,1),l=new Vt(0,1,0),c=0;c<r.length;c++){var u=r[c];u.parent&&u.parent.isBone&&(o.push(0,0,0),o.push(0,0,0),a.push(s.r,s.g,s.b),a.push(l.r,l.g,l.b))}i.setAttribute("position",new an(o,3)),i.setAttribute("color",new an(a,3));var h=new qo({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});return(n=e.call(this,i,h)||this).type="SkeletonHelper",n.isSkeletonHelper=!0,n.root=t,n.bones=r,n.matrix=t.matrixWorld,n.matrixAutoUpdate=!1,n}return he(t,e),t.prototype.updateMatrixWorld=function(t){var n=this.bones,r=this.geometry,i=r.getAttribute("position");Su.getInverse(this.root.matrixWorld);for(var o=0,a=0;o<n.length;o++){var s=n[o];s.parent&&s.parent.isBone&&(wu.multiplyMatrices(Su,s.matrixWorld),_u.setFromMatrixPosition(wu),i.setXYZ(a,_u.x,_u.y,_u.z),wu.multiplyMatrices(Su,s.parent.matrixWorld),_u.setFromMatrixPosition(wu),i.setXYZ(a+1,_u.x,_u.y,_u.z),a+=2)}r.getAttribute("position").needsUpdate=!0,e.prototype.updateMatrixWorld.call(this,t)},t}(na);function Tu(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,Tu(e.children[n]));return t}var Eu=function(e){function t(t,n,r){var i,o=new Es(n,4,2),a=new Yt({wireframe:!0,fog:!1,toneMapped:!1});return(i=e.call(this,o,a)||this).light=t,i.light.updateMatrixWorld(),i.color=r,i.type="PointLightHelper",i.matrix=i.light.matrixWorld,i.matrixAutoUpdate=!1,i.update(),i}he(t,e);var n=t.prototype;return n.dispose=function(){this.geometry.dispose(),this.material.dispose()},n.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},t}(Nn),Cu=new Se,Lu=new Vt,Ru=new Vt,Au=function(e){function t(t,n,r){var i;(i=e.call(this)||this).light=t,i.light.updateMatrixWorld(),i.matrix=t.matrixWorld,i.matrixAutoUpdate=!1,i.color=r;var o=new vs(n);o.rotateY(.5*Math.PI),i.material=new Yt({wireframe:!0,fog:!1,toneMapped:!1}),void 0===i.color&&(i.material.vertexColors=!0);var a=o.getAttribute("position"),s=new Float32Array(3*a.count);return o.setAttribute("color",new Jt(s,3)),i.add(new Nn(o,i.material)),i.update(),i}he(t,e);var n=t.prototype;return n.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},n.update=function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");Lu.copy(this.light.color),Ru.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var i=n<r/2?Lu:Ru;t.setXYZ(n,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(Cu.setFromMatrixPosition(this.light.matrixWorld).negate())},t}(wt),Pu=function(e){function t(t,n,r,i){var o;t=t||10,n=n||10,r=new Vt(void 0!==r?r:4473924),i=new Vt(void 0!==i?i:8947848);for(var a=n/2,s=t/n,l=t/2,c=[],u=[],h=0,d=0,p=-l;h<=n;h++,p+=s){c.push(-l,0,p,l,0,p),c.push(p,0,-l,p,0,l);var f=h===a?r:i;f.toArray(u,d),d+=3,f.toArray(u,d),d+=3,f.toArray(u,d),d+=3,f.toArray(u,d),d+=3}var m=new gn;m.setAttribute("position",new an(c,3)),m.setAttribute("color",new an(u,3));var v=new qo({vertexColors:!0,toneMapped:!1});return(o=e.call(this,m,v)||this).type="GridHelper",o}return he(t,e),t}(na),Iu=function(e){function t(t,n,r,i,o,a){var s;
10t=t||10,n=n||16,r=r||8,i=i||64,o=new Vt(void 0!==o?o:4473924),a=new Vt(void 0!==a?a:8947848);for(var l=[],c=[],u=0;u<=n;u++){var h=u/n*(2*Math.PI),d=Math.sin(h)*t,p=Math.cos(h)*t;l.push(0,0,0),l.push(d,0,p);var f=1&u?o:a;c.push(f.r,f.g,f.b),c.push(f.r,f.g,f.b)}for(var m=0;m<=r;m++)for(var v=1&m?o:a,g=t-t/r*m,y=0;y<i;y++){var x=y/i*(2*Math.PI),b=Math.sin(x)*g,_=Math.cos(x)*g;l.push(b,0,_),c.push(v.r,v.g,v.b),x=(y+1)/i*(2*Math.PI),b=Math.sin(x)*g,_=Math.cos(x)*g,l.push(b,0,_),c.push(v.r,v.g,v.b)}var w=new gn;w.setAttribute("position",new an(l,3)),w.setAttribute("color",new an(c,3));var S=new qo({vertexColors:!0,toneMapped:!1});return(s=e.call(this,w,S)||this).type="PolarGridHelper",s}return he(t,e),t}(na),Ou=new Se,Du=new Se,Nu=new Se,ku=function(e){function t(t,n,r){var i;(i=e.call(this)||this).light=t,i.light.updateMatrixWorld(),i.matrix=t.matrixWorld,i.matrixAutoUpdate=!1,i.color=r,void 0===n&&(n=1);var o=new gn;o.setAttribute("position",new an([-n,n,0,n,n,0,n,-n,0,-n,-n,0,-n,n,0],3));var a=new qo({fog:!1,toneMapped:!1});return i.lightPlane=new $o(o,a),i.add(i.lightPlane),(o=new gn).setAttribute("position",new an([0,0,0,0,0,1],3)),i.targetLine=new $o(o,a),i.add(i.targetLine),i.update(),i}he(t,e);var n=t.prototype;return n.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},n.update=function(){Ou.setFromMatrixPosition(this.light.matrixWorld),Du.setFromMatrixPosition(this.light.target.matrixWorld),Nu.subVectors(Du,Ou),this.lightPlane.lookAt(Du),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(Du),this.targetLine.scale.z=Nu.length()},t}(wt),zu=new Se,Bu=new Wn,Fu=function(e){function t(t){var n,r=new gn,i=new qo({color:16777215,vertexColors:!0,toneMapped:!1}),o=[],a=[],s={},l=new Vt(16755200),c=new Vt(16711680),u=new Vt(43775),h=new Vt(16777215),d=new Vt(3355443);function p(e,t,n){f(e,n),f(t,n)}function f(e,t){o.push(0,0,0),a.push(t.r,t.g,t.b),void 0===s[e]&&(s[e]=[]),s[e].push(o.length/3-1)}return p("n1","n2",l),p("n2","n4",l),p("n4","n3",l),p("n3","n1",l),p("f1","f2",l),p("f2","f4",l),p("f4","f3",l),p("f3","f1",l),p("n1","f1",l),p("n2","f2",l),p("n3","f3",l),p("n4","f4",l),p("p","n1",c),p("p","n2",c),p("p","n3",c),p("p","n4",c),p("u1","u2",u),p("u2","u3",u),p("u3","u1",u),p("c","t",h),p("p","c",d),p("cn1","cn2",d),p("cn3","cn4",d),p("cf1","cf2",d),p("cf3","cf4",d),r.setAttribute("position",new an(o,3)),r.setAttribute("color",new an(a,3)),(n=e.call(this,r,i)||this).type="CameraHelper",n.camera=t,n.camera.updateProjectionMatrix&&n.camera.updateProjectionMatrix(),n.matrix=t.matrixWorld,n.matrixAutoUpdate=!1,n.pointMap=s,n.update(),n}return he(t,e),t.prototype.update=function(){var e=this.geometry,t=this.pointMap;Bu.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Gu("c",t,e,Bu,0,0,-1),Gu("t",t,e,Bu,0,0,1),Gu("n1",t,e,Bu,-1,-1,-1),Gu("n2",t,e,Bu,1,-1,-1),Gu("n3",t,e,Bu,-1,1,-1),Gu("n4",t,e,Bu,1,1,-1),Gu("f1",t,e,Bu,-1,-1,1),Gu("f2",t,e,Bu,1,-1,1),Gu("f3",t,e,Bu,-1,1,1),Gu("f4",t,e,Bu,1,1,1),Gu("u1",t,e,Bu,.7,1.1,-1),Gu("u2",t,e,Bu,-.7,1.1,-1),Gu("u3",t,e,Bu,0,2,-1),Gu("cf1",t,e,Bu,-1,0,1),Gu("cf2",t,e,Bu,1,0,1),Gu("cf3",t,e,Bu,0,-1,1),Gu("cf4",t,e,Bu,0,1,1),Gu("cn1",t,e,Bu,-1,0,-1),Gu("cn2",t,e,Bu,1,0,-1),Gu("cn3",t,e,Bu,0,-1,-1),Gu("cn4",t,e,Bu,0,1,-1),e.getAttribute("position").needsUpdate=!0},t}(na);function Gu(e,t,n,r,i,o,a){zu.set(i,o,a).unproject(r);var s=t[e];if(void 0!==s)for(var l=n.getAttribute("position"),c=0,u=s.length;c<u;c++)l.setXYZ(s[c],zu.x,zu.y,zu.z)}var Hu,Uu,Wu,Vu=new Ee,ju=function(e){function t(t,n){var r;void 0===n&&(n=16776960);var i=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]),o=new Float32Array(24),a=new gn;return a.setIndex(new Jt(i,1)),a.setAttribute("position",new Jt(o,3)),(r=e.call(this,a,new qo({color:n,toneMapped:!1}))||this).object=t,r.type="BoxHelper",r.matrixAutoUpdate=!1,r.update(
10),r}he(t,e);var n=t.prototype;return n.update=function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Vu.setFromObject(this.object),!Vu.isEmpty()){var t=Vu.min,n=Vu.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},n.setFromObject=function(e){return this.object=e,this.update(),this},n.copy=function(e){return na.prototype.copy.call(this,e),this.object=e.object,this},t}(na),Xu=function(e){function t(t,n){var r;void 0===n&&(n=16776960);var i=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]),o=new gn;return o.setIndex(new Jt(i,1)),o.setAttribute("position",new an([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)),(r=e.call(this,o,new qo({color:n,toneMapped:!1}))||this).box=t,r.type="Box3Helper",r.geometry.computeBoundingSphere(),r}return he(t,e),t.prototype.updateMatrixWorld=function(t){var n=this.box;n.isEmpty()||(n.getCenter(this.position),n.getSize(this.scale),this.scale.multiplyScalar(.5),e.prototype.updateMatrixWorld.call(this,t))},t}(na),qu=function(e){function t(t,n,r){var i,o=void 0!==r?r:16776960,a=new gn;a.setAttribute("position",new an([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,0,1,0,0,0],3)),a.computeBoundingSphere(),(i=e.call(this,a,new qo({color:o,toneMapped:!1}))||this).type="PlaneHelper",i.plane=t,i.size=void 0===n?1:n;var s=new gn;return s.setAttribute("position",new an([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),s.computeBoundingSphere(),i.add(new Nn(s,new Yt({color:o,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1}))),i}return he(t,e),t.prototype.updateMatrixWorld=function(t){var n=-this.plane.constant;Math.abs(n)<1e-8&&(n=1e-8),this.scale.set(.5*this.size,.5*this.size,n),this.children[0].material.side=n<0?1:0,this.lookAt(this.plane.normal),e.prototype.updateMatrixWorld.call(this,t)},t}($o),Yu=new Se,Ku=function(e){function t(t,n,r,i,o,a){var s;return(s=e.call(this)||this).type="ArrowHelper",void 0===t&&(t=new Se(0,0,1)),void 0===n&&(n=new Se(0,0,0)),void 0===r&&(r=1),void 0===i&&(i=16776960),void 0===o&&(o=.2*r),void 0===a&&(a=.2*o),void 0===Hu&&((Hu=new gn).setAttribute("position",new an([0,0,0,0,1,0],3)),(Uu=new Sa(0,.5,1,5,1)).translate(0,-.5,0)),s.position.copy(n),s.line=new $o(Hu,new qo({color:i,toneMapped:!1})),s.line.matrixAutoUpdate=!1,s.add(s.line),s.cone=new Nn(Uu,new Yt({color:i,toneMapped:!1})),s.cone.matrixAutoUpdate=!1,s.add(s.cone),s.setDirection(t),s.setLength(r,o,a),s}he(t,e);var n=t.prototype;return n.setDirection=function(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{Yu.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Yu,t)}},n.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},n.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},n.copy=function(t){return e.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},t}(wt),Zu=function(e){function t(t){var n;void 0===t&&(t=1);var r=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=new gn;i.setAttribute("position",new an(r,3)),i.setAttribute("color",new an([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var o=new qo({vertexColors:!0,toneMapped:!1});return(n=e.call(this,i,o)||this).type="AxesHelper",n}return he(t,e),t}(na),Ju=Math.pow(2,8),Qu=[.125,.215,.35,.446,.526,.582],$u=5+Qu.length,eh=20,th=((Wu={})[3e3]=0,Wu[3001]=1,Wu[3002]=2,Wu[3004]=3,Wu[3005]=4,Wu[3006]=5,Wu[3007]=6,Wu),nh=new ec,rh=ph(),ih=rh._lodPlanes,oh=rh._sizeLods,ah=rh._sigmas,sh=null,lh=(1+Math.sqrt(5))/2,ch=1/lh,uh=[new Se(1,1,1),new Se(-1,1,1),new Se(1,1,-1),new Se(-1,1,-1),new Se(0,lh,ch),new Se(0,lh,-ch),new Se(ch,0,lh),new Se(-ch,0,lh),new Se(lh,
10ch,0),new Se(-lh,ch,0)],hh=function(){function e(e){var t,n,r;this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=(t=eh,n=new Float32Array(t),r=new Se(0,1,0),new Hs({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r},inputEncoding:{value:th[3e3]},outputEncoding:{value:th[3e3]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\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",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\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\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\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}var t=e.prototype;return t.fromScene=function(e,t,n,r){void 0===t&&(t=0),void 0===n&&(n=.1),void 0===r&&(r=100),sh=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i},t.fromEquirectangular=function(e){return this._fromTexture(e)},t.fromCubemap=function(e){return this._fromTexture(e)},t.compileCubemapShader=function(){null===this._cubemapShader&&(this._cubemapShader=gh(),this._compileMaterial(this._cubemapShader))},t.compileEquirectangularShader=function(){null===this._equirectShader&&(this._equirectShader=vh(),this._compileMaterial(this._equirectShader))},t.dispose=function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var e=0;e<ih.length;e++)ih[e].dispose()},t._cleanup=function(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(sh),e.scissorTest=!1,mh(e,0,0,e.width,e.height)},t._fromTexture=function(e){sh=this._renderer.getRenderTarget();var t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t},t._allocateTargets=function(e){var t={magFilter:p,minFilter:p,generateMipmaps:!1,type:x,format:1023,encoding:dh(e)?e.encoding:Z,depthBuffer:!1},n=fh(t);return n.depthBuffer=!e,this._pingPongRenderTarget=fh(t),n},t._compileMaterial=function(e){var t=new Nn(ih[0],e);this._renderer.compile(t,nh)},t._sceneToCubeUV=function(e,t,n,r){var i=new Vn(90,1,t,n),o=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],s=this._renderer,l=s.outputEncoding,c=s.toneMapping,u=s.getClearColor(),h=s.getClearAlpha();s.toneMapping=0,s.outputEncoding=q;var d=e.background;if(d&&d.isColor){d.convertSRGBToLinear();var p=Math.max(d.r,d.g,d.b),f=Math.min(Math.max(Math.ceil(Math.log2(p)),-128),127);d=d.multiplyScalar(Math.pow(2,-f));var m=(f+128)/255;s.setClearColor(d,m),e.background=null}for(var v=0;v<6;v++){var g=v%3;0==g?(i.up.set(0,o[v],0),i.lookAt(a[v],0,0)):1==g?(i.up.set(0,0,o[v]),i.lookAt(0,a[v],0)):(i.up.set(0,o[v],0),i.lookAt(0,0,a[v])),mh(r,g*Ju,v>2?Ju:0,Ju,Ju),s.setRenderTarget(r),s.render(e,i)}s.toneMapping=c,s.outputEncoding=l,s.setClearColor(u,h)},t._textureToCubeUV=function(e,t){var n=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=gh()):null==this._equirectShader&&(this._equirectShader=vh());var r=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new Nn(ih[0],r),o=r.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=th[e.encoding],o.outputEncoding.value=th[t.texture.encoding],mh(t,0,0,3*Ju,2*Ju),n.setRenderTarget(t),n.render(i,nh)},t._applyPMREM=function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var r=1;r<$u;r++){var i=Math.sqrt(ah[r]*ah[r]-ah[r-1]*ah[r-1]),o=uh[(r-1)%uh.length];this._blur(e,r-1,r,i,o)}t.autoClear=n},t._blur=function(e,t,n,r,i){var o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,r,"latitudinal",i),this._halfBlur(o,e,n,n,r,"longitudinal",i)},t._halfBlur=function(e,t,n,r,i,o,a){var s=this._renderer,l=this._blurMaterial;"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");var c=new Nn(ih[r],l),u=l.uniforms,h=oh[n]-1,d=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,p=i/d,f=isFinite(i)?1+Math.floor(3*p):eh;f>eh&&console.warn("sigmaRadians, "+i+", is too large and will clip, as it requested "+f+" samples when the maximum is set to "+eh);for(var m=[],v=0,g=0;g<eh;++g){var y=g/p,x=Math.exp(-y*y/2);m.push(x),0==g?v+=x:g<f&&(v+=2*x)}for(var b=0;b<m.length;b++)m[b]=m[b]/v;u.envMap.value=e.texture,u.samples.value=f,u.weights.value=m,u.latitudinal.value="latitudinal"===o,a&&(u.poleAxis.value=a),u.dTheta.value=d,u.mipInt.value=8-n,u.inputEncoding.value=th[e.texture.encoding],u.outputEncoding.value=th[e.texture.encoding];var _=oh[r];mh(t,3*Math.max(0,Ju-2*_),(0===r?0:2*Ju)+2*_*(r>4?r-8+4:0),3*_,2*_),s.setRenderTarget(t),s.render(c,nh)},e}();function dh(e){return void 0!==e&&e.type===x&&(e.encoding===q||e.encoding===Y||e.encoding===K)}function ph(){for(var e=[],t=[],n=[],r=8,i=0;i<$u;i++){var o=Math.pow(2,r);t.push(o);var a=1/o;i>4?a=Qu[i-8+4-1]:0==i&&(a=0),n.push(a);for(var s=1/(o-1),l=-s/2,c=1+s/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=new Float32Array(108),d=new Float32Array(72),p=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,v=f>2?0:-1,g=[m,v,0,m+2/3,v,0,m+2/3,v+1,0,m,v,0,m+2/3,v+1,0,m,v+1,0];h.set(g,18*f),d.set(u,12*f);var y=[f,f,f,f,f,f];p.set(y,6*f)}var x=new gn;x.setAttribute("position",new Jt(h,3)),x.setAttribute("uv",new Jt(d,2)),x.setAttribute("faceIndex",new Jt(p,1)),e.push(x),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function fh(e){var t=new be(3*Ju,3*Ju,e);return t.texture.mapping=l,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function mh(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function vh(){return new Hs({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:new fe(1,1)},inputEncoding:{value:th[3e3]},outputEncoding:{value:th[3e3]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\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",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 vec2 texelSize;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function gh(){return new Hs({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:th[3e3]},outputEncoding:{value:th[3e3]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\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",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 samplerCube envMap;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( val
10ue );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function yh(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Il.call(this,e),this.type="catmullrom",this.closed=!0}function xh(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Il.call(this,e),this.type="catmullrom"}function bh(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Il.call(this,e),this.type="catmullrom"}Ml.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Ml.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(Vl.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new xa,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new Se(i.x,i.y,i.z||0))}return t}}),Object.assign(jl.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),yh.prototype=Object.create(Il.prototype),xh.prototype=Object.create(Il.prototype),bh.prototype=Object.create(Il.prototype),Object.assign(bh.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Pu.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Mu.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(ml.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),lc.extractUrlBase(e)}}),ml.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(fu.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.get
vendor: 1,839 bytes, line 10
10Size(e)}}),Object.assign(Ee.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Ue.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),Qn.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},gu.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(le,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),le.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),le.ceilPowerOfTwo(e)}}),Object.assign(me.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3(
10) has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Je.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Se).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3(
10) has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,o)}}),Et.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},we.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3(
10) has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(Ze.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(zt.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(zt,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),zt.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),zt.getNormal(e,t,n,r)}}),Object.assign(Xl.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new hs(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Ts(this,e)}}),Object.assign(fe.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Se.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(xe.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(xa.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyM
10atrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(wt.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(wt.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Nn.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Nn.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(ko.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Go.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}
vendor: 4,747 bytes, line 10
10,set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),zo.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Ml.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Vn.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(ql.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Jt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===ne},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(ne)}}}),Object.assign(Jt.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?ne:te),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(gn.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new Jt(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyM
10atrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(gn.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(cc.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(lu.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(co.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===ne},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(co.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?ne:te),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(cs.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.assign(lo.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(ou.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(qt.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")}
vendor: 4,387 bytes, line 10
10,set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Vt}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(Vs.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Ws.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(e){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=e}}}),Object.defineProperties(Un.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(io.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_
10instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(io.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?Y:q}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(Ki.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(be.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy
10is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(kc.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new Mc).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Uc.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Xn.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update(
10)."),this.update(e,t)};var _h={merge:function(e,t,n){var r;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),r=t.matrix,t=t.geometry),e.merge(t,r,n)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}};ve.crossOrigin=void 0,ve.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new Sl;i.setCrossOrigin(this.crossOrigin);var o=i.load(e,n,void 0,r);return t&&(o.mapping=t),o},ve.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new _l;i.setCrossOrigin(this.crossOrigin);var o=i.load(e,n,void 0,r);return t&&(o.mapping=t),o},ve.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},ve.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var wh={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"121"}})),e.ACESFilmicToneMapping=4,e.AddEquation=t,e.AddOperation=2,e.AdditiveAnimationBlendMode=X,e.AdditiveBlending=2,e.AlphaFormat=1021,e.AlwaysDepth=1,e.AlwaysStencilFunc=519,e.AmbientLight=rc,e.AmbientLightProbe=Ec,e.AnimationClip=ul,e.AnimationLoader=yl,e.AnimationMixer=iu,e.AnimationObjectGroup=nu,e.AnimationUtils=Js,e.ArcCurve=El,e.ArrayCamera=$i,e.ArrowHelper=Ku,e.Audio=kc,e.AudioAnalyser=Uc,e.AudioContext=Sc,e.AudioListener=Nc,e.AudioLoader=Mc,e.AxesHelper=Zu,e.AxisHelper=function(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Zu(e)},e.BackSide=1,e.BasicDepthPacking=3200,e.BasicShadowMap=0,e.BinaryTextureLoader=function(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new wl(e)},e.Bone=Ho,e.BooleanKeyframeTrack=rl,e.BoundingBoxHelper=function(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new ju(e,t)},e.Box2=fu,e.Box3=Ee,e.Box3Helper=Xu,e.BoxBufferGeometry=Bn,e.BoxGeometry=ba,e.BoxHelper=ju,e.BufferAttribute=Jt,e.BufferGeometry=gn,e.BufferGeometryLoader=hc,e.ByteType=1010,e.Cache=dl,e.Camera=Wn,e.CameraHelper=Fu,e.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},e.CanvasTexture=pa,e.CatmullRomCurve3=Il,e.CineonToneMapping=3,e.CircleBufferGeometry=_a,e.CircleGeometry=wa,e.ClampToEdgeWrapping=h,e.Clock=Ac,e.ClosedSplineCurve3=yh,e.Color=Vt,e.ColorKeyframeTrack=il,e.CompressedTexture=da,e.CompressedTextureLoader=xl,e.ConeBufferGeometry=Ea,e.ConeGeometry=Ta,e.CubeCamera=Xn,e.CubeGeometry=ba,e.CubeReflectionMapping=i,e.CubeRefractionMapping=o,e.CubeTexture=qn,e.CubeTextureLoader=_l,e.CubeUVReflectionMapping=l,e.CubeUVRefractionMapping=c,e.CubicBezierCurve=kl,e.CubicBezierCurve3=zl,e.CubicInterpolant=$s,e.CullFaceBack=1,e.CullFaceFront=2,e.CullFaceFrontBack=3,e.CullFaceNone=0,e.Curve=Ml,e.CurvePath=Vl,e.CustomBlending=5,e.CustomToneMapping=5,e.CylinderBufferGeometry=Sa,e.CylinderGeometry=Ma,e.Cylindrical=du,e.DataTexture=Kn,e.DataTexture2DArray=xr,e.DataTexture3D=br,e.DataTextureLoader=wl,e.DecrementStencilOp=7683,e.DecrementWrapStencilOp=34056,e.DefaultLoadingManager=fl,e.DepthFormat=C,e.DepthStencilFormat=L,e.DepthTexture=fa,e.DirectionalLight=nc,e.DirectionalLightHelper=ku,e.DiscreteInterpolant=tl,e.DodecahedronBufferGeometry=La,e.DodecahedronGeometry=Ra,e.DoubleSide=2,e.DstAlphaFactor=206,e.DstColorFactor=208,e.DynamicBufferAttribute=function(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Jt(e,t).setUsage(ne)},e.DynamicCopyUsage=35050,e.DynamicDrawUsage=ne,e.DynamicReadUsage=35049,e.EdgesGeometry=Da,e.EdgesHelper=function(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new na(new Da(e.geometry),new qo({color:void 0!==t?t:16777215}))},e.EllipseCurve=Tl,e.EqualDepth=4,e.EqualStencilFunc=514,e.EquirectangularReflectionMapping=a,e.EquirectangularRefractionMapping=s,e.Euler=ot,e.EventDispatcher=ie,e.ExtrudeBufferGeometry=cs,e.ExtrudeGeometry=hs,e.Face3=jt,e.Face4=function(e,t,n,r,i,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new jt(e,t,n,i,o,a)},e.FaceColors=1,e.FileLoader=gl,e.FlatShading=1,e.Float32Attribute=function(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new an(e,t)},e.Float32BufferAttribute=an,e.Float64Attribute=function(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new sn(e,t)},e.Float64BufferAttribute=sn,e.FloatType=w,e.Fog=so,e.FogExp2=ao,e.Font=bc,e.FontLoader=wc,e.FrontSide=0,e.Frustum=Qn,e.GLBufferAttribute=su,e.GLSL1="100",e.GLSL3=re,e.GammaEncoding=K,e.Geometry=xa,e.GeometryUtils=_h,e.GreaterDepth=6,e.GreaterEqualDepth=5,e.GreaterEqualStencilFunc=518,e.GreaterStencilFunc=516,e.GridHelper=Pu,e.Group=eo,e.HalfFloatType=S,e.HemisphereLight=Yl,e.HemisphereLightHelper=Au,e.HemisphereLightProbe=Tc,e.IcosahedronBufferGeometry=ds,e.IcosahedronGeometry=ps,e.ImageBitmapLoader=yc,e.ImageLoader=bl,e.ImageUtils=ve,e.ImmediateRenderObject=yu,e.IncrementStencilOp=7682,e.IncrementWrapStencilOp=34055,e.InstancedBufferAttribute=uc,e.InstancedBufferGeometry=cc,e.InstancedInterleavedBuffer=au,e.InstancedMesh=Xo,e.Int16Attribute=function(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new tn(e,t)},e.Int16BufferAttribute=tn,e.Int32Attribute=function(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new rn(e,t)},e.Int32BufferAttribute=rn,e.Int8Attribute=function(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Qt(e,t)},e.Int8BufferAttribute=Qt,e.IntType=1013,e.InterleavedBuffer=co,e.InterleavedBufferAttribute=po,e.Interpolant=Qs,e.InterpolateDiscrete=F,e.InterpolateLinear=G,e.InterpolateSmooth=H,e.InvertStencilOp=5386,e.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")},e.KeepStencilOp=ee,e.KeyframeTrack=nl,e.LOD=ko,e.LatheBufferGeometry=fs,e.LatheGeometry=ms,e.Layers=lt,e.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")},e.LessDepth=2,e.LessEqualDepth=3,e.LessEqualStencilFunc=515,e.LessStencilFunc=513,e.Light=ql,e.LightProbe=ac,e.Line=$o,e.Line3=gu,e.LineBasicMaterial=qo,e.LineCurve=Bl,e.LineCurve3=Fl,e.LineDashedMaterial=Ks,e.LineLoop=ra,e.LinePieces=1,e.LineSegments=na,e.LineStrip=0,e.LinearEncoding=q,e.LinearFilter=v,e.LinearInterpolant=el,e.LinearMipMapLinearFilter=1008,e.LinearMipMapNearestFilter=1007,e.LinearMipmapLinearFilter=y,e.LinearMipmapNearestFilter=g,e.LinearToneMapping=1,e.Loader=ml,e.Loa
10derUtils=lc,e.LoadingManager=pl,e.LogLuvEncoding=3003,e.LoopOnce=2200,e.LoopPingPong=2202,e.LoopRepeat=2201,e.LuminanceAlphaFormat=1025,e.LuminanceFormat=1024,e.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},e.Material=qt,e.MaterialLoader=sc,e.Math=le,e.MathUtils=le,e.Matrix3=me,e.Matrix4=Je,e.MaxEquation=104,e.Mesh=Nn,e.MeshBasicMaterial=Yt,e.MeshDepthMaterial=qi,e.MeshDistanceMaterial=Yi,e.MeshFaceMaterial=function(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e},e.MeshLambertMaterial=qs,e.MeshMatcapMaterial=Ys,e.MeshNormalMaterial=Xs,e.MeshPhongMaterial=Vs,e.MeshPhysicalMaterial=Ws,e.MeshStandardMaterial=Us,e.MeshToonMaterial=js,e.MinEquation=103,e.MirroredRepeatWrapping=d,e.MixOperation=1,e.MultiMaterial=function(e){return void 0===e&&(e=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e},e.MultiplyBlending=4,e.MultiplyOperation=0,e.NearestFilter=p,e.NearestMipMapLinearFilter=1005,e.NearestMipMapNearestFilter=1004,e.NearestMipmapLinearFilter=m,e.NearestMipmapNearestFilter=f,e.NeverDepth=0,e.NeverStencilFunc=512,e.NoBlending=0,e.NoColors=0,e.NoToneMapping=0,e.NormalAnimationBlendMode=j,e.NormalBlending=1,e.NotEqualDepth=7,e.NotEqualStencilFunc=517,e.NumberKeyframeTrack=ol,e.Object3D=wt,e.ObjectLoader=fc,e.ObjectSpaceNormalMap=1,e.OctahedronBufferGeometry=vs,e.OctahedronGeometry=gs,e.OneFactor=201,e.OneMinusDstAlphaFactor=207,e.OneMinusDstColorFactor=209,e.OneMinusSrcAlphaFactor=205,e.OneMinusSrcColorFactor=203,e.OrthographicCamera=ec,e.PCFShadowMap=1,e.PCFSoftShadowMap=2,e.PMREMGenerator=hh,e.ParametricBufferGeometry=ys,e.ParametricGeometry=xs,e.Particle=function(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Co(e)},e.ParticleBasicMaterial=function(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new ia(e)},e.ParticleSystem=function(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new ca(e,t)},e.ParticleSystemMaterial=function(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new ia(e)},e.Path=jl,e.PerspectiveCamera=Vn,e.Plane=Et,e.PlaneBufferGeometry=tr,e.PlaneGeometry=bs,e.PlaneHelper=qu,e.PointCloud=function(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new ca(e,t)},e.PointCloudMaterial=function(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new ia(e)},e.PointLight=$l,e.PointLightHelper=Eu,e.Points=ca,e.PointsMaterial=ia,e.PolarGridHelper=Iu,e.PolyhedronBufferGeometry=Ca,e.PolyhedronGeometry=_s,e.PositionalAudio=Hc,e.PropertyBinding=tu,e.PropertyMixer=Wc,e.QuadraticBezierCurve=Gl,e.QuadraticBezierCurve3=Hl,e.Quaternion=we,e.QuaternionKeyframeTrack=sl,e.QuaternionLinearInterpolant=al,e.REVISION="121",e.RGBADepthPacking=3201,e.RGBAFormat=E,e.RGBAIntegerFormat=1033,e.RGBA_ASTC_10x10_Format=37819,e.RGBA_ASTC_10x5_Format=37816,e.RGBA_ASTC_10x6_Format=37817,e.RGBA_ASTC_10x8_Format=37818,e.RGBA_ASTC_12x10_Format=37820,e.RGBA_ASTC_12x12_Format=37821,e.RGBA_ASTC_4x4_Format=37808,e.RGBA_ASTC_5x4_Format=37809,e.RGBA_ASTC_5x5_Format=37810,e.RGBA_ASTC_6x5_Format=37811,e.RGBA_ASTC_6x6_Format=37812,e.RGBA_ASTC_8x5_Format=37813,e.RGBA_ASTC_8x6_Format=37814,e.RGBA_ASTC_8x8_Format=37815,e.RGBA_BPTC_Format=36492,e.RGBA_ETC2_EAC_Format=B,e.RGBA_PVRTC_2BPPV1_Format=k,e.RGBA_PVRTC_4BPPV1_Format=N,e.RGBA_S3TC_DXT1_Format=A,e.RGBA_S3TC_DXT3_Format=P,e.RGBA_S3TC_DXT5_Format=I,e.RGBDEncoding=$,e.RGBEEncoding=Z,e.RGBEFormat=1023,e.RGBFormat=T,e.RGBIntegerFormat=1032,e.RGBM16Encoding=Q,e.RGBM7Encoding=J,e.RGB_ETC1_Format=36196,e.RGB_ETC2_Format=z,e.RGB_PVRTC_2BPPV1_Format=D,e.RGB_PVRTC_4BPPV1_Format=O,e.RGB_S3TC_DXT1_Format=R,e.RGFormat=1030,e.RGIntegerFormat=1031,e.RawShaderMaterial=Hs,e.Ray=Ze,e.Raycaster=lu,e.RectAreaLight=ic,e.RedFormat=1028,e.RedIntegerFormat=1029,e.ReinhardToneMapping=2,e.RepeatWrapping=u,e.ReplaceStencilOp=7681,e.ReverseSubtractEquation=102,e.RingBufferGeometry=ws,e.RingGeometry=Ss,e.SRGB8_ALPHA8_ASTC_10x10_Format=37851,e.SRGB8_ALPHA8_ASTC_10x5_Format=37848,e.SRGB8_ALPHA8_ASTC_10x6_Format=37849,e.SRGB8_ALPHA8_ASTC_10x8_Format=37850,e.SRGB8_ALPHA8_ASTC_12x10_Format=37852,e.SRGB8_ALPHA8_ASTC_12x12_Format=37853,e.SRGB8_ALPHA8_ASTC_4x4_Format=37840,e.SRGB8_ALPHA8_ASTC_5x4_Format=37841,e.SRGB8_ALPHA8_ASTC_5x5_Format=37842,e.SRGB8_ALPHA8_ASTC_6x5_Format=37843,e.SRGB8_ALPHA8_ASTC_6x6_Format=37844,e.SRGB8_ALPHA8_ASTC_8x5_Format=37845,e.SRGB8_ALPHA8_ASTC_8x6_Format=37846,e.SRGB8_ALPHA8_ASTC_8x8_Format=37847,e.Scene=lo,e.SceneUtils=wh,e.ShaderChunk=nr,e.ShaderLib=ir,e.ShaderMaterial=Un,e.ShadowMaterial=Gs,e.Shape=Xl,e.ShapeBufferGeometry=Ms,e.ShapeGeometry=Ts,e.ShapePath=xc,e.ShapeUtils=as,e.ShortType=1011,e.Skeleton=Go,e.SkeletonHelper=Mu,e.SkinnedMesh=zo,e.SmoothShading=2,e.Sphere=Ue,e.SphereBufferGeometry=Es,e.SphereGeometry=Cs,e.Spherical=hu,e.SphericalHarmonics3=oc,e.Spline=bh,e.SplineCurve=Ul,e.SplineCurve3=xh,e.SpotLight=Jl,e.SpotLightHelper=bu,e.Sprite=Co,e.SpriteMaterial=fo,e.SrcAlphaFactor=204,e.SrcAlphaSaturateFactor=210,e.SrcColorFactor=202,e.StaticCopyUsage=35046,e.StaticDrawUsage=te,e.StaticReadUsage=35045,e.StereoCamera=Rc,e.StreamCopyUsage=35042,e.StreamDrawUsage=35040,e.StreamReadUsage=35041,e.StringKeyframeTrack=ll,e.SubtractEquation=101,e.SubtractiveBlending=3,e.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},e.TangentSpaceNormalMap=0,e.TetrahedronBufferGeometry=Ls,e.TetrahedronGeometry=Rs,e.TextBufferGeometry=As,e.TextGeometry=Ps,e.Texture=ye,e.TextureLoader=Sl,e.TorusBufferGeometry=Is,e.TorusGeometry=Os,e.TorusKnotBufferGeometry=Ds,e.TorusKnotGeometry=Ns,e.Triangle=zt,e.TriangleFanDrawMode=2,e.TriangleStripDrawMode=1,e.TrianglesDrawMode=0,e.TubeBufferGeometry=ks,e.TubeGeometry=zs,e.UVMapping=n,e.Uint16Attribute=function(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new nn(e,t)},e.Uint16BufferAttribute=nn,e.Uint32Attribute=function(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new on(e,t)},e.Uint32BufferAttribute=on,e.Uint8Attribute=function(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new $t(e,t)},e.Uint8BufferAttribute=$t,e.Uint8ClampedAttribute=function(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new en(e,t)},e.Uint8ClampedBufferAttribute=en,e.Uniform=ou,e.UniformsLib=rr,e.UniformsUtils=Hn,e.UnsignedByteType=x,e.UnsignedInt248Type=M,e.UnsignedIntType=_,e.UnsignedShort4444Type=1017,e.UnsignedShort5551Type=1018,e.UnsignedShort565Type=1019,e.UnsignedShortType=b,e.VSMShadowMap=3,e.Vector2=fe,e.Vector3=Se,e.Vector4=xe,e.VectorKeyframeTrack=cl,e.Vertex=function(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Se(e,t,n)},e.VertexColors=2,e.VideoTexture=ha,e.WebGL1Renderer=oo,e.WebGLCubeRen
10derTarget=Yn,e.WebGLMultisampleRenderTarget=_e,e.WebGLRenderTarget=be,e.WebGLRenderTargetCube=function(e,t,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Yn(e,n)},e.WebGLRenderer=io,e.WebGLUtils=Qi,e.WireframeGeometry=Bs,e.WireframeHelper=function(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new na(new Bs(e.geometry),new qo({color:void 0!==t?t:16777215}))},e.WrapAroundEnding=V,e.XHRLoader=function(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new gl(e)},e.ZeroCurvatureEnding=U,e.ZeroFactor=200,e.ZeroSlopeEnding=W,e.ZeroStencilOp=0,e.sRGBEncoding=Y,Object.defineProperty(e,"__esModule",{value:!0})}))},{"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":19}],80:[function(e,t,n){"use strict";var r=e("../core/settings"),i=e("../core/browser"),o=e("../utils/math"),a=e("../helpers/webXRHelper");n.preInit=function(){(s=new Audio("".concat(r.AUDIO_PATH,"bgm.mp3"))).volume=0,s.loop=!0,l=["tap-1","tap-2"].map((function(e){var t=new Audio("".concat(r.AUDIO_PATH).concat(e,".mp3"));return t.volume=0,t}))},n.init=function(){(h=i.isMobile&&!i.isVRBrowser)||document.addEventListener("click",f,{once:!0});a.onSessionStarted.add(f)},n.isActive=function(){return c},n.getBGMElementSource=function(){return s},n.playHover=function(){var e=l[d];e.pause(),e.currentTime=0,e.play(),d=(d+1)%l.length},n.playBgm=f,n.play=function(){c=!0},n.pause=function(){c=!1},n.toggle=function(){c=!c},n.prepareVolumeTransition=function(){p=!0},n.setVolumeTransition=function(e){c&&(u=e)},n.endVolumeTransition=function(){p=!1},n.update=function(e){if(h)return;if(!p){var t=c?1:-1;u=o.staturate(u+e*t)}s.volume=u,l.forEach((function(e){e.volume=u}))};var s,l,c=!1,u=0,h=!1,d=0,p=!1;function f(){s.play(),c=!0}},{"../core/browser":88,"../core/settings":91,"../helpers/webXRHelper":99,"../utils/math":165}],81:[function(e,t,n){"use strict";var r=e("three"),i=e("mout/object/mixIn"),o=e("./cameraPlacements");function a(e){i(this,{id:"",type:"",needsApplyPosition:!1,needsApplyQuaternion:!1,position:new r.Vector3,quaternion:new r.Quaternion,opacity:1,count:0,fov:60},e),this.data=o[this.id],this.data&&this.data.length&&(this.count=this.data.length)}t.exports=a;var s=a.prototype;s.preInit=function(){},s.init=function(){},s.show=function(){},s.hide=function(){},s.reset=function(){},s.update=function(e){}},{"./cameraPlacements":87,"mout/object/mixIn":54,three:79}],82:[function(e,t,n){"use strict";var r=e("../core/settings"),i=(e("../core/properties"),e("./CameraMode")),o=e("three"),a=e("mout/object/mixIn"),s=e("./OrbitControls");function l(e){c.constructor.call(this,a({type:"free",needsApplyPosition:!0,needsApplyQuaternion:!0,fov:45,controls:null,camera:null,ratio:0},e))}var c=i.prototype,u=l.prototype=Object.create(c);t.exports=l,u.init=function(){this.camera=new o.PerspectiveCamera,this.controls=new s(this.camera,r.canvas),this.controls.target0.set(4.1,2,3),this.controls.position0.set(4.1,4,15),this.controls.zoom0=1,this.controls.reset()},u.show=function(){this.controls.enableDamping=!1,this.controls.update(0),this.controls.enableDamping=!0,this.controls.reset()},u.update=function(e){this.controls.update(e),this.position.copy(this.camera.position),this.quaternion.copy(this.camera.quaternion),c.update.call(this,e)};new o.Vector3},{"../core/properties":90,"../core/settings":91,"./CameraMode":81,"./OrbitControls":83,"mout/object/mixIn":54,three:79}],83:[function(e,t,n){"use strict";var r=e("three");t.exports=r.OrbitControls=function(e,t){var n,i,o,a,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new r.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!0,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!1,this.keys={LE
10FT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:r.MOUSE.ROTATE,MIDDLE:r.MOUSE.DOLLY,RIGHT:r.MOUSE.PAN},this.touches={ONE:r.TOUCH.ROTATE,TWO:r.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(c),l.update(),p=d.NONE},this.update=(n=new r.Vector3,i=(new r.Quaternion).setFromUnitVectors(e.up,new r.Vector3(0,1,0)),o=i.clone().inverse(),a=new r.Vector3,s=new r.Quaternion,function(){var e=l.object.position;return n.copy(e).sub(l.target),n.applyQuaternion(i),m.setFromVector3(n),l.autoRotate&&p===d.NONE&&A(2*Math.PI/60/60*l.autoRotateSpeed),l.enableDamping?(m.theta+=v.theta*l.dampingFactor,m.phi+=v.phi*l.dampingFactor):(m.theta+=v.theta,m.phi+=v.phi),m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),!0===l.enableDamping?l.target.addScaledVector(y,l.dampingFactor):l.target.add(y),n.setFromSpherical(m),n.applyQuaternion(o),e.copy(l.target).add(n),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(v.set(0,0,0),y.set(0,0,0)),g=1,!!(x||a.distanceToSquared(l.object.position)>f||8*(1-s.dot(l.object.quaternion))>f)&&(l.dispatchEvent(c),a.copy(l.object.position),s.copy(l.object.quaternion),x=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",ee,!1),l.domElement.removeEventListener("mousedown",X,!1),l.domElement.removeEventListener("wheel",K,!1),l.domElement.removeEventListener("touchstart",J,!1),l.domElement.removeEventListener("touchend",$,!1),l.domElement.removeEventListener("touchmove",Q,!1),document.removeEventListener("mousemove",q,!1),document.removeEventListener("mouseup",Y,!1),window.removeEventListener("keydown",Z,!1)};var l=this,c={type:"change"},u={type:"start"},h={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},p=d.NONE,f=1e-6,m=new r.Spherical,v=new r.Spherical,g=1,y=new r.Vector3,x=!1,b=new r.Vector2,_=new r.Vector2,w=new r.Vector2,S=new r.Vector2,M=new r.Vector2,T=new r.Vector2,E=new r.Vector2,C=new r.Vector2,L=new r.Vector2;function R(){return Math.pow(.95,l.zoomSpeed)}function A(e){v.theta-=e}function P(e){v.phi-=e}var I,O=(I=new r.Vector3,function(e,t){I.setFromMatrixColumn(t,0),I.multiplyScalar(-e),y.add(I)}),D=function(){var e=new r.Vector3;return function(t,n){!0===l.screenSpacePanning?e.setFromMatrixColumn(n,1):(e.setFromMatrixColumn(n,0),e.crossVectors(l.object.up,e)),e.multiplyScalar(t),y.add(e)}}(),N=function(){var e=new r.Vector3;return function(t,n){var r=l.domElement===document?l.domElement.body:l.domElement;if(l.object.isPerspectiveCamera){var i=l.object.position;e.copy(i).sub(l.target);var o=e.length();o*=Math.tan(l.object.fov/2*Math.PI/180),O(2*t*o/r.clientHeight,l.object.matrix),D(2*n*o/r.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(O(t*(l.object.right-l.object.left)/l.object.zoom/r.clientWidth,l.object.matrix),D(n*(l.object.top-l.object.bottom)/l.object.zoom/r.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function k(e){l.object.isPerspectiveCamera?g/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(e){l.object.isPerspectiveCamera?g*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function B(e){b.set(e.clientX,e.clientY)}function F(e){S.set(e.clientX,e.clientY)}function G(e){if(1==e.touches.length)b.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);b.set(t,n)}}function H(e){if(1==e.touches.length)S.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);S.set(t,n)}}function U(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);E.set(0,r)}function W(e){if(1==e.touches.length)_.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);_.set(t,n)}w.subVectors(_,b).multiplyScalar(l.rotateSpeed);var r=l.domElement===document?l.domElement.body:l.domElement;A(2*Math.PI*w.x/r.clientHeight),P(2*Math.PI*w.y/r.clientHeight),b.copy(_)}function V(e){if(1==e.touches.length)M.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);M.set(t,n)}T.subVectors(M,S).multiplyScalar(l.panSpeed),N(T.x,T.y),S.copy(M)}function j(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);C.set(0,r),L.set(0,Math.pow(C.y/E.y,l.zoomSpeed)),k(L.y),E.copy(C)}function X(e){if(!1!==l.enabled){switch(e.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),e.button){case 0:switch(l.mouseButtons.LEFT){case r.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===l.enablePan)return;F(e),p=d.PAN}else{if(!1===l.enableRotate)return;B(e),p=d.ROTATE}break;case r.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===l.enableRotate)return;B(e),p=d.ROTATE}else{if(!1===l.enablePan)return;F(e),p=d.PAN}break;default:p=d.NONE}break;case 1:switch(l.mouseButtons.MIDDLE){case r.MOUSE.DOLLY:if(!1===l.enableZoom)return;!function(e){E.set(e.clientX,e.clientY)}(e),p=d.DOLLY;break;default:p=d.NONE}break;case 2:switch(l.mouseButtons.RIGHT){case r.MOUSE.ROTATE:if(!1===l.enableRotate)return;B(e),p=d.ROTATE;break;case r.MOUSE.PAN:if(!1===l.enablePan)return;F(e),p=d.PAN;break;default:p=d.NONE}}p!==d.NONE&&(document.addEventListener("mousemove",q,!1),document.addEventListener("mouseup",Y,!1),l.dispatchEvent(u))}}function q(e){if(!1!==l.enabled)switch(e.preventDefault(),p){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){_.set(e.clientX,e.clientY),w.subVectors(_,b).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;A(2*Math.PI*w.x/t.clientHeight),P(2*Math.PI*w.y/t.clientHeight),b.copy(_),l.update(
10)}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){C.set(e.clientX,e.clientY),L.subVectors(C,E),L.y>0?k(R()):L.y<0&&z(R()),E.copy(C),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){M.set(e.clientX,e.clientY),T.subVectors(M,S).multiplyScalar(l.panSpeed),N(T.x,T.y),S.copy(M),l.update()}(e)}}function Y(e){!1!==l.enabled&&(document.removeEventListener("mousemove",q,!1),document.removeEventListener("mouseup",Y,!1),l.dispatchEvent(h),p=d.NONE)}function K(e){!1===l.enabled||!1===l.enableZoom||p!==d.NONE&&p!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(u),function(e){e.deltaY<0?z(R()):e.deltaY>0&&k(R()),l.update()}(e),l.dispatchEvent(h))}function Z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){var t=!1;switch(e.keyCode){case l.keys.UP:N(0,l.keyPanSpeed),t=!0;break;case l.keys.BOTTOM:N(0,-l.keyPanSpeed),t=!0;break;case l.keys.LEFT:N(l.keyPanSpeed,0),t=!0;break;case l.keys.RIGHT:N(-l.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),l.update())}(e)}function J(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:switch(l.touches.ONE){case r.TOUCH.ROTATE:if(!1===l.enableRotate)return;G(e),p=d.TOUCH_ROTATE;break;case r.TOUCH.PAN:if(!1===l.enablePan)return;H(e),p=d.TOUCH_PAN;break;default:p=d.NONE}break;case 2:switch(l.touches.TWO){case r.TOUCH.DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){l.enableZoom&&U(e),l.enablePan&&H(e)}(e),p=d.TOUCH_DOLLY_PAN;break;case r.TOUCH.DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;!function(e){l.enableZoom&&U(e),l.enableRotate&&G(e)}(e),p=d.TOUCH_DOLLY_ROTATE;break;default:p=d.NONE}break;default:p=d.NONE}p!==d.NONE&&l.dispatchEvent(u)}}function Q(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),p){case d.TOUCH_ROTATE:if(!1===l.enableRotate)return;W(e),l.update();break;case d.TOUCH_PAN:if(!1===l.enablePan)return;V(e),l.update();break;case d.TOUCH_DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){l.enableZoom&&j(e),l.enablePan&&V(e)}(e),l.update();break;case d.TOUCH_DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;!function(e){l.enableZoom&&j(e),l.enableRotate&&W(e)}(e),l.update();break;default:p=d.NONE}}function $(e){!1!==l.enabled&&(l.dispatchEvent(h),p=d.NONE)}function ee(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",ee,!1),l.domElement.addEventListener("mousedown",X,!1),l.domElement.addEventListener("wheel",K,!1),l.domElement.addEventListener("touchstart",J,!1),l.domElement.addEventListener("touchend",$,!1),l.domElement.addEventListener("touchmove",Q,!1),window.addEventListener("keydown",Z,!1),this.update()},r.OrbitControls.prototype=Object.create(r.EventDispatcher.prototype),r.OrbitControls.prototype.constructor=r.OrbitControls,r.MapControls=function(e,t){r.OrbitControls.call(this,e,t),this.mouseButtons.LEFT=r.MOUSE.PAN,this.mouseButtons.RIGHT=r.MOUSE.ROTATE,this.touches.ONE=r.TOUCH.PAN,this.touches.TWO=r.TOUCH.DOLLY_ROTATE},r.MapControls.prototype=Object.create(r.EventDispatcher.prototype),r.MapControls.prototype.constructor=r.MapControls},{three:79}],84:[function(e,t,n){"use strict";var r=e("../core/settings"),i=e("../core/properties"),o=e("./CameraMode"),a=e("../utils/math"),s=e("three"),l=e("min-signal"),c=e("mout/object/mixIn");function u(e){h.constructor.call(this,c({type:"spline",needsApplyPosition:!0,needsApplyQuaternion:!0,splineTime:0,totalDuration:0,fadeDuration:1,splineIndex:0,splines:[],onAnimationStarted:new l,onAnimationRestarted:new l,onAllAnimationStarted:new l},e))}var h=o.prototype,d=u.prototype=Object.create(h);t.exports=u,d.preInit=function(){h.preInit.call(this);for(var e=0;e<this.data.length;e++)i.loader.add(r.MODEL_PATH+"cameraPath"+e+".buf",{type:"xhr",responseType:"arraybuffer",weight:5,onLoad:this._setSpline.bind(this,e)})},d.init=function(){h.init.call(this),this.v=new s.Vector3,this.q=new s.Quaternion},d._setSpline=function(e,t){var n,r=0,i=new Int16Array(t,r,900),o=this.data[e].position;n=new Float32Array(900);for(var a=0,s=0;a<300;a++)n[s+0]=o[0].from+(i[s+0]- -32768)/65535*o[0].delta,n[s+1]=o[1].from+(i[s+1]- -32768)/65535*o[1].delta,n[s+2]=o[2].from+(i[s+2]- -32768)/65535*o[2].delta,s+=3;i=n,r+=1800;var l=new Int16Array(t,r,1200),c=this.data[e].quaternion;n=new Float32Array(1200);for(var u=0,h=0;u<300;u++)n[h+0]=c[0].from+(l[h+0]- -32768)/65535*c[0].delta,n[h+1]=c[1].from+(l[h+1]- -32768)/65535*c[1].delta,n[h+2]=c[2].from+(l[h+2]- -32768)/65535*c[2].delta,n[h+3]=c[3].from+(l[h+3]- -32768)/65535*c[3].delta,h+=4;l=n,this.totalDuration+=p,this.splines[e]={positions:i,quaternions:l}},d._applyTransform=function(e,t,n,r){var i=this.splines[e],o=t*(i.positions.length/3-1),a=Math.floor(o),s=Math.ceil(o),l=o%1;this.v.fromArray(i.positions,3*s),this.q.fromArray(i.quaternions,4*s).normalize(),n.fromArray(i.positions,3*a).lerp(this.v,l),r.fromArray(i.quaternions,4*a).normalize().slerp(this.q,l)},d.show=function(){this.splineTime=0,this.splineIndex=-1},d.restart=function(){this.splineIndex=0,this.splineTime=0,this.onAnimationRestarted.dispatch(this.splineIndex)},d.update=function(e){var t=this.splineIndex,n=!1;this.splineTime+=e,this.splineTime>=this.totalDuration&&(this.splineTime=this.splineTime%this.totalDuration,n=!0);this.splineIndex=Math.floor(this.splineTime/p);var r=this.splineTime-this.splineIndex*p,o=this.splineTime/p-this.splineIndex;this._applyTransform(this.splineIndex,o,this.position,this.quaternion),this.opacity=a.cUnMix(0,this.fadeDuration,r)*a.cUnMix(p,p-this.fadeDuration,r),h.update.call(this,e),t!==this.splineIndex&&i.isHome&&this.onAnimationStarted.dispatch(this.splineIndex);n&&this.onAllAnimationStarted.dispatch()};var p=15},{"../core/properties":90,"../core/settings":91,"../utils/math":165,"./CameraMode":81,"min-signal":32,"mout/object/mixIn":54,three:79}],85:[function(e,t,n){"use strict";e("../core/settings"),e("../core/properties");var r=e("./CameraMode"),i=e("../utils/math"),o=(e("three"),e("mout/object/mixIn")),a=e("gsap").gsap;function s(e){l.constructor.call(this,o({type:"still",index:0,needsApplyPosition:!0,needsApplyQuaternion:!0,fov:45,ratio:0},e))}var l=r.prototype,c=s.prototype=Object.create(l);t.exports=s,c.change=function(e,t){if(u)return h=e,void(d=t);var n=this;h=null,u=!0,e=void 0===e?n.index+1:e,e=i.loop(Math.round(e),n.count),void 0===t&&(t=1);0===(t=Math.max(t,0))?(a.set(n,{ratio:1}),u=!1):(a.set(n,{ratio:0}),a.to(n,t,{ratio:1,ease:"linear",onUpdate:function(){n.ratio>.5&&(n.index=e)},onComplete:function(){null!==h?setTimeout((function(){u=!1,n.change(h,d)}),4):u=!1}}
10))},c.update=function(e){this.position.fromArray(this.data[this.index].position),this.quaternion.fromArray(this.data[this.index].quaternion),this.opacity=2*Math.abs(this.ratio-.5),l.update.call(this,e)};var u=!1,h=null,d=0},{"../core/properties":90,"../core/settings":91,"../utils/math":165,"./CameraMode":81,gsap:31,"mout/object/mixIn":54,three:79}],86:[function(e,t,n){"use strict";e("../core/settings");var r=e("../core/properties"),i=e("../motions/BrownianMotion"),o=(e("../utils/math"),e("../utils/ease")),a=e("three"),s=e("min-signal"),l=e("../visual/screen/screen"),c=e("./SplineCameraMode"),u=e("./StillCameraMode"),h=e("./FreeCameraMode");n.preInit=function(){var e;f=new i,e=new c({id:"splines"}),p.push(d[e.id]=e),e.preInit(),e=new u({id:"wide"}),p.push(d[e.id]=e),e.preInit(),e=new u({id:"narrow"}),p.push(d[e.id]=e),e.preInit(),e=new h({id:"free"}),p.push(d[e.id]=e),e.preInit()},n.init=function(){for(var e=0,t=p.length;e<t;e++){p[e].init()}y=new a.Plane,m=new a.Vector3,v=new a.Euler,g=new a.Quaternion,r.onCanvasClicked.add(b),window.getCameraPlacement=function(){r.camera.position,r.camera.quaternion;console.log(JSON.stringify({position:r.camera.position.toArray(),quaternion:r.camera.quaternion.toArray()},null,"\t"))}},n.changeMode=function(e){n.prevId||(n.prevId=e);
10n.currId||(n.currId=e);n.pendingId=e},n.update=function(e){if(!n.currId)return;var t=x;if(x>=1){x+=1,x=1;n.prevId;n.prevId=n.currId,n.currId,n.currId!==n.pendingId&&(n.currId=n.pendingId,x=0,d[n.prevId].hide())}else(x+=1)>.5&&t<=.5&&d[n.currId].show();for(var i=0,a=p.length;i<a;i++){var s=p[i];s.id!==n.prevId&&s.id!==n.currId||s.update(e)}var c=d[x<=.5?n.prevId:n.currId];c.needsApplyPosition&&r.camera.position.copy(c.position);c.needsApplyQuaternion&&r.camera.quaternion.copy(c.quaternion);r.useCameraBrowianMotion&&(f.update(e),r.camera.scale.set(1,1,1),r.camera.updateMatrix(),r.camera.matrix.multiply(f.matrix),r.camera.matrix.decompose(r.camera.position,r.camera.quaternion,r.camera.scale));r.camera.translateZ(-0),v.set(.035*r.easedMouse.y,.035*-r.easedMouse.x,0),g.setFromEuler(v),r.camera.quaternion.multiply(g),v.set(0,0,-.05*(r.easedMouse.x-r.easedMouse2.x)),g.setFromEuler(v),r.camera.quaternion.multiply(g),r.camera.translateZ(0),this.opacity=Math.abs(2*x-1)*c.opacity,r.camera.fov=c.fov+3*o.easeInSine(1-this.opacity),m.copy(l.container.position).sub(r.camera.position),y.normal.set(0,0,-1).applyQuaternion(r.camera.quaternion);var u=1*y.distanceToPoint(m);u=u*Math.tan(c.fov/360*Math.PI/2)/Math.tan(r.camera.fov/360*Math.PI/2)-u,r.camera.translateZ(u),r.camera.updateMatrixWorld(!0),r.camera.updateProjectionMatrix()};var d=n.modes={},p=n.modeList=[];n.onHidden=new s,n.onShown=new s,n.opacity=0,n.prevId="",n.currId="",n.pendingId="";var f,m,v,g,y,x=.5;function b(){"wide"===n.currId?d.wide.change():"narrow"===n.currId&&d.narrow.change()}},{"../core/properties":90,"../core/settings":91,"../motions/BrownianMotion":114,"../utils/ease":164,"../utils/math":165,"../visual/screen/screen":169,"./FreeCameraMode":82,"./SplineCameraMode":84,"./StillCameraMode":85,"min-signal":32,three:79}],87:[function(e,t,n){"use strict";t.exports={wide:[{position:[-3.86112,1.66463,11.177],quaternion:[.0410949,-.258313,.010999,.965124]},{position:[6.64309,1.28259,10.4538],quaternion:[.0613687,.0171891,-.001057,.997967]},{position:[10.2943,.394463,21.1072],quaternion:[.0660138,.21823,-.0147976,.97355]},{position:[3.76581,.157657,9.04469],quaternion:[.12397,452596e-9,-565272e-10,.992286]},{position:[13.7098,2.39153,7.90597],quaternion:[.0250148,.44139,-.0123108,.896882]},{position:[3.97992,10.5303,14.9967],quaternion:[-.252286,.00652528,.00170133,.967629]}],narrow:[{position:[6.563506695197463,1.2053421671044566,11.721427551851155],quaternion:[.07235339920819156,.09268977892721994,-.009104865124938516,.9930209926967806]},{position:[4,3.5,20],quaternion:[0,0,0,1]},{position:[17.083583075061483,3.7632706951573613,8.618660976614565],quaternion:[.0006069572748726825,.48733460058309613,.0030478031878673826,.8732097855458953]},{position:[-1.4231127819800278,6.6314409841695525,14.066740644149997],quaternion:[-.12436861704951953,-.1881080008280786,-.021046071943262527,.9740148304689271]},{position:[4.037988775656856,.13405260557406617,9.36010886058748],quaternion:[.12842705872588486,.0020521684483088658,.0009307055713908252,.9917163974538374]},{position:[22.273006927926005,6.905623107518253,12.374569232631517],quaternion:[-.06396713651911962,.5279177269950565,.04136888028015895,.8458721503361385]}],splines:[{position:[{from:3.06638694,delta:2.8725926900000003},{from:.956994414,delta:.8530670360000001},{from:2.6344409,delta:14.6588616}],quaternion:[{from:.0627227277,delta:.0321194231},{from:-.116107941,delta:.1985006038},{from:-.00787693076,delta:.015784940679999998},{from:.990909398,delta:.006794214000000021}]},{position:[{from:3.00168753,delta:11.25556897},{from:.437801301,delta:3.9498205790000003},{from:6.39744711,delta:1.2771592099999998}],quaternion:[{from:-.0536227413,delta:.1736346523},{from:-.0232848153,delta:.5939637643000001},{from:-.0236081462,delta:.0609922055},{from:.818567336,delta:.17443859500000003}]},{position:[{from:3.37267137,delta:8.869496130000002},{from:.229441985,delta:6.768281115},{from:5.92908907,delta:8.18762163}],quaternion:[{from:-.102323972,delta:.261955463},{from:-.141995147,delta:.2388127075},{from:-.00902517606,delta:.03223437906},{from:.976635277,delta:.01881176299999998}]},{position:[{from:-4.2088666,delta:12.62041331},{from:.766577184,delta:1.8804708159999999},{from:7.16021013,delta:.21211099999999927}],quaternion:[{from:.00542296702,delta:.09432551028},{from:-.0353215225,delta:.3305241355},{from:-.00778369606,delta:.0100206153},{from:.955417812,delta:.04366457400000001}]}]}},{}],88:[function(e,t,n){"use strict";var r;Object.defineProperty(n,"__esModule",{value:!0}),n.seedRandom=n.baseUrl=n.WebAudioContext=n.transformOriginStyle=n.transformPerspectiveStyle=n.transform3dStyle=n.transformStyle=n.transitionStyle=n.filterStyle=n.isMac=n.isIOS=n.isMobile=n.isVRBrowser=n.isOculusBrowser=n.isSafari=n.isChrome=n.isFirefox=n.isIE=n.isEdge=n.cpuCoreCount=n.isSupportOpacity=n.isRetina=n.isIFrame=n.audioFormat=n.videoFormat=void 0;var i="Webkit Moz O ms".split(" "),o=document.createElement("div").style,a=window,s=document,l=(navigator.userAgent||navigator.vendor||window.opera).toLowerCase(),c=D("video",["video/mp4","video/ogv"]);n.videoFormat=c;var u=D("audio",["audio/mp3","audio/ogg"]);n.audioFormat=u;var h=a.self!==a.top;n.isIFrame=h;var d=a.devicePixelRatio&&a.devicePixelRatio>=1.5;n.isRetina=d;var p=o.opacity!==r;n.isSupportOpacity=p;var f=navigator.hardwareConcurrency||1;n.cpuCoreCount=f;var m=l.indexOf("edge")>-1;n.isEdge=m;var v=l.indexOf("msie")>-1;n.isIE=v;var g=l.indexOf("firefox")>-1;n.isFirefox=g;var y=!m&&l.indexOf("chrome")>-1;n.isChrome=y;var x=!m&&!y&&l.indexOf("safari")>-1;n.isSafari=x;var b=l.indexOf("oculusbrowser")>-1;n.isOculusBrowser=b;
10var _=!!b||l.indexOf("mobile vr")>-1;n.isVRBrowser=_;var w=/(iPad|iPhone|Android)/i.test(l);n.isMobile=w;var S=/(iPad|iPhone)/i.test(l);n.isIOS=S;var M=/(Mac)/i.test(l);n.isMac=M;var T=v?r:N("filter");n.filterStyle=T;var E=N("transition");n.transitionStyle=E;var C=N("transform");n.transformStyle=C;var L=N("transform","perspective");n.transform3dStyle=L;var R=N("perspective");n.transformPerspectiveStyle=R;var A=N("transformOrigin");n.transformOriginStyle=A;var P=a.AudioContext||a.webkitAudioContext;n.WebAudioContext=P;var I=document.location.origin;n.baseUrl=I;var O=e("seed-random")("AZ0xEIu9WazVHT");function D(e,t){var n,r;try{switch(e){case"video":n=new a.Video;break;case"audio":n=new a.Audio}}catch(t){n=s.createElement(e)}for(var i=0,o=t.length;i<o;i++)if(n.canPlayType&&n.canPlayType(t[i])){r=t[i].substr(t[i].indexOf("/")+1);break}return r}function N(e,t){return function(e,t){return t>1?i[t-2]+e.charAt(0).toUpperCase()+e.slice(1):1===t&&e}(e,function(e){var t=e.charAt(0).toUpperCase()+e.slice(1),n=i.length;for(;n--;)if(o[i[n]+t]!==r)return n+2;if(o[e]!==r)return 1;return 0}(t||e))}n.seedRandom=O},{"seed-random":78}],89:[function(e,t,n){"use strict";var r=e("./browser");n.add=function(e){if(window.atob){var t=window.console;t&&(r.isFirefox||r.isChrome?t.log.apply(t,["\n"+(e?atob("JWMgQ3JlYXRlZCBieSBMdXNpb24gJWMgaHR0cHM6Ly9sdXNpb24uY28vIA=="):atob("JWMgRGV2ZWxvcGVkIGJ5IEx1c2lvbiAlYyBodHRwczovL2x1c2lvbi5jby8g"))+"\n",atob("Y29sb3I6ICNmZmY7IGJhY2tncm91bmQ6ICMyMjI7IHBhZGRpbmc6NXB4IDVweDs="),atob("Y29sb3I6ICM5OTk7IGJhY2tncm91bmQ6ICNGQ0ZDRkM7IHBhZGRpbmc6NXB4IDA7")]):t.log(atob(e?"Q3JlYXRlZCBieSBMdXNpb24gLSBodHRwczovL2x1c2lvbi5jby8=":"RGV2ZWxvcGVkIGJ5IEx1c2lvbiAtIGh0dHBzOi8vbHVzaW9uLmNvLw==")))}}},{"./browser":88}],90:[function(e,t,n){"use strict";var r=e("min-signal");n.loader=e("quick-loader").create(),n.loadervr=e("quick-loader").create(),e("./disclaimer").add(!0),n.gl=null,n.isSupportWebGL=null,n.renderer=null,n.scene=null,n.camera=null,n.cameraXRContainer=null,n.xrContainer=null,n.postprocessing=null,n.isMouseDown=!1,n.hasMouseJustDown=!1,n.mouse=null,n.mouseDown=null,n.easedMouse=null,n.easedMouse2=null,n.mouseEaseRatio=.15,n.mouseEaseRatio2=.02,n.useCameraBrowianMotion=!0,n.sharedUniforms=null,n.resolution=null,n.isStageReady=!1,n.hasInitialized=!1,n.domElement=null,n.shaderTime=0,n.shaderFrame=0,n.shaderTimeMultiplier=1,n.fpsList=[60],n.fps=0,n.isXRSupported=!1,n.isSelectDown=!1,n.hasSelectJustDown=!1,n.rayOnScreenIntersection=null,n.isRaycastingFloor=!1,n.isRaycastingGallery=!1,n.rayOnGalleryIntersection=null,n.isRaycastingPrompt=!1,n.rayOnPromptIntersection=null,n.promptCallback=function(){},n.vrControls=null,n.isOculusLink=!1,n.onOculusLinkDetected=new r,n.viewQuality=3,n.renderEnabled=!0,n.width=0,n.height=0,n.dpiWidth=0,n.dpiHeight=0,n.useHalfScreen=null,n.hasResized=!1,n.forceRenderOnResize=!1,n.pageRatio=0,n.time=0,n.bgColor="#031a24",n.isHome=!1,n.isEditor=!1,n.isView=!1,n.isAbout=!1,n.isGallery=!1,n.isPreview=!1,n.useInterlacing=!1,n.currentSketch=null,n.viewSketch=null,n.forkSlotIndex=null,n.onCanvasClicked=new r,n.onShaderCompiled=new r,n.onShaderDataChanged=new r,n.onShaderTemplateChanged=new r,n.onTabChanged=new r,n.onHelperValueChanged=new r,n.modelId="person",n.templateShaderId="",n.vrCanvas=null,n.vrCanvasCtx=null,n.shaderInfos={title:null,username:null}},{"./disclaimer":89,"min-signal":32,"quick-loader":67}],91:[function(e,t,n){"use strict";var r=e("mout/lang/isBoolean"),i=e("mout/lang/isInteger"),o=e("mout/queryString/parse")(window.location.href),a=e("./browser");for(var s in n.QUERY_STRING=e("mout/queryString/encode")(o),n.FONT_PATH="assets/fonts/",n.MODEL_PATH="assets/models/",n.TEXTURE_PATH="assets/textures/",n.SHADER_PATH="assets/shaders/",n.AUDIO_PATH="assets/audios/",n.DATA_PATH="assets/data/",n.GLOBAL_ID="cineNoise",n.SHADERTOY_PREVIEW_URL="https://stark-scrubland-74879.herokuapp.com/https://www.shadertoy.com/media/shaders/",n.API_KEY="Ntrt4r",n.canvas=null,n.gl=null,n.webglOpts={antialias:!1,logarithmicDepthBuffer:!1,alpha:!1,xrCompatible:!0,powerPreference:"high-performance"},n.RENDER_TARGET_FLOAT_TYPE=null,n.DATA_FLOAT_TYPE=null,n.USE_FLOAT_PACKING=!1,n.USE_WEBGL2=!0,n.USE_LOCAL_CACHE=!0,n.LOG_API_TIME=!1,n.API_SIMULTANEOUS_REQUEST_NUMBER=3,n.SCREEN_RESOLUTION=a.isOculusBrowser||a.isMobile?256:512,n.SCREEN_GEOMETRY_RESOLUTION_SCALE=a.isOculusBrowser||a.isMobile?.25:1,n.SCREEN_SEGMENTS=n.SCREEN_RESOLUTION*n.SCREEN_GEOMETRY_RESOLUTION_SCALE-1,n.SCREEN_SIZE=6,n.DEFAULT_VIEW_QUALITY=a.isOculusBrowser||a.isMobile?2:3,n.SKIP_ANIMATION=!1,n.CONTAINER_WIDTH=1.8,n.CONTAINER_HEIGHT=1,n.CONTAINER_PADDING=20,n.CONTAINER_MARGIN_BOTTOM=.5,n.CANVAS_UI_WIDTH=2048,
10n.CANVAS_UI_HEIGHT=n.CANVAS_UI_WIDTH*n.CONTAINER_HEIGHT/n.CONTAINER_WIDTH,n.PAGINATION_WIDTH=1,n.PAGINATION_HEIGHT=.5*n.CONTAINER_MARGIN_BOTTOM,n.IS_CANVAS_DEBUG=!1,n.IS_VR_DEBUG=!1,n.MARGIN_BETWEEN_CELLS=40,n.CELLS_PER_ROW=3,n.CELLS_PER_COLUMN=2,n.CELL_WIDTH=n.CANVAS_UI_WIDTH/n.CELLS_PER_ROW-n.CONTAINER_PADDING/2,n.CELL_HEIGHT=n.CANVAS_UI_HEIGHT/n.CELLS_PER_COLUMN-n.CONTAINER_PADDING,n.CELL_PADDING=.01,n.CELLS_COUNT=n.CELLS_PER_ROW*n.CELLS_PER_COLUMN,n.CELL_REAL_WIDTH=n.CELL_WIDTH-n.MARGIN_BETWEEN_CELLS,n.CELL_REAL_HEIGHT=n.CELL_HEIGHT-n.MARGIN_BETWEEN_CELLS,n.CELL_INNER_WIDTH=n.CELL_REAL_WIDTH-2*n.CELL_PADDING,n.CELL_INNER_HEIGHT=n.CELL_REAL_HEIGHT-2*n.CELL_PADDING,n.TITLE_FONT_SIZE=.04,n.AUTHOR_FONT_SIZE=.03,n.BUTTON_FONT_SIZE=.04,n.PAGINATION_FONT_SIZE=.06,n.XR_BUFFER_SCALE=1,n.SELECTOR_WIDTH=n.CELL_WIDTH*n.CONTAINER_WIDTH/n.CANVAS_UI_WIDTH,n.SELECTOR_HEIGHT=n.CELL_HEIGHT*n.CONTAINER_HEIGHT/n.CANVAS_UI_HEIGHT,n.SHOW_FPS=!1,n.USE_REDIRECT_CORS_PROXY=!1,n.JOYSTICK_MOVE_MULTIPLIER=.04,n.JOYSTICK_ROTATE_MULTIPLIER=.01,n.OCULUSLINK_RAY_ROTATION_X=.56*-Math.PI,n.OCULUSLINK_RAY_OFFSET_X=.01,n.OCULUSLINK_RAY_OFFSET_Y=.001,n.OCULUSLINK_RAY_OFFSET_Z=-.05,n.EXPOSE_FUNCTIONS=!1,o)if(void 0!==n[s]){var l=o[s];r(n[s])?n[s]=!(0==l):i(n[s])&&(n[s]=parseInt(l,10))}n.IS_STAGING=window.location.href.includes("staging.cineshader.com"),n.IS_PRODUCTION=!n.IS_STAGING&&window.location.href.includes("cineshader.com"),(n.USE_REDIRECT_CORS_PROXY||n.IS_PRODUCTION)&&(n.SHADERTOY_PREVIEW_URL="/media-cors-proxy/")},{"./browser":88,"mout/lang/isBoolean":38,"mout/lang/isInteger":39,"mout/queryString/encode":56,"mout/queryString/parse":58}],92:[function(e,t,n){"use strict";var r=e("../../core/properties"),i=e("../../core/settings"),o=e("three"),a=e("glslify");n.preInit=function(){o.ShaderChunk.bsdfs+="\n"+a(["#define GLSLIFY 1\nfloat screenLightHeightRatio;\n// https://eheitzresearch.wordpress.com/415-2/\nvec3 FetchDiffuseFilteredTexture(sampler2D texLightFiltered, vec3 p1_, vec3 p2_, vec3 p3_, vec3 p4_) {\n // area light plane basis\n vec3 V1 = p2_ - p1_;\n vec3 V2 = p4_ - p1_;\n vec3 planeOrtho = (cross(V1, V2));\n float planeAreaSquared = dot(planeOrtho, planeOrtho);\n float planeDistxPlaneArea = dot(planeOrtho, p1_);\n // orthonormal projection of (0,0,0) in area light space\n vec3 P = planeDistxPlaneArea * planeOrtho / planeAreaSquared - p1_;\n\n // find tex coords of P\n float dot_V1_V2 = dot(V1,V2);\n float inv_dot_V1_V1 = 1.0 / dot(V1, V1);\n vec3 V2_ = V2 - V1 * dot_V1_V2 * inv_dot_V1_V1;\n vec2 Puv;\n Puv.y = dot(V2_, P) / dot(V2_, V2_);\n Puv.x = dot(V1, P)*inv_dot_V1_V1 - dot_V1_V2*inv_dot_V1_V1*Puv.y ;\n\n // LOD\n float d = abs(planeDistxPlaneArea) / pow(planeAreaSquared, 0.75);\n\n\tfloat lod = log(2048.0*d)/log(3.0);\n\t// vec2 uv = clamp(vec2(0.125, 0.125) + 0.75 * Puv, vec2(0.0), vec2(1.0));\n\tvec2 uv = clamp(Puv, vec2(0.0), vec2(1.0));\n\n // return texture2DLodEXT(texLightFiltered, uv, lod).rgb;\n\t// custom one for this project\n\t#ifdef IS_MOBILE\n\treturn lodMipmapSampleSmoothstep(texLightFiltered, uv, lod, u_screenTextureSize, u_screenMipmapTextureSize).rgb;\n\t#else\n\treturn lodMipmapSampleCubic(texLightFiltered, uv, lod, u_screenTextureSize, u_screenMipmapTextureSize).rgb;\n\t#endif\n}\n\nvec3 LTC_EvaluateWithCookie(sampler2D texLightFiltered, const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\n\t// bail if point is on back side of plane of light\n\t// assumes ccw winding order of light vertices\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\n\t// construct orthonormal basis around N\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\n\n\t// compute transform\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\n\t// transform rect\n\tvec3 coords[ 4 ];
10\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\n\tvec3 textureLight = FetchDiffuseFilteredTexture(texLightFiltered, coords[0], coords[1], coords[2], coords[3]);\n\n\t// project rect onto sphere\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\n\t// calculate vector form factor\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\n\t// adjust for horizon clipping\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\n/*\n\t// alternate method of adjusting for horizon clipping (see referece)\n\t// refactoring required\n\tfloat len = length( vectorFormFactor );\n\tfloat z = vectorFormFactor.z / len;\n\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\n\t// tabulated horizon-clipped sphere, apparently...\n\tvec2 uv = vec2( z * 0.5 + 0.5, len );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\tfloat scale = texture2D( ltc_2, uv ).w;\n\n\tfloat result = len * scale;\n*/\n\n\treturn vec3( result ) * textureLight;\n\n}"]),o.ShaderChunk.lights_physical_pars_fragment=o.ShaderChunk.lights_physical_pars_fragment.replace("void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight","uniform sampler2D u_areaLightCookies[NUM_RECT_AREA_LIGHTS]; \nvoid RE_Direct_RectArea_Physical(const in sampler2D areaLightCookie, const in RectAreaLight rectAreaLight"),o.ShaderChunk.lights_physical_pars_fragment=o.ShaderChunk.lights_physical_pars_fragment.replace("LTC_Evaluate(","LTC_EvaluateWithCookie(areaLightCookie, "),o.ShaderChunk.lights_physical_pars_fragment=o.ShaderChunk.lights_physical_pars_fragment.replace("LTC_Evaluate(","LTC_EvaluateWithCookie(areaLightCookie, "),o.ShaderChunk.lights_fragment_begin=o.ShaderChunk.lights_fragment_begin.replace("RE_Direct_RectArea( rectAreaLight","RE_Direct_RectArea( u_areaLightCookies[ i ], rectAreaLight"),r.loader.add(i.TEXTURE_PATH+"ltc_mats.buf",{type:"xhr",responseType:"arraybuffer",weight:128,onLoad:function(e){if(!o.UniformsLib.LTC_1){var t=new o.DataTexture(new Float32Array(e,0,16384),64,64,o.RGBAFormat,o.FloatType,o.UVMapping,o.ClampToEdgeWrapping,o.ClampToEdgeWrapping,o.LinearFilter,o.NearestFilter,1),n=new o.DataTexture(new Float32Array(e,65536,16384),64,64,o.RGBAFormat,o.FloatType,o.UVMapping,o.ClampToEdgeWrapping,o.ClampToEdgeWrapping,o.LinearFilter,o.NearestFilter,1);t.needsUpdate=!0,n.needsUpdate=!0,o.UniformsLib.LTC_1=t,o.UniformsLib.LTC_2=n;var r={ltc_1:{value:null},ltc_2:{value:null}};Object.assign(o.ShaderLib.standard.uniforms,r),Object.assign(o.ShaderLib.physical.uniforms,r)}}})}},{"../../core/properties":90,"../../core/settings":91,glslify:30,three:79}],93:[function(e,t,n){"use strict";var r=e("../../core/properties"),i=e("../../core/settings"),o=e("../../helpers/shaderHelper"),a=e("three"),s=e("glslify");n.preInit=function(){var e=new a.Texture(r.loader.add(i.TEXTURE_PATH+"LDR_RGB1_0.png",{weight:55,onLoad:function(){e.needsUpdate=!0}}).content);e.generateMipmaps=!1,e.minFilter=e.magFilter=a.NearestFilter,e.wrapS=e.wrapT=a.RepeatWrapping,c.u_blueNoiseTexture={value:e},c.u_blueNoiseTexelSize={value:new a.Vector2(1/128,1/128)},c.u_blueNoiseCoordOffset={value:l=new a.Vector2},o.addChunk("getBlueNoise",s(["#define GLSLIFY 1\nuniform sampler2D u_blueNoiseTexture;\nuniform vec2 u_blueNoiseTexelSize;\nuniform vec2 u_blueNoiseCoordOffset;\n\n// getBlueNoise(gl_FragCoord.xy)\nvec3 getBlueNoise (vec2 coord) {\n\treturn texture2D(u_blueNoiseTexture, coord * u_blueNoiseTexelSize + u_blueNoiseCoordOffset).rgb;\n}\n// getStaticBlueNoise(gl_FragCoord.xy)\nvec3 getStaticBlueNoise (vec2 coord) {\n\treturn texture2D(u_blueNoiseTexture, coord * u_blueNoiseTexelSize).rgb;\n}"]))},n.update=function(e){l.set(Math.random(),Math.random())};var l,c=n.sharedUniforms={}},{"../../core/properties":90,"../../core/settings":91,"../../helpers/shaderHelper":98,glslify:30,three:79}],94:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getBlur9Material=m,n.getBlur9DepthMaterial=function(e,t){t=!!t;var n=(e=!!e)?t?a:l:t?s:c,i=d.MAX_VARYING_VECTORS>8;n||(n=new p.RawShaderMaterial({uniforms:{u_texture:{type:"t",value:r},u_delta:{type:"v2",value:new p.Vector2}},vertexShader:i?d.precisionPrefix+f(["#define GLSLIFY 1\nattribute vec3 position;\n\nuniform vec2 u_delta;\nvarying vec2 v_uv[9];\n\nvoid main() {\n vec2 uv = position.xy * 0.5 + 0.5;\n\n v_uv[0] = uv;\n\n vec2 delta = u_delta;\n v_uv[1] = uv - delta;\n v_uv[2] = uv + delta;\n\n delta += u_delta;\n v_uv[3] = uv - delta;\n v_uv[4] = uv + delta;\n\n delta += u_delta;\n v_uv[5] = uv - delta;\n v_uv[6] = uv + delta;\n\n delta += u_delta;\n v_uv[7] = uv - delta;\n v_uv[8] = uv + delta;\n\n gl_Position = vec4( position, 1.0 );\n\n}\n"]):d.vertexShader,fragmentShader:d.precisionPrefix+f(i?["#define GLSLIFY 1\n#include <packing>\n\nuniform sampler2D u_texture;\nuniform float u_cameraFarSubNear;\nuniform float u_cameraNearMulFar;\nuniform float u_cameraNear;\nuniform float u_cameraFar;\n\nvarying vec2 v_uv[9];\n\n#if FROM_LINEAR\nfloat tap (vec2 uv) {\n return unpackRGBAToDepth(texture2D(u_texture, uv));\n}\n#else\nfloat tap (vec2 uv) {\n return u_cameraNearMulFar / (unpackRGBAToDepth(texture2D(u_texture, uv) * u_cameraFarSubNear - u_cameraFar);\n}\n#endif\n\n#if TO_LINEAR\nfloat encode (float depth) {\n return packDepthToRGBA(depth);\n}\n#else\nfloat encode (float depth) {\n return packDepthToRGBA((u_cameraNear + depth) * u_cameraFar) / (u_cameraFarSubNear * viewZ);\n}\n#endif\n\nvoid main() {\n vec4 color = tap(v_uv[0]) * 0.1633;\n color += tap( v_uv[1]) * 0.1531;\n color += tap( v_uv[2]) * 0.1531;\n color += tap( v_uv[3]) * 0.12245;\n color += tap( v_uv[4]) * 0.12245;\n color += tap( v_uv[5]) * 0.0918;\n color += tap( v_uv[6]) * 0.0918;\n color += tap( v_uv[7]) * 0.051;\n color += tap( v_uv[8]) * 0.051;\n\n gl_FragColor = encode(color);\n}\n"]:["#define GLSLIFY 1\n#include <packing>\n\nuniform sampler2D u_texture;\nuniform vec2 u_delta;\nuniform float u_cameraFarSubNear;\nuniform float u_cameraNearMulFar;\nuniform float u_cameraNear;\nuniform float u_cameraFar;\n\nvarying vec2 v_uv;\n\n#if FROM_LINEAR\nfloat tap (vec2 uv) {\n return unpackRGBAToDepth(texture2D(u_texture, uv));\n}\n#else\nfloat tap (vec2 uv) {\n return u_cameraNearMulFar / (unpackRGBAToDepth(texture2D(u_texture, uv) * u_cameraFarSubNear - u_cameraFar);\n}\n#endif\n\n#if TO_LINEAR\nfloat encode (float depth) {\n return packDepthToRGBA(depth);\n}\n#else\nfloat encode (float depth) {\n return packDepthToRGBA((u_cameraNear + depth) * u_cameraFar) / (u_cameraFarSubNear * viewZ);\n}\n#endif\n\nvoid main() {\n vec4 color = tap(v_uv) * 0.1633;\n\n vec2 delta = u_delta;\n color += tap(v_uv - delta) * 0.1531;\n color += tap(v_uv + delta) * 0.1531;\n\n delta += u_delta;\n color += tap(v_uv - delta) * 0.12245;\n color += tap(v_uv + delta) * 0.12245;\n\n delta += u_delta;\n color += tap(v_uv - delta) * 0.0918;\n color += tap(v_uv + delta) * 0.0918;\n\n delta += u_delta;\n color += tap(v_uv - delta) * 0.051;\n color += tap(v_uv + delta) * 0.051;\n\n gl_FragColor = encode(color);\n}\n"]),blending:p.NoBlending,transparent:!0,defines:{FROM_LINEAR:e,TO_LINEAR:t}}));e?t?a=n:l=n:t?s=n:c=n;return n},n.blur9=function(e,t,n,r,i,o){v(m(),.25,e,t,n,r,i,o)},n.blur9RGBA=function(e,t,n,r,i,o){v(m(!0),.25,e,t,n,r,i,o)},n.blur=v;
10var r,i,o,a,s,l,c,u,h,d=e("../../helpers/fboHelper"),p=e("three"),f=e("glslify");function m(e){var t=(e=!!e)?o:i,n=d.MAX_VARYING_VECTORS>8;return t||(t=new p.RawShaderMaterial({uniforms:{u_texture:{type:"t",value:r},u_delta:{type:"v2",value:new p.Vector2}},vertexShader:n?d.precisionPrefix+f(["#define GLSLIFY 1\nattribute vec3 position;\n\nuniform vec2 u_delta;\nvarying vec2 v_uv[9];\n\nvoid main() {\n vec2 uv = position.xy * 0.5 + 0.5;\n\n v_uv[0] = uv;\n\n vec2 delta = u_delta;\n v_uv[1] = uv - delta;\n v_uv[2] = uv + delta;\n\n delta += u_delta;\n v_uv[3] = uv - delta;\n v_uv[4] = uv + delta;\n\n delta += u_delta;\n v_uv[5] = uv - delta;\n v_uv[6] = uv + delta;\n\n delta += u_delta;\n v_uv[7] = uv - delta;\n v_uv[8] = uv + delta;\n\n gl_Position = vec4( position, 1.0 );\n\n}\n"]):d.vertexShader,fragmentShader:d.precisionPrefix+f(n?["#define GLSLIFY 1\nuniform sampler2D u_texture;\nvarying vec2 v_uv[9];\n\nvoid main() {\n\n #ifdef USE_RGBA\n vec4 color = texture2D( u_texture, v_uv[0] ) * 0.1633;\n color += texture2D( u_texture, v_uv[1] ) * 0.1531;\n color += texture2D( u_texture, v_uv[2] ) * 0.1531;\n color += texture2D( u_texture, v_uv[3] ) * 0.12245;\n color += texture2D( u_texture, v_uv[4] ) * 0.12245;\n color += texture2D( u_texture, v_uv[5] ) * 0.0918;\n color += texture2D( u_texture, v_uv[6] ) * 0.0918;\n color += texture2D( u_texture, v_uv[7] ) * 0.051;\n color += texture2D( u_texture, v_uv[8] ) * 0.051;\n\n gl_FragColor = color;\n #else\n vec4 center = texture2D( u_texture, v_uv[0] );\n vec3 color = center.rgb * 0.1633;\n color += texture2D( u_texture, v_uv[1] ).rgb * 0.1531;\n color += texture2D( u_texture, v_uv[2] ).rgb * 0.1531;\n color += texture2D( u_texture, v_uv[3] ).rgb * 0.12245;\n color += texture2D( u_texture, v_uv[4] ).rgb * 0.12245;\n color += texture2D( u_texture, v_uv[5] ).rgb * 0.0918;\n color += texture2D( u_texture, v_uv[6] ).rgb * 0.0918;\n color += texture2D( u_texture, v_uv[7] ).rgb * 0.051;\n color += texture2D( u_texture, v_uv[8] ).rgb * 0.051;\n\n gl_FragColor = vec4(color, center.a);\n #endif\n\n}\n"]:["#define GLSLIFY 1\nuniform sampler2D u_texture;\nuniform vec2 u_delta;\n\nvarying vec2 v_uv;\n\nvoid main() {\n\n #ifdef USE_RGBA\n vec4 color = texture2D( u_texture, v_uv ) * 0.1633;\n\n vec2 delta = u_delta;\n color += texture2D( u_texture, v_uv - delta ) * 0.1531;\n color += texture2D( u_texture, v_uv + delta ) * 0.1531;\n\n delta += u_delta;\n color += texture2D( u_texture, v_uv - delta ) * 0.12245;\n color += texture2D( u_texture, v_uv + delta ) * 0.12245;\n\n delta += u_delta;\n color += texture2D( u_texture, v_uv - delta ) * 0.0918;\n color += texture2D( u_texture, v_uv + delta ) * 0.0918;\n\n delta += u_delta;\n color += texture2D( u_texture, v_uv - delta ) * 0.051;\n color += texture2D( u_texture, v_uv + delta ) * 0.051;\n\n gl_FragColor = color;\n\n #else\n vec4 center = texture2D( u_texture, v_uv );\n vec3 color = center.rgb * 0.1633;\n\n vec2 delta = u_delta;\n color += texture2D( u_texture, v_uv - delta ).rgb * 0.1531;\n color += texture2D( u_texture, v_uv + delta ).rgb * 0.1531;\n\n delta += u_delta;\n color += texture2D( u_texture, v_uv - delta ).rgb * 0.12245;\n color += texture2D( u_texture, v_uv + delta ).rgb * 0.12245;\n\n delta += u_delta;\n color += texture2D( u_texture, v_uv - delta ).rgb * 0.0918;\n color += texture2D( u_texture, v_uv + delta ).rgb * 0.0918;\n\n delta += u_delta;\n color += texture2D( u_texture, v_uv - delta ).rgb * 0.051;\n color += texture2D( u_texture, v_uv + delta ).rgb * 0.051;\n\n gl_FragColor = vec4(color, center.a);\n\n #endif\n\n}\n"]),blending:p.NoBlending,transparent:e,defines:{USE_RGBA:e}}),e?o=t:i=t),t}function v(e,t,n,r,i,o,a,s){var l=Math.ceil(i.width*r)||0,c=Math.ceil(i.height*r)||0;o||(e.transparent?(h||(h=d.createRenderTarget(1,1,!0)),o=h):(u||(u=d.createRenderTarget(1,1)),o=u)),o.setSize(l,c),a?s||a.setSize(i.width,i.height):a=i,e.uniforms.u_texture.value=i.texture||i,e.uniforms.u_delta.value.set(n/l*t,0),d.render(e,o),e.uniforms.u_texture.value=o.texture||o,e.uniforms.u_delta.value.set(0,n/c*t),d.render(e,a)}},{"../../helpers/fboHelper":97,glslify:30,three:79}],95:[function(e,t,n){"use strict";e("../../core/properties");
10var r=e("../../helpers/shaderHelper"),i=e("three"),o=e("glslify");n.init=function(){s.u_glPositionOffset={value:a=new i.Vector2},r.addChunk("glPositionOffset",o(["#define GLSLIFY 1\nuniform vec2 u_glPositionOffset;\n\nvec4 glPositionOffset (vec4 glPosition) {\n\treturn glPosition + vec4(u_glPositionOffset * glPosition.w, 0.0, 0.0);\n}"]))},n.setOffset=function(e,t){a.set(e,t)};var a,s=n.sharedUniforms={}},{"../../core/properties":90,"../../helpers/shaderHelper":98,glslify:30,three:79}],96:[function(e,t,n){"use strict";var r=e("three"),i=e("glslify"),o=e("../../utils/math"),a=e("../../helpers/fboHelper"),s=e("../../helpers/shaderHelper");(n=t.exports=function(){this.tmpRenderTarget=a.createRenderTarget(1,1),this.maxMipmapLevel=0,this.textureSize=new r.Vector2;var e=c+1;this.geometry=u(e),this.oddGeometry=u(e)}).init=function(){s.addChunk("lodMipmapSample",i(["#define GLSLIFY 1\nvec2 getMipUv (vec2 uv, float lod, vec2 textureSize, vec2 mipmapTextureSize) {\n\tfloat isNonZeroLod = step(0.5, lod);\n\tvec2 xy = vec2(\n\t\tisNonZeroLod * textureSize.x / mipmapTextureSize.x,\n\t\t1.0 - 1.0 / pow(2.0, max(0.0, lod - 1.0))\n\t);\n\tvec2 wh = (max(vec2(1.0), floor(textureSize / pow(2.0, lod))));\n\treturn xy + (0.5 + uv * (wh - 1.0)) / mipmapTextureSize;\n}\n\nvec2 getMipUv (vec2 uv, float lod, vec2 textureSize, vec2 mipmapTextureSize, out vec4 clampRect) {\n\tfloat isNonZeroLod = step(0.5, lod);\n\tvec2 xy = vec2(\n\t\tisNonZeroLod * textureSize.x / mipmapTextureSize.x,\n\t\t1.0 - 1.0 / pow(2.0, max(0.0, lod - 1.0))\n\t);\n\tvec2 wh = (max(vec2(1.0), floor(textureSize / pow(2.0, lod))));\n\tvec2 halfTexelSize = 0.5 / mipmapTextureSize;\n\n\tclampRect = vec4(\n\t\txy + halfTexelSize,\n\t\txy + wh / mipmapTextureSize - halfTexelSize\n\t);\n\t\n\treturn xy + (0.5 + uv * (wh - 1.0)) / mipmapTextureSize;\n}\n\nvec4 lodMipmapSampleNearestCubic (sampler2D tex, vec2 uv, float lod, vec2 textureSize, vec2 mipmapTextureSize) {\n\tvec4 clampRect;\n\tuv = getMipUv(uv, lod, textureSize, mipmapTextureSize, clampRect);\n\treturn textureBicubic(tex, uv, mipmapTextureSize, clampRect);\n}\n\nvec4 lodMipmapSampleNearestSmoothstep (sampler2D tex, vec2 uv, float lod, vec2 textureSize, vec2 mipmapTextureSize) {\n\treturn textureSmoothstep(tex, getMipUv(uv, lod, textureSize, mipmapTextureSize), mipmapTextureSize);\n}\n\nvec4 lodMipmapSampleNearest (sampler2D tex, vec2 uv, float lod, vec2 textureSize, vec2 mipmapTextureSize) {\n\treturn texture2D(tex, getMipUv(uv, lod, textureSize, mipmapTextureSize));\n}\n\nvec4 lodMipmapSampleCubic (sampler2D tex, vec2 uv, float lod, vec2 textureSize, vec2 mipmapTextureSize) {\n\tfloat lodFloor = floor(lod);\n\tfloat lodCeil = lodFloor + 1.0;\n\tfloat lodFract = lod - lodFloor;\n\n\tvec4 loClamp, hiClamp;\n\tvec2 loUv = getMipUv(uv, lodFloor, textureSize, mipmapTextureSize, loClamp);\n\tvec2 hiUv = getMipUv(uv, lodCeil, textureSize, mipmapTextureSize, hiClamp);\n\treturn mix(\n\t\ttextureBicubic(tex, loUv, mipmapTextureSize, loClamp),\n\t\ttextureBicubic(tex, hiUv, mipmapTextureSize, hiClamp),\n\t\tlodFract\n\t);\n}\n\nvec4 lodMipmapSampleSmoothstep (sampler2D tex, vec2 uv, float lod, vec2 textureSize, vec2 mipmapTextureSize) {\n\tfloat lodFloor = floor(lod);\n\tfloat lodCeil = lodFloor + 1.0;\n\tfloat lodFract = lod - lodFloor;\n\treturn mix(\n\t\ttextureSmoothstep(tex, getMipUv(uv, lodFloor, textureSize, mipmapTextureSize), mipmapTextureSize),\n\t\ttextureSmoothstep(tex, getMipUv(uv, lodCeil, textureSize, mipmapTextureSize), mipmapTextureSize),\n\t\tlodFract\n\t);\n}\n\nvec4 lodMipmapSample (sampler2D tex, vec2 uv, float lod, vec2 textureSize, vec2 mipmapTextureSize) {\n\tfloat lodFloor = floor(lod);\n\tfloat lodCeil = lodFloor + 1.0;\n\tfloat lodFract = lod - lodFloor;\n\treturn mix(\n\t\ttexture2D(tex, getMipUv(uv, lodFloor, textureSize, mipmapTextureSize)),\n\t\ttexture2D(tex, getMipUv(uv, lodCeil, textureSize, mipmapTextureSize)),\n\t\tlodFract\n\t);\n}\n"]))};var l=n.prototype;l.resize=function(e,t,n,r){this.maxMipmapLevel=o.powerTwoFloorBase(t),this.tmpRenderTarget.setSize(n,r),this.textureSize.set(n,r);for(var i=this.geometry.attributes.position.array,a=this.geometry.attributes.uv.array,s=0,l=0,c=this.maxMipmapLevel;l<c;l++){var u=(l>0?e:0)/n,h=(r-(r>>Math.max(0,l-1)))/r,d=Math.max(1,e>>l)/n,p=Math.max(1,t>>l)/r;a[s+0]=u,a[s+1]=h+p,a[s+2]=u,a[s+3]=h,a[s+4]=u+d,a[s+5]=h+p,a[s+6]=u+d,a[s+7]=h+p,a[s+8]=u,a[s+9]=h,a[s+10]=u+d,a[s+11]=h,s+=12}var f=this.oddGeometry.attributes.uv.array,m=this.oddGeometry.attributes.position.array;s=0;for(var v=0,g=0,y=0,x=0,b=this.maxMipmapLevel-1;x<b;x++)i[v+0]=2*a[s+12]-1,i[v+1]=2*a[s+13]-1,i[v+3]=2*a[s+14]-1,i[v+4]=2*a[s+15]-1,i[v+6]=2*a[s+16]-1,i[v+7]=2*a[s+17]-1,i[v+9]=2*a[s+18]-1,i[v+10]=2*a[s+19]-1,i[v+12]=2*a[s+20]-1,i[v+13]=2*a[s+21]-1,i[v+15]=2*a[s+22]-1,i[v+16]=2*a[s+23]-1,(x+1)%2&&(m[y+0]=2*(f[g+0]=a[s+12])-1,m[y+1]=2*(f[g+1]=a[s+13])-1,m[y+3]=2*(f[g+2]=a[s+14])-1,m[y+4]=2*(f[g+3]=a[s+15])-1,m[y+6]=2*(f[g+4]=a[s+16])-1,m[y+7]=2*(f[g+5]=a[s+17])-1,m[y+9]=2*(f[g+6]=a[s+18])-1,m[y+10]=2*(f[g+7]=a[s+19])-1,m[y+12]=2*(f[g+8]=a[s+20])-1,m[y+13]=2*(f[g+9]=a[s+21])-1,m[y+15]=2*(f[g+10]=a[s+22])-1,m[y+16]=2*(f[g+11]=a[s+23])-1,g+=12,y+=18),s+=12,v+=18;this.geometry.attributes.uv.needsUpdate=!0,this.geometry.attributes.position.needsUpdate=!0,this.oddGeometry.attributes.uv.needsUpdate=!0,this.oddGeometry.attributes.position.needsUpdate=!0},l.render=function(e){var t=a.getColorState(),n=a.uvCopyMaterial;this.textureSize.x==e.width&&this.textureSize.y==e.height||(e.setSize(e.width,e.height),this.resize(Math.round(e.width/3*2),e.height,e.width,e.height));a.renderer.autoClear=!1;for(var r=e,i=this.tmpRenderTarget,o=0,s=0,l=this.maxMipmapLevel-1;s<l;s++){n.uniforms.u_texture.value=r.texture,this.geometry.drawRange.start=6*s,this.geometry.drawRange.count=6,a.renderGeometry(this.geometry,n,i),i===this.tmpRenderTarget&&o++;var c=i;i=r,r=c}this.oddGeometry.drawRange.start=0,this.oddGeometry.drawRange.count=6*o,n.uniforms.u_texture.value=this.tmpRenderTarget.texture,a.renderGeometry(this.oddGeometry,n,e),a.setColorState(t)};var c=14;function u(e){var t=new Float32Array(6*e*2),n=new Float32Array(6*e*3),i=new r.BufferGeometry;return i.setAttribute("position",new r.BufferAttribute(n,3)),i.setAttribute("uv",new r.BufferAttribute(t,2)),i}},{"../../helpers/fboHelper":97,"../../helpers/shaderHelper":98,"../../utils/math":165,glslify:30,three:79}],97:[function(e,t,n){"use strict";var r=e("three"),i=e("glslify");n.init=function(e,t){h=n.renderer=e,n.floatType=t,o=new r.Scene,(a=new r.Camera).position.z=1,(d=n.triGeom=new r.BufferGeometry).setAttribute("position",new r.BufferAttribute(new Float32Array([-1,-1,0,4,-1,0,-1,4,0]),3)),n.quadGeom=new r.PlaneBufferGeometry(2,2),(s=new r.Mesh(d)).frustumCulled=!1,o.add(s);var p=n.precisionPrefix="precision "+h.capabilities.precision+" float;\n";n.precisionPrefix2="#version 300 es\nprecision "+h.capabilities.precision+" float;\nprecision "+h.capabilities.precision+" int;\n#define IS_WEBGL2 true\n";n.vertexShader=p+i(["#define GLSLIFY 1\nattribute vec3 position;\nvarying vec2 v_uv;\n\nvoid main() {\n v_uv = position.xy * 0.5 + 0.5;\n gl_Position = vec4(position, 1.0 );\n}\n"]),n.copyMaterial=new r.RawShaderMaterial({uniforms:{u_texture:{value:null}},vertexShader:n.vertexShader,fragmentShader:p+i(["#define GLSLIFY 1\nuniform sampler2D u_texture;\n\nvarying vec2 v_uv;\n\nvoid main () {\n gl_FragColor = texture2D(u_texture, v_uv);\n}\n"]),depthTest:!1,depthWrite:!1,blending:r.NoBlending}),n.uvCopyMaterial=new r.RawShaderMaterial({uniforms:{u_texture:{value:null}},vertexShader:p+i(["#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nvarying vec2 v_uv;\n\nvoid main() {\n v_uv = uv;\n gl_Position = vec4(position, 1.0 );\n}\n"]),fragmentShader:p+i(["#define GLSLIFY 1\nuniform sampler2D u_texture;\n\nvarying vec2 v_uv;\n\nvoid main () {\n gl_FragColor = texture2D(u_texture, v_uv);\n}\n"]),depthTest:!1,depthWrite:!1,blending:r.NoBlending}),n.clearMaterial=new r.RawShaderMaterial({uniforms:{u_color:{value:new r.Vector4(1,1,1,1)}},vertexShader:p+i(["#define GLSLIFY 1\nattribute vec3 position;\n\nvoid main() {\n gl_Position = vec4(position, 1.0 );\n}\n"]),fragmentShader:p+i(["#define GLSLIFY 1\nuniform vec4 u_color;\n\nvoid main () {\n gl_FragColor = u_color;\n}\n"]),depthTest:!1,depthWrite:!1,transparent:!0,blending:r.NoBlending}),l=new r.Scene;var f=new r.PlaneBufferGeometry(1,1);f.translate(.5,-.5,0),u=new r.RawShaderMaterial({uniforms:{u_texture:{value:null},u_transform:{value:new r.Vector4(0,0,1,1)}},vertexShader:p+i(["#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform vec4 u_transform;\n\nvarying vec2 v_uv;\n\nvoid main() {\n v_uv = uv;\n gl_Position = vec4( position.xy * u_transform.zw + u_transform.xy, 0.0, 1.0 );\n}\n"]),fragmentShader:p+i(["#define GLSLIFY 1\nuniform sampler2D u_texture;\n\nvarying vec2 v_uv;\n\nvoid main () {\n gl_FragColor = texture2D(u_texture, v_uv);\n}\n"]),depthTest:!1,depthWrite:!1,blending:r.NoBlending}),c=new r.Mesh(f,u),l.frustumCulled=!1,l.add(c)},n.copy=function(e,t){var r=n.copyMaterial;r.uniforms.u_texture.value=e,p(r,t)},n.uvCopy=function(e,t){var r=n.uvCopyMaterial;r.uniforms.u_texture.value=e,p(r,t)},n.render=p,n.renderGeometry=function(e,t,n){s.geometry=e,p(t,n),s.geometry=d},n.renderMesh=function(e,t){s.visible=!1,o.add(e),t&&h.setRenderTarget(t||null);h.render(o,a),t&&h.setRenderTarget(null);o.remove(e),s.visible=!0},n.debugTo=function(e,t,n,i,o){t=t||200,n=n||200,i=i||0,o=o||0;var s=h.getSize(new r.Vector2);i=i/s.width*2-1,o=1-o/s.height*2,t=t/s.width*2,n=n/s.height*2,u.uniforms.u_texture.value=e,u.uniforms.u_transform.value.set(i,o,t,n);f();h.autoClearColor=!1,h.setRenderTarget(null),h.render(l,a),f()},n.clearColor=function(e,t,i,o,a){var s=n.clearMaterial;s.uniforms.u_color.value.set(e,t,i,o),s.transparent=o<1,s.blending=o<1?r.NormalBlending:r.NoBlending,p(n.clearMaterial,a),s.transparent=!1,s.blending=r.NoBlending},n.getColorState=f,n.setColorState=function(e){h.setClearColor(e.clearColor,e.clearAlpha),h.autoClear=e.autoClear,h.autoClearColor=e.autoClearColor,h.autoClearStencil=e.autoClearStencil,h.autoClearDepth=e.autoClearDepth},n.createRenderTarget=function(e,t,i,o,a){return new r.WebGLRenderTarget(e,t,{wrapS:r.ClampToEdgeWrapping,wrapT:r.ClampToEdgeWrapping,magFilter:o?r.NearestFilter:r.LinearFilter,minFilter:o?r.NearestFilter:r.LinearFilter,format:i?r.RGBAFormat:r.RGBFormat,type:a?n.floatType:r.UnsignedByteType,anisotropy:0,encoding:r.LinearEncoding,depthBuffer:!1,stencilBuffer:!1})},n.createMultisampleRenderTarget=function(e,t,i,o,a){return new r.WebGLMultisampleRenderTarget(e,t,{wrapS:r.ClampToEdgeWrapping,wrapT:r.ClampToEdgeWrapping,magFilter:o?r.NearestFilter:r.LinearFilter,minFilter:o?r.NearestFilter:r.LinearFilter,format:i?r.RGBAFormat:r.RGBFormat,type:a?n.floatType:r.UnsignedByteType,anisotropy:0,encoding:r.LinearEncoding,depthBuffer:!1,stencilBuffer:!1})};var o,a,s,l,c,u,h=n.renderer=null,d=(n.quadGeom=null,n.triGeom=null);function p(e,t){s.material=e,t&&h.setRenderTarget(t),h.render(o,a),t&&h.setRenderTarget(null)}function f(){return{autoClear:h.autoClear,autoClearColor:h.autoClearColor,autoClearStencil:h.autoClearStencil,autoClearDepth:h.autoClearDepth,clearColor:h.getClearColor().getHex(),clearAlpha:h.getClearAlpha()}}n.clearMaterial=null,n.floatType=null,n.precisionPrefix="",n.precisionPrefix2="",n.vertexShader=""},{glslify:30,three:79}],98:[function(e,t,n){"use strict";var r=e("three");function i(e){return e.replace(/#define\sGLSLIFY\s./,"")}function o(e){return"#include <"+e+">"}n.glslifyStrip=i,n.addChunk=function(e,t){r.ShaderChunk[e]=i(t)},n.insertBefore=function(e,t,n,r){r&&(t=o(t));return e.replace(t,i(n)+"\n"+t)},n.insertAfter=function(e,t,n,r){r&&(t=o(t));return e.replace(t,t+"\n"+i(n)+"\n")},n.replace=function(e,t,n,r){r&&(t=o(t));return e.replace(t,"\n"+i(n)+"\n")}},{three:79}],99:[function(e,t,n){"use strict";var r=e("min-signal"),i=e("../core/properties"),o=e("../core/settings"),a=e("../webxr/vrStage");n.preInit=function(e){"xr"in navigator?function(e){navigator.xr.isSessionSupported("immersive-vr").then((function(t){console.log("WebXR supported",t),i.isXRSupported=t,e(),t&&n.onXRInitialized.dispatch()})).catch((function(e){console.error(e)}))}(e):e()},n.init=function(e){s=e},n.enterWebXR=c,n.leaveWebXR=u,n.toggleWebXR=function(){i.isXRSupported&&(l?u():c())},n.onSessionStarted=new r,n.onSessionEnded=new r,n.onXRInitialized=new r;var s,l=null;function c(){if(console.log("ENTER",i.isXRSupported),i.isXRSupported){navigator.xr.requestSession("immersive-vr",{optionalFeatures:["local-floor"]}).then(h)}else console.warn("WebXR not supported")}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};i.isXRSupported&&l.end().then(e)}function h(e){e.addEventListener("end",d),s.xr.setFramebufferScaleFactor(o.XR_BUFFER_SCALE),s.xr.setSession(e),l=e,i.renderEnabled=!0,a.init(),console.log("SESSION STARTED",e),n.onSessionStarted.dispatch()}function d(){l&&l.removeEventListener("end",d),l=null,n.onSessionEnded.dispatch()}},{"../core/properties":90,"../core/settings":91,"../webxr/vrStage":196,"min-signal":32}],100:[function(e,t,n){"use strict";var r,i,o,a,s=e("@babel/runtime/helpers/interopRequireDefault")(e("./utils/JStats")),l=e("gsap").gsap,c=e("./core/browser"),u=e("./core/settings"),h=e("./core/properties"),d=e("./helpers/fboHelper"),p=e("./helpers/shaderHelper"),f=e("./helpers/webXRHelper"),m=e("./effects/mipmapper/Mipmapper"),v=e("./effects/glPositionOffset/glPositionOffset"),g=e("./effects/
10areaLights/areaLights"),y=e("./post/Postprocessing"),x=e("./post/smaa/Smaa"),b=e("./post/bloom/Bloom"),_=e("./post/final/Final"),w=e("./router/router"),S=e("./controls/cameraControls"),M=e("./visual/visual"),T=e("./shaders/shaders"),E=e("./audio/audio"),C=e("./input/input"),L=e("./ui/preloader"),R=e("./ui/shaderContext"),A=e("./ui/viewInfos"),P=e("./ui/editor/editor"),I=e("./ui/prompt/prompt"),O=e("./ui/header/header"),D=e("./ui/about/about"),N=e("./ui/xrButtons/xrButtons"),k=e("./ui/xrLanding/xrLanding"),z=e("./ui/gallery/gallery"),B=e("./webxr/vrStage"),F=e("./webxr/vrPreloader"),G=e("./io/exporter"),H=e("three"),U=e("glslify");e("mout/object/mixIn");t.exports=n=u,n.browser=c,n.properties=h,n.resize=Q;var W,V=!1,j=+new Date/1e3;function X(){L.init(q),v.init(),g.preInit(),M.preInit(),S.preInit(),E.preInit(),h.isXRSupported&&(f.init(r),F.init(f.enterWebXR),u.SHOW_FPS&&(W=new s.default(r),i.add(W))),h.isVRBrowser||z.preInit(),window.addEventListener("resize",Q),Q(),l.ticker.remove(l.updateRoot),$(),h.loader.start(L.onPreloading)}function q(){x.updateTextures(),M.init(),S.init(),i.add(M.container),C.init(),R.init(),P.init(),A.init(),O.init(),D.init(),c.isVRBrowser?k.show():z.init(),E.init(),w.init(),G.init(),h.hasInitialized=!0,Q()}function Y(){h.isXRSupported&&(B.preInit(),N.init(),c.isVRBrowser&&(k.init(),h.renderEnabled=!1,document.documentElement.classList.add("is-vr-browser")))}function K(){V=!0}function Z(){setTimeout(Q,0)}function J(){var e=h.renderer.xr;V&&e.enabled&&e.isPresenting&&(V=!1,Q())}function Q(e){var t=window.innerWidth,n=window.innerHeight,i=h.renderer.xr;if(i.enabled&&i.isPresenting){var s=i.getSession().renderState.baseLayer;t=s.framebufferWidth,n=s.framebufferHeight,B.resize(t,n)}if(h.rawWidth=t,h.rawHeight=n,h.useHalfScreen&&(t=Math.ceil(t/2)),h.hasResized=!0,h.isStageReady){var l=c.isVRBrowser?1:c.isRetina&&c.isMobile?1.25:1,d=t*l,p=n*l;window.renderWidth=t,window.renderHeight=n,h.width=d,h.height=p,h.resolution.set(d,p),o.aspect=d/p,o.updateProjectionMatrix(),r.setSize(d,p),a.setSize(d,p),u.canvas.style.width=t+"px",u.canvas.style.height=n+"px",h.hasInitialized&&(M.resize(d,p),P.resize(),h.forceRenderOnResize&&(ee(),h.forceRenderOnResize=!1))}}function $(){h.isXRSupported?r.setAnimationLoop($):requestAnimationFrame($),function(){var e=+new Date/1e3,t=G.isExporting?0:e-j;j=e,l.updateRoot(j);var n=r.xr;E.update(t),O.update(t,j),h.hasInitialized&&!c.isVRBrowser&&z.update(t);c.isVRBrowser&&!r.xr.isPresenting&&k.update(t);if(h.isGallery||h.isAbout||!h.renderEnabled)return;if(G.isExporting)G.update();else{h.fpsList.push(1/Math.max(1e-4,t)),h.fpsList.length>10&&h.fpsList.shift(),h.fps=0;for(var o=0,a=0,s=h.fpsList.length;a<s;a++){var d=h.fpsList[a];h.fps+=d,o=Math.max(d,o)}if(h.fps/=h.fpsList.length,h.isStageReady&&(h.time+=t,r.setClearColor(0,0),h.hasInitialized)){if(r.xr.enabled=h.isXRSupported,n.enabled&&n.isPresenting&&(h.viewQuality=2),C.update(t),S.update(t),M.update(t),P.update(),i.updateMatrixWorld(!0),h.final.bgColor=h.bgColor,h.final.opacity=h.renderer.xr.isPresenting?h.cameraXRContainer.userData.opacity:Math.min(S.opacity,h.pageRatio),h.isXRSupported&&(B.update(t),u.SHOW_FPS))if(W.update(t,j),h.renderer.xr.isPresenting){W.position.copy(h.cameraXRContainer.position);var p=r.xr.getController(0);W.position.add(p.position),W.position.y+=.2,W.quaternion.copy(p.quaternion)}else W.position.copy(h.camera.position),W.translateZ(-1),W.lookAt(h.camera.position);ee()}}h.hasResized=!1,h.hasMouseJustDown=!1,h.hasSelectJustDown=!1}()}function ee(){var e=r.xr;r.xr.enabled=h.isXRSupported,h.xrContainer&&(h.xrContainer.visible=h.cameraXRContainer.visible=e.isPresenting),e.enabled&&e.isPresenting?(r.setRenderTarget(null),h.smaa.enabled=!1,h.bloom.enabled=h.viewQuality>1,h.final.enabled=!0,a.render(i,o,!0)):(h.smaa.enabled=h.viewQuality>1,h.bloom.enabled=h.viewQuality>1,h.final.enabled=!0,a.render(i,o,!0))}c.isMobile&&document.documentElement.classList.add("is-mobile"),u.canvas=document.getElementById("main-canvas"),function(){if(u.USE_WEBGL2&&window.WebGL2RenderingContext)try{return u.gl=u.canvas.getContext("webgl2",u.webglOpts),u.RENDER_TARGET_FLOAT_TYPE=H.FloatType,u.DATA_FLOAT_TYPE=H.FloatType,!0}catch(e){}if(u.USE_WEBGL2=!1,window.WebGLRenderingContext)try{var e=u.gl=u.canvas.getContext("webgl",u.webglOpts)||u.canvas.getContext("experimental-webgl",u.webglOpts);return(e.getExtension("OES_texture_float")||e.getExtension("OES_texture_half_float"))&&e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(u.RENDER_TARGET_FLOAT_TYPE=c.isIOS||!e.getExtension("OES_texture_float")?H.HalfFloatType:H.FloatType,u.DATA_FLOAT_TYPE=H.FloatType):(u.USE_FLOAT_PACKING=!0,u.RENDER_TARGET_FLOAT_TYPE=u.DATA_FLOAT_TYPE=H.UnsignedByteType),!0}catch(e){return!1}return!1}()&&(f.onXRInitialized.add(Y),f.onSessionStarted.add(K),f.onSessionEnded.add(Z),f.preInit((function(){!function(){h.loader.register(e("./loaders/BufItem"));var t=u.gl.getExtension;u.gl.getExtension=function(e){return"OVR_multiview2"===e?null:t.apply(u.gl,arguments)},(r=h.renderer=new H.WebGLRenderer({canvas:u.canvas,context:u.gl})).xr.enabled=h.isXRSupported,p.addChunk("textureBicubic",U(["#define GLSLIFY 1\nvec4 cubic(float v) {\n vec4 n = vec4(1.0, 2.0, 3.0, 4.0) - v;\n vec4 s = n * n * n;\n float x = s.x;
10\n float y = s.y - 4.0 * s.x;\n float z = s.z - 4.0 * s.y + 6.0 * s.x;\n float w = 6.0 - x - y - z;\n return vec4(x, y, z, w);\n}\n\n// https://stackoverflow.com/questions/13501081/efficient-bicubic-filtering-code-in-glsl\nvec4 textureBicubic(sampler2D t, vec2 texCoords, vec2 textureSize) {\n vec2 invTexSize = 1.0 / textureSize;\n texCoords = texCoords * textureSize - 0.5;\n\n vec2 fxy = fract(texCoords);\n texCoords -= fxy;\n vec4 xcubic = cubic(fxy.x);\n vec4 ycubic = cubic(fxy.y);\n\n vec4 c = texCoords.xxyy + vec2 (-0.5, 1.5).xyxy;\n\n vec4 s = vec4(xcubic.xz + xcubic.yw, ycubic.xz + ycubic.yw);\n vec4 offset = c + vec4 (xcubic.yw, ycubic.yw) / s;\n\n offset *= invTexSize.xxyy;\n\n vec4 sample0 = texture2D(t, offset.xz);\n vec4 sample1 = texture2D(t, offset.yz);\n vec4 sample2 = texture2D(t, offset.xw);\n vec4 sample3 = texture2D(t, offset.yw);\n\n float sx = s.x / (s.x + s.y);\n float sy = s.z / (s.z + s.w);\n\n return mix(\n mix(sample3, sample2, sx), mix(sample1, sample0, sx)\n , sy);\n}\n\nvec4 textureBicubic(sampler2D t, vec2 texCoords, vec2 textureSize, vec4 clampRect) {\n vec2 invTexSize = 1.0 / textureSize;\n texCoords = texCoords * textureSize - 0.5;\n\n vec2 fxy = fract(texCoords);\n texCoords -= fxy;\n vec4 xcubic = cubic(fxy.x);\n vec4 ycubic = cubic(fxy.y);\n\n vec4 c = texCoords.xxyy + vec2 (-0.5, 1.5).xyxy;\n\n vec4 s = vec4(xcubic.xz + xcubic.yw, ycubic.xz + ycubic.yw);\n vec4 offset = c + vec4 (xcubic.yw, ycubic.yw) / s;\n\n offset *= invTexSize.xxyy;\n\n vec4 sample0 = texture2D(t, clamp(offset.xz, clampRect.xy, clampRect.zw));\n vec4 sample1 = texture2D(t, clamp(offset.yz, clampRect.xy, clampRect.zw));\n vec4 sample2 = texture2D(t, clamp(offset.xw, clampRect.xy, clampRect.zw));\n vec4 sample3 = texture2D(t, clamp(offset.yw, clampRect.xy, clampRect.zw));\n\n float sx = s.x / (s.x + s.y);\n float sy = s.z / (s.z + s.w);\n\n return mix(\n mix(sample3, sample2, sx), mix(sample1, sample0, sx)\n , sy);\n}"])),p.addChunk("textureSmoothstep",U(["#define GLSLIFY 1\n// http://www.iquilezles.org/www/articles/texture/texture.htm\nvec4 textureSmoothstep(sampler2D t, vec2 texCoords, vec2 textureSize) {\n\ttexCoords = texCoords * textureSize + 0.5;\n\tvec2 iTexCoords = floor( texCoords );\n\tvec2 fTexCoords = fract( texCoords );\n\ttexCoords = iTexCoords + fTexCoords*fTexCoords*(3.0-2.0*fTexCoords);\n\ttexCoords = (texCoords - 0.5)/textureSize;\n\treturn texture2D( t, texCoords );\n}\n"])),(i=h.scene=new H.Scene).onBeforeRender=J,o=h.camera=new H.PerspectiveCamera(60,1,.05,100),h.isXRSupported?(h.cameraXRContainer=new H.Group,h.cameraXRContainer.userData.opacity=0,h.cameraXRContainer.add(o),i.add(h.cameraXRContainer),h.xrContainer=new H.Object3D,i.add(h.xrContainer)):i.add(o),h.resolution=new H.Vector2,h.sharedUniforms={u_resolution:{value:h.resolution}},d.init(r,u.RENDER_TARGET_FLOAT_TYPE),a=h.postprocessing=new y,x.setTextures(h.loader.add(u.TEXTURE_PATH+"smaa-area.png",{weight:32}).content,h.loader.add(u.TEXTURE_PATH+"smaa-search.png",{weight:.1}).content),a.queue.push(h.smaa=new x),a.queue.push(h.bloom=new b),a.queue.push(h.final=new _),m.init(),h.isStageReady=!0}(),I.init(),T.init(),w.preInit(X)})))},{"./audio/audio":80,"./controls/cameraControls":86,"./core/browser":88,"./core/properties":90,"./core/settings":91,"./effects/areaLights/areaLights":92,"./effects/glPositionOffset/glPositionOffset":95,"./effects/mipmapper/Mipmapper":96,"./helpers/fboHelper":97,"./helpers/shaderHelper":98,"./helpers/webXRHelper":99,"./input/input":101,"./io/exporter":103,"./loaders/BufItem":111,"./post/Postprocessing":122,"./post/bloom/Bloom":123,"./post/final/Final":124,"./post/smaa/Smaa":125,"./router/router":126,"./shaders/shaders":128,"./ui/about/about":129,"./ui/editor/editor":131,"./ui/gallery/gallery":151,"./ui/header/header":153,"./ui/preloader":154,"./ui/prompt/prompt":155,"./ui/shaderContext":157,"./ui/viewInfos":159,"./ui/xrButtons/xrButtons":160,"./ui/xrLanding/xrLanding":161,"./utils/JStats":162,"./visual/visual":174,"./webxr/vrPreloader":195,"./webxr/vrStage":196,"@babel/runtime/helpers/interopRequireDefault":11,glslify:30,gsap:31,"mout/object/mixIn":54,three:79}],101:[function(e,t,n){"use strict";var r,i,o,a=e("../core/settings"),s=e("../core/properties"),l=e("../utils/math"),c=e("three");n.init=function(){var e=a.canvas;s.mouse=new c.Vector2,s.mouseDown=new c.Vector2,s.easedMouse=new c.Vector2,s.easedMouse2=new c.Vector2,e.addEventListener("mousedown",h),e.addEventListener("touchstart",m(h)),e.addEventListener("mousemove",d),e.addEventListener("touchmove",m(d)),document.documentElement.addEventListener("mouseup",p),document.documentElement.addEventListener("touchend",m(p))},n.update=function(e){s.easedMouse.lerp(s.mouse,s.mouseEaseRatio),s.easedMouse2.lerp(s.mouse,s.mouseEaseRatio2)};var u=0;function h(e){e.stopPropagation&&e.stopPropagation(),r=f(e),s.mouseDown.set(r.x,r.y),i=r.x,o=r.y,u=+new Date,s.isMouseDown=!0,s.hasMouseJustDown=!0,d(e)}function d(e){r=f(e),s.mouse.set(r.x,r.y),r.x,r.y}function p(e){r=f(e),s.isMouseDown=!1,s.mouseDown.set(r.x,r.y),l.distanceTo(r.x-i,r.y-o)<40&&+new Date-u<200&&s.onCanvasClicked.dispatch(r)}function f(e){var t=a.canvas.getBoundingClientRect();return{x:l.clamp((e.clientX-t.left)/t.width*2-1,-1,1),y:l.clamp(1-(e.clientY-t.top)/t.height*2,-1,1)}}function m(e){return function(t){e.call(this,t.changedTouches[0]||t.touches[0])}}},{"../core/properties":90,"../core/settings":91,"../utils/math":165,three:79}],102:[function(e,t,n){"use strict";var r=e("../core/settings"),i=e("./localStorage");n.getIds=function(e,t,n,u){var h=r.IS_PRODUCTION?s:l;if(h[n].length){var d=c(h[n],e,t),p=d.idList,f=d.isEnd;u({success:!0,idList:p,isEnd:f})}else!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_VALUE,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){};if(!r.IS_PRODUCTION){var h=slice(l[e],t,n),d=h.idList,p=h.isEnd;return void u({success:!0,idList:d,isEnd:p})}var f=i.loadShaderIdList(e),m=Date.now()-f.timestamp<=o;if(f&&m){var v=c(f.idList,t,n),g=v.idList,y=v.isEnd;return void u({success:!0,isCached:!0,idList:g,isEnd:y})}var x=new XMLHttpRequest;x.responseType="json",x.open("GET","".concat(a).concat(e,".json"),!0),x.send(null),x.onreadystatechange=function(){if(4===x.readyState)if(200===x.status){var r=x.response.Results;s[e]=r,i.saveShaderIdList(e,r);var o=c(r,t,n),a=o.idList,h=o.isEnd;u({success:!0,idList:a,isEnd:h})}else{var d=c(l[e],t,n),p=d.idList,f=d.isEnd;u({success:!0,idList:p,isEnd:f})}},x.onerror=function(r){console.error("Log: -> xmlhttp.onerror -> event",r);var i=c(l[e],t,n),o=i.idList,a=i.isEnd;u({success:!0,idList:o,isEnd:a})}}(n,e,t,u)};var o=9e5,a="https://backend.cineshader.com/",s={popular:[],newest:[],hot:[],name:[],love:[]},l={popular:e("./popular.json").Results,newest:e("./newest.json").Results,hot:e("./hot.json").Results,name:e("./name.json").Results,love:e("./love.json").Results};
10function c(e,t,n){var r=t,i=t+n,o=i>=e.length;return{idList:e.slice(r,i),isEnd:o}}r.EXPOSE_FUNCTIONS&&(window.backend={},window.backend.ids=s,window.backend.idsLocal=l)},{"../core/settings":91,"./hot.json":104,"./localStorage":105,"./love.json":106,"./name.json":107,"./newest.json":108,"./popular.json":109}],103:[function(e,t,n){"use strict";var r,i=e("three"),o=e("glslify"),a=e("../core/properties"),s=e("../utils/math"),l=e("../helpers/fboHelper"),c=e("../effects/glPositionOffset/glPositionOffset"),u=e("min-signal");n.init=function(){r=new i.PerspectiveCamera,h=l.createRenderTarget(1,1,!0,!0,!0),d=l.createRenderTarget(1,1,!0,!0),p=new i.RawShaderMaterial({uniforms:{u_texture:{value:h.texture},u_iteration:{value:0}},vertexShader:l.vertexShader,fragmentShader:l.precisionPrefix+o(["#define GLSLIFY 1\nuniform sampler2D u_texture;\nuniform float u_iteration;\n\nvarying vec2 v_uv;\n\nvoid main () {\n\tvec4 sum = texture2D(u_texture, v_uv);\n sum /= u_iteration;\n\tgl_FragColor = vec4(sum.rgb, 1.0);\n}"]),blending:i.NoBlending,depthTest:!1,depthWrite:!1,transparent:!0})},n.save=function(e,t,r){n.isExporting=!0,m=s.clamp(r||64,4,128),f=0,v=e||3840,g=t||2160;var i=0,o=Math.max(1,Math.sqrt(m-1));x.length=0;for(var a=0;a<m;a++){i+=2.3999632297286535;var c=Math.sqrt(a)/o,u=Math.cos(i),y=Math.sin(i);c*=Math.min(Math.abs(1/u),Math.abs(1/y)),x.push({x:u*c,y:-y*c})}p.uniforms.u_iteration.value=m,h.setSize(v,g),d.setSize(v,g),l.clearColor(0,0,0,1,h),n.onExportStarted.dispatch(m)},n.update=function(){if(n.isExporting){0===f&&(y=a.time,r.copy(a.camera),a.camera.matrixWorld.decompose(r.position,r.quaternion,r.scale),r.aspect=v/g,r.updateProjectionMatrix());var e=a.postprocessing.width,t=a.postprocessing.height,o=a.time;a.time=y,a.postprocessing.setSize(v,g);var s=x[f];s&&c.setOffset(s.x/v,s.y/g);var u=a.smaa.enabled;a.smaa.enabled=!1,n.onBeforeRender.dispatch(f,s),a.postprocessing.render(a.scene,r,!1),n.onAfterRender.dispatch(f,s),a.smaa.enabled=u,l.copyMaterial.blending=i.CustomBlending,l.copyMaterial.blendSrc=i.OneFactor,l.copyMaterial.blendDst=i.OneFactor,l.copyMaterial.blendEquation=i.AddEquation,l.copyMaterial.blendSrcAlpha=i.OneFactor,l.copyMaterial.blendDstAlpha=i.OneFactor,l.copyMaterial.blendEquationAlpha=i.AddEquation;var b=l.getColorState();if(l.renderer.autoClearColor=!1,l.copy(a.postprocessing.fromTexture,h),l.setColorState(b),c.setOffset(0,0),l.copyMaterial.blending=i.NoBlending,a.time=o,a.postprocessing.setSize(e,t),++f>=m){l.render(p,d);var _=new Uint8Array(v*g*4);l.renderer.readRenderTargetPixels(d,0,0,v,g,_);var w=document.createElement("canvas"),S=w.getContext("2d");w.width=v,w.height=g,w.ctx=S;for(var M=S.createImageData(v,g),T=M.data,E=4*v,C=0,L=0,R=(g-1)*E;C<g;C++){for(var A=0;A<E;A++)T[L+A]=_[R+A];L+=E,R-=E}S.putImageData(M,0,0),n.onExportUpdated.dispatch(f/m),n.isExporting=!1,n.onExportEnded.dispatch(w)}else n.onExportUpdated.dispatch(f/m)}},n.onExportStarted=new u,n.onExportUpdated=new u,n.onExportEnded=new u,n.onBeforeRender=new u,n.onAfterRender=new u,n.isExporting=!1;var h,d,p,f=0,m=0,v=0,g=0,y=0,x=[]},{"../core/properties":90,"../effects/glPositionOffset/glPositionOffset":95,"../helpers/fboHelper":97,"../utils/math":165,glslify:30,"min-signal":32,three:79}],104:[function(e,t,n){t.exports={Shaders:99,Results:["wsGczG","WlcyD7","tsXBzS","WdVfRc","wlycRR","3sySRK","ttKGDt","wtcSzN","Wt33Wf","tt3XDn","wlVGWd","tlVGDt","wtdSR8","tdG3Rd","3sc3z4","3dVczw","WslGWl","XtVczV","wlBBWy","XlSGzz","llXfRr","ll3SWl","ts3yD7","WdXBW4","wdsfDH","Ml2XRD","MdXSWn","lllSR2","WtsBzf","WtKSzt","tt3yRH","WsjBRW","wttXDl","tlGXRz","3ttSzr","WtdXR8","WldSRn","wttXz8","wl3czM","tsVcWt","ttlyWB","XsX3zl","wtcyWr","3stBDf","WsVyzc","WltyR7","WdKXz3","WdycRw","tltcR4","tdKGW1","wddBzS","WscBzB","tsGyW3","WlBBzV","tsdfDf","wlGXRD","wt3SWj","wltSRS","3l3SzM","3lcSW2","ttK3Wt","wldSWH","wlGGWG","WlcXR4","3tdSRn","3l3XDr","tsVfRG","tlcSRN","3sKyWz","MlyBRd","WsG3Ry","3l2czV","MlsfR4","XsBfRW","ltXyzS","3dBBzz","wssXzr","3d23Rc","3lcSR8","3sfczf","ttfyWB","ttlyWf","tldSWH","3t3XDr","Wt3XDr","WldXRH","3tG3Rm","3lcSRn","tlcSR8","WsSGWG","WdGXRc","MsfXRf","WsV3D1","Xdj3DV","tdB3zV","tljXR1","4tKBW3","MtBfWw","XsdGW7"],timestamp:"2021-01-12T15:51:28.603Z"}},{}],105:[function(e,t,n){"use strict";n.checkForSlot=function(e){return!!window.localStorage.getItem("slot_"+e)},n.loadFromSlot=function(e){var t=window.localStorage.getItem("slot_"+e);return JSON.parse(t)},n.saveToSlot=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:properties.currentSketch;window.localStorage.setItem("slot_"+e,JSON.stringify(t))},n.checkForShaderIdList=function(){return!!window.localStorage.getItem(shaderIdList)},n.loadShaderIdList=function(e){var t=window.localStorage.getItem("shaderIdList_"+e);return!!t&&JSON.parse(t)},n.saveShaderIdList=function(e,t){var n={timestamp:Date.now(),idList:t};window.localStorage.setItem("shaderIdList_"+e,JSON.stringify(n))},n.checkForShader=function(e){return!!window.localStorage.getItem("shader_"+e)},n.loadShader=function(e){var t=window.localStorage.getItem("shader_"+e);return!!t&&JSON.parse(t)},n.saveShader=function(e,t){var n={timestamp:Date.now(),shaderInfo:t};window.localStorage.setItem("shader_"+e,JSON.stringify(n))}},{}],106:[function(e,t,n){t.exports={Shaders:99,Results:["MdXSWn","wsGczG","WdVfRc","WlcyD7","llXfRr","tsXBzS","tsVcWt","ttKGDt","Wt33Wf","wtcSzN","Ml2XRD","WsSGWG","tt3yRH","3sySRK","wlGGWG","tdG3Rd","3sc3z4","3dVczw","XsBfRW","WlBBzV","3stBDf","tlVGDt","wlycRR","XsX3zl","WslGWl","ttlyWB","wl3czM","ttlyWf","3ttSzr","wddBzS","WscBzB","ll3SWl","WtdXR8","ltXyzS","WdXBW4","WsG3Ry","XlSGzz","ttfyWB","wlVGWd","lllSR2","tdKGW1","ts3yD7","WtKSzt","MlyBR
10d","WldSRn","WsV3D1","wdsfDH","wttXz8","MsfXRf","wttXDl","XtVczV","MlsfR4","wssXzr","wlGXRD","WdKXz3","3d23Rc","3tdSRn","tt3XDn","wltSRS","WsjBRW","tlGXRz","wtdSR8","tsGyW3","4tKBW3","WdGXRc","ttK3Wt","WtsBzf","wlBBWy","3lcSR8","MtBfWw","WdycRw","3lcSRn","wt3SWj","3tG3Rm","tdB3zV","3l2czV","Xdj3DV","XsdGW7","wldSWH","WsVyzc","tsdfDf","3sfczf","tlcSRN","tljXR1","3l3SzM","Wt3XDr","3l3XDr","WldXRH","3t3XDr","tldSWH","3lcSW2","3sKyWz","WltyR7","wtcyWr","tltcR4","3dBBzz","tsVfRG","WlcXR4","tlcSR8"],timestamp:"2021-01-12T15:51:38.373Z"}},{}],107:[function(e,t,n){t.exports={Shaders:99,Results:["ttlyWf","3tdSRn","WldSRn","XsX3zl","WtsBzf","wlGGWG","tdG3Rd","3sfczf","ttfyWB","tsGyW3","3sySRK","wlVGWd","WslGWl","wdsfDH","WdXBW4","tldSWH","wldSWH","Wt33Wf","wtcSzN","tltcR4","3tG3Rm","ll3SWl","wttXz8","tlGXRz","wsGczG","tt3XDn","WlcXR4","MsfXRf","WltyR7","3sc3z4","WscBzB","ltXyzS","wlycRR","wl3czM","WdGXRc","WsSGWG","wddBzS","4tKBW3","WdVfRc","WtKSzt","wlBBWy","wssXzr","wtcyWr","tlVGDt","tt3yRH","3dVczw","wttXDl","wtdSR8","ttKGDt","tsVfRG","XsBfRW","wlGXRD","Xdj3DV","WsV3D1","Ml2XRD","3sKyWz","WsVyzc","3l3SzM","tdKGW1","WsG3Ry","3dBBzz","ttK3Wt","WlBBzV","tsVcWt","3lcSR8","WlcyD7","3stBDf","ttlyWB","ts3yD7","WldXRH","WsjBRW","XtVczV","MtBfWw","tsdfDf","tljXR1","tlcSRN","WdycRw","3ttSzr","tlcSR8","3l2czV","MlsfR4","tsXBzS","llXfRr","WtdXR8","WdKXz3","MdXSWn","3lcSRn","MlyBRd","3d23Rc","tdB3zV","3t3XDr","Wt3XDr","3l3XDr","3lcSW2","wt3SWj","XsdGW7","lllSR2","XlSGzz","wltSRS"],timestamp:"2021-01-12T15:51:34.006Z"}},{}],108:[function(e,t,n){t.exports={Shaders:99,Results:["wlycRR","WlcyD7","wtcyWr","WltyR7","wl3czM","tltcR4","tt3yRH","WdVfRc","3stBDf","tsVfRG","tsdfDf","wddBzS","WscBzB","tsVcWt","wsGczG","tsGyW3","XlSGzz","WsVyzc","3sKyWz","3dVczw","WdycRw","ts3yD7","wlBBWy","WlBBzV","WtsBzf","3l2czV","ttlyWf","ttlyWB","ttfyWB","WsjBRW","3dBBzz","tsXBzS","WdXBW4","wdsfDH","3sfczf","WtKSzt","wlGXRD","tlGXRz","wttXDl","wt3SWj","3lcSW2","wltSRS","wldSWH","tldSWH","tt3XDn","3l3XDr","Wt3XDr","3t3XDr","3l3SzM","wtcSzN","tlcSRN","WlcXR4","wttXz8","wtdSR8","WldXRH","WtdXR8","tlcSR8","3lcSR8","3ttSzr","WldSRn","3tdSRn","3lcSRn","wlVGWd","Wt33Wf","tlVGDt","ttKGDt","3tG3Rm","ttK3Wt","wlGGWG","WdKXz3","WdGXRc","3sySRK","tdG3Rd","WsG3Ry","tdKGW1","WsV3D1","3sc3z4","tljXR1","3d23Rc","wssXzr","WsSGWG","WslGWl","tdB3zV","4tKBW3","MlyBRd","XtVczV","MtBfWw","MlsfR4","llXfRr","XsBfRW","ltXyzS","ll3SWl","XsdGW7","Ml2XRD","lllSR2","MsfXRf","MdXSWn","Xdj3DV","XsX3zl"],timestamp:"2021-01-12T15:51:33.053Z"}},{}],109:[function(e,t,n){t.exports={Shaders:99,Results:["3sySRK","MdXSWn","WslGWl","3sc3z4","ll3SWl","llXfRr","tdG3Rd","tsXBzS","ttKGDt","Wt33Wf","wtcSzN","XsX3zl","XtVczV","wlVGWd","tlVGDt","Ml2XRD","lllSR2","tt3XDn","wtdSR8","wsGczG","3dVczw","3ttSzr","WtdXR8","wlBBWy","WldSRn","MlsfR4","WdXBW4","MlyBRd","wdsfDH","MsfXRf","XsBfRW","WtKSzt","ltXyzS","wttXz8","wttXDl","tdKGW1","Xdj3DV","tlGXRz","WdKXz3","WsjBRW","WdVfRc","XlSGzz","WlcyD7","ts3yD7","ttlyWB","wlGGWG","WtsBzf","WsG3Ry","ttK3Wt","3l3SzM","wltSRS","wssXzr","3tdSRn","wt3SWj","wlGXRD","WlcXR4","wldSWH","3l3XDr","3d23Rc","tlcSRN","3lcSW2","WsSGWG","3lcSR8","WlBBzV","WdycRw","3l2czV","WsVyzc","3sfczf","tldSWH","tdB3zV","XsdGW7","WsV3D1","WldXRH","3t3XDr","WdGXRc","3tG3Rm","Wt3XDr","3dBBzz","3lcSRn","MtBfWw","tlcSR8","4tKBW3","tsVcWt","tsGyW3","3sKyWz","ttfyWB","WscBzB","ttlyWf","tljXR1","wddBzS","3stBDf","tsdfDf","tt3yRH","wl3czM","wtcyWr","tsVfRG","WltyR7","tltcR4","wlycRR"],timestamp:"2021-01-12T15:51:28.577Z"}},{}],110:[function(e,t,n){"use strict";var r=e("../core/settings"),i=e("../visual/screen/screenShader"),o=e("mout/object/get");e("../io/localStorage");n.search=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"popular",s=arguments.length>4?arguments[4]:void 0;if(e){var c=new XMLHttpRequest;a.push(c),c.onerror=function(){l(c,a),s({success:!1,errorType:2})},c.onreadystatechange=function(){if(4===c.readyState&&200===c.status){var e;try{e=JSON.parse(c.response)}catch(e){return l(c,a),void s({success:!1,errorType:1})}if(e){var t=o(e,"Results");l(c,a),s({success:!0,isCached:!1,idList:t})}}},c.responseType="text";var u="https://www.shadertoy.com/api/v1/shaders/query/"+e+"?sort="+i+"&from="+t+"&num="+n+"&key="+r.API_KEY;c.open("GET",u,!0),c.send(null)}else l(xmlhttp,a),s({success:!1,errorType:1})},n.load=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];n&&i.preInitTester();if(e){var o=new XMLHttpRequest;a.push(o),o.onerror=function(){l(o,a),t({success:!1,errorType:2})},o.onreadystatechange=function(){if(4===o.readyState&&200===o.status){var e;try{e=JSON.parse(o.response)}catch(e){return l(o,a),void t({success:!1,errorType:1})}
10e&&(l(o,a),s(e,t,n))}},o.responseType="text",o.open("GET","https://www.shadertoy.com/api/v1/shaders/"+e+"?key="+r.API_KEY,!0),o.send(null)}else l(xmlhttp,a),t({success:!1,errorType:1})},n.abortRequests=function(){for(var e=0,t=a.length;e<t;e++)a[e].abort()};var a=[];function s(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=o(e,"Shader.renderpass"),s=o(e,"Shader.info");if(a){var l=a[0];if(1===a.length&&"image"===l.type){var c=!!n&&i.testShader(l.code);t(c?{success:!1,errorType:r.USE_WEBGL2?3:4}:{success:!0,shader:l.code,shaderInfo:{id:s.id,title:s.name,description:s.description,username:s.username,likes:s.likes,viewed:s.viewed}})}else t({success:!1,errorType:5})}else t({success:!1,errorType:2})}function l(e,t){var n=t.indexOf(e);t.splice(n,1)}n.ERROR_MESSAGES={1:"Shadertoy Id is missing.",2:"Shadertoy Id is invalid or it doesn't allow api access.",3:"This shadertoy is not compatible with Cine Shader.",4:"This shadertoy is not compatible with Cine Shader or it uses WebGL 2 special codes which your browser doesn't support.",5:"This shadertoy used framebuffer which Cine Shader doesn't support."}},{"../core/settings":91,"../io/localStorage":105,"../visual/screen/screenShader":172,"mout/object/get":51}],111:[function(e,t,n){"use strict";var r=e("../core/properties"),i=e("three"),o=r.loader.ITEM_CLASSES.xhr;function a(e,t){e&&(t.responseType="arraybuffer",s.constructor.apply(this,arguments))}t.exports=a,a.type="buf",a.extensions=["buf"];var s=o.prototype,l=a.prototype=new o;l.constructor=a,l._onLoad=function(){if(!this.content){for(var e=this.xmlhttp.response,t=new
10Uint32Array(e,0,1)[0],n=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e,4,t))),r=n.vertexCount,o=n.indexCount,a=4+t,l=new i.BufferGeometry,c=n.attributes,u=0,h=c.length;u<h;u++){var d=c[u],p=d.id,f="indices"===p?o:r,m=d.componentSize,v=window[d.storageType],g=new v(e,a,f*m),y=v.BYTES_PER_ELEMENT,x=void 0;if(d.needsPack){var b=d.packedComponents,_=b.length,w=0===d.storageType.indexOf("Int"),S=1<<8*y,M=w?.5*S:0,T=1/S;x=new Float32Array(f*m);for(var E=0,C=0;E<f;E++)for(var L=0;L<_;L++){var R=b[L];x[C]=(g[C]+M)*T*R.delta+R.from,C++}}else x=g;"normal"===p&&!0,"indices"===p?l.setIndex(new i.BufferAttribute(x,1)):l.setAttribute(p,new i.BufferAttribute(x,m)),a+=f*m*y}this.content=l}this.xmlhttp=void 0,s._onLoad.call(this)},a.retrieve=function(){return!1}},{"../core/properties":90,three:79}],112:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof")),i=e("three");t.exports=i.GLTFLoader=function(){function e(e){i.Loader.call(this,e),this.dracoLoader=null,this.ddsLoader=null}function t(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}e.prototype=Object.assign(Object.create(i.Loader.prototype),{constructor:e,load:function(e,t,n,r){var o,a=this;o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:i.LoaderUtils.extractUrlBase(e),a.manager.itemStart(e);var s=function(t){r?r(t):console.error(t),a.manager.itemError(e),a.manager.itemEnd(e)},l=new i.FileLoader(a.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),"use-credentials"===a.crossOrigin&&l.setWithCredentials(!0),l.load(e,(function(n){try{a.parse(n,o,(function(n){t(n),a.manager.itemEnd(e)}),s)}catch(e){s(e)}}),n,s)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},parse:function(e,t,r,u){var h,m={};if("string"==typeof e)h=e;else if(i.LoaderUtils.decodeText(new Uint8Array(e,0,4))===c){try{m[n.KHR_BINARY_GLTF]=new d(e)}catch(e){return void(u&&u(e))}h=m[n.KHR_BINARY_GLTF].content}else h=i.LoaderUtils.decodeText(new Uint8Array(e));var y=JSON.parse(h);if(void 0===y.asset||y.asset.version[0]<2)u&&u(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{if(y.extensionsUsed)for(var x=0;x<y.extensionsUsed.length;++x){var b=y.extensionsUsed[x],_=y.extensionsRequired||[];switch(b){case n.KHR_LIGHTS_PUNCTUAL:m[b]=new a(y);break;case n.KHR_MATERIALS_CLEARCOAT:m[b]=new l;break;case n.KHR_MATERIALS_UNLIT:m[b]=new s;break;case n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:m[b]=new v;break;case n.KHR_DRACO_MESH_COMPRESSION:m[b]=new p(y,this.dracoLoader);break;case n.MSFT_TEXTURE_DDS:m[b]=new o(this.ddsLoader);break;case n.KHR_TEXTURE_TRANSFORM:m[b]=new f;break;case n.KHR_MESH_QUANTIZATION:m[b]=new g;break;default:_.indexOf(b)>=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+b+'".')}}new U(y,m,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse(r,u)}}});var n={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_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function o(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=n.MSFT_TEXTURE_DDS,this.ddsLoader=e}function a(e){this.name=n.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[n.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function s(){this.name=n.KHR_MATERIALS_UNLIT}function l(){this.name=n.KHR_MATERIALS_CLEARCOAT}a.prototype.loadLight=function(e){var t,n=this.lightDefs[e],r=new i.Color(16777215);void 0!==n.color&&r.fromArray(n.color);var o=void 0!==n.range?n.range:0;switch(n.type){case"directional":(t=new i.DirectionalLight(r)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new i.PointLight(r)).distance=o;break;case"spot":(t=new i.SpotLight(r)).distance=o,n.spot=n.spot||{},n.spot.innerConeAngle=void 0!==n.spot.innerConeAngle?n.spot.innerConeAngle:0,n.spot.outerConeAngle=void 0!==n.spot.outerConeAngle?n.spot.outerConeAngle:Math.PI/4,t.angle=n.spot.outerConeAngle,t.penumbra=1-n.spot.innerConeAngle/n.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+n.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==n.intensity&&(t.intensity=n.intensity),t.name=n.name||"light_"+e,Promise.resolve(t)},s.prototype.getMaterialType=function(){return i.MeshBasicMaterial},s.prototype.extendParams=function(e,t,n){var r=[];e.color=new i.Color(1,1,1),e.opacity=1;var o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){var a=o.baseColorFactor;e.color.fromArray(a),e.opacity=a[3]}void 0!==o.baseColorTexture&&r.push(n.assignTexture(e,"map",o.baseColorTexture))}return Promise.all(r)},l.prototype.getMaterialType=function(){return i.MeshPhysicalMaterial},l.prototype.extendParams=function(e,t,n){var r=[],o=t.extensions[this.name];if(void 0!==o.clearcoatFactor&&(e.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&r.push(n.assignTexture(e,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(e.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&r.push(n.assignTexture(e,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(r.push(n.assignTexture(e,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){var a=o.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new i.Vector2(a,a)}return Promise.all(r)};var c="glTF",u=1313821514,h=5130562;function d(e){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,12);if(this.header={magic:i.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==c)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var r=new DataView(e,12),o=0;o<r.byteLength;){var a=r.getUint32(o,!0);o+=4;var s=r.getUint32(o,!0);if(o+=4,s===u){var l=new Uint8Array(e,12+o,a);this.content=i.LoaderUtils.decodeText(l)}else if(s===h){var d=12+o;this.body=e.slice(d,d+a)}o+=a}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function p(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=n.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}function f(){this.name=n.KHR_TEXTURE_TRANSFORM}function m(e){i.MeshStandardMaterial.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),n=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),r=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),o=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),a=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
10","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),s={specular:{value:(new i.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=s,this.onBeforeCompile=function(e){for(var i in s)e.uniforms[i]=s[i];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),e.fragmentShader=e.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_pars_fragment>",t),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_pars_fragment>",n),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_fragment>",r),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_fragment>",o),e.fragmentShader=e.fragmentShader.replace("#include <lights_physical_fragment>",a)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(e){s.specular.value=e}},specularMap:{get:function(){return s.specularMap.value},set:function(e){s.specularMap.value=e}},glossiness:{get:function(){return s.glossiness.value},set:function(e){s.glossiness.value=e}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(e){s.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function v(){return{name:n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return m},extendParams:function(e,t,n){var r=t.extensions[this.name];e.color=new i.Color(1,1,1),e.opacity=1;var o=[];if(Array.isArray(r.diffuseFactor)){var a=r.diffuseFactor;e.color.fromArray(a),e.opacity=a[3]}if(void 0!==r.diffuseTexture&&o.push(n.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new i.Color(0,0,0),e.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,e.specular=new i.Color(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){var s=r.specularGlossinessTexture;o.push(n.assignTexture(e,"glossinessMap",s)),o.push(n.assignTexture(e,"specularMap",s))}return Promise.all(o)},createMaterial:function(e){var t=new m(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=i.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function g(){this.name=n.KHR_MESH_QUANTIZATION}function y(e,t,n,r){i.Interpolant.call(this,e,t,n,r)}p.prototype.decodePrimitive=function(e,t){var n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},s={},l={};for(var c in o){var u=A[c]||c.toLowerCase();a[u]=o[c]}for(c in e.attributes){u=A[c]||c.toLowerCase();if(void 0!==o[c]){var h=n.accessors[e.attributes[c]],d=E[h.componentType];l[u]=d,s[u]=!0===h.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t){r.decodeDracoFile(e,(function(e){for(var n in e.attributes){var r=e.attributes[n],i=s[n];void 0!==i&&(r.normalized=i)}t(e)}),a,l)}))}))},f.prototype.extendTexture=function(e,t){return e=e.clone(),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),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},m.prototype=Object.create(i.MeshStandardMaterial.prototype),m.prototype.constructor=m,m.prototype.copy=function(e){return i.MeshStandardMaterial.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},y.prototype=Object.create(i.Interpolant.prototype),y.prototype.constructor=y,y.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r,o=0;o!==r;o++)t[o]=n[i+o];return t},y.prototype.beforeStart_=y.prototype.copySampleValue_,y.prototype.afterEnd_=y.prototype.copySampleValue_,y.prototype.interpolate_=function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=2*a,l=3*a,c=r-t,u=(n-t)/c,h=u*u,d=h*u,p=e*l,f=p-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u,x=0;x!==a;x++){var b=o[f+x+a],_=o[f+x+s]*c,w=o[p+x+a],S=o[p+x]*c;i[x]=g*b+y*_+m*w+v*S}return i};var x=0,b=1,_=2,w=3,S=4,M=5,T=6,E={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},C={9728:i.NearestFilter,9729:i.LinearFilter,9984:i.NearestMipmapNearestFilter,9985:i.LinearMipmapNearestFilter,9986:i.NearestMipmapLinearFilter,9987:i.LinearMipmapLinearFilter},L={33071:i.ClampToEdgeWrapping,33648:i.MirroredRepeatWrapping,10497:i.RepeatWrapping},R={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},A={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},P={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},I={CUBICSPLINE:void 0,LINEAR:i.InterpolateLinear,STEP:i.InterpolateDiscrete},O="OPAQUE",D="MASK",N="BLEND",k={"image/png":i.RGBAFormat,"image/jpeg":i.RGBFormat};function z(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)}function B(e,t,n){for(var r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function F(e,t){void 0!==t.extras&&("object"===(0,r.default)(t.extras)?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function G(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){var i=t.extras.targetNames;if(e.morphTargetInfluences.length===i.length){e.morphTargetDictionary={};for(n=0,r=i.length;n<r;n++)e.morphTargetDictionary[i[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function H(e){for(var t="",n=Object.keys(e).sort(),r=0,i=n.length;r<i;r++)t+=n[r]+":"+e[n[r]]+";";return t}function U(e,n,r){this.json=e||{},this.extensions=n||{},this.options=r||{},this.cache=new t,this.primitiveCache={},this.textureLoader=new i.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new i.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function W(e,t,n){var r=t.attributes,o=[];function a(t,r){return n.getDependency("accessor",t).then((function(t){e.setAttribute(r,t)}))}for(var s in r){var l=A[s]||s.toLowerCase();l in e.attributes||o.push(a(r[s],l))}if(void 0!==t.indices&&!e.index){var c=n.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));o.push(c)}return F(e,t),function(e,t,n){var r=t.attributes,o=new i.Box3;if(void 0!==r.POSITION){var a=(p=n.json.accessors[r.POSITION]).min,s=p.max;if(void 0!==a&&void 0!==s){o.set(new i.Vector3(a[0],a[1],a[2]),new i.Vector3(s[0],s[1],s[2]));var l=t.targets;if(void 0!==l){for(var c=new i.Vector3,u=new i.Vector3,h=0,d=l.length;h<d;h++){var p,f=l[h];if(void 0!==f.POSITION)a=(p=n.json.accessors[f.POSITION]).min,s=p.max,void 0!==a&&void 0!==s?(u.setX(Math.max(Math.abs(a[0]),Math.abs(s[0]))),u.setY(Math.max(Math.abs(a[1]),Math.abs(s[1]))),u.setZ(Math.max(Math.abs(a[2]),Math.abs(s[2]))),c.max(u)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}o.expandByVector(c)}e.boundingBox=o;var m=new i.Sphere;o.getCenter(m.center),m.radius=o.min.distanceTo(o.max)/2,e.boundingSphere=m}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}
10(e,t,n),Promise.all(o).then((function(){return void 0!==t.targets?function(e,t,n){for(var r=!1,i=!1,o=0,a=t.length;o<a&&(void 0!==(c=t[o]).POSITION&&(r=!0),void 0!==c.NORMAL&&(i=!0),!r||!i);o++);if(!r&&!i)return Promise.resolve(e);var s=[],l=[];for(o=0,a=t.length;o<a;o++){var c=t[o];if(r){var u=void 0!==c.POSITION?n.getDependency("accessor",c.POSITION):e.attributes.position;s.push(u)}i&&(u=void 0!==c.NORMAL?n.getDependency("accessor",c.NORMAL):e.attributes.normal,l.push(u))}return Promise.all([Promise.all(s),Promise.all(l)]).then((function(t){var n=t[0],o=t[1];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=o),e.morphTargetsRelative=!0,e}))}(e,t.targets,n):e}))}function V(e,t){var n=e.getIndex();if(null===n){var r=[],o=e.getAttribute("position");if(void 0===o)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var a=0;a<o.count;a++)r.push(a);e.setIndex(r),n=e.getIndex()}var s=n.count-2,l=[];if(t===i.TriangleFanDrawMode)for(a=1;a<=s;a++)l.push(n.getX(0)),l.push(n.getX(a)),l.push(n.getX(a+1));else for(a=0;a<s;a++)a%2==0?(l.push(n.getX(a)),l.push(n.getX(a+1)),l.push(n.getX(a+2))):(l.push(n.getX(a+2)),l.push(n.getX(a+1)),l.push(n.getX(a)));l.length/3!==s&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var c=e.clone();return c.setIndex(l),c}return U.prototype.parse=function(e,t){var n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then((function(t){var o={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};B(i,o,r),F(o,r),e(o)})).catch(t)},U.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[],r={},i={},o=0,a=t.length;o<a;o++)for(var s=t[o].joints,l=0,c=s.length;l<c;l++)e[s[l]].isBone=!0;for(var u=0,h=e.length;u<h;u++){var d=e[u];void 0!==d.mesh&&(void 0===r[d.mesh]&&(r[d.mesh]=i[d.mesh]=0),r[d.mesh]++,void 0!==d.skin&&(n[d.mesh].isSkinnedMesh=!0))}this.json.meshReferences=r,this.json.meshUses=i},U.prototype.getDependency=function(e,t){var r=e+":"+t,i=this.cache.get(r);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this.loadNode(t);break;case"mesh":i=this.loadMesh(t);break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this.loadBufferView(t);break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this.loadMaterial(t);break;case"texture":i=this.loadTexture(t);break;case"skin":i=this.loadSkin(t);break;case"animation":i=this.loadAnimation(t);break;case"camera":i=this.loadCamera(t);break;case"light":i=this.extensions[n.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(r,i)}return i},U.prototype.getDependencies=function(e){var t=this.cache.get(e);if(!t){var n=this,r=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(r.map((function(t,r){return n.getDependency(e,r)}))),this.cache.add(e,t)}return t},U.prototype.loadBuffer=function(e){var 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[n.KHR_BINARY_GLTF].body);var i=this.options;return new Promise((function(e,n){r.load(z(t.uri,i.path),e,void 0,(function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))},U.prototype.loadBufferView=function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){var n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)}))},U.prototype.loadAccessor=function(e){var t=this,n=this.json,r=this.json.accessors[e];if(void 0===r.bufferView&&void 0===r.sparse)return Promise.resolve(null);var o=[];return void 0!==r.bufferView?o.push(this.getDependency("bufferView",r.bufferView)):o.push(null),void 0!==r.sparse&&(o.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(o).then((function(e){var o,a,s=e[0],l=R[r.type],c=E[r.componentType],u=c.BYTES_PER_ELEMENT,h=u*l,d=r.byteOffset||0,p=void 0!==r.bufferView?n.bufferViews[r.bufferView].byteStride:void 0,f=!0===r.normalized;if(p&&p!==h){var m=Math.floor(d/p),v="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+m+":"+r.count,g=t.cache.get(v);g||(o=new c(s,m*p,r.count*p/u),g=new i.InterleavedBuffer(o,p/u),t.cache.add(v,g)),a=new i.InterleavedBufferAttribute(g,l,d%p/u,f)}else o=null===s?new c(r.count*l):new c(s,d,r.count*l),a=new i.BufferAttribute(o,l,f);if(void 0!==r.sparse){var y=R.SCALAR,x=E[r.sparse.indices.componentType],b=r.sparse.indices.byteOffset||0,_=r.sparse.values.byteOffset||0,w=new x(e[1],b,r.sparse.count*y),S=new c(e[2],_,r.sparse.count*l);null!==s&&(a=new i.BufferAttribute(a.array.slice(),a.itemSize,a.normalized));for(var M=0,T=w.length;M<T;M++){var C=w[M];if(a.setX(C,S[M*l]),l>=2&&a.setY(C,S[M*l+1]),l>=3&&a.setZ(C,S[M*l+2]),l>=4&&a.setW(C,S[M*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a}))},U.prototype.loadTexture=function(e){var t,r=this,o=this.json,a=this.options,s=this.textureLoader,l=self.URL||self.webkitURL,c=o.textures[e],u=c.extensions||{},h=(t=u[n.MSFT_TEXTURE_DDS]?o.images[u[n.MSFT_TEXTURE_DDS].source]:o.images[c.source]).uri,d=!1;return void 0!==t.bufferView&&(h=r.getDependency("bufferView",t.bufferView).then((function(e){d=!0;var n=new Blob([e],{type:t.mimeType});return h=l.createObjectURL(n)}))),Promise.resolve(h).then((function(e){var t=a.manager.getHandler(e);return t||(t=u[n.MSFT_TEXTURE_DDS]?r.extensions[n.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(n,r){t.load(z(e,a.path),n,void 0,r)}))})).then((function(e){!0===d&&l.revokeObjectURL(h),e.flipY=!1,c.name&&(e.name=c.name),t.mimeType in k&&(e.format=k[t.mimeType]);var n=(o.samplers||{})[c.sampler]||{};return e.magFilter=C[n.magFilter]||i.LinearFilter,e.minFilter=C[n.minFilter]||i.LinearMipmapLinearFilter,e.wrapS=L[n.wrapS]||i.RepeatWrapping,e.wrapT=L[n.wrapT]||i.RepeatWrapping,e}))},U.prototype.assignTexture=function(e,t,r){var o=this;return this.getDependency("texture",r.index).then((function(a){if
10(!a.isCompressedTexture)switch(t){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":a.format=i.RGBFormat}if(void 0===r.texCoord||0==r.texCoord||"aoMap"===t&&1==r.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+r.texCoord+" for texture "+t+" not yet supported."),o.extensions[n.KHR_TEXTURE_TRANSFORM]){var s=void 0!==r.extensions?r.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;s&&(a=o.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(a,s))}e[t]=a}))},U.prototype.assignFinalMaterial=function(e){var t=e.geometry,n=e.material,r=void 0!==t.attributes.tangent,o=void 0!==t.attributes.color,a=void 0===t.attributes.normal,s=!0===e.isSkinnedMesh,l=Object.keys(t.morphAttributes).length>0,c=l&&void 0!==t.morphAttributes.normal;if(e.isPoints){var u="PointsMaterial:"+n.uuid,h=this.cache.get(u);h||(h=new i.PointsMaterial,i.Material.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(u,h)),n=h}else if(e.isLine){u="LineBasicMaterial:"+n.uuid;var d=this.cache.get(u);d||(d=new i.LineBasicMaterial,i.Material.prototype.copy.call(d,n),d.color.copy(n.color),this.cache.add(u,d)),n=d}if(r||o||a||s||l){u="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(u+="specular-glossiness:"),s&&(u+="skinning:"),r&&(u+="vertex-tangents:"),o&&(u+="vertex-colors:"),a&&(u+="flat-shading:"),l&&(u+="morph-targets:"),c&&(u+="morph-normals:");var p=this.cache.get(u);p||(p=n.clone(),s&&(p.skinning=!0),r&&(p.vertexTangents=!0),o&&(p.vertexColors=!0),a&&(p.flatShading=!0),l&&(p.morphTargets=!0),c&&(p.morphNormals=!0),this.cache.add(u,p)),n=p}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",new i.BufferAttribute(t.attributes.uv.array,2)),n.normalScale&&!r&&(n.normalScale.y=-n.normalScale.y),n.clearcoatNormalScale&&!r&&(n.clearcoatNormalScale.y=-n.clearcoatNormalScale.y),e.material=n},U.prototype.loadMaterial=function(e){var t,r=this,o=this.json,a=this.extensions,s=o.materials[e],l={},c=s.extensions||{},u=[];if(c[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var h=a[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=h.getMaterialType(),u.push(h.extendParams(l,s,r))}else if(c[n.KHR_MATERIALS_UNLIT]){var d=a[n.KHR_MATERIALS_UNLIT];t=d.getMaterialType(),u.push(d.extendParams(l,s,r))}else{t=i.MeshStandardMaterial;var p=s.pbrMetallicRoughness||{};if(l.color=new i.Color(1,1,1),l.opacity=1,Array.isArray(p.baseColorFactor)){var f=p.baseColorFactor;l.color.fromArray(f),l.opacity=f[3]}void 0!==p.baseColorTexture&&u.push(r.assignTexture(l,"map",p.baseColorTexture)),l.metalness=void 0!==p.metallicFactor?p.metallicFactor:1,l.roughness=void 0!==p.roughnessFactor?p.roughnessFactor:1,void 0!==p.metallicRoughnessTexture&&(u.push(r.assignTexture(l,"metalnessMap",p.metallicRoughnessTexture)),u.push(r.assignTexture(l,"roughnessMap",p.metallicRoughnessTexture)))}!0===s.doubleSided&&(l.side=i.DoubleSide);var v=s.alphaMode||O;if(v===N?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,v===D&&(l.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&t!==i.MeshBasicMaterial&&(u.push(r.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new i.Vector2(1,1),void 0!==s.normalTexture.scale&&l.normalScale.set(s.normalTexture.scale,s.normalTexture.scale)),void 0!==s.occlusionTexture&&t!==i.MeshBasicMaterial&&(u.push(r.assignTexture(l,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(l.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&t!==i.MeshBasicMaterial&&(l.emissive=(new i.Color).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&t!==i.MeshBasicMaterial&&u.push(r.assignTexture(l,"emissiveMap",s.emissiveTexture)),c[n.KHR_MATERIALS_CLEARCOAT]){var g=a[n.KHR_MATERIALS_CLEARCOAT];t=g.getMaterialType(),u.push(g.extendParams(l,{extensions:c},r))}return Promise.all(u).then((function(){var e;return e=t===m?a[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):new t(l),s.name&&(e.name=s.name),e.map&&(e.map.encoding=i.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=i.sRGBEncoding),F(e,s),s.extensions&&B(a,e,s),e}))},U.prototype.loadGeometries=function(e){var t=this,r=this.extensions,o=this.primitiveCache;function a(e){return r[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return W(n,e,t)}))}for(var s,l,c=[],u=0,h=e.length;u<h;u++){var d,p=e[u],f=(l=void 0,(l=(s=p).extensions&&s.extensions[n.KHR_DRACO_MESH_COMPRESSION])?"draco:"+l.bufferView+":"+l.indices+":"+H(l.attributes):s.indices+":"+H(s.attributes)+":"+s.mode),m=o[f];if(m)c.push(m.promise);else d=p.extensions&&p.extensions[n.KHR_DRACO_MESH_COMPRESSION]?a(p):W(new i.BufferGeometry,p,t),o[f]={primitive:p,promise:d},c.push(d)}return Promise.all(c)},U.prototype.loadMesh=function(e){for(var t,n=this,r=this.json.meshes[e],o=r.primitives,a=[],s=0,l=o.length;s<l;s++){var c=void 0===o[s].material?(void 0===(t=this.cache).DefaultMaterial&&(t.DefaultMaterial=new i.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:i.FrontSide})),t.DefaultMaterial):this.getDependency("material",o[s].material);a.push(c)}return a.push(n.loadGeometries(o)),Promise.all(a).then((function(t){for(var a=t.slice(0,t.length-1),s=t[t.length-1],l=[],c=0,u=s.length;c<u;c++){var h,d=s[c],p=o[c],f=a[c];if(p.mode===S||p.mode===M||p.mode===T||void 0===p.mode)!0!==(h=!0===r.isSkinnedMesh?new i.SkinnedMesh(d,f):new i.Mesh(d,f)).isSkinnedMesh||h.geometry.attributes.skinWeight.normalized||h.normalizeSkinWeights(),p.mode===M?h.geometry=V(h.geometry,i.TriangleStripDrawMode):p.mode===T&&(h.geometry=V(h.geometry,i.TriangleFanDrawMode));else if(p.mode===b)h=new i.LineSegments(d,f);else if(p.mode===w)h=new i.Line(d,f);else if(p.mode===_)h=new i.LineLoop(d,f);else{if(p.mode!==x)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+p.mode);h=new i.Points(d,f)}Object.keys(h.geometry.morphAttributes).length>0&&G(h,r),h.name=r.name||"mesh_"+e,s.length>1&&(h.name+="_"+c),F(h,r),n.assignFinalMaterial(h),l.push(h)}if(1===l.length)return l[0];var m=new i.Group;for(c=0,u=l.length;c<u;c++)m.add(l[c]);return m}))},U.prototype.loadCamera=function(e){var t,n=this.json.cameras[e],r=n[n.type];if(r)return"perspective"===n.type?t=new i.PerspectiveCamera(i.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(t=new i.Orthogra
10phicCamera(r.xmag/-2,r.xmag/2,r.ymag/2,r.ymag/-2,r.znear,r.zfar)),n.name&&(t.name=n.name),F(t,n),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},U.prototype.loadSkin=function(e){var t=this.json.skins[e],n={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return n.inverseBindMatrices=e,n}))},U.prototype.loadAnimation=function(e){for(var t=this.json.animations[e],n=[],r=[],o=[],a=[],s=[],l=0,c=t.channels.length;l<c;l++){var u=t.channels[l],h=t.samplers[u.sampler],d=u.target,p=void 0!==d.node?d.node:d.id,f=void 0!==t.parameters?t.parameters[h.input]:h.input,m=void 0!==t.parameters?t.parameters[h.output]:h.output;n.push(this.getDependency("node",p)),r.push(this.getDependency("accessor",f)),o.push(this.getDependency("accessor",m)),a.push(h),s.push(d)}return Promise.all([Promise.all(n),Promise.all(r),Promise.all(o),Promise.all(a),Promise.all(s)]).then((function(n){for(var r=n[0],o=n[1],a=n[2],s=n[3],l=n[4],c=[],u=0,h=r.length;u<h;u++){var d=r[u],p=o[u],f=a[u],m=s[u],v=l[u];if(void 0!==d){var g;switch(d.updateMatrix(),d.matrixAutoUpdate=!0,P[v.path]){case P.weights:g=i.NumberKeyframeTrack;break;case P.rotation:g=i.QuaternionKeyframeTrack;break;case P.position:case P.scale:default:g=i.VectorKeyframeTrack}var x=d.name?d.name:d.uuid,b=void 0!==m.interpolation?I[m.interpolation]:i.InterpolateLinear,_=[];P[v.path]===P.weights?d.traverse((function(e){!0===e.isMesh&&e.morphTargetInfluences&&_.push(e.name?e.name:e.uuid)})):_.push(x);var w=f.array;if(f.normalized){var S;if(w.constructor===Int8Array)S=1/127;else if(w.constructor===Uint8Array)S=1/255;else if(w.constructor==Int16Array)S=1/32767;else{if(w.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");S=1/65535}for(var M=new Float32Array(w.length),T=0,E=w.length;T<E;T++)M[T]=w[T]*S;w=M}for(T=0,E=_.length;T<E;T++){var C=new g(_[T]+"."+P[v.path],p.array,w,b);"CUBICSPLINE"===m.interpolation&&(C.createInterpolant=function(e){return new y(this.times,this.values,this.getValueSize()/3,e)},C.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),c.push(C)}}}var L=t.name?t.name:"animation_"+e;return new i.AnimationClip(L,void 0,c)}))},U.prototype.loadNode=function(e){var t,r=this.json,o=this.extensions,a=this,s=r.meshReferences,l=r.meshUses,c=r.nodes[e];return(t=[],void 0!==c.mesh&&t.push(a.getDependency("mesh",c.mesh).then((function(e){var t;if(s[c.mesh]>1){var n=l[c.mesh]++;(t=e.clone()).name+="_instance_"+n}else t=e;return void 0!==c.weights&&t.traverse((function(e){if(e.isMesh)for(var t=0,n=c.weights.length;t<n;t++)e.morphTargetInfluences[t]=c.weights[t]})),t}))),void 0!==c.camera&&t.push(a.getDependency("camera",c.camera)),c.extensions&&c.extensions[n.KHR_LIGHTS_PUNCTUAL]&&void 0!==c.extensions[n.KHR_LIGHTS_PUNCTUAL].light&&t.push(a.getDependency("light",c.extensions[n.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(t)).then((function(e){var t;if((t=!0===c.isBone?new i.Bone:e.length>1?new i.Group:1===e.length?e[0]:new i.Object3D)!==e[0])for(var n=0,r=e.length;n<r;n++)t.add(e[n]);if(c.name&&(t.userData.name=c.name,t.name=i.PropertyBinding.sanitizeNodeName(c.name)),F(t,c),c.extensions&&B(o,t,c),void 0!==c.matrix){var a=new i.Matrix4;a.fromArray(c.matrix),t.applyMatrix4(a)}else void 0!==c.translation&&t.position.fromArray(c.translation),void 0!==c.rotation&&t.quaternion.fromArray(c.rotation),void 0!==c.scale&&t.scale.fromArray(c.scale);return t}))},U.prototype.loadScene=function(){function e(t,n,r,o){var a=r.nodes[t];return o.getDependency("node",t).then((function(e){return void 0===a.skin?e:o.getDependency("skin",a.skin).then((function(e){for(var n=[],r=0,i=(t=e).joints.length;r<i;r++)n.push(o.getDependency("node",t.joints[r]));return Promise.all(n)})).then((function(n){return e.traverse((function(e){if(e.isMesh){for(var r=[],o=[],a=0,s=n.length;a<s;a++){var l=n[a];if(l){r.push(l);var c=new i.Matrix4;void 0!==t.inverseBindMatrices&&c.fromArray(t.inverseBindMatrices.array,16*a),o.push(c)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}e.bind(new i.Skeleton(r,o),e.matrixWorld)}})),e}));var t})).then((function(t){n.add(t);var i=[];if(a.children)for(var s=a.children,l=0,c=s.length;l<c;l++){var u=s[l];i.push(e(u,t,r,o))}return Promise.all(i)}))}return function(t){var n=this.json,r=this.extensions,o=this.json.scenes[t],a=new i.Group;o.name&&(a.name=o.name),F(a,o),o.extensions&&B(r,a,o);for(var s=o.nodes||[],l=[],c=0,u=s.length;c<u;
10c++)l.push(e(s[c],a,n,this));return Promise.all(l).then((function(){return a}))}}(),e}()},{"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/typeof":19,three:79}],113:[function(e,t,n){"use strict";var r=e("./GLTFLoader"),i=e("three");n.init=function(){o.gltf=a(new r),o.texture=new i.TextureLoader,o.texture.setCrossOrigin("anonymous")},n.get=function(e){return o[e]},n.createQuickLoadFunc=a;var o={};function a(e,t,n){return function(r,i,o){return e.load(t?r.replace(t,n):r,i,(function(e){e.lengthComputable&&o.dispatch(e.loaded/e.total)}),(function(e){console.error(e)}))}}},{"./GLTFLoader":112,three:79}],114:[function(e,t,n){"use strict";var r=e("three");function i(){this.position=new r.Vector3,this.rotation=new r.Quaternion,this.scale=new r.Vector3(1,1,1),this.matrix=new r.Matrix4,this.enablePositionNoise=!0,this.enableRotationNoise=!0,this.positionFrequency=.25,this.rotationFrequency=.25,this.positionAmplitude=.3,this.rotationAmplitude=.003,this.positionScale=new r.Vector3(1,1,1),this.rotationScale=new r.Vector3(1,1,0),this.positionFractalLevel=3,this.rotationFractalLevel=3,this.times=new Float32Array(6),this.rehash()}t.exports=i;var o=i.prototype;o.rehash=function(){for(var e=0;e<6;e++)this.times[e]=-1e4*Math.random()},o.update=function(e){var t;if(e=void 0===e?1e3/60:e,this.enablePositionNoise){for(t=0;t<3;t++)this.times[t]+=this.positionFrequency*e;s.set(u(this.times[0],this.positionFractalLevel),u(this.times[1],this.positionFractalLevel),u(this.times[2],this.positionFractalLevel)),s.multiply(this.positionScale),s.multiplyScalar(this.positionAmplitude*l),this.position.copy(s)}if(this.enableRotationNoise){for(t=0;t<3;t++)this.times[t+3]+=this.rotationFrequency*e;s.set(u(this.times[3],this.rotationFractalLevel),u(this.times[4],this.rotationFractalLevel),u(this.times[5],this.rotationFractalLevel)),s.multiply(this.rotationScale),s.multiplyScalar(this.rotationAmplitude*l),a.set(s.x,s.y,s.z),this.rotation.setFromEuler(a)}this.matrix.compose(this.position,this.rotation,this.scale)};var a=new r.Euler,s=new r.Vector3,l=1/.75;var c=new function(){for(var e=1,t=1,n=[],r=0;r<256;++r)n.push(Math.random());var i=function(e,t,n){return e*(1-n)+t*n};return{getVal:function(r){var o=r*t,a=Math.floor(o),s=o-a,l=s*s*(3-2*s),c=255&a,u=c+1&255;return i(n[c],n[u],l)*e},setAmplitude:function(t){e=t},setScale:function(e){t=e}}};function u(e,t){for(var n=0,r=.5,i=0;i<t;i++)n+=r*c.getVal(e),e*=2,r*=.5;return n}},{three:79}],115:[function(e,t,n){"use strict";var r=e("../core/settings"),i=e("../core/properties"),o=e("./Page"),a=e("gsap").gsap,s=e("../ui/header/header"),l=e("../ui/about/about");e("../ui/transitionBlock");function c(){u.constructor.call(this,{id:"about",aliases:[/about/]})}t.exports=c;var u=o.prototype,h=c.prototype=Object.create(u);h.constructor=o,h.show=function(e,t,n,o,c){i.isAbout=!0,e===n?c():(!1!==i.useHalfScreen&&(i.useHalfScreen=!1,i.forceRenderOnResize=!0,r.resize()),l.show(),s.updateMenu(3),a.to(i,1,{pageRatio:1,onComplete:c}));u.show.call(this)},h.hide=function(e,t,n,r,o){i.isAbout=!1,e===n?o():(l.hide(),a.to(i,1,{pageRatio:0,onComplete:o}));u.hide.call(this)}},{"../core/properties":90,"../core/settings":91,"../ui/about/about":129,"../ui/header/header":153,"../ui/transitionBlock":158,"./Page":119,gsap:31}],116:[function(e,t,n){"use strict";var r=e("../core/settings"),i=e("../core/properties"),o=e("./Page"),a=e("../ui/editor/editor"),s=e("../ui/header/header"),l=e("gsap").gsap;function c(){u=document.querySelector(".editor"),h.constructor.call(this,{id:"editor",isMobileBlock:!0,mobileBlockMsg:"The Editor mode doesn't work on mobile. Please try it on a desktop device.",isVRBlock:!0,vrBlockMsg:"The Editor mode doesn't work on VR. Please try it on a desktop device.",aliases:[/editor/]})}t.exports=c;var u,h=o.prototype,d=c.prototype=Object.create(h);d.constructor=o,d.show=function(e,t,n,o,c){i.isEditor=!0,e===n?c():(!0!==i.useHalfScreen&&(i.useHalfScreen=!0,i.forceRenderOnResize=!0,r.resize()),a.initLocalSketches(),a.show(),a.resize(),s.updateMenu(2),l.to(u,1,{opacity:1}),l.to(i,1,{pageRatio:1,onComplete:c}));h.show.call(this)},d.hide=function(e,t,n,r,o){i.isEditor=!1,e===n?o():(a.hide(),l.to(u,1,{opacity:0}
10),l.to(i,1,{pageRatio:0,onComplete:o}));h.hide.call(this)}},{"../core/properties":90,"../core/settings":91,"../ui/editor/editor":131,"../ui/header/header":153,"./Page":119,gsap:31}],117:[function(e,t,n){"use strict";e("../core/settings");var r=e("../core/properties"),i=e("./Page"),o=e("gsap").gsap,a=e("../ui/header/header"),s=e("../ui/gallery/gallery");e("../ui/transitionBlock");function l(){c.constructor.call(this,{id:"gallery",isVRBlock:!0,vrBlockMsg:"The gallery is accessible inside VR Experience. Please Enter VR to select a shader.",aliases:[/gallery/]})}t.exports=l;var c=i.prototype,u=l.prototype=Object.create(c);u.constructor=i,u.show=function(e,t,n,i,l){r.isGallery=!0,document.body.classList.add("is-page-"+this.id),e===n?l():(s.show(),a.updateMenu(1),o.to(r,1,{pageRatio:1,onComplete:l}))},u.hide=function(e,t,n,i,a){document.body.classList.remove("is-page-"+this.id),e===n?(r.isGallery=!1,a()):(s.hide(),o.to(r,1,{pageRatio:0,onComplete:function(){r.isGallery=!1,a&&a()}}))}},{"../core/properties":90,"../core/settings":91,"../ui/gallery/gallery":151,"../ui/header/header":153,"../ui/transitionBlock":158,"./Page":119,gsap:31}],118:[function(e,t,n){"use strict";var r=e("../core/settings"),i=e("../core/properties"),o=e("./Page"),a=e("gsap").gsap,s=e("../controls/cameraControls"),l=e("../ui/shaderContext"),c=e("../visual/screen/screenShader"),u=e("../ui/header/header"),h=e("../shaders/shaders");function d(){p.constructor.call(this,{id:"home",aliasTestPirority:-100,aliases:[/.+/]})}t.exports=d;var p=o.prototype,f=d.prototype=Object.create(p);f.constructor=o,f.show=function(e,t,n,o,l){if(i.isHome=!0,e===n)l();else{!1!==i.useHalfScreen&&(i.useHalfScreen=!1,i.forceRenderOnResize=!0,r.resize()),s.changeMode("splines"),s.modes.splines.restart(),i.viewQuality=r.DEFAULT_VIEW_QUALITY;var d=h.infos[i.templateShaderId];c.changeShader((d||h.splineShaderList[0].id).shader),i.modelId="person",u.updateMenu(0),a.to(i,1,{pageRatio:1,onComplete:l})}p.show.call(this)},f.hide=function(e,t,n,r,o){i.isHome=!1,l.hide(),e===n?o():a.to(i,1,{pageRatio:0,onComplete:o});p.hide.call(this)}},{"../controls/cameraControls":86,"../core/properties":90,"../core/settings":91,"../shaders/shaders":128,"../ui/header/header":153,"../ui/shaderContext":157,"../visual/screen/screenShader":172,"./Page":119,gsap:31}],119:[function(e,t,n){"use strict";var r=e("mout/object/mixIn");function i(e){r(this,{id:"",aliasTestPirority:0,isMobileBlock:!1,mobileBlockMsg:"",isVRBlock:!1,vrBlockMsg:"",aliases:[]},e)}var o=i.prototype;t.exports=i;o.show=function(e,t,n,r,i){document.body.classList.add("is-page-"+this.id
10)},o.hide=function(e,t,n,r,i){document.body.classList.remove("is-page-"+this.id)}},{"mout/object/mixIn":54}],120:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault")(e("../ui/editor/Sketch")),i=e("../core/settings"),o=e("../core/properties"),a=e("./Page"),s=e("gsap").gsap,l=e("../io/shadertoy"),c=e("../controls/cameraControls"),u=e("../ui/viewInfos"),h=e("../ui/header/header"),d=e("../visual/screen/screenShader");function p(){f.constructor.call(this,{id:"view",aliases:[/view\/.+/]})}t.exports=p;var f=a.prototype,m=p.prototype=Object.create(f);m.constructor=a,m.loadShader=function(e,t,n){e||(e=o.viewShaderId);l.load(e,(function(e){if(e.success){var i=new r.default({id:e.shaderInfo.id});i.importShader(e.shader,e.shaderInfo),o.viewSketch=o.currentSketch=i,o.isPreview=!1,o.isView=!0,o.shaderInfos={title:e.shaderInfo.title,username:e.shaderInfo.username,likes:e.shaderInfo.likes,viewed:e.shaderInfo.viewed},t&&t(e)}else n&&n(e)}))},m.show=function(e,t,n,r,a){o.isView=!0,e===n?a():(!1!==o.useHalfScreen&&(o.useHalfScreen=!1,o.forceRenderOnResize=!0,i.resize()),c.changeMode("splines"),c.modes.splines.restart(),o.viewQuality=i.DEFAULT_VIEW_QUALITY,o.viewSketch&&!o.isPreview&&(o.currentSketch=o.viewSketch,d.changeShader(o.currentSketch.shader)),h.updateMenu(),s.to(o,1,{pageRatio:1,onComplete:a}),!1);f.show.call(this)},m.hide=function(e,t,n,r,i){o.isView=!1,e===n?i():(u.hide(),s.to(o,1,{pageRatio:0,onComplete:i}));f.hide.call(this)}},{"../controls/cameraControls":86,"../core/properties":90,"../core/settings":91,"../io/shadertoy":110,"../ui/editor/Sketch":130,"../ui/header/header":153,"../ui/viewInfos":159,"../visual/screen/screenShader":172,"./Page":119,"@babel/runtime/helpers/interopRequireDefault":11,gsap:31}],121:[function(e,t,n){"use strict";var r=e("three"),i=e("mout/object/merge"),o=e("../helpers/fboHelper");function a(e){i(this,{uniforms:{u_texture:{},u_resolution:{value:null},u_fullResolution:{value:null},u_isVR:{value:!1}},defines:{},enabled:!0,vertexShader:"",fragmentShader:"",isRawMaterial:!0,depthTest:!1,depthWrite:!1,blending:r.NoBlending,transparent:!0},e),this.vertexShader||(this.vertexShader=o.vertexShader),this.addRawShaderPrefix&&this.isRawMaterial&&(this.vertexShader=o.precisionPrefix+this.vertexShader,this.fragmentShader=o.precisionPrefix+this.fragmentShader),this.material=new(this.isRawMaterial?r.RawShaderMaterial:r.ShaderMaterial)({uniforms:this.uniforms,vertexShader:this.vertexShader,fragmentShader:this.fragmentShader,defines:this.defines,depthTest:this.depthTest,depthWrite:this.depthWrite,blending:this.blending,transparent:this.transparent})}t.exports=a;var s=a.prototype;s.setPostprocessing=function(e){this.uniforms.u_resolution.value=e.resolution},s.dispose=function(){},s.needsRender=function(){return!0},s.render=function(e,t){this.uniforms.u_texture.value=e.fromTexture,e.renderMaterial(this.material,t?null:e.toRenderTarget),e.swap()}},{"../helpers/fboHelper":97,"mout/object/merge":53,three:79}],122:[function(e,t,n){"use strict";var r=e("three"),i=e("../helpers/fboHelper"),o=e("min-signal");function a(e,t){l||n.init(),this.width=1,this.height=1,this.scene=null,this.camera=null,this.preserveScene=!!e,this.resolution=new r.Vector2(0,0),this.fullResolution=new r.Vector2(0,0),this.onBeforeSceneRendered=new o,this.onAfterSceneRendered=new o,this.onAfterRendered=new o,this.fromRenderTarget=i.createRenderTarget(1,1),this.fromRenderTarget.depthBuffer=!0,this.fromRenderTarget.stencilBuffer=!0,this.toRenderTarget=this.fromRenderTarget.clone(),this.prevSceneRenderTarget=e?this.fromRenderTarget.clone():null,this.sceneRenderTarget=e?this.fromRenderTarget.clone():null,this.useDepthTexture=!!t,this.useDepthTexture&&(this.depthTexture=new r.DepthTexture,this.depthTexture.type=r.UnsignedShortType,this.depthTextureUniform={value:this.depthTexture}),this.fromTexture=this.fromRenderTarget.texture,this.toTexture=this.toRenderTarget.texture,this.prevSceneTexture=e?this.prevSceneRenderTarget.texture:null,this.sceneTexture=e?this.sceneRenderTarget.texture:null,this.mesh=new r.Mesh,this.queue=[]}var s=a.prototype;n=t.exports=a,s.swap=function(){var e=this.fromRenderTarget;this.fromRenderTarget=this.toRenderTarget,this.toRenderTarget=e,this.fromTexture=this.fromRenderTarget.texture,this.toTexture=this.toRenderTarget.texture},s.setSize=function(e,t){this.width=e,this.height=t,this.resolution.set(e,t),this.fullResolution.set(e,t),this.preserveScene&&this.sceneRenderTarget.setSize(e,t);this.preserveScene&&this.prevSceneRenderTarget.setSize(e,t);this.fromRenderTarget.setSize(e,t),this.toRenderTarget.setSize(e,t)},s.dispose=function(){this.fromRenderTarget&&this.fromRenderTarget.dispose();this.toRenderTarget&&this.toRenderTarget.dispose();this.prevSceneRenderTarget&&this.prevSceneRenderTarget.dispose();this.sceneRenderTarget&&this.sceneRenderTarget.dispose()},s.renderMaterial=function(e,t){this.mesh.material=e,i.renderMesh(this.mesh,t)},s.render=function(e,t,n){var r=i.renderer;this.scene=e,this.camera=t,this.mesh.geometry=r.xr.enabled?c:l;var o,a=this.queue.filter(u);
10if(this.onBeforeSceneRendered.dispatch(),this.preserveScene){var s=this.prevSceneRenderTarget;this.prevSceneRenderTarget=this.sceneRenderTarget,this.sceneRenderTarget=s,this.prevSceneTexture=this.prevSceneRenderTarget.texture,this.sceneTexture=this.sceneRenderTarget.texture}if(a.length){this.useDepthTexture&&(this.fromRenderTarget.depthTexture=this.depthTexture),r.setRenderTarget(this.fromRenderTarget),r.render(e,t);r.getRenderTarget();var h=r.xr.enabled,d=r.shadowMap.autoUpdate;r.xr.enabled=!1,r.shadowMap.autoUpdate=!1,r.setRenderTarget(null),this.preserveScene&&i.copy(this.fromRenderTarget.texture,this.sceneRenderTarget),this.onAfterSceneRendered.dispatch(this.fromRenderTarget,this.sceneRenderTarget);var p=i.getColorState();r.autoClear=!1;for(var f=0,m=a.length;f<m;f++){var v=f===m-1&&n;(o=a[f]).setPostprocessing(this),o.render(this,v)}i.setColorState(p),r.xr.enabled=h,r.shadowMap.autoUpdate=d}else this.preserveScene?(r.setRenderTarget(this.sceneRenderTarget),r.render(e,t),r.setRenderTarget(null),n&&i.copy(this.sceneRenderTarget.texture),this.onAfterSceneRendered.dispatch(this.sceneRenderTarget,null)):r.render(e,t);this.onAfterRendered.dispatch()};var l=n.geom=null,c=n.vrGeom=null;function u(e){return e.enabled&&e.needsRender()}n.init=function(){(l=n.geom=n.geom||new r.BufferGeometry).setAttribute("position",new r.BufferAttribute(new Float32Array([-1,-1,0,4,-1,0,-1,4,0]),3)),l.setAttribute("a_uvClamp",new r.BufferAttribute(new Float32Array([0,0,1,1,0,0,1,1,0,0,1,1]),4)),(c=n.vrGeom=n.vrGeom||new r.BufferGeometry).setAttribute("position",new r.BufferAttribute(new Float32Array([-4,-1,0,0,-1,0,0,4,0,0,-1,0,4,-1,0,0,4,0]),3)),c.setAttribute("a_uvClamp",new r.BufferAttribute(new Float32Array([0,0,.5,1,0,0,.5,1,0,0,.5,1,.5,0,1,1,.5,0,1,1,.5,0,1,1]),4))}},{"../helpers/fboHelper":97,"min-signal":32,three:79}],123:[function(e,t,n){"use strict";var r=e("../PostEffect"),i=e("../../helpers/fboHelper"),o=e("../../utils/math"),a=e("mout/object/merge"),s=e("glslify"),l=e("three");function c(e){var t=(e=a({useHighPass:!0,ITERATION:4,amount:.75,radius:.75,threshold:.1},e)).ITERATION;this.directionX=new l.Vector2(1,0),this.directionY=new l.Vector2(0,1);var n=this.highPassRenderTarget=i.createRenderTarget(1,1);this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.blurMaterials=[];for(var r=0;r<t;r++)this.renderTargetsHorizontal.push(n.clone()),this.renderTargetsVertical.push(n.clone());for(var o={u_bloomStrength:{value:1},u_bloomWeights:{value:[]}},c=0;c<t;c++)o["u_blurTexture"+c]={value:this.renderTargetsVertical[c].texture};u.constructor.call(this,a({uniforms:o,defines:{ITERATION:t},fragmentShader:i.precisionPrefix+s(["#define GLSLIFY 1\nvarying vec2 v_uv;\nuniform sampler2D u_texture;\n\nuniform sampler2D u_blurTexture0;\n#if ITERATION > 1\nuniform sampler2D u_blurTexture1;\n#endif\n#if ITERATION > 2\nuniform sampler2D u_blurTexture2;\n#endif\n#if ITERATION > 3\nuniform sampler2D u_blurTexture3;\n#endif\n#if ITERATION > 4\nuniform sampler2D u_blurTexture4;\n#endif\nuniform float u_bloomWeights[ITERATION];\n\n#include <common>\n\t// based on https://www.shadertoy.com/view/MslGR8\n\tvec3 dithering( vec3 color ) {\n\t\t//Calculate grid position\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\n\t\t//modify shift acording to grid position.\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\n\t\t//shift the color by dither_shift\n\t\treturn color + dither_shift_RGB;\n\t}\n\nvoid main() {\n\tvec4 c = texture2D(u_texture, v_uv);\n\tvec3 luma = vec3( 0.299, 0.587, 0.114 );\n\tfloat v = dot( c.xyz, luma );\n\tfloat a = 1.0 - v;//max(0.0, 1.2 - v);//mix(1.0, 0.1, v);\n\n\tgl_FragColor = c + (\n\t\tu_bloomWeights[0] * texture2D(u_blurTexture0, v_uv)\n\t\t#if ITERATION > 1\n\t\t+ u_bloomWeights[1] * texture2D(u_blurTexture1, v_uv)\n\t\t#endif\n\t\t#if ITERATION > 2\n\t\t+ u_bloomWeights[2] * texture2D(u_blurTexture2, v_uv)\n\t\t#endif\n\t\t#if ITERATION > 3\n\t\t+ u_bloomWeights[3] * texture2D(u_blurTexture3, v_uv)\n\t\t#endif\n\t\t#if ITERATION > 4\n\t\t+ u_bloomWeights[4] * texture2D(u_blurTexture4, v_uv)\n\t\t#endif\n\t) * a;\n\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n\tgl_FragColor.a = 1.0;\n}\n"]),blending:l.NoBlending},e)),this.highPassMaterial=new l.RawShaderMaterial({uniforms:{u_texture:{value:null},u_luminosityThreshold:{value:1},u_smoothWidth:{value:1}},vertexShader:i.precisionPrefix+i.vertexShader,fragmentShader:i.precisionPrefix+s(["#define GLSLIFY 1\nuniform sampler2D u_texture;\n\nuniform float u_luminosityThreshold;\nuniform float u_smoothWidth;\n\nvarying vec2 v_uv;\n\nvoid main() {\n\n vec4 texel = texture2D( u_texture, v_uv );\n\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n\n float v = dot( texel.xyz, luma );\n\n vec4 outputColor = vec4(0.0, 0.0, 0.0, 1.0);\n\n float alpha = smoothstep( u_luminosityThreshold, u_luminosityThreshold + u_smoothWidth, v );\n\n outputColor = mix( outputColor, texel, alpha );
10\n\n gl_FragColor = vec4(outputColor.rgb, 1.0);\n\n}\n"])});for(var h=0;h<this.ITERATION;h++){var d=3+2*h;this.blurMaterials[h]=new l.RawShaderMaterial({uniforms:{u_texture:{value:null},u_resolution:{value:new l.Vector2},u_direction:{value:null}},vertexShader:i.precisionPrefix+i.vertexShader,fragmentShader:i.precisionPrefix+s(["#define GLSLIFY 1\nvarying vec2 v_uv;\nuniform sampler2D u_texture;\nuniform vec2 u_resolution;\nuniform vec2 u_direction;\n\nfloat gaussianPdf(in float x, in float sigma) {\n return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n}\nvoid main() {\n vec2 invSize = 1.0 / u_resolution;\n float fSigma = float(SIGMA);\n float weightSum = gaussianPdf(0.0, fSigma);\n vec3 diffuseSum = texture2D( u_texture, v_uv).rgb * weightSum;\n for( int i = 1; i < KERNEL_RADIUS; i ++ ) {\n float x = float(i);\n float w = gaussianPdf(x, fSigma);\n vec2 uvOffset = u_direction * invSize * x;\n vec3 sample1 = texture2D( u_texture, v_uv + uvOffset).rgb;\n vec3 sample2 = texture2D( u_texture, v_uv - uvOffset).rgb;\n diffuseSum += (sample1 + sample2) * w;\n weightSum += 2.0 * w;\n }\n gl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n}\n"]),defines:{KERNEL_RADIUS:d,SIGMA:d}})}}var u=r.prototype,h=c.prototype=Object.create(u);h.constructor=c,h.setPostprocessing=function(e){u.setPostprocessing.call(this,e);var t=e.width,n=e.height,r=Math.ceil(t/2),i=Math.ceil(n/2);this.highPassRenderTarget.setSize(r,i);for(var o=0;o<this.ITERATION;o++)this.renderTargetsHorizontal[o].setSize(r,i),this.renderTargetsVertical[o].setSize(r,i),this.blurMaterials[o].uniforms.u_resolution.value=new l.Vector2(r,i),r=Math.ceil(r/2),i=Math.ceil(i/2)},h.dispose=function(){this.highPassRenderTarget&&this.highPassRenderTarget.dispose();for(var e=0;e<this.ITERATION;e++)this.renderTargetsHorizontal[e]&&this.renderTargetsHorizontal[e].dispose(),this.renderTargetsVertical[e]&&this.renderTargetsVertical[e].dispose()},h.needsRender=function(){return!!this.amount},h.render=function(e,t){var n=this.ITERATION;this.useHighPass&&(this.highPassMaterial.uniforms.u_texture.value=e.fromTexture,this.highPassMaterial.uniforms.u_luminosityThreshold.value=this.threshold,e.renderMaterial(this.highPassMaterial,this.highPassRenderTarget));for(var r=this.useHighPass?this.highPassRenderTarget:e.fromRenderTarget,i=0;i<n;i++){var a=this.blurMaterials[i];a.uniforms.u_texture.value=r.texture,a.uniforms.u_direction.value=this.directionX,e.renderMaterial(a,this.renderTargetsHorizontal[i]),a.uniforms.u_texture.value=this.renderTargetsHorizontal[i].texture,a.uniforms.u_direction.value=this.directionY,e.renderMaterial(a,this.renderTargetsVertical[i]),r=this.renderTargetsVertical[i]}this.material.uniforms.u_texture.value=e.fromTexture;for(var s=0;s<n;s++){var l=(n-s)/n;this.uniforms.u_bloomWeights.value[s]=this.amount*o.mix(l,1.2-l,this.radius)/Math.pow(2,n-s-1)}u.render.call(this,e,t)},t.exports=c},{"../../helpers/fboHelper":97,"../../utils/math":165,"../PostEffect":121,glslify:30,"mout/object/merge":53,three:79}],124:[function(e,t,n){"use strict";var r=e("../PostEffect"),i=e("../../effects/blur/blur"),o=e("../../helpers/fboHelper"),a=e("../../utils/math"),s=e("mout/object/merge"),l=e("glslify"),c=e("three");function u(e){for(var t in e=s({opacity:1,rgbOffset:.001,bgColor:"#051015"},e),h.constructor.call(this,s({uniforms:{u_opacity:{value:0},u_rgbOffset:{value:.01},u_bgColor:{value:new c.Color}},fragmentShader:o.precisionPrefix+l(["#define GLSLIFY 1\nvarying vec2 v_uv;\nuniform sampler2D u_texture;\nuniform float u_opacity;\nuniform vec3 u_bgColor;\n\n#ifdef USE_RGB_SHIFT\nuniform float u_rgbOffset;\n#endif\n\nvec3 screen (vec3 cb, vec3 cs) {\n\treturn cb + cs - (cb * cs);\n}\n\nvec3 colorDodge (vec3 cb, vec3 cs) {\n\treturn mix(\n\t\tmin(vec3(1.0), cb / (1.0 - cs)),\n\t\tvec3(1.0),\n\t\tstep(vec3(1.0), cs)\n\t);\n}\n\nvoid main() {\n\tvec2 uv = v_uv;\n\t\n\t#ifdef USE_RGB_SHIFT\n\tvec2 uvOffset = (uv - 0.5) * (1.0 + u_rgbOffset) + 0.5 - uv;\n\tvec3 color = vec3(\n\t\ttexture2D(u_texture, uv + uvOffset).r,\n\t\ttexture2D(u_texture, uv).g,\n\t\ttexture2D(u_texture, uv - uvOffset).b\n\t);\n\t#else\n\tvec3 color = texture2D(u_texture, uv).rgb;\n\t#endif\n\n\tcolor *= u_opacity;\n\n\t// vigeette\n\tvec2 toCenter = uv - 0.5;
10\n\tcolor *= 1.0 - dot(toCenter, toCenter) * 2.0;\n\n\t// linear dodge add\n\tcolor = mix(color, screen(colorDodge(color, u_bgColor), u_bgColor), 0.75);\n\tgl_FragColor = vec4(mix(vec3(0.0196078431372549,0.06274509803921569,0.08235294117647059), color, min(1.0, u_opacity * 8.0)), 1.0);\n}\n"]),blending:c.NoBlending},e)),this.rgbShiftMaterial=new c.RawShaderMaterial({uniforms:{},vertexShader:this.material.vertexShader,fragmentShader:this.material.fragmentShader}),this.nonRgbShiftMaterial=this.material,this.rgbShiftMaterial.defines.USE_RGB_SHIFT=!0,this.material.uniforms)this.rgbShiftMaterial.uniforms[t]=this.material.uniforms[t];this.blurRenderTarget=o.createRenderTarget(1,1)}t.exports=u;var h=r.prototype,d=u.prototype=Object.create(h);d.constructor=u,d.needsRender=function(){return!0},d.render=function(e,t){this.uniforms.u_opacity.value=this.opacity,this.uniforms.u_bgColor.value.set(this.bgColor);var n=a.cUnMix(.5,0,this.opacity);n>0?(this.uniforms.u_rgbOffset.value=this.rgbOffset*(1-this.opacity*this.opacity)*16,this.material=this.rgbShiftMaterial,i.blur9(2*n,.5,e.fromRenderTarget,this.blurRenderTarget,e.fromRenderTarget),i.blur9(4*n,.25,e.fromRenderTarget,this.blurRenderTarget,e.fromRenderTarget),i.blur9(8*n,.25,e.fromRenderTarget,this.blurRenderTarget,e.fromRenderTarget)):this.material=this.nonRgbShiftMaterial;h.render.call(this,e,t)}},{"../../effects/blur/blur":94,"../../helpers/fboHelper":97,"../../utils/math":165,"../PostEffect":121,glslify:30,"mout/object/merge":53,three:79}],125:[function(e,t,n){"use strict";var r=e("../../helpers/fboHelper"),i=e("../PostEffect"),o=e("mout/object/merge"),a=e("three"),s=e("glslify");function l(e){e=o({},e),this.edgesRenderTarget=r.createRenderTarget(1,1),this.weightsRenderTarget=r.createRenderTarget(1,1,!0),this.uResolutionInv={value:new a.Vector2},c.constructor.call(this,o({uniforms:{u_weightsTexture:{value:this.weightsRenderTarget.texture},u_resolutionInv:this.uResolutionInv},vertexShader:r.precisionPrefix+s(["#define GLSLIFY 1\nattribute vec3 position;\n\nuniform vec2 u_resolutionInv;\n\nvarying vec2 v_uv;\nvarying vec4 v_offsets[ 2 ];\n\nvoid SMAANeighborhoodBlendingVS( vec2 texcoord ) {\n v_offsets[ 0 ] = texcoord.xyxy + u_resolutionInv.xyxy * vec4(
10-1.0, 0.0, 0.0, 1.0 ); // WebGL port note: Changed sign in W component\n v_offsets[ 1 ] = texcoord.xyxy + u_resolutionInv.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 ); // WebGL port note: Changed sign in W component\n}\n\nvoid main() {\n\tv_uv = position.xy * 0.5 + 0.5;\n\n SMAANeighborhoodBlendingVS( v_uv );\n\n // gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n gl_Position = vec4( position, 1.0 );\n\n}\n"]),fragmentShader:r.precisionPrefix+s(["#define GLSLIFY 1\nuniform sampler2D u_weightsTexture;\nuniform sampler2D u_texture;\nuniform vec2 u_resolutionInv;\n\nvarying vec2 v_uv;\nvarying vec4 v_offsets[ 2 ];\n\nvec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {\n // Fetch the blending weights for current pixel:\n vec4 a;\n a.xz = texture2D( blendTex, texcoord ).xz;\n a.y = texture2D( blendTex, offset[ 1 ].zw ).g;\n a.w = texture2D( blendTex, offset[ 1 ].xy ).a;\n\n // Is there any blending weight with a value greater than 0.0?\n if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {\n return texture2D( colorTex, texcoord, 0.0 );\n } else {\n // Up to 4 lines can be crossing a pixel (one through each edge). We\n // favor blending by choosing the line with the maximum weight for each\n // direction:\n vec2 offset;\n offset.x = a.a > a.b ? a.a : -a.b; // left vs. right\n offset.y = a.g > a.r ? -a.g : a.r; // top vs. bottom // WebGL port note: Changed signs\n\n // Then we go in the direction that has the maximum weight:\n if ( abs( offset.x ) > abs( offset.y )) { // horizontal vs. vertical\n offset.y = 0.0;\n } else {\n offset.x = 0.0;\n }\n\n // Fetch the opposite color and lerp by hand:\n vec4 C = texture2D( colorTex, texcoord, 0.0 );\n texcoord += sign( offset ) * u_resolutionInv;\n vec4 Cop = texture2D( colorTex, texcoord, 0.0 );\n float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );\n\n // WebGL port note: Added gamma correction\n C.xyz = pow(abs(C.xyz), vec3(2.2));\n Cop.xyz = pow(abs(Cop.xyz), vec3(2.2));\n vec4 mixed = mix(C, Cop, s);\n mixed.xyz = pow(abs(mixed.xyz), vec3(1.0 / 2.2));\n\n return mixed;\n }\n}\n\nvoid main() {\n\n gl_FragColor = SMAANeighborhoodBlendingPS( v_uv, v_offsets, u_texture, u_weightsTexture );\n}\n"])},e)),this.edgesMaterial=new a.RawShaderMaterial({uniforms:{u_texture:{value:null},u_resolutionInv:this.uResolutionInv},vertexShader:r.precisionPrefix+s(["#define GLSLIFY 1\nattribute vec3 position;\n\nuniform vec2 u_resolutionInv;\n\nvarying vec2 v_uv;\nvarying vec4 v_offsets[ 3 ];\n\nvoid SMAAEdgeDetectionVS( vec2 texcoord ) {\n v_offsets[ 0 ] = texcoord.xyxy + u_resolutionInv.xyxy * vec4(
10-1.0, 0.0, 0.0, 1.0 ); // WebGL port note: Changed sign in W component\n v_offsets[ 1 ] = texcoord.xyxy + u_resolutionInv.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 ); // WebGL port note: Changed sign in W component\n v_offsets[ 2 ] = texcoord.xyxy + u_resolutionInv.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 ); // WebGL port note: Changed sign in W component\n}\n\nvoid main() {\n\n\tv_uv = position.xy * 0.5 + 0.5;\n\n SMAAEdgeDetectionVS( v_uv );\n\n // gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n gl_Position = vec4( position, 1.0 );\n\n}\n"]),fragmentShader:r.precisionPrefix+s(["#define GLSLIFY 1\nuniform sampler2D u_texture;\n\nvarying vec2 v_uv;\nvarying vec4 v_offsets[ 3 ];\n\nvec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {\n vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );\n\n // Calculate color deltas:\n vec4 delta;\n vec3 C = texture2D( colorTex, texcoord ).rgb;\n\n vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;\n vec3 t = abs( C - Cleft );\n delta.x = max( max( t.r, t.g ), t.b );\n\n vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;\n t = abs( C - Ctop );\n delta.y = max( max( t.r, t.g ), t.b );\n\n // We do the usual threshold:\n vec2 edges = step( threshold, delta.xy );\n\n // Then discard if there is no edge:\n if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )\n discard;\n\n // Calculate right and bottom deltas:\n vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;\n t = abs( C - Cright );\n delta.z = max( max( t.r, t.g ), t.b );\n\n vec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;\n t = abs( C - Cbottom );\n delta.w = max( max( t.r, t.g ), t.b );\n\n // Calculate the maximum delta in the direct neighborhood:\n float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );\n\n // Calculate left-left and top-top deltas:\n vec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;\n t = abs( C - Cleftleft );\n delta.z = max( max( t.r, t.g ), t.b );\n\n vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;\n t = abs( C - Ctoptop );\n delta.w = max( max( t.r, t.g ), t.b );\n\n // Calculate the final maximum delta:\n maxDelta = max( max( maxDelta, delta.z ), delta.w );\n\n // Local contrast adaptation in action:\n edges.xy *= step( 0.5 * maxDelta, delta.xy );\n\n return vec4( edges, 0.0, 0.0 );\n}\n\nvoid main() {\n\n gl_FragColor = SMAAColorEdgeDetectionPS( v_uv, v_offsets, u_texture );\n\n}\n"]),defines:{SMAA_THRESHOLD:"0.1"},blending:a.NoBlending,depthTest:!1,depthWrite:!1}),this.weightsMaterial=new a.RawShaderMaterial({uniforms:{u_edgesTexture:{value:this.edgesRenderTarget.texture},u_areaTexture:h.u_areaTexture,u_searchTexture:h.u_searchTexture,u_resolutionInv:this.uResolutionInv},vertexShader:r.precisionPrefix+s(["#define GLSLIFY 1\nattribute vec3 position;\n\nuniform vec2 u_resolutionInv;\n\nvarying vec2 v_uv;\nvarying vec4 v_offsets[ 3 ];\nvarying vec2 v_pixcoord;\n\nvoid SMAABlendingWeightCalculationVS( vec2 texcoord ) {\n v_pixcoord = texcoord / u_resolutionInv;\n\n // We will use these offsets for the searches later on (see @PSEUDO_GATHER4):\n v_offsets[ 0 ] = texcoord.xyxy + u_resolutionInv.xyxy * vec4(
10-0.25, 0.125, 1.25, 0.125 ); // WebGL port note: Changed sign in Y and W components\n v_offsets[ 1 ] = texcoord.xyxy + u_resolutionInv.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 ); // WebGL port note: Changed sign in Y and W components\n\n // And these for the searches, they indicate the ends of the loops:\n v_offsets[ 2 ] = vec4( v_offsets[ 0 ].xz, v_offsets[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * u_resolutionInv.xxyy * float( SMAA_MAX_SEARCH_STEPS );\n\n}\n\nvoid main() {\n\tv_uv = position.xy * 0.5 + 0.5;\n\n SMAABlendingWeightCalculationVS( v_uv );\n\n // gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n gl_Position = vec4( position, 1.0 );\n\n}\n"]),fragmentShader:r.precisionPrefix+s(["#define GLSLIFY 1\n#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * u_resolutionInv, 0.0 )\n\nuniform sampler2D u_edgesTexture;\nuniform sampler2D u_areaTexture;\nuniform sampler2D u_searchTexture;\nuniform vec2 u_resolutionInv;\n\nvarying vec2 v_uv;\nvarying vec4 v_offsets[3];\nvarying vec2 v_pixcoord;\n\nvec2 round( vec2 x ) {\n return sign( x ) * floor( abs( x ) + 0.5 );\n}\n\nfloat SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {\n // Not required if searchTex accesses are set to point:\n // float2 SEARCH_TEX_PIXEL_SIZE = 1.0 / float2(66.0, 33.0);\n // e = float2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE +\n // e * float2(scale, 1.0) * float2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE;\n e.r = bias + e.r * scale;\n return 255.0 * texture2D( searchTex, e, 0.0 ).r;\n}\n\nfloat SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {\n /**\n * @PSEUDO_GATHER4\n * This texcoord has been offset by (-0.25, -0.125) in the vertex shader to\n * sample between edge, thus fetching four edges in a row.\n * Sampling with different offsets in each direction allows to disambiguate\n * which edges are active from the four fetched ones.\n */\n vec2 e = vec2( 0.0, 1.0 );\n\n for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) { // WebGL port note: Changed while to for\n e = texture2D( edgesTex, texcoord, 0.0 ).rg;\n texcoord -= vec2( 2.0, 0.0 ) * u_resolutionInv;\n if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;\n }\n\n // We correct the previous (-0.25, -0.125) offset we applied:\n texcoord.x += 0.25 * u_resolutionInv.x;\n\n // The searches are bias by 1, so adjust the coords accordingly:\n texcoord.x += u_resolutionInv.x;\n\n // Disambiguate the length added by the last step:\n texcoord.x += 2.0 * u_resolutionInv.x; // Undo last step\n texcoord.x -= u_resolutionInv.x * SMAASearchLength(searchTex, e, 0.0, 0.5);\n\n return texcoord.x;\n}\n\nfloat SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {\n vec2 e = vec2( 0.0, 1.0 );\n\n for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) { // WebGL port note: Changed while to for\n e = texture2D( edgesTex, texcoord, 0.0 ).rg;\n texcoord += vec2( 2.0, 0.0 ) * u_resolutionInv;\n if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;\n }\n\n texcoord.x -= 0.25 * u_resolutionInv.x;\n texcoord.x -= u_resolutionInv.x;\n texcoord.x -= 2.0 * u_resolutionInv.x;\n texcoord.x += u_resolutionInv.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );\n\n return texcoord.x;\n}\n\nfloat SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {\n vec2 e = vec2( 1.0, 0.0 );\n\n for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) { // WebGL port note: Changed while to for\n e = texture2D( edgesTex, texcoord, 0.0 ).rg;\n texcoord += vec2( 0.0, 2.0 ) * u_resolutionInv; // WebGL port note: Changed sign\n if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;\n }\n\n texcoord.y -= 0.25 * u_resolutionInv.y; // WebGL port note: Changed sign\n texcoord.y -= u_resolutionInv.y; // WebGL port note: Changed sign\n texcoord.y -= 2.0 * u_resolutionInv.y; // WebGL port note: Changed sign\n texcoord.y += u_resolutionInv.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 ); // WebGL port note: Changed sign\n\n return texcoord.y;\n}\n\nfloat SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {\n vec2 e = vec2( 1.0, 0.0 );\n\n for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) { // WebGL port note: Changed while to for\n e = texture2D( edgesTex, texcoord, 0.0 ).rg;\n texcoord -= vec2( 0.0, 2.0 ) * u_resolutionInv; // WebGL port note: Changed sign\n if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;\n }\n\n texcoord.y += 0.25 * u_resolutionInv.y; // WebGL port note: Changed sign\n texcoord.y += u_resolutionInv.y; // WebGL port note: Changed sign\n texcoord.y += 2.0 * u_resolutionInv.y; // WebGL port note: Changed sign\n texcoord.y -= u_resolutionInv.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 ); // WebGL port note: Changed sign\n\n return texcoord.y;\n}\n\nvec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {\n // Rounding prevents precision errors of bilinear filtering:\n vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e
101, e2 ) ) + dist;\n\n // We do a scale and bias for mapping to texel space:\n texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );\n\n // Move to proper place, according to the subpixel offset:\n texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;\n\n return texture2D( areaTex, texcoord, 0.0 ).rg;\n}\n\nvec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {\n vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );\n\n vec2 e = texture2D( edgesTex, texcoord ).rg;\n\n if ( e.g > 0.0 ) { // Edge at north\n vec2 d;\n\n // Find the distance to the left:\n vec2 coords;\n coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );\n coords.y = offset[ 1 ].y; // offset[1].y = texcoord.y - 0.25 * u_resolutionInv.y (@CROSSING_OFFSET)\n d.x = coords.x;\n\n // Now fetch the left crossing edges, two at a time using bilinear\n // filtering. Sampling at -0.25 (see @CROSSING_OFFSET) enables to\n // discern what value each edge has:\n float e1 = texture2D( edgesTex, coords, 0.0 ).r;\n\n // Find the distance to the right:\n coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );\n d.y = coords.x;\n\n // We want the distances to be in pixel units (doing this here allow to\n // better interleave arithmetic and memory accesses):\n d = d / u_resolutionInv.x - pixcoord.x;\n\n // SMAAArea below needs a sqrt, as the areas texture is compressed\n // quadratically:\n vec2 sqrt_d = sqrt( abs( d ) );\n\n // Fetch the right crossing edges:\n coords.y -= 1.0 * u_resolutionInv.y; // WebGL port note: Added\n float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;\n\n // Ok, we know how this pattern looks like, now it is time for getting\n // the actual area:\n weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );\n }\n\n if ( e.r > 0.0 ) { // Edge at west\n vec2 d;\n\n // Find the distance to the top:\n vec2 coords;\n\n coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );\n coords.x = offset[ 0 ].x; // offset[1].x = texcoord.x - 0.25 * u_resolutionInv.x;\n d.x = coords.y;\n\n // Fetch the top crossing edges:\n float e1 = texture2D( edgesTex, coords, 0.0 ).g;\n\n // Find the distance to the bottom:\n coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );\n d.y = coords.y;\n\n // We want the distances to be in pixel units:\n d = d / u_resolutionInv.y - pixcoord.y;\n\n // SMAAArea below needs a sqrt, as the areas texture is compressed\n // quadratically:\n vec2 sqrt_d = sqrt( abs( d ) );\n\n // Fetch the bottom crossing edges:\n coords.y -= 1.0 * u_resolutionInv.y; // WebGL port note: Added\n float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;\n\n // Get the area for this direction:\n weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );\n }\n\n return weights;\n}\n\nvoid main() {\n\n gl_FragColor = SMAABlendingWeightCalculationPS( v_uv, v_pixcoord, v_offsets, u_edgesTexture, u_areaTexture, u_searchTexture, ivec4( 0.0 ) );\n\n}\n"]),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 )"},transparent:!0,blending:a.NoBlending,depthTest:!1,depthWrite:!1})}var c=i.prototype,u=l.prototype=Object.create(c);u.constructor=l,u.setPostprocessing=function(e){c.setPostprocessing.call(this,e);var t=e.width,n=e.height;this.edgesRenderTarget.setSize(t,n),this.weightsRenderTarget.setSize(t,n),this.uResolutionInv.value.set(1/t,1/n)},u.dispose=function(){this.edgesRenderTarget&&this.edgesRenderTarget.dispose();this.weightsRenderTarget&&this.weightsRenderTarget.dispose()},u.needsRender=function(){return!h.u_areaTexture.value.needsUpdate},u.render=function(e,t){var n=r.getColorState();h.u_searchTexture.value||console.warn("You need to use Smaa.setImages() to set the smaa textures manually and assign to this class.");var i=r.renderer;i.autoClear=!0,i.setClearColor(0,0),this.edgesMaterial.uniforms.u_texture.value=e.fromTexture,e.renderMaterial(this.edgesMaterial,this.edgesRenderTarget,!0),e.renderMaterial(this.weightsMaterial,this.weightsRenderTarget,!0),r.setColorState(n),this.material.uniforms.u_texture.value=e.fromTexture,c.render.call(this,e,t)},(n=t.exports=l).setTextures=function(e,t){var n;(n=h.u_areaTexture.value=d(e)).format=a.RGBFormat,n.minFilter=a.LinearFilter,(n=h.u_searchTexture.value=d(t)).magFilter=a.NearestFilter,n.minFilter=a.NearestFilter},n.updateTextures=function(){h.u_areaTexture.value.needsUpdate=!0,h.u_searchTexture.value.needsUpdate=!0};var h={u_areaTexture:{value:null},u_searchTexture:{value:null}};function d(e){var t=new a.Texture(e);return t.generateMipmaps=!1,t.flipY=!1,t}},{"../../helpers/fboHelper":97,"../PostEffect":121,glslify:30,"mout/object/merge":53,three:79}],126:[function(e,t,n){"use strict";var r=e("../core/browser"),i=e("../core/settings"),o=(e("../core/properties"),e("../io/shadertoy")),a=e("../ui
10/prompt/prompt"),s=e("mout/string/trim");n.preInit=function(e){window.addEventListener("popstate",y),x(n.currPath);for(var t=0,s=d.length;t<s;t++){var l=d[t]=new d[t];p[l.id]=l}d.sort((function(e,t){return t.aliasTestPirority-e.aliasTestPirority}));var c=T(n.currPath);r.isVRBrowser&&c.isVRBlock&&(a.showMsg(c.vrBlockMsg,!0),history.replaceState(null,null,"/"+i.QUERY_STRING),x(n.currPath));r.isMobile&&c.isMobileBlock&&!c.isVRBlock&&(a.showMsg(c.mobileBlockMsg,!0),history.replaceState(null,null,"/"+i.QUERY_STRING),x(n.currPath));if(function(e){if(!e.dataset.hasLinksParsed){for(var t=e.getElementsByTagName("a"),n=t.length;n--;)w(t[n]);e.dataset.hasLinksParsed=!0}}(document.body),2===h.length&&"view"===h[0]){var u=e;c.loadShader(h[1],u,(function(t){a.showMsg(o.ERROR_MESSAGES[t.errorType],!0),E("/"),e()}))}else e()},n.init=function(){f=!0,C()},n.isAnimating=g,n.parseCurrUrl=x,n.parseUrl=b,n.getPageFromPath=T,n.goToUrl=E,n.parseItem=w;var l,c,u=n.prevPath=[],h=n.currPath=[],d=n.pageList=[e("../pages/HomePage"),e("../pages/ViewPage"),e("../pages/EditorPage"),e("../pages/AboutPage"),e("../pages/GalleryPage")],p=n.pages={},f=!1,m=!0,v=!0;function g(){return!(m&&f)}function y(e){e.preventDefault(),C()}function x(e){return b(window.location.href,e)}function b(e,t){var n=s(e.split("#")[0].replace(r.baseUrl,"").split("?")[0],"/").split("/");return t&&_(n,t),n}function _(e,t){t.length=0;for(var n=0,r=e.length;n<r;n++)t[n]=e[n]}function w(e){e.dataset.hasParsed||("A"===e.tagName&&e.href&&(0===e.href.indexOf(r.baseUrl)?e.addEventListener("click",S):e.addEventListener("click",M)),e.dataset.hasParsed=!0)}function S(e){e.preventDefault(),E(this.href)}function M(e){e.preventDefault(),window.open(this.href,this.target)}function T(e){for(var t=e.join("/"),n=0,r=d.length;n<r;n++)for(var i=d[n],o=i.aliases,a=0,s=o.length;a<s;a++){var l=o[a];if(t.match(l))return i}return p.home}function E(e){e=b(e).join("/")+i.QUERY_STRING,history.pushState(null,null,e||"/"),C()}function C(){if(!g()){var e=x();(v||e.join("/")!==h.join("/"))&&(m=!1,f=!1,_(h,u),_(e,h),l=c,c=T(e),v?(v=!1,f=!0,R()):l?l.hide(c,h,l,u,L):L())}}function L(){if(f=!0,2===h.length&&"view"===h[0]){var e=R,t=R;p.view.loadShader(h[1],e,t)}else R()}function R(){c.show(c,h,l,u,A)}function A(){m=!0,C()}},{"../core/browser":88,"../core/properties":90,"../core/settings":91,"../io/shadertoy":110,"../pages/AboutPage":115,"../pages/EditorPage":116,"../pages/GalleryPage":117,"../pages/HomePage":118,"../pages/ViewPage":120,"../ui/prompt/prompt":155,"mout/string/trim":65}],127:[function(e,t,n){"use strict";var r=e("glslify");function i(e){return e.replace(/#define\sGLSLIFY\s./,"")}t.exports=[{id:"ripple",title:"Ripple",isSpline:!1,isEditable:!0,shader:i(r(["#define GLSLIFY 1\nvoid mainImage( out vec4 fragColor, in vec2 fragCoord )\n{\n // Normalized pixel coordinates (from 0 to 1)\n vec2 uv = fragCoord / iResolution.xy;\n \n // Calculate the to center distance\n float d = length(uv - 0.5) * 2.0;\n \n // Calculate the ripple time\n float t = d * d * 25.0 - iTime * 3.0;\n \n // Calculate the ripple thickness\n d = (cos(t) * 0.5 + 0.5) * (1.0 - d);\n \n // Time varying pixel color\n vec3 col = 0.5 + 0.5 * cos(t / 20.0 + uv.xyx + vec3(0.0,2.0,4.0));\n\n // Set the output color to rgb channels and the thickness to alpha channel\n // AO is automatically calculated\n fragColor = vec4(col, d);\n}"])),desc:""},{id:"raymarch",title:"Raymarch",isSpline:!1,isEditable:!0,shader:i(r(["#define GLSLIFY 1\nfloat opSmoothUnion( float d1, float d2, float k )\n{\n float h = clamp( 0.5 + 0.5*(d2-d1)/k, 0.0, 1.0 );\n return mix( d2, d1, h ) - k*h*(1.0-h);\n}\n\nfloat sdSphere( vec3 p, float s )\n{\n return length(p)-s;\n} \n\nfloat map(vec3 p)\n{\n\tfloat d = 2.0;\n\tfor (int i = 0; i < 16; i++)\n\t{\n\t\tfloat fi = float(i);\n\t\tfloat time = iTime * (fract(fi * 412.531 + 0.513) - 0.5) * 2.0;\n\t\td = opSmoothUnion(\n sdSphere(p + sin(time + fi * vec3(52.5126, 64.62744, 632.25)) * vec3(2.0, 2.0, 0.8), mix(0.5, 1.0, fract(fi * 412.531 + 0.5124))),\n\t\t\td,\n\t\t\t0.4\n\t\t);\n\t}\n\treturn d;\n}\n\nvec3 calcNormal( in vec3 p )\n{\n const float h = 1e-5; // or some other value\n const vec2 k = vec2(1,-1);\n return normalize( k.xyy*map( p + k.xyy*h ) + \n k.yyx*map( p + k.yyx*h ) + \n k.yxy*map( p + k.yxy*h ) + \n k.xxx*map( p + k.xxx*h ) );\n}\n\nvoid mainImage( out vec4 fragColor, in vec2 fragCoord )\n{\n vec2 uv = fragCoord/iResolution.xy;\n \n // screen size is 6m x 6m\n\tvec3 rayOri = vec3((uv - 0.5) * vec2(iResolution.x/iResolution.y, 1.0) * 6.0, 3.0);\n\tvec3 rayDir = vec3(0.0, 0.0, -1.0);\n\t\n\tfloat depth = 0.0;\n\tvec3 p;\n\t\n\tfor(int i = 0; i < 64;
10 i++) {\n\t\tp = rayOri + rayDir * depth;\n\t\tfloat dist = map(p);\n depth += dist;\n\t\tif (dist < 1e-6) {\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n depth = min(6.0, depth);\n\tvec3 n = calcNormal(p);\n float b = max(0.0, dot(n, vec3(0.577)));\n vec3 col = (0.5 + 0.5 * cos((b + iTime * 3.0) + uv.xyx * 2.0 + vec3(0,2,4))) * (0.85 + b * 0.35);\n col *= exp( -depth * 0.15 );\n\t\n // maximum thickness is 2m in alpha channel\n fragColor = vec4(col, 1.0 - (depth - 0.5) / 2.0);\n}"])),desc:""},{id:"domain_warp",title:"Earn",isSpline:!0,isEditable:!1,shader:i(r(["#define GLSLIFY 1\n//\tSimplex 3D Noise \n//\tby Ian McEwan, Ashima Arts\n//\nvec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}\nvec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}\n\nfloat snoise(vec3 v){ \n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0. + 0.0 * C \n vec3 x1 = x0 - i1 + 1.0 * C.xxx;\n vec3 x2 = x0 - i2 + 2.0 * C.xxx;\n vec3 x3 = x0 - 1. + 3.0 * C.xxx;\n\n// Permutations\n i = mod(i, 289.0 ); \n vec4 p = permute( permute( permute( \n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) \n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients\n// ( N*N points uniformly over a square, mapped onto an octahedron.)\n float n_ = 1.0/7.0; // N=7\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), \n dot(p2,x2), dot(p3,x3) ) );\n}\n"]))+i(r(["#define GLSLIFY 1\nfloat fbm( vec3 p ) {\n float f = 0.0;\n f += 0.5000*snoise( p ); p = p*2.02;\n f += 0.2500*snoise( p ); p = p*2.03;\n f += 0.1250*snoise( p ); p = p*2.01;\n f += 0.0625*snoise( p );\n return f/0.9375;\n}\n\nfloat pattern(vec3 p ) {\n vec3 q = vec3( fbm( p ), fbm( p + vec3(5.2,1.3, 2.0) ), 0.0 );\n return fbm( p + 4.0*q );\n}\n\nvoid mainImage( out vec4 fragColor, in vec2 fragCoord ) {\n vec2 uv = fragCoord / iResolution.xy;\n float mouseRatio = smoothstep(100.0, 0.0, length(iMouse.xy - fragCoord.xy));\n float noise = 0.25 + pattern(vec3(uv * 0.75, iTime * 0.03 + 0.1 * mouseRatio)) * 0.75;\n fragColor = vec4(1.0, 1.0, 1.0, noise);\n}"])),desc:'Encouraging healthy financial habits through <a class="button-inline title-text-effect__non-text" href="https://en.wikipedia.org/wiki/Gamification" target="_blank">Gamification</a>'},{id:"turbulence",title:"Learn",isSpline:!0,isEditable:!0,shader:i(r(["#define GLSLIFY 1\n//\tSimplex 3D Noise \n//\tby Ian McEwan, Ashima Arts\n//\nvec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}\nvec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}\n\nfloat snoise(vec3 v){ \n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);
10\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0. + 0.0 * C \n vec3 x1 = x0 - i1 + 1.0 * C.xxx;\n vec3 x2 = x0 - i2 + 2.0 * C.xxx;\n vec3 x3 = x0 - 1. + 3.0 * C.xxx;\n\n// Permutations\n i = mod(i, 289.0 ); \n vec4 p = permute( permute( permute( \n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) \n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients\n// ( N*N points uniformly over a square, mapped onto an octahedron.)\n float n_ = 1.0/7.0; // N=7\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), \n dot(p2,x2), dot(p3,x3) ) );\n}\n"]))+i(r(["#define GLSLIFY 1\nfloat fbm( vec3 p ) {\n float f = 0.0;\n f += 0.5000*snoise( p ); p = p*2.02;\n f += 0.2500*snoise( p ); p = p*2.03;\n f += 0.1250*snoise( p ); p = p*2.01;\n f += 0.0625*snoise( p );\n return f/0.9375;\n}\n\nvoid mainImage( out vec4 fragColor, in vec2 fragCoord ) {\n vec2 uv = fragCoord / iResolution.xy;\n float mouseRatio = smoothstep(100.0, 0.0, length(iMouse.xy - fragCoord.xy));\n float noise = 0.25 + fbm(vec3(uv * 12.0 + (iMouse.xy - fragCoord.xy) * mouseRatio * 0.05, iTime * 0.18 + 0.5 * mouseRatio));\n noise *= 0.25 + snoise(vec3(uv * 4.0 + 1.5, iTime * 0.15));\n fragColor = vec4(1.0, 1.0, 1.0, noise);\n}"])),desc:"From crypto market experts"},{id:"worley3d",title:"Build",isSpline:!0,isEditable:!1,shader:i(r(["#define GLSLIFY 1\n// Permutation polynomial: (34x^2 + x) mod 289\nvec3 permute(vec3 x) {\n return mod((34.0 * x + 1.0) * x, 289.0);\n}\n\nvec3 dist(vec3 x, vec3 y, vec3 z, bool manhattanDistance) {\n return manhattanDistance ? abs(x) + abs(y) + abs(z) : (x * x + y * y + z * z);\n}\n\nvec2 worley(vec3 P, float jitter, bool manhattanDistance) {\nfloat K = 0.142857142857; // 1/7\nfloat Ko = 0.428571428571; // 1/2-K/2\nfloat K2 = 0.020408163265306; // 1/(7*7)\nfloat Kz = 0.166666666667; // 1/6\nfloat Kzo = 0.416666666667; // 1/2-1/6*2\n\n vec3 Pi = mod(floor(P), 289.0);\n vec3 Pf = fract(P) - 0.5;\n\n vec3 Pfx = Pf.x + vec3(1.0, 0.0, -1.0);\n vec3 Pfy = Pf.y + vec3(1.0, 0.0, -1.0);\n vec3 Pfz = Pf.z + vec3(1.0, 0.0, -1.0);\n\n vec3 p = permute(Pi.x + vec3(-1.0, 0.0, 1.0));\n vec3 p1 = permute(p + Pi.y - 1.0);\n vec3 p2 = permute(p + Pi.y);\n vec3 p3 = permute(p + Pi.y + 1.0);\n\n vec3 p11 = permute(p1 + Pi.z - 1.0);\n vec3 p12 = permute(p1 + Pi.z);\n vec3 p13 = permute(p1 + Pi.z + 1.0);\n\n vec3 p21 = permute(p2 + Pi.z - 1.0);\n vec3 p22 = permute(p2 + Pi.z);\n vec3 p23 = permute(p2 + Pi.z + 1.0);\n\n vec3 p31 = permute(p3 + Pi.z - 1.0);\n vec3 p32 = permute(p3 + Pi.z);\n vec3 p33 = permute(p3 + Pi.z + 1.0);\n\n vec3 ox11 = fract(p11*K) - Ko;\n vec3 oy11 = mod(floor(p11*K), 7.0)*K - Ko;\n vec3 oz11 = floor(p11*K2)*Kz - Kzo; // p11 < 289 guaranteed\n\n vec3 ox12 = fract(p12*K) - Ko;\n vec3 oy12 = mod(floor(p12*K), 7.0)*K - Ko;\n vec3 oz12 = floor(p12*K2)*Kz - Kzo;\n\n vec3 ox13 = fract(p13*K) - Ko;\n vec3 oy13 = mod(floor(p13*K), 7.0)*K - Ko;\n vec3 oz13 = floor(p13*K2)*Kz - Kzo;\n\n vec3 ox21 = fract(p21*K) - Ko;\n vec3 oy21 = mod(floor(p21*K), 7.0)*K - Ko;\n vec3 oz21 = floor(p21*K2)*Kz - Kzo;\n\n vec3 ox22 = fract(p22*K) - Ko;\n vec3 oy22 = mod(floor(p22*K), 7.0)*K - Ko;\n vec3 oz22 = floor(p22*K2)*Kz - Kzo;\n\n vec3 ox23 = fract(p23*K) - Ko;\n vec3 oy23 = mod(floor(p23*K), 7.0)*K - Ko;\n vec3 oz23 = floor(p23*K2)*Kz - Kzo;\n\n vec3 ox31 = fract(p31*K) - Ko;\n vec3 oy31 = mod(floor(p31*K), 7.0)*K - Ko;\n vec3 oz31 = floor(p31*K2)*Kz - Kzo;\n\n vec3 ox32 = fract(p32*K) - Ko;\n vec3 oy32 = mod(floor(p32*K), 7.0)*K - Ko;\n vec3 oz32 = floor(p32*K2)*Kz - Kzo;\n\n vec3 ox33 = fract(p33*K) - Ko;\n vec3 oy33 = mod(floor(p33*K), 7.0)*K - Ko;\n vec3 oz33 = floor(p33*K2)*Kz - Kzo;\n\n vec3 dx11 = Pfx + jitter*ox11;\n vec3 dy11 = Pfy.x + jitter*oy11;\n vec3 dz11 = Pfz.x + jitter*oz11;\n\n vec3 dx12 = Pfx + jitter*ox12;\n vec3 dy12 = Pfy.x + jitter*oy12;\n vec3 dz12 = Pfz.y + jitter*oz12;\n\n vec3 dx13 = Pfx + jitter*ox13;\n vec3 dy13 = Pfy.x + jitter*oy13;\n vec3 dz13 = Pfz.z + jitter*oz13;\n\n vec3 dx21 = Pfx + jitter*ox21;\n vec3 dy21 = Pfy.y + jitter*oy21;\n vec3 dz21 = Pfz.x + jitter*oz21;\n\n vec3 dx22 = Pfx + jitter*ox22;\n vec3 dy22 = Pfy.y + jitter*oy22;\n vec3 dz22 = Pfz.y + jitter*oz22;\n\n vec3 dx23 = Pfx + jitter*ox23;\n vec3 dy23 = Pfy.y + jitter*oy23;\n vec3 dz23 = Pfz.z + jitter*oz23;\n\n vec3 dx31 = Pfx + jitter*ox31;\n vec3 dy31 = Pfy.z + jitter*oy31;\n vec3 dz31 = Pfz.x + jitter*oz31;\n\n vec3 dx32 = Pfx + jitter*ox32;\n vec3 dy32 = Pfy.z + jitter*oy32;\n vec3 dz32 = Pfz.y + jitter*oz32;\n\n vec3 dx33 = Pfx + jitter*ox33;\n vec3 dy33 = Pfy.z + jitter*oy33;\n vec3 dz33 = Pfz.z + jitter*oz33;\n\n vec3 d11 = dist(dx11, dy11, dz11, manhattanDistance);\n vec3 d12 =dist(dx12, dy12, dz12, manhattanDistance);\n vec3 d13 = dist(dx13, dy13, dz13, manhattanDistance);\n vec3 d21 = dist(dx21, dy21, dz21, manhattanDistance);\n vec3 d22 = dist(dx22, dy22, dz22, manhattanDistance);\n vec3 d23 = dist(dx23, dy23, dz23, manhattanDistance);\n vec3 d31 = dist(dx31, dy31, dz31, manhattanDistance);\n vec3 d32 = dist(dx32, dy32, dz32, manhattanDistance);\n vec3 d33 = dist(dx33, dy33, dz33, manhattanDistance);\n\n vec3 d1a = min(d11, d12);\n d12 = max(d11, d12);\n d11 = min(d1a, d13); // Smallest now not in d12 or d13\n d13 = max(d1a, d13);\n d12 = min(d12, d13); // 2nd smallest now not in d13\n vec3 d2a = min(d21, d22);\n d22 = max(d21, d22);\n d21 = min(d2a, d23); // Smallest now not in d22 or d23\n d23 = max(d2a, d23);\n d22 = min(d22, d23); // 2nd smallest now not in d23\n vec3 d3a = min(d31, d32);\n d32 = max(d31, d32);\n d31 = min(d3a, d33); // Smallest now not in d32 or d33\n d33 = max(d3a, d33);\n d32 = min(d32, d33); // 2nd smallest now not in d33\n vec3 da = min(d11, d21);\n d21 = max(d11, d21);\n d11 = min(da, d31); // Smallest now in d11\n d31 = max(da, d31); // 2nd smallest now not in d31\n d11.xy = (d11.x < d11.y) ? d11.xy : d11.yx;\n d11.xz = (d11.x < d11.z) ? d11.xz : d11.zx; // d11.x now smallest\n d12 = min(d12, d21); // 2nd smallest now not in d21\n d12 = min(d12, d22); // nor in d22\n d12 = min(d12, d31); // nor in d31\n d12 = min(d12, d32); // nor in d32\n d11.yz = min(d11.yz,d12.xy); // nor in d12.yz\n d11.y = min(d11.y,d12.z); // Only two more to go\n d11.y = min(d11.y,d11.z); // Done! (Phew!)\n return sqrt(d11.xy); // F1, F2\n\n}\n\nvoid mainImage( out vec4 fragColor, in vec2 fragCoord ) {\n vec2 uv = fragCoord / iResolution.xy;\n float mouseRatio = smoothstep(100.0, 0.0, length(iMouse.xy - fragCoord.xy));\n vec2 noise = worley(vec3(uv * 5.0 + (iMouse.xy - fragCoord.xy) * mouseRatio * 0.05, iTime * 0.25), 1.0, false);\n fragColor = vec4(1.0, 1.0, 1.0, noise.y - noise.x);\n}"])),desc:"Generational Wealth"},{id:"ridge",title:"Unreal Crypto",isSpline:!0,isEditable:!1,shader:i(r(["#define GLSLIFY 1\n//\tSimplex 3D Noise \n//\tby Ian McEwan, Ashima Arts\n//\nvec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}\nvec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}\n\nfloat snoise(vec3 v){ \n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);
10\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0. + 0.0 * C \n vec3 x1 = x0 - i1 + 1.0 * C.xxx;\n vec3 x2 = x0 - i2 + 2.0 * C.xxx;\n vec3 x3 = x0 - 1. + 3.0 * C.xxx;\n\n// Permutations\n i = mod(i, 289.0 ); \n vec4 p = permute( permute( permute( \n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) \n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients\n// ( N*N points uniformly over a square, mapped onto an octahedron.)\n float n_ = 1.0/7.0; // N=7\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), \n dot(p2,x2), dot(p3,x3) ) );\n}\n"]))+i(r(["#define GLSLIFY 1\nfloat fbm( vec3 p ) {\n\tfloat f = 0.0;\n\tf += 0.5000*snoise( p ); p = p*2.02;\n\tf += 0.2500*snoise( p ); p = p*2.03;\n\tf += 0.1250*snoise( p ); p = p*2.01;\n\tf += 0.0625*snoise( p );\n\treturn f/0.9375;\n}\n\nvoid mainImage( out vec4 fragColor, in vec2 fragCoord ) {\n\tvec2 uv = fragCoord / iResolution.xy;\n \tfloat mouseRatio = smoothstep(100.0, 0.0, length(iMouse.xy - fragCoord.xy));\n\tfloat noise = fbm(vec3(uv * 2.2, iTime * 0.18));\n\tnoise = abs(noise) * 2.0;\n\tnoise = 0.5 * (1.0 + mouseRatio) - noise;\n\tnoise = noise * noise; \n\tfragColor = vec4(1.0, 1.0, 1.0, noise);\n}"])),desc:"Coming Soon..."}]},{glslify:30}],128:[function(e,t,n){"use strict";e("../core/settings");var r=e("../core/properties"),i=e("./shaderList");n.init=function(){for(var e=0,t=o.length;e<t;e++){var n=o[e];l[n.id]=n,n.isSpline&&a.push(n),n.isEditable&&s.push(n)}r.templateShaderId=a[0].id};var o=n.infoList=i,a=n.splineShaderList=[],s=n.editorShaderList=[],l=n.infos={}},{"../core/properties":90,"../core/settings":91,"./shaderList":127}],129:[function(e,t,n){"use strict";var r,i,o,a,s,l,c,u,h,d,p=e("../../core/browser"),f=e("../effects/TitleTextEffect"),m=e("../prompt/prompt"),v=e("../prompt/promptData"),g=e("gsap").gsap;n.init=function(){r=document.querySelector(".about"),o=document.querySelector(".about__wrapper"),i=document.querySelector(".about__intro"),u=document.querySelectorAll(".question__title"),d=document.querySelectorAll(".category__question"),h=document.querySelectorAll(".about__category-separator"),b=document.querySelectorAll(".about-prompt-button");for(var e=0,t=b.length;e<t;e++)b[e].addEventListener("click",S);for(var n=0,m=u.length;n<m;n++)u[n].addEventListener("click",M);a=new f({domElement:document.querySelector(".about__title"),useBlur:!p.isMobile}),s=new f({domElement:document.querySelector(".about__description"),useBlur:!p.isMobile}),l=document.querySelectorAll(".category__title"),c=document.querySelectorAll(".category__text");for(var v=0,g=l.length;v<g;v++){var y=new f({domElement:l[v],useBlur:!p.isMobile});_.push(y)}for(var x=0,E=c.length;x<E;x++){var C=new f({domElement:c[x],useBlur:!p.isMobile});w.push(C)}p.isMobile||o.addEventListener("scroll",T,{passive:!0})},n.show=function(){r.classList.add("is-visible"),a.show(2,.5),s.show(2,.8);for(var e=0,t=_.length;e<t;e++)_[e].show(1,1+.75*e);for(var n=0,i=w.length;n<i;n++)w[n].show(1,1.75+.75*n);y&&y.kill();g.set(u,{opacity:0}
10),y=g.to(u,{opacity:1,stagger:.3,delay:2.25,duration:3.5,ease:"Power4.easeOut"}),x&&x.kill();g.set(h,{opacity:0}),x=g.to(h,{opacity:1,stagger:1,scaleX:1,delay:1.5,duration:3,ease:"Power4.easeOut"})},n.hide=function(){r.classList.remove("is-visible"),a.hide(1,0),s.hide(1,0);for(var e=0,t=_.length;e<t;e++)_[e].hide(1,0);for(var n=0,i=w.length;n<i;n++)w[n].hide(1,0);y&&y.kill();y=g.to(u,{opacity:0,duration:1,ease:"Power4.easeOut"}),x&&x.kill();x=g.to(h,{opacity:0,scaleX:1,duration:1,ease:"Power4.easeOut"});for(var o=0,l=d.length;o<l;o++)d[o].classList.remove("is-open")};var y,x,b,_=[],w=[];function S(){m.showMsg(v[this.dataset.id],!1)}function M(e){e.target.parentNode.classList.toggle("is-open")}function T(e){i.style.transform="translateY("+o.scrollTop+"px)"}},{"../../core/browser":88,"../effects/TitleTextEffect":150,"../prompt/prompt":155,"../prompt/promptData":156,gsap:31}],130:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=r(e("@babel/runtime/helpers/classCallCheck")),o=r(e("@babel/runtime/helpers/createClass")),a=(e("mout/object/merge"),e("../../core/properties")),s=e("./editorCode"),l=e("./editorButtons"),c=e("../../shaders/shaders"),u=e("../../io/localStorage"),h=e("../viewInfos"),d=function(){function e(t){(0,i.default)(this,e),this.id=t.id?t.id:0,this.data=t.data?t.data:{},this.shader=t.shader?t.shader:null}return(0,o.default)(e,[{key:"init",value:function(){if(u.checkForSlot(this.id)){var e=u.loadFromSlot(this.id);this.data=e.data,this.shader=e.shader}else this.data={title:"My Shader "+this.id,description:"Lorem ipsum dolor",model:"person"},this.shader=c.editorShaderList[0].shader;a.onShaderDataChanged.add(this._onDataChange.bind(this)),a.onShaderTemplateChanged.add(this._onCodeChange.bind(this)),a.onShaderCompiled.add(this._onShaderCompiled.bind(this))}},{key:"show",value:function(){a.modelId=this.data.model,a.isEditor&&(l.setData(this.data),s.changeCode(this.shader,this.data))}},{key:"importShader",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.data=s.getDataFromShader(e,t),this.shader=e,h.setData(this.data,this.id),this.show()}},{key:"preview",value:function(){a.isPreview=!0,h.setData(this.data,this.id),h.updateTexts()}},{key:"setData",value:function(e){this.data=e,this.show()}},{key:"_onDataChange",value:function(){u.saveToSlot(this.id,this)}},{key:"_onCodeChange",value:function(){u.saveToSlot(this.id,this)}},{key:"_onShaderCompiled",value:function(){u.saveToSlot(this.id,this)}}]),e}();n.default=d},{"../../core/properties":90,"../../io/localStorage":105,"../../shaders/shaders":128,"../viewInfos":159,"./editorButtons":132,"./editorCode":133,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/interopRequireDefault":11,"mout/object/merge":53}],131:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault")(e("./Sketch")),i=e("../../core/properties"),o=e("../../io/shadertoy"),a=e("./editorButtons"),s=e("./editorTabs"),l=e("./editorCode"),c=e("./editorControls"),u=e("../../controls/cameraControls"),h=e("../prompt/prompt"),d=e("../prompt/promptData");n.init=function(){p=document.querySelector(".editor"),m=document.querySelector(".editor__intro--minimize"),v=document.querySelectorAll(".button__instructions"),f=document.querySelectorAll(".editor__nav-mode"),a.init(),s.init(),l.init(),c.init(),i.onTabChanged.add(_),m.addEventListener("click",x);for(var e=0,t=v.length;e<t;e++)v[e].addEventListener("click",b);for(var n=0,r=f.length;n<r;n++){f[n].addEventListener("change",S)}(y=localStorage.getItem("editorMinimized"))&&(y=!y,x())},n.show=function(){p.classList.add("is-visible"),c.syncViewQuality(),S()},n.hide=function(){p.classList.remove("is-visible")},n.initLocalSketches=function(){if(null!==i.forkSlotIndex)for(var e=0,t=s.tabs.length;e<t;e++)e===i.forkSlotIndex&&s.setActiveTab(e);for(var n=0,o=s.tabs.length;n<o;n++){var a=g[n];a||((a=new r.default({id:n})).init(),g.push(a)),s.tabs[n].classList.contains("is-active")&&(null!==i.forkSlotIndex?a.importShader(i.currentSketch.shader,i.currentSketch.data):(i.currentSketch=a).show())}i.forkSlotIndex=null},n.resize=w,n.update=function(e){c.update()};var p,f,m,v,g=[],y=(i.currentSketch=null,!1);function x(e){y=!y,p.classList.toggle("is-minimized",y),m.title=y?"Show Instru
10ction":"Hide Instruction",w(i.width,i.height),localStorage.setItem("editorMinimized",y)}function b(){if("test-shadertoy"===this.dataset.id){h.showInput("Please enter a shadertoy sketch url:","https://www.shadertoy.com/view/3sySRK",!1,!1);h.setOkCallback((function(){var e=h.getInputValue(),t=e.replace("https://www.shadertoy.com/view/","");t=t.replace("/",""),o.load(t,(function(t){if(t.success)window.open("https://unreal.io/view/"+e.split("/view/")[1]);else{var n=o.ERROR_MESSAGES[t.errorType];h.showMsg(n,!0)}}))}))}else h.showMsg(d[this.dataset.id],!1)}function _(){var e=document.querySelector(".editor__tab.is-active"),t=Array.prototype.indexOf.call(s.tabs,e);(i.currentSketch=g[t]).show(),l.clearHistory()}function w(e,t){l.resize()}function S(){for(var e=0,t=f.length;e<t;e++){var n=f[e];if(n.checked){u.changeMode(n.value);break}}}},{"../../controls/cameraControls":86,"../../core/properties":90,"../../io/shadertoy":110,"../prompt/prompt":155,"../prompt/promptData":156,"./Sketch":130,"./editorButtons":132,"./editorCode":133,"./editorControls":134,"./editorTabs":148,"@babel/runtime/helpers/interopRequireDefault":11}],132:[function(e,t,n){"use strict";var r,i,o,a,s,l=e("../../core/properties"),c=e("../../io/shadertoy"),u=e("../../shaders/shaders"),h=e("../prompt/prompt");function d(e){if(l.templateShaderId=r.value,l.currentSketch.data.templateId=l.templateShaderId,"shadertoy"===l.templateShaderId){h.showInput("Please enter a shadertoy sketch url:","https://www.shadertoy.com/view/3sySRK",!1,!1);h.setOkCallback((function(){var e=h.getInputValue().replace("https://www.shadertoy.com/view/","");e=e.replace("/",""),c.load(e,(function(e){if(e.success)l.currentSketch.importShader(e.shader,e.shaderInfo);else{var t=c.ERROR_MESSAGES[e.errorType];2===e.errorType&&(t+="<br>Try to directly copy and paste the code to the editor."),h.showMsg(t,!0)}}))}))}else l.onShaderTemplateChanged.dispatch()}function p(e){l.modelId=o.value,l.currentSketch.data.model=l.modelId,l.onShaderDataChanged.dispatch()}function f(e){l.currentSketch.data.title=a.value,l.currentSketch.data.description=s.value,l.onShaderDataChanged.dispatch()}n.init=function(){r=document.querySelector(".group--template select"),i=document.querySelector(".group--template button"),o=document.querySelector(".group--model select"),a=document.querySelector(".group--title input"),s=document.querySelector(".group--description input"),i.addEventListener("click",d),o.addEventListener("change",p),a.addEventListener("input",f),s.addEventListener("input",f);for(var e=0,t=u.editorShaderList.length;e<t;e++){var n=u.editorShaderList[e],l=document.createElement("option");l.value=n.id,l.innerHTML=n.title,r.appendChild(l)}var c=document.createElement("option");c.value="shadertoy",c.innerHTML="Shadertoy...",r.appendChild(c)},n.getData=function(){return{title:a.value,description:s.value,model:o.value}},n.setData=function(e){a.value=e.title,s.value=e.description,o.value=e.model}},{"../../core/properties":90,"../../io/shadertoy":110,"../../shaders/shaders":128,"../prompt/prompt":155}],133:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault")(e("./editorHelpers/Helpers"));e("codemirror/addon/search/search"),e("codemirror/addon/search/searchcursor"),e("codemirror/addon/comment/comment"),e("codemirror/mode/clike/clike.js");var i=e("../../core/browser"),o=e("../../core/properties"),a=e("../../visual/screen/screenShader"),s=e("./editorButtons"),l=e("./editorControls"),c=e("../../shaders/shaders"),u=e("mout/string/trim"),h=e("mout/object/mixIn"),d=e("codemirror");n.init=function(){p=document.getElementById("shader-editor"),f=document.getElementById("shader-editor-cm");var e={"Ctrl-/":"toggleComment","Alt-Enter":x,"Alt-Down":l.triggerRestart,"Alt-Up":l.triggerPause};i.isMac&&h(e,{"Cmd-/":"toggleComment","Cmd-Enter":x,"Cmd-Down":l.triggerRestart,"Cmd-Up":l.triggerPause});m=d(f,{value:"",indentUnit:4,theme:"monokai",viewportMargin:10,lineNumbers:!0,matchBrackets:!0,mode:"x-shader/x-fragment",autoCloseBrackets:!0,extraKeys:e,showCursorWhenSelecting:!0,indentWithTabs:!1}),new r.default({editor:m}),document.querySelector(".button__compile").addEventListener("click",x),m.addKeyMap({}),s.getData(),o.onShaderCompiled.add(_),o.onShaderDataChanged.add(w),o.onShaderTemplateChanged.add(S),o.onHelperValueChanged.add(M)},n.changeCode=function(e,t){t,m.doc.setValue(e),b(),x()},n.getDataFromShader=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=e.indexOf(g),o=e.indexOf("*/",i)+2;-1!==i&&1!==o&&i<o-2?(n=(n=(n=e.substring(i,o)).replace(g,"")).replace("*/",""),t=JSON.parse(n)):t=r?{title:r.title,de
10scription:r.description,model:"person"}:{title:"My shader",description:"Lorem ipsum dolor",model:"person"};r&&r.username&&(t.username=r.username);return t},n.clearHistory=function(){m.doc.clearHistory()},n.resize=function(e,t){var n=p.getBoundingClientRect();p.style.height=Math.max(1,o.rawHeight-n.top-20)+"px",m.refresh()};var p,f,m,v,g="/** SHADERDATA",y=[];function x(){a.changeShader(m.doc.getValue())}function b(){var e=m.doc.getCursor(),t=m.getScrollInfo(),n=m.doc.getHistory(),r=m.doc.getValue();return r=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;null===n&&(n=s.getData());var r=e.lastIndexOf("}");if(-1!==r)if(r+1===e.length)e+="\n\n";else if(r+1<e.length){var i=e.substring(r+1,e.length);i&&(e=e.replace(i,"\n\n"))}return t="/** SHADERDATA\n",t+=JSON.stringify(n,null,"\t"),e+(t+"\n*/")}(r=function(e){var t=null,n=e.indexOf(g),r=e.indexOf("*/",n)+2,i=-1!==n&&1!==r&&n<r;if(i)for(;i;)t=e.substring(n,r),n=(e=e.replace(t,"")).indexOf(g),r=e.indexOf("*/",n)+2,i=-1!==n&&1!==r&&n<r;return e}(r)),m.doc.setValue(r),m.doc.setCursor(e),m.scrollTo(t.left,t.top),m.doc.setHistory(n),o.currentSketch.shader=r,r}function _(e,t){if(m.operation((function(){for(var e=0;e<y.length;e++)m.doc.removeLineWidget(y[e])})),e)p.classList.add("success");else{p.classList.add("error");for(var n=t.fragmentShader.log.split(/\r\n|\r|\n/),r=0,i=n.length;r<i;r++){var o=u(n[r]);o&&o.replace(/\d+:(\d+):\s(.+)/g,(function(e,t,n,r,i){if(5===arguments.length){var o=parseInt(t,10)-a.shaderLineStart,s=document.createElement("div");s.className="cm-err-msg",s.innerHTML=n,y.push(m.doc.addLineWidget(o,s,{coverGutter:!1,noHScroll:!0}))}}))}m.refresh()}clearTimeout(v),v=setTimeout((function(){p.classList.remove("error","success")}),500)}function w(){b(),s.getData()}function S(){var e;e=c.infos[o.templateShaderId]?c.infos[o.templateShaderId].shader:c.infos.empty.shader,s.getData(),m.doc.setValue(e),a.changeShader(e),b()}function M(){x()}},{"../../core/browser":88,"../../core/properties":90,"../../shaders/shaders":128,"../../visual/screen/screenShader":172,"./editorButtons":132,"./editorControls":134,"./editorHelpers/Helpers":135,"@babel/runtime/helpers/interopRequireDefault":11,codemirror:27,"codemirror/addon/comment/comment":23,"codemirror/addon/search/search":25,"codemirror/addon/search/searchcursor":26,"codemirror/mode/clike/clike.js":28,"mout/object/mixIn":54,"mout/string/trim":65}],134:[function(e,t,n){"use strict";var r,i,o,a,s,l,c,u=e("../../router/router"),h=e("../../core/settings"),d=e("../../core/properties"),p=e("../../io/exporter");n.init=function(){s=document.querySelector(".editor__controls .time"),c=document.querySelector(".editor__controls .fps-value"),r=document.querySelector(".editor__controls .button__restart"),i=document.querySelector(".editor__controls .button__pause"),o=document.querySelector(".editor__controls .button__preview"),a=document.querySelector(".editor__controls .button__screenshot"),r.addEventListener("click",x),i.addEventListener("click",b),o.addEventListener("click",S),a.addEventListener("click",v),l=document.querySelector(".editor__controls-view-quality select");var e=localStorage.getItem("editorViewQuality");l.value=null!=e?parseInt(e,10)||0:h.DEFAULT_VIEW_QUALITY;l.addEventListener("change",y),p.onExportEnded.add(g)},n.update=function(e){(f+=1)>=20&&(c.innerHTML=d.fps.toFixed(0),f=0);s.innerHTML=d.shaderTime.toFixed(1)+"s"},n.triggerRestart=_,n.triggerPause=w,n.syncViewQuality=y;var f=0,m=!1;function v(){p.isExporting||p.save(1920,1080,64)}function g(e){!function(e,t,n){var r=document.createElement("a");e.toBlob((function(e){r.href=URL.createObjectURL(e),r.download=t,r.click(),n&&n()}),"image/png")}(e,"cineshader.png")}function y(){d.viewQuality=l.value,localStorage.setItem("editorViewQuality",d.viewQuality)}function x(){_()}function b(){w()}function _(){d.shaderTime=0,d.shaderFrame=0}function w(){m=!m,d.shaderTimeMultiplier=m?0:1,i.classList.toggle("is-paused",m)}function S(){d.currentSketch.preview(),u.goToUrl("/view/"+(d.currentSketch.id+1))}},{"../../core/properties":90,"../../core/settings":91,"../../io/exporter":103,"../../router/router":126}],135:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=r(e("@babel/runtime/helpers/classCallCheck")),o=r(e("@babel/runtime/helpers/createClass")),a=r(e("./pickers/ColorPicker")),s=r(e("./pickers/Vec2Picker")),l=r(e("./pickers/FloatPicker")),c=r(e("./pickers/types/Color")),u=(r(e("./modals/Modal")),e("../../../core/properties"));RegExp.prototype.execAll=function(e){for(var t=null,n=[];t=this.exec(e);){var r=[];for(var i in t)parseInt(i)==i&&r.push(t[i]);r.index=t.index,n.push(r)}return n};var h=function(){function e(t){var n=this;(0,i.default)(this,e),this.main=t;var r=window.getComputedStyle(t.editor.getWrapperElement(),null),o=new c.default(""!==r.background?r.background:r.backgroundColor),h=new c.default(r.color);this.properties={bgColor:o.getString("rgb"),fnColor:h.getString("rgb"),dimColor:"rgb(127, 127, 127)",selColor:"rgb(40, 168, 107)",linkButton:!1};var d=this.main.editor.getWrapperElement();d.addEventListener("contextmenu",(function(e){var t=n.main.editor.getCursor(!0);n.main.editor.getTokenAt(t).type})),d.addEventListener("mouseup",(function(e){if(!n.main.editor.somethingSelected()){var t=n.main.editor.getCursor(!0),r=n.getMatch(t),i=n.main.editor.getTokenAt(t);if(r){if(n.activeModal&&n.activeModal.isVisible)return n.activeModal.removeModal(),void u.onHelperValueChanged.dispatch();"color"===r.type&&(n.activeModal=new a.default(r.string,n.properties),n.activeModal.showAt(n.main.editor),n.activeModal.on("changed",(function(e){var i=e.getString("vec"),o={line:t.line,ch:r.start},a={line:t.line,ch:r.end};r.end=r.start+i.length,n.main.editor.replaceRange(i,o,a,"+".concat(r.type))}))),"vec2"===r.type?(n.activeModal=new s.default(r.string,n.properties),n.activeModal.showAt(n.main.editor),n.activeModal.on("changed",(function(e){var i=e.getString(),o={line:t.line,ch:r.start},a={line:t.line,ch:r.end};r.end=r.start+i.length,n.main.editor.replaceRange(i,o,a,"+".concat(r.type))}))):"number"===r.type&&(n.activeModal=new l.default(r.string,n.properties),n.activeModal.showAt(n.main.editor),n.activeModal.on("changed",(function(e){var i=e.getString(),o={line:t.line,ch:r.start},a={line:t.line,ch:r.end};r.end=r.start+i.length,n.main.editor.replaceRange(i,o,a,"+".concat(r.type))})))}else i.type}}))}return(0,o.default)(e,[{key:"getMatch",value:function(e){var t,n=["color","vec3","vec2","number"];for(var r in n)if(t=this.getTypeMatch(e,n[r]))return t}},{key:"getTypeMatch",value:function(e,t){if(t){var n;switch(t.toLowerCase()){case"color":n=/vec[3|4]\([\d|.|,\s]*\)/g;break;case"vec3":n=/vec3\([-|\d|.|,\s]*\)/g;break;case"vec2":n=/vec2\([-|\d|.|,\s]*\)/g;break;case"number":n=/[-]?\d+\.\d+|\d+\.|\.\d+/g;break;default:return void console.error("invalid match selection")}var r=this.main.editor.getLine(e.line),i=n.execAll(r);if(i)for(var o=0;o<i.length;o++){var a=i[o][0],s=a.length,l=i[o].index,c=i[o].index+s;if(e.ch>=l&&e.ch<=c)return{type:t,start:l,end:c,string:a}}}}}]),e}();n.default=h},{"../../../core/properties":90,"./modals/Modal":136,"./pickers/ColorPicker":137,"./pickers/FloatPicker":138,"./pickers/Vec2Picker":140,"./pickers/types/Color":141,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/interopRequireDefault":11}],136:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.addEvent=l,n.removeEvent=c,n.default=void 0;var i=r(e("@babel/runtime/helpers/classCallCheck")),o=r(e("@babel/runtime/helpers/createClass")),a=e("../tools/mixin"),s=function(){function e(t,n){for(var r in(0,i.default)(this,e),(0,a.subscribeMixin)(this),this.CSS_PREFIX=t,n=n||{})this[r]=n[r];if(this.el=document.createElement("div"),this.el.className=this.CSS_PREFIX+"_modal ge_modal",this.el.style.backgroundColor=this.bgColor,this.el.innerHTML=this.innerHTML||"",this.elements)for(var o=0;o<this.elements.length;o++)this.el.appendChild(this.elements[o]);this.isVisible=!1}return(0,o.default)(e,[{key:"close",value:function(){this.trigger("close")}},{key:"showAt",value:function(e){var t=e.cursorCoords(!0,"page"),n=t.left,r=t.top;r+=30,this.presentModal(n,r)}},{key:"presentModal",value:function(e,t){var n=this;window.setTimeout((function(){n.onClickOutsideHandler=l(document.body,"click",n.onClickOutside,n),n.onKeyPressHandler=l(window,"keydown",n.onKeyPress,n)}),0),this.isVisible=!0,this.el.style.left=e+"px",this.el.style.top=t+"px",this.el.style.width=this.width+"px",this.el.style.height=this.height+"px",this.position&&(this.el.style.position=this.position),document.body.appendChild(this.el),this.trigger("show")}},{key:"getModalClass",value:function(){return this.CSS_PREFIX+"modal"}},{key:"onKeyPress",value:function(e){this.removeModal()}},{key:"onClickOutside",value:function(e){if(e.target!==document.body){var t=e.target;if(t){for(;t!==document.documentElement&&!t.classList.contains(this.getModalClass());)t=t.parentNode;t.classList.contains(this.getModalClass())||this.removeModal()}}}},{key:"removeModal",value:function(){this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),c(document.body,"click",this.onClickOutsideHandler),this.onClickOutsideHandler=null,c(window,"keydown",this.onKeyPressHandler),this.onKeyPressHandler=null,this.close(),this.isVisible=!1}}]),e}();function l(e,t,n,r){var i;return e.addEventListener(t,i=function(e){n.call(r,e)},!1),i}
10function c(e,t,n){e.removeEventListener(t,n,!1)}n.default=s},{"../tools/mixin":147,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/interopRequireDefault":11}],137:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireWildcard"),i=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=i(e("@babel/runtime/helpers/classCallCheck")),a=i(e("@babel/runtime/helpers/createClass")),s=i(e("@babel/runtime/helpers/get")),l=i(e("@babel/runtime/helpers/inherits")),c=i(e("@babel/runtime/helpers/possibleConstructorReturn")),u=i(e("@babel/runtime/helpers/getPrototypeOf")),h=r(e("./Picker")),d=i(e("./types/Color")),p=e("../tools/common"),f=e("../tools/interactiveDom");function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,u.default)(e);if(t){var i=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var v,g,y=e("../../../../core/properties"),x=0,b=function(e){(0,l.default)(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"vec3(1.0,0.0,0.0)",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.default)(this,n),(e=t.call(this,"ge_colorpicker_",i)).width=250,e.height=216,e.disc={width:200,height:200},e.barlum={width:25,height:200},e.setValue(r),e.init(),e}return(0,a.default)(n,[{key:"init",value:function(){var e=this;if(!g){var t=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div"),i=document.createElement("canvas"),o=document.createElement("div"),a=document.createElement("div"),s=document.createElement("div"),l=document.createElement("div"),c=document.createElement("canvas"),u=document.createElement("div"),h=document.createElement("div"),d=document.createElement("div");t.className=this.CSS_PREFIX+"modal ge_picker_modal",t.style.backgroundColor=this.bgColor,n.className=this.CSS_PREFIX+"patch",n.style.backgroundColor=this.bgColor,r.className=this.CSS_PREFIX+"hsv-map",i.className=this.CSS_PREFIX+"disc",i.style.backgroundColor=this.bgColor,o.className=this.CSS_PREFIX+"disc-cover",a.className=this.CSS_PREFIX+"disc-cursor",s.className=this.CSS_PREFIX+"bar-bg",l.className=this.CSS_PREFIX+"bar-white",c.className=this.CSS_PREFIX+"bar-luminance",u.className=this.CSS_PREFIX+"bar-cursors",h.className=this.CSS_PREFIX+"bar-cursor-left",d.className=this.CSS_PREFIX+"bar-cursor-right",r.id="cp-map",u.id="cp-bar",t.appendChild(n),t.appendChild(r),r.appendChild(i),r.appendChild(o),r.appendChild(a),r.appendChild(s),r.appendChild(l),r.appendChild(c),r.appendChild(u),u.appendChild(h),u.appendChild(d),g=t}if(this.el=g.cloneNode(!0),(0,f.subscribeInteractiveDom)(this.el,{move:!0,resize:!1,snap:!1}),this.dom={},this.dom.hsvMap=this.el.querySelector(".ge_colorpicker_hsv-map"),this.dom.hsvMapCover=this.dom.hsvMap.children[1],this.dom.hsvMapCursor=this.dom.hsvMap.children[2],this.dom.hsvBarBGLayer=this.dom.hsvMap.children[3],this.dom.hsvBarWhiteLayer=this.dom.hsvMap.children[4],this.dom.hsvBarCursors=this.dom.hsvMap.children[6],this.dom.hsvLeftCursor=this.dom.hsvBarCursors.children[0],this.dom.hsvRightCursor=this.dom.hsvBarCursors.children[1],this.dom.colorDisc=this.el.querySelector(".ge_colorpicker_disc"),this.dom.luminanceBar=this.el.querySelector(".ge_colorpicker_bar-luminance"),this.linkButton){var p=document.createElement("div");p.innerHTML="+",p.className=this.CSS_PREFIX+"link-button",p.style.color=this.fgColor,this.el.appendChild(p),p.addEventListener("click",(function(){e.trigger("linkButton",e.value),"function"==typeof e.linkButton&&e.linkButton(e.value),e.removeModal()}))}}},{key:"draw",value:function(){this.el.querySelector(".ge_colorpicker_patch").style.backgroundColor=this.value.getString("rgb");var e=this.value.colors,t=this.dom.colorDisc.offsetHeight/2,n=2*Math.PI,r=Math.cos(n-e.hsv.h*n),i=Math.sin(n-e.hsv.h*n),o=e.hsv.s*(t-5);this.dom.hsvMapCover.style.opacity=1-e.hsv.v/255,this.dom.hsvBarWhiteLayer.style.opacity=1-e.hsv.s,this.dom.hsvBarBGLayer.style.backgroundColor="rgb("+e.hueRGB.r+","+e.hueRGB.g+","+e.hueRGB.b+")",this.dom.hsvMapCursor.style.cssText="left: "+(r*o+t)+"px;top: "+(i*o+t)+"px;border-color: "+(e.luminance>.22?"#333;":"#ddd"),e.luminance>.22?this.dom.hsvBarCursors.classList.add("ge_colorpicker_dark"):this.dom.hsvBarCursors.classList.remove("ge_colorpicker_dark"),this.dom.hsvLeftCursor&&(this.dom.hsvLeftCursor.style.top=this.dom.hsvRightCursor.style.top=(1-e.hsv.v/255)*t*2+"px")}},{key:"presentModal",value:function(e,t){(0,s.default)((0,u.default)(n.prototype),"presentModal",this).call(this,e,t),this.onHsvDownHandler=(0,h.addEvent)(this.dom.hsvMap,"mousedown",this.onHsvDown,this);var r=this.dom.colorDisc;
10if(r.getContext){var i=r.getContext("2d"),o=(0,p.getDevicePixelRatio)(i),a=this.disc.width/o,l=this.disc.height/o;this.dom.colorDisc.width=a*o,this.dom.colorDisc.height=l*o,i.scale(o,o),_(i,[a/2,l/2],[a/2-1,l/2-1],360,(function(e,t){var n=e.createRadialGradient(1,1,1,1,1,0);n.addColorStop(0,"hsl("+(360-t+0)+", 100%, 50%)"),n.addColorStop(1,"#fff"),e.fillStyle=n,e.fill()})),function(e,t,n,r,i){i=i||1,n=[(n[0]||n)-i/2,(n[1]||n)-i/2],_(e,t,n,1,(function(e,t){e.restore(),e.lineWidth=i,e.strokeStyle=r||"#000",e.stroke()}))}(i,[a/2,l/2],[a/2,l/2],this.bgColor,2/o);var c=this.dom.luminanceBar.getContext("2d");this.dom.luminanceBar.width=this.barlum.width,this.dom.luminanceBar.height=this.barlum.height*o,c.scale(o,o);var d=c.createLinearGradient(0,0,0,this.barlum.height/o);d.addColorStop(0,"transparent"),d.addColorStop(1,"black"),c.fillStyle=d,c.fillRect(0,0,30,200)}this.draw()}},{key:"setValue",value:function(e){this.value=new d.default(e)}},{key:"onHsvDown",value:function(e){var t=e.target||e.srcElement;e.preventDefault(),v=t.id?t:t.parentNode,x=v.offsetHeight,this.onHsvMoveHandler=(0,h.addEvent)(this.el,"mousemove",this.onHsvMove,this),this.onHsvUpHandler=(0,h.addEvent)(window,"mouseup",this.onHsvUp,this),this.onHsvMove(e),this.dom.hsvMap.classList.add("ge_colorpicker_no-cursor"),this.renderer.start()}},{key:"onHsvMove",value:function(e){var t,n,r,i,o;if(e.preventDefault(),e.stopPropagation(),e.target===this.dom.hsvMapCover&&v===this.dom.hsvMap)t=x/2,n=e.offsetX-t,r=e.offsetY-t,i=(360-(180*Math.atan2(r,n)/Math.PI+(r<0?360:0)))/360,o=Math.sqrt(n*n+r*r)/t,this.value.set({h:i,s:o},"hsv");else if(e.target===this.dom.hsvBarCursors&&v===this.dom.hsvBarCursors){var a=(x-e.offsetY)/x;a=255*Math.max(0,Math.min(1,a)),this.value.set({v:a},"hsv")}this.trigger("changed",this.value)}},{key:"onHsvUp",value:function(e){this.renderer.stop(),this.dom.hsvMap.classList.remove("ge_colorpicker_no-cursor"),this.destroyEvents(),y.onHelperValueChanged.dispatch()}},{key:"destroyEvents",value:function(){(0,h.removeEvent)(this.el,"mousemove",this.onHsvMoveHandler),this.onHsvMoveHandler=null,(0,h.removeEvent)(window,"mouseup",this.onHsvUpHandler),this.onHsvUpHandler=null}},{key:"close",value:function(){this.destroyEvents(),(0,h.removeEvent)(this.dom.hsvMap,"mousedown",this.onHsvDownHandler),this.onHsvDownHandler=null}}]),n}(h.default);function _(e,t,n,r,i){var o=t[0]||t,a=t[1]||t,s=n[0]||n,l=n[1]||n,c=360,u=Math.PI/180;for(e.save(),e.translate(o-s,a-l),e.scale(s,l),r=c/r||360;c>0;c-=r)e.beginPath(),360!==r&&e.moveTo(1,1),e.arc(1,1,1,(c-r/2-1)*u,(c+r/2+1)*u),i?i(e,c):(e.fillStyle="black",e.fill());e.restore()}n.default=b},{"../../../../core/properties":90,"../tools/common":145,"../tools/interactiveDom":146,"./Picker":139,"./types/Color":141,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/get":8,"@babel/runtime/helpers/getPrototypeOf":9,"@babel/runtime/helpers/inherits":10,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/interopRequireWildcard":12,"@babel/runtime/helpers/possibleConstructorReturn":15}],138:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=r(e("@babel/runtime/helpers/classCallCheck")),o=r(e("@babel/runtime/helpers/createClass")),a=r(e("@babel/runtime/helpers/get")),s=r(e("@babel/runtime/helpers/inherits")),l=r(e("@babel/runtime/helpers/possibleConstructorReturn")),c=r(e("@babel/runtime/helpers/getPrototypeOf")),u=r(e("./Picker")),h=r(e("./types/Float"));function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var i=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}var p=function(e){(0,s.default)(n,e);var t=d(n);function n(e,r){var o;return(0,i.default)(this,n),(o=t.call(this,"ge_floatpicker_",r)).width=o.width||250,o.height=o.height||40,o.prevOffset=0,o.scale=2,o.setValue(e||1),o.create(),o}return(0,o.default)(n,[{key:"draw",value:function(){this.ctx.clearRect(0,0,this.width,this.height),this.ctx.strokeStyle=this.dimColor,this.ctx.lineWidth=1,this.ctx.beginPath(),this.ctx.moveTo(0,.5+.5*this.height),this.ctx.lineTo(0+this.width,.5+.5*this.height),this.ctx.closePath(),this.ctx.stroke(),this.ctx.strokeStyle=this.fnColor,this.ctx.lineWidth=1,this.ctx.beginPath(),this.ctx.moveTo(.5*this.width,0),this.ctx.lineTo(.5*this.width,this.height),this.ctx.closePath(),this.ctx.stroke(),this.ctx.fillStyle=this.overPoint?this.selColor:this.fnColor,this.ctx.beginPath(),this.ctx.moveTo(.5*this.width,5),this.ctx.lineTo(.48*this.width,0),this.ctx.lineTo(.52*this.width,0),this.ctx.closePath(),this.ctx.fill();var e=this.width/40,t=this.offsetX;Math.abs(this.offsetX-.5*this.width)>.5*this.width&&(t=(this.offsetX-.5*this.width)%(.5*this.width)+this.width),this.ctx.strokeStyle=this.dimColor,this.ctx.beginPath();for(var n=0;n<120;n++){var r=n%20==0?.35*this.height:n%10==0?.2*this.height:.1*this.height;this.ctx.moveTo(n*e-t,.5*this.height-r),this.ctx.lineTo(n*e-t,.5*this.height+r)}this.ctx.stroke();var i=Math.round((this.value-this.min)/this.range*this.width);this.ctx.strokeStyle=this.overPoint?this.selColor:this.fnColor,this.ctx.lineWidth=1,this.ctx.beginPath(),this.ctx.moveTo(this.offsetX+i,.5*this.height),this.ctx.lineTo(this.offsetX+i,this.height),this.ctx.closePath(),this.ctx.stroke(),this.overPoint=!1}},{key:"onMouseDown",value:function(e){this.prevOffset=e.offsetX,(0,a.default)((0,c.default)(n.prototype),"onMouseDown",this).call(this,e)}},{key:"onMouseMove",value:function(e){var t=e.offsetX,n=t-this.prevOffset,r=this.offsetX-n,i=this.width/this.scale;this.setValue(r/i),this.prevOffset=t;var o=new h.default(this.getValue());this.trigger("changed",o),this.overPoint=!0}},{key:"setValue",value:function(e){"string"==typeof e?this.value=parseFloat(e):"number"==typeof e&&(this.value=e);var t=this.width/this.scale;this.offsetX=this.value*t}}]),n}(u.default);n.default=p},{"./Picker":139,"./types/Float":143,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/get":8,"@babel/runtime/helpers/getPrototypeOf":9,"@babel/runtime/helpers/inherits":10,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/possibleConstructorReturn":15}],139:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.addEvent=u,n.removeEvent=h,n.default=void 0;var i=r(e("@babel/runtime/helpers/classCallCheck")),o=r(e("@babel/runtime/helpers/createClass")),a=e("../tools/common"),s=e("../tools/mixin"),l=e("../../../../core/properties"),c=function(){function e(t,n){var r=this;for(var o in(0,i.default)(this,e),(0,s.subscribeMixin)(this),this.CSS_PREFIX=t,this.bgColor="#051015",this.dimColor="rgb(100, 100, 100)",this.fnColor="rgb(230, 230, 230)",this.selColor="rgb(133, 204, 196)",n=n||{})this[o]=n[o];this.renderer={frame:null,drawFrame:function(){r.el&&r.draw()},start:function(){r.renderer.drawFrame(),r.renderer.frame=window.requestAnimationFrame(r.renderer.start)},stop:function(){window.cancelAnimationFrame(r.renderer.frame)}},this.isVisible=!1}return(0,o.default)(e,[{key:"create",value:function(){this.el=document.createElement("div"),this.el.className=this.CSS_PREFIX+"modal ge_picker_modal",this.el.style.backgroundColor=this.bgColor,this.canvas=document.createElement("canvas"),this.canvas.className=this.CSS_PREFIX+"canvas ge_picker_canvas",this.canvas.style.backgroundColor=this.bgColor,this.el.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d");var e=(0,a.getDevicePixelRatio)(this.ctx);this.canvas.width=this.width*e,this.canvas.height=this.height*e,this.ctx.scale(e,e)}},{key:"draw",value:function(){}},{key:"close",value:function(){this.destroyEvents(),h(this.el,"mousedown",this.onMouseDownHandler),this.onMouseDownHandler=null}},{key:"destroyEvents",value:function(){h(this.el,"mousemove",this.onMouseMoveHandler),this.onMouseMoveHandler=null,h(window,"mouseup",this.onMouseUpHandler),this.onMouseUpHandler=null}},{key:"setValue",value:function(e){this.value=e}},{key:"getValue",value:function(){return this.value}},{key:"showAt",value:function(e){var t=e.cursorCoords(!0,"page"),n=t.left,r=t.top;n-=.5*this.width,r+=30,this.presentModal(n,r)}},{key:"presentModal",value:function(e,t){var n=this;window.setTimeout((function(){n.onClickOutsideHandler=u(document.body,"click",n.onClickOutside,n),n.onKeyPressHandler=u(window,"keydown",n.onKeyPress,n)}),0),this.isVisible=!0,this.el.style.left=e+"px",this.el.style.top=t+"px",this.el.style.width=this.width+"px",this.el.style.height=this.height+"px",document.body.appendChild(this.el),this.onMouseDownHandler=u(this.el,"mousedown",this.onMouseDown,this),this.renderer.drawFrame()}},{key:"removeModal",value:function(){this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),h(document.body,"click",this.onClickOutsideHandler),this.onClickOutsideHandler=null,h(window,"keydown",this.onKeyPressHandler),this.onKeyPressHandler=null,this.close(),this.isVisible=!1}},{key:"onKeyPress",value:function(e){this.removeModal()}},{key:"onClickOutside",value:function(e){if(e.target!==document.body){for(var t=e.target;t!==document.documentElement&&!t.classList.contains(this.CSS_PREFIX+"modal");)t=t.parentNode;t.classList.contains(this.CSS_PREFIX+"modal")||this.removeModal()}}},{key:"onMouseDown",value:function(e){e.preventDefault(),this.onMouseMoveHandler=u(this.el,"mousemove",this.onMouseMove,this),this.onMouseUpHandler=u(window,"mouseup",this.onMouseUp,this),this.onMouseMove(e),this.renderer.start()}},{key:"onMouseMove",value:function(e){}},{key:"onMouseUp",value:function(e){l.onHelperValueChanged.dispatch(),this.renderer.stop(),this.destroyEvents()}}]),e}();function u(e,t,n,r){var i;return e.addEventListener(t,i=function(e){n.call(r,e)},!1),i}function h(e,t,n){e.removeEventListener(t,n,!1)}n.default=c},{"../../../../core/properties":90,"../tools/common":145,"../tools/mixin":147,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/interopRequireDefault":11}],140:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=r(e("@babel/runtime/helpers/classCallCheck")),o=r(e("@babel/runtime/helpers/createClass")),a=r(e("@babel/runtime/helpers/inherits")),s=r(e("@babel/runtime/helpers/possibleConstructorReturn")),l=r(e("@babel/runtime/helpers/getPrototypeOf")),c=r(e("./Picker")),u=r(e("./types/Vector"));function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}var d=function(e){(0,a.default)(n,e);var t=h(n);function n(e,r){var o;(0,i.default)(this,n),(o=t.call(this,"ge_vec2picker_",r)).width=o.width||200,o.height=o.height||200,o.min=o.min||-1,o.max=o.max||1,o.size=o.size||6,o.range=o.max-o.min,o.overPoint=!1;var a=-1*(o.range/2-o.max);return o.setValue(e||[a,a]),o.create(),o}return(0,o.default)(n,[{key:"draw",value:function(){this.ctx.clearRect(0,0,this.width,this.height),this.ctx.strokeStyle=this.dimColor,this.ctx.lineWidth=2,this.ctx.strokeRect(0,0,this.width,this.height),this.ctx.beginPath(),this.ctx.lineWidth=.25;for(var e=this.width/20,t=0;t<20;t++)this.ctx.moveTo(t*e,0),this.ctx.lineTo(t*e,this.height),this.ctx.moveTo(0,t*e),this.ctx.lineTo(this.width,t*e);this.ctx.stroke(),this.ctx.strokeStyle=this.dimColor,this.ctx.lineWidth=1,this.ctx.beginPath(),this.ctx.moveTo(0,.5+.5*this.height),this.ctx.lineTo(this.width,.5+.5*this.height),this.ctx.closePath(),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(.5+.5*this.width,0),this.ctx.lineTo(.5+.5*this.width,this.height),this.ctx.closePath(),this.ctx.stroke();var n=Math.round((this.value.x-this.min)/this.range*this.width),r=Math.round((1-(this.value.y-this.min)/this.range)*this.height),i=this.size/2;n<i&&(n=i),n>this.width-i&&(n=this.width-i),r<i&&(r=i),r>this.height-i&&(r=this.height-i),this.ctx.fillStyle=this.overPoint?this.selColor:this.fnColor,this.ctx.beginPath();var o=this.overPoint?4:2;this.ctx.arc(n,r,o,0,2*Math.PI,!1),this.ctx.fill(),this.ctx.restore(
10),this.overPoint=!1}},{key:"onMouseMove",value:function(e){var t=e.offsetX,n=e.offsetY;this.value.x=this.range/this.width*t-(this.range-this.max),this.value.y=-1*(this.range/this.height*n-(this.range-this.max)),this.trigger("changed",this.value),this.overPoint=!0}},{key:"setValue",value:function(e){this.value=new u.default(e)}}]),n}(c.default);n.default=d},{"./Picker":139,"./types/Vector":144,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/getPrototypeOf":9,"@babel/runtime/helpers/inherits":10,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/possibleConstructorReturn":15}],141:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireWildcard"),i=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=i(e("@babel/runtime/helpers/classCallCheck")),a=i(e("@babel/runtime/helpers/createClass")),s=r(e("./ColorConverter")),l=function(){function e(t){(0,o.default)(this,e),this.colors={},this.set(t)}return(0,a.default)(e,[{key:"set",value:function(e,t){if("number"==typeof e){t=t||"rgb",this.colors[t]={};for(var n=3;n--;){var r=t[n]||t.charAt(n);this.colors[t][r]=e}}else if("string"==typeof e){var i=e.replace(/(?:#|\)|%)/g,"").split("(");if(i[1]){var o=(i[1]||"").split(/,\s*/);t=t||(i[1]?i[0].substr(0,3):"rgb"),this.set(o,t)}else this.set((0,s.getColorAsRGB)(e),"rgb")}else if(e)if(Array.isArray(e)){var a="";t=t||"rgb",this.colors[t]=this.colors[t]||{};for(var l=3;l--;){a=t[l]||t.charAt(l);var c=e.length>=3?l:0;this.colors[t][a]=parseFloat(e[c])}4===e.length&&(this.colors.alpha=parseFloat(e[3]))}else if(t)for(var u in e)this.colors[t][u]=(0,s.limitValue)(e[u]/(0,s.getValueRanges)(t)[u][1],0,1)*(0,s.getValueRanges)(t)[u][1];if(t){if("rgb"!==t){var h=s.default;this.colors.rgb=h[t+"2rgb"](this.colors[t])}this.convert(t),this.colors.hueRGB=s.default.hue2RGB(this.colors.hsv.h),this.colors.luminance=(0,s.getLuminance)(this.colors.rgb)}}},{key:"convert",value:function(e){var t=s.default,n=(0,s.getValueRanges)(),r={hsl:"hsv",cmyk:"cmy",rgb:e};if("alpha"!==e)for(var i in n)if(!n[i][i]&&e!==i&&"XYZ"!==i){var o=r[i]||"rgb";this.colors[i]=t[o+"2"+i](this.colors[o])}}},{key:"get",value:function(e){if("rgb"!==e){var t=s.default;return this.colors[e]=t["rgb2"+e](this.colors.rgb),this.colors[e]}return this.colors.rgb}},{key:"getString",value:function(e){if("HEX"===e)return s.default["rgb2"+e](this.colors.rgb);var t=this.get(e),n=e,r="";"vec"===e&&(n+=this.colors.alpha?4:3),n+="(";for(var i=0;i<3;i++)r=e[i]||e.charAt(i),n+="vec"===e?t[r].toFixed(3):Math.floor(t[r]),2!==i&&(n+=",");return this.colors.alpha&&(n+=","+this.colors.alpha.toFixed(3)),n+")"}},{key:"uniformType",value:function(){return this.colors.alpha?"vec4":"vec3"}},{key:"uniformValue",value:function(){var e=this.get("vec"),t=[e.v,e.e,e.c];return this.colors.alpha&&t.push(this.colors.alpha),t}},{key:"uniformMethod",value:function(e){return this.colors.alpha?"4f":"3f"}}]),e}();n.default=l},{"./ColorConverter":142,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/interopRequireWildcard":12}],142:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.limitValue=f,n.getLuminance=function(e,t){for(var n=t?1:255,r=[e.r/n,e.g/n,e.b/n],i=r.length;i--;)r[i]=r[i]<=.03928?r[i]/12.92:Math.pow((r[i]+.055)/1.055,2.4);return u*r[0]+h*r[1]+d*r[2]},n.getColorAsRGB=function(e){var t=document.createElement("div");t.style.backgroundColor=e,document.body.appendChild(t);var n=window.getComputedStyle(t).backgroundColor;"transparent"===n&&(n="rgb(0, 0, 0)");return t.parentNode.removeChild(t),n},n.getValueRanges=function(e){return e?s[e]:s},n.default=void 0;var i,o=r(e("@babel/runtime/helpers/classCallCheck")),a=r(e("@babel/runtime/helpers/createClass")),s={rgb:{r:[0,255],g:[0,255],b:[0,255]},hsv:{h:[0,1],s:[0,1],v:[0,255]},hsl:{h:[0,360],s:[0,100],l:[0,100]},cmy:{c:[0,100],m:[0,100],y:[0,100]},cmyk:{c:[0,100],m:[0,100],y:[0,100],k:[0,100]},Lab:{L:[0,100],a:[-128,127],b:[-128,127]},XYZ:{X:[0,100],Y:[0,100],Z:[0,100]},vec:{v:[0,1],e:[0,1],c:[0,1]},alpha:{alpha:[0,1]},HEX:{HEX:[0,16777215]}},l={X:[.4124564,.3575761,.1804375],Y:[.2126729,.7151522,.072175],Z:[.0193339,.119192,.9503041],R:[3.2404542,-1.5371385,-.4985314],G:[-.969266,1.8760108,.041556],B:[.0556434,-.2040259,1.0572252]},c={X:l.X[0]+l.X[1]+l.X[2],Y:l.Y[0]+l.Y[1]+l.Y[2],Z:l.Z[0]+l.Z[1]+l.Z[2]},u=.2126,h=.7152,d=.0722,p=function(){function e(){(0,o.default)(this,e)}return(0,a.default)(e,null,[{key:"vec2rgb",value:function(e){return{r:e.v*s.rgb.r[1],g:e.e*s.rgb.g[1],b:e.c*s.rgb.b[1]}}},{key:"rgb2vec",value:function(e){return{v:e.r/s.rgb.r[1],e:e.g/s.rgb.g[1],c:e.b/s.rgb.b[1]}}},{key:"RGB2HEX",value:function(e){return((e.r<16?"0":"")+e.r.toString(16)+(e.g<16?"0":"")+e.g.toString(16)+(e.b<16?"0":"")+e.b.toString(16)).toUpperCase()}},{key:"HEX2rgb",value:function(e){return e=e.split(""),{r:parseInt(e[0]+e[e[3]?1:0],16)/255,g:parseInt(e[e[3]?2:1]+(e[3]||e[1]),16)/255,b:parseInt((e[4]||e[2])+(e[5]||e[2]),16)/255}}},{key:"hue2RGB",value:function(e){var t=6*e,n=Math.floor(t),r=6===t?0:t-n;return{r:Math.round(255*[1,1-r,0,0,r,1][n]),g:Math.round(255*[r,1,1,1-r,0,0][n]),b:Math.round(255*[0,0,r,1,1,1-r][n])}}},{key:"rgb2hsv",value:function(e){var t,n,r=e.r,i=e.g,o=e.b,a=0;return i<o&&(i=o+(o=i,0),a=-1),n=o,r<i&&(r=i+(i=r,0),a=-2/6-a,n=Math.min(i,o)),t=r-n,{h:(r?t/r:0)<1e-15?0:t?Math.abs(a+(i-o)/(6*t)):0,s:r?t/r:0,v:r}}},{key:"hsv2rgb",value:function(e){var t=6*e.h,n=e.s,r=e.v,i=Math.floor(t),o=t-i,a=r*(1-n),s=r*(1-o*n),l=r*(1-(1-o)*n),c=i%6;return{r:[r,s,a,a,l,r][c],g:[l,r,r,s,a,a][c],b:[a,a,l,r,r,s][c]}}},{key:"hsv2hsl",value:function(e){var t=(2-e.s)*e.v,n=e.s*e.v;return n=e.s?t<1?t?n/t:0:n/(2-t):0,{h:e.h,s:e.v||n?n:0,l:t/2}}},{key:"rgb2hsl",value:function(t,n){var r=e.rgb2hsv(t);return e.hsv2hsl(n?r:i.hsv=r)}},{key:"hsl2rgb",value:function(e){var t=6*e.h,n=e.s,r=e.l,i=r<.5?r*(1+n):r+n-n*r,o=r+r-i,a=i?(i-o)/i:0,s=Math.floor(t),l=i*a*(t-s),c=o+l,u=i-l,h=s%6;return{r:[i,u,o,o,c,i][h],g:[c,i,i,u,o,o][h],b:[o,o,c,i,i,u][h]}}},{key:"rgb2cmy",value:function(e){return{c:1-e.r,m:1-e.g,y:1-e.b}}},{key:"cmy2cmyk",value:function(e){var t=Math.min(Math.min(e.c,e.m),e.y),n=1-t||1e-20;return{c:(e.c-t)/n,m:(e.m-t)/n,y:(e.y-t)/n,k:t}}},{key:"cmyk2cmy",value:function(e){var t=e.k;return{c:e.c*(1-t)+t,m:e.m*(1-t)+t,y:e.y*(1-t)+t}}},{key:"cmy2rgb",value:function(e){return{r:1-e.c,g:1-e.m,b:1-e.y}}},{key:"rgb2cmyk",value:function(t){var n=e.rgb2cmy(t);return e.cmy2cmyk(n)}},{key:"cmyk2rgb",value:function(t){var n=e.cmyk2cmy(t);return e.cmy2rgb(n)}},{key:"XYZ2rgb",value:function(e){var t=l,n=e.X,r=e.Y,i=e.Z,o=n*t.R[0]+r*t.R[1]+i*t.R[2],a=n*t.G[0]+r*t.G[1]+i*t.G[2],s=n*t.B[0]+r*t.B[1]+i*t.B[2],c=1/2.4;return o=o>(t=.0031308)?1.055*Math.pow(o,c)-.055:12.92*o,a=a>t?1.055*Math.pow(a,c)-.055:12.92*a,s=s>t?1.055*Math.pow(s,c)-.055:12.92*s,{r:f(o,0,1),g:f(a,0,1),b:f(s,0,1)}}},{key:"rgb2XYZ",value:function(e){var t=l,n=e.r,r=e.g,i=e.b,o=.04045;return n=n>o?Math.pow((n+.055)/1.055,2.4):n/12.92,r=r>o?Math.pow((r+.055)/1.055,2.4):r/12.92,i=i>o?Math.pow((i+.055)/1.055,2.4):i/12.92,{X:n*t.X[0]+r*t.X[1]+i*t.X[2],Y:n*t.Y[0]+r*t.Y[1]+i*t.Y[2],Z:n*t.Z[0]+r*t.Z[1]+i*t.Z[2]}}},{key:"XYZ2Lab",value:function(e){var t=c,n=e.X/t.X,r=e.Y/t.Y,i=e.Z/t.Z,o=16/116,a=1/3,s=.008856,l=7.787037;return n=n>s?Math.pow(n,a):l*n+o,{L:116*(r=r>s?Math.pow(r,a):l*r+o)-16,a:500*(n-r),b:200*(r-(i=i>s?Math.pow(i,a):l*i+o))}}},{key:"Lab2XYZ",value:function(e){var t=c,n=(e.L+16)/116,r=e.a/500+n,i=n-e.b/200,o=Math.pow(r,3),a=Math.pow(n,3),s=Math.pow(i,3),l=16/116,u=.008856,h=7.787037;return{X:(o>u?o:(r-l)/h)*t.X,Y:(a>u?a:(n-l)/h)*t.Y,Z:(s>u?s:(i-l)/h)*t.Z}}},{key:"rgb2Lab",value:function(t){var n=e.rgb2XYZ(t);return e.XYZ2Lab(n)}},{key:"Lab2rgb",value:function(t){var n=e.Lab2XYZ(t);return e.XYZ2rgb(n)}}]),e}();function f(e,t,n){return e>n?n:e<t?t:e}n.default=p},{"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/interopRequireDefault":11}],143:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=r(e("@babel/runtime/helpers/classCallCheck")),o=r(e("@babel/runtime/helpers/createClass")),a=function(){function e(t){(0,i.default)(this,e),this.value=t}return(0,o.default)(e,[{key:"getString",value:function(){return this.value.toFixed(3)}},{key:"uniformType",value:function(){return"float"}},{key:"uniformValue",value:function(){return[this.value]}},{key:"uniformMethod",value:function(){return"1f"}}]),e}();n.default=a},{"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/interopRequireDefault":11}],144:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=r(e("@babel/runtime/helpers/classCallCheck")),o=r(e("@babel/runtime/helpers/createClass")),a=function(){function e(t,n){(0,i.default)(this,e),this.value=[0,0],this.dim=2,this.set(t,n)}return(0,o.default)(e,[{key:"set",value:function(e,t){if("number"==typeof e)t=t||"vec2",this.set([e],t);else if("string"==typeof e){var n=e.replace(/(?:#|\)|\]|%)/g,"").split("("),r=(n[1]||n[0].replace(/(\[)/g,"")).split(/,\s*/);t=t||(n[1]?n[0].substr(0,4):"vec"+r.length);var i=[];for(var o in r)i.push(parseFloat(r[o]));this.set(i,t)}else if(e)if(Array.isArray(e)){this.value=[],this.value.length=0,this.dim=t?Number(t.substr(3,4)):e.length;for(var a=1===e.length?e[0]:0,s=0;s<this.dim;s++)this.value.push(e[s]||a)}else e.dim&&(this.value=e.value,this.dim=e.dim)}},{key:"getString",value:function(e){e=e||"vec"+this.dim;var t=this.dim,n="",r=e+"(",i=")";"array"===e?(r="[",i="]",t=this.dim):t=Number(e.substr(3,4)),n=r;for(var o=0;o<t;o++)n+=this.value[o].toFixed(3),o!==t-1&&(n+=",");return n+i}},{key:"uniformType",value:function(){return"vec"+this.dim}},{key:"uniformValue",value:function(){for(var e=[],t=0;t<this.dim;t++)e.push(this.value[t]);return e}},{key:"uniformMethod",value:function(){return this.dim+"f"}},{key:"add",value:function(t){if("number"==typeof t)for(var n=0;n<this.dim;n++)this.value[n]=this.value[n]+t;else for(var r=new e(t),i=Math.min(this.dim,r.dim),o=0;o<i;o++)this.value[o]=this.value[o]+r.value[o]}},{key:"sub",value:function(t){if("number"==typeof t)for(var n=0;n<this.dim;n++)this.value[n]=this.value[n]-t;else for(var r=new e(t),i=Math.min(this.dim,r.dim),o=0;o<i;o++)this.value[o]=this.value[o]-r.value[o]}},{key:"mult",value:function(t){if("number"==typeof t)for(var n=0;n<this.dim;n++)this.value[n]=this.value[n]*t;else for(var r=new e(t),i=Math.min(this.dim,r.dim),o=0;o<i;o++)this.value[o]=this.value[o]*r.value[o]}},{key:"div",value:function(t){if("number"==typeof t)for(var n=0;n<this.dim;n++)this.value[n]=this.value[n]/t;else for(var r=new e(t),i=Math.min(this.dim,r.dim),o=0;o<i;o++)this.value[o]=this.value[o]/r.value[o]}},{key:"normalize",value:function(){var e=this.getLength();this.div(e)}},{key:"getAdd",value:function(t){var n=new e(this);return n.add(t),n}},{key:"getSub",value:function(t){var n=new e(this);return n.sub(t),n}},{key:"getMult",value:function(t){var n=new e(this);return n.mult(t),n}},{key:"getDiv",value:function(t){var n=new e(this);return n.div(t),n}},{key:"getLengthSq",value:function(){return 2===this.dim?this.value[0]*this.value[0]+this.value[1]*this.value[1]:this.value[0]*this.value[0]+this.value[1]*this.value[1]+this.value[2]*this.value[2]}},{key:"getLength",value:function(){return Math.sqrt(this.getLengthSq())}},{key:"x",set:function(e){this.value[0]=e},get:function(){return this.value[0]||0}},{key:"y",set:function(e){this.value[1]=e},get:function(){return this.value[1]||0}},{key:"z",set:function(e){if(this.dim<3){for(;this.dim<3;)this.value.push(0);this.dim=3}this.value[2]=e},get:function(){return this.value[2]||0}},{key:"w",set:function(e){if(this.dim<4){for(;this.dim<4;)this.value.push(0);this.dim=4}this.value[3]=e},get:function(){return this.value[3]||0}}]),e}();n.default=a},{"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/interopRequireDefault":11}],145:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getDomOrigin=function(e){var t=e.getBoundingClientRect?e.getBoundingClientRect():{top:0,left:0},n=e&&e.ownerDocument,r=n.body,i=n.defaultView||n.parentWindow||window,o=n.documentElement||r.parentNode,a=o.clientTop||r.clientTop||0,s=o.clientLeft||r.clientLeft||0;return{left:t.left+(i.pageXOffset||o.scrollLeft)-s,top:t.top+(i.pageYOffset||o.scrollTop)-a}},n.getDevicePixelRatio=function(e){var t=window.devicePixelRatio||1,n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/n}},{}],146:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.subscribeInteractiveDom=function(e,t){(0,r.subscribeMixin)(e),(t=t||{}).resize=void 0!==t.resize&&t.resize,t.move=void 0!==t.move&&t.move,t.snap=void 0!==t.snap&&t.snap;var n,s,l,c,u,h,d,p,f,m,v,g=100,y=100,x=null,b=!1,_=document.createElement("div");_.className="ghostdom",t.snap&&e.parentElement.appendChild(_);function w(){a(_,p.left,p.top,p.width,p.height),_.style.opacity=0}function S(e){T(e);var r=t.resize&&(n||s||c||l);x={x:f,y:m,cx:e.clientX,cy:e.clientY,w:p.width,h:p.height,isResizing:r,isMoving:!r&&M(),onTopEdge:c,onLeftEdge:l,onRightEdge:n,onBottomEdge:s}}function M(){return t.move&&f>0&&f<p.width&&m>0&&m<p.height}function T(t){p=e.getBoundingClientRect(),f=t.clientX-p.left,m=t.clientY-p.top,c=m<o,l=f<o,n=f>=p.width-o,s=m>=p.height-o,u=window.innerWidth-o,h=window.innerHeight-o}function E(e){T(e),v=e,b=!0}function C(n){if(T(n),x&&x.isResizing&&e.trigger("resize",{finish:!0,el:e}),t.snap&&x&&x.isMoving){var r={width:p.width,height:p.height};p.top<i||p.left<i||p.right>window.innerWidth-i||p.bottom>window.innerHeight-i?(a(e,0,0,window.innerWidth,window.innerHeight),d=r):p.top<o?(a(e,0,0,window.innerWidth,window.innerHeight/2),d=r):p.left<o?(a(e,0,0,window.innerWidth/2,window.innerHeight),d=r):p.right>u?(a(e,window.innerWidth/2,0,window.innerWidth/2,window.innerHeight),d=r):p.bottom>h?(a(e,0,window.innerHeight/2,window.innerWidth,window.innerWidth/2),d=r):d=null,w(),e.trigger("move",{finish:!0,el:e}),e.trigger("resize",{finish:!0,el:e})}x=null}
10return e.addEventListener("mousedown",(function(e){S(e),v.preventDefault()})),document.addEventListener("mousemove",E),document.addEventListener("mouseup",C),e.addEventListener("touchstart",(function(e){S(e.touches[0]),v.preventDefault()})),document.addEventListener("touchmove",(function(e){e.preventDefault(),e.stopPropagation(),E(e.touches[0])})),document.addEventListener("touchend",(function(e){0===e.touches.length&&C(v.changedTouches[0])})),function r(){if(requestAnimationFrame(r),!b)return;if(b=!1,x&&x.isResizing){if(x.onRightEdge&&(e.style.width=Math.max(f,g)+"px"),x.onBottomEdge&&(e.style.height=Math.max(m,y)+"px"),x.onLeftEdge){var S=Math.max(x.cx-v.clientX+x.w,g);S>g&&(e.style.width=S+"px",e.style.removeProperty("right"),e.style.left=v.clientX+"px")}if(x.onTopEdge){var T=Math.max(x.cy-v.clientY+x.h,y);T>y&&(e.style.height=T+"px",e.style.removeProperty("bottom"),e.style.top=v.clientY+"px")}return w(),void e.trigger("resize",{finish:!1,el:e})}if(x&&x.isMoving){if(t.snap){if(p.top<i||p.left<i||p.right>window.innerWidth-i||p.bottom>window.innerHeight-i?(a(_,0,0,window.innerWidth,window.innerHeight),_.style.opacity=.2):p.top<o?(a(_,0,0,window.innerWidth,window.innerHeight/2),_.style.opacity=.2):p.left<o?(a(_,0,0,window.innerWidth/2,window.innerHeight),_.style.opacity=.2):p.right>u?(a(_,window.innerWidth/2,0,window.innerWidth/2,window.innerHeight),_.style.opacity=.2):p.bottom>h?(a(_,0,window.innerHeight/2,window.innerWidth,window.innerWidth/2),_.style.opacity=.2):w(),d)return void a(e,v.clientX-d.width/2,v.clientY-Math.min(x.y,d.height),d.width,d.height);e.style.removeProperty("right"),e.style.removeProperty("bottom"),e.style.top=v.clientY-x.y+"px",e.style.left=v.clientX-x.x+"px"}else{var E=v.clientX-x.x,C=v.clientY-x.y;E<0?E=0:C<0?C=0:E+e.offsetWidth>window.innerWidth?E=window.innerWidth-e.offsetWidth:C+e.offsetHeight>window.innerHeight&&(C=window.innerHeight-e.offsetHeight),e.style.removeProperty("right"),e.style.removeProperty("bottom"),e.style.left=E+"px",e.style.top=C+"px"}return void e.trigger("move",{finish:!1,el:e})}t.resize&&(n&&s||l&&c)?e.style.cursor="nwse-resize":t.resize&&(n&&c||s&&l)?e.style.cursor="nesw-resize":t.resize&&(n||l)?e.style.cursor="ew-resize":t.resize&&(s||c)?e.style.cursor="ns-resize":M()?e.style.cursor="move":e.style.cursor="default"}(),e.snapRight=function(){var t={width:e.width,height:e.height};a(e,window.innerWidth/2,0,window.innerWidth/2,window.innerHeight),d=t,e.trigger("move",{finish:!0,el:e}),e.trigger("resize",{finish:!0,el:e})},e};var r=e("./mixin"),i=-30,o=10;function a(e,t,n,r,i){e.style.left=t+"px",e.style.top=n+"px",e.style.width=r+"px",e.style.height=i+"px"}},{"./mixin":147}],147:[function(e,t,n){"use strict";function r(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(n,"__esModule",{value:!0}),n.subscribeMixin=function(e){var t=new Set;return Object.assign(e,{on:function(e,n){var r={};r[e]=n,t.add(r)},off:function(e,n){if(n){var i={};i[e]=n,t.delete(i)}else{var o,a=r(t);try{for(a.s();!(o=a.n()).done;)for(var s=o.value,l=0,c=Object.keys(s);l<c.length;l++){if(c[l]===e)return void t.delete(s)}}catch(e){a.e(e)}finally{a.f()}}},offAll:function(){t.clear()},trigger:function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];var a,s=r(t);try{for(s.s();!(a=s.n()).done;){var l=a.value;"function"==typeof l[e]&&l[e].apply(l,i)}}catch(e){s.e(e)}finally{s.f()}},listSubscriptions:function(){var e,n=r(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;console.log(i)}}catch(e){n.e(e)}finally{n.f()}}})}},{}],148:[function(e,t,n){"use strict";var r=e("../../core/properties");n.init=function(){i=n.tabs=document.querySelectorAll(".editor__tab"),o=n.currentTab=i[0];for(var e=0,t=i.length;e<t;e++)i[e].addEventListener("click",a)},n.setActiveTab=function(e){o=null;for(var t=0,n=i.length;t<n;t++)t===e?(i[t].classList.add("is-active"),o=i[t]):i[t].classList.remove("is-active")};var i=n.tabs=null,o=n.currentTab=null;function a(e){o!==e.target&&(o.classList.remove("is-active"),(o=e.target).classList.add("is-active"),r.onTabChanged.dispatch())}},{"../../core/properties":90}],149:[function(e,t,n){"use strict";var r=e("mout/object/mixIn"),i=e("../../utils/math"),o=e("gsap").gsap;function a(e){r(this,{domElement:null,ratio:0,useBlur:!0},e),this.domElement=this.domElement||document.createElement("div"),this.style=this.domElement.style,this.boundOnUpdate=this.onUpdate.bind(this),this.boundOnComplete=this.onComplete.bind(this)}var s=a.prototype;
10t.exports=a,s.show=function(e,t){o.killTweensOf(this),o.to(this,e||0,{delay:t||0,ratio:1,onUpdate:this.boundOnUpdate,onComplete:this.boundOnComplete})},s.hide=function(e,t){o.killTweensOf(this),o.to(this,e||0,{delay:t||0,ratio:0,onUpdate:this.boundOnUpdate,onComplete:this.boundOnComplete})},s.onUpdate=function(){var e=this.style,t=i.cUnMix(.4,1,this.ratio);e.opacity=t,this.useBlur&&(e.filter="blur("+.2*(1-t)+"ex)");e.visibility=t||t<2?"visible":"hidden",this.style.visibility=this.ratio?"visible":"hidden"},s.onComplete=function(){this.style.visibility=this.ratio?"visible":"hidden"}},{"../../utils/math":165,gsap:31,"mout/object/mixIn":54}],150:[function(e,t,n){"use strict";var r=e("mout/object/mixIn"),i=e("mout/array/shuffle"),o=e("../../utils/math"),a=e("gsap").gsap;function s(e){r(this,{text:"",domElement:null,ratio:0,stagger1s:[],stagger2s:[],chars:[],useBlur:!0},e),this.domElement=this.domElement||document.createElement("div"),this.text=this.text||this.domElement.innerHTML,this.style=this.domElement.style,this.boundOnUpdate=this.onUpdate.bind(this),this.boundOnComplete=this.onComplete.bind(this),this.setText(this.text)}var l=s.prototype;t.exports=s,l.setText=function(e){e=this.text=e||this.text,this.domElement.innerHTML=e,this.chars.length=0,this.stagger1s.length=0,this.stagger2s.length=0;for(var t=this.domElement.querySelectorAll(".title-text-effect__non-text"),n=0,r=t.length;n<r;n++){var i=t[n];this.domElement.innerHTML=this.domElement.innerHTML.replace(i.outerHTML,"#"+n+"# ")}var o=this.domElement.innerHTML.split(/\s+/g);this.domElement.innerHTML="";for(var a=0,s=o.length;a<s;a++){var l=o[a],c=l.match(/#(\d+)#/g),u=void 0;if(c)u=t[parseInt(c[0].replace(/#/g,""),10)];else{u=document.createElement("span");var h=l.substr(0,1);u.innerHTML=("'"==h||"."==h?"":" ")+l+" "}this.chars[a]=u,this.domElement.appendChild(u)}this.onComplete(),this.onUpdate()},l.show=function(e,t){a.killTweensOf(this),a.to(this,e||0,{delay:t||0,ratio:1,onUpdate:this.boundOnUpdate,onComplete:this.boundOnComplete})},l.hide=function(e,t){a.killTweensOf(this),a.to(this,e||0,{delay:t||0,ratio:0,onUpdate:this.boundOnUpdate,onComplete:this.boundOnComplete})},l.onUpdate=function(){for(var e=this.useBlur,t=0,n=this.chars.length;t<n;t++){var r=this.chars[t].style,i=o.cUnMix(.4*this.stagger1s[t],1-.4*this.stagger2s[t],this.ratio);if(r.opacity=i,e){var a=10*(1-i);r.filter="blur("+a.toFixed(1)+"px)"}r.visibility=i||this.chars.length<2?"visible":"hidden"}this.style.visibility=this.ratio?"visible":"hidden"},l.onComplete=function(){this.stagger1s.length=0,this.stagger2s.length=0;var e=this.chars,t=Math.max(1,e.length-1),n=Array.apply(null,{length:e.length}).map(Number.call,Number);Array.prototype.push.apply(this.stagger1s,i(n).map((function(e){return e/t}))),Array.prototype.push.apply(this.stagger2s,i(n).map((function(e){return e/t})))}},{"../../utils/math":165,gsap:31,"mout/array/shuffle":34,"mout/object/mixIn":54}],151:[function(e,t,n){"use strict";var r,i=e("../../core/properties"),o=e("../../utils/math"),a=e("../../utils/ease"),s=e("./galleryGrid");n.preInit=function(){s.preInit()},n.init=function(){r=document.querySelector(".gallery"),s.init()},n.show=function(){c=.025,i.final.opacity=0,r.classList.add("is-visible"),s.show()},n.hide=function(){c=-.08,r.classList.remove("is-visible")},n.update=function(e){l=o.clamp(l+c,0,1),r.style.opacity=a.easeOutCubic(l)};var l=0,c=0},{"../../core/properties":90,"../../utils/ease":164,"../../utils/math":165,"./galleryGrid":152}],152:[function(e,t,n){"use strict";var r,i,o=e("../../core/browser"),a=e("../../core/properties"),s=e("../../core/settings"),l=e("../../io/localStorage"),c=e("../../io/shadertoy"),u=e("../../io/backend"),h=e("../viewInfos"),d=e("../../router/router"),p=e("../prompt/prompt"),f=e("../prompt/promptData"),m=e("../effects/TitleTextEffect"),v=e("../effects/ElementOpacityEffect"),g=e("gsap").gsap;n.preInit=function(){r=document.querySelector(".gallery__wrapper"),i=document.querySelector(".gallery__inner"),y=document.querySelector(".gallery__select"),x=y.value,y.addEventListener("change",z,!1),H(),D()},n.init=function(){r.addEventListener("scroll",W,{passive:!0})},n.show=function(){S&&p.showMsg(f["api-error"],!0);for(var e=0,t=I.length;e<t;e++){var n=I[e],r=n.getAttribute("data-src");r&&(n.src=r,n.setAttribute("data-src",""))}I=[];for(var i=0,o=M.length;i<o;i++)M[i]()},n.shaderInfosList=[];var y,x,b,_,w=[],S=!1,M=[],T=0,E=!1,C=!1,L=!0,R=!1,A=3e5,P=[],I=[],O=0;function D(){i.classList.add("is-searching"),u.getIds(T,20,x,N)}function N(e){if(R=!1,s.LOG_API_TIME&&(_=performance.now(),console.log("search request took "+parseInt(_-b)+"ms"),b=0,_=0),e.success){E=!1;for(var t=0,n=e.idList.length;t<n;t++){var r=e.idList[t];w.includes(r)||w.push(r)}for(var o=0,l=s.API_SIMULTANEOUS_REQUEST_NUMBER;o<l;o++)k();e.isEnd&&(L=!0,i.classList.remove("is-searching"))}else a.isGallery?p.showMsg(f["api-error"],!0):S=!0,i.classList.remove("is-searching")}function k(){var e=w[O];e?(O++,function(e){var t=s.USE_LOCAL_CACHE?l.loadShader(e):null;s.LOG_API_TIME&&(console.log("start loading "+e,O),P[e]={start:performance.now(),end:null});if(t){Date.now()-t.timestamp>A?B(e):F({success:1,shaderInfo:t.shaderInfo})}else B(e)}(e)):s.LOG_API_TIME&&console.warn("end of list",O,w.length)}function z(){x=y.value,E=!0,L=!0,T=0,O=0,i.innerHTML=[],H(),w=[],M=[],I=[],n.shaderInfosList=[],c.abortRequests(),D(),W()}function B(e){c.load(e,F,!1)}function F(e){if(e.success&&!E){var t=e.shaderInfo.id;s.LOG_API_TIME&&(P[t].end=performance.now(),console.log(t,"shader took "+parseInt(P[t].end-P[t].start)+"ms to load")),n.shaderInfosList.push(e.shaderInfo),function(e){var t=n.shaderInfosList.length-1,r=document.querySelectorAll(".shader")[t];r||(r=G(),i.appendChild(r));r.addEventListener("click",(function(){var t;t=e,a.isPreview=!1,h.setData(t,t.id),h.updateTexts()}),!1);var l=r.querySelector(".shader__preview"),c=r.querySelector(".shader__preview-img"),u=r.querySelector(".shader__name"),p=r.querySelector(".shader__username"),f=r.querySelector(".shader__stat-icon--likes"),g=r.querySelector(".shader__stat-icon--views"),y=r.querySelector(".shader__stat-text--likes"),x=r.querySelector(".shader__stat-text--views");r.setAttribute("id",e.id),r.setAttribute("href","/view/"+e.id),c.setAttribute("alt","preview-"+e.id),u.innerHTML=e.title,p.innerHTML="by "+e.username,y.innerHTML=e.likes,x.innerHTML=e.viewed;var b=new m({domElement:u,useBlur:!o.isMobile}),_=new m({domElement:p,useBlur:!o.isMobile}),w=new m({domElement:y,useBlur:!o.isMobile}),S=new m({domElement:x,useBlur:!o.isMobile}),T=new v({domElement:c}),E=new v({domElement:f}),C=new v({domElement:g}),L=function(){U(l,(function(){l.classList.add("is-ready"),l.style.opacity=1,T.show(.2,0)}))};c.addEventListener("load",(function(){a.isGallery?L():M.push(L)}));var R=function(){U(u,(function(){u.classList.add("is-ready"),u.style.opacity=1,b.show(1,.1)})),U(p,(function(){p.classList.add("is-ready"),p.style.opacity=1,_.show(1,.2)})),w.show(1,.4),E.show(1,.5),S.show(1,.5),C.show(1,.6),r.classList.add("is-loaded")};a.isGallery?R():M.push(R);s.USE_REDIRECT_CORS_PROXY||(c.crossOrigin="anonymous");a.isGallery?c.src=s.SHADERTOY_PREVIEW_URL+e.id+".jpg":(c.setAttribute("data-src",s.SHADERTOY_PREVIEW_URL+e.id+".jpg"),I.push(c));d.parseItem(r)}
10(e.shaderInfo),l.saveShader(t,e.shaderInfo)}k()}function G(){var e=document.createElement("a");e.classList.add("shader");var t=document.createElement("div");e.id="",e.rel="internal",t.className="shader__content";var n=document.createElement("div"),r=document.createElement("img"),i=document.createElement("div"),o=document.createElement("div"),a=document.createElement("h3"),s=document.createElement("p"),l=document.createElement("div"),c=document.createElement("div"),u=document.createElement("div"),h=document.createElement("div"),d=document.createElement("div"),p=document.createElement("div"),f=document.createElement("div");return n.className="shader__preview",r.className="shader__preview-img",n.appendChild(r),i.className="shader__info",o.className="shader__part shader__part--left",a.className="shader__name",s.className="shader__username",o.appendChild(a),o.appendChild(s),i.appendChild(o),l.className="shader__part shader__part--right",c.className="shader__stat shader__stat--likes",u.className="shader__stat shader__stat--views",h.className="shader__stat-icon shader__stat-icon--likes",p.className="shader__stat-icon shader__stat-icon--views",d.className="shader__stat-text shader__stat-text--likes",f.className="shader__stat-text shader__stat-text--views",h.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>',p.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>',c.appendChild(d),u.appendChild(f),c.appendChild(h),u.appendChild(p),l.appendChild(c),l.appendChild(u),i.appendChild(l),t.appendChild(n),t.appendChild(i),e.appendChild(t),e}function H(){for(var e=0;e<20;e++){var t=G();t.id=e,i.appendChild(t)}}function U(e,t){g.to(e,{duration:.02,opacity:0,onComplete:t})}function W(){C=r.scrollHeight<r.clientHeight+r.scrollTop+1,!R&&C&&L&&(T+=20,D())}},{"../../core/browser":88,"../../core/properties":90,"../../core/settings":91,"../../io/backend":102,"../../io/localStorage":105,"../../io/shadertoy":110,"../../router/router":126,"../effects/ElementOpacityEffect":149,"../effects/TitleTextEffect":150,"../prompt/prompt":155,"../prompt/promptData":156,"../viewInfos":159,gsap:31}],153:[function(e,t,n){"use strict";var r,i,o,a,s=e("../../utils/math"),l=s.clamp,c=s.map,u=e("../../audio/audio");n.updateMenu=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=0,n=r.length;t<n;t++)r[t].classList.toggle("is-active",e===t)},n.init=function(){r=document.querySelectorAll(".menu__link"),i=document.querySelector(".menu__audio"),o=document.createElement("canvas"),a=o.getContext("2d"),i.appendChild(o),o.width=i.clientWidth,o.height=i.clientHeight,i.addEventListener("click",d)},n.update=function(e,t){if(!o)return;a.clearRect(0,0,o.width,o.height);for(var n=!u.isActive(),r=.75*(h=l(h+(n?1:-1)*e*2.5,0,1)),i=0;i<7;i++){var s=i/6,d=Math.round(c(s,0,1,1,o.width-1))+.5,p=Math.sin(s*Math.PI+4*t+Math.sin(s*Math.PI*.5+t)),f=c(p,-1,1,r,.75)*o.height;a.beginPath(),a.lineWidth=1,a.strokeStyle="#ddd",a.moveTo(d,o.height),a.lineTo(d,f),a.stroke()}};var h=1;function d(){u.toggle()}},{"../../audio/audio":80,"../../utils/math":165}],154:[function(e,t,n){"use strict";var r,i,o,a,s=e("../core/browser"),l=e("../core/settings"),c=e("gsap").gsap;function u(){o.innerHTML="Now Loading ("+Math.floor(100*n.percent)+"%)"}function h(){var e;1==n.percent&&(e=s.isVRBrowser?1.5:l.SKIP_ANIMATION?0:1,c.to(i,e,{autoAlpha:0}),r())}n.init=function(e){r=e,i=document.getElementById("preloader"),o=document.getElementById("preloader-text")},n.onPreloading=function(e){a&&a.kill();a=c.to(n,l.SKIP_ANIMATION?0:1,{percent:e,onUpdate:u,onComplete:h})},n.percent=0},{"../core/browser":88,"../core/settings":91,gsap:31}],155:[function(e,t,n){"use strict";var r,i,o,a,s;n.init=function(){r=document.getElementById("prompt"),i=document.getElementById("prompt--bg"),o=document.getElementById("prompt--msg"),a=document.getElementById("prompt--input"),s=document.getElementById("prompt--ok-btn"),i.addEventListener("click",c),s.addEventListener("click",u)},n.showMsg=function(e,t){o.innerHTML=e,r.classList.add("is-visible"),r.classList.remove("is-input"),r.classList.toggle("is-error",!!t)},n.showInput=function(e,t,n,i){o.innerHTML=e,a.value=t||"",r.classList.add("is-visible"),r.classList.add("is-input"),r.classList.toggle("is-error",!!n),a.focus(),a.select()},n.hide=c,n.setOkCallback=function(e){l=e},n.getInputValue=function(){return a.value};var l=null;function c(){r.classList.remove("is-visible")}function u(){c(),l&&(l(),l=null)}},{}],156:[function(e,t,n){"use strict";
10t.exports={"more-features":'\n\t<div class="prompt__paragraph"><div class="prompt__title">More features</div>\n\tCineShader supports 2.5D for the screen display through the alpha channel of the fragColor. It maps alpha: [0 - 1] to thickness [0m - 2m] with the screen size of 6m x 6m. In case of the future update, you are recommended to use the values through the vec3 uniform <span>iScreenSize</span> [6, 6, 2]<br><br>\n\tWe also added the <span>#define IS_CINESHADER</span> header on our side and you can use it to make your shader compatible with Shadertoy.com if you used any CineShader specific features.\n\t</div>\n\t',"save-and-share":'\n\t<div class="prompt__paragraph"><div class="prompt__title">Save and share instruction</div><ul>\n\t<li>sign in your <a href="https://www.shadertoy.com/profile" target="_blank">shadertoy</a> account.</li>\n\t<li>create a new shader and paste your code in it.</li>\n\t<li>add <span>cineshader</span> in the tag field.</li>\n\t<li>set its privacy to <span>public + api</span> and hit save.</li>\n\t<li>get your shader_id from the url: https://www.shadertoy.com/view/shadertoy_id</li>\n\t<li>your CineShader url would be : https://unreal.io/view/shadertoy_id</li>\n\t</ul></div>\n\t',"convert-your-shader":'\n\t<div class="prompt__paragraph"><div class="prompt__title">Make your shader CineShader compatible</div><ul>\n\t<li>make sure you didnât use any texture, audio and framebuffer.</li>\n\t<li>optionally add a bit of thickness to value to the alpha channel of fragColor.</li>\n\t<li>add <span>cineshader</span> in the tag field.</li>\n\t<li>set its privacy to <span>public + api</span> and hit save.</li>\n\t<li>get your shader_id from the url: https://www.shadertoy.com/view/shadertoy_id</li>\n\t<li>your CineShader url would be : https://unreal.io/view/shadertoy_id</li>\n\t</ul></div>\n\t',"api-error":'\n\t<div class="prompt__paragraph"><div class="prompt__title">Shadertoy API error</div>\n\tThe API seems unreachable for now, please try again later.\n\t</div>\n\t',"shader-syntax":'<div class="prompt__paragraph"><div class="prompt__title">Shader Syntax</div>\n\t<table>\n\t\t<tr><td>vec3</td><td>iResolution</td><td>The viewport resolution (z is pixel aspect ratio, usually 1.0)</td></tr>\n\t\t<tr><td>float</td><td>iTime</td><td>Current time in seconds</td></tr>\n\t\t<tr><td>float</td><td>iTimeDelta</td><td>Time it takes to render a frame, in seconds</td></tr>\n\t\t<tr><td>int</td><td>iFrame*</td><td>Current frame</td></tr>\n\t\t<tr><td>float</td><td>iFrameRate</td><td>Number of frames rendered per second</td></tr>\n\t\t<tr><td>vec4</td><td>iMouse</td><td>xy = current pixel coords (if LMB is down). zw = click pixel</td></tr>\n\t\t<tr><td>vec4</td><td>iDate</td><td>Year, month, day, time in seconds in .xyzw</td></tr>\n\t\t<tr><td>vec3</td><td>iCamPos**</td><td>relative camera position to the center of the screen</td></tr>\n\t\t<tr><td>vec4</td><td>iCamQuat**</td><td>relative camera rotation to the center of the screen</td></tr>\n\t\t<tr><td>vec3</td><td>iScreenSize**</td><td>screen mesh width, height and maximum thickness</td></tr>\n\t</table>\n\t<p>* Not compatible with browser running with WebGL 1.</p>\n\t<p>** CineShader only uniform. Recommend to use it with <span>#ifdef IS_CINESHADER</span> to make sure your shader is compatible with Shadertoy.com</p>\n\t</div>\n\t'}},{}],157:[function(e,t,n){"use strict";var r,i,o,a,s=e("../core/browser"),l=e("../core/properties"),c=e("./effects/TitleTextEffect"),u=e("../controls/cameraControls"),h=e("../shaders/shaders");n.init=function(e){e,r=document.getElementById("shader-context"),i=new c({domElement:document.getElementById("shader-title"),useBlur:!s.isMobile}),o=new c({domElement:document.getElementById("shader-desc"),useBlur:!s.isMobile}),u.modes.splines.onAnimationStarted.add(p),u.modes.splines.onAnimationRestarted.add(f)},n.show=m,n.hide=v;var d=!1;function p(e){if("splines"===u.pendingId&&"splines"===u.currId&&!l.isView){var t=h.splineShaderList[e%h.splineShaderList.length];m(t.title,t.desc,e%u.modes.splines.splines.length%2?"left":"right")}}function f(e){if(!l.isView){var t=h.splineShaderList[e%h.splineShaderList.length];m(t.title,t.desc,e%u.modes.splines.splines.length%2?"left":"right")}}function m(e,t,n){d||(r.classList.remove("is-left","is-right"),r.classList.add("is-"+n),i.setText(e),i.show(2,1),o.setText(t),o.show(2,1),a=setTimeout(v,9e3),d=!0)}function v(){clearTimeout(a),i.hide(1),o.hide(1),d=!1}},{"../controls/cameraControls":86,"../core/browser":88,"../core/properties":90,"../shaders/shaders":128,"./effects/TitleTextEffect":150}],158:[function(e,t,n){"use strict";var r,i,o,a,s,l,c,u,h,d,p=e("three");n.init=function(){r=document.getElementById("transition-block"),i=document.createElement("canvas"),o=i.getContext("2d"),i.width=i.height=0,r.appendChild(i),u=f(),h=f(!0),d=new p.Color(16711680)},n.resize=function(e,t){a=i.width=e,s=i.height=t,c=s+2*(l=.4*t)}
10,n.update=function(e){if(Math.abs(n.ratio)<1){var t=n.ratio;o.fillStyle=d.getStyle(),o.clearRect(0,0,a,s);var i=(c+s)*t;o.fillRect(0,i,a,s),n.ratio<1&&o.drawImage(h,0,i+s-1,a,l),n.ratio>0&&o.drawImage(u,0,i-l+1,a,l),r.style.display="block"}else r.style.display="none"},n.ratio=-1;function f(e){var t=document.createElement("canvas"),n=t.getContext("2d"),r=15*Math.PI/180,i=64*Math.tan(r),o=Math.cos(r)*(64-i);t.width=64,t.height=64;var a=n.createLinearGradient(0,i,Math.sin(r)*o,i+o*o/(64-i));return a.addColorStop(e?0:1,"rgba(6,16,21,1)"),a.addColorStop(e?1:0,"rgba(6,16,21,0)"),n.fillStyle=a,n.fillRect(0,0,64,64),t}},{three:79}],159:[function(e,t,n){"use strict";var r,i,o,a,s,l,c,u,h,d,p,f,m,v=e("../core/browser"),g=e("../core/properties"),y=e("./effects/TitleTextEffect"),x=e("../controls/cameraControls"),b=e("../router/router"),_=e("gsap").gsap;function w(){if(r.classList.toggle("is-preview",g.isPreview),i.innerHTML=m.title,s.innerHTML=m.username,s.setAttribute("href","https://www.shadertoy.com/user/"+m.username),u.setAttribute("href","https://www.shadertoy.com/view/"+m.id),o.setText(m.title),m.description){var e=!1,t=m.description.replace(/\[url=?(.+)?\](.+)\[\/url\]/g,(function(n,r){if(r){e=!0;var i=(r=r.replace("[/url]","")).replace(/(^\w+:|^)\/\//,"");return'<a class="button-inline title-text-effect__non-text" href="'+r+'" target="_blank">'+(i=i.replace("www.",""))+"</a>"}return t}));e||(t=m.description.replace(/(https?:\/\/[^\s]+)/g,(function(e,n){if(n){var r=(n=n.replace("[/url]","")).replace(/(^\w+:|^)\/\//,"");return'<a class="button-inline title-text-effect__non-text" href="'+n+'" target="_blank">'+(r=r.replace("www.",""))+"</a>"}return t}))),l.innerHTML=t,c.setText(t)}}function S(){r.classList.add("is-visible"),o.show(2,.5),c.show(2,2.5),_.to(a,{opacity:1,duration:2,delay:1.5,ease:"Power4.easeOut"}),_.to([u,d,p,f],{opacity:1,duration:2,stagger:.1,delay:3.5,ease:"Power4.easeOut"})}function M(){g.isView&&S()}function T(){g.forkSlotIndex=h.value-1,b.goToUrl("/editor")}function E(){b.goToUrl("/editor"),g.isPreview=!1}n.init=function(){r=document.querySelector(".view-infos"),a=document.querySelector(".view-infos__subtitle"),s=document.querySelector(".view-infos__author"),i=document.querySelector(".view-infos__title"),l=document.querySelector(".view-infos__description"),u=document.querySelector(".view-infos__link"),h=document.querySelector(".view-infos__select"),d=document.querySelector(".view-infos__fork .select-wrapper"),p=document.querySelector(".view-infos__fork-button"),f=document.querySelector(".view-infos__back"),o=new y({domElement:i,useBlur:!v.isMobile}),c=new y({domElement:l,useBlur:!v.isMobile}),m&&w();x.modes.splines.onAnimationRestarted.add(M),p.addEventListener("click",T),f.addEventListener("click",E)},n.show=S,n.hide=function(){o.hide(1,0),c.hide(1,.5),_.to(a,{opacity:0,duration:1,delay:.25,ease:"Power4.easeOut"}),_.to([u,d,p,f],{opacity:0,duration:2,stagger:.1,delay:.75,ease:"Power4.easeOut",onComplete:function(){r.classList.remove("is-visible")}})},n.setData=function(e,t){(m=e).id=t},n.updateTexts=w},{"../controls/cameraControls":86,"../core/browser":88,"../core/properties":90,"../router/router":126,"./effects/TitleTextEffect":150,gsap:31}],160:[function(e,t,n){"use strict";var r,i,o,a=e("../../helpers/webXRHelper"),s=e("../../core/properties"),l=e("../../webxr/vrPreloader");function c(){l.isComplete?a.toggleWebXR():s.loadervr.start(l.onPreloading)}function u(){i.textContent="EXIT VR"}function h(){i.textContent="ENTER VR"}n.init=function(){r=document.querySelector(".button__webxr--middle"),i=document.querySelector(".button__webxr--corner");for(var e=0,t=(o=[r,i]).length;e<t;e++)o[e].classList.add("is-visible"),o[e].addEventListener("click",c);a.onSessionStarted.add(u),a.onSessionEnded.add(h)}},{"../../core/properties":90,"../../helpers/webXRHelper":99,"../../webxr/vrPreloader":195}],161:[function(e,t,n){"use strict";var r,i,o,a,s,l,c,u=e("../effects/TitleTextEffect"),h=e("../effects/ElementOpacityEffect"),d=e("../../core/settings"),p=0;n.init=function(){i=new u({domElement:document.querySelector(".xr-landing__title"),useBlur:!0}),o=new u({domElement:document.querySelector(".xr-landing__desc"),useBlur:!0}),s=document.querySelector(".button__webxr--middle"),a=new h({domElement:s,useBlur:!0}),(c=document.querySelector(".xr-landing__bg")).style.backgroundImage="url("+d.TEXTURE_PATH+"landing_bg.jpg)",l=new h({domElement:c,useBlur:!1}),r=document.querySelector(".xr-landing__craftedby")}
10,n.show=function(){l.show(1.9,1.1),i.show(1.3,1.6),o.show(1.4,2.8),a.show(1.2,3.6)},n.update=function(e){if(l){p+=e;var t=.5*Math.sin(p)+.5,n=1+.1*(1-l.ratio)+.03*t;l.style.transform="scale3d("+n+","+n+", 1)",r.style.opacity=l.ratio}}},{"../../core/settings":91,"../effects/ElementOpacityEffect":149,"../effects/TitleTextEffect":150}],162:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=r(e("@babel/runtime/helpers/classCallCheck")),o=r(e("@babel/runtime/helpers/createClass")),a=r(e("@babel/runtime/helpers/inherits")),s=r(e("@babel/runtime/helpers/possibleConstructorReturn")),l=r(e("@babel/runtime/helpers/getPrototypeOf"));function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}var u,h=e("three"),d=e("../core/properties"),p=[],f=function(e){(0,a.default)(n,e);var t=c(n);function n(e){var r;(0,i.default)(this,n),(r=t.call(this)).renderer=e;var o=document.createElement("canvas");o.width=256,o.height=128,r.canvas=o;var a=o.getContext("2d");a.fillStyle="#00ffff",a.fillRect(0,0,o.width,o.height);var s=new h.CanvasTexture(o),l=new h.Mesh(new h.PlaneGeometry(.5,.25),new h.MeshBasicMaterial({map:s,transparent:!0,opacity:.2,side:h.DoubleSide,depthTest:!1,depthWrite:!1}));return l.position.z=-.1,l.position.y=-.03,r.add(l),r.cmesh=l,r.last=0,r.lastFrame=0,d.onOculusLinkDetected.add((function(){r.cmesh.geometry.rotateX(Math.PI),r.cmesh.position.z=.4})),r}return(0,o.default)(n,[{key:"update",value:function(e,t){t*=1e3;for(var n=performance.now();p.length>0&&p[0]<=n-1e3;)p.shift();if(p.push(n),u=p.length,t-this.last>300){var r=this.canvas.getContext("2d");r.fillStyle="white",r.fillRect(0,0,this.canvas.width,this.canvas.height),r.fillStyle="black",r.font="16pt sans-serif",this.renderer.xr.isPresenting?(r.fillText("calls per eye: ".concat(this.renderer.info.render.calls/2),3,20),r.fillText("tris per eye: ".concat(this.renderer.info.render.triangles/2),3,40)):(r.fillText("calls: ".concat(this.renderer.info.render.calls),3,20),r.fillText("tris: ".concat(this.renderer.info.render.triangles),3,40)),r.fillText("fps: ".concat(u.toFixed(2)),3,60),r.fillText("-------",3,80),r.fillText("Geometries: ".concat(this.renderer.info.memory.geometries),3,100),r.fillText("Textures: ".concat(this.renderer.info.memory.textures),3,120),this.cmesh.material.map.needsUpdate=!0,this.last=t,this.lastFrame=this.renderer.info.render.frame}}}]),n}(h.Group);n.default=f},{"../core/properties":90,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/getPrototypeOf":9,"@babel/runtime/helpers/inherits":10,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/possibleConstructorReturn":15,three:79}],163:[function(e,t,n){"use strict";n.rectRound=function(e,t,n,r,i,o){var a=isNaN(o)?o:{tl:o,tr:o,br:o,bl:o};e.beginPath(),e.moveTo(t+a.tl,n),e.lineTo(t+r-a.tr,n),e.quadraticCurveTo(t+r,n,t+r,n+a.tr),e.lineTo(t+r,n+i-a.br),e.quadraticCurveTo(t+r,n+i,t+r-a.br,n+i),e.lineTo(t+a.bl,n+i),e.quadraticCurveTo(t,n+i,t,n+i-a.bl),e.lineTo(t,n+a.tl),e.quadraticCurveTo(t,n,t+a.tl,n)}},{}],164:[function(e,t,n){"use strict";var r,i,o={Linear:{None:function(e){return e}},Quad:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quart:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quint:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sine:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Expo:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circ:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/.4))},Out:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin(2*(e-t)*Math.PI/.4)+1)},InOut:function(e){var t,n=.1,r=.4;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*n*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/r):n*Math.pow(2,-10*(e-=1))*Math.sin(2*(e-t)*Math.PI/r)*.5+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-o.Bounce.Out(1-e)},Out:function(e){return 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},InOut:function(e){return e<.5?.5*o.Bounce.In(2*e):.5*o.Bounce.Out(2*e-1)+.5}}};for(r in n.basic=o,n.linear=o.Linear,o)"Linear"!==r&&(i=o[r],n["easeIn"+r]=i.In,n["easeOut"+r]=i.Out,n["easeInOut"+r]=i.InOut)},{}],165:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.loop=n.cubicBezierFn=n.cubicBezier=n.latLngDistance=n.distanceSqrTo3=n.distanceTo3=n.distanceSqrTo=n.distanceTo=n.latLngBearing=n.powerTwoFloor=n.powerTwoFloorBase=n.powerTwoCeiling=n.powerTwoCeilingBase=n.isPowerOfTwo=n.sign=n.hash2=n.hash=n.fract=n.smoothstep=n.normalize=n.fit=n.cMap=n.map=n.staturate=n.cUnMix=n.unMix=n.cMix=n.mix=n.clamp=n.step=n.RAD2DEG=n.DEG2RAD=n.HALF_PI=n.PI2=n.PI=void 0;var r=Math.PI;n.PI=r;var i=2*r;n.PI2=i;var o=.5*r;n.HALF_PI=o;var a=r/180;n.DEG2RAD=a;var s=180/r;n.RAD2DEG=s;n.step=function(e,t){return t<e?0:1};var l=function(e,t,n){return e<t?t:e>n?n:e};n.clamp=l;n.mix=function(e,t,n){return e+(t-e)*n};n.cMix=function(e,t,n){return e+(t-e)*l(n,0,1)};n.unMix=function(e,t,n){return(n-e)/(t-e)};var c=function(e,t,n){return l((n-e)/(t-e),0,1)};n.cUnMix=c;n.staturate=function(e){return l(e,0,1)};var u=function(e,t,n,r,i){return r+(i-r)*(e-t)/(n-t)};n.map=u;n.cMap=function(e,t,n,r,i){return r+(i-r)*l((e-t)/(n-t),0,1)};n.fit=function(e,t,n,r,i,o){return e=c(t,n,e),o&&(e=o(e)),r+e*(i-r)};n.normalize=function(e,t,n){return u(e,t,n,0,1)};n.smoothstep=function(e,t,n){return(n=c(e,t,n))*n*(3-2*n)};var h=function(e){return e-Math.floor(e)};n.fract=h;n.hash=function(e){return h(43758.5453123*Math.sin(e))};n.hash2=function(e,t){return h(43758.5453*Math.sin(12.9898*e+4.1414*t))};n.sign=function(e){return e?e<0?-1:1:0};var d=function(e){return(e&-e)===e};n.isPowerOfTwo=d;var p=function(e){return Math.ceil(Math.log(e)/Math.log(2))};n.powerTwoCeilingBase=p;n.powerTwoCeiling=function(e){return d(e)?e:1<<p(e)};var f=function(e){return Math.floor(Math.log(e)/Math.log(2))};n.powerTwoFloorBase=f;n.powerTwoFloor=function(e){return d(e)?e:1<<f(e)};n.latLngBearing=function(e,t,n,r){var i=Math.sin(r-t)*Math.cos(n),o=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(r-t);return Math.atan2(i,o)};n.distanceTo=function(e,t){return Math.sqrt(e*e+t*t)};n.distanceSqrTo=function(e,t){return e*e+t*t};n.distanceTo3=function(e,t,n){return Math.sqrt(e*e+t*t+n*n)};n.distanceSqrTo3=function(e,t,n){return e*e+t*t+n*n};n.latLngDistance=function(e,t,n,r){var i=Math.sin((n-e)/2),o=Math.sin((r-t)/2),a=i*i+Math.cos(e)*Math.cos(n)*o*o;return 2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))};n.cubicBezier=function(e,t,n,r,i){var o=3*(t-e),a=3*(n-t)-o,s=i*i;return(r-e-o-a)*(s*i)+a*s+o*i+e};n.cubicBezierFn=function(e,t,n,r){var i=3*(t-e),o=3*(n-t)-i,a=r-e-i-o;return function(t){var n=t*t;return a*(n*t)+o*n+i*t+e}};n.loop=function(e,t){return e<0?(t-Math.abs(e)%t)%t:e%t}},{}],166:[function(e,t,n){"use strict";var r=e("../../core/browser"),i=e("../../core/settings"),o=e("../../core/properties"),a=e("../../effects/glPositionOffset/glPositionOffset"),s=e("../screen/screen"),l=e("../visual"),c=e("mout/object/mixIn"),u=e("three"),h=e("glslify");n.preInit=function(){if(n.hasStartedLoad)return;n.hasStartedLoad=!0,o.loader[o.hasInitialized?"load":"add"](i.MODEL_PATH+"car.buf",{weight:279,onLoad:_}),o.loader[o.hasInitialized?"load":"add"](i.MODEL_PATH+"car_glass.buf",{weight:69,onLoad:w}
10),(v=new u.Texture(o.loader[o.hasInitialized?"load":"add"](i.TEXTURE_PATH+"car.jpg",{weight:354,onLoad:function(){setTimeout((function(){v.needsUpdate=!0,v.isReady=!0}),4)}}).content)).wrapS=v.wrapT=u.RepeatWrapping},n.update=function(){d&&p&&v&&v.isReady&&(b||function(){if(!(p&&d&&v&&v.isReady))return;(f=new u.MeshStandardMaterial({side:u.DoubleSide})).type="ShaderMaterial",f.uniforms=c({u_infoTexture:{value:v}},u.UniformsUtils.merge([u.ShaderLib.standard.uniforms]),a.sharedUniforms,s.sharedUniforms),f.vertexShader=h(["#define GLSLIFY 1\n#define STANDARD\n\nattribute vec3 cmr;\nvarying vec2 v_uv;\n\n#include <glPositionOffset>\n\n#include <textureSmoothstep>\n#include <textureBicubic>\n#include <lodMipmapSample>\n\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;\nvarying vec3 v_worldNormal;\nvarying vec3 v_baseColor;\nvarying vec3 v_cmr;\n\nuniform vec2 u_screenTextureSize;\nuniform vec2 u_screenMipmapTextureSize;\nuniform vec3 u_screenPosition;\nuniform sampler2D u_areaLightCookies[1];\n\nvoid main () {\n\tvNormal = normalize( normalMatrix * normal );\n\tvec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\tvViewPosition = - mvPosition.xyz;\n\n\tvec3 worldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n\tvec3 delta = (worldPosition - u_screenPosition) / 50.0;\n\tv_baseColor = lodMipmapSampleNearestCubic(u_areaLightCookies[0], clamp(vec2(0.5, 0.5) + delta.xy, vec2(0.0), vec2(1.0)), 3.0 + abs(delta.z / 10.0), u_screenTextureSize, u_screenMipmapTextureSize).rgb;\n\n\tv_cmr = cmr;\n\tv_worldNormal = normal;\n\n\tv_uv = uv;\n\tgl_Position = projectionMatrix * mvPosition;\n\tgl_Position = glPositionOffset(gl_Position);\n}"]),f.fragmentShader=h(["#define GLSLIFY 1\n#define STANDARD\n\n#include <textureSmoothstep>\n#include <textureBicubic>\n#include <lodMipmapSample>\n\nuniform vec2 u_screenTextureSize;\nuniform vec2 u_screenMipmapTextureSize;\n\nuniform sampler2D u_infoTexture;\n\nvarying vec2 v_uv;\nvarying vec3 v_baseColor;\nvarying vec3 v_cmr;\nvarying vec3 v_worldNormal;\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\n// uniform float roughness;\n// uniform float metalness;\nuniform float opacity;\n\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;\n\n#include <common>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n\nvec3 hsv2rgb(vec3 c){\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main () {\n\tvec3 infoColor = texture2D(u_infoTexture, v_uv).rgb;\n\tfloat r = texture2D(u_infoTexture, v_uv * 16.0).r * infoColor.r;\n\n\tvec4 diffuseColor = vec4(r,r,r, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\tfloat roughnessFactor = v_cmr.b;\n\tfloat metalnessFactor = v_cmr.g;\n\n\tvec3 normal = normalize(vNormal);\n\tvec3 geometryNormal = normal;\n\n\tfloat fr = 1.0 - dot(vViewPosition, normal);\n\tvec3 rb = hsv2rgb(vec3(fr, 1.0, 1.0)) * smoothstep(0.5, -0.5, fr) * smoothstep(0.5, 0.45, abs(fr - 0.5));\n\n\t// accumulation\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\n\tvec3 worldNormal = normalize(v_worldNormal);\n\n\t// modulation\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\tgl_FragColor = vec4( max(outgoingLight * infoColor.b * 0.2, (infoColor.bbb + 0.012) * v_baseColor * (1.0 - infoColor.b) * max(0.0, worldNormal.z)), diffuseColor.a );\n\tgl_FragColor.rgb += rb * outgoingLight.rgb * infoColor.b * (1.0 - roughnessFactor) * 0.35;\n\n}"]),y=n.mesh=new u.Mesh(d,f),(m=new u.MeshStandardMaterial({roughness:0,metalness:1})).type="ShaderMaterial",m.uniforms=c({},u.UniformsUtils.merge([u.ShaderLib.standard.uniforms]),a.sharedUniforms,s.sharedUniforms),m.vertexShader=h(["#define GLSLIFY 1\n#define STANDARD\n\nvarying vec2 v_uv;\n\n#include <glPositionOffset>\n\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;\n\nuniform vec2 u_screenTextureSize;\nuniform vec2 u_screenMipmapTextureSize;\nuniform vec3 u_screenPosition;\n\nvoid main () {\n\tvNormal = normalize( normalMatrix * normal );
10\n\tvec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\tvViewPosition = - mvPosition.xyz;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\tgl_Position = glPositionOffset(gl_Position);\n}"]),m.fragmentShader=h(["#define GLSLIFY 1\n#define STANDARD\n\n#include <textureSmoothstep>\n#include <textureBicubic>\n#include <lodMipmapSample>\n\nuniform vec2 u_screenTextureSize;\nuniform vec2 u_screenMipmapTextureSize;\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;\n\n#include <common>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n\nvec3 hsv2rgb(vec3 c){\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main () {\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\n\tfloat roughnessFactor = roughness;\n\tfloat metalnessFactor = metalness;\n\n\tvec3 normal = normalize(vNormal);\n\tvec3 geometryNormal = normal;\n\n\tfloat fr = 1.0 - dot(vViewPosition, normal);\n\tvec3 rb = hsv2rgb(vec3(fr, 1.0, 1.0)) * smoothstep(0.5, -0.5, fr) * smoothstep(0.5, 0.45, abs(fr - 0.5));\n\n\t// accumulation\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\n\t// modulation\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\tgl_FragColor = vec4(outgoingLight * 0.08, 1.0);\n\tgl_FragColor.rgb = max(gl_FragColor.rgb, rb * 0.08);\n}"]),m.blending=u.AdditiveBlending,x=n.glassMesh=new u.Mesh(p,m),(r.isMobile||r.isOculusBrowser)&&(f.defines.IS_MOBILE=!0,m.defines.IS_MOBILE=!0);(g=n.container=new u.Object3D).add(y),g.add(x),l.container.add(g),b=!0}(),g.visible="car"==o.modelId)},n.hasStartedLoad=!1;var d,p,f,m,v,g=n.container=null,y=n.mesh=null,x=n.glassMesh=null,b=!1;function _(e){d=e}function w(e){p=e}},{"../../core/browser":88,"../../core/properties":90,"../../core/settings":91,"../../effects/glPositionOffset/glPositionOffset":95,"../screen/screen":169,"../visual":174,glslify:30,"mout/object/mixIn":54,three:79}],167:[function(e,t,n){"use strict";var r=e("../../core/browser"),i=e("../../core/settings"),o=e("../../core/properties"),a=e("../../helpers/fboHelper"),s=e("../../effects/glPositionOffset/glPositionOffset"),l=e("../../effects/mipmapper/Mipmapper"),c=e("../../utils/math"),u=e("mout/object/mixIn"),h=e("three"),d=e("glslify");n.preInit=function(){(p=new h.Texture(o.loader.add(i.TEXTURE_PATH+"floor.jpg",{weight:519}).content)).needsUpdate=!0,p.wrapS=p.wrapT=h.RepeatWrapping,(f=new h.Texture(o.loader.add(i.TEXTURE_PATH+"floor_mask.png",{weight:13}).content)).needsUpdate=!0},n.init=function(){m=new l,v=new h.Vector2,(g=a.createRenderTarget(1,1)).depthBuffer=!0,y=new h.Matrix4,x=0,b=new h.PerspectiveCamera,_=new h.Plane,w=new h.Vector3,S=new h.Vector3,M=new h.Vector3,T=new h.Matrix4,E=new h.Vector3,C=new h.Vector4,L=new h.Vector3,R=new h.Vector3,A=new h.Vector3,P=new h.Vector4,(I=n.mesh=new h.Mesh(new h.PlaneBufferGeometry(30,30),new h.ShaderMaterial({uniforms:u({u_infoTexture:{value:p},u_maskTexture:{value:f},u_textureMatrix:{value:y},u_textureSize:{value:v},u_mipmapTextureSize:{value:m.textureSize},u_mipmapTexture:{value:g.texture},u_noiseTime:{value:0},u_maskChannelMixer:{value:new h.Vector3}},s.sharedUniforms),vertexShader:d(["#define GLSLIFY 1\nuniform mat4 u_textureMatrix;\n\nvarying vec2 v_maskUv;\nvarying vec2 v_uv;\nvarying vec2 v_uv2;\nvarying vec4 v_reflectionTextureUv;\n\n#include <glPositionOffset>\n\nvoid main () {\n\tv_maskUv = vec2(uv.x, 1.0 - uv.y);\n\tv_uv = uv * 6.0;\n\tv_uv2 = uv * 3.0 + 0.421;\n\tv_reflectionTextureUv = u_textureMatrix * vec4( position, 1.0 );
10\n\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\n gl_Position = projectionMatrix * mvPosition;\n\t// gl_Position = glPositionOffset(gl_Position);\n}"]),fragmentShader:d(["#define GLSLIFY 1\nuniform sampler2D u_infoTexture;\nuniform sampler2D u_maskTexture;\nuniform vec3 u_maskChannelMixer;\n\nuniform sampler2D u_mipmapTexture;\nuniform vec2 u_textureSize;\nuniform vec2 u_mipmapTextureSize;\nuniform float u_noiseTime;\n\n#include <textureSmoothstep>\n#include <textureBicubic>\n#include <lodMipmapSample>\n\nvarying vec4 v_reflectionTextureUv;\nvarying vec2 v_maskUv;\nvarying vec2 v_uv;\nvarying vec2 v_uv2;\n\nvec2 mirrored(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nvoid main () {\n\tvec2 reflectionUv = v_reflectionTextureUv.xy / v_reflectionTextureUv.w;\n vec3 color = lodMipmapSampleNearest(u_mipmapTexture, reflectionUv, 0.0, u_textureSize, u_mipmapTextureSize).rgb;\n\tfloat lodMask = dot(u_maskChannelMixer, texture2D(u_maskTexture, v_maskUv).rgb);\n\n\tvec3 info;\n\tvec3 blury;\n\t#ifdef IS_MOBILE\n\tinfo = texture2D(u_infoTexture, v_uv).rgb * lodMask;\n blury = lodMipmapSampleSmoothstep(u_mipmapTexture, reflectionUv + info.br / 128.0, info.r * info.g * 6.5, u_textureSize, u_mipmapTextureSize).rgb;\n\tcolor = mix(color, blury, clamp((info.g - 0.25) * 5.0, 0.0, 1.0));\n\t\n\tinfo = texture2D(u_infoTexture, v_uv2).rgb * lodMask;\n blury = lodMipmapSampleSmoothstep(u_mipmapTexture, reflectionUv, info.r * 3.5, u_textureSize, u_mipmapTextureSize).rgb;\n\tcolor = mix(color, blury, clamp((info.b - 0.3) * 7.0, 0.0, 1.0));\n\t#else\n\tinfo = texture2D(u_infoTexture, v_uv).rgb * lodMask;\n blury = lodMipmapSampleCubic(u_mipmapTexture, reflectionUv + info.br / 128.0, info.r * info.g * 9.0, u_textureSize, u_mipmapTextureSize).rgb;\n\tcolor = mix(color, blury, clamp((info.g - 0.25) * 5.0, 0.0, 1.0));\n\t\n\tinfo = texture2D(u_infoTexture, v_uv2).rgb * lodMask;\n blury = lodMipmapSampleCubic(u_mipmapTexture, reflectionUv, info.r * 5.0, u_textureSize, u_mipmapTextureSize).rgb;\n\tcolor = mix(color, blury, clamp((info.b - 0.3) * 7.0, 0.0, 1.0));\n\t#endif\n\n\tgl_FragColor = vec4(color * mix(0.6, 0.75, info.g), 1.0);\n}"])}))).name="floor",I.userData.skipReflection=!0,(r.isMobile||r.isOculusBrowser)&&(I.material.defines.IS_MOBILE=!0);I.rotation.x=-.5*Math.PI,I.position.set(10,-.001,10),I.onBeforeRender=O},n.resize=function(e,t){if(!v)return;var n=r.isMobile?.5:1;e=2*Math.ceil(e*n/2),t=2*Math.ceil(t*n/2),t=c.powerTwoFloor(t),o.renderer.xr.isPresenting&&(e=2*Math.ceil(e/4));v.set(e,t),g.setSize(1.5*v.x,v.y),m.resize(v.x,v.y,g.width,g.height)};var p,f,m,v,g,y,x,b,_,w,S,M,T,E,C,L,R,A,P,I=n.mesh=null;function O(e,t,n){if(v){if("recursion"in n.userData){if(n.userData.recursion===recursion)return;n.userData.recursion++}if(S.setFromMatrixPosition(I.matrixWorld),M.setFromMatrixPosition(n.matrixWorld),T.extractRotation(I.matrixWorld),w.set(0,0,1),w.applyMatrix4(T),R.subVectors(S,M),!(R.dot(w)>0)){R.reflect(w).negate(),R.add(S),T.extractRotation(n.matrixWorld),E.set(0,0,-1),E.applyMatrix4(T),E.add(M),A.subVectors(S,E),A.reflect(w).negate(),A.add(S),b.position.copy(R),b.up.set(0,1,0),b.up.applyMatrix4(T),b.up.reflect(w),b.lookAt(A),b.near=n.near,b.far=n.far,b.updateMatrixWorld(),b.projectionMatrix.copy(n.projectionMatrix),y.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),y.multiply(b.projectionMatrix),y.multiply(b.matrixWorldInverse),y.multiply(I.matrixWorld),_.setFromNormalAndCoplanarPoint(w,S),_.applyMatrix4(b.matrixWorldInverse),C.set(_.normal.x,_.normal.y,_.normal.z,_.constant);var r=b.projectionMatrix;P.x=(Math.sign(C.x)+r.elements[8])/r.elements[0],P.y=(Math.sign(C.y)+r.elements[9])/r.elements[5],P.z=-1,P.w=(1+r.elements[10])/r.elements[14],C.multiplyScalar(2/C.dot(P)),r.elements[2]=C.x,r.elements[6]=C.y,r.elements[10]=C.z+1-x,r.elements[14]=C.w,L.setFromMatrixPosition(n.matrixWorld);var i=e.getRenderTarget(),a=e.xr.enabled,s=e.shadowMap.autoUpdate;e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,e.setRenderTarget(g),e.setViewport(0,0,v.x,v.y),o.renderer.xr.isPresenting?(e.setScissor(0,0,o.width,o.height),e.setScissorTest(!1)):(e.setScissor(0,0,v.x,v.y),e.setScissorTest(!0)),o.scene.traverse(D),e.render(t,b),e.setRenderTarget(null),e.setViewport(0,0,o.width,o.height),o.renderer.xr.isPresenting||e.setScissor(0,0,o.width,o.height),m.render(g),e.xr.enabled=a,e.shadowMap.autoUpdate=s,e.setRenderTarget(i);var l=n.viewport;void 0!==l&&e.state.viewport(l),o.scene.traverse(N),I.material.uniforms.u_noiseTime.value+=.01,I.material.uniforms.u_maskChannelMixer.value.set("nothing"===o.modelId,"person"===o.modelId,"car"===o.modelId)}}}function D(e){e.userData.skipReflection&&(e.userData.isVisible=e.visible,e.visible=!1)}function N(e){e.userData.skipReflection&&(e.visible=e.userData.isVisible)}},{"../../core/browser":88,"../../core/properties":90,"../../core/settings":91,"../../effects/glPositionOffset/glPositionOffset":95,"../../effects/mipmapper/Mipmapper":96,"../../helpers/fboHelper":97,"../../utils/math":165,glslify:30,"mout/object/mixIn":54,three:79}],168:[function(e,t,n){"use strict";var r=e("../../core/browser"),i=e("../../core/settings"),o=e("../../core/properties"),a=e("../../effects/glPositionOffset/glPositionOffset"),s=e("../screen/screen"),l=e("../visual"),c=e("mout/object/mixIn"),u=e("three"),h=e("glslify");n.preInit=function(){if(n.hasStartedLoad)return;n.hasStartedLoad=!0,o.loader[o.hasInitialized?"load":"add"](i.MODEL_PATH+"person.buf",{weight:136,onLoad:g}),(f=new u.Texture(o.loader[o.hasInitialized?"load":"add"](i.TEXTURE_PATH+"person.jpg",{weight:246,onLoad:function(){setTimeout((function(){f.needsUpdate=!0,f.isReady=!0}),4)}}).content)).generateMipmaps=!1,f.magFilter=f.minFilter=u.LinearFilter},n.update=function(){d&&f&&f.isReady&&(v||function(){if(!d||!f||!f.isReady)return;(p=new u.MeshStandardMaterial({roughness:.05,metalness:.025})).type="ShaderMaterial",p.uniforms=c({u_infoTexture:{value:f}},u.UniformsUtils.merge([u.ShaderLib.standard.uniforms]),a.sharedUniforms,s.sharedUniforms),p.vertexShader=h(["#define GLSLIFY 1\n#define STANDARD\n\nvarying vec2 v_uv;\n\n#include <glPositionOffset>\n\n#include <textureSmoothstep>
10\n#include <textureBicubic>\n#include <lodMipmapSample>\n\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;\nvarying vec3 v_baseColor;\n\nuniform vec2 u_screenTextureSize;\nuniform vec2 u_screenMipmapTextureSize;\nuniform vec3 u_screenPosition;\nuniform sampler2D u_areaLightCookies[1];\n\nvoid main () {\n\tvNormal = normalize( normalMatrix * normal );\n\tvec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\tvViewPosition = - mvPosition.xyz;\n\n\tvec3 worldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n\tvec3 delta = (worldPosition - u_screenPosition) / 50.0;\n\tv_baseColor = lodMipmapSampleNearestCubic(u_areaLightCookies[0], clamp(vec2(0.5, 0.5) + delta.xy, vec2(0.0), vec2(1.0)), 3.0 + abs(delta.z / 10.0), u_screenTextureSize, u_screenMipmapTextureSize).rgb;\n\n\tv_uv = uv;\n\tgl_Position = projectionMatrix * mvPosition;\n\tgl_Position = glPositionOffset(gl_Position);\n}"]),p.fragmentShader=h(["#define GLSLIFY 1\n#define STANDARD\n\n#include <textureSmoothstep>\n#include <textureBicubic>\n#include <lodMipmapSample>\n\nuniform vec2 u_screenTextureSize;\nuniform vec2 u_screenMipmapTextureSize;\n\nuniform sampler2D u_infoTexture;\n\nvarying vec2 v_uv;\nvarying vec3 v_baseColor;\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;\n\n#include <common>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n\nvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec2 normalScale, vec3 mapN ) {\n\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See vec4(0.6,0.6,0.5333333333333333,0.5333333333333333)\n\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\tvec2 st0 = dFdx( v_uv );\n\tvec2 st1 = dFdy( v_uv );\n\n\tmapN.xy *= normalScale;\n\n\t// solve the linear system\n\tvec3 dp2perp = cross( q1, surf_norm );\n\tvec3 dp1perp = cross( surf_norm, q0 );\n\tvec3 T = dp2perp * st0.x + dp1perp * st1.x;\n\tvec3 B = dp2perp * st0.y + dp1perp * st1.y;\n\n\t// construct a scale-invariant frame\n\tfloat invmax = 1.0 / sqrt( max( dot(T,T), dot(B,B) ) );\n\tmat3 tsn = mat3( T * invmax, B * invmax, surf_norm );\n\treturn normalize( tsn * mapN );\n}\n\nvoid main () {\n\tvec3 infoColor = texture2D(u_infoTexture, v_uv).rgb;\n\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\n\tfloat roughnessFactor = roughness;\n\tfloat metalnessFactor = metalness;\n\n\tvec3 mapN = vec3(infoColor.xy, 1.0) * 2.0 - 1.0;\n\tmapN.z = sqrt(1.0 - min(1.0, mapN.x * mapN.x + mapN.y * mapN.y));\n\tvec3 normal = normalize(vNormal);\n\tnormal = perturbNormal2Arb( -vViewPosition, normal, vec2(1.0, -1.0), normalize(mapN));\n\tvec3 geometryNormal = normal;\n\n\t// accumulation\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\n\t// modulation\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\tgl_FragColor = vec4( max(outgoingLight * infoColor.b * 0.45, infoColor.bbb * 0.1 * v_baseColor), diffuseColor.a );\n}"]),r.isMobile&&(p.defines.IS_MOBILE=!0);m=n.container=new u.Mesh(d,p),l.container.add(m),v=!0}(),m.visible="person"==o.modelId)},n.hasStartedLoad=!1;var d,p,f,m=n.container=null,v=!1;function g(e){d=e}},{"../../core/browser":88,"../../core/properties":90,"../../core/settings":91,"../../effects/glPositionOffset/glPositionOffset":95,"../screen/screen":169,"../visual":174,glslify:30,"mout/object/mixIn":54,three:79}],169:[function(e,t,n){"use strict";var r=e("../../core/settings"),i=(e("../../core/properties"),e("../../helpers/fboHelper"),e("./screenShader")),o=e("./screenLight"),a=e("./screenMesh"),s=e("three");n.preInit=function(){c=n.container=new s.Object3D},n.init=function(){i.init(),o.init(),c.add(o.light),o.light.position.set(4,3.5,-2),o.light.updateMatrixWorld(!0),a.init(),c.add(a.container),a.container.position.set(4,3.5,-1.45),a.container.scale.set(r.SCREEN_SIZE,r.SCREEN_SIZE,1),l.u_screenPosition.value=o.light.position},n.update=function(e){i.update(e),a.update(e)};var l=n.sharedUniforms={u_screenPosition:{value:null}},c=n.container=null},{"../../core/properties":90,"../../core/settings":91,"../../helpers/fboHelper":97,"./screenLight":170,"./screenMesh":171,"./screenShader":172,three:79}],170:[function(e,t,n){"use strict";var r=e("../../core/settings"),i=e("three");n.init=function(){(n.light=new i.RectAreaLight(16777215,10,r.SCREEN_SIZE,r.SCREEN_SIZE)).rotation.y=Math.PI};n.light=null},{"../../core/settings":91,three:79}],171:[function(e,t,n){"use strict";var r=e("../../core/browser"),i=e("../../core/settings"),o=e("../../core/properties"),a=e("../../effects/glPositionOffset/glPositionOffset"),s=e("./screen"),l=e("../../utils/math"),c=e("mout/object/mixIn"),u=e("three"),h=e("glslify");n.init=function(){f=n.container=new u.Object3D,function(){for(var e=i.SCREEN_SEGMENTS,t=i.SCREEN_SEGMENTS+2,n=t-1,r=new Float32Array(t*t*3),o=new Float32Array(t*t*2),a=new Uint32Array(n*n*6),s=0,c=0,h=0;s<t;s++){var p=(l.clamp(s-1,0,e)+.5)/(e+1),f=l.clamp(s-1,0,e)/e-.5,m=!1;0==s||s==t-1?m=!0:p=p;for(var v=0;v<t;v++){var g=(l.clamp(v-1,0,e)+.5)/(e+1),y=l.clamp(v-1,0,e)/e-.5,x=!1;0==v||v==t-1?x=!0:g=g,r[h+0]=y,r[h+1]=f,r[h+2]=x||m,o[c+0]=g,o[c+1]=p,c+=2,h+=3}}for(var b=0,_=0;b<n;b++)for(var w=0;w<n;w++){var S=w+t*b,M=w+t*(b+1),T=w+1+t*(b+1),E=w+1+t*b;
10a[_+0]=S,a[_+1]=E,a[_+2]=M,a[_+3]=M,a[_+4]=E,a[_+5]=T,_+=6}(d=new u.BufferGeometry).setAttribute("position",new u.BufferAttribute(r,3)),d.setAttribute("uv",new u.BufferAttribute(o,2)),d.setIndex(new u.BufferAttribute(a,1))}(),p=new u.ShaderMaterial({uniforms:c({u_resolution:o.sharedUniforms.u_resolution},s.sharedUniforms,a.sharedUniforms),vertexShader:h(["#define GLSLIFY 1\nuniform sampler2D u_screenTexture;\nuniform vec2 u_screenTextureSize;\nuniform vec2 u_resolution;\n\nvarying vec2 v_uv;\n\n#include <glPositionOffset>\n\nvoid main () {\n\tfloat isEdge = step(0.5, position.z);\n\n\tvec2 texCoord = clamp(uv * u_screenTextureSize, vec2(0.5), vec2(u_screenTextureSize - 0.5)) + u_glPositionOffset * u_resolution * 0.5;\n\n\tvec4 screenInfo = texture2D(u_screenTexture, texCoord / u_screenTextureSize * vec2(0.66666, 1.0));\n\tvec3 pos = vec3(position.xy, screenInfo.a * 2.0);\n\n\tv_uv = uv * vec2(0.66666, 1.0);\n\n\tpos.z *= (1.0 - isEdge);\n\tpos.z -= 0.5;\n\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n\tgl_Position = glPositionOffset(gl_Position);\n}"]),fragmentShader:h(["#define GLSLIFY 1\nuniform sampler2D u_screenTexture;\nvarying vec2 v_uv;\n\nvoid main () {\n\tgl_FragColor = texture2D(u_screenTexture, v_uv);\n}"])}),r.isMobile||r.isOculusBrowser||(p.defines.IS_HD=!0);p.extensions.derivatives=!0,m=n.mesh=new u.Mesh(d,p),f.add(m),(v=n.hitTestMesh=new u.Mesh(new u.PlaneBufferGeometry(1,1))).name="screenMesh",v.visible=!1,f.add(v)},n.resize=function(e,t){},n.update=function(e){};var d,p,f=n.container=null,m=n.mesh=null,v=n.hitTestMesh=null},{"../../core/browser":88,"../../core/properties":90,"../../core/settings":91,"../../effects/glPositionOffset/glPositionOffset":95,"../../utils/math":165,"./screen":169,glslify:30,"mout/object/mixIn":54,three:79}],172:[function(e,t,n){"use strict";var r=e("../../core/settings"),i=e("../../core/browser"),o=e("../../core/properties"),a=e("./screen"),s=e("./screenLight"),l=e("../../helpers/fboHelper"),c=e("../../shaders/shaders"),u=e("../../effects/blueNoise/blueNoise"),h=e("../../io/exporter"),d=e("../../effects/mipmapper/Mipmapper"),p=e("../../controls/cameraControls"),f=e("../../utils/math"),m=e("mout/object/mixIn"),v=e("three"),g=e("glslify");n.preInitTester=Y,n.init=function(){Y(),C=l.createRenderTarget(r.SCREEN_RESOLUTION,r.SCREEN_RESOLUTION,!0),A=l.createRenderTarget(r.SCREEN_RESOLUTION,r.SCREEN_RESOLUTION),L=l.createRenderTarget(r.SCREEN_RESOLUTION,r.SCREEN_RESOLUTION/2,!0),R=L.clone(),y=new d,_=new v.Vector2(r.SCREEN_RESOLUTION,r.SCREEN_RESOLUTION),x=l.createRenderTarget(1.5*_.x,_.y,!0),y.resize(_.x,_.y,x.width,x.height),z=new v.Matrix4,G=new v.Euler(0,Math.PI,0),H=new v.Quaternion,U=new v.Vector3,k=new v.Vector2(2*r.SCREEN_RESOLUTION,2*r.SCREEN_RESOLUTION),D=new v.Raycaster,N=new v.Plane(new v.Vector3(0,0,1),2),v.ShaderLib.standard.uniforms.u_areaLightCookies={value:[x.texture]},v.ShaderLib.physical.uniforms.u_areaLightCookies={value:[x.texture]},j.u_screenTextureSize={value:_},j.u_scree={value:y.textureSize},j.u_screenMipmapTextureSize={value:y.textureSize},j.u_maxScreenMipLevel={value:f.powerTwoFloorBase(r.SCREEN_RESOLUTION)-1},j.u_screenNoiseTexture={value:C.texture},j.u_screenNormalAOTexture={value:A.texture},j.u_screenTexture={value:x.texture},m(a.sharedUniforms,j),(S=new v.RawShaderMaterial({uniforms:M.uniforms,vertexShader:M.vertexShader,fragmentShader:"",depthTest:!1,depthWrite:!1,blending:v.NoBlending,transparent:!0})).extensions.derivatives=!0,T=new v.RawShaderMaterial({uniforms:{iResolution:S.uniforms.iResolution,u_oddTexture:{value:L.texture},u_evenTexture:{value:R.texture}},vertexShader:l.vertexShader,fragmentShader:l.precisionPrefix+g(["#define GLSLIFY 1\nuniform sampler2D u_oddTexture;\nuniform sampler2D u_evenTexture;\nuniform vec2 iResolution;\n\nvarying vec2 v_uv;\n\nvoid main () {\n\tvec2 uv = vec2(\n\t\tv_uv.x,\n\t\t(floor(gl_FragCoord.y * 0.5) + 0.5) / (iResolution.y * 0.5)\n\t);\n\n\tgl_FragColor = mix(\n\t\ttexture2D(u_evenTexture, uv),\n\t\ttexture2D(u_oddTexture, uv),\n\t\tstep(1.0, mod(gl_FragCoord.y, 2.0))\n\t);\n}"]),depthTest:!1,depthWrite:!1,blending:v.NoBlending,transparent:!0}),(w=new v.RawShaderMaterial({uniforms:m({u_screenAOSampleRange:{value:.1},u_screenHeightScale:{value:.1},u_noiseOffset:{value:new v.Vector2}},j,u.sharedUniforms),vertexShader:l.vertexShader,fragmentShader:l.precisionPrefix+g(["#define GLSLIFY 1\nuniform vec2 u_screenTextureSize;\nuniform vec2 u_noiseOffset;\nuniform sampler2D u_screenNoiseTexture;\nuniform float u_screenHeightScale;\nuniform float u_screenAOSampleRange;\n\nvarying vec2 v_uv;\n\nconst float PI2 = 6.2831853;\n\n// https://github.com/mrdoob/three.js/blob/ecb116f6af0a63558b707369f15d680a59ba736d/examples/webgl_shadowmap_pcss.html\nvec2 poissonDisk[SAMEPLE_COUNT];\n\nvoid initPoissonSamples(float noise) {\n\tfloat ANGLE_STEP = PI2 * 4.0 / float( SAMEPLE_COUNT );\n\tfloat INV_SAMEPLE_COUNT = 1.0 / float( SAMEPLE_COUNT );\n\tfloat angle = noise * PI2;\n\tfloat radius = INV_SAMEPLE_COUNT;
10\n\tfloat radiusStep = radius;\n\tfor( int i = 0; i < SAMEPLE_COUNT; i ++ ) {\n\t\tpoissonDisk[i] = vec2( cos( angle ), sin( angle ) ) * pow( radius, 0.75 );\n\t\tradius += radiusStep;\n\t\tangle += ANGLE_STEP;\n\t}\n}\n\nfloat hash12(vec2 p) {\n\tvec3 p3 = fract(vec3(p.xyx) * .1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nvoid main () {\n\tfloat center = texture2D(u_screenNoiseTexture, v_uv).a;\n\tvec2 texelSize = 1.0 / u_screenTextureSize;\n\tvec3 dX = vec3(texelSize.x * 2.0, 0.0, (\n\t\t\ttexture2D(u_screenNoiseTexture, v_uv + vec2(texelSize.x, 0.0)).a -\n\t\t\ttexture2D(u_screenNoiseTexture, v_uv - vec2(texelSize.x, 0.0)).a\n\t\t) * u_screenHeightScale\n\t);\n\tvec3 dY = vec3(0.0, texelSize.y * 2.0, (\n\t\t\ttexture2D(u_screenNoiseTexture, v_uv + vec2(0.0, texelSize.y)).a -\n\t\t\ttexture2D(u_screenNoiseTexture, v_uv - vec2(0.0, texelSize.y)).a\n\t\t) * u_screenHeightScale\n\t);\n\n\tvec3 n = normalize(cross(dX, dY)) * 0.5 + 0.5;\n\tinitPoissonSamples(hash12((v_uv + u_noiseOffset) * 100.0));\n\n\tfloat sum = 0.0;\n\tfor( int i = 0; i < SAMEPLE_COUNT; i ++ ) {\n\t\tvec2 offset = poissonDisk[i] * u_screenAOSampleRange;\n\t\tfloat r = texture2D(u_screenNoiseTexture, v_uv + offset).a;\n\t\tsum += max(0.0, r - center);\n\t}\n\tfloat ao = 1.0 - sum / float(SAMEPLE_COUNT);\n\n\tgl_FragColor = vec4(\n\t\tn.x,\n\t\tn.y,\n\t\tao * ao * ao,\n\t\t1.0\n\t);\n}"]),depthTest:!1,depthWrite:!1,blending:v.NoBlending,transparent:!0})).defines.SAMEPLE_COUNT=24,b=new v.RawShaderMaterial({uniforms:m({},j),vertexShader:l.vertexShader,fragmentShader:l.precisionPrefix+g(["#define GLSLIFY 1\nuniform sampler2D u_screenNoiseTexture;\nuniform sampler2D u_screenNormalAOTexture;\n\n// uniform float u_screenUseCustomColor;\n\nvarying vec2 v_uv;\n\nvoid main () {\n\tvec4 screenInfo = texture2D(u_screenNoiseTexture, v_uv);\n\tvec3 shade = texture2D(u_screenNormalAOTexture, v_uv).rgb;\n\tvec3 n = vec3(shade.rg * 2.0 - 1.0, 0.0);\n\tn.z = sqrt(1.0 - n.x * n.x - n.y * n.y);\n\n\tvec3 color = mix(mix(vec3(0.050980392156862744,0.2196078431372549,0.24313725490196078), vec3(0.9019607843137255,0.9686274509803922,0.9803921568627451), shade.b), screenInfo.rgb * (0.3 + 0.7 * shade.b), 1.0);\n\tfloat f = max(dot(n, vec3(0.5774)), 0.0);\n\tcolor *= mix(0.75, 1.0, f * f * 0.3 + f * 0.7);\n\t\n\tgl_FragColor = vec4(color, screenInfo.a);\n}"]),depthTest:!1,depthWrite:!1,blending:v.NoBlending,transparent:!0}),p.modes.splines.onAnimationStarted.add(K),o.isView?Z(o.currentSketch.shader):Z(c.infos[o.templateShaderId].shader);h.onBeforeRender.add(J)},n.changeShader=Z,n.testShader=function(e){var t=l.renderer.xr.enabled;l.renderer.xr.enabled=!1;var n=W.replace(V,e);M.fragmentShader=n,M.userData.originalShader=e,M.needsUpdate=!0;var r=l.getColorState();l.render(M,E),l.getColorState(r);for(var i=l.renderer.info.programs,o=!0,a=0,s=i.length;a<s;a++){var c=i[a].diagnostics;if(void 0!==c&&c.material===M){if(!c.runnable)return o=!1,l.renderer.xr.enabled=t,c;break}}if(l.renderer.xr.enabled=t,o)return!1},n.update=function(e){if(h.isExporting)return;o.shaderTime+=e*o.shaderTimeMultiplier,S.uniforms.iTime.value=o.shaderTime,S.uniforms.iTimeDelta.value=e,S.uniforms.iFrame.value=o.shaderFrame++,S.uniforms.iFrameRate.value=1/e;var t=new Date;O.set(t.getFullYear(),t.getMonth(),t.getDate(),3600*t.getHours()+60*t.getMinutes()+t.getSeconds()+t.getMilliseconds()/1e3),H.setFromEuler(G),z.makeRotationFromQuaternion(H).premultiply(s.light.matrixWorld);var n=o.camera.matrixWorld;o.renderer.xr.isPresenting&&(n=o.renderer.xr.getCamera(o.camera).matrixWorld);z.getInverse(z).multiply(n),z.decompose(B,H,U),F.set(H.x,H.y,H.z,H.w),o.isMouseDown&&(D.setFromCamera(o.mouse,o.camera),D.ray.intersectPlane(N,U),I.x=(U.x+3-4)/6*r.SCREEN_RESOLUTION,I.y=(U.y+3-3.5)/6*r.SCREEN_RESOLUTION);o.hasMouseJustDown?(D.setFromCamera(o.mouseDown,o.camera),D.ray.intersectPlane(N,U),I.z=k.x=(U.x+3-4)/6*r.SCREEN_RESOLUTION,I.w=k.y=(U.y+3-3.5)/6*r.SCREEN_RESOLUTION):o.isMouseDown?(I.z=k.x,I.w=k.y):(I.z=2*r.SCREEN_RESOLUTION-I.x,I.w=2*r.SCREEN_RESOLUTION-I.y);o.isSelectDown&&(I.x=(o.rayOnScreenIntersection.x+3-4)/6*r.SCREEN_RESOLUTION,I.y=(o.rayOnScreenIntersection.y+3-3.5)/6*r.SCREEN_RESOLUTION);o.hasSelectJustDown?(I.z=k.x=(o.rayOnScreenIntersection.x+3-4)/6*r.SCREEN_RESOLUTION,I.w=k.y=(o.rayOnScreenIntersection.y+3-3.5)/6*r.SCREEN_RESOLUTION):o.isSelectDown?(I.z=k.x,I.w=k.y):(I.z=2*r.SCREEN_RESOLUTION-I.x,I.w=2*r.SCREEN_RESOLUTION-I.y);Q()},n.shaderLineStart=-1;var y,x,b,_,w,S,M,T,E,C,L,R,A,P,I,O,D,N,k,z,B,F,G,H,U,W,V="/*ADD_GET_NOISE_SHADER*/",j={},X=!1,q=!0;function Y(){if(!W){var e=(r.USE_WEBGL2?l.precisionPrefix2:l.precisionPrefix)+"#define HW_PERFORMANCE "+(i.isMobile||i.isOculusBrowser?"0":"1")+"\n";W=e+g(["#define IS_CINESHADER\n#ifdef IS_WEBGL2\nout highp vec4 pc_fragColor;\n#define gl_FragColor pc_fragColor\nuniform int iFrame;\n#else\nprecision highp float;\n#define GLSLIFY 1\n#endif\n\nuniform vec3 iResolution;\nuniform float iTime;\nuniform float iTimeDelta;\n\nuniform float iFrameRate;\nuniform vec4 iMouse;\nuniform vec4 iDate;\n\nuniform vec3 iCamPos;\nuniform vec4 iCamQuat;\nuniform vec3 iScreenSize;\n\nuniform vec2 u_interlaceParams;\nuniform vec2 u_aaOffset;\n\n/*ADD_GET_NOISE_SHADER*/\n\nvoid main () {\n\tgl_FragColor = vec4(0.1);\n\n\tvec2 fragCoord = vec2(\n\t\tgl_FragCoord.x,\n\t\tfloor(gl_FragCoord.y) * u_interlaceParams.x + u_interlaceParams.y\n\t) + u_aaOffset;\n\n\tmainImage(gl_FragColor, fragCoord);\n}\n"]),n.shaderLineStart=W.split(V)[0].split(/\r\n|\r|\n/).length,E=l.createRenderTarget(1,1,!0),(M=new v.RawShaderMaterial({uniforms:{iResolution:{value:new v.Vector3(r.SCREEN_RESOLUTION,r.SCREEN_RESOLUTION,1)},iTime:{value:0},iTimeDelta:{value:0},iFrame:{value:0},iFrameRate:{value:0},iMouse:{value:I=new v.Vector4(0,0,2*-r.SCREEN_RESOLUTION,2*-r.SCREEN_RESOLUTION)},iDate:{value:O=new v.Vector4},iCamPos:{value:B=new v.Vector3},iCamQuat:{value:F=new v.Vector4},iScreenSize:{value:new v.Vector3(r.SCREEN_SIZE,r.SCREEN_SIZE,2)},u_interlaceParams:{value:new v.Vector2(1,.5)},u_aaOffset:{value:new v.Vector2(1,.5)}},vertexShader:e+g(["#define GLSLIFY 1\n#ifdef IS_WEBGL2\nin vec3 position;\n#else\nattribute vec3 position;\n#endif\n\nvoid main() {\n gl_Position = vec4(position, 1.0 );\n}\n"]),fragmentShader:"",depthTest:!1,depthWrite:!1,blending:v.NoBlending,transparent:!0})).extensions.derivatives=!0}}function K(e){"splines"!==p.pendingId||"splines"!==p.currId||o.isView||o.renderer.xr.isPresenting||Z(c.splineShaderList[e%c.splineShaderList.length].shader)}function Z(e){if(P!==e&&void 0!==e){var t=l.renderer.xr.enabled;l.renderer.xr.enabled=!1,P=e;var n=W.replace(V,e.replaceAll(/precision\s(\S+)\s(\S+)/g,""));M.fragmentShader=n,M.userData.originalShader=e,M.needsUpdate=!0;var r=l.getColorState();l.render(M,E),l.getColorState(r);for(var i=l.renderer.info.programs,a=!0,s=0,c=i.length;s<c;s++){var u=i[s].diagnostics;if(void 0!==u&&u.material===M){u.runnable||(a=!1,o.onShaderCompiled.dispatch(!1,u));break}}if(a){var h=S;S=M,M=h,o.currentSketch&&o.isEditor&&(o.currentSketch.shader=e),o.onShaderCompiled.dispatch(!0)}l.renderer.xr.enabled=t}}function J(e,t){M.uniforms.u_aaOffset.value.set(.5*t.x,.5*t.y),Q(),M.uniforms.u_aaOffset.value.set(0,0)}function Q(){var e=o.useInterlacing||o.viewQuality<3,t=o.renderer.xr;t.enabled&&t.isPresenting&&(e=!1);var n=l.renderer,r=l.getColorState(),i=t.enabled;t.enabled=!1,n.autoClear=!1,n.shadowMap.autoUpdate=!1,e?((q=!q)?(S.uniforms.u_interlaceParams.value.set(2,.5),l.render(S,R)):(S.uniforms.u_interlaceParams.value.set(2,1.5),l.render(S,L)),X||(q?l.copy(R.texture,L):l.copy(L.texture,R)),l.render(T,C)):(S.uniforms.u_interlaceParams.value.set(1,.5),l.render(S,C)),w.uniforms.u_noiseOffset.value.set(Math.random(),Math.random()),l.render(w,A),n.setRenderTarget(x),n.setVie
10wport(0,0,_.x,_.y),o.renderer.xr.isPresenting?(n.setScissor(0,0,o.width,o.height),n.setScissorTest(!1)):(n.setScissor(0,0,_.x,_.y),n.setScissorTest(!0)),l.render(b),n.setRenderTarget(null),n.setViewport(0,0,o.width,o.height),o.renderer.xr.isPresenting||n.setScissor(0,0,o.width,o.height),y.render(x),t.enabled=i,l.setColorState(r),X=e}},{"../../controls/cameraControls":86,"../../core/browser":88,"../../core/properties":90,"../../core/settings":91,"../../effects/blueNoise/blueNoise":93,"../../effects/mipmapper/Mipmapper":96,"../../helpers/fboHelper":97,"../../io/exporter":103,"../../shaders/shaders":128,"../../utils/math":165,"./screen":169,"./screenLight":170,glslify:30,"mout/object/mixIn":54,three:79}],173:[function(e,t,n){"use strict";var r=e("../../core/browser"),i=e("../../core/settings"),o=e("../../core/properties"),a=e("../../effects/glPositionOffset/glPositionOffset"),s=e("../screen/screen"),l=e("mout/object/mixIn"),c=e("three"),u=e("glslify");n.preInit=function(){o.loader.add(i.MODEL_PATH+"stage.buf",{weight:870,onLoad:b}),o.loader.add(i.MODEL_PATH+"stage_screen_edges.buf",{weight:2,onLoad:_}),(g=new c.Texture(o.loader.add(i.TEXTURE_PATH+"stage.jpg",{weight:565,onLoad:function(){g.needsUpdate=!0}}).content)).generateMipmaps=!1,g.magFilter=g.minFilter=c.LinearFilter},n.init=function(){x=n.container=new c.Object3D,(d=new c.MeshStandardMaterial({roughness:.35,metalness:.18})).type="ShaderMaterial",d.uniforms=l({u_infoTexture:{value:g}},c.UniformsUtils.merge([c.ShaderLib.standard.uniforms]),a.sharedUniforms,s.sharedUniforms),d.vertexShader=u(["#define GLSLIFY 1\nattribute float r;\n\n#ifdef USE_AREA_LIGHT\n\t#define STANDARD\n\tvarying vec3 vViewPosition;\n\tvarying vec3 vNormal;\n#else\n\tvarying vec3 v_worldNormal;\n\tvarying vec3 v_worldToCamera;\n#endif\n\n#ifdef IS_EDGES\n\tvarying vec4 v_edgeInfos;\n#endif\n\nvarying vec3 v_worldPosition;\n\n#include <glPositionOffset>\nvarying vec2 v_uv;\nvarying float v_r;\n\nvoid main () {\n\tv_r = r;\n\n\t#ifdef IS_EDGES\n\t\tvec2 edgeSampleUv = vec2(\n\t\t\t(position.x - 1.0) / 6.0,\n\t\t\t(position.y - 0.5) / 6.0\n\t\t);\n\t\tv_edgeInfos = vec4(\n\t\t\tedgeSampleUv, // uv\n\t\t\t(position.z + 1.5) * 2.0,\n\t\t\tnormal.z\n\t\t);\n\t#endif\n\n\tv_worldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n\n\tvec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\t#ifdef USE_AREA_LIGHT\n\t\tvNormal = normalize( normalMatrix * normal );\n\t\tvViewPosition = -mvPosition.xyz;\n\t#else\n\tv_worldNormal = (modelMatrix * vec4(position + normal, 1.0)).xyz - v_worldPosition;\n\tv_worldToCamera = v_worldPosition - cameraPosition;\n\t#endif\n\n\tv_uv = uv;\n\tgl_Position = projectionMatrix * mvPosition;\n\tgl_Position = glPositionOffset(gl_Position);\n\n}"]),d.fragmentShader=u(["#define GLSLIFY 1\n#define STANDARD\n\n#include <textureSmoothstep>\n#include <textureBicubic>\n#include <lodMipmapSample>\n\nuniform vec2 u_screenTextureSize;\nuniform vec2 u_screenMipmapTextureSize;\nuniform float u_maxScreenMipLevel;\nuniform vec3 u_screenPosition;\n\nuniform sampler2D u_infoTexture;\n\nvarying vec2 v_uv;\nvarying vec3 v_baseColor;\nvarying float v_r;\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\nvarying vec3 v_worldPosition;\n#ifdef USE_AREA_LIGHT\n\tvarying vec3 vViewPosition;\n\tvarying vec3 vNormal;\n#else\n\tvarying vec3 v_worldNormal;\n\tvarying vec3 v_worldToCamera;\n#endif\n\n#ifdef IS_EDGES\nvarying vec4 v_edgeInfos;\n#endif\n\n#ifdef USE_AREA_LIGHT\n\t#include <common>\n\t#include <bsdfs>\n\t#include <lights_pars_begin>\n\t#include <lights_physical_pars_fragment>\n\t#include <logdepthbuf_pars_fragment>\n#else\n\tuniform sampler2D u_areaLightCookies[1];\n#endif\nfloat sdBox( vec3 p, vec3 b ) {\n\tvec3 q = abs(p) - b;\n\treturn length(max(q,0.0)) + min(max(q.x,max(q.y,q.z)),0.0);\n}\n\nvoid main () {\n\tvec3 infoColor = texture2D(u_infoTexture, v_uv).rgb;\n\n\tfloat roughnessFactor = 0.15 + (1.0 - v_r) * 0.25;\n\tfloat metalnessFactor = v_r * 0.3;\n\n\tvec3 delta = (v_worldPosition - u_screenPosition);\n\tfloat d = max(0.0, sdBox(delta, vec3(5.0, 5.0, 0.01)));\n\tvec3 baseColor = lodMipmapSample(u_areaLightCookies[0], clamp(vec2(0.5, 0.5) + delta.xy / 5.0, vec2(0.0), vec2(1.0)), min(1.0, 0.625 + d * d * 0.01875) * (1.0 - v_r * 0.35) * u_maxScreenMipLevel, u_screenTextureSize, u_screenMipmapTextureSize).rgb;
10\n\tbaseColor *= 1.0 - v_r * 0.3;\n\t#ifdef USE_AREA_LIGHT\n\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t\tvec3 totalEmissiveRadiance = emissive;\n\n\t\tvec3 normal = normalize( vNormal );\n\t\tvec3 geometryNormal = normal;\n\n\t\t// accumulation\n\t\t#include <lights_physical_fragment>\n\t\t#include <lights_fragment_begin>\n\t\t#include <lights_fragment_maps>\n\t\t#include <lights_fragment_end>\n\n\t\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#else\n\t\tvec3 reflectRay = reflect(normalize(v_worldToCamera), normalize(v_worldNormal));\n\t\tfloat f = smoothstep(v_r * 0.9, 1.0, dot(reflectRay, normalize(-delta))) * (0.25 + v_r * 2.0);\n\t\tfloat t = -delta.z / reflectRay.z;\n\t\tvec3 projected = delta + reflectRay * t;\n\t\tvec2 specUv = clamp(projected.xy / 5.0 + 0.5, vec2(0.0), vec2(1.0));\n\t\tfloat dd = max(0.0, sdBox(projected, vec3(5.0, 5.0, 0.01)));\n\t\tvec3 spec = lodMipmapSample(u_areaLightCookies[0], specUv, min(1.0, 0.325 + t * t * 0.025) * (1.0 - v_r * 0.15) * u_maxScreenMipLevel, u_screenTextureSize, u_screenMipmapTextureSize).rgb;\n\t\tvec3 outgoingLight = baseColor * 0.35 + spec * (0.2 + v_r) * f;\n\t#endif\n\n\t// modulation\n\n\t#ifdef IS_EDGES\n\t\tvec2 edgeSampleUv = clamp(v_edgeInfos.xy, vec2(0.0), vec2(1.0));\n\t\tfloat lodOffset = length(max(vec2(0.0), abs(v_edgeInfos.xy - 0.5) - 0.5)) * 6.0 + v_edgeInfos.z + 1.0;\n\t\tfloat ao = 1.0;\n ao *= 1.0 - lodMipmapSample(u_areaLightCookies[0], edgeSampleUv, lodOffset, u_screenTextureSize, u_screenMipmapTextureSize).a * 0.5;\n ao *= 1.0 - lodMipmapSample(u_areaLightCookies[0], edgeSampleUv, lodOffset + 1.0, u_screenTextureSize, u_screenMipmapTextureSize).a * 0.25;\n ao *= 1.0 - lodMipmapSample(u_areaLightCookies[0], edgeSampleUv, lodOffset + 2.0, u_screenTextureSize, u_screenMipmapTextureSize).a * 0.125;\n\t\t\n\t\tgl_FragColor = vec4( outgoingLight * 0.35 + 0.65 * baseColor, 1.0 ) * mix(0.4, 1.25, v_edgeInfos.w * v_edgeInfos.w) * infoColor.r * ao;\n\t#else\n\t\t#ifdef USE_AREA_LIGHT\n\t\tgl_FragColor = vec4((outgoingLight * 0.35 + 0.65 * baseColor) * infoColor.r, 1.0);\n\t\t#else\n\t\tgl_FragColor = vec4((outgoingLight * 0.35 + 0.65 * baseColor) * infoColor.r, 1.0);\n\t\t#endif\n\t#endif\n\n}"]),(p=new c.Mesh(h,d)).renderOrder=2048,x.add(p),m=new c.MeshStandardMaterial({roughness:.35,metalness:.18}),(r.isMobile||r.isOculusBrowser)&&(d.defines.IS_MOBILE=!0,m.defines.IS_MOBILE=!0);m.type="ShaderMaterial",m.uniforms=d.uniforms,m.vertexShader=u(["#define GLSLIFY 1\nattribute float r;\n\n#ifdef USE_AREA_LIGHT\n\t#define STANDARD\n\tvarying vec3 vViewPosition;\n\tvarying vec3 vNormal;\n#else\n\tvarying vec3 v_worldNormal;\n\tvarying vec3 v_worldToCamera;\n#endif\n\n#ifdef IS_EDGES\n\tvarying vec4 v_edgeInfos;\n#endif\n\nvarying vec3 v_worldPosition;\n\n#include <glPositionOffset>\nvarying vec2 v_uv;\nvarying float v_r;\n\nvoid main () {\n\tv_r = r;\n\n\t#ifdef IS_EDGES\n\t\tvec2 edgeSampleUv = vec2(\n\t\t\t(position.x - 1.0) / 6.0,\n\t\t\t(position.y - 0.5) / 6.0\n\t\t);\n\t\tv_edgeInfos = vec4(\n\t\t\tedgeSampleUv, // uv\n\t\t\t(position.z + 1.5) * 2.0,\n\t\t\tnormal.z\n\t\t);\n\t#endif\n\n\tv_worldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n\n\tvec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\t#ifdef USE_AREA_LIGHT\n\t\tvNormal = normalize( normalMatrix * normal );\n\t\tvViewPosition = -mvPosition.xyz;\n\t#else\n\tv_worldNormal = (modelMatrix * vec4(position + normal, 1.0)).xyz - v_worldPosition;\n\tv_worldToCamera = v_worldPosition - cameraPosition;\n\t#endif\n\n\tv_uv = uv;\n\tgl_Position = projectionMatrix * mvPosition;\n\tgl_Position = glPositionOffset(gl_Position);\n\n}"]),m.fragmentShader=u(["#define GLSLIFY 1\n#define STANDARD\n\n#include <textureSmoothstep>\n#include <textureBicubic>\n#include <lodMipmapSample>\n\nuniform vec2 u_screenTextureSize;\nuniform vec2 u_screenMipmapTextureSize;\nuniform float u_maxScreenMipLevel;\nuniform vec3 u_screenPosition;\n\nuniform sampler2D u_infoTexture;\n\nvarying vec2 v_uv;\nvarying vec3 v_baseColor;\nvarying float v_r;\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\nvarying vec3 v_worldPosition;\n#ifdef USE_AREA_LIGHT\n\tvarying vec3 vViewPosition;\n\tvarying vec3 vNormal;\n#else\n\tvarying vec3 v_worldNormal;\n\tvarying vec3 v_worldToCamera;\n#endif\n\n#ifdef IS_EDGES\nvarying vec4 v_edgeInfos;\n#endif\n\n#ifdef USE_AREA_LIGHT\n\t#include <common>\n\t#include <bsdfs>\n\t#include <lights_pars_begin>\n\t#include <lights_physical_pars_fragment>\n\t#include <logdepthbuf_pars_fragment>\n#else\n\tuniform sampler2D u_areaLightCookies[1];\n#endif\nfloat sdBox( vec3 p, vec3 b ) {\n\tvec3 q = abs(p) - b;\n\treturn length(max(q,0.0)) + min(max(q.x,max(q.y,q.z)),0.0);\n}\n\nvoid main () {\n\tvec3 infoColor = texture2D(u_infoTexture, v_uv).rgb;\n\n\tfloat roughnessFactor = 0.15 + (1.0 - v_r) * 0.25;\n\tfloat metalnessFactor = v_r * 0.3;\n\n\tvec3 delta = (v_worldPosition - u_screenPosition);\n\tfloat d = max(0.0, sdBox(delta, vec3(5.0, 5.0, 0.01)));\n\tvec3 baseColor = lodMipmapSample(u_areaLightCookies[0], clamp(vec2(0.5, 0.5) + delta.xy / 5.0, vec2(0.0), vec2(1.0)), min(1.0, 0.625 + d * d * 0.01875) * (1.0 - v_r * 0.35) * u_maxScreenMipLevel, u_screenTextureSize, u_screenMipmapTextureSize).rgb;
10\n\tbaseColor *= 1.0 - v_r * 0.3;\n\t#ifdef USE_AREA_LIGHT\n\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t\tvec3 totalEmissiveRadiance = emissive;\n\n\t\tvec3 normal = normalize( vNormal );\n\t\tvec3 geometryNormal = normal;\n\n\t\t// accumulation\n\t\t#include <lights_physical_fragment>\n\t\t#include <lights_fragment_begin>\n\t\t#include <lights_fragment_maps>\n\t\t#include <lights_fragment_end>\n\n\t\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#else\n\t\tvec3 reflectRay = reflect(normalize(v_worldToCamera), normalize(v_worldNormal));\n\t\tfloat f = smoothstep(v_r * 0.9, 1.0, dot(reflectRay, normalize(-delta))) * (0.25 + v_r * 2.0);\n\t\tfloat t = -delta.z / reflectRay.z;\n\t\tvec3 projected = delta + reflectRay * t;\n\t\tvec2 specUv = clamp(projected.xy / 5.0 + 0.5, vec2(0.0), vec2(1.0));\n\t\tfloat dd = max(0.0, sdBox(projected, vec3(5.0, 5.0, 0.01)));\n\t\tvec3 spec = lodMipmapSample(u_areaLightCookies[0], specUv, min(1.0, 0.325 + t * t * 0.025) * (1.0 - v_r * 0.15) * u_maxScreenMipLevel, u_screenTextureSize, u_screenMipmapTextureSize).rgb;\n\t\tvec3 outgoingLight = baseColor * 0.35 + spec * (0.2 + v_r) * f;\n\t#endif\n\n\t// modulation\n\n\t#ifdef IS_EDGES\n\t\tvec2 edgeSampleUv = clamp(v_edgeInfos.xy, vec2(0.0), vec2(1.0));\n\t\tfloat lodOffset = length(max(vec2(0.0), abs(v_edgeInfos.xy - 0.5) - 0.5)) * 6.0 + v_edgeInfos.z + 1.0;\n\t\tfloat ao = 1.0;\n ao *= 1.0 - lodMipmapSample(u_areaLightCookies[0], edgeSampleUv, lodOffset, u_screenTextureSize, u_screenMipmapTextureSize).a * 0.5;\n ao *= 1.0 - lodMipmapSample(u_areaLightCookies[0], edgeSampleUv, lodOffset + 1.0, u_screenTextureSize, u_screenMipmapTextureSize).a * 0.25;\n ao *= 1.0 - lodMipmapSample(u_areaLightCookies[0], edgeSampleUv, lodOffset + 2.0, u_screenTextureSize, u_screenMipmapTextureSize).a * 0.125;\n\t\t\n\t\tgl_FragColor = vec4( outgoingLight * 0.35 + 0.65 * baseColor, 1.0 ) * mix(0.4, 1.25, v_edgeInfos.w * v_edgeInfos.w) * infoColor.r * ao;\n\t#else\n\t\t#ifdef USE_AREA_LIGHT\n\t\tgl_FragColor = vec4((outgoingLight * 0.35 + 0.65 * baseColor) * infoColor.r, 1.0);\n\t\t#else\n\t\tgl_FragColor = vec4((outgoingLight * 0.35 + 0.65 * baseColor) * infoColor.r, 1.0);\n\t\t#endif\n\t#endif\n\n}"]),m.defines.USE_AREA_LIGHT=!0,m.defines.IS_EDGES=!0,v=new c.Mesh(f,m),m.renderOrder=1024,x.add(v),v.geometry.computeBoundingBox();var e=new c.Box3;e.copy(v.geometry.boundingBox).applyMatrix4(v.matrixWorld),n.screenPositionsOnFloor={min:new c.Vector2(e.min.x-1,-5),max:new c.Vector2(e.max.x+1,0)};var t=new c.PlaneBufferGeometry(i.SCREEN_SIZE+1,i.SCREEN_SIZE+1),o=new c.MeshBasicMaterial({color:196871}),y=new c.Mesh(t,o);y.position.set(4,3.5,-2.5),y.rotation.y=Math.PI,x.add(y)},n.resize=function(e,t){},n.update=function(e){y!==o.viewQuality&&(d.defines.USE_AREA_LIGHT=o.viewQuality>2,d.needsUpdate=!0);y=o.viewQuality};var h,d,p,f,m,v,g,y,x=n.container=null;function b(e){h=e}function _(e){f=e}},{"../../core/browser":88,"../../core/properties":90,"../../core/settings":91,"../../effects/glPositionOffset/glPositionOffset":95,"../screen/screen":169,glslify:30,"mout/object/mixIn":54,three:79}],174:[function(e,t,n){"use strict";var r=e("../core/properties"),i=e("./stage/stage"),o=e("./floor/floor"),a=e("./screen/screen"),s=e("./car/car"),l=e("./person/person"),c=e("three");e("glslify");n.preInit=function(){u=n.container=new c.Object3D,a.preInit(),i.preInit(),o.preInit();var e=h[r.modelId];e&&e.preInit()},n.init=function(){a.init(),i.init(),o.init(),u.add(i.container),u.add(o.mesh),u.add(a.container)},n.resize=function(e,t){i.resize(e,t),o.resize(e,t)},n.update=function(e){for(var t in a.update(e),i.update(e),o.mesh.visible=r.viewQuality>0,i.container.children[0].visible=r.viewQuality>1,h){var n=h[t];t===r.modelId&&n.preInit(),n.update(e)}};var u=n.container=null,h={car:s,person:l}},{"../core/properties":90,"./car/car":166,"./floor/floor":167,"./person/person":168,"./screen/screen":169,"./stage/stage":173,glslify:30,three:79}],175:[function(e,t,n){"use strict";var r=e("../../core/settings"),i=e("../../core/properties"),o=e("./vrCanvasGrid/vrCanvasGrid");n.preInit=function(){o.preInit()},n.init=function(){n.canvas=document.createElement("canvas"),n.canvas.width=s,n.canvas.height=l,a=n.canvas.getContext("2d"),i.vrCanvas=n.canvas,i.vrCanvasCtx=a,r.IS_CANVAS_DEBUG&&(n.canvas.classList.add("vr-ui-canvas"),document.body.append(n.canvas));o.init()},n.resize=function(){},n.render=function(){o.render()},n.update=function(e){o.update(e)},n.canvas=null;var a,s=r.CANVAS_UI_WIDTH,l=r.CANVAS_UI_HEIGHT},{"../../core/properties":90,"../../core/settings":91,"./vrCanvasGrid/vrCanvasGrid":177}],176:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault")(e("../../../ui/editor/Sketch")),i=e("../../../core/settings"),o=e("../../../core/properties"),a=e("../../../io/shadertoy"),s=e("../../../visual/screen/screenShader"),l=e("../../vrGallery/vrGallery"),c=e("../../vrGallery/vrGallerySpinner"),u=e("../../../utils/canvas").rectRound,h=e("min-signal"),d=e("../../vrDock/vrShaderInfos");function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.cellIndex=e.cellIndex,this.infos=e.infos||null,this.posX=e.posX||0,this.posY=e.posY||0,this.width=i.CELL_REAL_WIDTH,this.height=i.CELL_REAL_HEIGHT,this.infos=e.infos||null,this.titleText="Loading...",this.usernameText="",this.image=null,this.imageHeight=.7*this.height,this.isCompilingShaderText="loading...",this.isCompilingShader=!1,this.isSelected=!1,this.onImageLoaded=new h,this.infos&&this.updateInfos(this.infos)}var f=p.prototype;
10t.exports=p,f.init=function(){o.onShaderCompiled.add(this.onShaderCompiled.bind(this))},f.draw=function(){o.vrCanvasCtx.save(),u(o.vrCanvasCtx,this.posX,this.posY,this.width,this.height,{tl:15,tr:15,br:15,bl:15}),o.vrCanvasCtx.clip();var e=this.isSelected?"#dddddd":this.isCompilingShader?"#1d1d1d":"#051015";o.vrCanvasCtx.fillStyle=e,o.vrCanvasCtx.fillRect(this.posX,this.posY,this.width,this.height),this.image&&this.image.naturalHeight?o.vrCanvasCtx.drawImage(this.image,this.posX,this.posY,this.width,this.imageHeight):(o.vrCanvasCtx.fillStyle="#091b23",o.vrCanvasCtx.fillRect(this.posX,this.posY,this.width,this.imageHeight));var t=this.posY+this.imageHeight+65;o.vrCanvasCtx.fillStyle=this.isSelected?"#051015":"#fff",o.vrCanvasCtx.font="45px t26-carbon",o.vrCanvasCtx.fillText(this.titleText,this.posX+25,t);var n=this.posX+.5*this.width,r=this.posX+this.width+2,i=o.vrCanvasCtx.createLinearGradient(n,t,r,t);i.addColorStop(0,e+"00"),i.addColorStop(.75,e),o.vrCanvasCtx.fillStyle=i,o.vrCanvasCtx.fillRect(n,t-45,r-n,65),o.vrCanvasCtx.fillStyle=this.isSelected?"#051015":"#fff",o.vrCanvasCtx.font="35px t26-carbon",o.vrCanvasCtx.fillText(this.usernameText,this.posX+25,this.posY+this.imageHeight+120,this.width-25),this.isCompilingShader&&(o.vrCanvasCtx.font="35px t26-carbon",o.vrCanvasCtx.fillText(this.isCompilingShaderText,this.posX+this.width-170,this.posY+this.height-20)),o.vrCanvasCtx.restore()},f.unselect=function(){this.isSelected=!1,l.needsRender=!0},f.select=function(){this.infos&&this.infos.id&&!this.isCompilingShader&&!this.isSelected&&(this.isCompilingShader=!0,l.needsRender=!0,l.hide(),c.show(),a.load(this.infos.id,(function(e){s.changeShader(e.shader),o.currentSketch||(o.currentSketch=new r.default({id:e.shaderInfo.id})),o.currentSketch.importShader(e.shader,e.shaderInfos),l.needsRender=!0,c.hide()}),!1),d.draw(this.infos.title,this.infos.username,this.infos.likes,this.infos.viewed),d.show())},f.reset=function(){this.infos=null,this.titleText="Loading...",this.usernameText="",this.image=null,this.isCompilingShader=!1,this.isSelected=!1},f.updateInfos=function(e){var t=this;e&&(this.infos=e,this.titleText=this.infos.title,this.usernameText="by "+this.infos.username,this.image=new Image,i.USE_REDIRECT_CORS_PROXY||(this.image.crossOrigin="anonymous"),this.image.addEventListener("load",(function(){t.onImageLoaded.dispatch()})),this.image.src=i.SHADERTOY_PREVIEW_URL+this.infos.id+".jpg")},f.onShaderCompiled=function(){this.isCompilingShader?(this.isCompilingShader=!1,this.isSelected=!0,l.hide()):this.isSelected=!1}},{"../../../core/properties":90,"../../../core/settings":91,"../../../io/shadertoy":110,"../../../ui/editor/Sketch":130,"../../../utils/canvas":163,"../../../visual/screen/screenShader":172,"../../vrDock/vrShaderInfos":188,"../../vrGallery/vrGallery":190,"../../vrGallery/vrGallerySpinner":194,"@babel/runtime/helpers/interopRequireDefault":11,"min-signal":32}],177:[function(e,t,n){"use strict";var r=e("../../../core/settings"),i=e("../../../core/properties"),o=e("../../vrGallery/vrGallery"),a=e("../../vrGallery/vrGallerySearch"),s=e("./vrCanvasCell"),l=e("../../../utils/canvas").rectRound;n.preInit=function(){for(var e=0,t=r.CELLS_COUNT;e<t;e++)u(e);a.onUpdateCells.add(p),a.onPageChange.add(d)},n.init=function(){c=!0},n.render=function(){if(c){i.vrCanvasCtx.clearRect(0,0,r.CANVAS_UI_WIDTH,r.CANVAS_UI_HEIGHT),i.vrCanvasCtx.save(),l(i.vrCanvasCtx,0,0,r.CANVAS_UI_WIDTH,r.CANVAS_UI_HEIGHT,{tl:25,tr:25,br:25,bl:25}),i.vrCanvasCtx.clip(),i.vrCanvasCtx.fillStyle="#000000",i.vrCanvasCtx.fillRect(0,0,r.CANVAS_UI_WIDTH,r.CANVAS_UI_HEIGHT);for(var e=0,t=n.cells.length;e<t;e++)n.cells[e].draw();i.vrCanvasCtx.restore()}},n.update=function(){},n.cells=[];var c=!1;function u(e){var t=e%r.CELLS_PER_ROW,i=Math.ceil((e+1)/r.CELLS_PER_ROW)-1,o=t*r.CELL_WIDTH+r.CONTAINER_PADDING+r.MARGIN_BETWEEN_CELLS/2,l=i*r.CELL_HEIGHT+r.CONTAINER_PADDING+r.MARGIN_BETWEEN_CELLS/2,c=new s({cellIndex:e,posX:o,posY:l,infos:a.shaderInfosList[e]});c.init(),c.onImageLoaded.add(h),n.cells.push(c)}function h(){o.needsRender=!0}function d(){n.cells.forEach((function(e,t){e.reset()})),o.needsRender=!0}
10function p(e){n.cells.forEach((function(t,n){e[n]&&t.updateInfos(e[n])})),o.needsRender=!0}},{"../../../core/properties":90,"../../../core/settings":91,"../../../utils/canvas":163,"../../vrGallery/vrGallery":190,"../../vrGallery/vrGallerySearch":192,"./vrCanvasCell":176}],178:[function(e,t,n){"use strict";var r=e("gsap").gsap,i=e("../core/properties"),o=e("../core/settings"),a=e("../audio/audio"),s=e("../visual/stage/stage"),l=e("../visual/floor/floor"),c=e("../visual/screen/screenMesh"),u=e("./vrGallery/vrGallery"),h=e("./vrGallery/vrGallerySelector"),d=e("./vrGallery/vrGalleryButtons"),p=e("./vrGallery/vrGallerySearch"),f=e("three"),m=e("./vrDock/vrPrompt");n.init=function(){v=new f.Raycaster,g=new f.Matrix4,n.rayCastedMeshes.push(l.mesh,c.hitTestMesh),_.push(s.screenPositionsOnFloor),i.rayOnScreenIntersection=new f.Vector3,i.rayOnGalleryIntersection=new f.Vector3,i.rayOnPromptIntersection=new f.Vector3,r.to(i.cameraXRContainer.userData,{duration:2.5,delay:1,opacity:1,onUpdate:function(){a.setVolumeTransition(i.cameraXRContainer.userData.opacity)}})},n.addController=function(e,t){var n={controller:e,inputSource:t,active:!1,stateHit:{},intersections:{},currentIntersection:null,hit:!1,isPulsing:!1};x.push(n);var r=new f.Group;r.name="raycasterContext",e.add(r)},n.removeController=function(e){var t=x.findIndex((function(t){return t.controller.name===e.name}));t>-1&&x.splice(t,1)},n.onSelectStart=function(e){var t=e.target,n=x.find((function(e){return e.controller===t}));if(i.vrControls.setPointerState(t,!0),n&&(n.active=!0,n.currentIntersection)){var o=n.currentIntersection.intersection,s=o.point;console.log("Log: vrControllerRay.js -> onSelectStart -> intersection.object",o.object);var l="floor"===o.object.name&&w(s),c="vrGalleryGrid"===o.object.name||"vrGalleryGrid"===o.object.parent.name,d="vrPrompt"===o.object.name||"vrPrompt"===o.object.parent.name;if(l){a.prepareVolumeTransition();var f=function(){a.setVolumeTransition(i.cameraXRContainer.userData.opacity)};r.to(i.cameraXRContainer.userData,{duration:.75,opacity:0,onUpdate:f,onComplete:function(){i.cameraXRContainer.position.copy(s),r.to(i.cameraXRContainer.userData,{duration:.75,opacity:1,onUpdate:f,onComplete:function(){a.endVolumeTransition()}})}})}else c?(i.rayOnGalleryIntersection.copy(o.point),u.container.worldToLocal(i.rayOnGalleryIntersection),b=n,h.selectCell(),h.onSelectStart()):d?m.select():"vrGalleryButtonLeft"===o.object.name?p.goToPreviousPage():"vrGalleryButtonRight"===o.object.name&&p.goToNextPage();if((y=o.object).userData.isPressed=!0,o.object.userData.onSelect){o.object.userData.onSelect();var v=e.data&&e.data.gamepad&&e.data.gamepad.hapticActuators;v&&v.forEach((function(e){e.pulse(.05,50)}))}}},n.onSelectEnd=function(e){var t=e.target;i.vrControls.setPointerState(t,!1),h.onSelectEnd(),d.onSelectEnd(),y&&(y.userData.isPressed=!1)},n.update=function(){for(var e=null,t=0,r=n.rayCastedMeshes.length;t<r;t++)n.rayCastedMeshes[t].userData.isHovered=!1;for(var o=!1,s=!1,l=0;l<x.length;l++){e=null;var c=x[l],d=M(c.controller,n.rayCastedMeshes);if(d.length>0){var p=Object.entries(d).filter((function(e){return null!==e[1]}));if(p.length>0){p.sort((function(e,t){return e[1].distance-t[1].distance}));var f=p[0][1],g="floor"===f.object.name&&w(f.point);"screenMesh"===f.object.name&&i.rayOnScreenIntersection.copy(f.point),o||(o="vrGalleryGrid"===f.object.name||"vrGalleryGrid"===f.object.parent.name)&&(i.rayOnGalleryIntersection.copy(f.point),u.container.worldToLocal(i.rayOnGalleryIntersection),b=c),s||(s="vrPrompt"===f.object.name||"vrPrompt"===f.object.parent.name)&&(i.rayOnPromptIntersection.copy(f.point),m.container.worldToLocal(i.rayOnPromptIntersection)),c.prevIntersection&&(c.prevIntersection.intersection.object.userData.isHovered=!1),c.prevIntersection=c.currentIntersection,e={intersection:f},f.object.userData.isHovered=!0,f.object.userData.hoverControllerIndex=l,i.vrControls.setFromController(l,v.ray),i.vrControls.setPointerAt(l,f.point,g)}else i.vrControls.setPointerAt(l)}else i.vrControls.missPointer(l),i.vrControls.setFromController(l,null);c.currentIntersection=e}i.isRaycastingGallery=o,i.isRaycastingPrompt=s,i.isRaycastingGallery||(b=null);
10n.rayCastedMeshes.forEach((function(e){var t=e.userData.isHoveredPrev!==e.userData.isHovered&&e.userData.isHovered,n=e.name.includes("dockButton")||e.name.includes("vrGalleryButton");t&&n&&(a.playHover(),S(x[e.userData.hoverControllerIndex]));e.userData.isHoveredPrev=e.userData.isHovered,e.userData.isHovered||(e.userData.hoverControllerIndex=null)})),i.isRaycastingGallery&&h.prevHoverIndex!==h.hoverIndex&&(a.playHover(),S(b))},n.rayCastedMeshes=[];var v,g,y,x=[],b=null,_=[];function w(e){for(var t=!0,n=0,r=_.length;n<r;n++){var i=_[n];e.x>i.min.x&&e.x<i.max.x&&e.z>i.min.y&&e.z<i.max.y&&(t=!1)}return t}function S(e){if(!e.isPulsing){var t=e.inputSource&&e.inputSource.gamepad&&e.inputSource.gamepad.hapticActuators;t&&t.forEach((function(t){e.isPulsing=!0,t.pulse(.25,25).then((function(){return e.isPulsing=!1}))}))}}function M(e,t){var n=e.getObjectByName("raycasterContext");return n?(i.isOculusLink&&(n.rotateX(o.OCULUSLINK_RAY_ROTATION_X),n.updateMatrixWorld()),v.ray.origin.setFromMatrixPosition(n.matrixWorld),g.identity().extractRotation(n.matrixWorld),v.ray.direction.set(0,0,-1).applyMatrix4(g),i.isOculusLink&&n.rotateX(-o.OCULUSLINK_RAY_ROTATION_X),Array.isArray(t)?v.intersectObjects(t,!0):v.intersectObject(t,!0)):[]}},{"../audio/audio":80,"../core/properties":90,"../core/settings":91,"../visual/floor/floor":167,"../visual/screen/screenMesh":171,"../visual/stage/stage":173,"./vrDock/vrPrompt":187,"./vrGallery/vrGallery":190,"./vrGallery/vrGalleryButtons":191,"./vrGallery/vrGallerySearch":192,"./vrGallery/vrGallerySelector":193,gsap:31,three:79}],179:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault")(e("./vrControls/vrControls")),i=(e("gsap").gsap,e("../loaders/loaders"),e("../core/properties")),o=(e("../core/settings"),e("./vrControllerRay")),a=e("three"),s=e("../helpers/webXRHelper");n.preInit=function(){},n.init=function(){if(i.vrControls=(0,r.default)(i.renderer,i.camera,i.scene),!l){i.cameraXRContainer.position.set(4,0,10),i.cameraXRContainer.userData.skipReflection=!0,o.init();for(var e=function(e){c[e]=i.renderer.xr.getController(e);var t=c[e];t.boundingBox=new a.Box3,t.userData.grabbing=null,t.addEventListener("selectstart",u),t.addEventListener("selectend",h),t.addEventListener("connected",(function(t){console.log("controller connected",t),n.connectedController++,t.data&&t.data.profiles&&"oculus-touch"===t.data.profiles[0]&&!i.isOculusLink&&(i.isOculusLink=!0,i.onOculusLinkDetected.dispatch(),console.log("properties.isOculusLink",i.isOculusLink)),i.vrControls.addController(e,t.data.handedness),o.addController(this,t.data)})),t.addEventListener("disconnected",(function(e){console.log("controller disconnected",e),n.connectedController--,e&&e.data&&(i.vrControls.removeController(e.data.handedness),o.removeController(this))}))},t=0;t<2;t++)e(t);s.onSessionStarted.add(d),s.onSessionEnded.add(p),l=!0}},n.update=function(e){o.update(e),i.vrControls.update(e)},n.rayCastedMeshes=[],n.connectedController=0;var l=!1,c=[];function u(e){i.isSelectDown=!0,i.hasSelectJustDown=!0,o.onSelectStart(e)}function h(e){i.isSelectDown=!1,o.onSelectEnd(e)}function d(){i.cameraXRContainer.position.set(4,0,10),i.cameraXRContainer.rotation.set(0,0,0)}function p(){i.cameraXRContainer.position.set(0,0,0),i.cameraXRContainer.rotation.set(0,0,0)}},{"../core/properties":90,"../core/settings":91,"../helpers/webXRHelper":99,"../loaders/loaders":113,"./vrControllerRay":178,"./vrControls/vrControls":182,"@babel/runtime/helpers/interopRequireDefault":11,gsap:31,three:79}],180:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.XRControllerModelFactory=void 0;var r=e("./motion-controllers.module.js"),i=e("three"),o=e("../../loaders/GLTFLoader"),a=e("mout/object/mixIn"),s=e("../../effects/glPositionOffset/glPositionOffset"),l=e("../../visual/screen/screen"),c=e("glslify"),u=e("../../core/browser"),h=(e("../../core/properties"),"https://cdn.jsdelivr.net/npm/@webxr-input-profiles/[email protected]/dist/profiles");function d(){i.Object3D.call(this),this.motionController=null,this.envMap=null,this.joystickValues=null}function p(e,t){!function(e,t){Object.values(e.components).forEac
10h((function(e){var n=e.type,i=e.touchPointNodeName,o=e.visualResponses;n===r.Constants.ComponentType.TOUCHPAD&&(e.touchPointNode=t.getObjectByName(i),e.touchPointNode||console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id))),Object.values(o).forEach((function(e){var n=e.valueNodeName,i=e.minNodeName,o=e.maxNodeName;if(e.valueNodeProperty===r.Constants.VisualResponseProperty.TRANSFORM){if(e.minNode=t.getObjectByName(i),e.maxNode=t.getObjectByName(o),!e.minNode)return void console.warn("Could not find ".concat(i," in the model"));if(!e.maxNode)return void console.warn("Could not find ".concat(o," in the model"))}e.valueNode=t.getObjectByName(n),e.valueNode||console.warn("Could not find ".concat(n," in the model"))}))}))}(e.motionController,t),e.envMap&&t.traverse((function(t){t.isTHREE.Mesh&&(t.material.envMap=e.envMap,t.material.needsUpdate=!0)})),t.traverse((function(e){if(e.material){var t=e.material.map;e.material.type="ShaderMaterial",e.material.uniforms=a({u_baseTexture:{value:t}},i.UniformsUtils.merge([i.ShaderLib.standard.uniforms]),s.sharedUniforms,l.sharedUniforms),e.material.vertexShader=c(["#define GLSLIFY 1\n#define STANDARD\n\nvarying vec2 v_uv;\n\n#include <glPositionOffset>\n\n#include <textureSmoothstep>\n#include <textureBicubic>\n#include <lodMipmapSample>\n\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;\nvarying vec3 v_baseColor;\n\nuniform vec2 u_screenTextureSize;\nuniform vec2 u_screenMipmapTextureSize;\nuniform vec3 u_screenPosition;\nuniform sampler2D u_areaLightCookies[1];\n\nvoid main () {\n\tvNormal = normalize( normalMatrix * normal );\n\tvec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\tvViewPosition = - mvPosition.xyz;\n\n\tvec3 worldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n\tvec3 delta = (worldPosition - u_screenPosition) / 50.0;\n\tv_baseColor = lodMipmapSampleNearestCubic(u_areaLightCookies[0], clamp(vec2(0.5, 0.5) + delta.xy, vec2(0.0), vec2(1.0)), 3.0 + abs(delta.z / 10.0), u_screenTextureSize, u_screenMipmapTextureSize).rgb;\n\n\tv_uv = uv;\n\tgl_Position = projectionMatrix * mvPosition;\n\tgl_Position = glPositionOffset(gl_Position);\n}"]),e.material.fragmentShader=c(["#define GLSLIFY 1\n#define STANDARD\n\n#include <textureSmoothstep>\n#include <textureBicubic>\n#include <lodMipmapSample>\n\nuniform vec2 u_screenTextureSize;\nuniform vec2 u_screenMipmapTextureSize;\n\nuniform sampler2D u_baseTexture;\n\nvarying vec2 v_uv;\nvarying vec3 v_baseColor;\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;\n\n#include <common>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n\nvoid main () {\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\n vec3 infoColor = texture2D(u_baseTexture, v_uv).rgb;\n\n\tfloat roughnessFactor = roughness;\n\tfloat metalnessFactor = metalness;\n\n\tvec3 normal = normalize(vNormal);\n\tvec3 geometryNormal = normal;\n\n\t// accumulation\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\n\t// modulation\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n gl_FragColor = vec4(outgoingLight + infoColor, diffuseColor.a);\n}"]),e.material.blending=i.NoBlending,e.material.transparent=!0,e.renderOrder=9e3,(u.isMobile||u.isOculusBrowser)&&(e.material.defines.IS_MOBILE=!0),e.userData.skipReflection=!0}})),e.add(t)}d.prototype=Object.assign(Object.create(i.Object3D.prototype),{constructor:d,setEnvironmentMap:function(e){return this.envMap==e||(this.envMap=e,this.traverse((function(e){e.isTHREE.Mesh}))),this},updateMatrixWorld:function(e){var t=this;i.Object3D.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEac
10h((function(e){if(e.values){var n="xr-standard-thumbstick"===e.id,o="xr-standard-touchpad"===e.id;if(n)t.joystickValues={x:e.values.xAxis,y:e.values.yAxis};else if(o){var a="pressed"==e.values.state;t.joystickValues=a?{x:e.values.xAxis,y:e.values.yAxis}:null}}Object.values(e.visualResponses).forEach((function(e){var t=e.valueNode,n=e.minNode,o=e.maxNode,a=e.value,s=e.valueNodeProperty;t&&(s===r.Constants.VisualResponseProperty.VISIBILITY?t.visible=a:s===r.Constants.VisualResponseProperty.TRANSFORM&&(i.Quaternion.slerp(n.quaternion,o.quaternion,t.quaternion,a),t.position.lerpVectors(n.position,o.position,a)))}))})))}});var f=function(){function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.gltfLoader=e,this.path=h,this._assetCache={},this.gltfLoader||(this.gltfLoader=new o)}return e.prototype={constructor:e,createControllerModel:function(e){var t=this,n=new d,i=null;return e.addEventListener("connected",(function(e){var o=e.data;"tracked-pointer"===o.targetRayMode&&o.gamepad&&(0,r.fetchProfile)(o,t.path,"generic-trigger").then((function(e){var a=e.profile,s=e.assetPath;n.motionController=new r.MotionController(o,a,s);var l=t._assetCache[n.motionController.assetUrl];if(l)i=l.scene.clone(),p(n,i);else{if(!t.gltfLoader)throw new Error("GLTFLoader not set.");t.gltfLoader.setPath(""),t.gltfLoader.load(n.motionController.assetUrl,(function(e){t._assetCache[n.motionController.assetUrl]=e,i=e.scene.clone(),p(n,i)}),null,(function(e){throw console.error(e),new Error("Asset ".concat(n.motionController.assetUrl," missing or malformed."))}))}})).catch((function(e){console.warn(e)}))})),e.addEventListener("disconnected",(function(){})),n}},e}();n.XRControllerModelFactory=f},{"../../core/browser":88,"../../core/properties":90,"../../effects/glPositionOffset/glPositionOffset":95,"../../loaders/GLTFLoader":112,"../../visual/screen/screen":169,"./motion-controllers.module.js":181,glslify:30,"mout/object/mixIn":54,three:79}],181:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.fetchProfile=function(e,t){return v.apply(this,arguments)},n.fetchProfilesList=f,n.MotionController=n.Constants=void 0;var i=r(e("@babel/runtime/regenerator")),o=r(e("@babel/runtime/helpers/defineProperty")),a=r(e("@babel/runtime/helpers/classCallCheck")),s=r(e("@babel/runtime/helpers/createClass")),l=r(e("@babel/runtime/helpers/asyncToGenerator"));function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var u=e("../../core/settings"),h={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function d(e){return p.apply(this,arguments)}function p(){return(p=(0,l.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:if((n=e.sent).ok){e.next=7;break}throw new Error(n.statusText);case 7:return e.abrupt("return",n.json());case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(e){return m.apply(this,arguments)}function m(){return(m=(0,l.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw new Error("No basePath supplied");case 2:return"profilesList.json",e.next=5,d(u.DATA_PATH+"profilesList.json");case 5:return n=e.sent,e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(){return(v=(0,l.default)(i.default.mark((function e(t,n){var r,o,a,s,l,c,u,h,p=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=p.length>2&&void 0!==p[2]?p[2]:null,o=!(p.length>3&&void 0!==p[3])||p[3],t){e.next=4;break}throw new Error("No xrInputSource supplied");case 4:if(n){e.next=6;break}throw new Error("No basePath supplied");case 6:return e.next=8,f(n);case 8:if(a=e.sent,t.profiles.some((function(e){var t=a[e];return t&&(s={profileId:e,profilePath:"".concat(n,"/").concat(t.path),deprecated:!!t.deprecated}),!!s})),s){e.next=17;break}if(r){e.next=13;break}throw new Error("No matching profile name found");case 13:if(l=a[r]){e.next=16;break}throw new Error('No matching profile name found and default profile "'.concat(r,'" missing.'));case 16:s={profileId:r,profilePath:"".concat(n,"/").concat(l.path),deprecated:!!l.deprecated};case 17:return e.next=19,d(s.profilePath);case 19:if(c=e.sent,!o){e.next=25;break}if(h="any"===t.handedness?c.layouts[Object.keys(c.layouts)[0]]:c.layouts[t.handedness]){e.next=24;break}throw new Error("No matching handedness, ".concat(t.handedness,", in profile ").concat(s.profileId));case 24:h.assetPath&&(u=s.profilePath.replace("profile.json",h.assetPath));case 25:return e.abrupt("return",{profile:c,assetPath:u});case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}n.Constants=h;var g={xAxis:0,yAxis:0,button:0,state:h.ComponentState.DEFAULT};var y=function(){function e(t){(0,a.default)(this,e),this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===h.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(g)}return(0,s.default)(e,[{key:"updateFromComponent",value:function(e){var t=e.xAxis,n=e.yAxis,r=e.button,i=e.state,o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e,r=t;if(Math.sqrt(e*e+t*t)>1){var i=Math.atan2(t,e);n=Math.cos(i),r=Math.sin(i)}
10return{normalizedXAxis:.5*n+.5,normalizedYAxis:.5*r+.5}}(t,n),a=o.normalizedXAxis,s=o.normalizedYAxis;switch(this.componentProperty){case h.ComponentProperty.X_AXIS:this.value=this.states.includes(i)?a:.5;break;case h.ComponentProperty.Y_AXIS:this.value=this.states.includes(i)?s:.5;break;case h.ComponentProperty.BUTTON:this.value=this.states.includes(i)?r:0;break;case h.ComponentProperty.STATE:this.valueNodeProperty===h.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(i):this.value=this.states.includes(i)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}}}]),e}(),x=function(){function e(t,n){var r=this;if((0,a.default)(this,e),!(t&&n&&n.visualResponses&&n.gamepadIndices&&0!==Object.keys(n.gamepadIndices).length))throw new Error("Invalid arguments supplied");this.id=t,this.type=n.type,this.rootNodeName=n.rootNodeName,this.touchPointNodeName=n.touchPointNodeName,this.visualResponses={},Object.keys(n.visualResponses).forEach((function(e){var t=new y(n.visualResponses[e]);r.visualResponses[e]=t})),this.gamepadIndices=Object.assign({},n.gamepadIndices),this.values={state:h.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}}return(0,s.default)(e,[{key:"updateFromGamepad",value:function(e){var t=this;if(this.values.state=h.ComponentState.DEFAULT,void 0!==this.gamepadIndices.button&&e.buttons.length>this.gamepadIndices.button){var n=e.buttons[this.gamepadIndices.button];this.values.button=n.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,n.pressed||1===this.values.button?this.values.state=h.ComponentState.PRESSED:(n.touched||this.values.button>h.ButtonTouchThreshold)&&(this.values.state=h.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===h.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>h.AxisTouchThreshold&&(this.values.state=h.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===h.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>h.AxisTouchThreshold&&(this.values.state=h.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach((function(e){e.updateFromComponent(t.values)}))}},{key:"data",get:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({id:this.id},this.values)}}]),e}(),b=function(){function e(t,n,r){var i=this;if((0,a.default)(this,e),!t)throw new Error("No xrInputSource supplied");if(!n)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=n.profileId,this.layoutDescription=n.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach((function(e){var t=i.layoutDescription.components[e];i.components[e]=new x(e,t)})),this.updateFromGamepad()}return(0,s.default)(e,[{key:"updateFromGamepad",value:function(){var e=this;Object.values(this.components).forEach((function(t){t.updateFromGamepad(e.xrInputSource.gamepad)}))}},{key:"gripSpace",get:function(){return this.xrInputSource.gripSpace}},{key:"targetRaySpace",get:function(){return this.xrInputSource.targetRaySpace}},{key:"data",get:function(){var e=[];return Object.values(this.components).forEach((function(t){e.push(t.data)})),e}}]),e}();n.MotionController=b},{"../../core/settings":91,"@babel/runtime/helpers/asyncToGenerator":4,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/
10defineProperty":7,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/regenerator":22}],182:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t,n){var r=[],p=[],f=0,m=0,v=0,g=new o.XRControllerModelFactory,y=new u.MeshBasicMaterial({color:16777215,alphaMap:new u.CanvasTexture(h()),transparent:!0,depthWrite:!1}),x=new u.BoxBufferGeometry(.004,.004,.35);x.translate(0,0,-.15);for(var b=x.attributes.uv,_=0;_<b.count;_++){var w=b.getX(_),S=b.getY(_),M=function(){switch(_){case 0:return[1,1];case 1:return[0,0];case 2:return[1,1];case 3:case 4:return[0,0];case 5:return[1,1];case 6:return[0,0];case 7:return[1,1];case 8:case 9:return[0,0];case 10:case 11:case 12:case 13:return[1,1];case 14:case 15:default:return[0,0]}}(),T=(0,i.default)(M,2);w=T[0],S=T[1],b.setXY(_,w,S)}var E=new u.Mesh(x,y);E.renderOrder=8e3;var C=new u.Vector3,L=new u.SpriteMaterial({map:new u.CanvasTexture(d()),sizeAttenuation:!1,transparent:!0,depthTest:!1,depthWrite:!1}),R=new u.Sprite(L);R.scale.set(1,1,1).multiplyScalar(.012),R.renderOrder=8e3;var A=new u.Matrix4;return{controllers:r,controllerGrips:p,addController:function(t,n){var i=e.xr.getController(t);i.name="controller-"+n;var o=e.xr.getControllerGrip(t);o.name="controller-grip-"+n,i&&r.push(i),o&&p.push(o);var l=E.clone(),u=R.clone(),h=new c;i.ray&&i.remove(i.ray),i.pointerMesh&&i.remove(i.pointerMesh),i.floorMark&&s.xrContainer.remove(i.floorMark),i.add(l,u),i.ray=l,i.pointerMesh=u,i.floorMark=h,s.xrContainer.add(h);var d=g.createControllerModel(o);if(d.name="controller-factory-"+t,o.add(d),s.isOculusLink){i.ray.rotateX(a.OCULUSLINK_RAY_ROTATION_X);var f="right"===n?a.OCULUSLINK_RAY_OFFSET_X:-a.OCULUSLINK_RAY_OFFSET_X;i.ray.translateX(f),i.ray.translateY(a.OCULUSLINK_RAY_OFFSET_Y),i.ray.translateZ(a.OCULUSLINK_RAY_OFFSET_Z)}s.cameraXRContainer.add(o,i)},removeController:function(e){var t=r.find((function(t){return t.name.includes(e)})),n=r.findIndex((function(t){return t.name.includes(e)}));t&&n>-1&&(s.cameraXRContainer.remove(t),r.splice(n,1))},setFromController:function(e,t){var n=r[e],i=p[e];if(n&&(A.identity().extractRotation(n.matrixWorld),i)){var o=i.children[0];o.joystickValues&&(m+=o.joystickValues.y*a.JOYSTICK_MOVE_MULTIPLIER,2==l.connectedController&&"controller-left"===n.name?f+=o.joystickValues.x*a.JOYSTICK_MOVE_MULTIPLIER:v-=o.joystickValues.x*a.JOYSTICK_ROTATE_MULTIPLIER)}},setPointerAt:function(e,t,n){var i=r[e];if(i){if(t){var o=s.renderer.xr.getCamera(s.camera),l=i.worldToLocal(t);if(C.copy(o.position).sub(l).normalize().multiplyScalar(.01),i.pointerMesh.position.copy(l).add(C),s.isOculusLink){var c="controller-right"===i.name?a.OCULUSLINK_RAY_OFFSET_X:-a.OCULUSLINK_RAY_OFFSET_X;i.pointerMesh.translateX(c),i.pointerMesh.translateY(a.OCULUSLINK_RAY_OFFSET_Y)}i.localToWorld(t),n&&i.floorMark.position.copy(t)}i.floorMark.userData.isActive=n,i.pointerMesh.visible=!n}},missPointer:function(e){var t=r[e];t&&(t.floorMark.userData.isActive=!1,t.pointerMesh.visible=!1)},setPointerState:function(e,t){var n=t?.008:.012;R.scale.set(1,1,1).multiplyScalar(n)},update:function(e){var t=.05*f,n=.05*m,i=.05*v;f-=t,m-=n,v-=i,s.cameraXRContainer.translateX(t),s.cameraXRContainer.translateZ(n),s.cameraXRContainer.rotateY(i);for(var o=0,a=r.length;o<a;o++)r[o].floorMark.update(e)}}};var i=r(e("@babel/runtime/helpers/slicedToArray")),o=e("./XRControllerModelFactory.js"),a=e("../../core/settings"),s=e("../../core/properties"),l=e("../vrControllers"),c=e("../vrFloorMark/VRFloorMark"),u=e("three");function h(){var e=document.createElement("canvas");e.width=64,e.height=64;var t=e.getContext("2d"),n=t.createLinearGradient(0,0,64,0);return n.addColorStop(0,"black"),n.addColorStop(1,"white"),t.fillStyle=n,t.fillRect(0,0,64,64),e}function d(){var e=document.createElement("canvas");e.width=64,e.height=64;var t=e.getContext("2d");return t.beginPath(),t.arc(32,32,29,0,2*Math.PI),t.lineWidth=5,t.stroke(),t.fillStyle="white",t.fill(),e}},{"../../core/properties":90,"../../core/settings":91,"../vrControllers":179,"../vrFloorMark/VRFloorMark":189,"./XRControllerModelFactory.js":180,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/slicedToArray":17,three:79}],183:[function(e,t,n){"use strict";var r=e("three"),i=e("../../core/properties"),o=e("../../core/settings"),a=e("../../utils/math"),s=a.mix,l=a.map,c=e("../../
10helpers/webXRHelper"),u=e("../vrControllerRay"),h=e("../vrGallery/vrGallery"),d=e("../vrGallery/vrGallerySpinner"),p=e("./vrInfos"),f=e("./vrPrompt"),m=e("./vrShaderInfos"),v=e("./vrDockButton").default,g=e("./vrDockButtonSound").default;n.preInit=function(){y=[{iconName:"infos",weight:4},{iconName:"gallery",weight:5},{iconName:"soundon",iconName2:"soundoff",weight:4,weight2:5},{iconName:"about",weight:4},{iconName:"exit",weight:5}].map((function(e){var t=e.iconName,n=e.iconName2,r=e.weight,a=e.weight2,s=i.loadervr.add("".concat(o.TEXTURE_PATH,"icon-").concat(t,".png"),{weight:r}).content;return n?[s,i.loadervr.add("".concat(o.TEXTURE_PATH,"icon-").concat(n,".png"),{weight:a}).content]:s})),h.preInit(),d.preInit(),p.preInit()},n.init=function(){n.container=new r.Object3D,n.container.position.y=-1e3,(b=new r.Object3D).rotation.x=.3*-Math.PI,h.init(),p.init(),f.init(),m.init(),d.init();var e=S.length,t=_*e*.5;x=S.map((function(n,r){var i=n.callback,o=n.label,a=l(r/(e-1),0,1,.075-t,t-.075),s="";0===r&&(s="left"),r===e-1&&(s="right");var c=y[r],h=Array.isArray(c)?new g(_,o,s,c):new v(_,o,s,c);return h.mesh.position.x=a,h.mesh.name="dockButton-".concat(o),h.mesh.userData.onSelect=i,b.add(h.mesh),u.rayCastedMeshes.push(h.mesh),h})),n.container.add(b),n.container.add(h.container),n.container.add(p.container),n.container.add(f.container),n.container.add(m.container),n.container.add(d.container),n.container.userData.skipReflection=!0,n.buttonSound=x[2],i.scene.add(n.container)},n.update=function(e){var t=i.renderer.xr.getCamera(i.camera);n.container.quaternion.copy(i.cameraXRContainer.quaternion),n.container.position.y>-1e3?n.container.position.set(t.position.x,s(n.container.position.y,.65*t.position.y,.07),t.position.z):(n.container.position.y=.65*t.position.y,h.container.position.y=.65);n.container.translateX(w.x),n.container.translateY(w.y),n.container.translateZ(w.z),n.buttonSound.update(e,t),x.forEach((function(e){e.mesh.userData.isPressed||(e.mesh.userData.isHovered?e.mesh.material.uniforms.u_mix.value=1:e.mesh.material.uniforms.u_mix.value=0)})),h.update(e),d.update(e),m.update(e),p.update(e),f.update(e)},o.EXPOSE_FUNCTIONS&&(window.vrDock={},window.vrDock.onSelectInfos=M,window.vrDock.onSelectGallery=T,window.vrDock.onSelectSound=E,window.vrDock.onSelectAbout=C,window.vrDock.onSelectExit=L,window.vrDock.onSelectExitFast=function(){L(),window.vrPrompt.onSelectLeft()}),n.container=null,n.buttonSound=null;var y,x,b,_=.15,w=new r.Vector3(0,0,-.6),S=[{callback:M,label:"Infos"},{callback:T,label:"Gallery"},{callback:E,label:"Audio"},{callback:C,label:"About"},{callback:L,label:"Quit"}];function M(){p.toggle(),f.hide()}function T(){h.toggle()}function E(){n.buttonSound.toggle()}function C(){f.show(),p.hide(),i.promptCallback=function(){c.leaveWebXR((function(){var e=document.querySelectorAll(".menu__link");e[e.length-1].click()}))}}function L(){f.show(),p.hide(),i.promptCallback=c.leaveWebXR}},{"../../core/properties":90,"../../core/settings":91,"../../helpers/webXRHelper":99,"../../utils/math":165,"../vrControllerRay":178,"../vrGallery/vrGallery":190,"../vrGallery/vrGallerySpinner":194,"./vrDockButton":184,"./vrDockButtonSound":185,"./vrInfos":186,"./vrPrompt":187,"./vrShaderInfos":188,three:79}],184:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=r(e("@babel/runtime/helpers/classCallCheck")),o=r(e("@babel/runtime/helpers/createClass")),a=e("three"),s=e("../../utils/canvas").rectRound,l=256,c=256,u=25,h=function(){function e(t,n,r,o){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:40;(0,i.default)(this,e),this.label=n,this.image=o,this.iconSize=s,this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d");var h=new a.PlaneBufferGeometry(t,t);this.texture=new a.CanvasTexture(this.canvas);var d=new a.ShaderMaterial({uniforms:{u_texture:{value:this.texture},u_mix:{value:0},u_opacity:{value:1}},vertexShader:"\n varying vec2 v_uv;\n \n void main() {\n v_uv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
10);\n }\n ",fragmentShader:"\n uniform sampler2D u_texture;\n uniform float u_mix;\n uniform float u_opacity;\n\n varying vec2 v_uv;\n\n void main() {\n vec4 texture = texture2D(u_texture, v_uv);\n vec3 color = vec3(0.02, 0.063, 0.082);\n\n float icon = mix(texture.r * 0.75, texture.g, u_mix);\n color += icon;\n \n gl_FragColor = vec4(color, texture.a * u_opacity);\n }\n ",transparent:!0});this.mesh=new a.Mesh(h,d),this.mesh.renderOrder=4010,this.borderRadius=null,"left"===r?this.borderRadius={tl:u,tr:0,br:0,bl:u}:"right"===r?this.borderRadius={tl:0,tr:u,br:u,bl:0}:"all"===r&&(this.borderRadius={tl:u,tr:u,br:u,bl:u}),this.canvas.width=l,this.canvas.height=c,this.context.fillStyle="#000",this.context.fillRect(0,0,l,c),this.drawImage(this.image,this.label)}return(0,o.default)(e,[{key:"drawImage",value:function(e,t){this.context.clearRect(0,0,l,c),this.context.save(),this.borderRadius&&(s(this.context,0,0,l,c,this.borderRadius),this.context.clip()),this.context.fillStyle="#00f",this.context.fillRect(0,0,l,c),this.context.drawImage(e,128-.5*this.iconSize,128-.5*this.iconSize,this.iconSize,this.iconSize),t&&""!==t&&(this.context.font="35px t26-carbon",this.context.textAlign="center",this.context.textBaseline="middle",this.context.fillStyle="#0f0",this.context.fillText(t,128,204.8)),this.context.restore(),this.texture.needsUpdate=!0}}]),e}();n.default=h},{"../../utils/canvas":163,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/interopRequireDefault":11,three:79}],185:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=r(e("@babel/runtime/helpers/classCallCheck")),o=r(e("@babel/runtime/helpers/createClass")),a=r(e("@babel/runtime/helpers/inherits")),s=r(e("@babel/runtime/helpers/possibleConstructorReturn")),l=r(e("@babel/runtime/helpers/getPrototypeOf"));function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}var u=e("three"),h=e("../../core/properties"),d=e("../../audio/audio"),p=function(e){(0,a.default)(n,e);var t=c(n);function n(e,r,o,a){var s;return(0,i.default)(this,n),(s=t.call(this,e,r,o,a[0])).image2=a[1],s.listener=new u.AudioListener,h.scene.add(s.listener),s.positionalAudio=new u.PositionalAudio(s.listener),s.positionalAudio.setMediaElementSource(d.getBGMElementSource()),s.positionalAudio.setRefDistance(5),s.positionalAudio.position.set(4,2,0),h.scene.add(s.positionalAudio),s.isActive=!0,s}return(0,o.default)(n,[{key:"toggle",value:function(){d.toggle()}},{key:"update",value:function(e,t){this.listener.position.copy(t.position),this.listener.quaternion.copy(t.quaternion);var n=d.isActive();this.isActive!==n&&(n?this.drawImage(this.image,this.label):this.drawImage(this.image2,this.label)),this.isActive=n}}]),n}(e("./vrDockButton").default);n.default=p},{"../../audio/audio":80,"../../core/properties":90,"./vrDockButton":184,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/getPrototypeOf":9,"@babel/runtime/helpers/inherits":10,"@babel/runtime/helpers/interopRequireDefault":11,"@babel/runtime/helpers/possibleConstructorReturn":15,three:79}],186:[function(e,t,n){"use strict";var r=e("three"),i=e("../../utils/math"),o=e("../../utils/ease"),a=e("../../core/properties"),s=e("../../core/settings"),l=e("../../webxr/vrControllerRay");n.preInit=function(){u=new r.Texture(a.loadervr.add(s.TEXTURE_PATH+"vr_ui_tutorial.png",{weight:33,onLoad:function(){u.needsUpdate=!0}}).content)},n.init=function(){n.container=new r.Object3D;var e=new r.PlaneBufferGeometry(.8,.45);c=new r.MeshBasicMaterial({map:u,transparent:!0}),(d=new r.Mesh(e,c)).name="vrTutorialPlane",d.renderOrder=4020,d.userData.onSelect=g,n.container.add(d),n.container.position.y+=.375,n.container.position.z-=.25,n.container.rotation.x-=.1*Math.PI,m(),h=setTimeout(v,7e3)},n.show=m,n.hide=v,n.toggle=function(){f?v():m()},n.update=function(e){p=i.clamp(p+(f?1:-1)*e*5,0,1),c.opacity=p,d.visible=p>0,d.position.z=-.05*(1-o.easeOutCubic(p))},n.container=null;var c,u,h,d=1,p=0,f=!1;function m(){f=!0,l.rayCastedMeshes.push(d)}function v(){clearTimeout(h),f=!1;var e=l.rayCastedMeshes.findIndex((function(e){return e.name===d.name}));e>-1&&l.rayCastedMeshes.splice(e,1)}function g(){v()}},{"../../core/properties":90,"../../core/settings":91,"../../utils/ease":164,"../../utils/math":165,"../../webxr/vrControllerRay":178,three:79}],187:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/
10defineProperty"));function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){(0,r.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var a=e("three"),s=e("../../core/settings"),l=e("../../core/properties"),c=e("../../utils/math").map,u=e("../../utils/canvas").rectRound,h=e("../vrControllerRay"),d=e("../../utils/math"),p=e("../../utils/ease");n.init=function(){n.container=new a.Object3D,f=document.createElement("canvas"),m=f.getContext("2d"),f.width=_,f.height=w,y=new a.CanvasTexture(f),function(){m.font="35px t26-carbon",m.textAlign="center",m.textBaseline="middle";var e=m.measureText(L.value);g={x:-e.actualBoundingBoxLeft-S,y:-e.actualBoundingBoxAscent-S,w:e.actualBoundingBoxLeft+e.actualBoundingBoxRight+64,h:e.actualBoundingBoxAscent+e.actualBoundingBoxDescent+64},v=[C,L].map((function(e){return{min:{x:c(e.x+g.x,0,_,-.25,.25),y:c(e.y+g.y+g.h,0,w,.146484375,-.146484375)},max:{x:c(e.x+g.x+g.w,0,_,-.25,.25),y:c(e.y+g.y,0,w,.146484375,-.146484375)}}}))}(),e=new a.PlaneBufferGeometry(M,T),x=new a.ShaderMaterial({uniforms:{u_texture:{value:y},u_opacity:{value:k},u_hover:{value:0},u_button:{value:0}},vertexShader:"\n varying vec2 v_uv;\n \n void main() {\n v_uv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n uniform sampler2D u_texture;\n uniform float u_opacity;\n uniform float u_hover;\n uniform float u_button;\n\n varying vec2 v_uv;\n\n void main() {\n vec4 texture = texture2D(u_texture, v_uv);\n\n vec3 color = vec3(0.02, 0.063, 0.082);\n color += mix(\n texture.r,\n mix(texture.g, texture.b, u_button),\n u_hover\n );\n float alpha = u_opacity * texture.a;\n \n gl_FragColor = vec4(color, alpha);\n }\n ",transparent:!0}),(b=new a.Mesh(e,x)).renderOrder=4050,b.name="vrPromptPlane",n.container.add(b),n.container.name="vrPrompt",n.container.position.y+=.375,n.container.position.z-=.24,n.container.rotation.x-=.1*Math.PI,F();var e},n.show=G,n.hide=H,n.select=U,n.error=function(){B.error=!0,G()},n.update=function(e){k=d.clamp(k+(z?1:-1)*e*5,0,1),b.visible=k>0,b.position.z=-.05*(1-p.easeOutCubic(k)),x.uniforms.u_opacity.value=k,l.isRaycastingPrompt&&(N=v.findIndex((function(e){return l.rayOnPromptIntersection.x>=e.min.x&&l.rayOnPromptIntersection.x<=e.max.x&&l.rayOnPromptIntersection.y>=e.min.y&&l.rayOnPromptIntersection.y<=e.max.y})))>-1?(x.uniforms.u_hover.value=1,x.uniforms.u_button.value=N):x.uniforms.u_hover.value=0},s.EXPOSE_FUNCTIONS&&(window.vrPrompt={},window.vrPrompt.onSelectLeft=function(){N=0,U()},window.vrPrompt.onSelectRight=function(){N=1,U()}),n.container=null;var f,m,v,g,y,x,b,_=512,w=300,S=32,M=.5,T=.29296875,E=["You are about to","to leave the experience"],C={value:"OK",x:128,y:217.5},L={value:"Cancel",x:384,y:217.5},R=["The API seems unreachable,","please try again later."],A=o(o({},C),{},{value:"Reload"}),P=o(o({},L),{},{value:"Close"}),I=E,O=C,D=L,N=-1,k=0,z=!1,B={};function F(){m.save(),u(m,0,0,_,w,25),m.clip(),m.fillStyle="#000",m.fillRect(0,0,_,w),m.lineWidth=2.5,m.fillStyle="#fff",m.strokeStyle="#fff",m.fillText(I[0],256,60),m.fillText(I[1],256,105),m.fillStyle="#0f0",u(m,O.x+g.x,O.y+g.y,g.w,g.h,25),m.fill(),m.stroke(),m.fillStyle="#f0f",m.fillText(O.value,O.x,O.y),m.fillStyle="#00f",u(m,D.x+g.x,D.y+g.y,g.w,g.h,25),m.fill(),m.stroke(),m.fillStyle="#ff0",m.fillText(D.value,D.x,D.y),m.restore(),y.needsUpdate=!0}function G(){z=!0,h.rayCastedMeshes.push(b)}function H(){z=!1;var e=h.rayCastedMeshes.findIndex((function(e){return e.name===b.name}));e>-1&&h.rayCastedMeshes.splice(e,1)}function U(){B.error?0===N?window.location.reload():(B.error=!1,H()):(0===N&&(l.promptCallback(),l.promptCallback=function(){}),H())}Object.defineProperty(B,"error",{get:function(){return O.value===A.value},set:function(e){e?(I=R,O=A,D=P):(I=E,O=C,D=L),F()}})},{"../../core/properties":90,"../../core/settings":91,"../../utils/canvas":163,"../../utils/ease":164,"../../utils/math":165,"../vrControllerRay":178,"@babel/runtime/helpers/
10defineProperty":7,"@babel/runtime/helpers/interopRequireDefault":11,three:79}],188:[function(e,t,n){"use strict";var r=e("three"),i=e("../../core/properties"),o=e("../../utils/ease"),a=e("../../utils/math"),s=e("../../utils/canvas").rectRound,l=e("../../helpers/webXRHelper");n.init=function(){n.container=new r.Object3D,c=document.createElement("canvas"),u=c.getContext("2d"),c.width=g,c.height=y;var e=new r.PlaneBufferGeometry(.5,.09722222222222222);if(h=new r.CanvasTexture(c),d=new r.MeshBasicMaterial({map:h,transparent:!0}),p=new r.Mesh(e,d),n.container.add(p),n.container.position.y+=.09,n.container.position.z-=.11,n.container.rotation.x-=.25*Math.PI,f=new Path2D("M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"),m=new Path2D("M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"),v=new Path2D("M9,12a3,3 0 1,0 6,0a3,3 0 1,0 -6,0"),i.shaderInfos&&i.shaderInfos.title&&i.shaderInfos.username){var t=i.shaderInfos;w(t.title,t.username,t.likes,t.viewed),S()}l.onSessionEnded.add(T)},n.draw=w,n.show=S,n.hide=M,n.update=function(e){b=a.clamp(b+(_?1:-1)*e*2,0,1),d.opacity=b,p.visible=b>0,p.position.z=-.05*(1-o.easeOutCubic(b))},n.container=null;var c,u,h,d,p,f,m,v,g=900,y=175,x=32,b=0,_=!1;function w(e,t,n,r){u.save(),s(u,0,0,g,y,10),u.clip(),u.fillStyle="#051014",u.fillRect(0,0,g,y),u.textAlign="left",u.textBaseline="top",u.fillStyle="#fff",u.font="50px t26-carbon",u.fillText("".concat(e),x,x);var i=u.createLinearGradient(450,x,902,x);i.addColorStop(0,"#05101400"),i.addColorStop(.6,"#051014"),u.fillStyle=i,u.fillRect(450,x,452,82),u.fillStyle="#fff",u.textAlign="right",u.textBaseline="top",u.font="35px t26-carbon",u.fillText("".concat(n),814,42),u.textAlign="left",u.textBaseline="bottom",u.fillText("by ".concat(t),x,143),u.textAlign="right",u.fillText("".concat(r),814,143),u.restore(),u.strokeStyle="#fff",u.save(),u.translate(824,48),u.stroke(f),u.restore(),u.save(),u.translate(824,113),u.stroke(m),u.stroke(v),u.restore(),h.needsUpdate=!0}function S(){_=!0}function M(){_=!1}function T(){M(),b=0,p.visible=!1,p.position.z=-.05*(1-o.easeOutCubic(b))}},{"../../core/properties":90,"../../helpers/webXRHelper":99,"../../utils/canvas":163,"../../utils/ease":164,"../../utils/math":165,three:79}],189:[function(e,t,n){"use strict";var r,i,o=e("three"),a=(e("../../core/properties"),e("../../core/settings"),e("../../utils/math")),s=(e("../../utils/ease"),e("glslify"));function l(){if(!r){for(var e in(r=new o.TorusBufferGeometry(1,.1,3,18)).rotateX(.5*-Math.PI),i=new o.InstancedBufferGeometry,r.attributes)i.setAttribute(e,r.attributes[e]);i.setIndex(r.getIndex());for(var t=new Float32Array(5),n=0;n<5;n++)t[n]=n/5;i.setAttribute("instanceRatio",new o.InstancedBufferAttribute(t,1))}c.constructor.call(this,i,new o.ShaderMaterial({uniforms:{u_time:{value:0},u_opacity:{value:1}},vertexShader:s(["#define GLSLIFY 1\nuniform float u_time;\nuniform float u_opacity;\nattribute float instanceRatio;\nvarying float v_yRatio;\nvarying float v_opacity;\nvarying vec3 v_viewNormal;\n\nvoid main () {\n\tvec3 pos = position;\n\tv_yRatio = step(0.025, pos.y);\n\tfloat ratio = mod(max(0.0, u_time * 0.45 - instanceRatio), 1.0);\n\tpos *= ratio * ratio;\n\tpos.y = v_yRatio * (1.0 - ratio) * smoothstep(0.0, 0.3, ratio);\n\tv_opacity = (1.0 - ratio) * smoothstep(0.0, 0.2, ratio) * 0.45 * u_opacity;\n\tv_viewNormal = normalMatrix * normal; // wrong but okay\n\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}"]),fragmentShader:s(["#define GLSLIFY 1\nvarying float v_yRatio;\nvarying float v_opacity;\nvarying vec3 v_viewNormal;\n\nvoid main () {\n\tvec3 color = vec3(1.0);\n\tfloat opacity = (1.0 - v_yRatio) * v_opacity * smoothstep(0.0, 1.0, v_viewNormal.z);\n\tgl_FragColor = vec4(color, opacity);\n}"]),depthWrite:!1,transparent:!0,blending:o.CustomBlending,blendEquation:o.AddEquation,blendSrc:o.SrcAlphaFactor,blendDst:o.OneFactor})),this.frustumCulled=!1,this.visible=!1,this.userData.isActive=!1}var c=o.Mesh.prototype,u=l.prototype=Object.create(c);t.exports=l,u.constructor=l,u.reset=function(){this.material.uniforms.u_time.value=0,this.material.uniforms.u_opacity.value=1},u.update=function(e){this.material.uniforms.u_time.value+=e,this.material.uniforms.u_opacity.value=a.clamp(this.material.uniforms.u_opacity.value+(this.userData.isActive?e:-e),0,1),this.visible=this.material.uniforms.u_opacity.value>0}},{"../../core/properties":90,"../../core/settings":91,"../../utils/ease":164,"../../utils/math":165,glslify:30,three:79}],190:[function(e,t,n){"use strict";var r,i,o,a=e("three"),s=(e("../../core/properties"),e("../../core/settings")),l=e("../vrCanvas/vrCanvas"),c=e("./vrGalleryButtons"),u=e("./vrGallerySearch"),h=e("./vrGallerySelector"),d=e("../vrControllerRay"),p=e("../../utils/math"),f=e("../../utils/ease");n.preInit=function(){u.preInit(),h.preInit(),c.preInit()},n.init=function(){i=new a.CanvasTexture(l.canvas),n.container=new a.Object3D,n.container.name="vrGallery";var e=new a.PlaneBufferGeometry(s.CONTAINER_WIDTH,s.CONTAINER_HEIGHT);o=new a.MeshBasicMaterial({map:i,opacity:0,transparent:!0}),(r=new a.Mesh(e,o)).name="vrGalleryGrid",r.renderOrder=4e3,n.container.add(r),n.container.position.set(0,.5*s.CONTAINER_HEIGHT+s.CONTAINER_MARGIN_BOTTOM,-1),r.onBeforeRender=function(){},n.boundingBox=new a.Box3,r.geometry.computeBoundingBox(),n.boundingBox.copy(r.geometry.boundingBox).applyMatrix4(r.matrixWorld),u.init(
10),h.init(),n.container.add(h.container),c.init(),n.container.add(c.container),x()},n.toggle=function(){v?y():(v=!0,d.rayCastedMeshes.push(r))},n.hide=y,n.render=x,n.update=function(e){m=p.clamp(m+(v?1:-1)*e*2,0,1),o.opacity=m,r.visible=m>0,r.position.z=-.05*(1-f.easeOutCubic(m)),c.update(e,m),h.update(e),g+=e,n.needsRender&&g>.25&&(g=0,n.needsRender=!1,x())},n.container=null,n.boundingBox=null,n.needsRender=!1;var m=0,v=!1,g=0;function y(){v=!1;var e=d.rayCastedMeshes.findIndex((function(e){return e.name===r.name}));e>-1&&d.rayCastedMeshes.splice(e,1)}function x(){l.render(),i&&(i.needsUpdate=!0)}},{"../../core/properties":90,"../../core/settings":91,"../../utils/ease":164,"../../utils/math":165,"../vrCanvas/vrCanvas":175,"../vrControllerRay":178,"./vrGalleryButtons":191,"./vrGallerySearch":192,"./vrGallerySelector":193,three:79}],191:[function(e,t,n){"use strict";var r,i,o,a=e("three"),s=e("../../core/properties"),l=e("../../core/settings"),c=e("../../utils/math"),u=e("../../utils/ease"),h=e("./vrGallerySearch"),d=e("../vrControllerRay"),p=e("../vrDock/vrDockButton").default;n.preInit=function(){r=s.loadervr.add("".concat(l.TEXTURE_PATH,"icon-arrow.png"),{weight:9}).content},n.init=function(){n.container=new a.Object3D,n.container.name="vrGalleryButtons",(i=new p(f,"","all",r,100)).mesh.name="vrGalleryButtonLeft",i.mesh.position.set(-l.CONTAINER_WIDTH/2-.1-.05,0,0),i.mesh.material.blending=a.NormalBlending,i.mesh.renderOrder=4001,n.container.add(i.mesh),d.rayCastedMeshes.push(i.mesh),m.push(i),(o=new p(f,"","all",r,100)).mesh.name="vrGalleryButtonRight",o.mesh.position.set(l.CONTAINER_WIDTH/2+.1+.05,0,0),o.mesh.material.blending=a.NormalBlending,o.mesh.renderOrder=4001,o.mesh.rotateZ(Math.PI),n.container.add(o.mesh),d.rayCastedMeshes.push(o.mesh),m.push(o),v()},n.onSelectEnd=function(){v()},n.update=function(e,t){var r=c.fit(t,.25,1,0,1,u.easeOutCubic);n.container.position.z=-.05*(1-r),n.container.visible=r>0,m.forEach((function(e){e.mesh.material.uniforms.u_opacity.value=t;var n=1;e.mesh.userData.isPressed?n=.95:e.mesh.userData.isHovered?e.mesh.material.uniforms.u_mix.value=1:e.mesh.material.uniforms.u_mix.value=0,e.mesh.scale.set(n,n,n)}))},n.container=null;var f=.2,m=[];function v(){var e=i.mesh.visible;if(i.mesh.visible=h.pageIndex>0,i.mesh.visible)e||d.rayCastedMeshes.push(i.mesh);else{var t=d.rayCastedMeshes.indexOf(i.mesh);t>-1&&d.rayCastedMeshes.splice(t,1)}var n=o.mesh.visible;if(o.mesh.visible=h.pageIndex<h.maxIndex,o.mesh.visible)n||d.rayCastedMeshes.push(o.mesh);else{var r=d.rayCastedMeshes.indexOf(o.mesh);r>-1&&d.rayCastedMeshes.splice(r,1)}}},{"../../core/properties":90,"../../core/settings":91,"../../utils/ease":164,"../../utils/math":165,"../vrControllerRay":178,"../vrDock/vrDockButton":184,"./vrGallerySearch":192,three:79}],192:[function(e,t,n){"use strict";var r=e("min-signal"),i=e("../../core/settings"),o=e("../../io/shadertoy"),a=e("../../io/localStorage"),s=e("../../io/backend"),l=e("../vrDock/vrPrompt");n.preInit=function(){},n.init=function(){h()},n.goToPreviousPage=p,n.goToNextPage=f,n.pageIndex=0,n.maxIndex=Number.MAX_VALUE,n.shaderInfosList=[],n.onUpdateCells=new r,n.onPageChange=new r,i.EXPOSE_FUNCTIONS&&(window.vrGallerySearch={goToPreviousPage:p,goToNextPage:f});var c=i.CELLS_PER_ROW*i.CELLS_PER_COLUMN,u=[];function h(){s.getIds(n.pageIndex*c,c,"popular",d)}function d(e){if(e.success){for(var t=0,r=e.idList.length;t<r;t++){var i=e.idList[t];u.includes(i)||(u.push(i),m(i))}e.isEnd&&(n.maxIndex=Math.floor(u.length/c)),g()}else l.error()}function p(){n.pageIndex>0&&(n.pageIndex--,n.onPageChange.dispatch(),g())}function f(){n.pageIndex<n.maxIndex&&(n.pageIndex++,n.onPageChange.dispatch(),h())}function m(e){var t=a.loadShader(e),n=Date.now()-t.timestamp;!!t&&n<=3e5?v({success:1,shaderInfo:t.shaderInfo}):o.load(e,v,!1)}function v(e){if(e.success){var t=e.shaderInfo;n.shaderInfosList.push(t),a.saveShader(t.id,t)}g()}function g(){for(var e=[],t=c*n.pageIndex,r=c*n.pageIndex+c;t<r;t++)e.push(n.shaderInfosList[t]);n.onUpdateCells.dispatch(e)}i.EXPOSE_FUNCTIONS&&(window.vrGallerySearch={},window.vrGallerySearch.goToPreviousPage=p,window.vrGallerySearch.goToNextPage=f)},{"../../core/settings":91,"../../io/backend":102,"../../io/localStorage":105,"../../io/shadertoy":110,"../vrDock/vrPrompt":187,"min-signal":32}],193:[function(e,t,n){"use strict";var r=e("three"),i=e("glslify"),o=e("../../utils/math"),a=e("../../
10helpers/webXRHelper"),s=e("../../core/properties"),l=e("../../core/settings"),c=e("./vrGallery"),u=e("../vrCanvas/vrCanvasGrid/vrCanvasGrid");n.preInit=function(){n.container=new r.Object3D,s.loadervr.add(l.MODEL_PATH+"vr_selector.buf",{weight:2,onLoad:w})},n.init=function(){n.container.name="vrGallerySelector",n.container.position.set(0,0,.01);for(var e=0,t=l.CELLS_PER_ROW;e<t;e++){var r=.5*l.SELECTOR_WIDTH+o.fit(e,0,l.CELLS_PER_ROW,c.boundingBox.min.x,c.boundingBox.max.x);y.x.push(r)}for(var i=l.CONTAINER_PADDING*l.CONTAINER_HEIGHT/l.CANVAS_UI_HEIGHT,s=l.MARGIN_BETWEEN_CELLS*l.CONTAINER_HEIGHT/l.CANVAS_UI_HEIGHT,u=0,h=l.CELLS_PER_COLUMN;u<h;u++){var d=.5*l.SELECTOR_HEIGHT+o.fit(u,0,l.CELLS_PER_COLUMN,c.boundingBox.min.y+s/2*(l.CELLS_PER_COLUMN-1),c.boundingBox.max.y-i);y.y.push(d)}a.onSessionEnded.add(S)},n.onSelectStart=function(){x=!0},n.onSelectEnd=function(){x=!1},n.selectCell=function(){(g=u.cells[n.hoverIndex]).select()},n.update=function(e){null!==n.hoverIndex&&n.prevHoverIndex!==n.hoverIndex&&(_=0);if(n.prevHoverIndex=n.hoverIndex,b=o.clamp(b+(s.isRaycastingGallery?1:-1)*e,0,1),_=o.clamp(_+e,0,1),s.isRaycastingGallery){h=0,d=0;for(var t=0,r=y.x.length;t<r;t++)s.rayOnGalleryIntersection.x>y.x[t]-l.SELECTOR_WIDTH/2&&(h=t);for(var i=0,a=y.y.length;i<a;i++)s.rayOnGalleryIntersection.y>y.y[i]-l.SELECTOR_HEIGHT/2&&(d=i);p=y.x[h],f=y.y[d],m=x?1e-4:.01,n.container.position.set(p,f,m),v&&v.uniforms.u_color.value.set(x?65453:16777215),d=l.CELLS_PER_COLUMN-d-1,n.hoverIndex=h+d*l.CELLS_PER_ROW}else n.hoverIndex=null;v&&(v.uniforms.u_time.value+=e,v.uniforms.u_visibleRatio.value=b,v.uniforms.u_hoverRatio.value=_);n.container.visible=b>0},n.container=null,n.hoverIndex=null,n.prevHoverIndex=null;var h,d,p,f,m,v,g,y={x:[],y:[]},x=!1,b=0,_=0;function w(e){v=new r.ShaderMaterial({uniforms:{u_time:{value:0},u_visibleRatio:{value:0},u_hoverRatio:{value:0},u_tubeRadius:{value:.0175},u_color:{value:new r.Color},u_size:{value:new r.Vector2(l.SELECTOR_WIDTH,l.SELECTOR_HEIGHT)}},vertexShader:i(["#define GLSLIFY 1\nattribute float r;\n\nuniform float u_hoverRatio;\nuniform float u_visibleRatio;\nuniform float u_time;\nuniform float u_tubeRadius;\nuniform vec2 u_size;\n\nvarying float v_opacity;\nvarying float v_angle;\n\nfloat easeOutBack (float e) {\n\tfloat t = 1.70158;\n\treturn --e * e * ((t + 1.0) * e + t) + 1.0;\n}\n\nvoid main () {\n\tconst float W = 0.7071067811865476;\n\tconst float PI = 3.141592653589793;\n\tvec3 pos = position;\n\tvec2 sides = step(vec2(0.0), pos.xy) * 2.0 - 1.0;\n\n\tvec2 centerPos = sides * u_size * 0.5;\n\tfloat centerAngle = r * PI * 4.0;\n\tv_angle = centerAngle + u_time * 4.0;\n\n\tpos = (pos - vec3(sides, 0.0)) * u_tubeRadius * easeOutBack(u_hoverRatio);\n\n\tpos.xy += centerPos;\n\n\tv_opacity = smoothstep(-1.0, 1.0, dot(normal, vec3(0.5773502691896257))) * u_visibleRatio;\n\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}"]),fragmentShader:i(["#define GLSLIFY 1\nuniform vec3 u_color;\n\nvarying float v_opacity;\nvarying float v_angle;\n\nvoid main () {\n\tfloat ratio = cos(v_angle) * 0.5 + 0.5;\n\tfloat l = smoothstep(0.0, 1.0, ratio);\n\tgl_FragColor = vec4(u_color, l * v_opacity);\n}"]),depthWrite:!1,transparent:!0});var t=new r.Mesh(e,v);t.renderOrder=4005,n.container.add(t)}function S(){g&&(g.unselect(),g=null)}},{"../../core/properties":90,"../../core/settings":91,"../../helpers/webXRHelper":99,"../../utils/math":165,"../vrCanvas/vrCanvasGrid/vrCanvasGrid":177,"./vrGallery":190,glslify:30,three:79}],194:[function(e,t,n){"use strict";var r,i,o,a=e("three"),s=e("../../core/properties"),l=e("../../core/settings"),c=e("../../utils/math"),u=e("../../utils/ease");n.preInit=function(){i=new a.Texture(s.loadervr.add(l.TEXTURE_PATH+"vr_ui_spinner.png",{weight:1,onLoad:function(){i.needsUpdate=!0}}).content)},n.init=function(){n.container=new a.Object3D,n.container.name="vrGallerySpinner";var e=new a.PlaneBufferGeometry(.15,.15);o=new a.MeshBasicMaterial({map:i,transparent:!0,opacity:h,alphaTest:.5}),(r=new a.Mesh(e,o)).name="vrGallerySpinnerPlane",n.container.add(r),n.container.position.set(0,.05,-.95)},n.show=function(){d=.04},n.hide=function(){d=-.04},n.update=function(e){p=h>.001,h=c.clamp(h+d,0,1),p&&(r.rotateZ(-.3),o.opacity=u.easeOutCubic(h))},n.container=null;var h=0,d=0,p=!1},{"../../core/properties":90,"../../core/settings":91,"../../utils/ease":164,"../../utils/math":165,three:79}],195:[function(e,t,n){"use strict";var r=e("gsap").gsap;n.init=function(e){l=e,i=document.querySelector("#preloader-vr"),o=document.querySelector("#preloader-vr__progress__percent")},n.onPreloading=function(e){i.style.display="flex",a&&a.kill();a=r.to(s,1,{percent:e,onUpdate:c,onComplete:u})},n.isComplete=!1;var i,o,a,s={percent:0},l=function(){};function c(){o.innerHTML=Math.floor(100*s.percent)}
10function u(){1===s.percent&&(i.style.display="none",n.isComplete=!0,l())}},{gsap:31}],196:[function(e,t,n){"use strict";var r=e("../core/properties"),i=e("../core/settings"),o=e("./vrControllers"),a=e("./vrDock/vrDock"),s=e("./vrGallery/vrGallery"),l=e("./vrCanvas/vrCanvas"),c=e("../helpers/webXRHelper");n.preInit=function(){o.preInit(),a.preInit(),l.preInit(),i.IS_CANVAS_DEBUG&&(l.init(),l.render())},n.init=function(){if(u)return;o.init(),i.IS_CANVAS_DEBUG||(l.init(),l.render());a.init(),c.onSessionStarted.add(h),c.onSessionEnded.add(d),u=!0},n.resize=function(e,t){u&&i.IS_CANVAS_DEBUG&&l.resize(e,t)},n.update=function(e){u&&(r.renderer.xr.isPresenting?(o.update(e),l.update(e),a.update(e)):i.IS_CANVAS_DEBUG&&l.update(e))};var u=!1;function h(){a.container.visible=!0}function d(){a.container.visible=!1,s.hide()}},{"../core/properties":90,"../core/settings":91,"../helpers/webXRHelper":99,"./vrCanvas/vrCanvas":175,"./vrControllers":179,"./vrDock/vrDock":183,"./vrGallery/vrGallery":190}]},{},[100]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.