/*! For license information please see vendor.js.LICENSE.txt */
(self.webpackChunkaq_html_boilerplate=self.webpackChunkaq_html_boilerplate||[]).push([[429],{30:function(e,t,r){e.exports=r(777)},125:function(e,t,r){"use strict";var n,i=r(700);i.canUseDOM&&(n=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var r="on"+e,o=r in document;if(!o){var s=document.createElement("div");s.setAttribute(r,"return;"),o="function"==typeof s[r]}return!o&&n&&"wheel"===e&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}},127:function(){!function(){"use strict";if("object"==typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var e=function(){for(var e=window.document,t=i(e);t;)t=i(e=t.ownerDocument);return e}(),t=[],r=null,n=null;s.prototype.THROTTLE_TIMEOUT=100,s.prototype.POLL_INTERVAL=null,s.prototype.USE_MUTATION_OBSERVER=!0,s._setupCrossOriginUpdater=function(){return r||(r=function(e,r){n=e&&r?h(e,r):{top:0,bottom:0,left:0,right:0,width:0,height:0},t.forEach((function(e){e._checkForIntersections()}))}),r},s._resetCrossOriginUpdater=function(){r=null,n=null},s.prototype.observe=function(e){if(!this._observationTargets.some((function(t){return t.element==e}))){if(!e||1!=e.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:e,entry:null}),this._monitorIntersections(e.ownerDocument),this._checkForIntersections()}},s.prototype.unobserve=function(e){this._observationTargets=this._observationTargets.filter((function(t){return t.element!=e})),this._unmonitorIntersections(e.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},s.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},s.prototype.takeRecords=function(){var e=this._queuedEntries.slice();return this._queuedEntries=[],e},s.prototype._initThresholds=function(e){var t=e||[0];return Array.isArray(t)||(t=[t]),t.sort().filter((function(e,t,r){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return e!==r[t-1]}))},s.prototype._parseRootMargin=function(e){var t=(e||"0px").split(/\s+/).map((function(e){var t=/^(-?\d*\.?\d+)(px|%)$/.exec(e);if(!t)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(t[1]),unit:t[2]}}));return t[1]=t[1]||t[0],t[2]=t[2]||t[0],t[3]=t[3]||t[1],t},s.prototype._monitorIntersections=function(t){var r=t.defaultView;if(r&&-1==this._monitoringDocuments.indexOf(t)){var n=this._checkForIntersections,o=null,s=null;this.POLL_INTERVAL?o=r.setInterval(n,this.POLL_INTERVAL):(a(r,"resize",n,!0),a(t,"scroll",n,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in r&&(s=new r.MutationObserver(n)).observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(t),this._monitoringUnsubscribes.push((function(){var e=t.defaultView;e&&(o&&e.clearInterval(o),l(e,"resize",n,!0)),l(t,"scroll",n,!0),s&&s.disconnect()}));var c=this.root&&(this.root.ownerDocument||this.root)||e;if(t!=c){var u=i(t);u&&this._monitorIntersections(u.ownerDocument)}}},s.prototype._unmonitorIntersections=function(t){var r=this._monitoringDocuments.indexOf(t);if(-1!=r){var n=this.root&&(this.root.ownerDocument||this.root)||e,o=this._observationTargets.some((function(e){var r=e.element.ownerDocument;if(r==t)return!0;for(;r&&r!=n;){var o=i(r);if((r=o&&o.ownerDocument)==t)return!0}return!1}));if(!o){var s=this._monitoringUnsubscribes[r];if(this._monitoringDocuments.splice(r,1),this._monitoringUnsubscribes.splice(r,1),s(),t!=n){var a=i(t);a&&this._unmonitorIntersections(a.ownerDocument)}}}},s.prototype._unmonitorAllIntersections=function(){var e=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var t=0;t<e.length;t++)e[t]()},s.prototype._checkForIntersections=function(){if(this.root||!r||n){var e=this._rootIsInDom(),t=e?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach((function(n){var i=n.element,s=c(i),a=this._rootContainsTarget(i),l=n.entry,u=e&&a&&this._computeTargetAndRootIntersection(i,s,t),h=null;this._rootContainsTarget(i)?r&&!this.root||(h=t):h={top:0,bottom:0,left:0,right:0,width:0,height:0};var d=n.entry=new o({time:window.performance&&performance.now&&performance.now(),target:i,boundingClientRect:s,rootBounds:h,intersectionRect:u});l?e&&a?this._hasCrossedThreshold(l,d)&&this._queuedEntries.push(d):l&&l.isIntersecting&&this._queuedEntries.push(d):this._queuedEntries.push(d)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},s.prototype._computeTargetAndRootIntersection=function(t,i,o){if("none"!=window.getComputedStyle(t).display){for(var s,a,l,u,d,f,m,y,g=i,v=p(t),b=!1;!b&&v;){var _=null,x=1==v.nodeType?window.getComputedStyle(v):{};if("none"==x.display)return null;if(v==this.root||9==v.nodeType)if(b=!0,v==this.root||v==e)r&&!this.root?!n||0==n.width&&0==n.height?(v=null,_=null,g=null):_=n:_=o;else{var w=p(v),S=w&&c(w),M=w&&this._computeTargetAndRootIntersection(w,S,o);S&&M?(v=w,_=h(S,M)):(v=null,g=null)}else{var T=v.ownerDocument;v!=T.body&&v!=T.documentElement&&"visible"!=x.overflow&&(_=c(v))}if(_&&(s=_,a=g,void 0,void 0,void 0,void 0,void 0,void 0,l=Math.max(s.top,a.top),u=Math.min(s.bottom,a.bottom),d=Math.max(s.left,a.left),y=u-l,g=(m=(f=Math.min(s.right,a.right))-d)>=0&&y>=0&&{top:l,bottom:u,left:d,right:f,width:m,height:y}||null),!g)break;v=v&&p(v)}return g}},s.prototype._getRootRect=function(){var t;if(this.root&&!f(this.root))t=c(this.root);else{var r=f(this.root)?this.root:e,n=r.documentElement,i=r.body;t={top:0,left:0,right:n.clientWidth||i.clientWidth,width:n.clientWidth||i.clientWidth,bottom:n.clientHeight||i.clientHeight,height:n.clientHeight||i.clientHeight}}return this._expandRectByRootMargin(t)},s.prototype._expandRectByRootMargin=function(e){var t=this._rootMarginValues.map((function(t,r){return"px"==t.unit?t.value:t.value*(r%2?e.width:e.height)/100})),r={top:e.top-t[0],right:e.right+t[1],bottom:e.bottom+t[2],left:e.left-t[3]};return r.width=r.right-r.left,r.height=r.bottom-r.top,r},s.prototype._hasCrossedThreshold=function(e,t){var r=e&&e.isIntersecting?e.intersectionRatio||0:-1,n=t.isIntersecting?t.intersectionRatio||0:-1;if(r!==n)for(var i=0;i<this.thresholds.length;i++){var o=this.thresholds[i];if(o==r||o==n||o<r!=o<n)return!0}},s.prototype._rootIsInDom=function(){return!this.root||d(e,this.root)},s.prototype._rootContainsTarget=function(t){var r=this.root&&(this.root.ownerDocument||this.root)||e;return d(r,t)&&(!this.root||r==t.ownerDocument)},s.prototype._registerInstance=function(){t.indexOf(this)<0&&t.push(this)},s.prototype._unregisterInstance=function(){var e=t.indexOf(this);-1!=e&&t.splice(e,1)},window.IntersectionObserver=s,window.IntersectionObserverEntry=o}function i(e){try{return e.defaultView&&e.defaultView.frameElement||null}catch(e){return null}}function o(e){this.time=e.time,this.target=e.target,this.rootBounds=u(e.rootBounds),this.boundingClientRect=u(e.boundingClientRect),this.intersectionRect=u(e.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0}),this.isIntersecting=!!e.intersectionRect;var t=this.boundingClientRect,r=t.width*t.height,n=this.intersectionRect,i=n.width*n.height;this.intersectionRatio=r?Number((i/r).toFixed(4)):this.isIntersecting?1:0}function s(e,t){var r,n,i,o=t||{};if("function"!=typeof e)throw new Error("callback must be a function");if(o.root&&1!=o.root.nodeType&&9!=o.root.nodeType)throw new Error("root must be a Document or Element");this._checkForIntersections=(r=this._checkForIntersections.bind(this),n=this.THROTTLE_TIMEOUT,i=null,function(){i||(i=setTimeout((function(){r(),i=null}),n))}),this._callback=e,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(o.rootMargin),this.thresholds=this._initThresholds(o.threshold),this.root=o.root||null,this.rootMargin=this._rootMarginValues.map((function(e){return e.value+e.unit})).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}function a(e,t,r,n){"function"==typeof e.addEventListener?e.addEventListener(t,r,n||!1):"function"==typeof e.attachEvent&&e.attachEvent("on"+t,r)}function l(e,t,r,n){"function"==typeof e.removeEventListener?e.removeEventListener(t,r,n||!1):"function"==typeof e.detachEvent&&e.detachEvent("on"+t,r)}function c(e){var t;try{t=e.getBoundingClientRect()}catch(e){}return t?(t.width&&t.height||(t={top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.right-t.left,height:t.bottom-t.top}),t):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function u(e){return!e||"x"in e?e:{top:e.top,y:e.top,bottom:e.bottom,left:e.left,x:e.left,right:e.right,width:e.width,height:e.height}}function h(e,t){var r=t.top-e.top,n=t.left-e.left;return{top:r,left:n,height:t.height,width:t.width,bottom:r+t.height,right:n+t.width}}function d(e,t){for(var r=t;r;){if(r==e)return!0;r=p(r)}return!1}function p(t){var r=t.parentNode;return 9==t.nodeType&&t!=e?i(t):(r&&r.assignedSlot&&(r=r.assignedSlot.parentNode),r&&11==r.nodeType&&r.host?r.host:r)}function f(e){return e&&9===e.nodeType}}()},323:function(e,t,r){"use strict";r.d(t,{Sq:function(){return f}});var n,i,o=function(){return n||"undefined"!=typeof window&&(n=window.gsap)&&n.registerPlugin&&n},s=function(e,t){return!!(void 0===e?t:e&&!~(e+"").indexOf("false"))},a=function(e){if(n=e||o()){i=n.registerEase;var t,r=n.parseEase(),s=function(e){return function(t){var r=.5+t/2;e.config=function(t){return e(2*(1-t)*t*r+t*t)}}};for(t in r)r[t].config||s(r[t]);for(t in i("slow",d),i("expoScale",p),i("rough",f),m)"version"!==t&&n.core.globals(t,m[t])}},l=function(e,t,r){var n=(e=Math.min(1,e||.7))<1?t||0===t?t:.7:0,i=(1-e)/2,o=i+e,a=s(r);return function(e){var t=e+(.5-e)*n;return e<i?a?1-(e=1-e/i)*e:t-(e=1-e/i)*e*e*e*t:e>o?a?1===e?0:1-(e=(e-o)/i)*e:t+(e-t)*(e=(e-o)/i)*e*e*e:a?1:t}},c=function(e,t,r){var i=Math.log(t/e),o=t-e;return r&&(r=n.parseEase(r)),function(t){return(e*Math.exp(i*(r?r(t):t))-e)/o}},u=function(e,t,r){this.t=e,this.v=t,r&&(this.next=r,r.prev=this,this.c=r.v-t,this.gap=r.t-e)},h=function(e){"object"!=typeof e&&(e={points:+e||20});for(var t,r,i,o,a,l,c,h=e.taper||"none",d=[],p=0,f=0|(+e.points||20),m=f,y=s(e.randomize,!0),g=s(e.clamp),v=n?n.parseEase(e.template):0,b=.4*(+e.strength||1);--m>-1;)t=y?Math.random():1/f*m,r=v?v(t):t,i="none"===h?b:"out"===h?(o=1-t)*o*b:"in"===h?t*t*b:t<.5?(o=2*t)*o*.5*b:(o=2*(1-t))*o*.5*b,y?r+=Math.random()*i-.5*i:m%2?r+=.5*i:r-=.5*i,g&&(r>1?r=1:r<0&&(r=0)),d[p++]={x:t,y:r};for(d.sort((function(e,t){return e.x-t.x})),l=new u(1,1,null),m=f;m--;)a=d[m],l=new u(a.x,a.y,l);return c=new u(0,0,l.t?l:l.next),function(e){var t=c;if(e>t.t){for(;t.next&&e>=t.t;)t=t.next;t=t.prev}else for(;t.prev&&e<=t.t;)t=t.prev;return c=t,t.v+(e-t.t)/t.gap*t.c}},d=l(.7);d.ease=d,d.config=l;var p=c(1,2);p.config=c;var f=h();f.ease=f,f.config=h;var m={SlowMo:d,RoughEase:f,ExpoScaleEase:p};for(var y in m)m[y].register=a,m[y].version="3.12.7";o()&&n.registerPlugin(d)},571:function(e,t,r){"use strict";r.d(t,{I:function(){return _}});var n,i,o,s,a,l,c,u,h=function(){return"undefined"!=typeof window},d=function(){return n||h()&&(n=window.gsap)&&n.registerPlugin&&n},p=function(e){return"string"==typeof e},f=function(e){return"function"==typeof e},m=function(e,t){var r="x"===t?"Width":"Height",n="scroll"+r,i="client"+r;return e===o||e===s||e===a?Math.max(s[n],a[n])-(o["inner"+r]||s[i]||a[i]):e[n]-e["offset"+r]},y=function(e,t){var r="scroll"+("x"===t?"Left":"Top");return e===o&&(null!=e.pageXOffset?r="page"+t.toUpperCase()+"Offset":e=null!=s[r]?s:a),function(){return e[r]}},g=function(e,t){if(!(e=l(e)[0])||!e.getBoundingClientRect)return console.warn("scrollTo target doesn't exist. Using 0")||{x:0,y:0};var r=e.getBoundingClientRect(),n=!t||t===o||t===a,i=n?{top:s.clientTop-(o.pageYOffset||s.scrollTop||a.scrollTop||0),left:s.clientLeft-(o.pageXOffset||s.scrollLeft||a.scrollLeft||0)}:t.getBoundingClientRect(),c={x:r.left-i.left,y:r.top-i.top};return!n&&t&&(c.x+=y(t,"x")(),c.y+=y(t,"y")()),c},v=function(e,t,r,n,i){return isNaN(e)||"object"==typeof e?p(e)&&"="===e.charAt(1)?parseFloat(e.substr(2))*("-"===e.charAt(0)?-1:1)+n-i:"max"===e?m(t,r)-i:Math.min(m(t,r),g(e,t)[r]-i):parseFloat(e)-i},b=function(){n=d(),h()&&n&&"undefined"!=typeof document&&document.body&&(o=window,a=document.body,s=document.documentElement,l=n.utils.toArray,n.config({autoKillThreshold:7}),c=n.config(),i=1)},_={version:"3.12.7",name:"scrollTo",rawVars:1,register:function(e){n=e,b()},init:function(e,t,r,s,a){i||b();var l=this,h=n.getProperty(e,"scrollSnapType");l.isWin=e===o,l.target=e,l.tween=r,t=function(e,t,r,n){if(f(e)&&(e=e(t,r,n)),"object"!=typeof e)return p(e)&&"max"!==e&&"="!==e.charAt(1)?{x:e,y:e}:{y:e};if(e.nodeType)return{y:e,x:e};var i,o={};for(i in e)o[i]="onAutoKill"!==i&&f(e[i])?e[i](t,r,n):e[i];return o}(t,s,e,a),l.vars=t,l.autoKill=!!("autoKill"in t?t:c).autoKill,l.getX=y(e,"x"),l.getY=y(e,"y"),l.x=l.xPrev=l.getX(),l.y=l.yPrev=l.getY(),u||(u=n.core.globals().ScrollTrigger),"smooth"===n.getProperty(e,"scrollBehavior")&&n.set(e,{scrollBehavior:"auto"}),h&&"none"!==h&&(l.snap=1,l.snapInline=e.style.scrollSnapType,e.style.scrollSnapType="none"),null!=t.x?(l.add(l,"x",l.x,v(t.x,e,"x",l.x,t.offsetX||0),s,a),l._props.push("scrollTo_x")):l.skipX=1,null!=t.y?(l.add(l,"y",l.y,v(t.y,e,"y",l.y,t.offsetY||0),s,a),l._props.push("scrollTo_y")):l.skipY=1},render:function(e,t){for(var r,n,i,s,a,l=t._pt,h=t.target,d=t.tween,p=t.autoKill,f=t.xPrev,y=t.yPrev,g=t.isWin,v=t.snap,b=t.snapInline;l;)l.r(e,l.d),l=l._next;r=g||!t.skipX?t.getX():f,i=(n=g||!t.skipY?t.getY():y)-y,s=r-f,a=c.autoKillThreshold,t.x<0&&(t.x=0),t.y<0&&(t.y=0),p&&(!t.skipX&&(s>a||s<-a)&&r<m(h,"x")&&(t.skipX=1),!t.skipY&&(i>a||i<-a)&&n<m(h,"y")&&(t.skipY=1),t.skipX&&t.skipY&&(d.kill(),t.vars.onAutoKill&&t.vars.onAutoKill.apply(d,t.vars.onAutoKillParams||[]))),g?o.scrollTo(t.skipX?r:t.x,t.skipY?n:t.y):(t.skipY||(h.scrollTop=t.y),t.skipX||(h.scrollLeft=t.x)),!v||1!==e&&0!==e||(n=h.scrollTop,r=h.scrollLeft,b?h.style.scrollSnapType=b:h.style.removeProperty("scroll-snap-type"),h.scrollTop=n+1,h.scrollLeft=r+1,h.scrollTop=n,h.scrollLeft=r),t.xPrev=t.x,t.yPrev=t.y,u&&u.update()},kill:function(e){var t="scrollTo"===e,r=this._props.indexOf(e);return(t||"scrollTo_x"===e)&&(this.skipX=1),(t||"scrollTo_y"===e)&&(this.skipY=1),r>-1&&this._props.splice(r,1),!this._props.length}};_.max=m,_.getOffset=g,_.buildGetter=y,_.config=function(e){for(var t in c||b()||(c=n.config()),e)c[t]=e[t]},d()&&n.registerPlugin(_)},575:function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r.d(t,{u:function(){return lr}});var i,o,s,a,l,c,u,h,d,p,f,m,y,g=function(){return i||"undefined"!=typeof window&&(i=window.gsap)&&i.registerPlugin&&i},v=1,b=[],_=[],x=[],w=Date.now,S=function(e,t){return t},M=function(e,t){return~x.indexOf(e)&&x[x.indexOf(e)+1][t]},T=function(e){return!!~p.indexOf(e)},E=function(e,t,r,n,i){return e.addEventListener(t,r,{passive:!1!==n,capture:!!i})},j=function(e,t,r,n){return e.removeEventListener(t,r,!!n)},A="scrollLeft",L="scrollTop",C=function(){return f&&f.isPressed||_.cache++},P=function(e,t){var r=function r(n){if(n||0===n){v&&(s.history.scrollRestoration="manual");var i=f&&f.isPressed;n=r.v=Math.round(n)||(f&&f.iOS?1:0),e(n),r.cacheID=_.cache,i&&S("ss",n)}else(t||_.cache!==r.cacheID||S("ref"))&&(r.cacheID=_.cache,r.v=e());return r.v+r.offset};return r.offset=0,e&&r},R={s:A,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:P((function(e){return arguments.length?s.scrollTo(e,O.sc()):s.pageXOffset||a[A]||l[A]||c[A]||0}))},O={s:L,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:R,sc:P((function(e){return arguments.length?s.scrollTo(R.sc(),e):s.pageYOffset||a[L]||l[L]||c[L]||0}))},k=function(e,t){return(t&&t._ctx&&t._ctx.selector||i.utils.toArray)(e)[0]||("string"==typeof e&&!1!==i.config().nullTargetWarn?console.warn("Element not found:",e):null)},I=function(e,t){var r=t.s,n=t.sc;T(e)&&(e=a.scrollingElement||l);var o=_.indexOf(e),s=n===O.sc?1:2;!~o&&(o=_.push(e)-1),_[o+s]||E(e,"scroll",C);var c=_[o+s],u=c||(_[o+s]=P(M(e,r),!0)||(T(e)?n:P((function(t){return arguments.length?e[r]=t:e[r]}))));return u.target=e,c||(u.smooth="smooth"===i.getProperty(e,"scrollBehavior")),u},D=function(e,t,r){var n=e,i=e,o=w(),s=o,a=t||50,l=Math.max(500,3*a),c=function(e,t){var l=w();t||l-o>a?(i=n,n=e,s=o,o=l):r?n+=e:n=i+(e-i)/(l-s)*(o-s)};return{update:c,reset:function(){i=n=r?0:n,s=o=0},getVelocity:function(e){var t=s,a=i,u=w();return(e||0===e)&&e!==n&&c(e),o===s||u-s>l?0:(n+(r?a:-a))/((r?u:o)-t)*1e3}}},N=function(e,t){return t&&!e._gsapAllow&&e.preventDefault(),e.changedTouches?e.changedTouches[0]:e},F=function(e){var t=Math.max.apply(Math,e),r=Math.min.apply(Math,e);return Math.abs(t)>=Math.abs(r)?t:r},U=function(){var e,t,r,n;(d=i.core.globals().ScrollTrigger)&&d.core&&(e=d.core,t=e.bridge||{},r=e._scrollers,n=e._proxies,r.push.apply(r,_),n.push.apply(n,x),_=r,x=n,S=function(e,r){return t[e](r)})},B=function(e){return i=e||g(),!o&&i&&"undefined"!=typeof document&&document.body&&(s=window,a=document,l=a.documentElement,c=a.body,p=[s,a,l,c],i.utils.clamp,y=i.core.context||function(){},h="onpointerenter"in c?"pointer":"mouse",u=z.isTouch=s.matchMedia&&s.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in s||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,m=z.eventTypes=("ontouchstart"in l?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in l?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout((function(){return v=0}),500),U(),o=1),o};R.op=O,_.cache=0;var z=function(){function e(e){this.init(e)}var t,r;return e.prototype.init=function(e){o||B(i)||console.warn("Please gsap.registerPlugin(Observer)"),d||U();var t=e.tolerance,r=e.dragMinimum,n=e.type,p=e.target,g=e.lineHeight,v=e.debounce,_=e.preventDefault,x=e.onStop,S=e.onStopDelay,M=e.ignore,A=e.wheelSpeed,L=e.event,P=e.onDragStart,z=e.onDragEnd,G=e.onDrag,V=e.onPress,H=e.onRelease,W=e.onRight,q=e.onLeft,X=e.onUp,Y=e.onDown,Z=e.onChangeX,J=e.onChangeY,K=e.onChange,Q=e.onToggleX,$=e.onToggleY,ee=e.onHover,te=e.onHoverEnd,re=e.onMove,ne=e.ignoreCheck,ie=e.isNormalizer,oe=e.onGestureStart,se=e.onGestureEnd,ae=e.onWheel,le=e.onEnable,ce=e.onDisable,ue=e.onClick,he=e.scrollSpeed,de=e.capture,pe=e.allowClicks,fe=e.lockAxis,me=e.onLockAxis;this.target=p=k(p)||l,this.vars=e,M&&(M=i.utils.toArray(M)),t=t||1e-9,r=r||0,A=A||1,he=he||1,n=n||"wheel,touch,pointer",v=!1!==v,g||(g=parseFloat(s.getComputedStyle(c).lineHeight)||22);var ye,ge,ve,be,_e,xe,we,Se=this,Me=0,Te=0,Ee=e.passive||!_&&!1!==e.passive,je=I(p,R),Ae=I(p,O),Le=je(),Ce=Ae(),Pe=~n.indexOf("touch")&&!~n.indexOf("pointer")&&"pointerdown"===m[0],Re=T(p),Oe=p.ownerDocument||a,ke=[0,0,0],Ie=[0,0,0],De=0,Ne=function(){return De=w()},Fe=function(e,t){return(Se.event=e)&&M&&~M.indexOf(e.target)||t&&Pe&&"touch"!==e.pointerType||ne&&ne(e,t)},Ue=function(){var e=Se.deltaX=F(ke),r=Se.deltaY=F(Ie),n=Math.abs(e)>=t,i=Math.abs(r)>=t;K&&(n||i)&&K(Se,e,r,ke,Ie),n&&(W&&Se.deltaX>0&&W(Se),q&&Se.deltaX<0&&q(Se),Z&&Z(Se),Q&&Se.deltaX<0!=Me<0&&Q(Se),Me=Se.deltaX,ke[0]=ke[1]=ke[2]=0),i&&(Y&&Se.deltaY>0&&Y(Se),X&&Se.deltaY<0&&X(Se),J&&J(Se),$&&Se.deltaY<0!=Te<0&&$(Se),Te=Se.deltaY,Ie[0]=Ie[1]=Ie[2]=0),(be||ve)&&(re&&re(Se),ve&&(P&&1===ve&&P(Se),G&&G(Se),ve=0),be=!1),xe&&!(xe=!1)&&me&&me(Se),_e&&(ae(Se),_e=!1),ye=0},Be=function(e,t,r){ke[r]+=e,Ie[r]+=t,Se._vx.update(e),Se._vy.update(t),v?ye||(ye=requestAnimationFrame(Ue)):Ue()},ze=function(e,t){fe&&!we&&(Se.axis=we=Math.abs(e)>Math.abs(t)?"x":"y",xe=!0),"y"!==we&&(ke[2]+=e,Se._vx.update(e,!0)),"x"!==we&&(Ie[2]+=t,Se._vy.update(t,!0)),v?ye||(ye=requestAnimationFrame(Ue)):Ue()},Ge=function(e){if(!Fe(e,1)){var t=(e=N(e,_)).clientX,n=e.clientY,i=t-Se.x,o=n-Se.y,s=Se.isDragging;Se.x=t,Se.y=n,(s||(i||o)&&(Math.abs(Se.startX-t)>=r||Math.abs(Se.startY-n)>=r))&&(ve=s?2:1,s||(Se.isDragging=!0),ze(i,o))}},Ve=Se.onPress=function(e){Fe(e,1)||e&&e.button||(Se.axis=we=null,ge.pause(),Se.isPressed=!0,e=N(e),Me=Te=0,Se.startX=Se.x=e.clientX,Se.startY=Se.y=e.clientY,Se._vx.reset(),Se._vy.reset(),E(ie?p:Oe,m[1],Ge,Ee,!0),Se.deltaX=Se.deltaY=0,V&&V(Se))},He=Se.onRelease=function(e){if(!Fe(e,1)){j(ie?p:Oe,m[1],Ge,!0);var t=!isNaN(Se.y-Se.startY),r=Se.isDragging,n=r&&(Math.abs(Se.x-Se.startX)>3||Math.abs(Se.y-Se.startY)>3),o=N(e);!n&&t&&(Se._vx.reset(),Se._vy.reset(),_&&pe&&i.delayedCall(.08,(function(){if(w()-De>300&&!e.defaultPrevented)if(e.target.click)e.target.click();else if(Oe.createEvent){var t=Oe.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,s,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(t)}}))),Se.isDragging=Se.isGesturing=Se.isPressed=!1,x&&r&&!ie&&ge.restart(!0),ve&&Ue(),z&&r&&z(Se),H&&H(Se,n)}},We=function(e){return e.touches&&e.touches.length>1&&(Se.isGesturing=!0)&&oe(e,Se.isDragging)},qe=function(){return(Se.isGesturing=!1)||se(Se)},Xe=function(e){if(!Fe(e)){var t=je(),r=Ae();Be((t-Le)*he,(r-Ce)*he,1),Le=t,Ce=r,x&&ge.restart(!0)}},Ye=function(e){if(!Fe(e)){e=N(e,_),ae&&(_e=!0);var t=(1===e.deltaMode?g:2===e.deltaMode?s.innerHeight:1)*A;Be(e.deltaX*t,e.deltaY*t,0),x&&!ie&&ge.restart(!0)}},Ze=function(e){if(!Fe(e)){var t=e.clientX,r=e.clientY,n=t-Se.x,i=r-Se.y;Se.x=t,Se.y=r,be=!0,x&&ge.restart(!0),(n||i)&&ze(n,i)}},Je=function(e){Se.event=e,ee(Se)},Ke=function(e){Se.event=e,te(Se)},Qe=function(e){return Fe(e)||N(e,_)&&ue(Se)};ge=Se._dc=i.delayedCall(S||.25,(function(){Se._vx.reset(),Se._vy.reset(),ge.pause(),x&&x(Se)})).pause(),Se.deltaX=Se.deltaY=0,Se._vx=D(0,50,!0),Se._vy=D(0,50,!0),Se.scrollX=je,Se.scrollY=Ae,Se.isDragging=Se.isGesturing=Se.isPressed=!1,y(this),Se.enable=function(e){return Se.isEnabled||(E(Re?Oe:p,"scroll",C),n.indexOf("scroll")>=0&&E(Re?Oe:p,"scroll",Xe,Ee,de),n.indexOf("wheel")>=0&&E(p,"wheel",Ye,Ee,de),(n.indexOf("touch")>=0&&u||n.indexOf("pointer")>=0)&&(E(p,m[0],Ve,Ee,de),E(Oe,m[2],He),E(Oe,m[3],He),pe&&E(p,"click",Ne,!0,!0),ue&&E(p,"click",Qe),oe&&E(Oe,"gesturestart",We),se&&E(Oe,"gestureend",qe),ee&&E(p,h+"enter",Je),te&&E(p,h+"leave",Ke),re&&E(p,h+"move",Ze)),Se.isEnabled=!0,Se.isDragging=Se.isGesturing=Se.isPressed=be=ve=!1,Se._vx.reset(),Se._vy.reset(),Le=je(),Ce=Ae(),e&&e.type&&Ve(e),le&&le(Se)),Se},Se.disable=function(){Se.isEnabled&&(b.filter((function(e){return e!==Se&&T(e.target)})).length||j(Re?Oe:p,"scroll",C),Se.isPressed&&(Se._vx.reset(),Se._vy.reset(),j(ie?p:Oe,m[1],Ge,!0)),j(Re?Oe:p,"scroll",Xe,de),j(p,"wheel",Ye,de),j(p,m[0],Ve,de),j(Oe,m[2],He),j(Oe,m[3],He),j(p,"click",Ne,!0),j(p,"click",Qe),j(Oe,"gesturestart",We),j(Oe,"gestureend",qe),j(p,h+"enter",Je),j(p,h+"leave",Ke),j(p,h+"move",Ze),Se.isEnabled=Se.isPressed=Se.isDragging=!1,ce&&ce(Se))},Se.kill=Se.revert=function(){Se.disable();var e=b.indexOf(Se);e>=0&&b.splice(e,1),f===Se&&(f=0)},b.push(Se),ie&&T(p)&&(f=Se),Se.enable(L)},t=e,(r=[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}])&&n(t.prototype,r),e}();z.version="3.12.7",z.create=function(e){return new z(e)},z.register=B,z.getAll=function(){return b.slice()},z.getById=function(e){return b.filter((function(t){return t.vars.id===e}))[0]},g()&&i.registerPlugin(z);var G,V,H,W,q,X,Y,Z,J,K,Q,$,ee,te,re,ne,ie,oe,se,ae,le,ce,ue,he,de,pe,fe,me,ye,ge,ve,be,_e,xe,we,Se,Me,Te,Ee=1,je=Date.now,Ae=je(),Le=0,Ce=0,Pe=function(e,t,r){var n=We(e)&&("clamp("===e.substr(0,6)||e.indexOf("max")>-1);return r["_"+t+"Clamp"]=n,n?e.substr(6,e.length-7):e},Re=function(e,t){return!t||We(e)&&"clamp("===e.substr(0,6)?e:"clamp("+e+")"},Oe=function e(){return Ce&&requestAnimationFrame(e)},ke=function(){return te=1},Ie=function(){return te=0},De=function(e){return e},Ne=function(e){return Math.round(1e5*e)/1e5||0},Fe=function(){return"undefined"!=typeof window},Ue=function(){return G||Fe()&&(G=window.gsap)&&G.registerPlugin&&G},Be=function(e){return!!~Y.indexOf(e)},ze=function(e){return("Height"===e?ve:H["inner"+e])||q["client"+e]||X["client"+e]},Ge=function(e){return M(e,"getBoundingClientRect")||(Be(e)?function(){return tr.width=H.innerWidth,tr.height=ve,tr}:function(){return ft(e)})},Ve=function(e,t){var r=t.s,n=t.d2,i=t.d,o=t.a;return Math.max(0,(r="scroll"+n)&&(o=M(e,r))?o()-Ge(e)()[i]:Be(e)?(q[r]||X[r])-ze(n):e[r]-e["offset"+n])},He=function(e,t){for(var r=0;r<se.length;r+=3)(!t||~t.indexOf(se[r+1]))&&e(se[r],se[r+1],se[r+2])},We=function(e){return"string"==typeof e},qe=function(e){return"function"==typeof e},Xe=function(e){return"number"==typeof e},Ye=function(e){return"object"==typeof e},Ze=function(e,t,r){return e&&e.progress(t?0:1)&&r&&e.pause()},Je=function(e,t){if(e.enabled){var r=e._ctx?e._ctx.add((function(){return t(e)})):t(e);r&&r.totalTime&&(e.callbackAnimation=r)}},Ke=Math.abs,Qe="left",$e="right",et="bottom",tt="width",rt="height",nt="Right",it="Left",ot="Top",st="Bottom",at="padding",lt="margin",ct="Width",ut="Height",ht="px",dt=function(e){return H.getComputedStyle(e)},pt=function(e,t){for(var r in t)r in e||(e[r]=t[r]);return e},ft=function(e,t){var r=t&&"matrix(1, 0, 0, 1, 0, 0)"!==dt(e)[re]&&G.to(e,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),n=e.getBoundingClientRect();return r&&r.progress(0).kill(),n},mt=function(e,t){var r=t.d2;return e["offset"+r]||e["client"+r]||0},yt=function(e){var t,r=[],n=e.labels,i=e.duration();for(t in n)r.push(n[t]/i);return r},gt=function(e){var t=G.utils.snap(e),r=Array.isArray(e)&&e.slice(0).sort((function(e,t){return e-t}));return r?function(e,n,i){var o;if(void 0===i&&(i=.001),!n)return t(e);if(n>0){for(e-=i,o=0;o<r.length;o++)if(r[o]>=e)return r[o];return r[o-1]}for(o=r.length,e+=i;o--;)if(r[o]<=e)return r[o];return r[0]}:function(r,n,i){void 0===i&&(i=.001);var o=t(r);return!n||Math.abs(o-r)<i||o-r<0==n<0?o:t(n<0?r-e:r+e)}},vt=function(e,t,r,n){return r.split(",").forEach((function(r){return e(t,r,n)}))},bt=function(e,t,r,n,i){return e.addEventListener(t,r,{passive:!n,capture:!!i})},_t=function(e,t,r,n){return e.removeEventListener(t,r,!!n)},xt=function(e,t,r){(r=r&&r.wheelHandler)&&(e(t,"wheel",r),e(t,"touchmove",r))},wt={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},St={toggleActions:"play",anticipatePin:0},Mt={top:0,left:0,center:.5,bottom:1,right:1},Tt=function(e,t){if(We(e)){var r=e.indexOf("="),n=~r?+(e.charAt(r-1)+1)*parseFloat(e.substr(r+1)):0;~r&&(e.indexOf("%")>r&&(n*=t/100),e=e.substr(0,r-1)),e=n+(e in Mt?Mt[e]*t:~e.indexOf("%")?parseFloat(e)*t/100:parseFloat(e)||0)}return e},Et=function(e,t,r,n,i,o,s,a){var l=i.startColor,c=i.endColor,u=i.fontSize,h=i.indent,d=i.fontWeight,p=W.createElement("div"),f=Be(r)||"fixed"===M(r,"pinType"),m=-1!==e.indexOf("scroller"),y=f?X:r,g=-1!==e.indexOf("start"),v=g?l:c,b="border-color:"+v+";font-size:"+u+";color:"+v+";font-weight:"+d+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return b+="position:"+((m||a)&&f?"fixed;":"absolute;"),(m||a||!f)&&(b+=(n===O?$e:et)+":"+(o+parseFloat(h))+"px;"),s&&(b+="box-sizing:border-box;text-align:left;width:"+s.offsetWidth+"px;"),p._isStart=g,p.setAttribute("class","gsap-marker-"+e+(t?" marker-"+t:"")),p.style.cssText=b,p.innerText=t||0===t?e+"-"+t:e,y.children[0]?y.insertBefore(p,y.children[0]):y.appendChild(p),p._offset=p["offset"+n.op.d2],jt(p,0,n,g),p},jt=function(e,t,r,n){var i={display:"block"},o=r[n?"os2":"p2"],s=r[n?"p2":"os2"];e._isFlipped=n,i[r.a+"Percent"]=n?-100:0,i[r.a]=n?"1px":0,i["border"+o+ct]=1,i["border"+s+ct]=0,i[r.p]=t+"px",G.set(e,i)},At=[],Lt={},Ct=function(){return je()-Le>34&&(we||(we=requestAnimationFrame(Yt)))},Pt=function(){(!ue||!ue.isPressed||ue.startX>X.clientWidth)&&(_.cache++,ue?we||(we=requestAnimationFrame(Yt)):Yt(),Le||Nt("scrollStart"),Le=je())},Rt=function(){pe=H.innerWidth,de=H.innerHeight},Ot=function(e){_.cache++,(!0===e||!ee&&!ce&&!W.fullscreenElement&&!W.webkitFullscreenElement&&(!he||pe!==H.innerWidth||Math.abs(H.innerHeight-de)>.25*H.innerHeight))&&Z.restart(!0)},kt={},It=[],Dt=function e(){return _t(lr,"scrollEnd",e)||Wt(!0)},Nt=function(e){return kt[e]&&kt[e].map((function(e){return e()}))||It},Ft=[],Ut=function(e){for(var t=0;t<Ft.length;t+=5)(!e||Ft[t+4]&&Ft[t+4].query===e)&&(Ft[t].style.cssText=Ft[t+1],Ft[t].getBBox&&Ft[t].setAttribute("transform",Ft[t+2]||""),Ft[t+3].uncache=1)},Bt=function(e,t){var r;for(ne=0;ne<At.length;ne++)!(r=At[ne])||t&&r._ctx!==t||(e?r.kill(1):r.revert(!0,!0));be=!0,t&&Ut(t),t||Nt("revert")},zt=function(e,t){_.cache++,(t||!Se)&&_.forEach((function(e){return qe(e)&&e.cacheID++&&(e.rec=0)})),We(e)&&(H.history.scrollRestoration=ye=e)},Gt=0,Vt=function(){X.appendChild(ge),ve=!ue&&ge.offsetHeight||H.innerHeight,X.removeChild(ge)},Ht=function(e){return J(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach((function(t){return t.style.display=e?"none":"block"}))},Wt=function(e,t){if(q=W.documentElement,X=W.body,Y=[H,W,q,X],!Le||e||be){Vt(),Se=lr.isRefreshing=!0,_.forEach((function(e){return qe(e)&&++e.cacheID&&(e.rec=e())}));var r=Nt("refreshInit");ae&&lr.sort(),t||Bt(),_.forEach((function(e){qe(e)&&(e.smooth&&(e.target.style.scrollBehavior="auto"),e(0))})),At.slice(0).forEach((function(e){return e.refresh()})),be=!1,At.forEach((function(e){if(e._subPinOffset&&e.pin){var t=e.vars.horizontal?"offsetWidth":"offsetHeight",r=e.pin[t];e.revert(!0,1),e.adjustPinSpacing(e.pin[t]-r),e.refresh()}})),_e=1,Ht(!0),At.forEach((function(e){var t=Ve(e.scroller,e._dir),r="max"===e.vars.end||e._endClamp&&e.end>t,n=e._startClamp&&e.start>=t;(r||n)&&e.setPositions(n?t-1:e.start,r?Math.max(n?t:e.start+1,t):e.end,!0)})),Ht(!1),_e=0,r.forEach((function(e){return e&&e.render&&e.render(-1)})),_.forEach((function(e){qe(e)&&(e.smooth&&requestAnimationFrame((function(){return e.target.style.scrollBehavior="smooth"})),e.rec&&e(e.rec))})),zt(ye,1),Z.pause(),Gt++,Se=2,Yt(2),At.forEach((function(e){return qe(e.vars.onRefresh)&&e.vars.onRefresh(e)})),Se=lr.isRefreshing=!1,Nt("refresh")}else bt(lr,"scrollEnd",Dt)},qt=0,Xt=1,Yt=function(e){if(2===e||!Se&&!be){lr.isUpdating=!0,Te&&Te.update(0);var t=At.length,r=je(),n=r-Ae>=50,i=t&&At[0].scroll();if(Xt=qt>i?-1:1,Se||(qt=i),n&&(Le&&!te&&r-Le>200&&(Le=0,Nt("scrollEnd")),Q=Ae,Ae=r),Xt<0){for(ne=t;ne-- >0;)At[ne]&&At[ne].update(0,n);Xt=1}else for(ne=0;ne<t;ne++)At[ne]&&At[ne].update(0,n);lr.isUpdating=!1}we=0},Zt=[Qe,"top",et,$e,lt+st,lt+nt,lt+ot,lt+it,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],Jt=Zt.concat([tt,rt,"boxSizing","max"+ct,"max"+ut,"position",lt,at,at+ot,at+nt,at+st,at+it]),Kt=function(e,t,r,n){if(!e._gsap.swappedIn){for(var i,o=Zt.length,s=t.style,a=e.style;o--;)s[i=Zt[o]]=r[i];s.position="absolute"===r.position?"absolute":"relative","inline"===r.display&&(s.display="inline-block"),a[et]=a[$e]="auto",s.flexBasis=r.flexBasis||"auto",s.overflow="visible",s.boxSizing="border-box",s[tt]=mt(e,R)+ht,s[rt]=mt(e,O)+ht,s[at]=a[lt]=a.top=a[Qe]="0",$t(n),a[tt]=a["max"+ct]=r[tt],a[rt]=a["max"+ut]=r[rt],a[at]=r[at],e.parentNode!==t&&(e.parentNode.insertBefore(t,e),t.appendChild(e)),e._gsap.swappedIn=!0}},Qt=/([A-Z])/g,$t=function(e){if(e){var t,r,n=e.t.style,i=e.length,o=0;for((e.t._gsap||G.core.getCache(e.t)).uncache=1;o<i;o+=2)r=e[o+1],t=e[o],r?n[t]=r:n[t]&&n.removeProperty(t.replace(Qt,"-$1").toLowerCase())}},er=function(e){for(var t=Jt.length,r=e.style,n=[],i=0;i<t;i++)n.push(Jt[i],r[Jt[i]]);return n.t=e,n},tr={left:0,top:0},rr=function(e,t,r,n,i,o,s,a,l,c,u,h,d,p){qe(e)&&(e=e(a)),We(e)&&"max"===e.substr(0,3)&&(e=h+("="===e.charAt(4)?Tt("0"+e.substr(3),r):0));var f,m,y,g=d?d.time():0;if(d&&d.seek(0),isNaN(e)||(e=+e),Xe(e))d&&(e=G.utils.mapRange(d.scrollTrigger.start,d.scrollTrigger.end,0,h,e)),s&&jt(s,r,n,!0);else{qe(t)&&(t=t(a));var v,b,_,x,w=(e||"0").split(" ");y=k(t,a)||X,(v=ft(y)||{})&&(v.left||v.top)||"none"!==dt(y).display||(x=y.style.display,y.style.display="block",v=ft(y),x?y.style.display=x:y.style.removeProperty("display")),b=Tt(w[0],v[n.d]),_=Tt(w[1]||"0",r),e=v[n.p]-l[n.p]-c+b+i-_,s&&jt(s,_,n,r-_<20||s._isStart&&_>20),r-=r-_}if(p&&(a[p]=e||-.001,e<0&&(e=0)),o){var S=e+r,M=o._isStart;f="scroll"+n.d2,jt(o,S,n,M&&S>20||!M&&(u?Math.max(X[f],q[f]):o.parentNode[f])<=S+1),u&&(l=ft(s),u&&(o.style[n.op.p]=l[n.op.p]-n.op.m-o._offset+ht))}return d&&y&&(f=ft(y),d.seek(h),m=ft(y),d._caScrollDist=f[n.p]-m[n.p],e=e/d._caScrollDist*h),d&&d.seek(g),d?e:Math.round(e)},nr=/(webkit|moz|length|cssText|inset)/i,ir=function(e,t,r,n){if(e.parentNode!==t){var i,o,s=e.style;if(t===X){for(i in e._stOrig=s.cssText,o=dt(e))+i||nr.test(i)||!o[i]||"string"!=typeof s[i]||"0"===i||(s[i]=o[i]);s.top=r,s.left=n}else s.cssText=e._stOrig;G.core.getCache(e).uncache=1,t.appendChild(e)}},or=function(e,t,r){var n=t,i=n;return function(t){var o=Math.round(e());return o!==n&&o!==i&&Math.abs(o-n)>3&&Math.abs(o-i)>3&&(t=o,r&&r()),i=n,n=Math.round(t)}},sr=function(e,t,r){var n={};n[t.p]="+="+r,G.set(e,n)},ar=function(e,t){var r=I(e,t),n="_scroll"+t.p2,i=function t(i,o,s,a,l){var c=t.tween,u=o.onComplete,h={};s=s||r();var d=or(r,s,(function(){c.kill(),t.tween=0}));return l=a&&l||0,a=a||i-s,c&&c.kill(),o[n]=i,o.inherit=!1,o.modifiers=h,h[n]=function(){return d(s+a*c.ratio+l*c.ratio*c.ratio)},o.onUpdate=function(){_.cache++,t.tween&&Yt()},o.onComplete=function(){t.tween=0,u&&u.call(c)},c=t.tween=G.to(e,o)};return e[n]=r,r.wheelHandler=function(){return i.tween&&i.tween.kill()&&(i.tween=0)},bt(e,"wheel",r.wheelHandler),lr.isTouch&&bt(e,"touchmove",r.wheelHandler),i},lr=function(){function e(t,r){V||e.register(G)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),me(this),this.init(t,r)}return e.prototype.init=function(t,r){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),Ce){var n,i,o,s,a,l,c,u,h,d,p,f,m,y,g,v,b,w,S,T,E,j,A,L,C,P,D,N,F,U,B,z,V,Y,Z,$,re,ie,oe,se,ce,ue,he=t=pt(We(t)||Xe(t)||t.nodeType?{trigger:t}:t,St),de=he.onUpdate,pe=he.toggleClass,fe=he.id,me=he.onToggle,ye=he.onRefresh,ge=he.scrub,ve=he.trigger,be=he.pin,we=he.pinSpacing,Ae=he.invalidateOnRefresh,Oe=he.anticipatePin,ke=he.onScrubComplete,Ie=he.onSnapComplete,Fe=he.once,Ue=he.snap,He=he.pinReparent,Qe=he.pinSpacer,$e=he.containerAnimation,et=he.fastScrollEnd,vt=he.preventOverlaps,xt=t.horizontal||t.containerAnimation&&!1!==t.horizontal?R:O,Mt=!ge&&0!==ge,jt=k(t.scroller||H),Ct=G.core.getCache(jt),Rt=Be(jt),kt="fixed"===("pinType"in t?t.pinType:M(jt,"pinType")||Rt&&"fixed"),It=[t.onEnter,t.onLeave,t.onEnterBack,t.onLeaveBack],Nt=Mt&&t.toggleActions.split(" "),Ft="markers"in t?t.markers:St.markers,Ut=Rt?0:parseFloat(dt(jt)["border"+xt.p2+ct])||0,Bt=this,zt=t.onRefreshInit&&function(){return t.onRefreshInit(Bt)},Vt=function(e,t,r){var n=r.d,i=r.d2,o=r.a;return(o=M(e,"getBoundingClientRect"))?function(){return o()[n]}:function(){return(t?ze(i):e["client"+i])||0}}(jt,Rt,xt),Ht=function(e,t){return!t||~x.indexOf(e)?Ge(e):function(){return tr}}(jt,Rt),qt=0,Yt=0,Zt=0,Jt=I(jt,xt);if(Bt._startClamp=Bt._endClamp=!1,Bt._dir=xt,Oe*=45,Bt.scroller=jt,Bt.scroll=$e?$e.time.bind($e):Jt,s=Jt(),Bt.vars=t,r=r||t.animation,"refreshPriority"in t&&(ae=1,-9999===t.refreshPriority&&(Te=Bt)),Ct.tweenScroll=Ct.tweenScroll||{top:ar(jt,O),left:ar(jt,R)},Bt.tweenTo=n=Ct.tweenScroll[xt.p],Bt.scrubDuration=function(e){(V=Xe(e)&&e)?z?z.duration(e):z=G.to(r,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:V,paused:!0,onComplete:function(){return ke&&ke(Bt)}}):(z&&z.progress(1).kill(),z=0)},r&&(r.vars.lazy=!1,r._initted&&!Bt.isReverted||!1!==r.vars.immediateRender&&!1!==t.immediateRender&&r.duration()&&r.render(0,!0,!0),Bt.animation=r.pause(),r.scrollTrigger=Bt,Bt.scrubDuration(ge),U=0,fe||(fe=r.vars.id)),Ue&&(Ye(Ue)&&!Ue.push||(Ue={snapTo:Ue}),"scrollBehavior"in X.style&&G.set(Rt?[X,q]:jt,{scrollBehavior:"auto"}),_.forEach((function(e){return qe(e)&&e.target===(Rt?W.scrollingElement||q:jt)&&(e.smooth=!1)})),o=qe(Ue.snapTo)?Ue.snapTo:"labels"===Ue.snapTo?function(e){return function(t){return G.utils.snap(yt(e),t)}}(r):"labelsDirectional"===Ue.snapTo?(se=r,function(e,t){return gt(yt(se))(e,t.direction)}):!1!==Ue.directional?function(e,t){return gt(Ue.snapTo)(e,je()-Yt<500?0:t.direction)}:G.utils.snap(Ue.snapTo),Y=Ue.duration||{min:.1,max:2},Y=Ye(Y)?K(Y.min,Y.max):K(Y,Y),Z=G.delayedCall(Ue.delay||V/2||.1,(function(){var e=Jt(),t=je()-Yt<500,i=n.tween;if(!(t||Math.abs(Bt.getVelocity())<10)||i||te||qt===e)Bt.isActive&&qt!==e&&Z.restart(!0);else{var s,a,u=(e-l)/y,h=r&&!Mt?r.totalProgress():u,d=t?0:(h-B)/(je()-Q)*1e3||0,p=G.utils.clamp(-u,1-u,Ke(d/2)*d/.185),f=u+(!1===Ue.inertia?0:p),m=Ue,g=m.onStart,v=m.onInterrupt,b=m.onComplete;if(s=o(f,Bt),Xe(s)||(s=f),a=Math.max(0,Math.round(l+s*y)),e<=c&&e>=l&&a!==e){if(i&&!i._initted&&i.data<=Ke(a-e))return;!1===Ue.inertia&&(p=s-u),n(a,{duration:Y(Ke(.185*Math.max(Ke(f-h),Ke(s-h))/d/.05||0)),ease:Ue.ease||"power3",data:Ke(a-e),onInterrupt:function(){return Z.restart(!0)&&v&&v(Bt)},onComplete:function(){Bt.update(),qt=Jt(),r&&!Mt&&(z?z.resetTo("totalProgress",s,r._tTime/r._tDur):r.progress(s)),U=B=r&&!Mt?r.totalProgress():Bt.progress,Ie&&Ie(Bt),b&&b(Bt)}},e,p*y,a-e-p*y),g&&g(Bt,n.tween)}}})).pause()),fe&&(Lt[fe]=Bt),(oe=(ve=Bt.trigger=k(ve||!0!==be&&be))&&ve._gsap&&ve._gsap.stRevert)&&(oe=oe(Bt)),be=!0===be?ve:k(be),We(pe)&&(pe={targets:ve,className:pe}),be&&(!1===we||we===lt||(we=!(!we&&be.parentNode&&be.parentNode.style&&"flex"===dt(be.parentNode).display)&&at),Bt.pin=be,(i=G.core.getCache(be)).spacer?g=i.pinState:(Qe&&((Qe=k(Qe))&&!Qe.nodeType&&(Qe=Qe.current||Qe.nativeElement),i.spacerIsNative=!!Qe,Qe&&(i.spacerState=er(Qe))),i.spacer=w=Qe||W.createElement("div"),w.classList.add("pin-spacer"),fe&&w.classList.add("pin-spacer-"+fe),i.pinState=g=er(be)),!1!==t.force3D&&G.set(be,{force3D:!0}),Bt.spacer=w=i.spacer,F=dt(be),L=F[we+xt.os2],T=G.getProperty(be),E=G.quickSetter(be,xt.a,ht),Kt(be,w,F),b=er(be)),Ft){f=Ye(Ft)?pt(Ft,wt):wt,d=Et("scroller-start",fe,jt,xt,f,0),p=Et("scroller-end",fe,jt,xt,f,0,d),S=d["offset"+xt.op.d2];var Qt=k(M(jt,"content")||jt);u=this.markerStart=Et("start",fe,Qt,xt,f,S,0,$e),h=this.markerEnd=Et("end",fe,Qt,xt,f,S,0,$e),$e&&(ie=G.quickSetter([u,h],xt.a,ht)),kt||x.length&&!0===M(jt,"fixedMarkers")||(ue=dt(ce=Rt?X:jt).position,ce.style.position="absolute"===ue||"fixed"===ue?ue:"relative",G.set([d,p],{force3D:!0}),P=G.quickSetter(d,xt.a,ht),N=G.quickSetter(p,xt.a,ht))}if($e){var nr=$e.vars.onUpdate,or=$e.vars.onUpdateParams;$e.eventCallback("onUpdate",(function(){Bt.update(0,0,1),nr&&nr.apply($e,or||[])}))}if(Bt.previous=function(){return At[At.indexOf(Bt)-1]},Bt.next=function(){return At[At.indexOf(Bt)+1]},Bt.revert=function(e,t){if(!t)return Bt.kill(!0);var n=!1!==e||!Bt.enabled,i=ee;n!==Bt.isReverted&&(n&&($=Math.max(Jt(),Bt.scroll.rec||0),Zt=Bt.progress,re=r&&r.progress()),u&&[u,h,d,p].forEach((function(e){return e.style.display=n?"none":"block"})),n&&(ee=Bt,Bt.update(n)),!be||He&&Bt.isActive||(n?function(e,t,r){$t(r);var n=e._gsap;if(n.spacerIsNative)$t(n.spacerState);else if(e._gsap.swappedIn){var i=t.parentNode;i&&(i.insertBefore(e,t),i.removeChild(t))}e._gsap.swappedIn=!1}(be,w,g):Kt(be,w,dt(be),C)),n||Bt.update(n),ee=i,Bt.isReverted=n)},Bt.refresh=function(i,o,f,_){if(!ee&&Bt.enabled||o)if(be&&i&&Le)bt(e,"scrollEnd",Dt);else{!Se&&zt&&zt(Bt),ee=Bt,n.tween&&!f&&(n.tween.kill(),n.tween=0),z&&z.pause(),Ae&&r&&r.revert({kill:!1}).invalidate(),Bt.isReverted||Bt.revert(!0,!0),Bt._subPinOffset=!1;var x,S,M,E,L,P,N,F,U,B,V,H,Y,J=Vt(),K=Ht(),Q=$e?$e.duration():Ve(jt,xt),te=y<=.01,ne=0,ie=_||0,oe=Ye(f)?f.end:t.end,se=t.endTrigger||ve,ae=Ye(f)?f.start:t.start||(0!==t.start&&ve?be?"0 0":"0 100%":0),ce=Bt.pinnedContainer=t.pinnedContainer&&k(t.pinnedContainer,Bt),ue=ve&&Math.max(0,At.indexOf(Bt))||0,he=ue;for(Ft&&Ye(f)&&(H=G.getProperty(d,xt.p),Y=G.getProperty(p,xt.p));he-- >0;)(P=At[he]).end||P.refresh(0,1)||(ee=Bt),!(N=P.pin)||N!==ve&&N!==be&&N!==ce||P.isReverted||(B||(B=[]),B.unshift(P),P.revert(!0,!0)),P!==At[he]&&(ue--,he--);for(qe(ae)&&(ae=ae(Bt)),ae=Pe(ae,"start",Bt),l=rr(ae,ve,J,xt,Jt(),u,d,Bt,K,Ut,kt,Q,$e,Bt._startClamp&&"_startClamp")||(be?-.001:0),qe(oe)&&(oe=oe(Bt)),We(oe)&&!oe.indexOf("+=")&&(~oe.indexOf(" ")?oe=(We(ae)?ae.split(" ")[0]:"")+oe:(ne=Tt(oe.substr(2),J),oe=We(ae)?ae:($e?G.utils.mapRange(0,$e.duration(),$e.scrollTrigger.start,$e.scrollTrigger.end,l):l)+ne,se=ve)),oe=Pe(oe,"end",Bt),c=Math.max(l,rr(oe||(se?"100% 0":Q),se,J,xt,Jt()+ne,h,p,Bt,K,Ut,kt,Q,$e,Bt._endClamp&&"_endClamp"))||-.001,ne=0,he=ue;he--;)(N=(P=At[he]).pin)&&P.start-P._pinPush<=l&&!$e&&P.end>0&&(x=P.end-(Bt._startClamp?Math.max(0,P.start):P.start),(N===ve&&P.start-P._pinPush<l||N===ce)&&isNaN(ae)&&(ne+=x*(1-P.progress)),N===be&&(ie+=x));if(l+=ne,c+=ne,Bt._startClamp&&(Bt._startClamp+=ne),Bt._endClamp&&!Se&&(Bt._endClamp=c||-.001,c=Math.min(c,Ve(jt,xt))),y=c-l||(l-=.01)&&.001,te&&(Zt=G.utils.clamp(0,1,G.utils.normalize(l,c,$))),Bt._pinPush=ie,u&&ne&&((x={})[xt.a]="+="+ne,ce&&(x[xt.p]="-="+Jt()),G.set([u,h],x)),!be||_e&&Bt.end>=Ve(jt,xt)){if(ve&&Jt()&&!$e)for(S=ve.parentNode;S&&S!==X;)S._pinOffset&&(l-=S._pinOffset,c-=S._pinOffset),S=S.parentNode}else x=dt(be),E=xt===O,M=Jt(),j=parseFloat(T(xt.a))+ie,!Q&&c>1&&(V={style:V=(Rt?W.scrollingElement||q:jt).style,value:V["overflow"+xt.a.toUpperCase()]},Rt&&"scroll"!==dt(X)["overflow"+xt.a.toUpperCase()]&&(V.style["overflow"+xt.a.toUpperCase()]="scroll")),Kt(be,w,x),b=er(be),S=ft(be,!0),F=kt&&I(jt,E?R:O)(),we?((C=[we+xt.os2,y+ie+ht]).t=w,(he=we===at?mt(be,xt)+y+ie:0)&&(C.push(xt.d,he+ht),"auto"!==w.style.flexBasis&&(w.style.flexBasis=he+ht)),$t(C),ce&&At.forEach((function(e){e.pin===ce&&!1!==e.vars.pinSpacing&&(e._subPinOffset=!0)})),kt&&Jt($)):(he=mt(be,xt))&&"auto"!==w.style.flexBasis&&(w.style.flexBasis=he+ht),kt&&((L={top:S.top+(E?M-l:F)+ht,left:S.left+(E?F:M-l)+ht,boxSizing:"border-box",position:"fixed"})[tt]=L["max"+ct]=Math.ceil(S.width)+ht,L[rt]=L["max"+ut]=Math.ceil(S.height)+ht,L[lt]=L[lt+ot]=L[lt+nt]=L[lt+st]=L[lt+it]="0",L[at]=x[at],L[at+ot]=x[at+ot],L[at+nt]=x[at+nt],L[at+st]=x[at+st],L[at+it]=x[at+it],v=function(e,t,r){for(var n,i=[],o=e.length,s=r?8:0;s<o;s+=2)n=e[s],i.push(n,n in t?t[n]:e[s+1]);return i.t=e.t,i}(g,L,He),Se&&Jt(0)),r?(U=r._initted,le(1),r.render(r.duration(),!0,!0),A=T(xt.a)-j+y+ie,D=Math.abs(y-A)>1,kt&&D&&v.splice(v.length-2,2),r.render(0,!0,!0),U||r.invalidate(!0),r.parent||r.totalTime(r.totalTime()),le(0)):A=y,V&&(V.value?V.style["overflow"+xt.a.toUpperCase()]=V.value:V.style.removeProperty("overflow-"+xt.a));B&&B.forEach((function(e){return e.revert(!1,!0)})),Bt.start=l,Bt.end=c,s=a=Se?$:Jt(),$e||Se||(s<$&&Jt($),Bt.scroll.rec=0),Bt.revert(!1,!0),Yt=je(),Z&&(qt=-1,Z.restart(!0)),ee=0,r&&Mt&&(r._initted||re)&&r.progress()!==re&&r.progress(re||0,!0).render(r.time(),!0,!0),(te||Zt!==Bt.progress||$e||Ae||r&&!r._initted)&&(r&&!Mt&&r.totalProgress($e&&l<-.001&&!Zt?G.utils.normalize(l,c,0):Zt,!0),Bt.progress=te||(s-l)/y===Zt?0:Zt),be&&we&&(w._pinOffset=Math.round(Bt.progress*A)),z&&z.invalidate(),isNaN(H)||(H-=G.getProperty(d,xt.p),Y-=G.getProperty(p,xt.p),sr(d,xt,H),sr(u,xt,H-(_||0)),sr(p,xt,Y),sr(h,xt,Y-(_||0))),te&&!Se&&Bt.update(),!ye||Se||m||(m=!0,ye(Bt),m=!1)}},Bt.getVelocity=function(){return(Jt()-a)/(je()-Q)*1e3||0},Bt.endAnimation=function(){Ze(Bt.callbackAnimation),r&&(z?z.progress(1):r.paused()?Mt||Ze(r,Bt.direction<0,1):Ze(r,r.reversed()))},Bt.labelToScroll=function(e){return r&&r.labels&&(l||Bt.refresh()||l)+r.labels[e]/r.duration()*y||0},Bt.getTrailing=function(e){var t=At.indexOf(Bt),r=Bt.direction>0?At.slice(0,t).reverse():At.slice(t+1);return(We(e)?r.filter((function(t){return t.vars.preventOverlaps===e})):r).filter((function(e){return Bt.direction>0?e.end<=l:e.start>=c}))},Bt.update=function(e,t,i){if(!$e||i||e){var o,u,h,p,f,m,g,_=!0===Se?$:Bt.scroll(),x=e?0:(_-l)/y,S=x<0?0:x>1?1:x||0,M=Bt.progress;if(t&&(a=s,s=$e?Jt():_,Ue&&(B=U,U=r&&!Mt?r.totalProgress():S)),Oe&&be&&!ee&&!Ee&&Le&&(!S&&l<_+(_-a)/(je()-Q)*Oe?S=1e-4:1===S&&c>_+(_-a)/(je()-Q)*Oe&&(S=.9999)),S!==M&&Bt.enabled){if(p=(f=(o=Bt.isActive=!!S&&S<1)!=(!!M&&M<1))||!!S!=!!M,Bt.direction=S>M?1:-1,Bt.progress=S,p&&!ee&&(u=S&&!M?0:1===S?1:1===M?2:3,Mt&&(h=!f&&"none"!==Nt[u+1]&&Nt[u+1]||Nt[u],g=r&&("complete"===h||"reset"===h||h in r))),vt&&(f||g)&&(g||ge||!r)&&(qe(vt)?vt(Bt):Bt.getTrailing(vt).forEach((function(e){return e.endAnimation()}))),Mt||(!z||ee||Ee?r&&r.totalProgress(S,!(!ee||!Yt&&!e)):(z._dp._time-z._start!==z._time&&z.render(z._dp._time-z._start),z.resetTo?z.resetTo("totalProgress",S,r._tTime/r._tDur):(z.vars.totalProgress=S,z.invalidate().restart()))),be)if(e&&we&&(w.style[we+xt.os2]=L),kt){if(p){if(m=!e&&S>M&&c+1>_&&_+1>=Ve(jt,xt),He)if(e||!o&&!m)ir(be,w);else{var T=ft(be,!0),C=_-l;ir(be,X,T.top+(xt===O?C:0)+ht,T.left+(xt===O?0:C)+ht)}$t(o||m?v:b),D&&S<1&&o||E(j+(1!==S||m?0:A))}}else E(Ne(j+A*S));Ue&&!n.tween&&!ee&&!Ee&&Z.restart(!0),pe&&(f||Fe&&S&&(S<1||!xe))&&J(pe.targets).forEach((function(e){return e.classList[o||Fe?"add":"remove"](pe.className)})),de&&!Mt&&!e&&de(Bt),p&&!ee?(Mt&&(g&&("complete"===h?r.pause().totalProgress(1):"reset"===h?r.restart(!0).pause():"restart"===h?r.restart(!0):r[h]()),de&&de(Bt)),!f&&xe||(me&&f&&Je(Bt,me),It[u]&&Je(Bt,It[u]),Fe&&(1===S?Bt.kill(!1,1):It[u]=0),f||It[u=1===S?1:3]&&Je(Bt,It[u])),et&&!o&&Math.abs(Bt.getVelocity())>(Xe(et)?et:2500)&&(Ze(Bt.callbackAnimation),z?z.progress(1):Ze(r,"reverse"===h?1:!S,1))):Mt&&de&&!ee&&de(Bt)}if(N){var R=$e?_/$e.duration()*($e._caScrollDist||0):_;P(R+(d._isFlipped?1:0)),N(R)}ie&&ie(-_/$e.duration()*($e._caScrollDist||0))}},Bt.enable=function(t,r){Bt.enabled||(Bt.enabled=!0,bt(jt,"resize",Ot),Rt||bt(jt,"scroll",Pt),zt&&bt(e,"refreshInit",zt),!1!==t&&(Bt.progress=Zt=0,s=a=qt=Jt()),!1!==r&&Bt.refresh())},Bt.getTween=function(e){return e&&n?n.tween:z},Bt.setPositions=function(e,t,r,n){if($e){var i=$e.scrollTrigger,o=$e.duration(),s=i.end-i.start;e=i.start+s*e/o,t=i.start+s*t/o}Bt.refresh(!1,!1,{start:Re(e,r&&!!Bt._startClamp),end:Re(t,r&&!!Bt._endClamp)},n),Bt.update()},Bt.adjustPinSpacing=function(e){if(C&&e){var t=C.indexOf(xt.d)+1;C[t]=parseFloat(C[t])+e+ht,C[1]=parseFloat(C[1])+e+ht,$t(C)}},Bt.disable=function(t,r){if(Bt.enabled&&(!1!==t&&Bt.revert(!0,!0),Bt.enabled=Bt.isActive=!1,r||z&&z.pause(),$=0,i&&(i.uncache=1),zt&&_t(e,"refreshInit",zt),Z&&(Z.pause(),n.tween&&n.tween.kill()&&(n.tween=0)),!Rt)){for(var o=At.length;o--;)if(At[o].scroller===jt&&At[o]!==Bt)return;_t(jt,"resize",Ot),Rt||_t(jt,"scroll",Pt)}},Bt.kill=function(e,n){Bt.disable(e,n),z&&!n&&z.kill(),fe&&delete Lt[fe];var o=At.indexOf(Bt);o>=0&&At.splice(o,1),o===ne&&Xt>0&&ne--,o=0,At.forEach((function(e){return e.scroller===Bt.scroller&&(o=1)})),o||Se||(Bt.scroll.rec=0),r&&(r.scrollTrigger=null,e&&r.revert({kill:!1}),n||r.kill()),u&&[u,h,d,p].forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),Te===Bt&&(Te=0),be&&(i&&(i.uncache=1),o=0,At.forEach((function(e){return e.pin===be&&o++})),o||(i.spacer=0)),t.onKill&&t.onKill(Bt)},At.push(Bt),Bt.enable(!1,!1),oe&&oe(Bt),r&&r.add&&!y){var lr=Bt.update;Bt.update=function(){Bt.update=lr,_.cache++,l||c||Bt.refresh()},G.delayedCall(.01,Bt.update),y=.01,l=c=0}else Bt.refresh();be&&function(){if(Me!==Gt){var e=Me=Gt;requestAnimationFrame((function(){return e===Gt&&Wt(!0)}))}}()}else this.update=this.refresh=this.kill=De},e.register=function(t){return V||(G=t||Ue(),Fe()&&window.document&&e.enable(),V=Ce),V},e.defaults=function(e){if(e)for(var t in e)St[t]=e[t];return St},e.disable=function(e,t){Ce=0,At.forEach((function(r){return r[t?"kill":"disable"](e)})),_t(H,"wheel",Pt),_t(W,"scroll",Pt),clearInterval($),_t(W,"touchcancel",De),_t(X,"touchstart",De),vt(_t,W,"pointerdown,touchstart,mousedown",ke),vt(_t,W,"pointerup,touchend,mouseup",Ie),Z.kill(),He(_t);for(var r=0;r<_.length;r+=3)xt(_t,_[r],_[r+1]),xt(_t,_[r],_[r+2])},e.enable=function(){if(H=window,W=document,q=W.documentElement,X=W.body,G&&(J=G.utils.toArray,K=G.utils.clamp,me=G.core.context||De,le=G.core.suppressOverwrites||De,ye=H.history.scrollRestoration||"auto",qt=H.pageYOffset||0,G.core.globals("ScrollTrigger",e),X)){Ce=1,(ge=document.createElement("div")).style.height="100vh",ge.style.position="absolute",Vt(),Oe(),z.register(G),e.isTouch=z.isTouch,fe=z.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),he=1===z.isTouch,bt(H,"wheel",Pt),Y=[H,W,q,X],G.matchMedia?(e.matchMedia=function(e){var t,r=G.matchMedia();for(t in e)r.add(t,e[t]);return r},G.addEventListener("matchMediaInit",(function(){return Bt()})),G.addEventListener("matchMediaRevert",(function(){return Ut()})),G.addEventListener("matchMedia",(function(){Wt(0,1),Nt("matchMedia")})),G.matchMedia().add("(orientation: portrait)",(function(){return Rt(),Rt}))):console.warn("Requires GSAP 3.11.0 or later"),Rt(),bt(W,"scroll",Pt);var t,r,n=X.hasAttribute("style"),i=X.style,o=i.borderTopStyle,s=G.core.Animation.prototype;for(s.revert||Object.defineProperty(s,"revert",{value:function(){return this.time(-.01,!0)}}),i.borderTopStyle="solid",t=ft(X),O.m=Math.round(t.top+O.sc())||0,R.m=Math.round(t.left+R.sc())||0,o?i.borderTopStyle=o:i.removeProperty("border-top-style"),n||(X.setAttribute("style",""),X.removeAttribute("style")),$=setInterval(Ct,250),G.delayedCall(.5,(function(){return Ee=0})),bt(W,"touchcancel",De),bt(X,"touchstart",De),vt(bt,W,"pointerdown,touchstart,mousedown",ke),vt(bt,W,"pointerup,touchend,mouseup",Ie),re=G.utils.checkPrefix("transform"),Jt.push(re),V=je(),Z=G.delayedCall(.2,Wt).pause(),se=[W,"visibilitychange",function(){var e=H.innerWidth,t=H.innerHeight;W.hidden?(ie=e,oe=t):ie===e&&oe===t||Ot()},W,"DOMContentLoaded",Wt,H,"load",Wt,H,"resize",Ot],He(bt),At.forEach((function(e){return e.enable(0,1)})),r=0;r<_.length;r+=3)xt(_t,_[r],_[r+1]),xt(_t,_[r],_[r+2])}},e.config=function(t){"limitCallbacks"in t&&(xe=!!t.limitCallbacks);var r=t.syncInterval;r&&clearInterval($)||($=r)&&setInterval(Ct,r),"ignoreMobileResize"in t&&(he=1===e.isTouch&&t.ignoreMobileResize),"autoRefreshEvents"in t&&(He(_t)||He(bt,t.autoRefreshEvents||"none"),ce=-1===(t.autoRefreshEvents+"").indexOf("resize"))},e.scrollerProxy=function(e,t){var r=k(e),n=_.indexOf(r),i=Be(r);~n&&_.splice(n,i?6:2),t&&(i?x.unshift(H,t,X,t,q,t):x.unshift(r,t))},e.clearMatchMedia=function(e){At.forEach((function(t){return t._ctx&&t._ctx.query===e&&t._ctx.kill(!0,!0)}))},e.isInViewport=function(e,t,r){var n=(We(e)?k(e):e).getBoundingClientRect(),i=n[r?tt:rt]*t||0;return r?n.right-i>0&&n.left+i<H.innerWidth:n.bottom-i>0&&n.top+i<H.innerHeight},e.positionInViewport=function(e,t,r){We(e)&&(e=k(e));var n=e.getBoundingClientRect(),i=n[r?tt:rt],o=null==t?i/2:t in Mt?Mt[t]*i:~t.indexOf("%")?parseFloat(t)*i/100:parseFloat(t)||0;return r?(n.left+o)/H.innerWidth:(n.top+o)/H.innerHeight},e.killAll=function(e){if(At.slice(0).forEach((function(e){return"ScrollSmoother"!==e.vars.id&&e.kill()})),!0!==e){var t=kt.killAll||[];kt={},t.forEach((function(e){return e()}))}},e}();lr.version="3.12.7",lr.saveStyles=function(e){return e?J(e).forEach((function(e){if(e&&e.style){var t=Ft.indexOf(e);t>=0&&Ft.splice(t,5),Ft.push(e,e.style.cssText,e.getBBox&&e.getAttribute("transform"),G.core.getCache(e),me())}})):Ft},lr.revert=function(e,t){return Bt(!e,t)},lr.create=function(e,t){return new lr(e,t)},lr.refresh=function(e){return e?Ot(!0):(V||lr.register())&&Wt(!0)},lr.update=function(e){return++_.cache&&Yt(!0===e?2:0)},lr.clearScrollMemory=zt,lr.maxScroll=function(e,t){return Ve(e,t?R:O)},lr.getScrollFunc=function(e,t){return I(k(e),t?R:O)},lr.getById=function(e){return Lt[e]},lr.getAll=function(){return At.filter((function(e){return"ScrollSmoother"!==e.vars.id}))},lr.isScrolling=function(){return!!Le},lr.snapDirectional=gt,lr.addEventListener=function(e,t){var r=kt[e]||(kt[e]=[]);~r.indexOf(t)||r.push(t)},lr.removeEventListener=function(e,t){var r=kt[e],n=r&&r.indexOf(t);n>=0&&r.splice(n,1)},lr.batch=function(e,t){var r,n=[],i={},o=t.interval||.016,s=t.batchMax||1e9,a=function(e,t){var r=[],n=[],i=G.delayedCall(o,(function(){t(r,n),r=[],n=[]})).pause();return function(e){r.length||i.restart(!0),r.push(e.trigger),n.push(e),s<=r.length&&i.progress(1)}};for(r in t)i[r]="on"===r.substr(0,2)&&qe(t[r])&&"onRefreshInit"!==r?a(0,t[r]):t[r];return qe(s)&&(s=s(),bt(lr,"refresh",(function(){return s=t.batchMax()}))),J(e).forEach((function(e){var t={};for(r in i)t[r]=i[r];t.trigger=e,n.push(lr.create(t))})),n};var cr,ur=function(e,t,r,n){return t>n?e(n):t<0&&e(0),r>n?(n-t)/(r-t):r<0?t/(t-r):1},hr=function e(t,r){!0===r?t.style.removeProperty("touch-action"):t.style.touchAction=!0===r?"auto":r?"pan-"+r+(z.isTouch?" pinch-zoom":""):"none",t===q&&e(X,r)},dr={auto:1,scroll:1},pr=function(e){var t,r=e.event,n=e.target,i=e.axis,o=(r.changedTouches?r.changedTouches[0]:r).target,s=o._gsap||G.core.getCache(o),a=je();if(!s._isScrollT||a-s._isScrollT>2e3){for(;o&&o!==X&&(o.scrollHeight<=o.clientHeight&&o.scrollWidth<=o.clientWidth||!dr[(t=dt(o)).overflowY]&&!dr[t.overflowX]);)o=o.parentNode;s._isScroll=o&&o!==n&&!Be(o)&&(dr[(t=dt(o)).overflowY]||dr[t.overflowX]),s._isScrollT=a}(s._isScroll||"x"===i)&&(r.stopPropagation(),r._gsapAllow=!0)},fr=function(e,t,r,n){return z.create({target:e,capture:!0,debounce:!1,lockAxis:!0,type:t,onWheel:n=n&&pr,onPress:n,onDrag:n,onScroll:n,onEnable:function(){return r&&bt(W,z.eventTypes[0],yr,!1,!0)},onDisable:function(){return _t(W,z.eventTypes[0],yr,!0)}})},mr=/(input|label|select|textarea)/i,yr=function(e){var t=mr.test(e.target.tagName);(t||cr)&&(e._gsapAllow=!0,cr=t)};lr.sort=function(e){if(qe(e))return At.sort(e);var t=H.pageYOffset||0;return lr.getAll().forEach((function(e){return e._sortY=e.trigger?t+e.trigger.getBoundingClientRect().top:e.start+H.innerHeight})),At.sort(e||function(e,t){return-1e6*(e.vars.refreshPriority||0)+(e.vars.containerAnimation?1e6:e._sortY)-((t.vars.containerAnimation?1e6:t._sortY)+-1e6*(t.vars.refreshPriority||0))})},lr.observe=function(e){return new z(e)},lr.normalizeScroll=function(e){if(void 0===e)return ue;if(!0===e&&ue)return ue.enable();if(!1===e)return ue&&ue.kill(),void(ue=e);var t=e instanceof z?e:function(e){Ye(e)||(e={}),e.preventDefault=e.isNormalizer=e.allowClicks=!0,e.type||(e.type="wheel,touch"),e.debounce=!!e.debounce,e.id=e.id||"normalizer";var t,r,n,i,o,s,a,l,c=e,u=c.normalizeScrollX,h=c.momentum,d=c.allowNestedScroll,p=c.onRelease,f=k(e.target)||q,m=G.core.globals().ScrollSmoother,y=m&&m.get(),g=fe&&(e.content&&k(e.content)||y&&!1!==e.content&&!y.smooth()&&y.content()),v=I(f,O),b=I(f,R),x=1,w=(z.isTouch&&H.visualViewport?H.visualViewport.scale*H.visualViewport.width:H.outerWidth)/H.innerWidth,S=0,M=qe(h)?function(){return h(t)}:function(){return h||2.8},T=fr(f,e.type,!0,d),E=function(){return i=!1},j=De,A=De,L=function(){r=Ve(f,O),A=K(fe?1:0,r),u&&(j=K(0,Ve(f,R))),n=Gt},C=function(){g._gsap.y=Ne(parseFloat(g._gsap.y)+v.offset)+"px",g.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(g._gsap.y)+", 0, 1)",v.offset=v.cacheID=0},P=function(){L(),o.isActive()&&o.vars.scrollY>r&&(v()>r?o.progress(1)&&v(r):o.resetTo("scrollY",r))};return g&&G.set(g,{y:"+=0"}),e.ignoreCheck=function(e){return fe&&"touchmove"===e.type&&function(){if(i){requestAnimationFrame(E);var e=Ne(t.deltaY/2),r=A(v.v-e);if(g&&r!==v.v+v.offset){v.offset=r-v.v;var n=Ne((parseFloat(g&&g._gsap.y)||0)-v.offset);g.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+n+", 0, 1)",g._gsap.y=n+"px",v.cacheID=_.cache,Yt()}return!0}v.offset&&C(),i=!0}()||x>1.05&&"touchstart"!==e.type||t.isGesturing||e.touches&&e.touches.length>1},e.onPress=function(){i=!1;var e=x;x=Ne((H.visualViewport&&H.visualViewport.scale||1)/w),o.pause(),e!==x&&hr(f,x>1.01||!u&&"x"),s=b(),a=v(),L(),n=Gt},e.onRelease=e.onGestureStart=function(e,t){if(v.offset&&C(),t){_.cache++;var n,i,s=M();u&&(i=(n=b())+.05*s*-e.velocityX/.227,s*=ur(b,n,i,Ve(f,R)),o.vars.scrollX=j(i)),i=(n=v())+.05*s*-e.velocityY/.227,s*=ur(v,n,i,Ve(f,O)),o.vars.scrollY=A(i),o.invalidate().duration(s).play(.01),(fe&&o.vars.scrollY>=r||n>=r-1)&&G.to({},{onUpdate:P,duration:s})}else l.restart(!0);p&&p(e)},e.onWheel=function(){o._ts&&o.pause(),je()-S>1e3&&(n=0,S=je())},e.onChange=function(e,t,r,i,o){if(Gt!==n&&L(),t&&u&&b(j(i[2]===t?s+(e.startX-e.x):b()+t-i[1])),r){v.offset&&C();var l=o[2]===r,c=l?a+e.startY-e.y:v()+r-o[1],h=A(c);l&&c!==h&&(a+=h-c),v(h)}(r||t)&&Yt()},e.onEnable=function(){hr(f,!u&&"x"),lr.addEventListener("refresh",P),bt(H,"resize",P),v.smooth&&(v.target.style.scrollBehavior="auto",v.smooth=b.smooth=!1),T.enable()},e.onDisable=function(){hr(f,!0),_t(H,"resize",P),lr.removeEventListener("refresh",P),T.kill()},e.lockAxis=!1!==e.lockAxis,(t=new z(e)).iOS=fe,fe&&!v()&&v(1),fe&&G.ticker.add(De),l=t._dc,o=G.to(t,{ease:"power4",paused:!0,inherit:!1,scrollX:u?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:or(v,v(),(function(){return o.pause()}))},onUpdate:Yt,onComplete:l.vars.onComplete}),t}(e);return ue&&ue.target===t.target&&ue.kill(),Be(t.target)&&(ue=t),t},lr.core={_getVelocityProp:D,_inputObserver:fr,_scrollers:_,_proxies:x,bridge:{ss:function(){Le||Nt("scrollStart"),Le=je()},ref:function(){return ee}}},Ue()&&G.registerPlugin(lr)},700:function(e){"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=r},751:function(e){var t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,y=!1;function g(){if(!y){y=!0;var e=navigator.userAgent,g=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),v=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(d=/\b(iPhone|iP[ao]d)/.exec(e),p=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),f=/FBAN\/\w+;/i.exec(e),m=/Mobile/i.exec(e),h=!!/Win64/.exec(e),g){(t=g[1]?parseFloat(g[1]):g[5]?parseFloat(g[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var b=/(?:Trident\/(\d+.\d+))/.exec(e);s=b?parseFloat(b[1])+4:t,r=g[2]?parseFloat(g[2]):NaN,n=g[3]?parseFloat(g[3]):NaN,(i=g[4]?parseFloat(g[4]):NaN)?(g=/(?:Chrome\/(\d+\.\d+))/.exec(e),o=g&&g[1]?parseFloat(g[1]):NaN):o=NaN}else t=r=n=o=i=NaN;if(v){if(v[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);a=!_||parseFloat(_[1].replace("_","."))}else a=!1;l=!!v[2],c=!!v[3]}else a=l=c=!1}}var v={ie:function(){return g()||t},ieCompatibilityMode:function(){return g()||s>t},ie64:function(){return v.ie()&&h},firefox:function(){return g()||r},opera:function(){return g()||n},webkit:function(){return g()||i},safari:function(){return v.webkit()},chrome:function(){return g()||o},windows:function(){return g()||l},osx:function(){return g()||a},linux:function(){return g()||c},iphone:function(){return g()||d},mobile:function(){return g()||d||p||u||m},nativeApp:function(){return g()||f},android:function(){return g()||u},ipad:function(){return g()||p}};e.exports=v},777:function(e,t,r){"use strict";var n=r(751),i=r(125);function o(e){var t=0,r=0,n=0,i=0;return"detail"in e&&(r=e.detail),"wheelDelta"in e&&(r=-e.wheelDelta/120),"wheelDeltaY"in e&&(r=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=r,r=0),n=10*t,i=10*r,"deltaY"in e&&(i=e.deltaY),"deltaX"in e&&(n=e.deltaX),(n||i)&&e.deltaMode&&(1==e.deltaMode?(n*=40,i*=40):(n*=800,i*=800)),n&&!t&&(t=n<1?-1:1),i&&!r&&(r=i<1?-1:1),{spinX:t,spinY:r,pixelX:n,pixelY:i}}o.getEventType=function(){return n.firefox()?"DOMMouseScroll":i("wheel")?"wheel":"mousewheel"},e.exports=o},880:function(e,t,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}r.d(t,{Ay:function(){return Yn},os:function(){return Yn}});var o,s,a,l,c,u,h,d,p,f,m,y,g,v,b,_,x,w={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},S={duration:.5,overwrite:!1,delay:0},M=1e8,T=1e-8,E=2*Math.PI,j=E/4,A=0,L=Math.sqrt,C=Math.cos,P=Math.sin,R=function(e){return"string"==typeof e},O=function(e){return"function"==typeof e},k=function(e){return"number"==typeof e},I=function(e){return void 0===e},D=function(e){return"object"==typeof e},N=function(e){return!1!==e},F=function(){return"undefined"!=typeof window},U=function(e){return O(e)||R(e)},B="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},z=Array.isArray,G=/(?:-?\.?\d|\.)+/gi,V=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,H=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,W=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,q=/[+-]=-?[.\d]+/,X=/[^,'"\[\]\s]+/gi,Y=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Z={},J={},K=function(e){return(J=Ee(e,Z))&&Er},Q=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},$=function(e,t){return!t&&console.warn(e)},ee=function(e,t){return e&&(Z[e]=t)&&J&&(J[e]=t)||Z},te=function(){return 0},re={suppressEvents:!0,isStart:!0,kill:!1},ne={suppressEvents:!0,kill:!1},ie={suppressEvents:!0},oe={},se=[],ae={},le={},ce={},ue=30,he=[],de="",pe=function(e){var t,r,n=e[0];if(D(n)||O(n)||(e=[e]),!(t=(n._gsap||{}).harness)){for(r=he.length;r--&&!he[r].targetTest(n););t=he[r]}for(r=e.length;r--;)e[r]&&(e[r]._gsap||(e[r]._gsap=new Bt(e[r],t)))||e.splice(r,1);return e},fe=function(e){return e._gsap||pe(nt(e))[0]._gsap},me=function(e,t,r){return(r=e[t])&&O(r)?e[t]():I(r)&&e.getAttribute&&e.getAttribute(t)||r},ye=function(e,t){return(e=e.split(",")).forEach(t)||e},ge=function(e){return Math.round(1e5*e)/1e5||0},ve=function(e){return Math.round(1e7*e)/1e7||0},be=function(e,t){var r=t.charAt(0),n=parseFloat(t.substr(2));return e=parseFloat(e),"+"===r?e+n:"-"===r?e-n:"*"===r?e*n:e/n},_e=function(e,t){for(var r=t.length,n=0;e.indexOf(t[n])<0&&++n<r;);return n<r},xe=function(){var e,t,r=se.length,n=se.slice(0);for(ae={},se.length=0,e=0;e<r;e++)(t=n[e])&&t._lazy&&(t.render(t._lazy[0],t._lazy[1],!0)._lazy=0)},we=function(e,t,r,n){se.length&&!s&&xe(),e.render(t,r,n||s&&t<0&&(e._initted||e._startAt)),se.length&&!s&&xe()},Se=function(e){var t=parseFloat(e);return(t||0===t)&&(e+"").match(X).length<2?t:R(e)?e.trim():e},Me=function(e){return e},Te=function(e,t){for(var r in t)r in e||(e[r]=t[r]);return e},Ee=function(e,t){for(var r in t)e[r]=t[r];return e},je=function e(t,r){for(var n in r)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&(t[n]=D(r[n])?e(t[n]||(t[n]={}),r[n]):r[n]);return t},Ae=function(e,t){var r,n={};for(r in e)r in t||(n[r]=e[r]);return n},Le=function(e){var t,r=e.parent||l,n=e.keyframes?(t=z(e.keyframes),function(e,r){for(var n in r)n in e||"duration"===n&&t||"ease"===n||(e[n]=r[n])}):Te;if(N(e.inherit))for(;r;)n(e,r.vars.defaults),r=r.parent||r._dp;return e},Ce=function(e,t,r,n,i){void 0===r&&(r="_first"),void 0===n&&(n="_last");var o,s=e[n];if(i)for(o=t[i];s&&s[i]>o;)s=s._prev;return s?(t._next=s._next,s._next=t):(t._next=e[r],e[r]=t),t._next?t._next._prev=t:e[n]=t,t._prev=s,t.parent=t._dp=e,t},Pe=function(e,t,r,n){void 0===r&&(r="_first"),void 0===n&&(n="_last");var i=t._prev,o=t._next;i?i._next=o:e[r]===t&&(e[r]=o),o?o._prev=i:e[n]===t&&(e[n]=i),t._next=t._prev=t.parent=null},Re=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Oe=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},ke=function(e,t,r,n){return e._startAt&&(s?e._startAt.revert(ne):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},Ie=function e(t){return!t||t._ts&&e(t.parent)},De=function(e){return e._repeat?Ne(e._tTime,e=e.duration()+e._rDelay)*e:0},Ne=function(e,t){var r=Math.floor(e=ve(e/t));return e&&r===e?r-1:r},Fe=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Ue=function(e){return e._end=ve(e._start+(e._tDur/Math.abs(e._ts||e._rts||T)||0))},Be=function(e,t){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=ve(r._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Ue(e),r._dirty||Oe(r,e)),e},ze=function(e,t){var r;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(r=Fe(e.rawTime(),t),(!t._dur||$e(0,t.totalDuration(),r)-t._tTime>T)&&t.render(r,!0)),Oe(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(r=e;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-1e-8}},Ge=function(e,t,r,n){return t.parent&&Re(t),t._start=ve((k(r)?r:r||e!==l?Je(e,r,t):e._time)+t._delay),t._end=ve(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),Ce(e,t,"_first","_last",e._sort?"_start":0),qe(t)||(e._recent=t),n||ze(e,t),e._ts<0&&Be(e,e._tTime),e},Ve=function(e,t){return(Z.ScrollTrigger||Q("scrollTrigger",t))&&Z.ScrollTrigger.create(t,e)},He=function(e,t,r,n,i){return Yt(e,t,i),e._initted?!r&&e._pt&&!s&&(e._dur&&!1!==e.vars.lazy||!e._dur&&e.vars.lazy)&&p!==jt.frame?(se.push(e),e._lazy=[i,n],1):void 0:1},We=function e(t){var r=t.parent;return r&&r._ts&&r._initted&&!r._lock&&(r.rawTime()<0||e(r))},qe=function(e){var t=e.data;return"isFromStart"===t||"isStart"===t},Xe=function(e,t,r,n){var i=e._repeat,o=ve(t)||0,s=e._tTime/e._tDur;return s&&!n&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:ve(o*(i+1)+e._rDelay*i):o,s>0&&!n&&Be(e,e._tTime=e._tDur*s),e.parent&&Ue(e),r||Oe(e.parent,e),e},Ye=function(e){return e instanceof Gt?Oe(e):Xe(e,e._dur)},Ze={_start:0,endTime:te,totalDuration:te},Je=function e(t,r,n){var i,o,s,a=t.labels,l=t._recent||Ze,c=t.duration()>=M?l.endTime(!1):t._dur;return R(r)&&(isNaN(r)||r in a)?(o=r.charAt(0),s="%"===r.substr(-1),i=r.indexOf("="),"<"===o||">"===o?(i>=0&&(r=r.replace(/=/,"")),("<"===o?l._start:l.endTime(l._repeat>=0))+(parseFloat(r.substr(1))||0)*(s?(i<0?l:n).totalDuration()/100:1)):i<0?(r in a||(a[r]=c),a[r]):(o=parseFloat(r.charAt(i-1)+r.substr(i+1)),s&&n&&(o=o/100*(z(n)?n[0]:n).totalDuration()),i>1?e(t,r.substr(0,i-1),n)+o:c+o)):null==r?c:+r},Ke=function(e,t,r){var n,i,o=k(t[1]),s=(o?2:1)+(e<2?0:1),a=t[s];if(o&&(a.duration=t[1]),a.parent=r,e){for(n=a,i=r;i&&!("immediateRender"in n);)n=i.vars.defaults||{},i=N(i.vars.inherit)&&i.parent;a.immediateRender=N(n.immediateRender),e<2?a.runBackwards=1:a.startAt=t[s-1]}return new $t(t[0],a,t[s+1])},Qe=function(e,t){return e||0===e?t(e):t},$e=function(e,t,r){return r<e?e:r>t?t:r},et=function(e,t){return R(e)&&(t=Y.exec(e))?t[1]:""},tt=[].slice,rt=function(e,t){return e&&D(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&D(e[0]))&&!e.nodeType&&e!==c},nt=function(e,t,r){return a&&!t&&a.selector?a.selector(e):!R(e)||r||!u&&At()?z(e)?function(e,t,r){return void 0===r&&(r=[]),e.forEach((function(e){var n;return R(e)&&!t||rt(e,1)?(n=r).push.apply(n,nt(e)):r.push(e)}))||r}(e,r):rt(e)?tt.call(e,0):e?[e]:[]:tt.call((t||h).querySelectorAll(e),0)},it=function(e){return e=nt(e)[0]||$("Invalid scope")||{},function(t){var r=e.current||e.nativeElement||e;return nt(t,r.querySelectorAll?r:r===e?$("Invalid scope")||h.createElement("div"):e)}},ot=function(e){return e.sort((function(){return.5-Math.random()}))},st=function(e){if(O(e))return e;var t=D(e)?e:{each:e},r=It(t.ease),n=t.from||0,i=parseFloat(t.base)||0,o={},s=n>0&&n<1,a=isNaN(n)||s,l=t.axis,c=n,u=n;return R(n)?c=u={center:.5,edges:.5,end:1}[n]||0:!s&&a&&(c=n[0],u=n[1]),function(e,s,h){var d,p,f,m,y,g,v,b,_,x=(h||t).length,w=o[x];if(!w){if(!(_="auto"===t.grid?0:(t.grid||[1,M])[1])){for(v=-M;v<(v=h[_++].getBoundingClientRect().left)&&_<x;);_<x&&_--}for(w=o[x]=[],d=a?Math.min(_,x)*c-.5:n%_,p=_===M?0:a?x*u/_-.5:n/_|0,v=0,b=M,g=0;g<x;g++)f=g%_-d,m=p-(g/_|0),w[g]=y=l?Math.abs("y"===l?m:f):L(f*f+m*m),y>v&&(v=y),y<b&&(b=y);"random"===n&&ot(w),w.max=v-b,w.min=b,w.v=x=(parseFloat(t.amount)||parseFloat(t.each)*(_>x?x-1:l?"y"===l?x/_:_:Math.max(_,x/_))||0)*("edges"===n?-1:1),w.b=x<0?i-x:i,w.u=et(t.amount||t.each)||0,r=r&&x<0?Ot(r):r}return x=(w[e]-w.min)/w.max||0,ve(w.b+(r?r(x):x)*w.v)+w.u}},at=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var n=ve(Math.round(parseFloat(r)/e)*e*t);return(n-n%1)/t+(k(r)?0:et(r))}},lt=function(e,t){var r,n,i=z(e);return!i&&D(e)&&(r=i=e.radius||M,e.values?(e=nt(e.values),(n=!k(e[0]))&&(r*=r)):e=at(e.increment)),Qe(t,i?O(e)?function(t){return n=e(t),Math.abs(n-t)<=r?n:t}:function(t){for(var i,o,s=parseFloat(n?t.x:t),a=parseFloat(n?t.y:0),l=M,c=0,u=e.length;u--;)(i=n?(i=e[u].x-s)*i+(o=e[u].y-a)*o:Math.abs(e[u]-s))<l&&(l=i,c=u);return c=!r||l<=r?e[c]:t,n||c===t||k(t)?c:c+et(t)}:at(e))},ct=function(e,t,r,n){return Qe(z(e)?!t:!0===r?!!(r=0):!n,(function(){return z(e)?e[~~(Math.random()*e.length)]:(r=r||1e-5)&&(n=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((e-r/2+Math.random()*(t-e+.99*r))/r)*r*n)/n}))},ut=function(e,t,r){return Qe(r,(function(r){return e[~~t(r)]}))},ht=function(e){for(var t,r,n,i,o=0,s="";~(t=e.indexOf("random(",o));)n=e.indexOf(")",t),i="["===e.charAt(t+7),r=e.substr(t+7,n-t-7).match(i?X:G),s+=e.substr(o,t-o)+ct(i?r:+r[0],i?0:+r[1],+r[2]||1e-5),o=n+1;return s+e.substr(o,e.length-o)},dt=function(e,t,r,n,i){var o=t-e,s=n-r;return Qe(i,(function(t){return r+((t-e)/o*s||0)}))},pt=function(e,t,r){var n,i,o,s=e.labels,a=M;for(n in s)(i=s[n]-t)<0==!!r&&i&&a>(i=Math.abs(i))&&(o=n,a=i);return o},ft=function(e,t,r){var n,i,o,s=e.vars,l=s[t],c=a,u=e._ctx;if(l)return n=s[t+"Params"],i=s.callbackScope||e,r&&se.length&&xe(),u&&(a=u),o=n?l.apply(i,n):l.call(i),a=c,o},mt=function(e){return Re(e),e.scrollTrigger&&e.scrollTrigger.kill(!!s),e.progress()<1&&ft(e,"onInterrupt"),e},yt=[],gt=function(e){if(e)if(e=!e.name&&e.default||e,F()||e.headless){var t=e.name,r=O(e),n=t&&!r&&e.init?function(){this._props=[]}:e,i={init:te,render:lr,add:qt,kill:ur,modifier:cr,rawVars:0},o={targetTest:0,get:0,getSetter:ir,aliases:{},register:0};if(At(),e!==n){if(le[t])return;Te(n,Te(Ae(e,i),o)),Ee(n.prototype,Ee(i,Ae(e,o))),le[n.prop=t]=n,e.targetTest&&(he.push(n),oe[t]=1),t=("css"===t?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}ee(t,n),e.register&&e.register(Er,n,pr)}else yt.push(e)},vt=255,bt={aqua:[0,vt,vt],lime:[0,vt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,vt],navy:[0,0,128],white:[vt,vt,vt],olive:[128,128,0],yellow:[vt,vt,0],orange:[vt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[vt,0,0],pink:[vt,192,203],cyan:[0,vt,vt],transparent:[vt,vt,vt,0]},_t=function(e,t,r){return(6*(e+=e<0?1:e>1?-1:0)<1?t+(r-t)*e*6:e<.5?r:3*e<2?t+(r-t)*(2/3-e)*6:t)*vt+.5|0},xt=function(e,t,r){var n,i,o,s,a,l,c,u,h,d,p=e?k(e)?[e>>16,e>>8&vt,e&vt]:0:bt.black;if(!p){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),bt[e])p=bt[e];else if("#"===e.charAt(0)){if(e.length<6&&(n=e.charAt(1),i=e.charAt(2),o=e.charAt(3),e="#"+n+n+i+i+o+o+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(p=parseInt(e.substr(1,6),16))>>16,p>>8&vt,p&vt,parseInt(e.substr(7),16)/255];p=[(e=parseInt(e.substr(1),16))>>16,e>>8&vt,e&vt]}else if("hsl"===e.substr(0,3))if(p=d=e.match(G),t){if(~e.indexOf("="))return p=e.match(V),r&&p.length<4&&(p[3]=1),p}else s=+p[0]%360/360,a=+p[1]/100,n=2*(l=+p[2]/100)-(i=l<=.5?l*(a+1):l+a-l*a),p.length>3&&(p[3]*=1),p[0]=_t(s+1/3,n,i),p[1]=_t(s,n,i),p[2]=_t(s-1/3,n,i);else p=e.match(G)||bt.transparent;p=p.map(Number)}return t&&!d&&(n=p[0]/vt,i=p[1]/vt,o=p[2]/vt,l=((c=Math.max(n,i,o))+(u=Math.min(n,i,o)))/2,c===u?s=a=0:(h=c-u,a=l>.5?h/(2-c-u):h/(c+u),s=c===n?(i-o)/h+(i<o?6:0):c===i?(o-n)/h+2:(n-i)/h+4,s*=60),p[0]=~~(s+.5),p[1]=~~(100*a+.5),p[2]=~~(100*l+.5)),r&&p.length<4&&(p[3]=1),p},wt=function(e){var t=[],r=[],n=-1;return e.split(Mt).forEach((function(e){var i=e.match(H)||[];t.push.apply(t,i),r.push(n+=i.length+1)})),t.c=r,t},St=function(e,t,r){var n,i,o,s,a="",l=(e+a).match(Mt),c=t?"hsla(":"rgba(",u=0;if(!l)return e;if(l=l.map((function(e){return(e=xt(e,t,1))&&c+(t?e[0]+","+e[1]+"%,"+e[2]+"%,"+e[3]:e.join(","))+")"})),r&&(o=wt(e),(n=r.c).join(a)!==o.c.join(a)))for(s=(i=e.replace(Mt,"1").split(H)).length-1;u<s;u++)a+=i[u]+(~n.indexOf(u)?l.shift()||c+"0,0,0,0)":(o.length?o:l.length?l:r).shift());if(!i)for(s=(i=e.split(Mt)).length-1;u<s;u++)a+=i[u]+l[u];return a+i[s]},Mt=function(){var e,t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(e in bt)t+="|"+e+"\\b";return new RegExp(t+")","gi")}(),Tt=/hsl[a]?\(/,Et=function(e){var t,r=e.join(" ");if(Mt.lastIndex=0,Mt.test(r))return t=Tt.test(r),e[1]=St(e[1],t),e[0]=St(e[0],t,wt(e[1])),!0},jt=function(){var e,t,r,n,i,o,s=Date.now,a=500,l=33,p=s(),f=p,y=1e3/240,g=y,v=[],b=function r(c){var u,h,d,m,b=s()-f,_=!0===c;if((b>a||b<0)&&(p+=b-l),((u=(d=(f+=b)-p)-g)>0||_)&&(m=++n.frame,i=d-1e3*n.time,n.time=d/=1e3,g+=u+(u>=y?4:y-u),h=1),_||(e=t(r)),h)for(o=0;o<v.length;o++)v[o](d,i,m,c)};return n={time:0,frame:0,tick:function(){b(!0)},deltaRatio:function(e){return i/(1e3/(e||60))},wake:function(){d&&(!u&&F()&&(c=u=window,h=c.document||{},Z.gsap=Er,(c.gsapVersions||(c.gsapVersions=[])).push(Er.version),K(J||c.GreenSockGlobals||!c.gsap&&c||{}),yt.forEach(gt)),r="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame,e&&n.sleep(),t=r||function(e){return setTimeout(e,g-1e3*n.time+1|0)},m=1,b(2))},sleep:function(){(r?cancelAnimationFrame:clearTimeout)(e),m=0,t=te},lagSmoothing:function(e,t){a=e||1/0,l=Math.min(t||33,a)},fps:function(e){y=1e3/(e||240),g=1e3*n.time+y},add:function(e,t,r){var i=t?function(t,r,o,s){e(t,r,o,s),n.remove(i)}:e;return n.remove(e),v[r?"unshift":"push"](i),At(),i},remove:function(e,t){~(t=v.indexOf(e))&&v.splice(t,1)&&o>=t&&o--},_listeners:v}}(),At=function(){return!m&&jt.wake()},Lt={},Ct=/^[\d.\-M][\d.\-,\s]/,Pt=/["']/g,Rt=function(e){for(var t,r,n,i={},o=e.substr(1,e.length-3).split(":"),s=o[0],a=1,l=o.length;a<l;a++)r=o[a],t=a!==l-1?r.lastIndexOf(","):r.length,n=r.substr(0,t),i[s]=isNaN(n)?n.replace(Pt,"").trim():+n,s=r.substr(t+1).trim();return i},Ot=function(e){return function(t){return 1-e(1-t)}},kt=function e(t,r){for(var n,i=t._first;i;)i instanceof Gt?e(i,r):!i.vars.yoyoEase||i._yoyo&&i._repeat||i._yoyo===r||(i.timeline?e(i.timeline,r):(n=i._ease,i._ease=i._yEase,i._yEase=n,i._yoyo=r)),i=i._next},It=function(e,t){return e&&(O(e)?e:Lt[e]||function(e){var t,r,n,i,o=(e+"").split("("),s=Lt[o[0]];return s&&o.length>1&&s.config?s.config.apply(null,~e.indexOf("{")?[Rt(o[1])]:(t=e,r=t.indexOf("(")+1,n=t.indexOf(")"),i=t.indexOf("(",r),t.substring(r,~i&&i<n?t.indexOf(")",n+1):n)).split(",").map(Se)):Lt._CE&&Ct.test(e)?Lt._CE("",e):s}(e))||t},Dt=function(e,t,r,n){void 0===r&&(r=function(e){return 1-t(1-e)}),void 0===n&&(n=function(e){return e<.5?t(2*e)/2:1-t(2*(1-e))/2});var i,o={easeIn:t,easeOut:r,easeInOut:n};return ye(e,(function(e){for(var t in Lt[e]=Z[e]=o,Lt[i=e.toLowerCase()]=r,o)Lt[i+("easeIn"===t?".in":"easeOut"===t?".out":".inOut")]=Lt[e+"."+t]=o[t]})),o},Nt=function(e){return function(t){return t<.5?(1-e(1-2*t))/2:.5+e(2*(t-.5))/2}},Ft=function e(t,r,n){var i=r>=1?r:1,o=(n||(t?.3:.45))/(r<1?r:1),s=o/E*(Math.asin(1/i)||0),a=function(e){return 1===e?1:i*Math.pow(2,-10*e)*P((e-s)*o)+1},l="out"===t?a:"in"===t?function(e){return 1-a(1-e)}:Nt(a);return o=E/o,l.config=function(r,n){return e(t,r,n)},l},Ut=function e(t,r){void 0===r&&(r=1.70158);var n=function(e){return e?--e*e*((r+1)*e+r)+1:0},i="out"===t?n:"in"===t?function(e){return 1-n(1-e)}:Nt(n);return i.config=function(r){return e(t,r)},i};ye("Linear,Quad,Cubic,Quart,Quint,Strong",(function(e,t){var r=t<5?t+1:t;Dt(e+",Power"+(r-1),t?function(e){return Math.pow(e,r)}:function(e){return e},(function(e){return 1-Math.pow(1-e,r)}),(function(e){return e<.5?Math.pow(2*e,r)/2:1-Math.pow(2*(1-e),r)/2}))})),Lt.Linear.easeNone=Lt.none=Lt.Linear.easeIn,Dt("Elastic",Ft("in"),Ft("out"),Ft()),y=7.5625,b=2*(v=1/(g=2.75)),_=2.5*v,Dt("Bounce",(function(e){return 1-x(1-e)}),x=function(e){return e<v?y*e*e:e<b?y*Math.pow(e-1.5/g,2)+.75:e<_?y*(e-=2.25/g)*e+.9375:y*Math.pow(e-2.625/g,2)+.984375}),Dt("Expo",(function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)})),Dt("Circ",(function(e){return-(L(1-e*e)-1)})),Dt("Sine",(function(e){return 1===e?1:1-C(e*j)})),Dt("Back",Ut("in"),Ut("out"),Ut()),Lt.SteppedEase=Lt.steps=Z.SteppedEase={config:function(e,t){void 0===e&&(e=1);var r=1/e,n=e+(t?0:1),i=t?1:0;return function(e){return((n*$e(0,.99999999,e)|0)+i)*r}}},S.ease=Lt["quad.out"],ye("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",(function(e){return de+=e+","+e+"Params,"}));var Bt=function(e,t){this.id=A++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:me,this.set=t?t.getSetter:ir},zt=function(){function e(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,Xe(this,+e.duration,1,1),this.data=e.data,a&&(this._ctx=a,a.data.push(this)),m||jt.wake()}var t=e.prototype;return t.delay=function(e){return e||0===e?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+e-this._delay),this._delay=e,this):this._delay},t.duration=function(e){return arguments.length?this.totalDuration(this._repeat>0?e+(e+this._rDelay)*this._repeat:e):this.totalDuration()&&this._dur},t.totalDuration=function(e){return arguments.length?(this._dirty=0,Xe(this,this._repeat<0?e:(e-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(e,t){if(At(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(Be(this,e),!r._dp||r.parent||ze(r,this);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&&this._dp.autoRemoveChildren&&(this._ts>0&&e<this._tDur||this._ts<0&&e>0||!this._tDur&&!e)&&Ge(this._dp,this,this._start-this._delay)}return(this._tTime!==e||!this._dur&&!t||this._initted&&Math.abs(this._zTime)===T||!e&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=e),we(this,e,t)),this},t.time=function(e,t){return arguments.length?this.totalTime(Math.min(this.totalDuration(),e+De(this))%(this._dur+this._rDelay)||(e?this._dur:0),t):this._time},t.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?e:1-e)+De(this),t):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(e,t){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(e-1)*r,t):this._repeat?Ne(this._tTime,r)+1:1},t.timeScale=function(e,t){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===e)return this;var r=this.parent&&this._ts?Fe(this.parent._time,this):this._tTime;return this._rts=+e||0,this._ts=this._ps||-1e-8===e?0:this._rts,this.totalTime($e(-Math.abs(this._delay),this._tDur,r),!1!==t),Ue(this),function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e}(this)},t.paused=function(e){return arguments.length?(this._ps!==e&&(this._ps=e,e?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(At(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==T&&(this._tTime-=T)))),this):this._ps},t.startTime=function(e){if(arguments.length){this._start=e;var t=this.parent||this._dp;return t&&(t._sort||!this.parent)&&Ge(t,this,e-this._delay),this}return this._start},t.endTime=function(e){return this._start+(N(e)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},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?Fe(t.rawTime(e),this):this._tTime:this._tTime},t.revert=function(e){void 0===e&&(e=ie);var t=s;return s=e,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(e),this.totalTime(-.01,e.suppressEvents)),"nested"!==this.data&&!1!==e.kill&&this.kill(),s=t,this},t.globalTime=function(e){for(var t=this,r=arguments.length?e:t.rawTime();t;)r=t._start+r/(Math.abs(t._ts)||1),t=t._dp;return!this.parent&&this._sat?this._sat.globalTime(e):r},t.repeat=function(e){return arguments.length?(this._repeat=e===1/0?-2:e,Ye(this)):-2===this._repeat?1/0:this._repeat},t.repeatDelay=function(e){if(arguments.length){var t=this._time;return this._rDelay=e,Ye(this),t?this.time(t):this}return this._rDelay},t.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},t.seek=function(e,t){return this.totalTime(Je(this,e),N(t))},t.restart=function(e,t){return this.play().totalTime(e?-this._delay:0,N(t)),this._dur||(this._zTime=-1e-8),this},t.play=function(e,t){return null!=e&&this.seek(e,t),this.reversed(!1).paused(!1)},t.reverse=function(e,t){return null!=e&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},t.pause=function(e,t){return null!=e&&this.seek(e,t),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(e){return arguments.length?(!!e!==this.reversed()&&this.timeScale(-this._rts||(e?-1e-8:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},t.isActive=function(){var e,t=this.parent||this._dp,r=this._start;return!(t&&!(this._ts&&this._initted&&t.isActive()&&(e=t.rawTime(!0))>=r&&e<this.endTime(!0)-T))},t.eventCallback=function(e,t,r){var n=this.vars;return arguments.length>1?(t?(n[e]=t,r&&(n[e+"Params"]=r),"onUpdate"===e&&(this._onUpdate=t)):delete n[e],this):n[e]},t.then=function(e){var t=this;return new Promise((function(r){var n=O(e)?e:Me,i=function(){var e=t.then;t.then=null,O(n)&&(n=n(t))&&(n.then||n===t)&&(t.then=e),r(n),t.then=e};t._initted&&1===t.totalProgress()&&t._ts>=0||!t._tTime&&t._ts<0?i():t._prom=i}))},t.kill=function(){mt(this)},e}();Te(zt.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var Gt=function(e){function t(t,r){var i;return void 0===t&&(t={}),(i=e.call(this,t)||this).labels={},i.smoothChildTiming=!!t.smoothChildTiming,i.autoRemoveChildren=!!t.autoRemoveChildren,i._sort=N(t.sortChildren),l&&Ge(t.parent||l,n(i),r),t.reversed&&i.reverse(),t.paused&&i.paused(!0),t.scrollTrigger&&Ve(n(i),t.scrollTrigger),i}i(t,e);var r=t.prototype;return r.to=function(e,t,r){return Ke(0,arguments,this),this},r.from=function(e,t,r){return Ke(1,arguments,this),this},r.fromTo=function(e,t,r,n){return Ke(2,arguments,this),this},r.set=function(e,t,r){return t.duration=0,t.parent=this,Le(t).repeatDelay||(t.repeat=0),t.immediateRender=!!t.immediateRender,new $t(e,t,Je(this,r),1),this},r.call=function(e,t,r){return Ge(this,$t.delayedCall(0,e,t),r)},r.staggerTo=function(e,t,r,n,i,o,s){return r.duration=t,r.stagger=r.stagger||n,r.onComplete=o,r.onCompleteParams=s,r.parent=this,new $t(e,r,Je(this,i)),this},r.staggerFrom=function(e,t,r,n,i,o,s){return r.runBackwards=1,Le(r).immediateRender=N(r.immediateRender),this.staggerTo(e,t,r,n,i,o,s)},r.staggerFromTo=function(e,t,r,n,i,o,s,a){return n.startAt=r,Le(n).immediateRender=N(n.immediateRender),this.staggerTo(e,t,n,i,o,s,a)},r.render=function(e,t,r){var n,i,o,a,c,u,h,d,p,f,m,y,g=this._time,v=this._dirty?this.totalDuration():this._tDur,b=this._dur,_=e<=0?0:ve(e),x=this._zTime<0!=e<0&&(this._initted||!b);if(this!==l&&_>v&&e>=0&&(_=v),_!==this._tTime||r||x){if(g!==this._time&&b&&(_+=this._time-g,e+=this._time-g),n=_,p=this._start,u=!(d=this._ts),x&&(b||(g=this._zTime),(e||!t)&&(this._zTime=e)),this._repeat){if(m=this._yoyo,c=b+this._rDelay,this._repeat<-1&&e<0)return this.totalTime(100*c+e,t,r);if(n=ve(_%c),_===v?(a=this._repeat,n=b):((a=~~(f=ve(_/c)))&&a===f&&(n=b,a--),n>b&&(n=b)),f=Ne(this._tTime,c),!g&&this._tTime&&f!==a&&this._tTime-f*c-this._dur<=0&&(f=a),m&&1&a&&(n=b-n,y=1),a!==f&&!this._lock){var w=m&&1&f,S=w===(m&&1&a);if(a<f&&(w=!w),g=w?0:_%b?b:_,this._lock=1,this.render(g||(y?0:ve(a*c)),t,!b)._lock=0,this._tTime=_,!t&&this.parent&&ft(this,"onRepeat"),this.vars.repeatRefresh&&!y&&(this.invalidate()._lock=1),g&&g!==this._time||u!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(b=this._dur,v=this._tDur,S&&(this._lock=2,g=w?b:-1e-4,this.render(g,!0),this.vars.repeatRefresh&&!y&&this.invalidate()),this._lock=0,!this._ts&&!u)return this;kt(this,y)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(h=function(e,t,r){var n;if(r>t)for(n=e._first;n&&n._start<=r;){if("isPause"===n.data&&n._start>t)return n;n=n._next}else for(n=e._last;n&&n._start>=r;){if("isPause"===n.data&&n._start<t)return n;n=n._prev}}(this,ve(g),ve(n)),h&&(_-=n-(n=h._start))),this._tTime=_,this._time=n,this._act=!d,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=e,g=0),!g&&n&&!t&&!a&&(ft(this,"onStart"),this._tTime!==_))return this;if(n>=g&&e>=0)for(i=this._first;i;){if(o=i._next,(i._act||n>=i._start)&&i._ts&&h!==i){if(i.parent!==this)return this.render(e,t,r);if(i.render(i._ts>0?(n-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(n-i._start)*i._ts,t,r),n!==this._time||!this._ts&&!u){h=0,o&&(_+=this._zTime=-1e-8);break}}i=o}else{i=this._last;for(var M=e<0?e:n;i;){if(o=i._prev,(i._act||M<=i._end)&&i._ts&&h!==i){if(i.parent!==this)return this.render(e,t,r);if(i.render(i._ts>0?(M-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(M-i._start)*i._ts,t,r||s&&(i._initted||i._startAt)),n!==this._time||!this._ts&&!u){h=0,o&&(_+=this._zTime=M?-1e-8:T);break}}i=o}}if(h&&!t&&(this.pause(),h.render(n>=g?0:-1e-8)._zTime=n>=g?1:-1,this._ts))return this._start=p,Ue(this),this.render(e,t,r);this._onUpdate&&!t&&ft(this,"onUpdate",!0),(_===v&&this._tTime>=this.totalDuration()||!_&&g)&&(p!==this._start&&Math.abs(d)===Math.abs(this._ts)||this._lock||((e||!b)&&(_===v&&this._ts>0||!_&&this._ts<0)&&Re(this,1),t||e<0&&!g||!_&&!g&&v||(ft(this,_===v&&e>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(_<v&&this.timeScale()>0)&&this._prom())))}return this},r.add=function(e,t){var r=this;if(k(t)||(t=Je(this,t,e)),!(e instanceof zt)){if(z(e))return e.forEach((function(e){return r.add(e,t)})),this;if(R(e))return this.addLabel(e,t);if(!O(e))return this;e=$t.delayedCall(0,e)}return this!==e?Ge(this,e,t):this},r.getChildren=function(e,t,r,n){void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===r&&(r=!0),void 0===n&&(n=-M);for(var i=[],o=this._first;o;)o._start>=n&&(o instanceof $t?t&&i.push(o):(r&&i.push(o),e&&i.push.apply(i,o.getChildren(!0,t,r)))),o=o._next;return i},r.getById=function(e){for(var t=this.getChildren(1,1,1),r=t.length;r--;)if(t[r].vars.id===e)return t[r]},r.remove=function(e){return R(e)?this.removeLabel(e):O(e)?this.killTweensOf(e):(e.parent===this&&Pe(this,e),e===this._recent&&(this._recent=this._last),Oe(this))},r.totalTime=function(t,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=ve(jt.time-(this._ts>0?t/this._ts:(this.totalDuration()-t)/-this._ts))),e.prototype.totalTime.call(this,t,r),this._forcing=0,this):this._tTime},r.addLabel=function(e,t){return this.labels[e]=Je(this,t),this},r.removeLabel=function(e){return delete this.labels[e],this},r.addPause=function(e,t,r){var n=$t.delayedCall(0,t||te,r);return n.data="isPause",this._hasPause=1,Ge(this,n,Je(this,e))},r.removePause=function(e){var t=this._first;for(e=Je(this,e);t;)t._start===e&&"isPause"===t.data&&Re(t),t=t._next},r.killTweensOf=function(e,t,r){for(var n=this.getTweensOf(e,r),i=n.length;i--;)Vt!==n[i]&&n[i].kill(e,t);return this},r.getTweensOf=function(e,t){for(var r,n=[],i=nt(e),o=this._first,s=k(t);o;)o instanceof $t?_e(o._targets,i)&&(s?(!Vt||o._initted&&o._ts)&&o.globalTime(0)<=t&&o.globalTime(o.totalDuration())>t:!t||o.isActive())&&n.push(o):(r=o.getTweensOf(i,t)).length&&n.push.apply(n,r),o=o._next;return n},r.tweenTo=function(e,t){t=t||{};var r,n=this,i=Je(n,e),o=t,s=o.startAt,a=o.onStart,l=o.onStartParams,c=o.immediateRender,u=$t.to(n,Te({ease:t.ease||"none",lazy:!1,immediateRender:!1,time:i,overwrite:"auto",duration:t.duration||Math.abs((i-(s&&"time"in s?s.time:n._time))/n.timeScale())||T,onStart:function(){if(n.pause(),!r){var e=t.duration||Math.abs((i-(s&&"time"in s?s.time:n._time))/n.timeScale());u._dur!==e&&Xe(u,e,0,1).render(u._time,!0,!0),r=1}a&&a.apply(u,l||[])}},t));return c?u.render(0):u},r.tweenFromTo=function(e,t,r){return this.tweenTo(t,Te({startAt:{time:Je(this,e)}},r))},r.recent=function(){return this._recent},r.nextLabel=function(e){return void 0===e&&(e=this._time),pt(this,Je(this,e))},r.previousLabel=function(e){return void 0===e&&(e=this._time),pt(this,Je(this,e),1)},r.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+T)},r.shiftChildren=function(e,t,r){void 0===r&&(r=0);for(var n,i=this._first,o=this.labels;i;)i._start>=r&&(i._start+=e,i._end+=e),i=i._next;if(t)for(n in o)o[n]>=r&&(o[n]+=e);return Oe(this)},r.invalidate=function(t){var r=this._first;for(this._lock=0;r;)r.invalidate(t),r=r._next;return e.prototype.invalidate.call(this,t)},r.clear=function(e){void 0===e&&(e=!0);for(var t,r=this._first;r;)t=r._next,this.remove(r),r=t;return this._dp&&(this._time=this._tTime=this._pTime=0),e&&(this.labels={}),Oe(this)},r.totalDuration=function(e){var t,r,n,i=0,o=this,s=o._last,a=M;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-e:e));if(o._dirty){for(n=o.parent;s;)t=s._prev,s._dirty&&s.totalDuration(),(r=s._start)>a&&o._sort&&s._ts&&!o._lock?(o._lock=1,Ge(o,s,r-s._delay,1)._lock=0):a=r,r<0&&s._ts&&(i-=r,(!n&&!o._dp||n&&n.smoothChildTiming)&&(o._start+=r/o._ts,o._time-=r,o._tTime-=r),o.shiftChildren(-r,!1,-Infinity),a=0),s._end>i&&s._ts&&(i=s._end),s=t;Xe(o,o===l&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(e){if(l._ts&&(we(l,Fe(e,l)),p=jt.frame),jt.frame>=ue){ue+=w.autoSleep||120;var t=l._first;if((!t||!t._ts)&&w.autoSleep&&jt._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||jt.sleep()}}},t}(zt);Te(Gt.prototype,{_lock:0,_hasPause:0,_forcing:0});var Vt,Ht,Wt=function(e,t,r,n,i,o,s){var a,l,c,u,h,d,p,f,m=new pr(this._pt,e,t,0,1,ar,null,i),y=0,g=0;for(m.b=r,m.e=n,r+="",(p=~(n+="").indexOf("random("))&&(n=ht(n)),o&&(o(f=[r,n],e,t),r=f[0],n=f[1]),l=r.match(W)||[];a=W.exec(n);)u=a[0],h=n.substring(y,a.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)?be(d,u)-d:parseFloat(u)-d,m:c&&c<4?Math.round:0},y=W.lastIndex);return m.c=y<n.length?n.substring(y,n.length):"",m.fp=s,(q.test(n)||p)&&(m.e=0),this._pt=m,m},qt=function(e,t,r,n,i,o,s,a,l,c){O(n)&&(n=n(i||0,e,o));var u,h=e[t],d="get"!==r?r:O(h)?l?e[t.indexOf("set")||!O(e["get"+t.substr(3)])?t:"get"+t.substr(3)](l):e[t]():h,p=O(h)?l?rr:tr:er;if(R(n)&&(~n.indexOf("random(")&&(n=ht(n)),"="===n.charAt(1)&&((u=be(d,n)+(et(d)||0))||0===u)&&(n=u)),!c||d!==n||Ht)return isNaN(d*n)||""===n?(!h&&!(t in e)&&Q(t,n),Wt.call(this,e,t,d,n,p,a||w.stringFilter,l)):(u=new pr(this._pt,e,t,+d||0,n-(d||0),"boolean"==typeof h?sr:or,0,p),l&&(u.fp=l),s&&u.modifier(s,this,e),this._pt=u)},Xt=function(e,t,r,n,i,o){var s,a,l,c;if(le[e]&&!1!==(s=new le[e]).init(i,s.rawVars?t[e]:function(e,t,r,n,i){if(O(e)&&(e=Jt(e,i,t,r,n)),!D(e)||e.style&&e.nodeType||z(e)||B(e))return R(e)?Jt(e,i,t,r,n):e;var o,s={};for(o in e)s[o]=Jt(e[o],i,t,r,n);return s}(t[e],n,i,o,r),r,n,o)&&(r._pt=a=new pr(r._pt,i,e,0,1,s.render,s,0,s.priority),r!==f))for(l=r._ptLookup[r._targets.indexOf(i)],c=s._props.length;c--;)l[s._props[c]]=a;return s},Yt=function e(t,r,n){var i,a,c,u,h,d,p,f,m,y,g,v,b,_=t.vars,x=_.ease,w=_.startAt,E=_.immediateRender,j=_.lazy,A=_.onUpdate,L=_.runBackwards,C=_.yoyoEase,P=_.keyframes,R=_.autoRevert,O=t._dur,k=t._startAt,I=t._targets,D=t.parent,F=D&&"nested"===D.data?D.vars.targets:I,U="auto"===t._overwrite&&!o,B=t.timeline;if(B&&(!P||!x)&&(x="none"),t._ease=It(x,S.ease),t._yEase=C?Ot(It(!0===C?x:C,S.ease)):0,C&&t._yoyo&&!t._repeat&&(C=t._yEase,t._yEase=t._ease,t._ease=C),t._from=!B&&!!_.runBackwards,!B||P&&!_.stagger){if(v=(f=I[0]?fe(I[0]).harness:0)&&_[f.prop],i=Ae(_,oe),k&&(k._zTime<0&&k.progress(1),r<0&&L&&E&&!R?k.render(-1,!0):k.revert(L&&O?ne:re),k._lazy=0),w){if(Re(t._startAt=$t.set(I,Te({data:"isStart",overwrite:!1,parent:D,immediateRender:!0,lazy:!k&&N(j),startAt:null,delay:0,onUpdate:A&&function(){return ft(t,"onUpdate")},stagger:0},w))),t._startAt._dp=0,t._startAt._sat=t,r<0&&(s||!E&&!R)&&t._startAt.revert(ne),E&&O&&r<=0&&n<=0)return void(r&&(t._zTime=r))}else if(L&&O&&!k)if(r&&(E=!1),c=Te({overwrite:!1,data:"isFromStart",lazy:E&&!k&&N(j),immediateRender:E,stagger:0,parent:D},i),v&&(c[f.prop]=v),Re(t._startAt=$t.set(I,c)),t._startAt._dp=0,t._startAt._sat=t,r<0&&(s?t._startAt.revert(ne):t._startAt.render(-1,!0)),t._zTime=r,E){if(!r)return}else e(t._startAt,T,T);for(t._pt=t._ptCache=0,j=O&&N(j)||j&&!O,a=0;a<I.length;a++){if(p=(h=I[a])._gsap||pe(I)[a]._gsap,t._ptLookup[a]=y={},ae[p.id]&&se.length&&xe(),g=F===I?a:F.indexOf(h),f&&!1!==(m=new f).init(h,v||i,t,g,F)&&(t._pt=u=new pr(t._pt,h,m.name,0,1,m.render,m,0,m.priority),m._props.forEach((function(e){y[e]=u})),m.priority&&(d=1)),!f||v)for(c in i)le[c]&&(m=Xt(c,i,t,g,h,F))?m.priority&&(d=1):y[c]=u=qt.call(t,h,c,"get",i[c],g,F,0,_.stringFilter);t._op&&t._op[a]&&t.kill(h,t._op[a]),U&&t._pt&&(Vt=t,l.killTweensOf(h,y,t.globalTime(r)),b=!t.parent,Vt=0),t._pt&&j&&(ae[p.id]=1)}d&&dr(t),t._onInit&&t._onInit(t)}t._onUpdate=A,t._initted=(!t._op||t._pt)&&!b,P&&r<=0&&B.render(M,!0,!0)},Zt=function(e,t,r,n){var i,o,s=t.ease||n||"power1.inOut";if(z(t))o=r[e]||(r[e]=[]),t.forEach((function(e,r){return o.push({t:r/(t.length-1)*100,v:e,e:s})}));else for(i in t)o=r[i]||(r[i]=[]),"ease"===i||o.push({t:parseFloat(e),v:t[i],e:s})},Jt=function(e,t,r,n,i){return O(e)?e.call(t,r,n,i):R(e)&&~e.indexOf("random(")?ht(e):e},Kt=de+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Qt={};ye(Kt+",id,stagger,delay,duration,paused,scrollTrigger",(function(e){return Qt[e]=1}));var $t=function(e){function t(t,r,i,s){var a;"number"==typeof r&&(i.duration=r,r=i,i=null);var c,u,h,d,p,f,m,y,g=(a=e.call(this,s?r:Le(r))||this).vars,v=g.duration,b=g.delay,_=g.immediateRender,x=g.stagger,S=g.overwrite,M=g.keyframes,T=g.defaults,E=g.scrollTrigger,j=g.yoyoEase,A=r.parent||l,L=(z(t)||B(t)?k(t[0]):"length"in r)?[t]:nt(t);if(a._targets=L.length?pe(L):$("GSAP target "+t+" not found. https://gsap.com",!w.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=S,M||x||U(v)||U(b)){if(r=a.vars,(c=a.timeline=new Gt({data:"nested",defaults:T||{},targets:A&&"nested"===A.data?A.vars.targets:L})).kill(),c.parent=c._dp=n(a),c._start=0,x||U(v)||U(b)){if(d=L.length,m=x&&st(x),D(x))for(p in x)~Kt.indexOf(p)&&(y||(y={}),y[p]=x[p]);for(u=0;u<d;u++)(h=Ae(r,Qt)).stagger=0,j&&(h.yoyoEase=j),y&&Ee(h,y),f=L[u],h.duration=+Jt(v,n(a),u,f,L),h.delay=(+Jt(b,n(a),u,f,L)||0)-a._delay,!x&&1===d&&h.delay&&(a._delay=b=h.delay,a._start+=b,h.delay=0),c.to(f,h,m?m(u,f,L):0),c._ease=Lt.none;c.duration()?v=b=0:a.timeline=0}else if(M){Le(Te(c.vars.defaults,{ease:"none"})),c._ease=It(M.ease||r.ease||"none");var C,P,R,O=0;if(z(M))M.forEach((function(e){return c.to(L,e,">")})),c.duration();else{for(p in h={},M)"ease"===p||"easeEach"===p||Zt(p,M[p],h,M.easeEach);for(p in h)for(C=h[p].sort((function(e,t){return e.t-t.t})),O=0,u=0;u<C.length;u++)(R={ease:(P=C[u]).e,duration:(P.t-(u?C[u-1].t:0))/100*v})[p]=P.v,c.to(L,R,O),O+=R.duration;c.duration()<v&&c.to({},{duration:v-c.duration()})}}v||a.duration(v=c.duration())}else a.timeline=0;return!0!==S||o||(Vt=n(a),l.killTweensOf(L),Vt=0),Ge(A,n(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),(_||!v&&!M&&a._start===ve(A._time)&&N(_)&&Ie(n(a))&&"nested"!==A.data)&&(a._tTime=-1e-8,a.render(Math.max(0,-b)||0)),E&&Ve(n(a),E),a}i(t,e);var r=t.prototype;return r.render=function(e,t,r){var n,i,o,a,l,c,u,h,d,p=this._time,f=this._tDur,m=this._dur,y=e<0,g=e>f-T&&!y?f:e<T?0:e;if(m){if(g!==this._tTime||!e||r||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==y||this._lazy){if(n=g,h=this.timeline,this._repeat){if(a=m+this._rDelay,this._repeat<-1&&y)return this.totalTime(100*a+e,t,r);if(n=ve(g%a),g===f?(o=this._repeat,n=m):(o=~~(l=ve(g/a)))&&o===l?(n=m,o--):n>m&&(n=m),(c=this._yoyo&&1&o)&&(d=this._yEase,n=m-n),l=Ne(this._tTime,a),n===p&&!r&&this._initted&&o===l)return this._tTime=g,this;o!==l&&(h&&this._yEase&&kt(h,c),this.vars.repeatRefresh&&!c&&!this._lock&&n!==a&&this._initted&&(this._lock=r=1,this.render(ve(a*o),!0).invalidate()._lock=0))}if(!this._initted){if(He(this,y?e:n,r,t,g))return this._tTime=0,this;if(!(p===this._time||r&&this.vars.repeatRefresh&&o!==l))return this;if(m!==this._dur)return this.render(e,t,r)}if(this._tTime=g,this._time=n,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=u=(d||this._ease)(n/m),this._from&&(this.ratio=u=1-u),n&&!p&&!t&&!o&&(ft(this,"onStart"),this._tTime!==g))return this;for(i=this._pt;i;)i.r(u,i.d),i=i._next;h&&h.render(e<0?e:h._dur*h._ease(n/this._dur),t,r)||this._startAt&&(this._zTime=e),this._onUpdate&&!t&&(y&&ke(this,e,0,r),ft(this,"onUpdate")),this._repeat&&o!==l&&this.vars.onRepeat&&!t&&this.parent&&ft(this,"onRepeat"),g!==this._tDur&&g||this._tTime!==g||(y&&!this._onUpdate&&ke(this,e,0,!0),(e||!m)&&(g===this._tDur&&this._ts>0||!g&&this._ts<0)&&Re(this,1),t||y&&!p||!(g||p||c)||(ft(this,g===f?"onComplete":"onReverseComplete",!0),this._prom&&!(g<f&&this.timeScale()>0)&&this._prom()))}}else!function(e,t,r,n){var i,o,a,l=e.ratio,c=t<0||!t&&(!e._start&&We(e)&&(e._initted||!qe(e))||(e._ts<0||e._dp._ts<0)&&!qe(e))?0:1,u=e._rDelay,h=0;if(u&&e._repeat&&(h=$e(0,e._tDur,t),o=Ne(h,u),e._yoyo&&1&o&&(c=1-c),o!==Ne(e._tTime,u)&&(l=1-c,e.vars.repeatRefresh&&e._initted&&e.invalidate())),c!==l||s||n||e._zTime===T||!t&&e._zTime){if(!e._initted&&He(e,t,n,r,h))return;for(a=e._zTime,e._zTime=t||(r?T:0),r||(r=t&&!a),e.ratio=c,e._from&&(c=1-c),e._time=0,e._tTime=h,i=e._pt;i;)i.r(c,i.d),i=i._next;t<0&&ke(e,t,0,!0),e._onUpdate&&!r&&ft(e,"onUpdate"),h&&e._repeat&&!r&&e.parent&&ft(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===c&&(c&&Re(e,1),r||s||(ft(e,c?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)}(this,e,t,r);return this},r.targets=function(){return this._targets},r.invalidate=function(t){return(!t||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),e.prototype.invalidate.call(this,t)},r.resetTo=function(e,t,r,n,i){m||jt.wake(),this._ts||this.play();var o=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||Yt(this,o),function(e,t,r,n,i,o,s,a){var l,c,u,h,d=(e._pt&&e._ptCache||(e._ptCache={}))[t];if(!d)for(d=e._ptCache[t]=[],u=e._ptLookup,h=e._targets.length;h--;){if((l=u[h][t])&&l.d&&l.d._pt)for(l=l.d._pt;l&&l.p!==t&&l.fp!==t;)l=l._next;if(!l)return Ht=1,e.vars[t]="+=0",Yt(e,s),Ht=0,a?$(t+" not eligible for reset"):1;d.push(l)}for(h=d.length;h--;)(l=(c=d[h])._pt||c).s=!n&&0!==n||i?l.s+(n||0)+o*l.c:n,l.c=r-l.s,c.e&&(c.e=ge(r)+et(c.e)),c.b&&(c.b=l.s+et(c.b))}(this,e,t,r,n,this._ease(o/this._dur),o,i)?this.resetTo(e,t,r,n,1):(Be(this,0),this.parent||Ce(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},r.kill=function(e,t){if(void 0===t&&(t="all"),!(e||t&&"all"!==t))return this._lazy=this._pt=0,this.parent?mt(this):this.scrollTrigger&&this.scrollTrigger.kill(!!s),this;if(this.timeline){var r=this.timeline.totalDuration();return this.timeline.killTweensOf(e,t,Vt&&!0!==Vt.vars.overwrite)._first||mt(this),this.parent&&r!==this.timeline.totalDuration()&&Xe(this,this._dur*this.timeline._tDur/r,0,1),this}var n,i,o,a,l,c,u,h=this._targets,d=e?nt(e):h,p=this._ptLookup,f=this._pt;if((!t||"all"===t)&&function(e,t){for(var r=e.length,n=r===t.length;n&&r--&&e[r]===t[r];);return r<0}(h,d))return"all"===t&&(this._pt=0),mt(this);for(n=this._op=this._op||[],"all"!==t&&(R(t)&&(l={},ye(t,(function(e){return l[e]=1})),t=l),t=function(e,t){var r,n,i,o,s=e[0]?fe(e[0]).harness:0,a=s&&s.aliases;if(!a)return t;for(n in r=Ee({},t),a)if(n in r)for(i=(o=a[n].split(",")).length;i--;)r[o[i]]=r[n];return r}(h,t)),u=h.length;u--;)if(~d.indexOf(h[u]))for(l in i=p[u],"all"===t?(n[u]=t,a=i,o={}):(o=n[u]=n[u]||{},a=t),a)(c=i&&i[l])&&("kill"in c.d&&!0!==c.d.kill(l)||Pe(this,c,"_pt"),delete i[l]),"all"!==o&&(o[l]=1);return this._initted&&!this._pt&&f&&mt(this),this},t.to=function(e,r){return new t(e,r,arguments[2])},t.from=function(e,t){return Ke(1,arguments)},t.delayedCall=function(e,r,n,i){return new t(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:r,onReverseComplete:r,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:i})},t.fromTo=function(e,t,r){return Ke(2,arguments)},t.set=function(e,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new t(e,r)},t.killTweensOf=function(e,t,r){return l.killTweensOf(e,t,r)},t}(zt);Te($t.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ye("staggerTo,staggerFrom,staggerFromTo",(function(e){$t[e]=function(){var t=new Gt,r=tt.call(arguments,0);return r.splice("staggerFromTo"===e?5:4,0,0),t[e].apply(t,r)}}));var er=function(e,t,r){return e[t]=r},tr=function(e,t,r){return e[t](r)},rr=function(e,t,r,n){return e[t](n.fp,r)},nr=function(e,t,r){return e.setAttribute(t,r)},ir=function(e,t){return O(e[t])?tr:I(e[t])&&e.setAttribute?nr:er},or=function(e,t){return t.set(t.t,t.p,Math.round(1e6*(t.s+t.c*e))/1e6,t)},sr=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},ar=function(e,t){var r=t._pt,n="";if(!e&&t.b)n=t.b;else if(1===e&&t.e)n=t.e;else{for(;r;)n=r.p+(r.m?r.m(r.s+r.c*e):Math.round(1e4*(r.s+r.c*e))/1e4)+n,r=r._next;n+=t.c}t.set(t.t,t.p,n,t)},lr=function(e,t){for(var r=t._pt;r;)r.r(e,r.d),r=r._next},cr=function(e,t,r,n){for(var i,o=this._pt;o;)i=o._next,o.p===n&&o.modifier(e,t,r),o=i},ur=function(e){for(var t,r,n=this._pt;n;)r=n._next,n.p===e&&!n.op||n.op===e?Pe(this,n,"_pt"):n.dep||(t=1),n=r;return!t},hr=function(e,t,r,n){n.mSet(e,t,n.m.call(n.tween,r,n.mt),n)},dr=function(e){for(var t,r,n,i,o=e._pt;o;){for(t=o._next,r=n;r&&r.pr>o.pr;)r=r._next;(o._prev=r?r._prev:i)?o._prev._next=o:n=o,(o._next=r)?r._prev=o:i=o,o=t}e._pt=n},pr=function(){function e(e,t,r,n,i,o,s,a,l){this.t=t,this.s=n,this.c=i,this.p=r,this.r=o||or,this.d=s||this,this.set=a||er,this.pr=l||0,this._next=e,e&&(e._prev=this)}return e.prototype.modifier=function(e,t,r){this.mSet=this.mSet||this.set,this.set=hr,this.m=e,this.mt=r,this.tween=t},e}();ye(de+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(e){return oe[e]=1})),Z.TweenMax=Z.TweenLite=$t,Z.TimelineLite=Z.TimelineMax=Gt,l=new Gt({sortChildren:!1,defaults:S,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),w.stringFilter=Et;var fr=[],mr={},yr=[],gr=0,vr=0,br=function(e){return(mr[e]||yr).map((function(e){return e()}))},_r=function(){var e=Date.now(),t=[];e-gr>2&&(br("matchMediaInit"),fr.forEach((function(e){var r,n,i,o,s=e.queries,a=e.conditions;for(n in s)(r=c.matchMedia(s[n]).matches)&&(i=1),r!==a[n]&&(a[n]=r,o=1);o&&(e.revert(),i&&t.push(e))})),br("matchMediaRevert"),t.forEach((function(e){return e.onMatch(e,(function(t){return e.add(null,t)}))})),gr=e,br("matchMedia"))},xr=function(){function e(e,t){this.selector=t&&it(t),this.data=[],this._r=[],this.isReverted=!1,this.id=vr++,e&&this.add(e)}var t=e.prototype;return t.add=function(e,t,r){O(e)&&(r=t,t=e,e=O);var n=this,i=function(){var e,i=a,o=n.selector;return i&&i!==n&&i.data.push(n),r&&(n.selector=it(r)),a=n,e=t.apply(n,arguments),O(e)&&n._r.push(e),a=i,n.selector=o,n.isReverted=!1,e};return n.last=i,e===O?i(n,(function(e){return n.add(null,e)})):e?n[e]=i:i},t.ignore=function(e){var t=a;a=null,e(this),a=t},t.getTweens=function(){var t=[];return this.data.forEach((function(r){return r instanceof e?t.push.apply(t,r.getTweens()):r instanceof $t&&!(r.parent&&"nested"===r.parent.data)&&t.push(r)})),t},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(e,t){var r=this;if(e?function(){for(var t,n=r.getTweens(),i=r.data.length;i--;)"isFlip"===(t=r.data[i]).data&&(t.revert(),t.getChildren(!0,!0,!1).forEach((function(e){return n.splice(n.indexOf(e),1)})));for(n.map((function(e){return{g:e._dur||e._delay||e._sat&&!e._sat.vars.immediateRender?e.globalTime(0):-1/0,t:e}})).sort((function(e,t){return t.g-e.g||-1/0})).forEach((function(t){return t.t.revert(e)})),i=r.data.length;i--;)(t=r.data[i])instanceof Gt?"nested"!==t.data&&(t.scrollTrigger&&t.scrollTrigger.revert(),t.kill()):!(t instanceof $t)&&t.revert&&t.revert(e);r._r.forEach((function(t){return t(e,r)})),r.isReverted=!0}():this.data.forEach((function(e){return e.kill&&e.kill()})),this.clear(),t)for(var n=fr.length;n--;)fr[n].id===this.id&&fr.splice(n,1)},t.revert=function(e){this.kill(e||{})},e}(),wr=function(){function e(e){this.contexts=[],this.scope=e,a&&a.data.push(this)}var t=e.prototype;return t.add=function(e,t,r){D(e)||(e={matches:e});var n,i,o,s=new xr(0,r||this.scope),l=s.conditions={};for(i in a&&!s.selector&&(s.selector=a.selector),this.contexts.push(s),t=s.add("onMatch",t),s.queries=e,e)"all"===i?o=1:(n=c.matchMedia(e[i]))&&(fr.indexOf(s)<0&&fr.push(s),(l[i]=n.matches)&&(o=1),n.addListener?n.addListener(_r):n.addEventListener("change",_r));return o&&t(s,(function(e){return s.add(null,e)})),this},t.revert=function(e){this.kill(e||{})},t.kill=function(e){this.contexts.forEach((function(t){return t.kill(e,!0)}))},e}(),Sr={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.forEach((function(e){return gt(e)}))},timeline:function(e){return new Gt(e)},getTweensOf:function(e,t){return l.getTweensOf(e,t)},getProperty:function(e,t,r,n){R(e)&&(e=nt(e)[0]);var i=fe(e||{}).get,o=r?Me:Se;return"native"===r&&(r=""),e?t?o((le[t]&&le[t].get||i)(e,t,r,n)):function(t,r,n){return o((le[t]&&le[t].get||i)(e,t,r,n))}:e},quickSetter:function(e,t,r){if((e=nt(e)).length>1){var n=e.map((function(e){return Er.quickSetter(e,t,r)})),i=n.length;return function(e){for(var t=i;t--;)n[t](e)}}e=e[0]||{};var o=le[t],s=fe(e),a=s.harness&&(s.harness.aliases||{})[t]||t,l=o?function(t){var n=new o;f._pt=0,n.init(e,r?t+r:t,f,0,[e]),n.render(1,n),f._pt&&lr(1,f)}:s.set(e,a);return o?l:function(t){return l(e,a,r?t+r:t,s,1)}},quickTo:function(e,t,r){var n,i=Er.to(e,Te(((n={})[t]="+=0.1",n.paused=!0,n.stagger=0,n),r||{})),o=function(e,r,n){return i.resetTo(t,e,r,n)};return o.tween=i,o},isTweening:function(e){return l.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=It(e.ease,S.ease)),je(S,e||{})},config:function(e){return je(w,e||{})},registerEffect:function(e){var t=e.name,r=e.effect,n=e.plugins,i=e.defaults,o=e.extendTimeline;(n||"").split(",").forEach((function(e){return e&&!le[e]&&!Z[e]&&$(t+" effect requires "+e+" plugin.")})),ce[t]=function(e,t,n){return r(nt(e),Te(t||{},i),n)},o&&(Gt.prototype[t]=function(e,r,n){return this.add(ce[t](e,D(r)?r:(n=r)&&{},this),n)})},registerEase:function(e,t){Lt[e]=It(t)},parseEase:function(e,t){return arguments.length?It(e,t):Lt},getById:function(e){return l.getById(e)},exportRoot:function(e,t){void 0===e&&(e={});var r,n,i=new Gt(e);for(i.smoothChildTiming=N(e.smoothChildTiming),l.remove(i),i._dp=0,i._time=i._tTime=l._time,r=l._first;r;)n=r._next,!t&&!r._dur&&r instanceof $t&&r.vars.onComplete===r._targets[0]||Ge(i,r,r._start-r._delay),r=n;return Ge(l,i,0),i},context:function(e,t){return e?new xr(e,t):a},matchMedia:function(e){return new wr(e)},matchMediaRefresh:function(){return fr.forEach((function(e){var t,r,n=e.conditions;for(r in n)n[r]&&(n[r]=!1,t=1);t&&e.revert()}))||_r()},addEventListener:function(e,t){var r=mr[e]||(mr[e]=[]);~r.indexOf(t)||r.push(t)},removeEventListener:function(e,t){var r=mr[e],n=r&&r.indexOf(t);n>=0&&r.splice(n,1)},utils:{wrap:function e(t,r,n){var i=r-t;return z(t)?ut(t,e(0,t.length),r):Qe(n,(function(e){return(i+(e-t)%i)%i+t}))},wrapYoyo:function e(t,r,n){var i=r-t,o=2*i;return z(t)?ut(t,e(0,t.length-1),r):Qe(n,(function(e){return t+((e=(o+(e-t)%o)%o||0)>i?o-e:e)}))},distribute:st,random:ct,snap:lt,normalize:function(e,t,r){return dt(e,t,0,1,r)},getUnit:et,clamp:function(e,t,r){return Qe(r,(function(r){return $e(e,t,r)}))},splitColor:xt,toArray:nt,selector:it,mapRange:dt,pipe:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduce((function(e,t){return t(e)}),e)}},unitize:function(e,t){return function(r){return e(parseFloat(r))+(t||et(r))}},interpolate:function e(t,r,n,i){var o=isNaN(t+r)?0:function(e){return(1-e)*t+e*r};if(!o){var s,a,l,c,u,h=R(t),d={};if(!0===n&&(i=1)&&(n=null),h)t={p:t},r={p:r};else if(z(t)&&!z(r)){for(l=[],c=t.length,u=c-2,a=1;a<c;a++)l.push(e(t[a-1],t[a]));c--,o=function(e){e*=c;var t=Math.min(u,~~e);return l[t](e-t)},n=r}else i||(t=Ee(z(t)?[]:{},t));if(!l){for(s in r)qt.call(d,t,s,"get",r[s]);o=function(e){return lr(e,d)||(h?t.p:t)}}}return Qe(n,o)},shuffle:ot},install:K,effects:ce,ticker:jt,updateRoot:Gt.updateRoot,plugins:le,globalTimeline:l,core:{PropTween:pr,globals:ee,Tween:$t,Timeline:Gt,Animation:zt,getCache:fe,_removeLinkedListItem:Pe,reverting:function(){return s},context:function(e){return e&&a&&(a.data.push(e),e._ctx=a),a},suppressOverwrites:function(e){return o=e}}};ye("to,from,fromTo,delayedCall,set,killTweensOf",(function(e){return Sr[e]=$t[e]})),jt.add(Gt.updateRoot),f=Sr.to({},{duration:0});var Mr=function(e,t){for(var r=e._pt;r&&r.p!==t&&r.op!==t&&r.fp!==t;)r=r._next;return r},Tr=function(e,t){return{name:e,rawVars:1,init:function(e,r,n){n._onInit=function(e){var n,i;if(R(r)&&(n={},ye(r,(function(e){return n[e]=1})),r=n),t){for(i in n={},r)n[i]=t(r[i]);r=n}!function(e,t){var r,n,i,o=e._targets;for(r in t)for(n=o.length;n--;)(i=e._ptLookup[n][r])&&(i=i.d)&&(i._pt&&(i=Mr(i,r)),i&&i.modifier&&i.modifier(t[r],e,o[n],r))}(e,r)}}}},Er=Sr.registerPlugin({name:"attr",init:function(e,t,r,n,i){var o,s,a;for(o in this.tween=r,t)a=e.getAttribute(o)||"",(s=this.add(e,"setAttribute",(a||0)+"",t[o],n,i,0,0,o)).op=o,s.b=a,this._props.push(o)},render:function(e,t){for(var r=t._pt;r;)s?r.set(r.t,r.p,r.b,r):r.r(e,r.d),r=r._next}},{name:"endArray",init:function(e,t){for(var r=t.length;r--;)this.add(e,r,e[r]||0,t[r],0,0,0,0,0,1)}},Tr("roundProps",at),Tr("modifiers"),Tr("snap",lt))||Sr;$t.version=Gt.version=Er.version="3.12.7",d=1,F()&&At(),Lt.Power0,Lt.Power1,Lt.Power2,Lt.Power3,Lt.Power4,Lt.Linear,Lt.Quad,Lt.Cubic,Lt.Quart,Lt.Quint,Lt.Strong,Lt.Elastic,Lt.Back,Lt.SteppedEase,Lt.Bounce,Lt.Sine,Lt.Expo,Lt.Circ;var jr,Ar,Lr,Cr,Pr,Rr,Or,kr,Ir={},Dr=180/Math.PI,Nr=Math.PI/180,Fr=Math.atan2,Ur=/([A-Z])/g,Br=/(left|right|width|margin|padding|x)/i,zr=/[\s,\(]\S/,Gr={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Vr=function(e,t){return t.set(t.t,t.p,Math.round(1e4*(t.s+t.c*e))/1e4+t.u,t)},Hr=function(e,t){return t.set(t.t,t.p,1===e?t.e:Math.round(1e4*(t.s+t.c*e))/1e4+t.u,t)},Wr=function(e,t){return t.set(t.t,t.p,e?Math.round(1e4*(t.s+t.c*e))/1e4+t.u:t.b,t)},qr=function(e,t){var r=t.s+t.c*e;t.set(t.t,t.p,~~(r+(r<0?-.5:.5))+t.u,t)},Xr=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},Yr=function(e,t){return t.set(t.t,t.p,1!==e?t.b:t.e,t)},Zr=function(e,t,r){return e.style[t]=r},Jr=function(e,t,r){return e.style.setProperty(t,r)},Kr=function(e,t,r){return e._gsap[t]=r},Qr=function(e,t,r){return e._gsap.scaleX=e._gsap.scaleY=r},$r=function(e,t,r,n,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},en=function(e,t,r,n,i){var o=e._gsap;o[t]=r,o.renderTransform(i,o)},tn="transform",rn=tn+"Origin",nn=function e(t,r){var n=this,i=this.target,o=i.style,s=i._gsap;if(t in Ir&&o){if(this.tfm=this.tfm||{},"transform"===t)return Gr.transform.split(",").forEach((function(t){return e.call(n,t,r)}));if(~(t=Gr[t]||t).indexOf(",")?t.split(",").forEach((function(e){return n.tfm[e]=wn(i,e)})):this.tfm[t]=s.x?s[t]:wn(i,t),t===rn&&(this.tfm.zOrigin=s.zOrigin),this.props.indexOf(tn)>=0)return;s.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(rn,r,"")),t=tn}(o||r)&&this.props.push(t,r,o[t])},on=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},sn=function(){var e,t,r=this.props,n=this.target,i=n.style,o=n._gsap;for(e=0;e<r.length;e+=3)r[e+1]?2===r[e+1]?n[r[e]](r[e+2]):n[r[e]]=r[e+2]:r[e+2]?i[r[e]]=r[e+2]:i.removeProperty("--"===r[e].substr(0,2)?r[e]:r[e].replace(Ur,"-$1").toLowerCase());if(this.tfm){for(t in this.tfm)o[t]=this.tfm[t];o.svg&&(o.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),(e=Or())&&e.isStart||i[tn]||(on(i),o.zOrigin&&i[rn]&&(i[rn]+=" "+o.zOrigin+"px",o.zOrigin=0,o.renderTransform()),o.uncache=1)}},an=function(e,t){var r={target:e,props:[],revert:sn,save:nn};return e._gsap||Er.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach((function(e){return r.save(e)})),r},ln=function(e,t){var r=Ar.createElementNS?Ar.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Ar.createElement(e);return r&&r.style?r:Ar.createElement(e)},cn=function e(t,r,n){var i=getComputedStyle(t);return i[r]||i.getPropertyValue(r.replace(Ur,"-$1").toLowerCase())||i.getPropertyValue(r)||!n&&e(t,hn(r)||r,1)||""},un="O,Moz,ms,Ms,Webkit".split(","),hn=function(e,t,r){var n=(t||Pr).style,i=5;if(e in n&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);i--&&!(un[i]+e in n););return i<0?null:(3===i?"ms":i>=0?un[i]:"")+e},dn=function(){"undefined"!=typeof window&&window.document&&(jr=window,Ar=jr.document,Lr=Ar.documentElement,Pr=ln("div")||{style:{}},ln("div"),tn=hn(tn),rn=tn+"Origin",Pr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",kr=!!hn("perspective"),Or=Er.core.reverting,Cr=1)},pn=function(e){var t,r=e.ownerSVGElement,n=ln("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=e.cloneNode(!0);i.style.display="block",n.appendChild(i),Lr.appendChild(n);try{t=i.getBBox()}catch(e){}return n.removeChild(i),Lr.removeChild(n),t},fn=function(e,t){for(var r=t.length;r--;)if(e.hasAttribute(t[r]))return e.getAttribute(t[r])},mn=function(e){var t,r;try{t=e.getBBox()}catch(n){t=pn(e),r=1}return t&&(t.width||t.height)||r||(t=pn(e)),!t||t.width||t.x||t.y?t:{x:+fn(e,["x","cx","x1"])||0,y:+fn(e,["y","cy","y1"])||0,width:0,height:0}},yn=function(e){return!(!e.getCTM||e.parentNode&&!e.ownerSVGElement||!mn(e))},gn=function(e,t){if(t){var r,n=e.style;t in Ir&&t!==rn&&(t=tn),n.removeProperty?("ms"!==(r=t.substr(0,2))&&"webkit"!==t.substr(0,6)||(t="-"+t),n.removeProperty("--"===r?t:t.replace(Ur,"-$1").toLowerCase())):n.removeAttribute(t)}},vn=function(e,t,r,n,i,o){var s=new pr(e._pt,t,r,0,1,o?Yr:Xr);return e._pt=s,s.b=n,s.e=i,e._props.push(r),s},bn={deg:1,rad:1,turn:1},_n={grid:1,flex:1},xn=function e(t,r,n,i){var o,s,a,l,c=parseFloat(n)||0,u=(n+"").trim().substr((c+"").length)||"px",h=Pr.style,d=Br.test(r),p="svg"===t.tagName.toLowerCase(),f=(p?"client":"offset")+(d?"Width":"Height"),m=100,y="px"===i,g="%"===i;if(i===u||!c||bn[i]||bn[u])return c;if("px"!==u&&!y&&(c=e(t,r,n,"px")),l=t.getCTM&&yn(t),(g||"%"===u)&&(Ir[r]||~r.indexOf("adius")))return o=l?t.getBBox()[d?"width":"height"]:t[f],ge(g?c/o*m:c/100*o);if(h[d?"width":"height"]=m+(y?u:i),s="rem"!==i&&~r.indexOf("adius")||"em"===i&&t.appendChild&&!p?t:t.parentNode,l&&(s=(t.ownerSVGElement||{}).parentNode),s&&s!==Ar&&s.appendChild||(s=Ar.body),(a=s._gsap)&&g&&a.width&&d&&a.time===jt.time&&!a.uncache)return ge(c/a.width*m);if(!g||"height"!==r&&"width"!==r)(g||"%"===u)&&!_n[cn(s,"display")]&&(h.position=cn(t,"position")),s===t&&(h.position="static"),s.appendChild(Pr),o=Pr[f],s.removeChild(Pr),h.position="absolute";else{var v=t.style[r];t.style[r]=m+i,o=t[f],v?t.style[r]=v:gn(t,r)}return d&&g&&((a=fe(s)).time=jt.time,a.width=s[f]),ge(y?o*c/m:o&&c?m/o*c:0)},wn=function(e,t,r,n){var i;return Cr||dn(),t in Gr&&"transform"!==t&&~(t=Gr[t]).indexOf(",")&&(t=t.split(",")[0]),Ir[t]&&"transform"!==t?(i=On(e,n),i="transformOrigin"!==t?i[t]:i.svg?i.origin:kn(cn(e,rn))+" "+i.zOrigin+"px"):(!(i=e.style[t])||"auto"===i||n||~(i+"").indexOf("calc("))&&(i=En[t]&&En[t](e,t,r)||cn(e,t)||me(e,t)||("opacity"===t?1:0)),r&&!~(i+"").trim().indexOf(" ")?xn(e,t,i,r)+r:i},Sn=function(e,t,r,n){if(!r||"none"===r){var i=hn(t,e,1),o=i&&cn(e,i,1);o&&o!==r?(t=i,r=o):"borderColor"===t&&(r=cn(e,"borderTopColor"))}var s,a,l,c,u,h,d,p,f,m,y,g=new pr(this._pt,e.style,t,0,1,ar),v=0,b=0;if(g.b=r,g.e=n,r+="","auto"==(n+="")&&(h=e.style[t],e.style[t]=n,n=cn(e,t)||n,h?e.style[t]=h:gn(e,t)),Et(s=[r,n]),n=s[1],l=(r=s[0]).match(H)||[],(n.match(H)||[]).length){for(;a=H.exec(n);)d=a[0],f=n.substring(v,a.index),u?u=(u+1)%5:"rgba("!==f.substr(-5)&&"hsla("!==f.substr(-5)||(u=1),d!==(h=l[b++]||"")&&(c=parseFloat(h)||0,y=h.substr((c+"").length),"="===d.charAt(1)&&(d=be(c,d)+y),p=parseFloat(d),m=d.substr((p+"").length),v=H.lastIndex-m.length,m||(m=m||w.units[t]||y,v===n.length&&(n+=m,g.e+=m)),y!==m&&(c=xn(e,t,h,m)||0),g._pt={_next:g._pt,p:f||1===b?f:",",s:c,c:p-c,m:u&&u<4||"zIndex"===t?Math.round:0});g.c=v<n.length?n.substring(v,n.length):""}else g.r="display"===t&&"none"===n?Yr:Xr;return q.test(n)&&(g.e=0),this._pt=g,g},Mn={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Tn=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var r,n,i,o=t.t,s=o.style,a=t.u,l=o._gsap;if("all"===a||!0===a)s.cssText="",n=1;else for(i=(a=a.split(",")).length;--i>-1;)r=a[i],Ir[r]&&(n=1,r="transformOrigin"===r?rn:tn),gn(o,r);n&&(gn(o,tn),l&&(l.svg&&o.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",On(o,1),l.uncache=1,on(s)))}},En={clearProps:function(e,t,r,n,i){if("isFromStart"!==i.data){var o=e._pt=new pr(e._pt,t,r,0,0,Tn);return o.u=n,o.pr=-10,o.tween=i,e._props.push(r),1}}},jn=[1,0,0,1,0,0],An={},Ln=function(e){return"matrix(1, 0, 0, 1, 0, 0)"===e||"none"===e||!e},Cn=function(e){var t=cn(e,tn);return Ln(t)?jn:t.substr(7).match(V).map(ge)},Pn=function(e,t){var r,n,i,o,s=e._gsap||fe(e),a=e.style,l=Cn(e);return s.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(",")?jn:l:(l!==jn||e.offsetParent||e===Lr||s.svg||(i=a.display,a.display="block",(r=e.parentNode)&&(e.offsetParent||e.getBoundingClientRect().width)||(o=1,n=e.nextElementSibling,Lr.appendChild(e)),l=Cn(e),i?a.display=i:gn(e,"display"),o&&(n?r.insertBefore(e,n):r?r.appendChild(e):Lr.removeChild(e))),t&&l.length>6?[l[0],l[1],l[4],l[5],l[12],l[13]]:l)},Rn=function(e,t,r,n,i,o){var s,a,l,c=e._gsap,u=i||Pn(e,!0),h=c.xOrigin||0,d=c.yOrigin||0,p=c.xOffset||0,f=c.yOffset||0,m=u[0],y=u[1],g=u[2],v=u[3],b=u[4],_=u[5],x=t.split(" "),w=parseFloat(x[0])||0,S=parseFloat(x[1])||0;r?u!==jn&&(a=m*v-y*g)&&(l=w*(-y/a)+S*(m/a)-(m*_-y*b)/a,w=w*(v/a)+S*(-g/a)+(g*_-v*b)/a,S=l):(w=(s=mn(e)).x+(~x[0].indexOf("%")?w/100*s.width:w),S=s.y+(~(x[1]||x[0]).indexOf("%")?S/100*s.height:S)),n||!1!==n&&c.smooth?(b=w-h,_=S-d,c.xOffset=p+(b*m+_*g)-b,c.yOffset=f+(b*y+_*v)-_):c.xOffset=c.yOffset=0,c.xOrigin=w,c.yOrigin=S,c.smooth=!!n,c.origin=t,c.originIsAbsolute=!!r,e.style[rn]="0px 0px",o&&(vn(o,c,"xOrigin",h,w),vn(o,c,"yOrigin",d,S),vn(o,c,"xOffset",p,c.xOffset),vn(o,c,"yOffset",f,c.yOffset)),e.setAttribute("data-svg-origin",w+" "+S)},On=function(e,t){var r=e._gsap||new Bt(e);if("x"in r&&!t&&!r.uncache)return r;var n,i,o,s,a,l,c,u,h,d,p,f,m,y,g,v,b,_,x,S,M,T,E,j,A,L,C,P,R,O,k,I,D=e.style,N=r.scaleX<0,F="px",U="deg",B=getComputedStyle(e),z=cn(e,rn)||"0";return n=i=o=l=c=u=h=d=p=0,s=a=1,r.svg=!(!e.getCTM||!yn(e)),B.translate&&("none"===B.translate&&"none"===B.scale&&"none"===B.rotate||(D[tn]=("none"!==B.translate?"translate3d("+(B.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==B.rotate?"rotate("+B.rotate+") ":"")+("none"!==B.scale?"scale("+B.scale.split(" ").join(",")+") ":"")+("none"!==B[tn]?B[tn]:"")),D.scale=D.rotate=D.translate="none"),y=Pn(e,r.svg),r.svg&&(r.uncache?(A=e.getBBox(),z=r.xOrigin-A.x+"px "+(r.yOrigin-A.y)+"px",j=""):j=!t&&e.getAttribute("data-svg-origin"),Rn(e,j||z,!!j||r.originIsAbsolute,!1!==r.smooth,y)),f=r.xOrigin||0,m=r.yOrigin||0,y!==jn&&(_=y[0],x=y[1],S=y[2],M=y[3],n=T=y[4],i=E=y[5],6===y.length?(s=Math.sqrt(_*_+x*x),a=Math.sqrt(M*M+S*S),l=_||x?Fr(x,_)*Dr:0,(h=S||M?Fr(S,M)*Dr+l:0)&&(a*=Math.abs(Math.cos(h*Nr))),r.svg&&(n-=f-(f*_+m*S),i-=m-(f*x+m*M))):(I=y[6],O=y[7],C=y[8],P=y[9],R=y[10],k=y[11],n=y[12],i=y[13],o=y[14],c=(g=Fr(I,R))*Dr,g&&(j=T*(v=Math.cos(-g))+C*(b=Math.sin(-g)),A=E*v+P*b,L=I*v+R*b,C=T*-b+C*v,P=E*-b+P*v,R=I*-b+R*v,k=O*-b+k*v,T=j,E=A,I=L),u=(g=Fr(-S,R))*Dr,g&&(v=Math.cos(-g),k=M*(b=Math.sin(-g))+k*v,_=j=_*v-C*b,x=A=x*v-P*b,S=L=S*v-R*b),l=(g=Fr(x,_))*Dr,g&&(j=_*(v=Math.cos(g))+x*(b=Math.sin(g)),A=T*v+E*b,x=x*v-_*b,E=E*v-T*b,_=j,T=A),c&&Math.abs(c)+Math.abs(l)>359.9&&(c=l=0,u=180-u),s=ge(Math.sqrt(_*_+x*x+S*S)),a=ge(Math.sqrt(E*E+I*I)),g=Fr(T,E),h=Math.abs(g)>2e-4?g*Dr:0,p=k?1/(k<0?-k:k):0),r.svg&&(j=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!Ln(cn(e,tn)),j&&e.setAttribute("transform",j))),Math.abs(h)>90&&Math.abs(h)<270&&(N?(s*=-1,h+=l<=0?180:-180,l+=l<=0?180:-180):(a*=-1,h+=h<=0?180:-180)),t=t||r.uncache,r.x=n-((r.xPercent=n&&(!t&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-n)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+F,r.y=i-((r.yPercent=i&&(!t&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-i)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+F,r.z=o+F,r.scaleX=ge(s),r.scaleY=ge(a),r.rotation=ge(l)+U,r.rotationX=ge(c)+U,r.rotationY=ge(u)+U,r.skewX=h+U,r.skewY=d+U,r.transformPerspective=p+F,(r.zOrigin=parseFloat(z.split(" ")[2])||!t&&r.zOrigin||0)&&(D[rn]=kn(z)),r.xOffset=r.yOffset=0,r.force3D=w.force3D,r.renderTransform=r.svg?zn:kr?Bn:Dn,r.uncache=0,r},kn=function(e){return(e=e.split(" "))[0]+" "+e[1]},In=function(e,t,r){var n=et(t);return ge(parseFloat(t)+parseFloat(xn(e,"x",r+"px",n)))+n},Dn=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Bn(e,t)},Nn="0deg",Fn="0px",Un=") ",Bn=function(e,t){var r=t||this,n=r.xPercent,i=r.yPercent,o=r.x,s=r.y,a=r.z,l=r.rotation,c=r.rotationY,u=r.rotationX,h=r.skewX,d=r.skewY,p=r.scaleX,f=r.scaleY,m=r.transformPerspective,y=r.force3D,g=r.target,v=r.zOrigin,b="",_="auto"===y&&e&&1!==e||!0===y;if(v&&(u!==Nn||c!==Nn)){var x,w=parseFloat(c)*Nr,S=Math.sin(w),M=Math.cos(w);w=parseFloat(u)*Nr,x=Math.cos(w),o=In(g,o,S*x*-v),s=In(g,s,-Math.sin(w)*-v),a=In(g,a,M*x*-v+v)}m!==Fn&&(b+="perspective("+m+Un),(n||i)&&(b+="translate("+n+"%, "+i+"%) "),(_||o!==Fn||s!==Fn||a!==Fn)&&(b+=a!==Fn||_?"translate3d("+o+", "+s+", "+a+") ":"translate("+o+", "+s+Un),l!==Nn&&(b+="rotate("+l+Un),c!==Nn&&(b+="rotateY("+c+Un),u!==Nn&&(b+="rotateX("+u+Un),h===Nn&&d===Nn||(b+="skew("+h+", "+d+Un),1===p&&1===f||(b+="scale("+p+", "+f+Un),g.style[tn]=b||"translate(0, 0)"},zn=function(e,t){var r,n,i,o,s,a=t||this,l=a.xPercent,c=a.yPercent,u=a.x,h=a.y,d=a.rotation,p=a.skewX,f=a.skewY,m=a.scaleX,y=a.scaleY,g=a.target,v=a.xOrigin,b=a.yOrigin,_=a.xOffset,x=a.yOffset,w=a.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*=Nr,p*=Nr,r=Math.cos(d)*m,n=Math.sin(d)*m,i=Math.sin(d-p)*-y,o=Math.cos(d-p)*y,p&&(f*=Nr,s=Math.tan(p-f),i*=s=Math.sqrt(1+s*s),o*=s,f&&(s=Math.tan(f),r*=s=Math.sqrt(1+s*s),n*=s)),r=ge(r),n=ge(n),i=ge(i),o=ge(o)):(r=m,o=y,n=i=0),(S&&!~(u+"").indexOf("px")||M&&!~(h+"").indexOf("px"))&&(S=xn(g,"x",u,"px"),M=xn(g,"y",h,"px")),(v||b||_||x)&&(S=ge(S+v-(v*r+b*i)+_),M=ge(M+b-(v*n+b*o)+x)),(l||c)&&(s=g.getBBox(),S=ge(S+l/100*s.width),M=ge(M+c/100*s.height)),s="matrix("+r+","+n+","+i+","+o+","+S+","+M+")",g.setAttribute("transform",s),w&&(g.style[tn]=s)},Gn=function(e,t,r,n,i){var o,s,a=360,l=R(i),c=parseFloat(i)*(l&&~i.indexOf("rad")?Dr:1)-n,u=n+c+"deg";return l&&("short"===(o=i.split("_")[1])&&(c%=a)!=c%180&&(c+=c<0?a:-360),"cw"===o&&c<0?c=(c+36e9)%a-~~(c/a)*a:"ccw"===o&&c>0&&(c=(c-36e9)%a-~~(c/a)*a)),e._pt=s=new pr(e._pt,t,r,n,c,Hr),s.e=u,s.u="deg",e._props.push(r),s},Vn=function(e,t){for(var r in t)e[r]=t[r];return e},Hn=function(e,t,r){var n,i,o,s,a,l,c,u=Vn({},r._gsap),h=r.style;for(i in u.svg?(o=r.getAttribute("transform"),r.setAttribute("transform",""),h[tn]=t,n=On(r,1),gn(r,tn),r.setAttribute("transform",o)):(o=getComputedStyle(r)[tn],h[tn]=t,n=On(r,1),h[tn]=o),Ir)(o=u[i])!==(s=n[i])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)<0&&(a=et(o)!==(c=et(s))?xn(r,i,o,c):parseFloat(o),l=parseFloat(s),e._pt=new pr(e._pt,n,i,a,l-a,Vr),e._pt.u=c||0,e._props.push(i));Vn(n,u)};ye("padding,margin,Width,Radius",(function(e,t){var r="Top",n="Right",i="Bottom",o="Left",s=(t<3?[r,n,i,o]:[r+o,r+n,i+n,i+o]).map((function(r){return t<2?e+r:"border"+r+e}));En[t>1?"border"+e:e]=function(e,t,r,n,i){var o,a;if(arguments.length<4)return o=s.map((function(t){return wn(e,t,r)})),5===(a=o.join(" ")).split(o[0]).length?o[0]:a;o=(n+"").split(" "),a={},s.forEach((function(e,t){return a[e]=o[t]=o[t]||o[(t-1)/2|0]})),e.init(t,a,i)}}));var Wn,qn,Xn={name:"css",register:dn,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,r,n,i){var o,s,a,l,c,u,h,d,p,f,m,y,g,v,b,_,x,S,M,T,E=this._props,j=e.style,A=r.vars.startAt;for(h in Cr||dn(),this.styles=this.styles||an(e),_=this.styles.props,this.tween=r,t)if("autoRound"!==h&&(s=t[h],!le[h]||!Xt(h,t,r,n,e,i)))if(c=typeof s,u=En[h],"function"===c&&(c=typeof(s=s.call(r,n,e,i))),"string"===c&&~s.indexOf("random(")&&(s=ht(s)),u)u(this,e,h,s,r)&&(b=1);else if("--"===h.substr(0,2))o=(getComputedStyle(e).getPropertyValue(h)+"").trim(),s+="",Mt.lastIndex=0,Mt.test(o)||(d=et(o),p=et(s)),p?d!==p&&(o=xn(e,h,o,p)+p):d&&(s+=d),this.add(j,"setProperty",o,s,n,i,0,0,h),E.push(h),_.push(h,0,j[h]);else if("undefined"!==c){if(A&&h in A?(o="function"==typeof A[h]?A[h].call(r,n,e,i):A[h],R(o)&&~o.indexOf("random(")&&(o=ht(o)),et(o+"")||"auto"===o||(o+=w.units[h]||et(wn(e,h))||""),"="===(o+"").charAt(1)&&(o=wn(e,h))):o=wn(e,h),l=parseFloat(o),(f="string"===c&&"="===s.charAt(1)&&s.substr(0,2))&&(s=s.substr(2)),a=parseFloat(s),h in Gr&&("autoAlpha"===h&&(1===l&&"hidden"===wn(e,"visibility")&&a&&(l=0),_.push("visibility",0,j.visibility),vn(this,j,"visibility",l?"inherit":"hidden",a?"inherit":"hidden",!a)),"scale"!==h&&"transform"!==h&&~(h=Gr[h]).indexOf(",")&&(h=h.split(",")[0])),m=h in Ir)if(this.styles.save(h),y||((g=e._gsap).renderTransform&&!t.parseTransform||On(e,t.parseTransform),v=!1!==t.smoothOrigin&&g.smooth,(y=this._pt=new pr(this._pt,j,tn,0,1,g.renderTransform,g,0,-1)).dep=1),"scale"===h)this._pt=new pr(this._pt,g,"scaleY",g.scaleY,(f?be(g.scaleY,f+a):a)-g.scaleY||0,Vr),this._pt.u=0,E.push("scaleY",h),h+="X";else{if("transformOrigin"===h){_.push(rn,0,j[rn]),S=void 0,M=void 0,T=void 0,M=(S=(x=s).split(" "))[0],T=S[1]||"50%","top"!==M&&"bottom"!==M&&"left"!==T&&"right"!==T||(x=M,M=T,T=x),S[0]=Mn[M]||M,S[1]=Mn[T]||T,s=S.join(" "),g.svg?Rn(e,s,0,v,0,this):((p=parseFloat(s.split(" ")[2])||0)!==g.zOrigin&&vn(this,g,"zOrigin",g.zOrigin,p),vn(this,j,h,kn(o),kn(s)));continue}if("svgOrigin"===h){Rn(e,s,1,v,0,this);continue}if(h in An){Gn(this,g,h,l,f?be(l,f+s):s);continue}if("smoothOrigin"===h){vn(this,g,"smooth",g.smooth,s);continue}if("force3D"===h){g[h]=s;continue}if("transform"===h){Hn(this,s,e);continue}}else h in j||(h=hn(h)||h);if(m||(a||0===a)&&(l||0===l)&&!zr.test(s)&&h in j)a||(a=0),(d=(o+"").substr((l+"").length))!==(p=et(s)||(h in w.units?w.units[h]:d))&&(l=xn(e,h,o,p)),this._pt=new pr(this._pt,m?g:j,h,l,(f?be(l,f+a):a)-l,m||"px"!==p&&"zIndex"!==h||!1===t.autoRound?Vr:qr),this._pt.u=p||0,d!==p&&"%"!==p&&(this._pt.b=o,this._pt.r=Wr);else if(h in j)Sn.call(this,e,h,o,f?f+s:s);else if(h in e)this.add(e,h,o||e[h],f?f+s:s,n,i);else if("parseTransform"!==h){Q(h,s);continue}m||(h in j?_.push(h,0,j[h]):"function"==typeof e[h]?_.push(h,2,e[h]()):_.push(h,1,o||e[h])),E.push(h)}b&&dr(this)},render:function(e,t){if(t.tween._time||!Or())for(var r=t._pt;r;)r.r(e,r.d),r=r._next;else t.styles.revert()},get:wn,aliases:Gr,getSetter:function(e,t,r){var n=Gr[t];return n&&n.indexOf(",")<0&&(t=n),t in Ir&&t!==rn&&(e._gsap.x||wn(e,"x"))?r&&Rr===r?"scale"===t?Qr:Kr:(Rr=r||{})&&("scale"===t?$r:en):e.style&&!I(e.style[t])?Zr:~t.indexOf("-")?Jr:ir(e,t)},core:{_removeProperty:gn,_getMatrix:Pn}};Er.utils.checkPrefix=hn,Er.core.getStyleSaver=an,qn=ye("x,y,z,scale,scaleX,scaleY,xPercent,yPercent"+","+(Wn="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(e){Ir[e]=1})),ye(Wn,(function(e){w.units[e]="deg",An[e]=1})),Gr[qn[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+Wn,ye("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(e){var t=e.split(":");Gr[t[1]]=qn[t[0]]})),ye("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(e){w.units[e]="px"})),Er.registerPlugin(Xn);var Yn=Er.registerPlugin(Xn)||Er;Yn.core.Tween},915:function(e){"use strict";var t="bfred-it:object-fit-images",r=/(object-fit|object-position)\s*:\s*([-.\w\s%]+)/g,n="undefined"==typeof Image?{style:{"object-position":1}}:new Image,i="object-fit"in n.style,o="object-position"in n.style,s="background-size"in n.style,a="string"==typeof n.currentSrc,l=n.getAttribute,c=n.setAttribute,u=!1;function h(e,t,r){var n="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='"+(t||1)+"' height='"+(r||0)+"'%3E%3C/svg%3E";l.call(e,"src")!==n&&c.call(e,"src",n)}function d(e,t){e.naturalWidth?t(e):setTimeout(d,100,e,t)}function p(e){var n=function(e){for(var t,n=getComputedStyle(e).fontFamily,i={};null!==(t=r.exec(n));)i[t[1]]=t[2];return i}(e),o=e[t];if(n["object-fit"]=n["object-fit"]||"fill",!o.img){if("fill"===n["object-fit"])return;if(!o.skipTest&&i&&!n["object-position"])return}if(!o.img){o.img=new Image(e.width,e.height),o.img.srcset=l.call(e,"data-ofi-srcset")||e.srcset,o.img.src=l.call(e,"data-ofi-src")||e.src,c.call(e,"data-ofi-src",e.src),e.srcset&&c.call(e,"data-ofi-srcset",e.srcset),h(e,e.naturalWidth||e.width,e.naturalHeight||e.height),e.srcset&&(e.srcset="");try{!function(e){var r={get:function(r){return e[t].img[r||"src"]},set:function(r,n){return e[t].img[n||"src"]=r,c.call(e,"data-ofi-"+n,r),p(e),r}};Object.defineProperty(e,"src",r),Object.defineProperty(e,"currentSrc",{get:function(){return r.get("currentSrc")}}),Object.defineProperty(e,"srcset",{get:function(){return r.get("srcset")},set:function(e){return r.set(e,"srcset")}})}(e)}catch(e){window.console&&console.warn("https://bit.ly/ofi-old-browser")}}!function(e){if(e.srcset&&!a&&window.picturefill){var t=window.picturefill._;e[t.ns]&&e[t.ns].evaled||t.fillImg(e,{reselect:!0}),e[t.ns].curSrc||(e[t.ns].supported=!1,t.fillImg(e,{reselect:!0})),e.currentSrc=e[t.ns].curSrc||e.src}}(o.img),e.style.backgroundImage='url("'+(o.img.currentSrc||o.img.src).replace(/"/g,'\\"')+'")',e.style.backgroundPosition=n["object-position"]||"center",e.style.backgroundRepeat="no-repeat",e.style.backgroundOrigin="content-box",/scale-down/.test(n["object-fit"])?d(o.img,(function(){o.img.naturalWidth>e.width||o.img.naturalHeight>e.height?e.style.backgroundSize="contain":e.style.backgroundSize="auto"})):e.style.backgroundSize=n["object-fit"].replace("none","auto").replace("fill","100% 100%"),d(o.img,(function(t){h(e,t.naturalWidth,t.naturalHeight)}))}function f(e,r){var n=!u&&!e;if(r=r||{},e=e||"img",o&&!r.skipTest||!s)return!1;"img"===e?e=document.getElementsByTagName("img"):"string"==typeof e?e=document.querySelectorAll(e):"length"in e||(e=[e]);for(var i=0;i<e.length;i++)e[i][t]=e[i][t]||{skipTest:r.skipTest},p(e[i]);n&&(document.body.addEventListener("load",(function(e){"IMG"===e.target.tagName&&f(e.target,{skipTest:r.skipTest})}),!0),u=!0,e="img"),r.watchMQ&&window.addEventListener("resize",f.bind(null,e,{skipTest:r.skipTest}))}f.supportsObjectFit=i,f.supportsObjectPosition=o,function(){function e(e,r){return e[t]&&e[t].img&&("src"===r||"srcset"===r)?e[t].img:e}o||(HTMLImageElement.prototype.getAttribute=function(t){return l.call(e(this,t),t)},HTMLImageElement.prototype.setAttribute=function(t,r){return c.call(e(this,t),t,String(r))})}(),e.exports=f},953:function(t,r,n){!function(e){t.exports=e()}((function(){return function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var l=void 0;if(!a&&l)return require(s,!0);if(o)return o(s,!0);throw(a=new Error("Cannot find module '"+s+"'")).code="MODULE_NOT_FOUND",a}l=r[s]={exports:{}},t[s][0].call(l.exports,(function(e){return i(t[s][1][e]||e)}),l,l.exports,e,t,r,n)}return r[s].exports}for(var o=void 0,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,r){"use strict";r.byteLength=function(e){return 3*((e=l(e))[0]+(e=e[1]))/4-e},r.toByteArray=function(e){var t,r,n=(s=l(e))[0],s=s[1],a=new o(function(e,t){return 3*(e+t)/4-t}(n,s)),c=0,u=0<s?n-4:n;for(r=0;r<u;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],a[c++]=t>>16&255,a[c++]=t>>8&255,a[c++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,a[c++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,a[c++]=t>>8&255,a[c++]=255&t),a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(function(e,t,r){for(var i,o=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(function(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}(i));return o.join("")}(e,s,a<s+16383?a:s+16383));return 1==i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function l(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");return t=(e=-1===(e=e.indexOf("="))?t:e)===t?0:4-e%4,[e,t]}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(e,t,r){},{}],3:[function(e,t,r){},{}],4:[function(e,t,r){(function(t){"use strict";var n=e("base64-js"),i=e("ieee754"),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null,s=(r.Buffer=t,r.SlowBuffer=function(e){return+e!=e&&(e=0),t.alloc(+e)},r.INSPECT_MAX_BYTES=50,2147483647);function a(e){if(s<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');return e=new Uint8Array(e),Object.setPrototypeOf(e,t.prototype),e}function t(e,t,r){if("number"!=typeof e)return l(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}function l(e,r,n){if("string"==typeof e){var i=e,o=r;if(t.isEncoding(o="string"==typeof o&&""!==o?o:"utf8"))return(i=(l=a(s=0|p(i,o))).write(i,o))!==s?l.slice(0,i):l;throw new TypeError("Unknown encoding: "+o)}if(ArrayBuffer.isView(e))return h(e);if(null!=e){if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer)){var s=e,l=n;if((i=r)<0||s.byteLength<i)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<i+(l||0))throw new RangeError('"length" is outside of buffer bounds');return s=void 0===i&&void 0===l?new Uint8Array(s):void 0===l?new Uint8Array(s,i):new Uint8Array(s,i,l),Object.setPrototypeOf(s,t.prototype),s}if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');if(null!=(o=e.valueOf&&e.valueOf())&&o!==e)return t.from(o,r,n);var c=function(e){var r,n;return t.isBuffer(e)?(0!==(n=a(r=0|d(e.length))).length&&e.copy(n,0,0,r),n):void 0!==e.length?"number"!=typeof e.length||R(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(c)return c;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return t.from(e[Symbol.toPrimitive]("string"),r,n)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),a(e<0?0:0|d(e))}function h(e){for(var t=e.length<0?0:0|d(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e){if(s<=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function p(e,r){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||P(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,i=2<arguments.length&&!0===arguments[2];if(!i&&0===n)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return A(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return L(e).length;default:if(o)return i?-1:A(e).length;r=(""+r).toLowerCase(),o=!0}}function f(e,t,r){var i,o=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var s=t,a=r,l=this.length;(!a||a<0||l<a)&&(a=l);for(var c="",u=s=!s||s<0?0:s;u<a;++u)c+=O[this[u]];return c;case"utf8":case"utf-8":return _(this,t,r);case"ascii":l=t;var h=r,d="";h=Math.min(this.length,h);for(var p=l;p<h;++p)d+=String.fromCharCode(127&this[p]);return d;case"latin1":case"binary":s=t;var f=r,m="";f=Math.min(this.length,f);for(var y=s;y<f;++y)m+=String.fromCharCode(this[y]);return m;case"base64":return g=this,i=r,0===(v=t)&&i===g.length?n.fromByteArray(g):n.fromByteArray(g.slice(v,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var g=t,v=r,b=this.slice(g,v),x="",w=0;w<b.length;w+=2)x+=String.fromCharCode(b[w]+256*b[w+1]);return x;default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,r,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):2147483647<n?n=2147483647:n<-2147483648&&(n=-2147483648),(n=(n=R(n=+n)?o?0:e.length-1:n)<0?e.length+n:n)>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof r&&(r=t.from(r,i)),t.isBuffer(r))return 0===r.length?-1:g(e,r,n,i,o);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?(o?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,r,n):g(e,[r],n,i,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var o=1,s=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s/=o=2,a/=2,r/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i)for(var c=-1,u=r;u<s;u++)if(l(e,u)===l(t,-1===c?0:u-c)){if(u-(c=-1===c?u:c)+1===a)return c*o}else-1!==c&&(u-=u-c),c=-1;else for(u=r=s<r+a?s-a:r;0<=u;u--){for(var h=!0,d=0;d<a;d++)if(l(e,u+d)!==l(t,d)){h=!1;break}if(h)return u}return-1}function v(e,t,r,n){return C(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function b(e,t,r,n){return C(function(e,t){for(var r,n,i=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,n%=256,i.push(n),i.push(r);return i}(t,e.length-r),e,r,n)}function _(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,l,c=e[i],u=null,h=239<c?4:223<c?3:191<c?2:1;if(i+h<=r)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(o=e[i+1]))&&127<(l=(31&c)<<6|63&o)&&(u=l);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&2047<(l=(15&c)<<12|(63&o)<<6|63&s)&&(l<55296||57343<l)&&(u=l);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&65535<(l=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)&&l<1114112&&(u=l)}null===u?(u=65533,h=1):65535<u&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=h}var d=n,p=d.length;if(p<=x)return String.fromCharCode.apply(String,d);for(var f="",m=0;m<p;)f+=String.fromCharCode.apply(String,d.slice(m,m+=x));return f}r.kMaxLength=s,(t.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=l,Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array),t.alloc=function(e,t,r){return c(e),e<=0||void 0===t?a(e):"string"==typeof r?a(e).fill(t,r):a(e).fill(t)},t.allocUnsafe=u,t.allocUnsafeSlow=u,t.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==t.prototype},t.compare=function(e,r){if(P(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),P(r,Uint8Array)&&(r=t.from(r,r.offset,r.byteLength)),!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0},t.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return t.alloc(0);if(void 0===r)for(o=r=0;o<e.length;++o)r+=e[o].length;for(var n=t.allocUnsafe(r),i=0,o=0;o<e.length;++o){var s=e[o];if(P(s,Uint8Array)&&(s=t.from(s)),!t.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},t.byteLength=p,t.prototype._isBuffer=!0,t.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},t.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},t.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},t.prototype.toLocaleString=t.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?_(this,0,e):f.apply(this,arguments)},t.prototype.equals=function(e){if(t.isBuffer(e))return this===e||0===t.compare(this,e);throw new TypeError("Argument must be a Buffer")},t.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},o&&(t.prototype[o]=t.prototype.inspect),t.prototype.compare=function(e,r,n,i,o){if(P(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),(r=void 0===r?0:r)<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(o<=i&&n<=r)return 0;if(o<=i)return-1;if(n<=r)return 1;if(this===e)return 0;for(var s=(o>>>=0)-(i>>>=0),a=(n>>>=0)-(r>>>=0),l=Math.min(s,a),c=this.slice(i,o),u=e.slice(r,n),h=0;h<l;++h)if(c[h]!==u[h]){s=c[h],a=u[h];break}return s<a?-1:a<s?1:0},t.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},t.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},t.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},t.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||i<r)&&(r=i),0<e.length&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,s,a,l=!1;;)switch(n){case"hex":var c=e,u=t,h=r,d=(u=Number(u)||0,this.length-u);(!h||d<(h=Number(h)))&&(h=d),(d=c.length)/2<h&&(h=d/2);for(var p=0;p<h;++p){var f=parseInt(c.substr(2*p,2),16);if(R(f))return p;this[u+p]=f}return p;case"utf8":case"utf-8":return d=t,a=r,C(A(e,(s=this).length-d),s,d,a);case"ascii":case"latin1":case"binary":return v(this,e,t,r);case"base64":return s=this,a=t,o=r,C(L(e),s,a,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,e,t,r);default:if(l)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),l=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function S(e,r,n,i,o,s){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<r||r<s)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function M(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,n,o){return t=+t,r>>>=0,o||M(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function E(e,t,r,n,o){return t=+t,r>>>=0,o||M(e,0,r,8),i.write(e,t,r,n,52,8),r+8}t.prototype.slice=function(e,r){var n=this.length;return(e=~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):n<r&&(r=n),r<e&&(r=e),n=this.subarray(e,r),Object.setPrototypeOf(n,t.prototype),n},t.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},t.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e+--t],i=1;0<t&&(i*=256);)n+=this[e+--t]*i;return n},t.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*t)),n},t.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=t,i=1,o=this[e+--n];0<n&&(i*=256);)o+=this[e+--n]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*t)),o},t.prototype.readInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),32768&(t=this[e]|this[e+1]<<8)?4294901760|t:t},t.prototype.readInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),32768&(t=this[e+1]|this[e]<<8)?4294901760|t:t},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||S(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},t.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||S(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;0<=--i&&(o*=256);)this[t+i]=e/o&255;return t+r},t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,r,n){e=+e,t>>>=0,n||S(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},t.prototype.writeIntBE=function(e,t,r,n){e=+e,t>>>=0,n||S(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var i=r-1,o=1,s=0;for(this[t+i]=255&e;0<=--i&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},t.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},t.prototype.writeDoubleLE=function(e,t,r){return E(this,e,t,!0,r)},t.prototype.writeDoubleBE=function(e,t,r){return E(this,e,t,!1,r)},t.prototype.copy=function(e,r,n,i){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n=n||0,i||0===i||(i=this.length),r>=e.length&&(r=e.length),(i=0<i&&i<n?n:i)===n)return 0;if(0===e.length||0===this.length)return 0;if((r=r||0)<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length);var o=(i=e.length-r<i-n?e.length-r+n:i)-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(r,n,i);else if(this===e&&n<r&&r<i)for(var s=o-1;0<=s;--s)e[s+r]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,i),r);return o},t.prototype.fill=function(e,r,n,i){if("string"==typeof e){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i);var o;1===e.length&&(o=e.charCodeAt(0),("utf8"===i&&o<128||"latin1"===i)&&(e=o))}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");var s;if(!(n<=r))if(r>>>=0,n=void 0===n?this.length:n>>>0,"number"==typeof(e=e||0))for(s=r;s<n;++s)this[s]=e;else{var a=t.isBuffer(e)?e:t.from(e,i),l=a.length;if(0===l)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<n-r;++s)this[s+r]=a[s%l]}return this};var j=/[^+/0-9A-Za-z-_]/g;function A(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=e.charCodeAt(s))&&r<57344){if(!i){if(56319<r){-1<(t-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(t-=3)&&o.push(239,191,189);continue}i=r;continue}if(r<56320){-1<(t-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(t-=3)&&o.push(239,191,189);if(i=null,r<128){if(--t<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function L(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function C(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function P(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function R(e){return e!=e}var O=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()}).call(this,e("buffer").Buffer)},{"base64-js":1,buffer:4,ieee754:254}],5:[function(e,t,r){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],6:[function(e,t,r){var n=e("../internals/is-object");t.exports=function(e){if(n(e)||null===e)return e;throw TypeError("Can't set "+String(e)+" as a prototype")}},{"../internals/is-object":75}],7:[function(e,t,r){var n=e("../internals/well-known-symbol"),i=e("../internals/object-create"),o=(e=e("../internals/object-define-property"),n("unscopables")),s=Array.prototype;null==s[o]&&e.f(s,o,{configurable:!0,value:i(null)}),t.exports=function(e){s[o][e]=!0}},{"../internals/object-create":91,"../internals/object-define-property":93,"../internals/well-known-symbol":150}],8:[function(e,t,r){"use strict";var n=e("../internals/string-multibyte").charAt;t.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},{"../internals/string-multibyte":125}],9:[function(e,t,r){t.exports=function(e,t,r){if(e instanceof t)return e;throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}},{}],10:[function(e,t,r){var n=e("../internals/is-object");t.exports=function(e){if(n(e))return e;throw TypeError(String(e)+" is not an object")}},{"../internals/is-object":75}],11:[function(e,t,r){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},{}],12:[function(e,t,r){"use strict";function n(e){return l(e)&&c(E,u(e))}var i,o=e("../internals/array-buffer-native"),s=e("../internals/descriptors"),a=e("../internals/global"),l=e("../internals/is-object"),c=e("../internals/has"),u=e("../internals/classof"),h=e("../internals/create-non-enumerable-property"),d=e("../internals/redefine"),p=e("../internals/object-define-property").f,f=e("../internals/object-get-prototype-of"),m=e("../internals/object-set-prototype-of"),y=e("../internals/well-known-symbol"),g=(e=e("../internals/uid"),a.Int8Array),v=g&&g.prototype,b=(b=a.Uint8ClampedArray)&&b.prototype,_=g&&f(g),x=v&&f(v),w=Object.prototype,S=w.isPrototypeOf,M=(y=y("toStringTag"),e("TYPED_ARRAY_TAG")),T=o&&!!m&&"Opera"!==u(a.opera),E=(e=!1,{Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8});for(i in E)a[i]||(T=!1);if((!T||"function"!=typeof _||_===Function.prototype)&&(_=function(){throw TypeError("Incorrect invocation")},T))for(i in E)a[i]&&m(a[i],_);if((!T||!x||x===w)&&(x=_.prototype,T))for(i in E)a[i]&&m(a[i].prototype,x);if(T&&f(b)!==x&&m(b,x),s&&!c(x,y))for(i in e=!0,p(x,y,{get:function(){return l(this)?this[M]:void 0}}),E)a[i]&&h(a[i],M,i);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:T,TYPED_ARRAY_TAG:e&&M,aTypedArray:function(e){if(n(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(m){if(S.call(_,e))return e}else for(var t in E)if(c(E,i)&&(t=a[t])&&(e===t||S.call(t,e)))return e;throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(s){if(r)for(var n in E)(n=a[n])&&c(n.prototype,e)&&delete n.prototype[e];x[e]&&!r||d(x,e,!r&&T&&v[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(s){if(m){if(r)for(n in E)(i=a[n])&&c(i,e)&&delete i[e];if(_[e]&&!r)return;try{return d(_,e,!r&&T&&g[e]||t)}catch(e){}}for(n in E)!(i=a[n])||i[e]&&!r||d(i,e,t)}},isView:function(e){return"DataView"===(e=u(e))||c(E,e)},isTypedArray:n,TypedArray:_,TypedArrayPrototype:x}},{"../internals/array-buffer-native":11,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/global":60,"../internals/has":61,"../internals/is-object":75,"../internals/object-define-property":93,"../internals/object-get-prototype-of":98,"../internals/object-set-prototype-of":102,"../internals/redefine":110,"../internals/uid":147,"../internals/well-known-symbol":150}],13:[function(e,t,r){"use strict";function n(e){return[255&e]}function i(e){return[255&e,e>>8&255]}function o(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function s(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function a(e){return B(e,23,4)}function l(e){return B(e,52,8)}function c(e,t){E(e[O],t,{get:function(){return L(this)[t]}})}function u(e,t,r,n){if((r=x(r))+t>(e=L(e)).byteLength)throw U(k);var i=L(e.buffer).bytes;return r+=e.byteOffset,e=i.slice(r,r+t),n?e:e.reverse()}function h(e,t,r,n,i,o){if((r=x(r))+t>(e=L(e)).byteLength)throw U(k);for(var s=L(e.buffer).bytes,a=r+e.byteOffset,l=n(+i),c=0;c<t;c++)s[a+c]=l[o?c:t-c-1]}var d=e("../internals/global"),p=e("../internals/descriptors"),f=e("../internals/array-buffer-native"),m=e("../internals/create-non-enumerable-property"),y=e("../internals/redefine-all"),g=e("../internals/fails"),v=e("../internals/an-instance"),b=e("../internals/to-integer"),_=e("../internals/to-length"),x=e("../internals/to-index"),w=e("../internals/ieee754"),S=e("../internals/object-get-prototype-of"),M=e("../internals/object-set-prototype-of"),T=e("../internals/object-get-own-property-names").f,E=e("../internals/object-define-property").f,j=e("../internals/array-fill"),A=e("../internals/set-to-string-tag"),L=(e=e("../internals/internal-state")).get,C=e.set,P="ArrayBuffer",R="DataView",O="prototype",k="Wrong index",I=d[P],D=I,N=d[R],F=(e=N&&N[O],Object.prototype),U=d.RangeError,B=w.pack,z=w.unpack;if(f){if(!g((function(){I(1)}))||!g((function(){new I(-1)}))||g((function(){return new I,new I(1.5),new I(NaN),I.name!=P}))){d=(D=function(e){return v(this,D),new I(x(e))})[O]=I[O];for(var G,V=T(I),H=0;V.length>H;)(G=V[H++])in D||m(D,G,I[G]);d.constructor=D}M&&S(e)!==F&&M(e,F),w=new N(new D(2));var W=e.setInt8;w.setInt8(0,2147483648),w.setInt8(1,2147483649),!w.getInt8(0)&&w.getInt8(1)||y(e,{setInt8:function(e,t){W.call(this,e,t<<24>>24)},setUint8:function(e,t){W.call(this,e,t<<24>>24)}},{unsafe:!0})}else D=function(e){v(this,D,P),e=x(e),C(this,{bytes:j.call(new Array(e),0),byteLength:e}),p||(this.byteLength=e)},N=function(e,t,r){v(this,N,R),v(e,D,R);var n=L(e).byteLength;if((t=b(t))<0||n<t)throw U("Wrong offset");if(n<t+(r=void 0===r?n-t:_(r)))throw U("Wrong length");C(this,{buffer:e,byteLength:r,byteOffset:t}),p||(this.buffer=e,this.byteLength=r,this.byteOffset=t)},p&&(c(D,"byteLength"),c(N,"buffer"),c(N,"byteLength"),c(N,"byteOffset")),y(N[O],{getInt8:function(e){return u(this,1,e)[0]<<24>>24},getUint8:function(e){return u(this,1,e)[0]},getInt16:function(e){return((e=u(this,2,e,1<arguments.length?arguments[1]:void 0))[1]<<8|e[0])<<16>>16},getUint16:function(e){return(e=u(this,2,e,1<arguments.length?arguments[1]:void 0))[1]<<8|e[0]},getInt32:function(e){return s(u(this,4,e,1<arguments.length?arguments[1]:void 0))},getUint32:function(e){return s(u(this,4,e,1<arguments.length?arguments[1]:void 0))>>>0},getFloat32:function(e){return z(u(this,4,e,1<arguments.length?arguments[1]:void 0),23)},getFloat64:function(e){return z(u(this,8,e,1<arguments.length?arguments[1]:void 0),52)},setInt8:function(e,t){h(this,1,e,n,t)},setUint8:function(e,t){h(this,1,e,n,t)},setInt16:function(e,t){h(this,2,e,i,t,2<arguments.length?arguments[2]:void 0)},setUint16:function(e,t){h(this,2,e,i,t,2<arguments.length?arguments[2]:void 0)},setInt32:function(e,t){h(this,4,e,o,t,2<arguments.length?arguments[2]:void 0)},setUint32:function(e,t){h(this,4,e,o,t,2<arguments.length?arguments[2]:void 0)},setFloat32:function(e,t){h(this,4,e,a,t,2<arguments.length?arguments[2]:void 0)},setFloat64:function(e,t){h(this,8,e,l,t,2<arguments.length?arguments[2]:void 0)}});A(D,P),A(N,R),t.exports={ArrayBuffer:D,DataView:N}},{"../internals/an-instance":9,"../internals/array-buffer-native":11,"../internals/array-fill":15,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":60,"../internals/ieee754":66,"../internals/internal-state":71,"../internals/object-define-property":93,"../internals/object-get-own-property-names":96,"../internals/object-get-prototype-of":98,"../internals/object-set-prototype-of":102,"../internals/redefine-all":109,"../internals/set-to-string-tag":119,"../internals/to-index":135,"../internals/to-integer":137,"../internals/to-length":138}],14:[function(e,t,r){"use strict";var n=e("../internals/to-object"),i=e("../internals/to-absolute-index"),o=e("../internals/to-length"),s=Math.min;t.exports=[].copyWithin||function(e,t){var r=n(this),a=o(r.length),l=i(e,a),c=i(t,a),u=s((void 0===(e=2<arguments.length?arguments[2]:void 0)?a:i(e,a))-c,a-l),h=1;for(c<l&&l<c+u&&(h=-1,c+=u-1,l+=u-1);0<u--;)c in r?r[l]=r[c]:delete r[l],l+=h,c+=h;return r}},{"../internals/to-absolute-index":134,"../internals/to-length":138,"../internals/to-object":139}],15:[function(e,t,r){"use strict";var n=e("../internals/to-object"),i=e("../internals/to-absolute-index"),o=e("../internals/to-length");t.exports=function(e){for(var t,r=n(this),s=o(r.length),a=i(1<(t=arguments.length)?arguments[1]:void 0,s),l=void 0===(t=2<t?arguments[2]:void 0)?s:i(t,s);a<l;)r[a++]=e;return r}},{"../internals/to-absolute-index":134,"../internals/to-length":138,"../internals/to-object":139}],16:[function(e,t,r){"use strict";var n=e("../internals/array-iteration").forEach,i=e("../internals/array-method-is-strict");e=e("../internals/array-method-uses-to-length"),i=i("forEach"),e=e("forEach"),t.exports=i&&e?[].forEach:function(e){return n(this,e,1<arguments.length?arguments[1]:void 0)}},{"../internals/array-iteration":19,"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23}],17:[function(e,t,r){"use strict";var n=e("../internals/function-bind-context"),i=e("../internals/to-object"),o=e("../internals/call-with-safe-iteration-closing"),s=e("../internals/is-array-iterator-method"),a=e("../internals/to-length"),l=e("../internals/create-property"),c=e("../internals/get-iterator-method");t.exports=function(e){var t,r,u,h,d,p,f=i(e),m=(e="function"==typeof this?this:Array,arguments.length),y=1<m?arguments[1]:void 0,g=void 0!==y,v=c(f),b=0;if(g&&(y=n(y,2<m?arguments[2]:void 0,2)),null==v||e==Array&&s(v))for(r=new e(t=a(f.length));b<t;b++)p=g?y(f[b],b):f[b],l(r,b,p);else for(d=(h=v.call(f)).next,r=new e;!(u=d.call(h)).done;b++)p=g?o(h,y,[u.value,b],!0):u.value,l(r,b,p);return r.length=b,r}},{"../internals/call-with-safe-iteration-closing":26,"../internals/create-property":40,"../internals/function-bind-context":55,"../internals/get-iterator-method":58,"../internals/is-array-iterator-method":72,"../internals/to-length":138,"../internals/to-object":139}],18:[function(e,t,r){function n(e){return function(t,r,n){var a,l=i(t),c=o(l.length),u=s(n,c);if(e&&r!=r){for(;u<c;)if((a=l[u++])!=a)return!0}else for(;u<c;u++)if((e||u in l)&&l[u]===r)return e||u||0;return!e&&-1}}var i=e("../internals/to-indexed-object"),o=e("../internals/to-length"),s=e("../internals/to-absolute-index");t.exports={includes:n(!0),indexOf:n(!1)}},{"../internals/to-absolute-index":134,"../internals/to-indexed-object":136,"../internals/to-length":138}],19:[function(e,t,r){function n(e){var t=1==e,r=2==e,n=3==e,u=4==e,h=6==e,d=5==e||h;return function(p,f,m,y){for(var g,v,b=s(p),_=o(b),x=i(f,m,3),w=a(_.length),S=0,M=(f=y||l,t?f(p,w):r?f(p,0):void 0);S<w;S++)if((d||S in _)&&(v=x(g=_[S],S,b),e))if(t)M[S]=v;else if(v)switch(e){case 3:return!0;case 5:return g;case 6:return S;case 2:c.call(M,g)}else if(u)return!1;return h?-1:n||u?u:M}}var i=e("../internals/function-bind-context"),o=e("../internals/indexed-object"),s=e("../internals/to-object"),a=e("../internals/to-length"),l=e("../internals/array-species-create"),c=[].push;t.exports={forEach:n(0),map:n(1),filter:n(2),some:n(3),every:n(4),find:n(5),findIndex:n(6)}},{"../internals/array-species-create":25,"../internals/function-bind-context":55,"../internals/indexed-object":67,"../internals/to-length":138,"../internals/to-object":139}],20:[function(e,t,r){"use strict";var n=e("../internals/to-indexed-object"),i=e("../internals/to-integer"),o=e("../internals/to-length"),s=e("../internals/array-method-is-strict"),a=(e=e("../internals/array-method-uses-to-length"),Math.min),l=[].lastIndexOf,c=!!l&&1/[1].lastIndexOf(1,-0)<0;s=s("lastIndexOf"),e=e("indexOf",{ACCESSORS:!0,1:0}),t.exports=!c&&s&&e?l:function(e){if(c)return l.apply(this,arguments)||0;var t=n(this),r=o(t.length),s=r-1;for((s=1<arguments.length?a(s,i(arguments[1])):s)<0&&(s=r+s);0<=s;s--)if(s in t&&t[s]===e)return s||0;return-1}},{"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23,"../internals/to-indexed-object":136,"../internals/to-integer":137,"../internals/to-length":138}],21:[function(e,t,r){var n=e("../internals/fails"),i=e("../internals/well-known-symbol"),o=e("../internals/engine-v8-version"),s=i("species");t.exports=function(e){return 51<=o||!n((function(){var t=[];return(t.constructor={})[s]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},{"../internals/engine-v8-version":48,"../internals/fails":51,"../internals/well-known-symbol":150}],22:[function(e,t,r){"use strict";var n=e("../internals/fails");t.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){throw 1},1)}))}},{"../internals/fails":51}],23:[function(e,t,r){function n(e){throw e}var i=e("../internals/descriptors"),o=e("../internals/fails"),s=e("../internals/has"),a=Object.defineProperty,l={};t.exports=function(e,t){var r,c,u,h;return s(l,e)?l[e]:(r=[][e],c=!!s(t=t||{},"ACCESSORS")&&t.ACCESSORS,u=s(t,0)?t[0]:n,h=s(t,1)?t[1]:void 0,l[e]=!!r&&!o((function(){if(c&&!i)return!0;var e={length:-1};c?a(e,1,{enumerable:!0,get:n}):e[1]=1,r.call(e,u,h)})))}},{"../internals/descriptors":43,"../internals/fails":51,"../internals/has":61}],24:[function(e,t,r){function n(e){return function(t,r,n,l){i(r);var c=o(t),u=s(c),h=a(c.length),d=e?h-1:0,p=e?-1:1;if(n<2)for(;;){if(d in u){l=u[d],d+=p;break}if(d+=p,e?d<0:h<=d)throw TypeError("Reduce of empty array with no initial value")}for(;e?0<=d:d<h;d+=p)d in u&&(l=r(l,u[d],d,c));return l}}var i=e("../internals/a-function"),o=e("../internals/to-object"),s=e("../internals/indexed-object"),a=e("../internals/to-length");t.exports={left:n(!1),right:n(!0)}},{"../internals/a-function":5,"../internals/indexed-object":67,"../internals/to-length":138,"../internals/to-object":139}],25:[function(e,t,r){var n=e("../internals/is-object"),i=e("../internals/is-array"),o=e("../internals/well-known-symbol")("species");t.exports=function(e,t){var r;return new(void 0===(r=i(e)&&("function"==typeof(r=e.constructor)&&(r===Array||i(r.prototype))||n(r)&&null===(r=r[o]))?void 0:r)?Array:r)(0===t?0:t)}},{"../internals/is-array":73,"../internals/is-object":75,"../internals/well-known-symbol":150}],26:[function(e,t,r){var n=e("../internals/an-object");t.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){throw void 0!==(i=e.return)&&n(i.call(e)),t}}},{"../internals/an-object":10}],27:[function(e,t,r){var n=e("../internals/well-known-symbol")("iterator"),i=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){i=!0}};s[n]=function(){return this},Array.from(s,(function(){throw 2}))}catch(e){}t.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},e(o)}catch(e){}return r}},{"../internals/well-known-symbol":150}],28:[function(e,t,r){var n={}.toString;t.exports=function(e){return n.call(e).slice(8,-1)}},{}],29:[function(e,t,r){var n=e("../internals/to-string-tag-support"),i=e("../internals/classof-raw"),o=e("../internals/well-known-symbol")("toStringTag"),s="Arguments"==i(function(){return arguments}());t.exports=n?i:function(e){var t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,t){try{return e[t]}catch(e){}}(e=Object(e),o))?t:s?i(e):"Object"==(t=i(e))&&"function"==typeof e.callee?"Arguments":t}},{"../internals/classof-raw":28,"../internals/to-string-tag-support":143,"../internals/well-known-symbol":150}],30:[function(e,t,r){"use strict";var n=e("../internals/object-define-property").f,i=e("../internals/object-create"),o=e("../internals/redefine-all"),s=e("../internals/function-bind-context"),a=e("../internals/an-instance"),l=e("../internals/iterate"),c=e("../internals/define-iterator"),u=e("../internals/set-species"),h=e("../internals/descriptors"),d=e("../internals/internal-metadata").fastKey,p=(e=e("../internals/internal-state")).set,f=e.getterFor;t.exports={getConstructor:function(e,t,r,c){function u(e,t,r){var n,i=g(e),o=m(e,t);return o?o.value=r:(i.last=o={index:n=d(t,!0),key:t,value:r,previous:t=i.last,next:void 0,removed:!1},i.first||(i.first=o),t&&(t.next=o),h?i.size++:e.size++,"F"!==n&&(i.index[n]=o)),e}function m(e,t){e=g(e);var r,n=d(t);if("F"!==n)return e.index[n];for(r=e.first;r;r=r.next)if(r.key==t)return r}var y=e((function(e,n){a(e,y,t),p(e,{type:t,index:i(null),first:void 0,last:void 0,size:0}),h||(e.size=0),null!=n&&l(n,e[c],e,r)})),g=f(t);return o(y.prototype,{clear:function(){for(var e=g(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,h?e.size=0:this.size=0},delete:function(e){var t,r,n=g(this);return(e=m(this,e))&&(t=e.next,r=e.previous,delete n.index[e.index],e.removed=!0,r&&(r.next=t),t&&(t.previous=r),n.first==e&&(n.first=t),n.last==e&&(n.last=r),h?n.size--:this.size--),!!e},forEach:function(e){for(var t,r=g(this),n=s(e,1<arguments.length?arguments[1]:void 0,3);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!m(this,e)}}),o(y.prototype,r?{get:function(e){return(e=m(this,e))&&e.value},set:function(e,t){return u(this,0===e?0:e,t)}}:{add:function(e){return u(this,e=0===e?0:e,e)}}),h&&n(y.prototype,"size",{get:function(){return g(this).size}}),y},setStrong:function(e,t,r){var n=t+" Iterator",i=f(t),o=f(n);c(e,t,(function(e,t){p(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:{value:e.target=void 0,done:!0}}),r?"entries":"values",!r,!0),u(t)}}},{"../internals/an-instance":9,"../internals/define-iterator":41,"../internals/descriptors":43,"../internals/function-bind-context":55,"../internals/internal-metadata":70,"../internals/internal-state":71,"../internals/iterate":78,"../internals/object-create":91,"../internals/object-define-property":93,"../internals/redefine-all":109,"../internals/set-species":118}],31:[function(e,t,r){"use strict";function n(e){return e.frozen||(e.frozen=new i)}function i(){this.entries=[]}function o(e,t){return y(e.entries,(function(e){return e[0]===t}))}var s=e("../internals/redefine-all"),a=e("../internals/internal-metadata").getWeakData,l=e("../internals/an-object"),c=e("../internals/is-object"),u=e("../internals/an-instance"),h=e("../internals/iterate"),d=e("../internals/array-iteration"),p=e("../internals/has"),f=(e=e("../internals/internal-state")).set,m=e.getterFor,y=d.find,g=d.findIndex,v=0;i.prototype={get:function(e){if(e=o(this,e))return e[1]},has:function(e){return!!o(this,e)},set:function(e,t){var r=o(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=g(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}},t.exports={getConstructor:function(e,t,r,i){function o(e,t,r){var i=y(e),o=a(l(t),!0);return!0===o?n(i).set(t,r):o[i.id]=r,e}var d=e((function(e,n){u(e,d,t),f(e,{type:t,id:v++,frozen:void 0}),null!=n&&h(n,e[i],e,r)})),y=m(t);return s(d.prototype,{delete:function(e){var t,r=y(this);return!!c(e)&&(!0===(t=a(e))?n(r).delete(e):t&&p(t,r.id)&&delete t[r.id])},has:function(e){var t,r=y(this);return!!c(e)&&(!0===(t=a(e))?n(r).has(e):t&&p(t,r.id))}}),s(d.prototype,r?{get:function(e){var t,r=y(this);if(c(e))return!0===(t=a(e))?n(r).get(e):t?t[r.id]:void 0},set:function(e,t){return o(this,e,t)}}:{add:function(e){return o(this,e,!0)}}),d}}},{"../internals/an-instance":9,"../internals/an-object":10,"../internals/array-iteration":19,"../internals/has":61,"../internals/internal-metadata":70,"../internals/internal-state":71,"../internals/is-object":75,"../internals/iterate":78,"../internals/redefine-all":109}],32:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/global"),o=e("../internals/is-forced"),s=e("../internals/redefine"),a=e("../internals/internal-metadata"),l=e("../internals/iterate"),c=e("../internals/an-instance"),u=e("../internals/is-object"),h=e("../internals/fails"),d=e("../internals/check-correctness-of-iteration"),p=e("../internals/set-to-string-tag"),f=e("../internals/inherit-if-required");t.exports=function(e,t,r){function m(e){var t=T[e];s(T,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(w&&!u(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return w&&!u(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(w&&!u(e))&&t.call(this,0===e?0:e)}:function(e,r){return t.call(this,0===e?0:e,r),this})}var y,g,v,b,_,x=-1!==e.indexOf("Map"),w=-1!==e.indexOf("Weak"),S=x?"set":"add",M=i[e],T=M&&M.prototype,E=M,j={};return o(e,"function"!=typeof M||!(w||T.forEach&&!h((function(){(new M).entries().next()}))))?(E=r.getConstructor(t,e,x,S),a.REQUIRED=!0):o(e,!0)&&(g=(y=new E)[S](w?{}:-0,1)!=y,v=h((function(){y.has(1)})),b=d((function(e){new M(e)})),_=!w&&h((function(){for(var e=new M,t=5;t--;)e[S](t,t);return!e.has(-0)})),b||(((E=t((function(t,r){return c(t,E,e),t=f(new M,t,E),null!=r&&l(r,t[S],t,x),t}))).prototype=T).constructor=E),(v||_)&&(m("delete"),m("has"),x&&m("get")),(_||g)&&m(S),w&&T.clear&&delete T.clear),j[e]=E,n({global:!0,forced:E!=M},j),p(E,e),w||r.setStrong(E,e,x),E}},{"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/export":50,"../internals/fails":51,"../internals/global":60,"../internals/inherit-if-required":68,"../internals/internal-metadata":70,"../internals/is-forced":74,"../internals/is-object":75,"../internals/iterate":78,"../internals/redefine":110,"../internals/set-to-string-tag":119}],33:[function(e,t,r){var n=e("../internals/has"),i=e("../internals/own-keys"),o=e("../internals/object-get-own-property-descriptor"),s=e("../internals/object-define-property");t.exports=function(e,t){for(var r=i(t),a=s.f,l=o.f,c=0;c<r.length;c++){var u=r[c];n(e,u)||a(e,u,l(t,u))}}},{"../internals/has":61,"../internals/object-define-property":93,"../internals/object-get-own-property-descriptor":94,"../internals/own-keys":105}],34:[function(e,t,r){var n=e("../internals/well-known-symbol")("match");t.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},{"../internals/well-known-symbol":150}],35:[function(e,t,r){e=e("../internals/fails"),t.exports=!e((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},{"../internals/fails":51}],36:[function(e,t,r){var n=e("../internals/require-object-coercible"),i=/"/g;t.exports=function(e,t,r,o){e=String(n(e));var s="<"+t;return""!==r&&(s+=" "+r+'="'+String(o).replace(i,"&quot;")+'"'),s+">"+e+"</"+t+">"}},{"../internals/require-object-coercible":115}],37:[function(e,t,r){"use strict";function n(){return this}var i=e("../internals/iterators-core").IteratorPrototype,o=e("../internals/object-create"),s=e("../internals/create-property-descriptor"),a=e("../internals/set-to-string-tag"),l=e("../internals/iterators");t.exports=function(e,t,r){return t+=" Iterator",e.prototype=o(i,{next:s(1,r)}),a(e,t,!1,!0),l[t]=n,e}},{"../internals/create-property-descriptor":39,"../internals/iterators":80,"../internals/iterators-core":79,"../internals/object-create":91,"../internals/set-to-string-tag":119}],38:[function(e,t,r){var n=e("../internals/descriptors"),i=e("../internals/object-define-property"),o=e("../internals/create-property-descriptor");t.exports=n?function(e,t,r){return i.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/object-define-property":93}],39:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],40:[function(e,t,r){"use strict";var n=e("../internals/to-primitive"),i=e("../internals/object-define-property"),o=e("../internals/create-property-descriptor");t.exports=function(e,t,r){(t=n(t))in e?i.f(e,t,o(0,r)):e[t]=r}},{"../internals/create-property-descriptor":39,"../internals/object-define-property":93,"../internals/to-primitive":142}],41:[function(e,t,r){"use strict";function n(){return this}var i=e("../internals/export"),o=e("../internals/create-iterator-constructor"),s=e("../internals/object-get-prototype-of"),a=e("../internals/object-set-prototype-of"),l=e("../internals/set-to-string-tag"),c=e("../internals/create-non-enumerable-property"),u=e("../internals/redefine"),h=e("../internals/well-known-symbol"),d=e("../internals/is-pure"),p=e("../internals/iterators"),f=(e=e("../internals/iterators-core")).IteratorPrototype,m=e.BUGGY_SAFARI_ITERATORS,y=h("iterator"),g="values",v="entries";t.exports=function(e,t,r,h,b,_,x){function w(e){if(e===b&&A)return A;if(!m&&e in E)return E[e];switch(e){case"keys":case g:case v:return function(){return new r(this,e)}}return function(){return new r(this)}}o(r,t,h),h=t+" Iterator";var S,M,T=!1,E=e.prototype,j=E[y]||E["@@iterator"]||b&&E[b],A=!m&&j||w(b),L="Array"==t&&E.entries||j;if(L&&(L=s(L.call(new e)),f!==Object.prototype&&L.next&&(d||s(L)===f||(a?a(L,f):"function"!=typeof L[y]&&c(L,y,n)),l(L,h,!0,!0),d&&(p[h]=n))),b==g&&j&&j.name!==g&&(T=!0,A=function(){return j.call(this)}),d&&!x||E[y]===A||c(E,y,A),p[t]=A,b)if(S={values:w(g),keys:_?A:w("keys"),entries:w(v)},x)for(M in S)!m&&!T&&M in E||u(E,M,S[M]);else i({target:t,proto:!0,forced:m||T},S);return S}},{"../internals/create-iterator-constructor":37,"../internals/create-non-enumerable-property":38,"../internals/export":50,"../internals/is-pure":76,"../internals/iterators":80,"../internals/iterators-core":79,"../internals/object-get-prototype-of":98,"../internals/object-set-prototype-of":102,"../internals/redefine":110,"../internals/set-to-string-tag":119,"../internals/well-known-symbol":150}],42:[function(e,t,r){var n=e("../internals/path"),i=e("../internals/has"),o=e("../internals/well-known-symbol-wrapped"),s=e("../internals/object-define-property").f;t.exports=function(e){var t=n.Symbol||(n.Symbol={});i(t,e)||s(t,e,{value:o.f(e)})}},{"../internals/has":61,"../internals/object-define-property":93,"../internals/path":106,"../internals/well-known-symbol-wrapped":149}],43:[function(e,t,r){e=e("../internals/fails"),t.exports=!e((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},{"../internals/fails":51}],44:[function(e,t,r){var n=e("../internals/global"),i=(e=e("../internals/is-object"),n.document),o=e(i)&&e(i.createElement);t.exports=function(e){return o?i.createElement(e):{}}},{"../internals/global":60,"../internals/is-object":75}],45:[function(e,t,r){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},{}],46:[function(e,t,r){e=e("../internals/engine-user-agent"),t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(e)},{"../internals/engine-user-agent":47}],47:[function(e,t,r){e=e("../internals/get-built-in"),t.exports=e("navigator","userAgent")||""},{"../internals/get-built-in":57}],48:[function(e,t,r){var n,i,o=e("../internals/global");e=e("../internals/engine-user-agent"),(o=(o=(o=o.process)&&o.versions)&&o.v8)?i=(n=o.split("."))[0]+n[1]:e&&(!(n=e.match(/Edge\/(\d+)/))||74<=n[1])&&(n=e.match(/Chrome\/(\d+)/))&&(i=n[1]),t.exports=i&&+i},{"../internals/engine-user-agent":47,"../internals/global":60}],49:[function(e,t,r){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],50:[function(e,t,r){var n=e("../internals/global"),i=e("../internals/object-get-own-property-descriptor").f,o=e("../internals/create-non-enumerable-property"),s=e("../internals/redefine"),a=e("../internals/set-global"),l=e("../internals/copy-constructor-properties"),c=e("../internals/is-forced");t.exports=function(e,t){var r,u,h,d=e.target,p=e.global,f=e.stat,m=p?n:f?n[d]||a(d,{}):(n[d]||{}).prototype;if(m)for(r in t){if(u=t[r],h=e.noTargetGet?(h=i(m,r))&&h.value:m[r],!c(p?r:d+(f?".":"#")+r,e.forced)&&void 0!==h){if(typeof u==typeof h)continue;l(u,h)}(e.sham||h&&h.sham)&&o(u,"sham",!0),s(m,r,u,e)}}},{"../internals/copy-constructor-properties":33,"../internals/create-non-enumerable-property":38,"../internals/global":60,"../internals/is-forced":74,"../internals/object-get-own-property-descriptor":94,"../internals/redefine":110,"../internals/set-global":117}],51:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],52:[function(e,t,r){"use strict";e("../modules/es.regexp.exec");var n=e("../internals/redefine"),i=e("../internals/fails"),o=e("../internals/well-known-symbol"),s=e("../internals/regexp-exec"),a=e("../internals/create-non-enumerable-property"),l=o("species"),c=!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),u="$0"==="a".replace(/./,"$0"),h=!!/./[e=o("replace")]&&""===/./[e]("a","$0"),d=!i((function(){var e=(t=/(?:)/).exec,t=(t.exec=function(){return e.apply(this,arguments)},"ab".split(t));return 2!==t.length||"a"!==t[0]||"b"!==t[1]}));t.exports=function(e,t,r,p){var f,m,y=o(e),g=!i((function(){var t={};return t[y]=function(){return 7},7!=""[e](t)})),v=g&&!i((function(){var t=!1,r=/a/;return"split"===e&&((r={constructor:{}}).constructor[l]=function(){return r},r.flags="",r[y]=/./[y]),r.exec=function(){return t=!0,null},r[y](""),!t}));g&&v&&("replace"!==e||c&&u&&!h)&&("split"!==e||d)||(f=/./[y],r=(v=r(y,""[e],(function(e,t,r,n,i){return t.exec===s?g&&!i?{done:!0,value:f.call(t,r,n)}:{done:!0,value:e.call(r,t,n)}:{done:!1}}),{REPLACE_KEEPS_$0:u,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:h}))[0],m=v[1],n(String.prototype,e,r),n(RegExp.prototype,y,2==t?function(e,t){return m.call(e,this,t)}:function(e){return m.call(e,this)})),p&&a(RegExp.prototype[y],"sham",!0)}},{"../internals/create-non-enumerable-property":38,"../internals/fails":51,"../internals/redefine":110,"../internals/regexp-exec":112,"../internals/well-known-symbol":150,"../modules/es.regexp.exec":195}],53:[function(e,t,r){"use strict";var n=e("../internals/is-array"),i=e("../internals/to-length"),o=e("../internals/function-bind-context");t.exports=function e(t,r,s,a,l,c,u,h){for(var d,p=l,f=0,m=!!u&&o(u,h,3);f<a;){if(f in s){if(d=m?m(s[f],f,r):s[f],0<c&&n(d))p=e(t,r,d,i(d.length),p,c-1)-1;else{if(9007199254740991<=p)throw TypeError("Exceed the acceptable array length");t[p]=d}p++}f++}return p}},{"../internals/function-bind-context":55,"../internals/is-array":73,"../internals/to-length":138}],54:[function(e,t,r){e=e("../internals/fails"),t.exports=!e((function(){return Object.isExtensible(Object.preventExtensions({}))}))},{"../internals/fails":51}],55:[function(e,t,r){var n=e("../internals/a-function");t.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},{"../internals/a-function":5}],56:[function(e,t,r){"use strict";var n=e("../internals/a-function"),i=e("../internals/is-object"),o=[].slice,s={};t.exports=Function.bind||function(e){var t=n(this),r=o.call(arguments,1),a=function(){var n=r.concat(o.call(arguments));if(this instanceof a){var i=t,l=n.length,c=n;if(!(l in s)){for(var u=[],h=0;h<l;h++)u[h]="a["+h+"]";s[l]=Function("C,a","return new C("+u.join(",")+")")}return s[l](i,c)}return t.apply(e,n)};return i(t.prototype)&&(a.prototype=t.prototype),a}},{"../internals/a-function":5,"../internals/is-object":75}],57:[function(e,t,r){function n(e){return"function"==typeof e?e:void 0}var i=e("../internals/path"),o=e("../internals/global");t.exports=function(e,t){return arguments.length<2?n(i[e])||n(o[e]):i[e]&&i[e][t]||o[e]&&o[e][t]}},{"../internals/global":60,"../internals/path":106}],58:[function(e,t,r){var n=e("../internals/classof"),i=e("../internals/iterators"),o=e("../internals/well-known-symbol")("iterator");t.exports=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[n(e)]}},{"../internals/classof":29,"../internals/iterators":80,"../internals/well-known-symbol":150}],59:[function(e,t,r){var n=e("../internals/an-object"),i=e("../internals/get-iterator-method");t.exports=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return n(t.call(e))}},{"../internals/an-object":10,"../internals/get-iterator-method":58}],60:[function(e,t,r){(function(e){function r(e){return e&&e.Math==Math&&e}t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||Function("return this")()}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],61:[function(e,t,r){var n={}.hasOwnProperty;t.exports=function(e,t){return n.call(e,t)}},{}],62:[function(e,t,r){t.exports={}},{}],63:[function(e,t,r){var n=e("../internals/global");t.exports=function(e,t){var r=n.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}},{"../internals/global":60}],64:[function(e,t,r){e=e("../internals/get-built-in"),t.exports=e("document","documentElement")},{"../internals/get-built-in":57}],65:[function(e,t,r){var n=e("../internals/descriptors"),i=e("../internals/fails"),o=e("../internals/document-create-element");t.exports=!n&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},{"../internals/descriptors":43,"../internals/document-create-element":44,"../internals/fails":51}],66:[function(e,t,r){var n=Math.abs,i=Math.pow,o=Math.floor,s=Math.log,a=Math.LN2;t.exports={pack:function(e,t,r){var l,c,u,h=new Array(r),d=8*r-t-1,p=(r=(1<<d)-1)>>1,f=23===t?i(2,-24)-i(2,-77):0,m=e<0||0===e&&1/e<0?1:0,y=0;for((e=n(e))!=e||e===1/0?(c=e!=e?1:0,l=r):(l=o(s(e)/a),e*(u=i(2,-l))<1&&(l--,u*=2),2<=(e+=1<=l+p?f/u:f*i(2,1-p))*u&&(l++,u/=2),r<=l+p?(c=0,l=r):1<=l+p?(c=(e*u-1)*i(2,t),l+=p):(c=e*i(2,p-1)*i(2,t),l=0));8<=t;h[y++]=255&c,c/=256,t-=8);for(l=l<<t|c,d+=t;0<d;h[y++]=255&l,l/=256,d-=8);return h[--y]|=128*m,h},unpack:function(e,t){var r,n,o=e.length,s=(1<<(n=8*o-t-1))-1,a=s>>1,l=n-7,c=o-1,u=127&(n=e[c--]);for(n>>=7;0<l;u=256*u+e[c],c--,l-=8);for(r=u&(1<<-l)-1,u>>=-l,l+=t;0<l;r=256*r+e[c],c--,l-=8);if(0===u)u=1-a;else{if(u===s)return r?NaN:n?-1/0:1/0;r+=i(2,t),u-=a}return(n?-1:1)*r*i(2,u-t)}}},{}],67:[function(e,t,r){var n=e("../internals/fails"),i=e("../internals/classof-raw"),o="".split;t.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?o.call(e,""):Object(e)}:Object},{"../internals/classof-raw":28,"../internals/fails":51}],68:[function(e,t,r){var n=e("../internals/is-object"),i=e("../internals/object-set-prototype-of");t.exports=function(e,t,r){return i&&"function"==typeof(t=t.constructor)&&t!==r&&n(t=t.prototype)&&t!==r.prototype&&i(e,t),e}},{"../internals/is-object":75,"../internals/object-set-prototype-of":102}],69:[function(e,t,r){e=e("../internals/shared-store");var n=Function.toString;"function"!=typeof e.inspectSource&&(e.inspectSource=function(e){return n.call(e)}),t.exports=e.inspectSource},{"../internals/shared-store":121}],70:[function(e,t,r){function n(e){a(e,u,{value:{objectID:"O"+ ++h,weakData:{}}})}var i=e("../internals/hidden-keys"),o=e("../internals/is-object"),s=e("../internals/has"),a=e("../internals/object-define-property").f,l=e("../internals/uid"),c=e("../internals/freezing"),u=l("meta"),h=0,d=Object.isExtensible||function(){return!0},p=t.exports={REQUIRED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,u)){if(!d(e))return"F";if(!t)return"E";n(e)}return e[u].objectID},getWeakData:function(e,t){if(!s(e,u)){if(!d(e))return!0;if(!t)return!1;n(e)}return e[u].weakData},onFreeze:function(e){return c&&p.REQUIRED&&d(e)&&!s(e,u)&&n(e),e}};i[u]=!0},{"../internals/freezing":54,"../internals/has":61,"../internals/hidden-keys":62,"../internals/is-object":75,"../internals/object-define-property":93,"../internals/uid":147}],71:[function(e,t,r){var n,i,o,s,a,l,c,u,h=e("../internals/native-weak-map"),d=e("../internals/global"),p=e("../internals/is-object"),f=e("../internals/create-non-enumerable-property"),m=e("../internals/has"),y=e("../internals/shared-key");e=e("../internals/hidden-keys"),d=d.WeakMap,c=h?(n=new d,i=n.get,o=n.has,s=n.set,a=function(e,t){return s.call(n,e,t),t},l=function(e){return i.call(n,e)||{}},function(e){return o.call(n,e)}):(e[u=y("state")]=!0,a=function(e,t){return f(e,u,t),t},l=function(e){return m(e,u)?e[u]:{}},function(e){return m(e,u)}),t.exports={set:a,get:l,has:c,enforce:function(e){return c(e)?l(e):a(e,{})},getterFor:function(e){return function(t){if(p(t)&&(t=l(t)).type===e)return t;throw TypeError("Incompatible receiver, "+e+" required")}}}},{"../internals/create-non-enumerable-property":38,"../internals/global":60,"../internals/has":61,"../internals/hidden-keys":62,"../internals/is-object":75,"../internals/native-weak-map":86,"../internals/shared-key":120}],72:[function(e,t,r){var n=e("../internals/well-known-symbol"),i=e("../internals/iterators"),o=n("iterator"),s=Array.prototype;t.exports=function(e){return void 0!==e&&(i.Array===e||s[o]===e)}},{"../internals/iterators":80,"../internals/well-known-symbol":150}],73:[function(e,t,r){var n=e("../internals/classof-raw");t.exports=Array.isArray||function(e){return"Array"==n(e)}},{"../internals/classof-raw":28}],74:[function(e,t,r){function n(e,t){return(e=a[s(e)])==c||e!=l&&("function"==typeof t?i(t):!!t)}var i=e("../internals/fails"),o=/#|\.prototype\./,s=n.normalize=function(e){return String(e).replace(o,".").toLowerCase()},a=n.data={},l=n.NATIVE="N",c=n.POLYFILL="P";t.exports=n},{"../internals/fails":51}],75:[function(e,t,r){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],76:[function(e,t,r){t.exports=!1},{}],77:[function(e,t,r){var n=e("../internals/is-object"),i=e("../internals/classof-raw"),o=e("../internals/well-known-symbol")("match");t.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},{"../internals/classof-raw":28,"../internals/is-object":75,"../internals/well-known-symbol":150}],78:[function(e,t,r){function n(e,t){this.stopped=e,this.result=t}var i=e("../internals/an-object"),o=e("../internals/is-array-iterator-method"),s=e("../internals/to-length"),a=e("../internals/function-bind-context"),l=e("../internals/get-iterator-method"),c=e("../internals/call-with-safe-iteration-closing");(t.exports=function(e,t,r,u,h){var d,p,f,m,y,g,v=a(t,r,u?2:1);if(h)d=e;else{if("function"!=typeof(t=l(e)))throw TypeError("Target is not iterable");if(o(t)){for(p=0,f=s(e.length);p<f;p++)if((m=u?v(i(g=e[p])[0],g[1]):v(e[p]))&&m instanceof n)return m;return new n(!1)}d=t.call(e)}for(y=d.next;!(g=y.call(d)).done;)if("object"==typeof(m=c(d,v,g.value,u))&&m&&m instanceof n)return m;return new n(!1)}).stop=function(e){return new n(!0,e)}},{"../internals/an-object":10,"../internals/call-with-safe-iteration-closing":26,"../internals/function-bind-context":55,"../internals/get-iterator-method":58,"../internals/is-array-iterator-method":72,"../internals/to-length":138}],79:[function(e,t,r){"use strict";var n,i,o=e("../internals/object-get-prototype-of"),s=e("../internals/create-non-enumerable-property"),a=e("../internals/has"),l=e("../internals/well-known-symbol"),c=(e=e("../internals/is-pure"),l=l("iterator"),!1);[].keys&&("next"in(i=[].keys())?(o=o(o(i)))!==Object.prototype&&(n=o):c=!0),null==n&&(n={}),e||a(n,l)||s(n,l,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:c}},{"../internals/create-non-enumerable-property":38,"../internals/has":61,"../internals/is-pure":76,"../internals/object-get-prototype-of":98,"../internals/well-known-symbol":150}],80:[function(e,t,r){t.exports={}},{}],81:[function(e,t,r){t.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},{}],82:[function(e,t,r){var n,i,o,s,a,l,c,u,h=e("../internals/global"),d=e("../internals/object-get-own-property-descriptor").f,p=e("../internals/classof-raw"),f=e("../internals/task").set,m=(e=e("../internals/engine-is-ios"),h.MutationObserver||h.WebKitMutationObserver),y=h.process,g=h.Promise,v="process"==p(y);p=d(h,"queueMicrotask"),(d=p&&p.value)||(n=function(){var e,t;for(v&&(e=y.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(e){throw i?s():o=void 0,e}}o=void 0,e&&e.enter()},s=v?function(){y.nextTick(n)}:m&&!e?(a=!0,l=document.createTextNode(""),new m(n).observe(l,{characterData:!0}),function(){l.data=a=!a}):g&&g.resolve?(c=g.resolve(void 0),u=c.then,function(){u.call(c,n)}):function(){f.call(h,n)}),t.exports=d||function(e){e={fn:e,next:void 0},o&&(o.next=e),i||(i=e,s()),o=e}},{"../internals/classof-raw":28,"../internals/engine-is-ios":46,"../internals/global":60,"../internals/object-get-own-property-descriptor":94,"../internals/task":132}],83:[function(e,t,r){e=e("../internals/global"),t.exports=e.Promise},{"../internals/global":60}],84:[function(e,t,r){e=e("../internals/fails"),t.exports=!!Object.getOwnPropertySymbols&&!e((function(){return!String(Symbol())}))},{"../internals/fails":51}],85:[function(e,t,r){var n=e("../internals/fails"),i=e("../internals/well-known-symbol"),o=e("../internals/is-pure"),s=i("iterator");t.exports=!n((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),o&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host}))},{"../internals/fails":51,"../internals/is-pure":76,"../internals/well-known-symbol":150}],86:[function(e,t,r){var n=e("../internals/global");e=e("../internals/inspect-source"),n=n.WeakMap,t.exports="function"==typeof n&&/native code/.test(e(n))},{"../internals/global":60,"../internals/inspect-source":69}],87:[function(e,t,r){"use strict";function n(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=i(t),this.reject=i(r)}var i=e("../internals/a-function");t.exports.f=function(e){return new n(e)}},{"../internals/a-function":5}],88:[function(e,t,r){var n=e("../internals/is-regexp");t.exports=function(e){if(n(e))throw TypeError("The method doesn't accept regular expressions");return e}},{"../internals/is-regexp":77}],89:[function(e,t,r){var n=e("../internals/global").isFinite;t.exports=Number.isFinite||function(e){return"number"==typeof e&&n(e)}},{"../internals/global":60}],90:[function(e,t,r){"use strict";var n=e("../internals/descriptors"),i=e("../internals/fails"),o=e("../internals/object-keys"),s=e("../internals/object-get-own-property-symbols"),a=e("../internals/object-property-is-enumerable"),l=e("../internals/to-object"),c=e("../internals/indexed-object"),u=Object.assign,h=Object.defineProperty;t.exports=!u||i((function(){var e,t,r,i;return!(!n||1===u({b:1},u(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)||(t={},i="abcdefghijklmnopqrst",(e={})[r=Symbol()]=7,i.split("").forEach((function(e){t[e]=e})),7!=u({},e)[r]||o(u({},t)).join("")!=i)}))?function(e,t){for(var r=l(e),i=arguments.length,u=1,h=s.f,d=a.f;u<i;)for(var p,f=c(arguments[u++]),m=h?o(f).concat(h(f)):o(f),y=m.length,g=0;g<y;)p=m[g++],n&&!d.call(f,p)||(r[p]=f[p]);return r}:u},{"../internals/descriptors":43,"../internals/fails":51,"../internals/indexed-object":67,"../internals/object-get-own-property-symbols":97,"../internals/object-keys":100,"../internals/object-property-is-enumerable":101,"../internals/to-object":139}],91:[function(e,t,r){function n(){}var i,o=e("../internals/an-object"),s=e("../internals/object-define-properties"),a=e("../internals/enum-bug-keys"),l=e("../internals/hidden-keys"),c=e("../internals/html"),u=e("../internals/document-create-element"),h=(e=e("../internals/shared-key"),"prototype"),d="script",p=e("IE_PROTO"),f=function(e){return"<"+d+">"+e+"</"+d+">"},m=function(){try{i=document.domain&&new ActiveXObject("htmlfile")}catch(e){}m=i?((e=i).write(f("")),e.close(),t=e.parentWindow.Object,e=null,t):(e=u("iframe"),t="java"+d+":",e.style.display="none",c.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(f("document.F=Object")),t.close(),t.F);for(var e,t,r=a.length;r--;)delete m[h][a[r]];return m()};l[p]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(n[h]=o(e),r=new n,n[h]=null,r[p]=e):r=m(),void 0===t?r:s(r,t)}},{"../internals/an-object":10,"../internals/document-create-element":44,"../internals/enum-bug-keys":49,"../internals/hidden-keys":62,"../internals/html":64,"../internals/object-define-properties":92,"../internals/shared-key":120}],92:[function(e,t,r){var n=e("../internals/descriptors"),i=e("../internals/object-define-property"),o=e("../internals/an-object"),s=e("../internals/object-keys");t.exports=n?Object.defineProperties:function(e,t){o(e);for(var r,n=s(t),a=n.length,l=0;l<a;)i.f(e,r=n[l++],t[r]);return e}},{"../internals/an-object":10,"../internals/descriptors":43,"../internals/object-define-property":93,"../internals/object-keys":100}],93:[function(e,t,r){var n=e("../internals/descriptors"),i=e("../internals/ie8-dom-define"),o=e("../internals/an-object"),s=e("../internals/to-primitive"),a=Object.defineProperty;r.f=n?a:function(e,t,r){if(o(e),t=s(t,!0),o(r),i)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},{"../internals/an-object":10,"../internals/descriptors":43,"../internals/ie8-dom-define":65,"../internals/to-primitive":142}],94:[function(e,t,r){var n=e("../internals/descriptors"),i=e("../internals/object-property-is-enumerable"),o=e("../internals/create-property-descriptor"),s=e("../internals/to-indexed-object"),a=e("../internals/to-primitive"),l=e("../internals/has"),c=e("../internals/ie8-dom-define"),u=Object.getOwnPropertyDescriptor;r.f=n?u:function(e,t){if(e=s(e),t=a(t,!0),c)try{return u(e,t)}catch(e){}if(l(e,t))return o(!i.f.call(e,t),e[t])}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/has":61,"../internals/ie8-dom-define":65,"../internals/object-property-is-enumerable":101,"../internals/to-indexed-object":136,"../internals/to-primitive":142}],95:[function(e,t,r){var n=e("../internals/to-indexed-object"),i=e("../internals/object-get-own-property-names").f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(e){if(!s||"[object Window]"!=o.call(e))return i(n(e));try{return i(e)}catch(e){return s.slice()}}},{"../internals/object-get-own-property-names":96,"../internals/to-indexed-object":136}],96:[function(e,t,r){var n=e("../internals/object-keys-internal"),i=e("../internals/enum-bug-keys").concat("length","prototype");r.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},{"../internals/enum-bug-keys":49,"../internals/object-keys-internal":99}],97:[function(e,t,r){r.f=Object.getOwnPropertySymbols},{}],98:[function(e,t,r){var n=e("../internals/has"),i=e("../internals/to-object"),o=e("../internals/shared-key"),s=(e=e("../internals/correct-prototype-getter"),o("IE_PROTO")),a=Object.prototype;t.exports=e?Object.getPrototypeOf:function(e){return e=i(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},{"../internals/correct-prototype-getter":35,"../internals/has":61,"../internals/shared-key":120,"../internals/to-object":139}],99:[function(e,t,r){var n=e("../internals/has"),i=e("../internals/to-indexed-object"),o=e("../internals/array-includes").indexOf,s=e("../internals/hidden-keys");t.exports=function(e,t){var r,a=i(e),l=0,c=[];for(r in a)!n(s,r)&&n(a,r)&&c.push(r);for(;t.length>l;)!n(a,r=t[l++])||~o(c,r)||c.push(r);return c}},{"../internals/array-includes":18,"../internals/has":61,"../internals/hidden-keys":62,"../internals/to-indexed-object":136}],100:[function(e,t,r){var n=e("../internals/object-keys-internal"),i=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return n(e,i)}},{"../internals/enum-bug-keys":49,"../internals/object-keys-internal":99}],101:[function(e,t,r){"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!n.call({1:2},1);r.f=o?function(e){return!!(e=i(this,e))&&e.enumerable}:n},{}],102:[function(e,t,r){var n=e("../internals/an-object"),i=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(r){}return function(r,o){return n(r),i(o),t?e.call(r,o):r.__proto__=o,r}}():void 0)},{"../internals/a-possible-prototype":6,"../internals/an-object":10}],103:[function(e,t,r){function n(e){return function(t){for(var r,n=s(t),l=o(n),c=l.length,u=0,h=[];u<c;)r=l[u++],i&&!a.call(n,r)||h.push(e?[r,n[r]]:n[r]);return h}}var i=e("../internals/descriptors"),o=e("../internals/object-keys"),s=e("../internals/to-indexed-object"),a=e("../internals/object-property-is-enumerable").f;t.exports={entries:n(!0),values:n(!1)}},{"../internals/descriptors":43,"../internals/object-keys":100,"../internals/object-property-is-enumerable":101,"../internals/to-indexed-object":136}],104:[function(e,t,r){"use strict";var n=e("../internals/to-string-tag-support"),i=e("../internals/classof");t.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},{"../internals/classof":29,"../internals/to-string-tag-support":143}],105:[function(e,t,r){var n=e("../internals/get-built-in"),i=e("../internals/object-get-own-property-names"),o=e("../internals/object-get-own-property-symbols"),s=e("../internals/an-object");t.exports=n("Reflect","ownKeys")||function(e){var t=i.f(s(e)),r=o.f;return r?t.concat(r(e)):t}},{"../internals/an-object":10,"../internals/get-built-in":57,"../internals/object-get-own-property-names":96,"../internals/object-get-own-property-symbols":97}],106:[function(e,t,r){e=e("../internals/global"),t.exports=e},{"../internals/global":60}],107:[function(e,t,r){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},{}],108:[function(e,t,r){var n=e("../internals/an-object"),i=e("../internals/is-object"),o=e("../internals/new-promise-capability");t.exports=function(e,t){return n(e),i(t)&&t.constructor===e?t:((0,(e=o.f(e)).resolve)(t),e.promise)}},{"../internals/an-object":10,"../internals/is-object":75,"../internals/new-promise-capability":87}],109:[function(e,t,r){var n=e("../internals/redefine");t.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},{"../internals/redefine":110}],110:[function(e,t,r){var n=e("../internals/global"),i=e("../internals/create-non-enumerable-property"),o=e("../internals/has"),s=e("../internals/set-global"),a=e("../internals/inspect-source"),l=(e=e("../internals/internal-state")).get,c=e.enforce,u=String(String).split("String");(t.exports=function(e,t,r,a){var l=!!a&&!!a.unsafe,h=!!a&&!!a.enumerable;a=!!a&&!!a.noTargetGet,"function"==typeof r&&("string"!=typeof t||o(r,"name")||i(r,"name",t),c(r).source=u.join("string"==typeof t?t:"")),e===n?h?e[t]=r:s(t,r):(l?!a&&e[t]&&(h=!0):delete e[t],h?e[t]=r:i(e,t,r))})(Function.prototype,"toString",(function(){return"function"==typeof this&&l(this).source||a(this)}))},{"../internals/create-non-enumerable-property":38,"../internals/global":60,"../internals/has":61,"../internals/inspect-source":69,"../internals/internal-state":71,"../internals/set-global":117}],111:[function(e,t,r){var n=e("./classof-raw"),i=e("./regexp-exec");t.exports=function(e,t){var r=e.exec;if("function"==typeof r){if("object"!=typeof(r=r.call(e,t)))throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==n(e))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},{"./classof-raw":28,"./regexp-exec":112}],112:[function(e,t,r){"use strict";var n,i,o=e("./regexp-flags"),s=(e=e("./regexp-sticky-helpers"),RegExp.prototype.exec),a=String.prototype.replace,l=s,c=(n=/a/,i=/b*/g,s.call(n,"a"),s.call(i,"a"),0!==n.lastIndex||0!==i.lastIndex),u=e.UNSUPPORTED_Y||e.BROKEN_CARET,h=void 0!==/()??/.exec("")[1];t.exports=l=c||h||u?function(e){var t,r,n,i,l=this,d=u&&l.sticky,p=o.call(l),f=l.source,m=0,y=e;return d&&(-1===(p=p.replace("y","")).indexOf("g")&&(p+="g"),y=String(e).slice(l.lastIndex),0<l.lastIndex&&(!l.multiline||l.multiline&&"\n"!==e[l.lastIndex-1])&&(f="(?: "+f+")",y=" "+y,m++),r=new RegExp("^(?:"+f+")",p)),h&&(r=new RegExp("^"+f+"$(?!\\s)",p)),c&&(t=l.lastIndex),n=s.call(d?r:l,y),d?n?(n.input=n.input.slice(m),n[0]=n[0].slice(m),n.index=l.lastIndex,l.lastIndex+=n[0].length):l.lastIndex=0:c&&n&&(l.lastIndex=l.global?n.index+n[0].length:t),h&&n&&1<n.length&&a.call(n[0],r,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(n[i]=void 0)})),n}:l},{"./regexp-flags":113,"./regexp-sticky-helpers":114}],113:[function(e,t,r){"use strict";var n=e("../internals/an-object");t.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},{"../internals/an-object":10}],114:[function(e,t,r){"use strict";function n(e,t){return RegExp(e,t)}e=e("./fails"),r.UNSUPPORTED_Y=e((function(){var e=n("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),r.BROKEN_CARET=e((function(){var e=n("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},{"./fails":51}],115:[function(e,t,r){t.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},{}],116:[function(e,t,r){t.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},{}],117:[function(e,t,r){var n=e("../internals/global"),i=e("../internals/create-non-enumerable-property");t.exports=function(e,t){try{i(n,e,t)}catch(r){n[e]=t}return t}},{"../internals/create-non-enumerable-property":38,"../internals/global":60}],118:[function(e,t,r){"use strict";var n=e("../internals/get-built-in"),i=e("../internals/object-define-property"),o=e("../internals/well-known-symbol"),s=e("../internals/descriptors"),a=o("species");t.exports=function(e){e=n(e);var t=i.f;s&&e&&!e[a]&&t(e,a,{configurable:!0,get:function(){return this}})}},{"../internals/descriptors":43,"../internals/get-built-in":57,"../internals/object-define-property":93,"../internals/well-known-symbol":150}],119:[function(e,t,r){var n=e("../internals/object-define-property").f,i=e("../internals/has"),o=e("../internals/well-known-symbol")("toStringTag");t.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},{"../internals/has":61,"../internals/object-define-property":93,"../internals/well-known-symbol":150}],120:[function(e,t,r){var n=e("../internals/shared"),i=e("../internals/uid"),o=n("keys");t.exports=function(e){return o[e]||(o[e]=i(e))}},{"../internals/shared":122,"../internals/uid":147}],121:[function(e,t,r){var n=e("../internals/global"),i=(e=e("../internals/set-global"),"__core-js_shared__");n=n[i]||e(i,{}),t.exports=n},{"../internals/global":60,"../internals/set-global":117}],122:[function(e,t,r){var n=e("../internals/is-pure"),i=e("../internals/shared-store");(t.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:n?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},{"../internals/is-pure":76,"../internals/shared-store":121}],123:[function(e,t,r){var n=e("../internals/an-object"),i=e("../internals/a-function"),o=e("../internals/well-known-symbol")("species");t.exports=function(e,t){return void 0===(e=n(e).constructor)||null==(e=n(e)[o])?t:i(e)}},{"../internals/a-function":5,"../internals/an-object":10,"../internals/well-known-symbol":150}],124:[function(e,t,r){var n=e("../internals/fails");t.exports=function(e){return n((function(){var t=""[e]('"');return t!==t.toLowerCase()||3<t.split('"').length}))}},{"../internals/fails":51}],125:[function(e,t,r){function n(e){return function(t,r){t=String(o(t)),r=i(r);var n,s=t.length;return r<0||s<=r?e?"":void 0:(n=t.charCodeAt(r))<55296||56319<n||r+1===s||(s=t.charCodeAt(r+1))<56320||57343<s?e?t.charAt(r):n:e?t.slice(r,r+2):s-56320+(n-55296<<10)+65536}}var i=e("../internals/to-integer"),o=e("../internals/require-object-coercible");t.exports={codeAt:n(!1),charAt:n(!0)}},{"../internals/require-object-coercible":115,"../internals/to-integer":137}],126:[function(e,t,r){e=e("../internals/engine-user-agent"),t.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(e)},{"../internals/engine-user-agent":47}],127:[function(e,t,r){function n(e){return function(t,r,n){var l=(t=String(s(t))).length;return n=void 0===n?" ":String(n),(r=i(r))<=l||""==n?t:((l=o.call(n,a((r-=l)/n.length))).length>r&&(l=l.slice(0,r)),e?t+l:l+t)}}var i=e("../internals/to-length"),o=e("../internals/string-repeat"),s=e("../internals/require-object-coercible"),a=Math.ceil;t.exports={start:n(!1),end:n(!0)}},{"../internals/require-object-coercible":115,"../internals/string-repeat":129,"../internals/to-length":138}],128:[function(e,t,r){"use strict";function n(e){return e+22+75*(e<26)}function i(e){var t,r=[],i=(e=function(e){for(var t=[],r=0,n=e.length;r<n;){var i,o=e.charCodeAt(r++);55296<=o&&o<=56319&&r<n?56320==(64512&(i=e.charCodeAt(r++)))?t.push(((1023&o)<<10)+(1023&i)+65536):(t.push(o),r--):t.push(o)}return t}(e)).length,u=128,h=0,y=72;for(_=0;_<e.length;_++)(t=e[_])<128&&r.push(m(t));var g=r.length,v=g;for(g&&r.push("-");v<i;){for(var b=o,_=0;_<e.length;_++)u<=(t=e[_])&&t<b&&(b=t);var x=v+1;if(b-u>f((o-h)/x))throw RangeError(d);for(h+=(b-u)*x,u=b,_=0;_<e.length;_++){if((t=e[_])<u&&++h>o)throw RangeError(d);if(t==u){for(var w=h,S=s;;S+=s){var M=S<=y?1:y+a<=S?a:S-y;if(w<M)break;var T=w-M,E=s-M;r.push(m(n(M+T%E))),w=f(T/E)}r.push(m(n(w))),y=function(e,t,r){var n=0;for(e=r?f(e/c):e>>1,e+=f(e/t);p*a>>1<e;n+=s)e=f(e/p);return f(n+(p+1)*e/(e+l))}(h,x,v==g),h=0,++v}}++h,++u}return r.join("")}var o=2147483647,s=36,a=26,l=38,c=700,u=/[^\0-\u007E]/,h=/[.\u3002\uFF0E\uFF61]/g,d="Overflow: input needs wider integers to process",p=s-1,f=Math.floor,m=String.fromCharCode;t.exports=function(e){for(var t,r=[],n=e.toLowerCase().replace(h,".").split("."),o=0;o<n.length;o++)t=n[o],r.push(u.test(t)?"xn--"+i(t):t);return r.join(".")}},{}],129:[function(e,t,r){"use strict";var n=e("../internals/to-integer"),i=e("../internals/require-object-coercible");t.exports="".repeat||function(e){var t=String(i(this)),r="",o=n(e);if(o<0||o==1/0)throw RangeError("Wrong number of repetitions");for(;0<o;(o>>>=1)&&(t+=t))1&o&&(r+=t);return r}},{"../internals/require-object-coercible":115,"../internals/to-integer":137}],130:[function(e,t,r){var n=e("../internals/fails"),i=e("../internals/whitespaces");t.exports=function(e){return n((function(){return!!i[e]()||"​᠎"!="​᠎"[e]()||i[e].name!==e}))}},{"../internals/fails":51,"../internals/whitespaces":151}],131:[function(e,t,r){function n(e){return function(t){return t=String(i(t)),1&e&&(t=t.replace(o,"")),2&e?t.replace(s,""):t}}var i=e("../internals/require-object-coercible"),o=(e="["+e("../internals/whitespaces")+"]",RegExp("^"+e+e+"*")),s=RegExp(e+e+"*$");t.exports={start:n(1),end:n(2),trim:n(3)}},{"../internals/require-object-coercible":115,"../internals/whitespaces":151}],132:[function(e,t,r){function n(e){return function(){w(e)}}function i(e){w(e.data)}function o(e){a.postMessage(e+"",p.protocol+"//"+p.host)}var s,a=e("../internals/global"),l=e("../internals/fails"),c=e("../internals/classof-raw"),u=e("../internals/function-bind-context"),h=e("../internals/html"),d=e("../internals/document-create-element"),p=(e=e("../internals/engine-is-ios"),a.location),f=a.setImmediate,m=a.clearImmediate,y=a.process,g=a.MessageChannel,v=a.Dispatch,b=0,_={},x="onreadystatechange",w=function(e){var t;_.hasOwnProperty(e)&&(t=_[e],delete _[e],t())};f&&m||(f=function(e){for(var t=[],r=1;r<arguments.length;)t.push(arguments[r++]);return _[++b]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},s(b),b},m=function(e){delete _[e]},"process"==c(y)?s=function(e){y.nextTick(n(e))}:v&&v.now?s=function(e){v.now(n(e))}:g&&!e?(e=(c=new g).port2,c.port1.onmessage=i,s=u(e.postMessage,e,1)):!a.addEventListener||"function"!=typeof postMessage||a.importScripts||l(o)||"file:"===p.protocol?s=x in d("script")?function(e){h.appendChild(d("script"))[x]=function(){h.removeChild(this),w(e)}}:function(e){setTimeout(n(e),0)}:(s=o,a.addEventListener("message",i,!1))),t.exports={set:f,clear:m}},{"../internals/classof-raw":28,"../internals/document-create-element":44,"../internals/engine-is-ios":46,"../internals/fails":51,"../internals/function-bind-context":55,"../internals/global":60,"../internals/html":64}],133:[function(e,t,r){var n=e("../internals/classof-raw");t.exports=function(e){if("number"!=typeof e&&"Number"!=n(e))throw TypeError("Incorrect invocation");return+e}},{"../internals/classof-raw":28}],134:[function(e,t,r){var n=e("../internals/to-integer"),i=Math.max,o=Math.min;t.exports=function(e,t){return(e=n(e))<0?i(e+t,0):o(e,t)}},{"../internals/to-integer":137}],135:[function(e,t,r){var n=e("../internals/to-integer"),i=e("../internals/to-length");t.exports=function(e){if(void 0===e)return 0;e=n(e);var t=i(e);if(e!==t)throw RangeError("Wrong length or index");return t}},{"../internals/to-integer":137,"../internals/to-length":138}],136:[function(e,t,r){var n=e("../internals/indexed-object"),i=e("../internals/require-object-coercible");t.exports=function(e){return n(i(e))}},{"../internals/indexed-object":67,"../internals/require-object-coercible":115}],137:[function(e,t,r){var n=Math.ceil,i=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(0<e?i:n)(e)}},{}],138:[function(e,t,r){var n=e("../internals/to-integer"),i=Math.min;t.exports=function(e){return 0<e?i(n(e),9007199254740991):0}},{"../internals/to-integer":137}],139:[function(e,t,r){var n=e("../internals/require-object-coercible");t.exports=function(e){return Object(n(e))}},{"../internals/require-object-coercible":115}],140:[function(e,t,r){var n=e("../internals/to-positive-integer");t.exports=function(e,t){if((e=n(e))%t)throw RangeError("Wrong offset");return e}},{"../internals/to-positive-integer":141}],141:[function(e,t,r){var n=e("../internals/to-integer");t.exports=function(e){if((e=n(e))<0)throw RangeError("The argument can't be less than 0");return e}},{"../internals/to-integer":137}],142:[function(e,t,r){var n=e("../internals/is-object");t.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e))||"function"==typeof(r=e.valueOf)&&!n(i=r.call(e))||!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},{"../internals/is-object":75}],143:[function(e,t,r){var n={};n[e("../internals/well-known-symbol")("toStringTag")]="z",t.exports="[object z]"===String(n)},{"../internals/well-known-symbol":150}],144:[function(e,t,r){"use strict";function n(e,t){for(var r=0,n=t.length,i=new(X(e))(n);r<n;)i[r]=t[r++];return i}function i(e,t){N(e,t,{get:function(){return I(this)[t]}})}function o(e){return e instanceof z||"ArrayBuffer"==(e=S(e))||"SharedArrayBuffer"==e}function s(e,t){return Y(e)&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)}function a(e,t){return s(e,t=x(t,!0))?y(2,e[t]):F(e,t)}function l(e,t,r){return!(s(e,t=x(t,!0))&&M(r)&&w(r,"value"))||w(r,"get")||w(r,"set")||r.configurable||w(r,"writable")&&!r.writable||w(r,"enumerable")&&!r.enumerable?N(e,t,r):(e[t]=r.value,e)}var c=e("../internals/export"),u=e("../internals/global"),h=e("../internals/descriptors"),d=e("../internals/typed-array-constructors-require-wrappers"),p=e("../internals/array-buffer-view-core"),f=e("../internals/array-buffer"),m=e("../internals/an-instance"),y=e("../internals/create-property-descriptor"),g=e("../internals/create-non-enumerable-property"),v=e("../internals/to-length"),b=e("../internals/to-index"),_=e("../internals/to-offset"),x=e("../internals/to-primitive"),w=e("../internals/has"),S=e("../internals/classof"),M=e("../internals/is-object"),T=e("../internals/object-create"),E=e("../internals/object-set-prototype-of"),j=e("../internals/object-get-own-property-names").f,A=e("../internals/typed-array-from"),L=e("../internals/array-iteration").forEach,C=e("../internals/set-species"),P=e("../internals/object-define-property"),R=e("../internals/object-get-own-property-descriptor"),O=e("../internals/internal-state"),k=e("../internals/inherit-if-required"),I=O.get,D=O.set,N=P.f,F=R.f,U=Math.round,B=u.RangeError,z=f.ArrayBuffer,G=f.DataView,V=p.NATIVE_ARRAY_BUFFER_VIEWS,H=p.TYPED_ARRAY_TAG,W=p.TypedArray,q=p.TypedArrayPrototype,X=p.aTypedArrayConstructor,Y=p.isTypedArray,Z="BYTES_PER_ELEMENT",J="Wrong length";h?(V||(R.f=a,P.f=l,i(q,"buffer"),i(q,"byteOffset"),i(q,"byteLength"),i(q,"length")),c({target:"Object",stat:!0,forced:!V},{getOwnPropertyDescriptor:a,defineProperty:l}),t.exports=function(e,t,r){function i(e,t){N(e,t,{get:function(){var e=this,r=t;return(e=I(e)).view[l](r*s+e.byteOffset,!0)},set:function(e){var n=this,i=t;n=I(n),r&&(e=(e=U(e))<0?0:255<e?255:255&e),n.view[h](i*s+n.byteOffset,e,!0)},enumerable:!0})}var s=e.match(/\d+$/)[0]/8,a=e+(r?"Clamped":"")+"Array",l="get"+e,h="set"+e,p=u[a],f=p,y=(e=f&&f.prototype,{});V?d&&(f=t((function(e,t,r,i){return m(e,f,a),k(M(t)?o(t)?void 0!==i?new p(t,_(r,s),i):void 0!==r?new p(t,_(r,s)):new p(t):Y(t)?n(f,t):A.call(f,t):new p(b(t)),e,f)})),E&&E(f,W),L(j(p),(function(e){e in f||g(f,e,p[e])})),f.prototype=e):(f=t((function(e,t,r,l){m(e,f,a);var c,u,h=0,d=0;if(M(t)){if(!o(t))return Y(t)?n(f,t):A.call(f,t);var p=t;if(d=_(r,s),r=t.byteLength,void 0===l){if(r%s)throw B(J);if((c=r-d)<0)throw B(J)}else if(r<(c=v(l)*s)+d)throw B(J);u=c/s}else u=b(t),p=new z(c=u*s);for(D(e,{buffer:p,byteOffset:d,byteLength:c,length:u,view:new G(p)});h<u;)i(e,h++)})),E&&E(f,W),e=f.prototype=T(q)),e.constructor!==f&&g(e,"constructor",f),H&&g(e,H,a),y[a]=f,c({global:!0,forced:f!=p,sham:!V},y),Z in f||g(f,Z,s),Z in e||g(e,Z,s),C(a)}):t.exports=function(){}},{"../internals/an-instance":9,"../internals/array-buffer":13,"../internals/array-buffer-view-core":12,"../internals/array-iteration":19,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/export":50,"../internals/global":60,"../internals/has":61,"../internals/inherit-if-required":68,"../internals/internal-state":71,"../internals/is-object":75,"../internals/object-create":91,"../internals/object-define-property":93,"../internals/object-get-own-property-descriptor":94,"../internals/object-get-own-property-names":96,"../internals/object-set-prototype-of":102,"../internals/set-species":118,"../internals/to-index":135,"../internals/to-length":138,"../internals/to-offset":140,"../internals/to-primitive":142,"../internals/typed-array-constructors-require-wrappers":145,"../internals/typed-array-from":146}],145:[function(e,t,r){var n=e("../internals/global"),i=e("../internals/fails"),o=e("../internals/check-correctness-of-iteration"),s=(e=e("../internals/array-buffer-view-core").NATIVE_ARRAY_BUFFER_VIEWS,n.ArrayBuffer),a=n.Int8Array;t.exports=!e||!i((function(){a(1)}))||!i((function(){new a(-1)}))||!o((function(e){new a,new a(null),new a(1.5),new a(e)}),!0)||i((function(){return 1!==new a(new s(2),1,void 0).length}))},{"../internals/array-buffer-view-core":12,"../internals/check-correctness-of-iteration":27,"../internals/fails":51,"../internals/global":60}],146:[function(e,t,r){var n=e("../internals/to-object"),i=e("../internals/to-length"),o=e("../internals/get-iterator-method"),s=e("../internals/is-array-iterator-method"),a=e("../internals/function-bind-context"),l=e("../internals/array-buffer-view-core").aTypedArrayConstructor;t.exports=function(e){var t,r,c,u,h,d,p=n(e),f=arguments.length,m=1<f?arguments[1]:void 0,y=void 0!==m,g=o(p);if(null!=g&&!s(g))for(d=(h=g.call(p)).next,p=[];!(u=d.call(h)).done;)p.push(u.value);for(y&&2<f&&(m=a(m,arguments[2],2)),r=i(p.length),c=new(l(this))(r),t=0;t<r;t++)c[t]=y?m(p[t],t):p[t];return c}},{"../internals/array-buffer-view-core":12,"../internals/function-bind-context":55,"../internals/get-iterator-method":58,"../internals/is-array-iterator-method":72,"../internals/to-length":138,"../internals/to-object":139}],147:[function(e,t,r){var n=0,i=Math.random();t.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+i).toString(36)}},{}],148:[function(e,t,r){e=e("../internals/native-symbol"),t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/native-symbol":84}],149:[function(e,t,r){e=e("../internals/well-known-symbol"),r.f=e},{"../internals/well-known-symbol":150}],150:[function(e,t,r){var n=e("../internals/global"),i=e("../internals/shared"),o=e("../internals/has"),s=e("../internals/uid"),a=e("../internals/native-symbol"),l=(e=e("../internals/use-symbol-as-uid"),i("wks")),c=n.Symbol,u=e?c:c&&c.withoutSetter||s;t.exports=function(e){return o(l,e)||(a&&o(c,e)?l[e]=c[e]:l[e]=u("Symbol."+e)),l[e]}},{"../internals/global":60,"../internals/has":61,"../internals/native-symbol":84,"../internals/shared":122,"../internals/uid":147,"../internals/use-symbol-as-uid":148}],151:[function(e,t,r){t.exports="\t\n\v\f\r                　\u2028\u2029\ufeff"},{}],152:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/global"),o=e("../internals/array-buffer"),s=(e=e("../internals/set-species"),"ArrayBuffer");o=o[s],n({global:!0,forced:i[s]!==o},{ArrayBuffer:o}),e(s)},{"../internals/array-buffer":13,"../internals/export":50,"../internals/global":60,"../internals/set-species":118}],153:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/fails"),o=e("../internals/is-array"),s=e("../internals/is-object"),a=e("../internals/to-object"),l=e("../internals/to-length"),c=e("../internals/create-property"),u=e("../internals/array-species-create"),h=e("../internals/array-method-has-species-support"),d=e("../internals/well-known-symbol"),p=(e=e("../internals/engine-v8-version"),d("isConcatSpreadable")),f=9007199254740991,m="Maximum allowed index exceeded";d=51<=e||!i((function(){var e=[];return e[p]=!1,e.concat()[0]!==e})),e=h("concat"),n({target:"Array",proto:!0,forced:!d||!e},{concat:function(e){for(var t,r,n,i,h,d=a(this),y=u(d,0),g=0,v=-1,b=arguments.length;v<b;v++)if(h=void 0,s(i=n=-1===v?d:arguments[v])&&(void 0!==(h=i[p])?h:o(i))){if(r=l(n.length),f<g+r)throw TypeError(m);for(t=0;t<r;t++,g++)t in n&&c(y,g,n[t])}else{if(f<=g)throw TypeError(m);c(y,g++,n)}return y.length=g,y}})},{"../internals/array-method-has-species-support":21,"../internals/array-species-create":25,"../internals/create-property":40,"../internals/engine-v8-version":48,"../internals/export":50,"../internals/fails":51,"../internals/is-array":73,"../internals/is-object":75,"../internals/to-length":138,"../internals/to-object":139,"../internals/well-known-symbol":150}],154:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/array-copy-within");e=e("../internals/add-to-unscopables"),n({target:"Array",proto:!0},{copyWithin:i}),e("copyWithin")},{"../internals/add-to-unscopables":7,"../internals/array-copy-within":14,"../internals/export":50}],155:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/array-iteration").every,o=e("../internals/array-method-is-strict");e=e("../internals/array-method-uses-to-length"),o=o("every"),e=e("every"),n({target:"Array",proto:!0,forced:!o||!e},{every:function(e){return i(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":19,"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23,"../internals/export":50}],156:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/array-fill");e=e("../internals/add-to-unscopables"),n({target:"Array",proto:!0},{fill:i}),e("fill")},{"../internals/add-to-unscopables":7,"../internals/array-fill":15,"../internals/export":50}],157:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/array-iteration").filter,o=e("../internals/array-method-has-species-support");e=e("../internals/array-method-uses-to-length"),o=o("filter"),e=e("filter"),n({target:"Array",proto:!0,forced:!o||!e},{filter:function(e){return i(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":19,"../internals/array-method-has-species-support":21,"../internals/array-method-uses-to-length":23,"../internals/export":50}],158:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/array-iteration").findIndex,o=e("../internals/add-to-unscopables"),s=(e=e("../internals/array-method-uses-to-length"),"findIndex"),a=!0;e=e(s),s in[]&&Array(1)[s]((function(){a=!1})),n({target:"Array",proto:!0,forced:a||!e},{findIndex:function(e){return i(this,e,1<arguments.length?arguments[1]:void 0)}}),o(s)},{"../internals/add-to-unscopables":7,"../internals/array-iteration":19,"../internals/array-method-uses-to-length":23,"../internals/export":50}],159:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/flatten-into-array"),o=e("../internals/to-object"),s=e("../internals/to-length"),a=e("../internals/a-function"),l=e("../internals/array-species-create");n({target:"Array",proto:!0},{flatMap:function(e){var t,r=o(this),n=s(r.length);return a(e),(t=l(r,0)).length=i(t,r,r,n,0,1,e,1<arguments.length?arguments[1]:void 0),t}})},{"../internals/a-function":5,"../internals/array-species-create":25,"../internals/export":50,"../internals/flatten-into-array":53,"../internals/to-length":138,"../internals/to-object":139}],160:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/flatten-into-array"),o=e("../internals/to-object"),s=e("../internals/to-length"),a=e("../internals/to-integer"),l=e("../internals/array-species-create");n({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=o(this),r=s(t.length),n=l(t,0);return n.length=i(n,t,t,r,0,void 0===e?1:a(e)),n}})},{"../internals/array-species-create":25,"../internals/export":50,"../internals/flatten-into-array":53,"../internals/to-integer":137,"../internals/to-length":138,"../internals/to-object":139}],161:[function(e,t,r){"use strict";var n=e("../internals/export");e=e("../internals/array-for-each"),n({target:"Array",proto:!0,forced:[].forEach!=e},{forEach:e})},{"../internals/array-for-each":16,"../internals/export":50}],162:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/array-from");n({target:"Array",stat:!0,forced:!e("../internals/check-correctness-of-iteration")((function(e){Array.from(e)}))},{from:i})},{"../internals/array-from":17,"../internals/check-correctness-of-iteration":27,"../internals/export":50}],163:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/array-includes").includes,o=e("../internals/add-to-unscopables");n({target:"Array",proto:!0,forced:!e("../internals/array-method-uses-to-length")("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return i(this,e,1<arguments.length?arguments[1]:void 0)}}),o("includes")},{"../internals/add-to-unscopables":7,"../internals/array-includes":18,"../internals/array-method-uses-to-length":23,"../internals/export":50}],164:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/array-includes").indexOf,o=e("../internals/array-method-is-strict"),s=(e=e("../internals/array-method-uses-to-length"),[].indexOf),a=!!s&&1/[1].indexOf(1,-0)<0;o=o("indexOf"),e=e("indexOf",{ACCESSORS:!0,1:0}),n({target:"Array",proto:!0,forced:a||!o||!e},{indexOf:function(e){return a?s.apply(this,arguments)||0:i(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-includes":18,"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23,"../internals/export":50}],165:[function(e,t,r){"use strict";var n=e("../internals/to-indexed-object"),i=e("../internals/add-to-unscopables"),o=e("../internals/iterators"),s=e("../internals/internal-state"),a=(e=e("../internals/define-iterator"),"Array Iterator"),l=s.set,c=s.getterFor(a);t.exports=e(Array,"Array",(function(e,t){l(this,{type:a,target:n(e),index:0,kind:t})}),(function(){var e=c(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},{"../internals/add-to-unscopables":7,"../internals/define-iterator":41,"../internals/internal-state":71,"../internals/iterators":80,"../internals/to-indexed-object":136}],166:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/indexed-object"),o=e("../internals/to-indexed-object"),s=(e=e("../internals/array-method-is-strict"),[].join);i=i!=Object,e=e("join",","),n({target:"Array",proto:!0,forced:i||!e},{join:function(e){return s.call(o(this),void 0===e?",":e)}})},{"../internals/array-method-is-strict":22,"../internals/export":50,"../internals/indexed-object":67,"../internals/to-indexed-object":136}],167:[function(e,t,r){e("../internals/export")({target:"Array",proto:!0,forced:(e=e("../internals/array-last-index-of"))!==[].lastIndexOf},{lastIndexOf:e})},{"../internals/array-last-index-of":20,"../internals/export":50}],168:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/array-iteration").map,o=e("../internals/array-method-has-species-support");e=e("../internals/array-method-uses-to-length"),o=o("map"),e=e("map"),n({target:"Array",proto:!0,forced:!o||!e},{map:function(e){return i(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":19,"../internals/array-method-has-species-support":21,"../internals/array-method-uses-to-length":23,"../internals/export":50}],169:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/is-object"),o=e("../internals/is-array"),s=e("../internals/to-absolute-index"),a=e("../internals/to-length"),l=e("../internals/to-indexed-object"),c=e("../internals/create-property"),u=e("../internals/well-known-symbol"),h=e("../internals/array-method-has-species-support"),d=(e=e("../internals/array-method-uses-to-length"),h=h("slice"),e=e("slice",{ACCESSORS:!0,0:0,1:2}),u("species")),p=[].slice,f=Math.max;n({target:"Array",proto:!0,forced:!h||!e},{slice:function(e,t){var r,n,u,h=l(this),m=a(h.length),y=s(e,m),g=s(void 0===t?m:t,m);if(o(h)&&((r="function"==typeof(r=h.constructor)&&(r===Array||o(r.prototype))||i(r)&&null===(r=r[d])?void 0:r)===Array||void 0===r))return p.call(h,y,g);for(n=new(void 0===r?Array:r)(f(g-y,0)),u=0;y<g;y++,u++)y in h&&c(n,u,h[y]);return n.length=u,n}})},{"../internals/array-method-has-species-support":21,"../internals/array-method-uses-to-length":23,"../internals/create-property":40,"../internals/export":50,"../internals/is-array":73,"../internals/is-object":75,"../internals/to-absolute-index":134,"../internals/to-indexed-object":136,"../internals/to-length":138,"../internals/well-known-symbol":150}],170:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/array-iteration").some,o=e("../internals/array-method-is-strict");e=e("../internals/array-method-uses-to-length"),o=o("some"),e=e("some"),n({target:"Array",proto:!0,forced:!o||!e},{some:function(e){return i(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":19,"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23,"../internals/export":50}],171:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/to-absolute-index"),o=e("../internals/to-integer"),s=e("../internals/to-length"),a=e("../internals/to-object"),l=e("../internals/array-species-create"),c=e("../internals/create-property"),u=e("../internals/array-method-has-species-support"),h=(e=e("../internals/array-method-uses-to-length"),u=u("splice"),e=e("splice",{ACCESSORS:!0,0:0,1:2}),Math.max),d=Math.min;n({target:"Array",proto:!0,forced:!u||!e},{splice:function(e,t){var r,n,u,p,f,m,y=a(this),g=s(y.length),v=i(e,g);if(0===(e=arguments.length)?r=n=0:n=1===e?(r=0,g-v):(r=e-2,d(h(o(t),0),g-v)),9007199254740991<g+r-n)throw TypeError("Maximum allowed length exceeded");for(u=l(y,n),p=0;p<n;p++)(f=v+p)in y&&c(u,p,y[f]);if(r<(u.length=n)){for(p=v;p<g-n;p++)m=p+r,(f=p+n)in y?y[m]=y[f]:delete y[m];for(p=g;g-n+r<p;p--)delete y[p-1]}else if(n<r)for(p=g-n;v<p;p--)m=p+r-1,(f=p+n-1)in y?y[m]=y[f]:delete y[m];for(p=0;p<r;p++)y[p+v]=arguments[p+2];return y.length=g-n+r,u}})},{"../internals/array-method-has-species-support":21,"../internals/array-method-uses-to-length":23,"../internals/array-species-create":25,"../internals/create-property":40,"../internals/export":50,"../internals/to-absolute-index":134,"../internals/to-integer":137,"../internals/to-length":138,"../internals/to-object":139}],172:[function(e,t,r){e("../internals/add-to-unscopables")("flatMap")},{"../internals/add-to-unscopables":7}],173:[function(e,t,r){e("../internals/add-to-unscopables")("flat")},{"../internals/add-to-unscopables":7}],174:[function(e,t,r){var n=e("../internals/descriptors"),i=(e=e("../internals/object-define-property").f,Function.prototype),o=i.toString,s=/^\s*function ([^ (]*)/;!n||"name"in i||e(i,"name",{configurable:!0,get:function(){try{return o.call(this).match(s)[1]}catch(e){return""}}})},{"../internals/descriptors":43,"../internals/object-define-property":93}],175:[function(e,t,r){"use strict";var n=e("../internals/collection");e=e("../internals/collection-strong"),t.exports=n("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),e)},{"../internals/collection":32,"../internals/collection-strong":30}],176:[function(e,t,r){e=e("../internals/export");var n=Math.hypot,i=Math.abs,o=Math.sqrt;e({target:"Math",stat:!0,forced:!!n&&n(1/0,NaN)!==1/0},{hypot:function(e,t){for(var r,n,s=0,a=0,l=arguments.length,c=0;a<l;)c<(r=i(arguments[a++]))?(s=s*(n=c/r)*n+1,c=r):s+=0<r?(n=r/c)*n:r;return c===1/0?1/0:c*o(s)}})},{"../internals/export":50}],177:[function(e,t,r){e=e("../internals/export");var n=Math.log,i=Math.LN2;e({target:"Math",stat:!0},{log2:function(e){return n(e)/i}})},{"../internals/export":50}],178:[function(e,t,r){e("../internals/export")({target:"Math",stat:!0},{sign:e("../internals/math-sign")})},{"../internals/export":50,"../internals/math-sign":81}],179:[function(e,t,r){"use strict";function n(e){var t,r,n,i,o,s,a,l=h(e,!1);if("string"==typeof l&&2<l.length)if(43===(e=(l=g(l)).charCodeAt(0))||45===e){if(88===(t=l.charCodeAt(2))||120===t)return NaN}else if(48===e){switch(l.charCodeAt(1)){case 66:case 98:r=2,n=49;break;case 79:case 111:r=8,n=55;break;default:return+l}for(o=(i=l.slice(2)).length,s=0;s<o;s++)if((a=i.charCodeAt(s))<48||n<a)return NaN;return parseInt(i,r)}return+l}var i=e("../internals/descriptors"),o=e("../internals/global"),s=e("../internals/is-forced"),a=e("../internals/redefine"),l=e("../internals/has"),c=e("../internals/classof-raw"),u=e("../internals/inherit-if-required"),h=e("../internals/to-primitive"),d=e("../internals/fails"),p=e("../internals/object-create"),f=e("../internals/object-get-own-property-names").f,m=e("../internals/object-get-own-property-descriptor").f,y=e("../internals/object-define-property").f,g=e("../internals/string-trim").trim,v="Number",b=o[v],_=b.prototype,x=c(p(_))==v;if(s(v,!b(" 0o1")||!b("0b1")||b("+0x1"))){for(var w,S=function(e){e=arguments.length<1?0:e;var t=this;return t instanceof S&&(x?d((function(){_.valueOf.call(t)})):c(t)!=v)?u(new b(n(e)),t,S):n(e)},M=i?f(b):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),T=0;M.length>T;T++)l(b,w=M[T])&&!l(S,w)&&y(S,w,m(b,w));(S.prototype=_).constructor=S,a(o,v,S)}},{"../internals/classof-raw":28,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":60,"../internals/has":61,"../internals/inherit-if-required":68,"../internals/is-forced":74,"../internals/object-create":91,"../internals/object-define-property":93,"../internals/object-get-own-property-descriptor":94,"../internals/object-get-own-property-names":96,"../internals/redefine":110,"../internals/string-trim":131,"../internals/to-primitive":142}],180:[function(e,t,r){e("../internals/export")({target:"Number",stat:!0},{EPSILON:Math.pow(2,-52)})},{"../internals/export":50}],181:[function(e,t,r){e("../internals/export")({target:"Number",stat:!0},{isFinite:e("../internals/number-is-finite")})},{"../internals/export":50,"../internals/number-is-finite":89}],182:[function(e,t,r){"use strict";function n(e,t,r){return 0===t?r:t%2==1?n(e,t-1,r*e):n(e*e,t/2,r)}var i=e("../internals/export"),o=e("../internals/to-integer"),s=e("../internals/this-number-value"),a=e("../internals/string-repeat"),l=(e=e("../internals/fails"),1..toFixed),c=Math.floor;i({target:"Number",proto:!0,forced:l&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!e((function(){l.call({})}))},{toFixed:function(e){function t(e,t){for(var r=-1,n=t;++r<6;)n+=e*d[r],d[r]=n%1e7,n=c(n/1e7)}function r(e){for(var t=6,r=0;0<=--t;)r+=d[t],d[t]=c(r/e),r=r%e*1e7}function i(){for(var e,t=6,r="";0<=--t;)""===r&&0!==t&&0===d[t]||(e=String(d[t]),r=""===r?e:r+a.call("0",7-e.length)+e);return r}var l,u,h=s(this),d=(e=o(e),[0,0,0,0,0,0]),p="",f="0";if(e<0||20<e)throw RangeError("Incorrect fraction digits");if(h!=h)return"NaN";if(h<=-1e21||1e21<=h)return String(h);if(h<0&&(p="-",h=-h),1e-21<h)if(h=(l=function(e){for(var t=0,r=e;4096<=r;)t+=12,r/=4096;for(;2<=r;)t+=1,r/=2;return t}(h*n(2,69,1))-69)<0?h*n(2,-l,1):h/n(2,l,1),h*=4503599627370496,0<(l=52-l)){for(t(0,h),u=e;7<=u;)t(1e7,0),u-=7;for(t(n(10,u,1),0),u=l-1;23<=u;)r(1<<23),u-=23;r(1<<u),t(1,1),r(2),f=i()}else t(0,h),t(1<<-l,0),f=i()+a.call("0",e);return 0<e?p+((h=f.length)<=e?"0."+a.call("0",e-h)+f:f.slice(0,h-e)+"."+f.slice(h-e)):p+f}})},{"../internals/export":50,"../internals/fails":51,"../internals/string-repeat":129,"../internals/this-number-value":133,"../internals/to-integer":137}],183:[function(e,t,r){var n=e("../internals/export");e=e("../internals/object-assign"),n({target:"Object",stat:!0,forced:Object.assign!==e},{assign:e})},{"../internals/export":50,"../internals/object-assign":90}],184:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/object-to-array").entries;n({target:"Object",stat:!0},{entries:function(e){return i(e)}})},{"../internals/export":50,"../internals/object-to-array":103}],185:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/iterate"),o=e("../internals/create-property");n({target:"Object",stat:!0},{fromEntries:function(e){var t={};return i(e,(function(e,r){o(t,e,r)}),void 0,!0),t}})},{"../internals/create-property":40,"../internals/export":50,"../internals/iterate":78}],186:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/fails"),o=e("../internals/to-indexed-object"),s=e("../internals/object-get-own-property-descriptor").f;e=e("../internals/descriptors"),i=i((function(){s(1)})),n({target:"Object",stat:!0,forced:!e||i,sham:!e},{getOwnPropertyDescriptor:function(e,t){return s(o(e),t)}})},{"../internals/descriptors":43,"../internals/export":50,"../internals/fails":51,"../internals/object-get-own-property-descriptor":94,"../internals/to-indexed-object":136}],187:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/fails");e=e("../internals/object-get-own-property-names-external").f,n({target:"Object",stat:!0,forced:i((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:e})},{"../internals/export":50,"../internals/fails":51,"../internals/object-get-own-property-names-external":95}],188:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/fails"),o=e("../internals/to-object"),s=e("../internals/object-get-prototype-of");e=e("../internals/correct-prototype-getter"),n({target:"Object",stat:!0,forced:i((function(){s(1)})),sham:!e},{getPrototypeOf:function(e){return s(o(e))}})},{"../internals/correct-prototype-getter":35,"../internals/export":50,"../internals/fails":51,"../internals/object-get-prototype-of":98,"../internals/to-object":139}],189:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/to-object"),o=e("../internals/object-keys");n({target:"Object",stat:!0,forced:e("../internals/fails")((function(){o(1)}))},{keys:function(e){return o(i(e))}})},{"../internals/export":50,"../internals/fails":51,"../internals/object-keys":100,"../internals/to-object":139}],190:[function(e,t,r){var n=e("../internals/to-string-tag-support"),i=e("../internals/redefine");e=e("../internals/object-to-string"),n||i(Object.prototype,"toString",e,{unsafe:!0})},{"../internals/object-to-string":104,"../internals/redefine":110,"../internals/to-string-tag-support":143}],191:[function(e,t,r){"use strict";var n,i,o,s,a=e("../internals/export"),l=e("../internals/is-pure"),c=e("../internals/global"),u=e("../internals/get-built-in"),h=e("../internals/native-promise-constructor"),d=e("../internals/redefine"),p=e("../internals/redefine-all"),f=e("../internals/set-to-string-tag"),m=e("../internals/set-species"),y=e("../internals/is-object"),g=e("../internals/a-function"),v=e("../internals/an-instance"),b=e("../internals/classof-raw"),_=e("../internals/inspect-source"),x=e("../internals/iterate"),w=e("../internals/check-correctness-of-iteration"),S=e("../internals/species-constructor"),M=e("../internals/task").set,T=e("../internals/microtask"),E=e("../internals/promise-resolve"),j=e("../internals/host-report-errors"),A=e("../internals/new-promise-capability"),L=e("../internals/perform"),C=e("../internals/internal-state"),P=e("../internals/is-forced"),R=e("../internals/well-known-symbol"),O=e("../internals/engine-v8-version"),k=R("species"),I="Promise",D=C.get,N=C.set,F=C.getterFor(I),U=h,B=c.TypeError,z=c.document,G=c.process,V=u("fetch"),H=A.f,W=H,q="process"==b(G),X=!!(z&&z.createEvent&&c.dispatchEvent),Y="unhandledrejection",Z=(e=P(I,(function(){var e,t;if(_(U)===String(U)){if(66===O)return!0;if(!q&&"function"!=typeof PromiseRejectionEvent)return!0}return!((!l||U.prototype.finally)&&(51<=O&&/native code/.test(U)||(t=function(e){e((function(){}),(function(){}))},((e=U.resolve(1)).constructor={})[k]=t,e.then((function(){}))instanceof t)))})),R=e||!w((function(e){U.all(e).catch((function(){}))})),function(e){var t;return!(!y(e)||"function"!=typeof(t=e.then))&&t}),J=function(e,t,r){var n;t.notified||(t.notified=!0,n=t.reactions,T((function(){for(var i,o,s=t.value,a=1==t.state,l=0;n.length>l;){var u,h,d,p=n[l++],f=a?p.ok:p.fail,m=p.resolve,y=p.reject,g=p.domain;try{f?(a||(2===t.rejection&&function(e,t){M.call(c,(function(){q?G.emit("rejectionHandled",e):K("rejectionhandled",e,t.value)}))}(e,t),t.rejection=1),!0===f?u=s:(g&&g.enter(),u=f(s),g&&(g.exit(),d=!0)),u===p.promise?y(B("Promise-chain cycle")):(h=Z(u))?h.call(u,m,y):m(u)):y(s)}catch(s){g&&!d&&g.exit(),y(s)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&(i=e,o=t,M.call(c,(function(){var e=o.value,t=Q(o);if(t&&(t=L((function(){q?G.emit("unhandledRejection",e,i):K(Y,i,e)})),o.rejection=q||Q(o)?2:1,t.error))throw t.value})))})))},K=function(e,t,r){var n;X?((n=z.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},(t=c["on"+e])?t(n):e===Y&&j("Unhandled promise rejection",r)},Q=function(e){return 1!==e.rejection&&!e.parent},$=function(e,t,r,n){return function(i){e(t,r,i,n)}},ee=function(e,t,r,n){t.done||(t.done=!0,(t=n||t).value=r,t.state=2,J(e,t,!0))},te=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw B("Promise can't be resolved itself");var i=Z(r);i?T((function(){var n={done:!1};try{i.call(r,$(te,e,n,t),$(ee,e,n,t))}catch(r){ee(e,n,r,t)}})):(t.value=r,t.state=1,J(e,t,!1))}catch(r){ee(e,{done:!1},r,t)}}};e&&(U=function(e){v(this,U,I),g(e),n.call(this);var t=D(this);try{e($(te,this,t),$(ee,this,t))}catch(e){ee(this,t,e)}},(n=function(e){N(this,{type:I,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=p(U.prototype,{then:function(e,t){var r=F(this),n=H(S(this,U));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=q?G.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&J(this,r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new n,t=D(e);this.promise=e,this.resolve=$(te,e,t),this.reject=$(ee,e,t)},A.f=H=function(e){return e===U||e===o?new i:W(e)},l||"function"!=typeof h||(s=h.prototype.then,d(h.prototype,"then",(function(e,t){var r=this;return new U((function(e,t){s.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof V&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return E(U,V.apply(c,arguments))}}))),a({global:!0,wrap:!0,forced:e},{Promise:U}),f(U,I,!1,!0),m(I),o=u(I),a({target:I,stat:!0,forced:e},{reject:function(e){var t=H(this);return t.reject.call(void 0,e),t.promise}}),a({target:I,stat:!0,forced:l||e},{resolve:function(e){return E(l&&this===o?U:this,e)}}),a({target:I,stat:!0,forced:R},{all:function(e){var t=this,r=H(t),n=r.resolve,i=r.reject,o=L((function(){var r=g(t.resolve),o=[],s=0,a=1;x(e,(function(e){var l=s++,c=!1;o.push(void 0),a++,r.call(t,e).then((function(e){c||(c=!0,o[l]=e,--a||n(o))}),i)})),--a||n(o)}));return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=H(t),n=r.reject,i=L((function(){var i=g(t.resolve);x(e,(function(e){i.call(t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}})},{"../internals/a-function":5,"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/classof-raw":28,"../internals/engine-v8-version":48,"../internals/export":50,"../internals/get-built-in":57,"../internals/global":60,"../internals/host-report-errors":63,"../internals/inspect-source":69,"../internals/internal-state":71,"../internals/is-forced":74,"../internals/is-object":75,"../internals/is-pure":76,"../internals/iterate":78,"../internals/microtask":82,"../internals/native-promise-constructor":83,"../internals/new-promise-capability":87,"../internals/perform":107,"../internals/promise-resolve":108,"../internals/redefine":110,"../internals/redefine-all":109,"../internals/set-species":118,"../internals/set-to-string-tag":119,"../internals/species-constructor":123,"../internals/task":132,"../internals/well-known-symbol":150}],192:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/get-built-in"),o=e("../internals/a-function"),s=e("../internals/an-object"),a=e("../internals/is-object"),l=e("../internals/object-create"),c=e("../internals/function-bind"),u=(e=e("../internals/fails"),i("Reflect","construct")),h=e((function(){function e(){}return!(u((function(){}),[],e)instanceof e)})),d=!e((function(){u((function(){}))}));n({target:"Reflect",stat:!0,forced:i=h||d,sham:i},{construct:function(e,t){o(e),s(t);var r=arguments.length<3?e:o(arguments[2]);if(d&&!h)return u(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return n.push.apply(n,t),new(c.apply(e,n))}return n=r.prototype,r=l(a(n)?n:Object.prototype),n=Function.apply.call(e,r,t),a(n)?n:r}})},{"../internals/a-function":5,"../internals/an-object":10,"../internals/export":50,"../internals/fails":51,"../internals/function-bind":56,"../internals/get-built-in":57,"../internals/is-object":75,"../internals/object-create":91}],193:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/is-object"),o=e("../internals/an-object"),s=e("../internals/has"),a=e("../internals/object-get-own-property-descriptor"),l=e("../internals/object-get-prototype-of");n({target:"Reflect",stat:!0},{get:function e(t,r){var n,c=arguments.length<3?t:arguments[2];return o(t)===c?t[r]:(n=a.f(t,r))?s(n,"value")?n.value:void 0===n.get?void 0:n.get.call(c):i(n=l(t))?e(n,r,c):void 0}})},{"../internals/an-object":10,"../internals/export":50,"../internals/has":61,"../internals/is-object":75,"../internals/object-get-own-property-descriptor":94,"../internals/object-get-prototype-of":98}],194:[function(e,t,r){var n=e("../internals/descriptors"),i=e("../internals/global"),o=e("../internals/is-forced"),s=e("../internals/inherit-if-required"),a=e("../internals/object-define-property").f,l=e("../internals/object-get-own-property-names").f,c=e("../internals/is-regexp"),u=e("../internals/regexp-flags"),h=e("../internals/regexp-sticky-helpers"),d=e("../internals/redefine"),p=e("../internals/fails"),f=e("../internals/internal-state").set,m=e("../internals/set-species"),y=e("../internals/well-known-symbol")("match"),g=i.RegExp,v=g.prototype,b=/a/g,_=/a/g,x=new g(b)!==b,w=h.UNSUPPORTED_Y;if(n&&o("RegExp",!x||w||p((function(){return _[y]=!1,g(b)!=b||g(_)==_||"/a/i"!=g(b,"i")})))){for(var S=function(e,t){var r,n=this instanceof S,i=c(e),o=void 0===t;return!n&&i&&e.constructor===S&&o?e:(x?i&&!o&&(e=e.source):e instanceof S&&(o&&(t=u.call(e)),e=e.source),w&&(r=!!t&&-1<t.indexOf("y"))&&(t=t.replace(/y/g,"")),i=s(x?new g(e,t):g(e,t),n?this:v,S),w&&r&&f(i,{sticky:r}),i)},M=l(g),T=0;M.length>T;)!function(e){e in S||a(S,e,{configurable:!0,get:function(){return g[e]},set:function(t){g[e]=t}})}(M[T++]);(v.constructor=S).prototype=v,d(i,"RegExp",S)}m("RegExp")},{"../internals/descriptors":43,"../internals/fails":51,"../internals/global":60,"../internals/inherit-if-required":68,"../internals/internal-state":71,"../internals/is-forced":74,"../internals/is-regexp":77,"../internals/object-define-property":93,"../internals/object-get-own-property-names":96,"../internals/redefine":110,"../internals/regexp-flags":113,"../internals/regexp-sticky-helpers":114,"../internals/set-species":118,"../internals/well-known-symbol":150}],195:[function(e,t,r){"use strict";var n=e("../internals/export");e=e("../internals/regexp-exec"),n({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e})},{"../internals/export":50,"../internals/regexp-exec":112}],196:[function(e,t,r){"use strict";var n=e("../internals/redefine"),i=e("../internals/an-object"),o=e("../internals/fails"),s=e("../internals/regexp-flags"),a=(e="toString",RegExp.prototype),l=a[e],c=(o=o((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),l.name!=e);(o||c)&&n(RegExp.prototype,e,(function(){var e=i(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in a)?s.call(e):r)}),{unsafe:!0})},{"../internals/an-object":10,"../internals/fails":51,"../internals/redefine":110,"../internals/regexp-flags":113}],197:[function(e,t,r){"use strict";var n=e("../internals/collection");e=e("../internals/collection-strong"),t.exports=n("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),e)},{"../internals/collection":32,"../internals/collection-strong":30}],198:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/object-get-own-property-descriptor").f,o=e("../internals/to-length"),s=e("../internals/not-a-regexp"),a=e("../internals/require-object-coercible"),l=e("../internals/correct-is-regexp-logic"),c=(e=e("../internals/is-pure"),"".endsWith),u=Math.min;l=l("endsWith"),n({target:"String",proto:!0,forced:!(!e&&!l&&(n=i(String.prototype,"endsWith"))&&!n.writable||l)},{endsWith:function(e){var t=String(a(this)),r=(s(e),1<arguments.length?arguments[1]:void 0),n=o(t.length);return r=void 0===r?n:u(o(r),n),n=String(e),c?c.call(t,n,r):t.slice(r-n.length,r)===n}})},{"../internals/correct-is-regexp-logic":34,"../internals/export":50,"../internals/is-pure":76,"../internals/not-a-regexp":88,"../internals/object-get-own-property-descriptor":94,"../internals/require-object-coercible":115,"../internals/to-length":138}],199:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/not-a-regexp"),o=e("../internals/require-object-coercible");n({target:"String",proto:!0,forced:!e("../internals/correct-is-regexp-logic")("includes")},{includes:function(e){return!!~String(o(this)).indexOf(i(e),1<arguments.length?arguments[1]:void 0)}})},{"../internals/correct-is-regexp-logic":34,"../internals/export":50,"../internals/not-a-regexp":88,"../internals/require-object-coercible":115}],200:[function(e,t,r){"use strict";var n=e("../internals/string-multibyte").charAt,i=e("../internals/internal-state"),o=(e=e("../internals/define-iterator"),"String Iterator"),s=i.set,a=i.getterFor(o);e(String,"String",(function(e){s(this,{type:o,string:String(e),index:0})}),(function(){var e=a(this),t=e.string,r=e.index;return r>=t.length?{value:void 0,done:!0}:(t=n(t,r),e.index+=t.length,{value:t,done:!1})}))},{"../internals/define-iterator":41,"../internals/internal-state":71,"../internals/string-multibyte":125}],201:[function(e,t,r){"use strict";var n=e("../internals/fix-regexp-well-known-symbol-logic"),i=e("../internals/an-object"),o=e("../internals/to-length"),s=e("../internals/require-object-coercible"),a=e("../internals/advance-string-index"),l=e("../internals/regexp-exec-abstract");n("match",1,(function(e,t,r){return[function(t){var r=s(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,r):new RegExp(t)[e](String(r))},function(e){var n=r(t,e,this);if(n.done)return n.value;var s=i(e),c=String(this);if(!s.global)return l(s,c);for(var u=s.unicode,h=[],d=s.lastIndex=0;null!==(p=l(s,c));){var p=String(p[0]);""===(h[d]=p)&&(s.lastIndex=a(c,o(s.lastIndex),u)),d++}return 0===d?null:h}]}))},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":111,"../internals/require-object-coercible":115,"../internals/to-length":138}],202:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/string-pad").start;n({target:"String",proto:!0,forced:e("../internals/string-pad-webkit-bug")},{padStart:function(e){return i(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/export":50,"../internals/string-pad":127,"../internals/string-pad-webkit-bug":126}],203:[function(e,t,r){e("../internals/export")({target:"String",proto:!0},{repeat:e("../internals/string-repeat")})},{"../internals/export":50,"../internals/string-repeat":129}],204:[function(e,t,r){"use strict";var n=e("../internals/fix-regexp-well-known-symbol-logic"),i=e("../internals/an-object"),o=e("../internals/to-object"),s=e("../internals/to-length"),a=e("../internals/to-integer"),l=e("../internals/require-object-coercible"),c=e("../internals/advance-string-index"),u=e("../internals/regexp-exec-abstract"),h=Math.max,d=Math.min,p=Math.floor,f=/\$([$&'`]|\d\d?|<[^>]*>)/g,m=/\$([$&'`]|\d\d?)/g;n("replace",2,(function(e,t,r,n){var y=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,g=n.REPLACE_KEEPS_$0,v=y?"$":"$0";return[function(r,n){var i=l(this),o=null==r?void 0:r[e];return void 0!==o?o.call(r,i,n):t.call(String(i),r,n)},function(e,n){if(!y&&g||"string"==typeof n&&-1===n.indexOf(v)){var l=r(t,e,this,n);if(l.done)return l.value}for(var b,_=i(e),x=String(this),w="function"==typeof n,S=(w||(n=String(n)),_.global),M=(S&&(b=_.unicode,_.lastIndex=0),[]);null!==(L=u(_,x))&&(M.push(L),S);)""===String(L[0])&&(_.lastIndex=c(x,s(_.lastIndex),b));for(var T,E="",j=0,A=0;A<M.length;A++){for(var L=M[A],C=String(L[0]),P=h(d(a(L.index),x.length),0),R=[],O=1;O<L.length;O++)R.push(void 0===(T=L[O])?T:String(T));var k=L.groups,I=w?(I=[C].concat(R,P,x),void 0!==k&&I.push(k),String(n.apply(void 0,I))):function(e,r,n,i,s,a){var l=n+e.length,c=i.length,u=m;return void 0!==s&&(s=o(s),u=f),t.call(a,u,(function(t,o){var a;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return r.slice(0,n);case"'":return r.slice(l);case"<":a=s[o.slice(1,-1)];break;default:var u,h=+o;if(0==h)return t;if(c<h)return 0!==(u=p(h/10))&&u<=c?void 0===i[u-1]?o.charAt(1):i[u-1]+o.charAt(1):t;a=i[h-1]}return void 0===a?"":a}))}(C,x,P,R,k,n);j<=P&&(E+=x.slice(j,P)+I,j=P+C.length)}return E+x.slice(j)}]}))},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":111,"../internals/require-object-coercible":115,"../internals/to-integer":137,"../internals/to-length":138,"../internals/to-object":139}],205:[function(e,t,r){"use strict";var n=e("../internals/fix-regexp-well-known-symbol-logic"),i=e("../internals/an-object"),o=e("../internals/require-object-coercible"),s=e("../internals/same-value"),a=e("../internals/regexp-exec-abstract");n("search",1,(function(e,t,r){return[function(t){var r=o(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,r):new RegExp(t)[e](String(r))},function(e){var n,o=r(t,e,this);return o.done?o.value:(o=i(e),e=String(this),n=o.lastIndex,s(n,0)||(o.lastIndex=0),e=a(o,e),s(o.lastIndex,n)||(o.lastIndex=n),null===e?-1:e.index)}]}))},{"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":111,"../internals/require-object-coercible":115,"../internals/same-value":116}],206:[function(e,t,r){"use strict";var n=e("../internals/fix-regexp-well-known-symbol-logic"),i=e("../internals/is-regexp"),o=e("../internals/an-object"),s=e("../internals/require-object-coercible"),a=e("../internals/species-constructor"),l=e("../internals/advance-string-index"),c=e("../internals/to-length"),u=e("../internals/regexp-exec-abstract"),h=e("../internals/regexp-exec"),d=(e=e("../internals/fails"),[].push),p=Math.min,f=4294967295,m=!e((function(){return!RegExp(f,"y")}));n("split",2,(function(e,t,r){var n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||1<".".split(/()()/).length||"".split(/.?/).length?function(e,r){var n=String(s(this)),o=void 0===r?f:r>>>0;if(0==o)return[];if(void 0===e)return[n];if(!i(e))return t.call(n,e,o);for(var a,l,c,u=[],p=(r=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),0),m=new RegExp(e.source,r+"g");(a=h.call(m,n))&&!(p<(l=m.lastIndex)&&(u.push(n.slice(p,a.index)),1<a.length&&a.index<n.length&&d.apply(u,a.slice(1)),c=a[0].length,p=l,u.length>=o));)m.lastIndex===a.index&&m.lastIndex++;return p===n.length?!c&&m.test("")||u.push(""):u.push(n.slice(p)),u.length>o?u.slice(0,o):u}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:t.call(this,e,r)}:t;return[function(t,r){var i=s(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,i,r):n.call(String(i),t,r)},function(e,i){if((s=r(n,e,this,i,n!==t)).done)return s.value;var s=o(e),h=String(this),d=(e=a(s,RegExp),s.unicode),y=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(m?"y":"g"),g=new e(m?s:"^(?:"+s.source+")",y),v=void 0===i?f:i>>>0;if(0==v)return[];if(0===h.length)return null===u(g,h)?[h]:[];for(var b=0,_=0,x=[];_<h.length;){g.lastIndex=m?_:0;var w,S=u(g,m?h:h.slice(_));if(null===S||(w=p(c(g.lastIndex+(m?0:_)),h.length))===b)_=l(h,_,d);else{if(x.push(h.slice(b,_)),x.length===v)return x;for(var M=1;M<=S.length-1;M++)if(x.push(S[M]),x.length===v)return x;_=b=w}}return x.push(h.slice(b)),x}]}),!m)},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fails":51,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/is-regexp":77,"../internals/regexp-exec":112,"../internals/regexp-exec-abstract":111,"../internals/require-object-coercible":115,"../internals/species-constructor":123,"../internals/to-length":138}],207:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/object-get-own-property-descriptor").f,o=e("../internals/to-length"),s=e("../internals/not-a-regexp"),a=e("../internals/require-object-coercible"),l=e("../internals/correct-is-regexp-logic"),c=(e=e("../internals/is-pure"),"".startsWith),u=Math.min;l=l("startsWith"),n({target:"String",proto:!0,forced:!(!e&&!l&&(n=i(String.prototype,"startsWith"))&&!n.writable||l)},{startsWith:function(e){var t=String(a(this)),r=(s(e),o(u(1<arguments.length?arguments[1]:void 0,t.length)));return e=String(e),c?c.call(t,e,r):t.slice(r,r+e.length)===e}})},{"../internals/correct-is-regexp-logic":34,"../internals/export":50,"../internals/is-pure":76,"../internals/not-a-regexp":88,"../internals/object-get-own-property-descriptor":94,"../internals/require-object-coercible":115,"../internals/to-length":138}],208:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/create-html");n({target:"String",proto:!0,forced:e("../internals/string-html-forced")("sub")},{sub:function(){return i(this,"sub","","")}})},{"../internals/create-html":36,"../internals/export":50,"../internals/string-html-forced":124}],209:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/string-trim").trim;n({target:"String",proto:!0,forced:e("../internals/string-trim-forced")("trim")},{trim:function(){return i(this)}})},{"../internals/export":50,"../internals/string-trim":131,"../internals/string-trim-forced":130}],210:[function(e,t,r){"use strict";var n,i,o,s,a,l=e("../internals/export"),c=e("../internals/descriptors"),u=e("../internals/global"),h=e("../internals/has"),d=e("../internals/is-object"),p=e("../internals/object-define-property").f,f=(e=e("../internals/copy-constructor-properties"),u.Symbol);!c||"function"!=typeof f||"description"in f.prototype&&void 0===f().description||(n={},e(i=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof i?new f(e):void 0===e?f():f(e);return""===e&&(n[t]=!0),t},f),(u=i.prototype=f.prototype).constructor=i,o=u.toString,s="Symbol(test)"==String(f("test")),a=/^Symbol\((.*)\)[^)]+$/,p(u,"description",{configurable:!0,get:function(){var e=d(this)?this.valueOf():this,t=o.call(e);return h(n,e)?"":""===(e=s?t.slice(7,-1):t.replace(a,"$1"))?void 0:e}}),l({global:!0,forced:!0},{Symbol:i}))},{"../internals/copy-constructor-properties":33,"../internals/descriptors":43,"../internals/export":50,"../internals/global":60,"../internals/has":61,"../internals/is-object":75,"../internals/object-define-property":93}],211:[function(e,t,r){e("../internals/define-well-known-symbol")("iterator")},{"../internals/define-well-known-symbol":42}],212:[function(e,t,r){"use strict";function n(e,t){var r=te[e]=S(Z[W]);return q(r,{type:H,tag:e,description:t}),h||(r.description=t),r}function i(e,t){v(e);var r=_(t);return t=M(r).concat(ue(r)),G(t,(function(t){h&&!ce.call(r,t)||le(e,t,r[t])})),e}function o(e,t){var r;if(e=_(e),t=x(t,!0),e!==Y||!m(te,t)||m(re,t))return!(r=K(e,t))||!m(te,t)||m(e,V)&&e[V][t]||(r.enumerable=!0),r}function s(e){e=$(_(e));var t=[];return G(e,(function(e){m(te,e)||m(I,e)||t.push(e)})),t}var a=e("../internals/export"),l=e("../internals/global"),c=e("../internals/get-built-in"),u=e("../internals/is-pure"),h=e("../internals/descriptors"),d=e("../internals/native-symbol"),p=e("../internals/use-symbol-as-uid"),f=e("../internals/fails"),m=e("../internals/has"),y=e("../internals/is-array"),g=e("../internals/is-object"),v=e("../internals/an-object"),b=e("../internals/to-object"),_=e("../internals/to-indexed-object"),x=e("../internals/to-primitive"),w=e("../internals/create-property-descriptor"),S=e("../internals/object-create"),M=e("../internals/object-keys"),T=e("../internals/object-get-own-property-names"),E=e("../internals/object-get-own-property-names-external"),j=e("../internals/object-get-own-property-symbols"),A=e("../internals/object-get-own-property-descriptor"),L=e("../internals/object-define-property"),C=e("../internals/object-property-is-enumerable"),P=e("../internals/create-non-enumerable-property"),R=e("../internals/redefine"),O=e("../internals/shared"),k=e("../internals/shared-key"),I=e("../internals/hidden-keys"),D=e("../internals/uid"),N=e("../internals/well-known-symbol"),F=e("../internals/well-known-symbol-wrapped"),U=e("../internals/define-well-known-symbol"),B=e("../internals/set-to-string-tag"),z=e("../internals/internal-state"),G=e("../internals/array-iteration").forEach,V=k("hidden"),H="Symbol",W="prototype",q=(e=N("toPrimitive"),z.set),X=z.getterFor(H),Y=Object[W],Z=l.Symbol,J=c("JSON","stringify"),K=A.f,Q=L.f,$=E.f,ee=C.f,te=O("symbols"),re=O("op-symbols"),ne=O("string-to-symbol-registry"),ie=O("symbol-to-string-registry"),oe=(k=O("wks"),!(z=l.QObject)||!z[W]||!z[W].findChild),se=h&&f((function(){return 7!=S(Q({},"a",{get:function(){return Q(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=K(Y,t);n&&delete Y[t],Q(e,t,r),n&&e!==Y&&Q(Y,t,n)}:Q,ae=p?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof Z},le=function(e,t,r){return e===Y&&le(re,t,r),v(e),t=x(t,!0),v(r),(m(te,t)?(r.enumerable?(m(e,V)&&e[V][t]&&(e[V][t]=!1),r=S(r,{enumerable:w(0,!1)})):(m(e,V)||Q(e,V,w(1,{})),e[V][t]=!0),se):Q)(e,t,r)},ce=function(e){e=x(e,!0);var t=ee.call(this,e);return!(this===Y&&m(te,e)&&!m(re,e))&&(!(t||!m(this,e)||!m(te,e)||m(this,V)&&this[V][e])||t)},ue=function(e){var t=e===Y,r=(e=$(t?re:_(e)),[]);return G(e,(function(e){!m(te,e)||t&&!m(Y,e)||r.push(te[e])})),r};d||(R((Z=function(){if(this instanceof Z)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=D(e),r=function(e){this===Y&&r.call(re,e),m(this,V)&&m(this[V],t)&&(this[V][t]=!1),se(this,t,w(1,e))};return h&&oe&&se(Y,t,{configurable:!0,set:r}),n(t,e)})[W],"toString",(function(){return X(this).tag})),R(Z,"withoutSetter",(function(e){return n(D(e),e)})),C.f=ce,L.f=le,A.f=o,T.f=E.f=s,j.f=ue,F.f=function(e){return n(N(e),e)},h&&(Q(Z[W],"description",{configurable:!0,get:function(){return X(this).description}}),u||R(Y,"propertyIsEnumerable",ce,{unsafe:!0}))),a({global:!0,wrap:!0,forced:!d,sham:!d},{Symbol:Z}),G(M(k),(function(e){U(e)})),a({target:H,stat:!0,forced:!d},{for:function(e){var t;return e=String(e),m(ne,e)?ne[e]:(t=Z(e),ne[e]=t,ie[t]=e,t)},keyFor:function(e){if(!ae(e))throw TypeError(e+" is not a symbol");if(m(ie,e))return ie[e]},useSetter:function(){oe=!0},useSimple:function(){oe=!1}}),a({target:"Object",stat:!0,forced:!d,sham:!h},{create:function(e,t){return void 0===t?S(e):i(S(e),t)},defineProperty:le,defineProperties:i,getOwnPropertyDescriptor:o}),a({target:"Object",stat:!0,forced:!d},{getOwnPropertyNames:s,getOwnPropertySymbols:ue}),a({target:"Object",stat:!0,forced:f((function(){j.f(1)}))},{getOwnPropertySymbols:function(e){return j.f(b(e))}}),J&&a({target:"JSON",stat:!0,forced:!d||f((function(){var e=Z();return"[null]"!=J([e])||"{}"!=J({a:e})||"{}"!=J(Object(e))}))},{stringify:function(e,t,r){for(var n,i=[e],o=1;o<arguments.length;)i.push(arguments[o++]);if((g(n=t)||void 0!==e)&&!ae(e))return y(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!ae(t))return t}),i[1]=t,J.apply(null,i)}}),Z[W][e]||P(Z[W],e,Z[W].valueOf),B(Z,H),I[V]=!0},{"../internals/an-object":10,"../internals/array-iteration":19,"../internals/create-non-enumerable-property":38,"../internals/create-property-descriptor":39,"../internals/define-well-known-symbol":42,"../internals/descriptors":43,"../internals/export":50,"../internals/fails":51,"../internals/get-built-in":57,"../internals/global":60,"../internals/has":61,"../internals/hidden-keys":62,"../internals/internal-state":71,"../internals/is-array":73,"../internals/is-object":75,"../internals/is-pure":76,"../internals/native-symbol":84,"../internals/object-create":91,"../internals/object-define-property":93,"../internals/object-get-own-property-descriptor":94,"../internals/object-get-own-property-names":96,"../internals/object-get-own-property-names-external":95,"../internals/object-get-own-property-symbols":97,"../internals/object-keys":100,"../internals/object-property-is-enumerable":101,"../internals/redefine":110,"../internals/set-to-string-tag":119,"../internals/shared":122,"../internals/shared-key":120,"../internals/to-indexed-object":136,"../internals/to-object":139,"../internals/to-primitive":142,"../internals/uid":147,"../internals/use-symbol-as-uid":148,"../internals/well-known-symbol":150,"../internals/well-known-symbol-wrapped":149}],213:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-copy-within"),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("copyWithin",(function(e,t){return i.call(o(this),e,t,2<arguments.length?arguments[2]:void 0)}))},{"../internals/array-buffer-view-core":12,"../internals/array-copy-within":14}],214:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-iteration").every,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",(function(e){return i(o(this),e,1<arguments.length?arguments[1]:void 0)}))},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],215:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-fill"),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("fill",(function(e){return i.apply(o(this),arguments)}))},{"../internals/array-buffer-view-core":12,"../internals/array-fill":15}],216:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-iteration").filter,o=e("../internals/species-constructor"),s=n.aTypedArray,a=n.aTypedArrayConstructor;(0,n.exportTypedArrayMethod)("filter",(function(e){for(var t=i(s(this),e,1<arguments.length?arguments[1]:void 0),r=(e=o(this,this.constructor),0),n=t.length,l=new(a(e))(n);r<n;)l[r]=t[r++];return l}))},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19,"../internals/species-constructor":123}],217:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-iteration").findIndex,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",(function(e){return i(o(this),e,1<arguments.length?arguments[1]:void 0)}))},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],218:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-iteration").find,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",(function(e){return i(o(this),e,1<arguments.length?arguments[1]:void 0)}))},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],219:[function(e,t,r){e("../internals/typed-array-constructor")("Float32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},{"../internals/typed-array-constructor":144}],220:[function(e,t,r){e("../internals/typed-array-constructor")("Float64",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},{"../internals/typed-array-constructor":144}],221:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-iteration").forEach,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",(function(e){i(o(this),e,1<arguments.length?arguments[1]:void 0)}))},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],222:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-includes").includes,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",(function(e){return i(o(this),e,1<arguments.length?arguments[1]:void 0)}))},{"../internals/array-buffer-view-core":12,"../internals/array-includes":18}],223:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-includes").indexOf,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",(function(e){return i(o(this),e,1<arguments.length?arguments[1]:void 0)}))},{"../internals/array-buffer-view-core":12,"../internals/array-includes":18}],224:[function(e,t,r){e("../internals/typed-array-constructor")("Int16",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},{"../internals/typed-array-constructor":144}],225:[function(e,t,r){e("../internals/typed-array-constructor")("Int32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},{"../internals/typed-array-constructor":144}],226:[function(e,t,r){"use strict";function n(){return a.call(u(this))}var i=e("../internals/global"),o=e("../internals/array-buffer-view-core"),s=e("../modules/es.array.iterator"),a=(e=e("../internals/well-known-symbol")("iterator"),i=i.Uint8Array,s.values),l=s.keys,c=s.entries,u=o.aTypedArray;s=o.exportTypedArrayMethod,i=!!(o=i&&i.prototype[e])&&("values"==o.name||null==o.name),s("entries",(function(){return c.call(u(this))})),s("keys",(function(){return l.call(u(this))})),s("values",n,!i),s(e,n,!i)},{"../internals/array-buffer-view-core":12,"../internals/global":60,"../internals/well-known-symbol":150,"../modules/es.array.iterator":165}],227:[function(e,t,r){"use strict";var n=(e=e("../internals/array-buffer-view-core")).aTypedArray,i=(e=e.exportTypedArrayMethod,[].join);e("join",(function(e){return i.apply(n(this),arguments)}))},{"../internals/array-buffer-view-core":12}],228:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-last-index-of"),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",(function(e){return i.apply(o(this),arguments)}))},{"../internals/array-buffer-view-core":12,"../internals/array-last-index-of":20}],229:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-iteration").map,o=e("../internals/species-constructor"),s=n.aTypedArray,a=n.aTypedArrayConstructor;(0,n.exportTypedArrayMethod)("map",(function(e){return i(s(this),e,1<arguments.length?arguments[1]:void 0,(function(e,t){return new(a(o(e,e.constructor)))(t)}))}))},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19,"../internals/species-constructor":123}],230:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-reduce").right,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",(function(e){return i(o(this),e,arguments.length,1<arguments.length?arguments[1]:void 0)}))},{"../internals/array-buffer-view-core":12,"../internals/array-reduce":24}],231:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-reduce").left,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",(function(e){return i(o(this),e,arguments.length,1<arguments.length?arguments[1]:void 0)}))},{"../internals/array-buffer-view-core":12,"../internals/array-reduce":24}],232:[function(e,t,r){"use strict";var n=(e=e("../internals/array-buffer-view-core")).aTypedArray,i=(e=e.exportTypedArrayMethod,Math.floor);e("reverse",(function(){for(var e,t=n(this).length,r=i(t/2),o=0;o<r;)e=this[o],this[o++]=this[--t],this[t]=e;return this}))},{"../internals/array-buffer-view-core":12}],233:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/to-length"),o=e("../internals/to-offset"),s=e("../internals/to-object"),a=(e=e("../internals/fails"),n.aTypedArray);(0,n.exportTypedArrayMethod)("set",(function(e){a(this);var t=o(1<arguments.length?arguments[1]:void 0,1),r=this.length,n=s(e),l=i(n.length),c=0;if(r<l+t)throw RangeError("Wrong length");for(;c<l;)this[t+c]=n[c++]}),e((function(){new Int8Array(1).set({})})))},{"../internals/array-buffer-view-core":12,"../internals/fails":51,"../internals/to-length":138,"../internals/to-object":139,"../internals/to-offset":140}],234:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/species-constructor"),o=(e=e("../internals/fails"),n.aTypedArray),s=n.aTypedArrayConstructor,a=(n=n.exportTypedArrayMethod,[].slice);n("slice",(function(e,t){for(var r=a.call(o(this),e,t),n=(e=i(this,this.constructor),0),l=r.length,c=new(s(e))(l);n<l;)c[n]=r[n++];return c}),e((function(){new Int8Array(1).slice()})))},{"../internals/array-buffer-view-core":12,"../internals/fails":51,"../internals/species-constructor":123}],235:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/array-iteration").some,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",(function(e){return i(o(this),e,1<arguments.length?arguments[1]:void 0)}))},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],236:[function(e,t,r){"use strict";var n=(e=e("../internals/array-buffer-view-core")).aTypedArray,i=(e=e.exportTypedArrayMethod,[].sort);e("sort",(function(e){return i.call(n(this),e)}))},{"../internals/array-buffer-view-core":12}],237:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core"),i=e("../internals/to-length"),o=e("../internals/to-absolute-index"),s=e("../internals/species-constructor"),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("subarray",(function(e,t){var r=a(this),n=r.length;return e=o(e,n),new(s(r,r.constructor))(r.buffer,r.byteOffset+e*r.BYTES_PER_ELEMENT,i((void 0===t?n:o(t,n))-e))}))},{"../internals/array-buffer-view-core":12,"../internals/species-constructor":123,"../internals/to-absolute-index":134,"../internals/to-length":138}],238:[function(e,t,r){"use strict";var n=e("../internals/global"),i=e("../internals/array-buffer-view-core"),o=(e=e("../internals/fails"),n.Int8Array),s=i.aTypedArray,a=(n=i.exportTypedArrayMethod,[].toLocaleString),l=[].slice,c=!!o&&e((function(){a.call(new o(1))}));n("toLocaleString",(function(){return a.apply(c?l.call(s(this)):s(this),arguments)}),e((function(){return[1,2].toLocaleString()!=new o([1,2]).toLocaleString()}))||!e((function(){o.prototype.toLocaleString.call([1,2])})))},{"../internals/array-buffer-view-core":12,"../internals/fails":51,"../internals/global":60}],239:[function(e,t,r){"use strict";var n=e("../internals/array-buffer-view-core").exportTypedArrayMethod,i=e("../internals/fails"),o=(e=(e=e("../internals/global").Uint8Array)&&e.prototype||{},[].toString),s=[].join;i((function(){o.call({})}))&&(o=function(){return s.call(this)}),i=e.toString!=o,n("toString",o,i)},{"../internals/array-buffer-view-core":12,"../internals/fails":51,"../internals/global":60}],240:[function(e,t,r){e("../internals/typed-array-constructor")("Uint16",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},{"../internals/typed-array-constructor":144}],241:[function(e,t,r){e("../internals/typed-array-constructor")("Uint32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},{"../internals/typed-array-constructor":144}],242:[function(e,t,r){e("../internals/typed-array-constructor")("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},{"../internals/typed-array-constructor":144}],243:[function(e,t,r){e("../internals/typed-array-constructor")("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}),!0)},{"../internals/typed-array-constructor":144}],244:[function(e,t,r){"use strict";function n(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}var i,o,s,a,l,c=e("../internals/global"),u=e("../internals/redefine-all"),h=e("../internals/internal-metadata"),d=e("../internals/collection"),p=e("../internals/collection-weak"),f=e("../internals/is-object"),m=e("../internals/internal-state").enforce,y=(e=e("../internals/native-weak-map"),c=!c.ActiveXObject&&"ActiveXObject"in c,Object.isExtensible);t=t.exports=d("WeakMap",n,p),e&&c&&(i=p.getConstructor(n,"WeakMap",!0),h.REQUIRED=!0,d=t.prototype,o=d.delete,s=d.has,a=d.get,l=d.set,u(d,{delete:function(e){var t;return f(e)&&!y(e)?((t=m(this)).frozen||(t.frozen=new i),o.call(this,e)||t.frozen.delete(e)):o.call(this,e)},has:function(e){var t;return f(e)&&!y(e)?((t=m(this)).frozen||(t.frozen=new i),s.call(this,e)||t.frozen.has(e)):s.call(this,e)},get:function(e){var t;return!f(e)||y(e)||((t=m(this)).frozen||(t.frozen=new i),s.call(this,e))?a.call(this,e):t.frozen.get(e)},set:function(e,t){var r;return!f(e)||y(e)||((r=m(this)).frozen||(r.frozen=new i),s.call(this,e))?l.call(this,e,t):r.frozen.set(e,t),this}}))},{"../internals/collection":32,"../internals/collection-weak":31,"../internals/global":60,"../internals/internal-metadata":70,"../internals/internal-state":71,"../internals/is-object":75,"../internals/native-weak-map":86,"../internals/redefine-all":109}],245:[function(e,t,r){var n,i=e("../internals/global"),o=e("../internals/dom-iterables"),s=e("../internals/array-for-each"),a=e("../internals/create-non-enumerable-property");for(n in o){var l;if((l=(l=i[n])&&l.prototype)&&l.forEach!==s)try{a(l,"forEach",s)}catch(e){l.forEach=s}}},{"../internals/array-for-each":16,"../internals/create-non-enumerable-property":38,"../internals/dom-iterables":45,"../internals/global":60}],246:[function(e,t,r){var n,i=e("../internals/global"),o=e("../internals/dom-iterables"),s=e("../modules/es.array.iterator"),a=e("../internals/create-non-enumerable-property"),l=(e=e("../internals/well-known-symbol"))("iterator"),c=e("toStringTag"),u=s.values;for(n in o){var h=i[n],d=h&&h.prototype;if(d){if(d[l]!==u)try{a(d,l,u)}catch(e){d[l]=u}if(d[c]||a(d,c,n),o[n])for(var p in s)if(d[p]!==s[p])try{a(d,p,s[p])}catch(e){d[p]=s[p]}}}},{"../internals/create-non-enumerable-property":38,"../internals/dom-iterables":45,"../internals/global":60,"../internals/well-known-symbol":150,"../modules/es.array.iterator":165}],247:[function(e,t,r){"use strict";function n(e){try{return decodeURIComponent(e)}catch(t){return e}}function i(e){return F[e]}function o(e){return encodeURIComponent(e).replace(N,i)}function s(e){this.entries.length=0,U(this.entries,e)}function a(e,t){if(e<t)throw TypeError("Not enough arguments")}function l(){g(this,l,L);var e,t,r,n,i,o,a,c,u=0<arguments.length?arguments[0]:void 0,h=[];if(P(this,{type:L,entries:h,updateURL:function(){},updateSearchParams:s}),void 0!==u)if(w(u))if("function"==typeof(e=E(u)))for(r=(t=e.call(u)).next;!(n=r.call(t)).done;){if((o=(i=(n=T(x(n.value))).next).call(n)).done||(a=i.call(n)).done||!i.call(n).done)throw TypeError("Expected sequence with length 2");h.push({key:o.value+"",value:a.value+""})}else for(c in u)v(u,c)&&h.push({key:c,value:u[c]+""});else U(h,"string"==typeof u?"?"===u.charAt(0)?u.slice(1):u:u+"")}e("../modules/es.array.iterator");var c=e("../internals/export"),u=e("../internals/get-built-in"),h=e("../internals/native-url"),d=e("../internals/redefine"),p=e("../internals/redefine-all"),f=e("../internals/set-to-string-tag"),m=e("../internals/create-iterator-constructor"),y=e("../internals/internal-state"),g=e("../internals/an-instance"),v=e("../internals/has"),b=e("../internals/function-bind-context"),_=e("../internals/classof"),x=e("../internals/an-object"),w=e("../internals/is-object"),S=e("../internals/object-create"),M=e("../internals/create-property-descriptor"),T=e("../internals/get-iterator"),E=e("../internals/get-iterator-method"),j=(e=e("../internals/well-known-symbol"),u("fetch")),A=u("Headers"),L=(u=e("iterator"),"URLSearchParams"),C=L+"Iterator",P=y.set,R=y.getterFor(L),O=y.getterFor(C),k=/\+/g,I=Array(4),D=function(e){var t,r=e.replace(k," "),i=4;try{return decodeURIComponent(r)}catch(e){for(;i;)r=r.replace((t=i--,I[t-1]||(I[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))),n);return r}},N=/[!'()~]|%20/g,F={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},U=function(e,t){if(t)for(var r,n=t.split("&"),i=0;i<n.length;)(r=n[i++]).length&&(r=r.split("="),e.push({key:D(r.shift()),value:D(r.join("="))}))},B=m((function(e,t){P(this,{type:C,iterator:T(R(e).entries),kind:t})}),"Iterator",(function(){var e,t=(e=O(this)).kind,r=(e=e.iterator.next()).value;return e.done||(e.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),e}));p(e=l.prototype,{append:function(e,t){a(arguments.length,2);var r=R(this);r.entries.push({key:e+"",value:t+""}),r.updateURL()},delete:function(e){a(arguments.length,1);for(var t=R(this),r=t.entries,n=e+"",i=0;i<r.length;)r[i].key===n?r.splice(i,1):i++;t.updateURL()},get:function(e){a(arguments.length,1);for(var t=R(this).entries,r=e+"",n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){a(arguments.length,1);for(var t=R(this).entries,r=e+"",n=[],i=0;i<t.length;i++)t[i].key===r&&n.push(t[i].value);return n},has:function(e){a(arguments.length,1);for(var t=R(this).entries,r=e+"",n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){a(arguments.length,1);for(var r,n=R(this),i=n.entries,o=!1,s=e+"",l=t+"",c=0;c<i.length;c++)(r=i[c]).key===s&&(o?i.splice(c--,1):(o=!0,r.value=l));o||i.push({key:s,value:l}),n.updateURL()},sort:function(){for(var e,t,r=R(this),n=r.entries,i=n.slice(),o=n.length=0;o<i.length;o++){for(e=i[o],t=0;t<o;t++)if(n[t].key>e.key){n.splice(t,0,e);break}t===o&&n.push(e)}r.updateURL()},forEach:function(e){for(var t,r=R(this).entries,n=b(e,1<arguments.length?arguments[1]:void 0,3),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new B(this,"keys")},values:function(){return new B(this,"values")},entries:function(){return new B(this,"entries")}},{enumerable:!0}),d(e,u,e.entries),d(e,"toString",(function(){for(var e,t=R(this).entries,r=[],n=0;n<t.length;)e=t[n++],r.push(o(e.key)+"="+o(e.value));return r.join("&")}),{enumerable:!0}),f(l,L),c({global:!0,forced:!h},{URLSearchParams:l}),h||"function"!=typeof j||"function"!=typeof A||c({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,r,n;return e=[e],1<arguments.length&&(w(t=arguments[1])&&(r=t.body,_(r)===L&&((n=t.headers?new A(t.headers):new A).has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=S(t,{body:M(0,String(r)),headers:M(0,n)}))),e.push(t)),j.apply(this,e)}}),t.exports={URLSearchParams:l,getState:R}},{"../internals/an-instance":9,"../internals/an-object":10,"../internals/classof":29,"../internals/create-iterator-constructor":37,"../internals/create-property-descriptor":39,"../internals/export":50,"../internals/function-bind-context":55,"../internals/get-built-in":57,"../internals/get-iterator":59,"../internals/get-iterator-method":58,"../internals/has":61,"../internals/internal-state":71,"../internals/is-object":75,"../internals/native-url":85,"../internals/object-create":91,"../internals/redefine":110,"../internals/redefine-all":109,"../internals/set-to-string-tag":119,"../internals/well-known-symbol":150,"../modules/es.array.iterator":165}],248:[function(e,t,r){"use strict";function n(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)t.unshift(e%256),e=C(e/256);return t.join(".")}if("object"!=typeof e)return e;for(t="",n=Y(e),r=0;r<8;r++)i&&0===e[r]||(i=i&&!1,n===r?(t+=r?":":"::",i=!0):(t+=e[r].toString(16),r<7&&(t+=":")));return"["+t+"]"}function i(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme}function o(e,t,r,n){var i,o,s,a=r||le,c=0,u="",h=!1,d=!1,p=!1;for(r||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(W,"")),t=t.replace(q,""),i=_(t);c<=i.length;){switch(o=i[c],a){case le:if(!o||!D.test(o)){if(r)return O;a=ue;continue}u+=o.toLowerCase(),a=ce;break;case ce:if(o&&(N.test(o)||"+"==o||"-"==o||"."==o))u+=o.toLowerCase();else{if(":"!=o){if(r)return O;u="",a=ue,c=0;continue}if(r&&(te(e)!=v(ee,u)||"file"==u&&(re(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=u,r)return void(te(e)&&ee[e.scheme]==e.port&&(e.port=null));u="","file"==e.scheme?a=xe:te(e)&&n&&n.scheme==e.scheme?a=he:te(e)?a=me:"/"==i[c+1]?(a=de,c++):(e.cannotBeABaseURL=!0,e.path.push(""),a=Ee)}break;case ue:if(!n||n.cannotBeABaseURL&&"#"!=o)return O;if(n.cannotBeABaseURL&&"#"==o){e.scheme=n.scheme,e.path=n.path.slice(),e.query=n.query,e.fragment="",e.cannotBeABaseURL=!0,a=Ae;break}a="file"==n.scheme?xe:pe;continue;case he:if("/"!=o||"/"!=i[c+1]){a=pe;continue}a=ye,c++;break;case de:if("/"==o){a=ge;break}a=Te;continue;case pe:if(e.scheme=n.scheme,o==l)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query;else if("/"==o||"\\"==o&&te(e))a=fe;else if("?"==o)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query="",a=je;else{if("#"!=o){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.path.pop(),a=Te;continue}e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query,e.fragment="",a=Ae}break;case fe:if(!te(e)||"/"!=o&&"\\"!=o){if("/"!=o){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,a=Te;continue}a=ge}else a=ye;break;case me:if(a=ye,"/"!=o||"/"!=u.charAt(c+1))continue;c++;break;case ye:if("/"==o||"\\"==o)break;a=ge;continue;case ge:if("@"==o){h&&(u="%40"+u),h=!0;for(var f=_(u),m=0;m<f.length;m++){var y=f[m];":"!=y||p?(y=$(y,Q),p?e.password+=y:e.username+=y):p=!0}u=""}else if(o==l||"/"==o||"?"==o||"#"==o||"\\"==o&&te(e)){if(h&&""==u)return R;c-=_(u).length+1,u="",a=ve}else u+=o;break;case ve:case be:if(r&&"file"==e.scheme){a=Se;continue}if(":"!=o||d){if(o==l||"/"==o||"?"==o||"#"==o||"\\"==o&&te(e)){if(te(e)&&""==u)return k;if(r&&""==u&&(re(e)||null!==e.port))return;if(s=X(e,u))return s;if(u="",a=Me,r)return;continue}"["==o?d=!0:"]"==o&&(d=!1),u+=o}else{if(""==u)return k;if(s=X(e,u))return s;if(u="",a=_e,r==be)return}break;case _e:if(!F.test(o)){if(o==l||"/"==o||"?"==o||"#"==o||"\\"==o&&te(e)||r){if(""!=u){var g=parseInt(u,10);if(65535<g)return I;e.port=te(e)&&g===ee[e.scheme]?null:g,u=""}if(r)return;a=Me;continue}return I}u+=o;break;case xe:if(e.scheme="file","/"==o||"\\"==o)a=we;else{if(!n||"file"!=n.scheme){a=Te;continue}if(o==l)e.host=n.host,e.path=n.path.slice(),e.query=n.query;else if("?"==o)e.host=n.host,e.path=n.path.slice(),e.query="",a=je;else{if("#"!=o){ie(i.slice(c).join(""))||(e.host=n.host,e.path=n.path.slice(),oe(e)),a=Te;continue}e.host=n.host,e.path=n.path.slice(),e.query=n.query,e.fragment="",a=Ae}}break;case we:if("/"==o||"\\"==o){a=Se;break}n&&"file"==n.scheme&&!ie(i.slice(c).join(""))&&(ne(n.path[0],!0)?e.path.push(n.path[0]):e.host=n.host),a=Te;continue;case Se:if(o==l||"/"==o||"\\"==o||"?"==o||"#"==o){if(!r&&ne(u))a=Te;else{if(""==u){if(e.host="",r)return}else{if(s=X(e,u))return s;if("localhost"==e.host&&(e.host=""),r)return;u=""}a=Me}continue}u+=o;break;case Me:if(te(e)){if(a=Te,"/"!=o&&"\\"!=o)continue}else if(r||"?"!=o)if(r||"#"!=o){if(o!=l&&(a=Te,"/"!=o))continue}else e.fragment="",a=Ae;else e.query="",a=je;break;case Te:if(o==l||"/"==o||"\\"==o&&te(e)||!r&&("?"==o||"#"==o)){if(ae(u)?(oe(e),"/"==o||"\\"==o&&te(e)||e.path.push("")):se(u)?"/"==o||"\\"==o&&te(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&ne(u)&&(e.host&&(e.host=""),u=u.charAt(0)+":"),e.path.push(u)),u="","file"==e.scheme&&(o==l||"?"==o||"#"==o))for(;1<e.path.length&&""===e.path[0];)e.path.shift();"?"==o?(e.query="",a=je):"#"==o&&(e.fragment="",a=Ae)}else u+=$(o,K);break;case Ee:"?"==o?(e.query="",a=je):"#"==o?(e.fragment="",a=Ae):o!=l&&(e.path[0]+=$(o,Z));break;case je:r||"#"!=o?o!=l&&("'"==o&&te(e)?e.query+="%27":e.query+="#"==o?"%23":$(o,Z)):(e.fragment="",a=Ae);break;case Ae:o!=l&&(e.fragment+=$(o,J))}c++}}function s(e){var t,r,n=g(this,s,"URL"),i=1<arguments.length?arguments[1]:void 0,a=(e=String(e),A(n,{type:"URL"}));if(void 0!==i)if(i instanceof s)t=L(i);else if(r=o(t={},String(i)))throw TypeError(r);if(r=o(a,e,null,t))throw TypeError(r);var l=a.searchParams=new E;(i=j(l)).updateSearchParams(a.query),i.updateURL=function(){a.query=String(l)||null},d||(n.href=Le.call(n),n.origin=Ce.call(n),n.protocol=Pe.call(n),n.username=Re.call(n),n.password=Oe.call(n),n.host=ke.call(n),n.hostname=Ie.call(n),n.port=De.call(n),n.pathname=Ne.call(n),n.search=Fe.call(n),n.searchParams=Ue.call(n),n.hash=Be.call(n))}function a(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}}e("../modules/es.string.iterator");var l,c,u,h=e("../internals/export"),d=e("../internals/descriptors"),p=e("../internals/native-url"),f=e("../internals/global"),m=e("../internals/object-define-properties"),y=e("../internals/redefine"),g=e("../internals/an-instance"),v=e("../internals/has"),b=e("../internals/object-assign"),_=e("../internals/array-from"),x=e("../internals/string-multibyte").codeAt,w=e("../internals/string-punycode-to-ascii"),S=e("../internals/set-to-string-tag"),M=e("../modules/web.url-search-params"),T=(e=e("../internals/internal-state"),f.URL),E=M.URLSearchParams,j=M.getState,A=e.set,L=e.getterFor("URL"),C=Math.floor,P=Math.pow,R="Invalid authority",O="Invalid scheme",k="Invalid host",I="Invalid port",D=/[A-Za-z]/,N=/[\d+-.A-Za-z]/,F=/\d/,U=/^(0x|0X)/,B=/^[0-7]+$/,z=/^\d+$/,G=/^[\dA-Fa-f]+$/,V=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,H=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,W=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,q=/[\u0009\u000A\u000D]/g,X=function(e,t){var r,n,i;if("["==t.charAt(0))return"]"==t.charAt(t.length-1)&&(r=function(e){var t,r,n,i,o,s,a,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,d=function(){return e.charAt(h)};if(":"==d()){if(":"!=e.charAt(1))return;h+=2,u=++c}for(;d();){if(8==c)return;if(":"!=d()){for(t=r=0;r<4&&G.test(d());)t=16*t+parseInt(d(),16),h++,r++;if("."==d()){if(0==r)return;if(h-=r,c>6)return;for(n=0;d();){if(i=null,n>0){if(!("."==d()&&n<4))return;h++}if(!F.test(d()))return;for(;F.test(d());){if(o=parseInt(d(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;h++}l[c]=256*l[c]+i,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==d()){if(h++,!d())return}else if(d())return;l[c++]=t}else{if(null!==u)return;h++,u=++c}}if(null!==u)for(s=c-u,c=7;0!=c&&s>0;)a=l[c],l[c--]=l[u+s-1],l[u+--s]=a;else if(8!=c)return;return l}(t.slice(1,-1)))?void(e.host=r):k;if(te(e))return t=w(t),V.test(t)||null===(r=function(e){var t,r,n,i,o,s,a,l=e.split(".");if(l.length&&""==l[l.length-1]&&l.pop(),(t=l.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=l[n]))return e;if(o=10,i.length>1&&"0"==i.charAt(0)&&(o=U.test(i)?16:8,i=i.slice(8==o?1:2)),""===i)s=0;else{if(!(10==o?z:8==o?B:G).test(i))return e;s=parseInt(i,o)}r.push(s)}for(n=0;n<t;n++)if(s=r[n],n==t-1){if(s>=P(256,5-t))return null}else if(s>255)return null;for(a=r.pop(),n=0;n<r.length;n++)a+=r[n]*P(256,3-n);return a}(t))?k:void(e.host=r);if(H.test(t))return k;for(r="",n=_(t),i=0;i<n.length;i++)r+=$(n[i],Z);e.host=r},Y=function(e){for(var t=null,r=1,n=null,i=0,o=0;o<8;o++)0!==e[o]?(r<i&&(t=n,r=i),n=null,i=0):(null===n&&(n=o),++i);return r<i&&(t=n,r=i),t},Z={},J=b({},Z,{" ":1,'"':1,"<":1,">":1,"`":1}),K=b({},J,{"#":1,"?":1,"{":1,"}":1}),Q=b({},K,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),$=function(e,t){var r=x(e,0);return 32<r&&r<127&&!v(t,e)?e:encodeURIComponent(e)},ee={ftp:21,file:null,http:80,https:443,ws:80,wss:443},te=function(e){return v(ee,e.scheme)},re=function(e){return""!=e.username||""!=e.password},ne=function(e,t){return 2==e.length&&D.test(e.charAt(0))&&(":"==(e=e.charAt(1))||!t&&"|"==e)},ie=function(e){return 1<e.length&&ne(e.slice(0,2))&&(2==e.length||"/"===(e=e.charAt(2))||"\\"===e||"?"===e||"#"===e)},oe=function(e){var t=e.path,r=t.length;!r||"file"==e.scheme&&1==r&&ne(t[0],!0)||t.pop()},se=function(e){return"."===e||"%2e"===e.toLowerCase()},ae=function(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e},le={},ce={},ue={},he={},de={},pe={},fe={},me={},ye={},ge={},ve={},be={},_e={},xe={},we={},Se={},Me={},Te={},Ee={},je={},Ae={},Le=(f=s.prototype,function(){var e=L(this),t=e.scheme,r=e.username,i=e.password,o=e.host,s=e.port,a=e.path,l=e.query,c=e.fragment,u=t+":";return null!==o?(u+="//",re(e)&&(u+=r+(i?":"+i:"")+"@"),u+=n(o),null!==s&&(u+=":"+s)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==l&&(u+="?"+l),null!==c&&(u+="#"+c),u}),Ce=function(){var e=L(this),t=e.scheme,r=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&te(e)?t+"://"+n(e.host)+(null!==r?":"+r:""):"null"},Pe=function(){return L(this).scheme+":"},Re=function(){return L(this).username},Oe=function(){return L(this).password},ke=function(){var e=(t=L(this)).host,t=t.port;return null===e?"":null===t?n(e):n(e)+":"+t},Ie=function(){var e=L(this).host;return null===e?"":n(e)},De=function(){var e=L(this).port;return null===e?"":String(e)},Ne=function(){var e=L(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Fe=function(){var e=L(this).query;return e?"?"+e:""},Ue=function(){return L(this).searchParams},Be=function(){var e=L(this).fragment;return e?"#"+e:""};d&&m(f,{href:a(Le,(function(e){var t=L(this);if(e=o(t,e=String(e)))throw TypeError(e);j(t.searchParams).updateSearchParams(t.query)})),origin:a(Ce),protocol:a(Pe,(function(e){o(L(this),String(e)+":",le)})),username:a(Re,(function(e){var t=L(this),r=_(String(e));if(!i(t)){t.username="";for(var n=0;n<r.length;n++)t.username+=$(r[n],Q)}})),password:a(Oe,(function(e){var t=L(this),r=_(String(e));if(!i(t)){t.password="";for(var n=0;n<r.length;n++)t.password+=$(r[n],Q)}})),host:a(ke,(function(e){var t=L(this);t.cannotBeABaseURL||o(t,String(e),ve)})),hostname:a(Ie,(function(e){var t=L(this);t.cannotBeABaseURL||o(t,String(e),be)})),port:a(De,(function(e){var t=L(this);i(t)||(""==(e=String(e))?t.port=null:o(t,e,_e))})),pathname:a(Ne,(function(e){var t=L(this);t.cannotBeABaseURL||(t.path=[],o(t,e+"",Me))})),search:a(Fe,(function(e){var t=L(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",o(t,e,je)),j(t.searchParams).updateSearchParams(t.query)})),searchParams:a(Ue),hash:a(Be,(function(e){var t=L(this);""==(e=String(e))?t.fragment=null:("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",o(t,e,Ae))}))}),y(f,"toJSON",(function(){return Le.call(this)}),{enumerable:!0}),y(f,"toString",(function(){return Le.call(this)}),{enumerable:!0}),T&&(c=T.createObjectURL,u=T.revokeObjectURL,c&&y(s,"createObjectURL",(function(e){return c.apply(T,arguments)})),u&&y(s,"revokeObjectURL",(function(e){return u.apply(T,arguments)}))),S(s,"URL"),h({global:!0,forced:!p,sham:!d},{URL:s})},{"../internals/an-instance":9,"../internals/array-from":17,"../internals/descriptors":43,"../internals/export":50,"../internals/global":60,"../internals/has":61,"../internals/internal-state":71,"../internals/native-url":85,"../internals/object-assign":90,"../internals/object-define-properties":92,"../internals/redefine":110,"../internals/set-to-string-tag":119,"../internals/string-multibyte":125,"../internals/string-punycode-to-ascii":128,"../modules/es.string.iterator":200,"../modules/web.url-search-params":247}],249:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":250}],250:[function(e,t,r){(function(n,i){var o;o=function(){"use strict";function t(e){return"function"==typeof e}var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=0,s=void 0,a=void 0,l=function(e,t){f[o]=e,f[o+1]=t,2===(o+=2)&&(a?a(m):b())},c="undefined"!=typeof window?window:void 0,u=(u=c||{}).MutationObserver||u.WebKitMutationObserver,h="undefined"==typeof self&&void 0!==n&&"[object process]"==={}.toString.call(n),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var e=setTimeout;return function(){return e(m,1)}}var f=new Array(1e3);function m(){for(var e=0;e<o;e+=2)(0,f[e])(f[e+1]),f[e]=void 0,f[e+1]=void 0;o=0}var y,g,v,b=void 0;function _(e,t){var r,n=this,i=new this.constructor(S),o=(void 0===i[w]&&D(i),n._state);return o?(r=arguments[o-1],l((function(){return k(o,i,r,n._result)}))):R(n,i,e,t),i}function x(e){var t;return e&&"object"==typeof e&&e.constructor===this?e:(A(t=new this(S),e),t)}b=h?function(){return n.nextTick(m)}:u?(g=0,h=new u(m),v=document.createTextNode(""),h.observe(v,{characterData:!0}),function(){v.data=g=++g%2}):d?((y=new MessageChannel).port1.onmessage=m,function(){return y.port2.postMessage(0)}):(void 0===c&&"function"==typeof e?function(){try{var e=Function("return this")().require("vertx");return void 0!==(s=e.runOnLoop||e.runOnContext)?function(){s(m)}:p()}catch(e){return p()}}:p)();var w=Math.random().toString(36).substring(2);function S(){}var M=void 0,T=1,E=2;function j(e,r,n){var i,o;r.constructor===e.constructor&&n===_&&r.constructor.resolve===x?(i=e,(o=r)._state===T?C(i,o._result):o._state===E?P(i,o._result):R(o,void 0,(function(e){return A(i,e)}),(function(e){return P(i,e)}))):void 0!==n&&t(n)?function(e,t,r){l((function(e){var n=!1,i=function(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}(r,t,(function(r){n||(n=!0,(t!==r?A:C)(e,r))}),(function(t){n||(n=!0,P(e,t))}),e._label);!n&&i&&(n=!0,P(e,i))}),e)}(e,r,n):C(e,r)}function A(e,t){if(e===t)P(e,new TypeError("You cannot resolve a promise with itself"));else if(r=typeof t,null===t||"object"!=r&&"function"!=r)C(e,t);else{r=void 0;try{r=t.then}catch(t){return void P(e,t)}j(e,t,r)}var r}function L(e){e._onerror&&e._onerror(e._result),O(e)}function C(e,t){e._state===M&&(e._result=t,e._state=T,0!==e._subscribers.length&&l(O,e))}function P(e,t){e._state===M&&(e._state=E,e._result=t,l(L,e))}function R(e,t,r,n){var i=e._subscribers,o=i.length;e._onerror=null,i[o]=t,i[o+T]=r,i[o+E]=n,0===o&&e._state&&l(O,e)}function O(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n,i=void 0,o=e._result,s=0;s<t.length;s+=3)n=t[s],i=t[s+r],n?k(r,n,i,o):i(o);e._subscribers.length=0}}function k(e,r,n,i){var o=t(n),s=void 0,a=void 0,l=!0;if(o){try{s=n(i)}catch(e){l=!1,a=e}if(r===s)return void P(r,new TypeError("A promises callback cannot return that same promise."))}else s=i;r._state===M&&(o&&l?A(r,s):!1===l?P(r,a):e===T?C(r,s):e===E&&P(r,s))}var I=0;function D(e){e[w]=I++,e._state=void 0,e._result=void 0,e._subscribers=[]}F.prototype._enumerate=function(e){for(var t=0;this._state===M&&t<e.length;t++)this._eachEntry(e[t],t)},F.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===x){var i,o=void 0,s=void 0,a=!1;try{o=e.then}catch(t){a=!0,s=t}o===_&&e._state!==M?this._settledAt(e._state,t,e._result):"function"!=typeof o?(this._remaining--,this._result[t]=e):r===U?(i=new r(S),a?P(i,s):j(i,e,o),this._willSettleAt(i,t)):this._willSettleAt(new r((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},F.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===M&&(this._remaining--,e===E?P(n,r):this._result[t]=r),0===this._remaining&&C(n,this._result)},F.prototype._willSettleAt=function(e,t){var r=this;R(e,void 0,(function(e){return r._settledAt(T,t,e)}),(function(e){return r._settledAt(E,t,e)}))};var N=F;function F(e,t){this._instanceConstructor=e,this.promise=new e(S),this.promise[w]||D(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0!==this.length&&(this.length=this.length||0,this._enumerate(t),0!==this._remaining)||C(this.promise,this._result)):P(this.promise,new Error("Array Methods must be provided an Array"))}B.prototype.catch=function(e){return this.then(null,e)},B.prototype.finally=function(e){var r=this.constructor;return t(e)?this.then((function(t){return r.resolve(e()).then((function(){return t}))}),(function(t){return r.resolve(e()).then((function(){throw t}))})):this.then(e,e)};var U=B;function B(e){if(this[w]=I++,this._result=this._state=void 0,this._subscribers=[],S!==e){if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof B))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");var t=this;try{e((function(e){A(t,e)}),(function(e){P(t,e)}))}catch(e){P(t,e)}}}return U.prototype.then=_,U.all=function(e){return new N(this,e).promise},U.race=function(e){var t=this;return r(e)?new t((function(r,n){for(var i=e.length,o=0;o<i;o++)t.resolve(e[o]).then(r,n)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))},U.resolve=x,U.reject=function(e){var t=new this(S);return P(t,e),t},U._setScheduler=function(e){a=e},U._setAsap=function(e){l=e},U._asap=l,U.polyfill=function(){var e=void 0;if(void 0!==i)e=i;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=U},U.Promise=U},"object"==typeof r&&void 0!==t?t.exports=o():this.ES6Promise=o()}).call(this,e("_process"),void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:259}],251:[function(e,t,r){var n;n=function(e,t){"use strict";function r(e){try{delete window[e]}catch(t){window[e]=void 0}}function n(e){(e=document.getElementById(e))&&document.getElementsByTagName("head")[0].removeChild(e)}t.exports=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=e,o=t.timeout||5e3,s=t.jsonpCallback||"callback",a=void 0;return new Promise((function(l,c){var u=t.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),h=s+"_"+u,d=(window[u]=function(e){l({ok:!0,json:function(){return Promise.resolve(e)}}),a&&clearTimeout(a),n(h),r(u)},i+=-1===i.indexOf("?")?"?":"&",document.createElement("script"));d.setAttribute("src",""+i+s+"="+u),t.charset&&d.setAttribute("charset",t.charset),d.id=h,document.getElementsByTagName("head")[0].appendChild(d),a=setTimeout((function(){c(new Error("JSONP request to "+e+" timed out")),r(u),n(h),window[u]=function(){r(u)}}),o),d.onerror=function(){c(new Error("JSONP request to "+e+" failed")),r(u),n(h),a&&clearTimeout(a)}}))}},void 0!==r&&void 0!==t?n(0,t):(n(n={exports:{}},n),this.fetchJsonp=n.exports)},{}],252:[function(e,t,r){var n=function(e){"use strict";var t,r,n,i,o,s,a,l,c,u;if(!(void 0===e||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)))return u=e.document,t=function(){return e.URL||e.webkitURL||e},r=u.createElementNS("http://www.w3.org/1999/xhtml","a"),n="download"in r,i=/constructor/i.test(e.HTMLElement)||e.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent),s=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},a=function(e){setTimeout((function(){"string"==typeof e?t().revokeObjectURL(e):e.remove()}),4e4)},l=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},u=(c=function(c,u,h){h||(c=l(c));var d,p,f=this,m=(h="application/octet-stream"===c.type,function(){for(var e=f,t="writestart progress write writeend".split(" "),r=(t=[].concat(t)).length;r--;){var n=e["on"+t[r]];if("function"==typeof n)try{n.call(e,e)}catch(e){s(e)}}});f.readyState=f.INIT,n?(d=t().createObjectURL(c),setTimeout((function(){var e,t;r.href=d,r.download=u,e=r,t=new MouseEvent("click"),e.dispatchEvent(t),m(),a(d),f.readyState=f.DONE}))):(o||h&&i)&&e.FileReader?((p=new FileReader).onloadend=function(){var t=o?p.result:p.result.replace(/^data:[^;]*;/,"data:attachment/file;");e.open(t,"_blank")||(e.location.href=t),t=void 0,f.readyState=f.DONE,m()},p.readAsDataURL(c),f.readyState=f.INIT):(d=d||t().createObjectURL(c),!h&&e.open(d,"_blank")||(e.location.href=d),f.readyState=f.DONE,m(),a(d))}).prototype,"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,r){return t=t||e.name||"download",r||(e=l(e)),navigator.msSaveOrOpenBlob(e,t)}:(u.abort=function(){},u.readyState=u.INIT=0,u.WRITING=1,u.DONE=2,u.error=u.onwritestart=u.onprogress=u.onwrite=u.onabort=u.onerror=u.onwriteend=null,function(e,t,r){return new c(e,t||e.name||"download",r)})}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);void 0!==t&&t.exports&&(t.exports.saveAs=n)},{}],253:[function(e,t,r){var n,i=Object.defineProperty,o=(i(r,"__esModule",{value:!0}),r),s={GIFEncoder:()=>w,applyPalette:()=>function(e,t,r="rgb565"){if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(256<t.length)throw new Error("applyPalette() only works with 256 colors or less");const n=new Uint32Array(e.buffer),i=n.length,o="rgb444"===r?4096:65536,s=new Uint8Array(i),a=new Array(o);if("rgba4444"===r)for(let e=0;e<i;e++){var l,c=(l=n[e])>>24&255,u=l>>16&255,f=l>>8&255,m=(m=d(l&=255,f,u,c))in a?a[m]:a[m]=function(e,t,r,n,i){let o=0,s=1e100;for(let c=0;c<i.length;c++){var a=i[c],l=b(a[3]-n);l>s||(l+=b(a[0]-e))>s||(l+=b(a[1]-t))>s||(l+=b(a[2]-r))>s||(s=l,o=c)}return o}(l,f,u,c,t);s[e]=m}else{const e="rgb444"===r?p:h;for(let r=0;r<i;r++){var y,g=(y=n[r])>>16&255,v=y>>8&255,_=(_=e(y&=255,v,g))in a?a[_]:a[_]=function(e,t,r,n){let i=0,o=1e100;for(let l=0;l<n.length;l++){var s=n[l],a=b(s[0]-e);a>o||(a+=b(s[1]-t))>o||(a+=b(s[2]-r))>o||(o=a,i=l)}return i}(y,v,g,t);s[r]=_}}return s},default:()=>j,nearestColor:()=>function(e,t,r=g){return e[_(e,t,r)]},nearestColorIndex:()=>_,nearestColorIndexWithDistance:()=>x,prequantize:()=>function(e,{roundRGB:t=5,roundAlpha:r=10,oneBitAlpha:n=null}={}){const i=new Uint32Array(e.buffer);for(let e=0;e<i.length;e++){let l=(a=i[e])>>24&255;var o=a>>16&255,s=a>>8&255,a=255&a;l=v(l,r),n&&(l=l<=("number"==typeof n?n:127)?0:255),a=v(a,t),s=v(s,t),o=v(o,t),i[e]=l<<24|o<<16|s<<8|a}},quantize:()=>function(e,t,r={}){var{format:n="rgb565",clearAlpha:i=!0,clearAlphaColor:o=0,clearAlphaThreshold:s=0,oneBitAlpha:a=!1}=r;if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");e=new Uint32Array(e.buffer);let l=!1!==r.useSqrt;const c="rgba4444"===n,u=function(e,t){const r=new Array("rgb444"===t?4096:65536),n=e.length;if("rgba4444"===t)for(let t=0;t<n;++t){var i,o=(i=e[t])>>24&255,s=i>>16&255,a=i>>8&255,l=d(i&=255,a,s,o);let n=l in r?r[l]:r[l]={ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0};n.rc+=i,n.gc+=a,n.bc+=s,n.ac+=o,n.cnt++}else if("rgb444"===t)for(let t=0;t<n;++t){var c,u=(c=e[t])>>16&255,f=c>>8&255,m=p(c&=255,f,u);let n=m in r?r[m]:r[m]={ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0};n.rc+=c,n.gc+=f,n.bc+=u,n.cnt++}else for(let t=0;t<n;++t){var y,g=(y=e[t])>>16&255,v=y>>8&255,b=h(y&=255,v,g);let n=b in r?r[b]:r[b]={ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0};n.rc+=y,n.gc+=v,n.bc+=g,n.cnt++}return r}(e,n),g=u.length,v=g-1,b=new Uint32Array(g+1);for(var _=0,x=0;x<g;++x){const e=u[x];null!=e&&(R=1/e.cnt,c&&(e.ac*=R),e.rc*=R,e.gc*=R,e.bc*=R,u[_++]=e)}var w,S,M;for(m(t)/_<.022&&(l=!1),x=0;x<_-1;++x)u[x].fw=x+1,u[x+1].bk=x,l&&(u[x].cnt=Math.sqrt(u[x].cnt));for(l&&(u[x].cnt=Math.sqrt(u[x].cnt)),x=0;x<_;++x){y(u,x,!1);var T=u[x].err;for(S=++b[0];1<S&&!(u[w=b[M=S>>1]].err<=T);S=M)b[S]=w;b[S]=x}var E,j=_-t;for(x=0;x<j;){for(;;){var A=b[1];if((E=u[A]).tm>=E.mtm&&u[E.nn].mtm<=E.tm)break;for(E.mtm==v?A=b[1]=b[b[0]--]:(y(u,A,!1),E.tm=x),T=u[A].err,S=1;(M=S+S)<=b[0]&&(M<b[0]&&u[b[M]].err>u[b[M+1]].err&&M++,!(T<=u[w=b[M]].err));S=M)b[S]=w;b[S]=A}var L=u[E.nn],C=E.cnt,P=L.cnt,R=1/(C+P);c&&(E.ac=R*(C*E.ac+P*L.ac)),E.rc=R*(C*E.rc+P*L.rc),E.gc=R*(C*E.gc+P*L.gc),E.bc=R*(C*E.bc+P*L.bc),E.cnt+=L.cnt,E.mtm=++x,u[L.bk].fw=L.fw,u[L.fw].bk=L.bk,L.mtm=v}let O=[];for(x=0;;0){let e=f(Math.round(u[x].rc),0,255),t=f(Math.round(u[x].gc),0,255),r=f(Math.round(u[x].bc),0,255),n=255;c&&(n=f(Math.round(u[x].ac),0,255),a&&(n=n<=(k="number"==typeof a?a:127)?0:255),i&&n<=s&&(e=t=r=o,n=0));var k=c?[e,t,r,n]:[e,t,r];if(function(e,t){for(let i=0;i<e.length;i++){var r=(n=e[i])[0]===t[0]&&n[1]===t[1]&&n[2]===t[2],n=!(4<=n.length&&4<=t.length)||n[3]===t[3];if(r&&n)return!0}return!1}(O,k)||O.push(k),0==(x=u[x].fw))break}return O},snapColorsToPalette:()=>function(e,t,r=5){if(e.length&&t.length){var n=e.map((e=>e.slice(0,3))),i=r*r,o=e[0].length;for(let r=0;r<t.length;r++){let l=t[r];l=l.length<o?[l[0],l[1],l[2],255]:l.length>o?l.slice(0,3):l.slice();var s,a=(s=x(n,l.slice(0,3),g))[0];0<(s=s[1])&&s<=i&&(e[a]=l)}}}};for(n in s)i(o,n,{get:s[n],enumerable:!0});var a={signature:"GIF",version:"89a",trailer:59,extensionIntroducer:33,applicationExtensionLabel:255,graphicControlExtensionLabel:249,imageSeparator:44,signatureSize:3,versionSize:3,globalColorTableFlagMask:128,colorResolutionMask:112,sortFlagMask:8,globalColorTableSizeMask:7,applicationIdentifierSize:8,applicationAuthCodeSize:3,disposalMethodMask:28,userInputFlagMask:2,transparentColorFlagMask:1,localColorTableFlagMask:128,interlaceFlagMask:64,idSortFlagMask:32,localColorTableSizeMask:7};function l(e=256){let t=0,r=new Uint8Array(e);return{get buffer(){return r.buffer},reset(){t=0},bytesView(){return r.subarray(0,t)},bytes(){return r.slice(0,t)},writeByte(e){n(t+1),r[t]=e,t++},writeBytes(e,i=0,o=e.length){n(t+o);for(let n=0;n<o;n++)r[t++]=e[n+i]},writeBytesView(e,i=0,o=e.byteLength){n(t+o),r.set(e.subarray(i,i+o),t),t+=o}};function n(e){var n=r.length;if(!(e<=n)){e=Math.max(e,n*(n<1048576?2:1.125)>>>0),0!=n&&(e=Math.max(e,256));const i=r;r=new Uint8Array(e),0<t&&r.set(i.subarray(0,t),0)}}}var c=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],u=function(e,t,r,n,i=l(512),o=new Uint8Array(256),s=new Int32Array(5003),a=new Int32Array(5003)){var u=s.length;n=Math.max(2,n),o.fill(0),a.fill(0),s.fill(-1);let h=0,d=0;var p=n+1;const f=p;let m=!1,y=f,g=(1<<y)-1;var v=1<<p-1;const b=1+v;let _=2+v,x=0,w=r[0],S=0;for(let e=u;e<65536;e*=2)++S;S=8-S,i.writeByte(n),A(v);var M=r.length;for(let e=1;e<M;e++)e:{var T=r[e],E=(T<<12)+w;let t=T<<S^w;if(s[t]===E)w=a[t];else{for(var j=0===t?1:u-t;0<=s[t];)if((t-=j)<0&&(t+=u),s[t]===E){w=a[t];break e}A(w),w=T,_<4096?(a[t]=_++,s[t]=E):(s.fill(-1),_=2+v,m=!0,A(v))}}return A(w),A(b),i.writeByte(0),i.bytesView();function A(e){for(h&=c[d],0<d?h|=e<<d:h=e,d+=y;8<=d;)o[x++]=255&h,254<=x&&(i.writeByte(x),i.writeBytesView(o,0,x),x=0),h>>=8,d-=8;if((_>g||m)&&(m?(y=f,g=(1<<y)-1,m=!1):(++y,g=12===y?1<<y:(1<<y)-1)),e==b){for(;0<d;)o[x++]=255&h,254<=x&&(i.writeByte(x),i.writeBytesView(o,0,x),x=0),h>>=8,d-=8;0<x&&(i.writeByte(x),i.writeBytesView(o,0,x),x=0)}}};function h(e,t,r){return e<<8&63488|t<<2&992|r>>3}function d(e,t,r,n){return e>>4|240&t|(240&r)<<4|(240&n)<<8}function p(e,t,r){return e>>4<<8|240&t|r>>4}function f(e,t,r){return e<t?t:r<e?r:e}function m(e){return e*e}function y(e,t,r){var n=0,i=1e100;const o=e[t];for(var s=o.cnt,a=o.ac,l=o.rc,c=o.gc,u=o.bc,h=o.fw;0!=h;h=e[h].fw){var d,p,f=e[h];i<=(p=s*(p=f.cnt)/(s+p))||(d=0,r&&i<=(d+=p*m(f.ac-a))||i<=(d+=p*m(f.rc-l))||i<=(d+=p*m(f.gc-c))||i<=(d+=p*m(f.bc-u))||(i=d,n=h))}o.err=i,o.nn=n}function g(e,t){for(var r=0,n=0;n<e.length;n++){var i=e[n]-t[n];r+=i*i}return r}function v(e,t){return 1<t?Math.round(e/t)*t:e}function b(e){return e*e}function _(e,t,r=g){let n=1/0,i=-1;for(let s=0;s<e.length;s++){var o=r(t,e[s]);o<n&&(n=o,i=s)}return i}function x(e,t,r=g){let n=1/0,i=-1;for(let s=0;s<e.length;s++){var o=r(t,e[s]);o<n&&(n=o,i=s)}return[i,n]}function w(e={}){const{initialCapacity:t=4096,auto:r=!0}=e,n=l(t),i=new Uint8Array(256),o=new Int32Array(5003),s=new Int32Array(5003);let c=!1;return{reset(){n.reset(),c=!1},finish(){n.writeByte(a.trailer)},bytes(){return n.bytes()},bytesView(){return n.bytesView()},get buffer(){return n.buffer},get stream(){return n},writeHeader:h,writeFrame(e,t,a,l={}){var{transparent:d=!1,transparentIndex:p=0,delay:f=0,palette:m=null,repeat:y=0,colorDepth:g=8,dispose:v=-1}=l;let b=!1;if(r?c||(b=!0,h(),c=!0):b=Boolean(l.first),t=Math.max(0,Math.floor(t)),a=Math.max(0,Math.floor(a)),b){if(!m)throw new Error("First frame must include a { palette } option");var[l,_,x,w,j=8]=[n,t,a,m,g];j=128|j-1<<4|(w=E(w.length)-1),M(l,_),M(l,x),l.writeBytes([j,0,0]),S(n,m),0<=y&&(_=y,(w=n).writeByte(33),w.writeByte(255),w.writeByte(11),T(w,"NETSCAPE2.0"),w.writeByte(3),w.writeByte(1),M(w,_),w.writeByte(0))}var A,x,j=v,y=x=Math.round(f/10),_=d,w=p,f=((l=n).writeByte(33),l.writeByte(249),l.writeByte(4),w<0&&(w=0,_=!1),_=_?(A=1,2):A=0,0<=j&&(_=7&j),_<<=2,l.writeByte(_|A),M(l,y),l.writeByte(w||0),l.writeByte(0),Boolean(m)&&!b);d=t,p=a,A=f?m:null,(v=n).writeByte(44),M(v,0),M(v,0),M(v,d),M(v,p),A?(d=E(A.length)-1,v.writeByte(128|d)):v.writeByte(0),f&&S(n,m),[y,l,p,d,v=8,f,m,e]=[n,e,t,a,g,i,o,s],u(p,d,l,v,y,f,m,e)}};function h(){T(n,"GIF89a")}}function S(e,t){var r=1<<E(t.length);for(let n=0;n<r;n++){let r=[0,0,0];n<t.length&&(r=t[n]),e.writeByte(r[0]),e.writeByte(r[1]),e.writeByte(r[2])}}function M(e,t){e.writeByte(255&t),e.writeByte(t>>8&255)}function T(e,t){for(var r=0;r<t.length;r++)e.writeByte(t.charCodeAt(r))}function E(e){return Math.max(Math.ceil(Math.log2(e)),1)}var j=w},{}],254:[function(e,t,r){r.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,c=l>>1,u=-7,h=r?i-1:0,d=r?-1:1;for(i=e[t+h],h+=d,o=i&(1<<-u)-1,i>>=-u,u+=a;0<u;o=256*o+e[t+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;0<u;s=256*s+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(i?-1:1);s+=Math.pow(2,n),o-=c}return(i?-1:1)*s*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var s,a,l=8*o-i-1,c=(1<<l)-1,u=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1;for(o=t<0||0===t&&1/t<0?1:0,t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-s))<1&&(s--,n*=2),2<=(t+=1<=s+u?h/n:h*Math.pow(2,1-u))*n&&(s++,n/=2),c<=s+u?(a=0,s=c):1<=s+u?(a=(t*n-1)*Math.pow(2,i),s+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),s=0));8<=i;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;0<l;e[r+d]=255&s,d+=p,s/=256,l-=8);e[r+d-p]|=128*o}},{}],255:[function(e,t,r){"use strict";var n;function i(e,t){return e.b===t.b&&e.a===t.a}function o(e,t){return e.b<t.b||e.b===t.b&&e.a<=t.a}function s(e,t,r){var n=t.b-e.b,i=r.b-t.b;return 0<n+i?n<i?t.a-e.a+n/(n+i)*(e.a-r.a):t.a-r.a+i/(n+i)*(r.a-e.a):0}function a(e,t,r){var n=t.b-e.b,i=r.b-t.b;return 0<n+i?(t.a-r.a)*n+(t.a-e.a)*i:0}function l(e,t){return e.a<t.a||e.a===t.a&&e.b<=t.b}function c(e,t,r){var n=t.a-e.a,i=r.a-t.a;return 0<n+i?n<i?t.b-e.b+n/(n+i)*(e.b-r.b):t.b-r.b+i/(n+i)*(r.b-e.b):0}function u(e,t,r){var n=t.a-e.a,i=r.a-t.a;return 0<n+i?(t.b-r.b)*n+(t.b-e.b)*i:0}function h(e,t,r,n){return(e=e<0?0:e)<=(r=r<0?0:r)?0===r?(t+n)/2:t+e/(e+r)*(n-t):n+r/(e+r)*(t-n)}function d(e){var t=g(e.b);return b(t,e.c),b(t.b,e.c),_(t,e.a),t}function p(e,t){var r=!1,n=!1;e!==t&&(t.a!==e.a&&(n=!0,w(t.a,e.a)),t.d!==e.d&&(r=!0,S(t.d,e.d)),v(t,e),n||(b(t,e.a),e.a.c=e),r||(_(t,e.d),e.d.a=e))}function f(e){var t=e.b,r=!1;e.d!==e.b.d&&(r=!0,S(e.d,e.b.d)),e.c===e?w(e.a,null):(e.b.d.a=e.b.e,e.a.c=e.c,v(e,e.b.e),r||_(e,e.d)),t.c===t?(w(t.a,null),S(t.d,null)):(e.d.a=t.b.e,t.a.c=t.c,v(t,t.b.e)),x(e)}function m(e){var t=g(e),r=t.b;return v(t,e.e),t.a=e.b.a,b(r,t.a),t.d=r.d=e.d,t=t.b,v(e.b,e.b.b.e),v(e.b,t),e.b.a=t.a,t.b.a.c=t.b,t.b.d=e.b.d,t.f=e.f,t.b.f=e.b.f,t}function y(e,t){var r=!1,n=g(e),i=n.b;return t.d!==e.d&&(r=!0,S(t.d,e.d)),v(n,e.e),v(i,t),n.a=e.b.a,i.a=t.a,n.d=i.d=e.d,e.d.a=i,r||_(n,e.d),n}function g(e){var t=new Z,r=new Z,n=e.b.h;return(((r.h=n).b.h=t).h=e).b.h=r,t.b=r,((t.c=t).e=r).b=t,(r.c=r).e=t}function v(e,t){var r=e.c,n=t.c;r.b.e=t,(n.b.e=e).c=n,t.c=r}function b(e,t){var r=t.f,n=new K(t,r);for(r.e=n,r=(t.f=n).c=e;r.a=n,(r=r.c)!==e;);}function _(e,t){var r=t.d,n=new Y(t,r);for(r.b=n,(t.d=n).a=e,n.c=t.c,r=e;r.d=n,(r=r.e)!==e;);}function x(e){var t=e.h;e=e.b.h,(t.b.h=e).b.h=t}function w(e,t){for(var r=e.c,n=r;n.a=t,(n=n.c)!==r;);r=e.f,((n=e.e).f=r).e=n}function S(e,t){for(var r=e.a,n=r;n.d=t,(n=n.e)!==r;);r=e.d,((n=e.b).d=r).b=n}function M(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])?2:t}function T(e,t){e.f+=t.f,e.b.f+=t.b.f}function E(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?o(t.a,r.a)?a(r.b.a,t.a,r.a)<=0:0<=a(t.b.a,r.a,t.a):a(r.b.a,e,r.a)<=0:r.b.a===e?0<=a(t.b.a,e,t.a):(t=s(t.b.a,e,t.a),(e=s(r.b.a,e,r.a))<=t)}function j(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function A(e,t){f(e.a),e.c=!1,(e.a=t).i=e}function L(e){for(var t=e.a.a;(e=ce(e)).a.a===t;);return e.c&&(A(e,t=y(le(e).a.b,e.a.e)),e=ce(e)),e}function C(e,t,r){var n=new ae;return n.a=r,n.e=V(e.f,t.e,n),r.i=n}function P(e,t){switch(e.s){case 100130:return!!(1&t);case 100131:return 0!==t;case 100132:return 0<t;case 100133:return t<0;case 100134:return 2<=t||t<=-2}return!1}function R(e){var t=e.a,r=t.d;r.c=e.d,r.a=t,j(e)}function O(e,t,r){for(t=(e=t).a;e!==r;){e.c=!1;var n=le(e),i=n.a;if(i.a!==t.a){if(!n.c){R(e);break}A(n,i=y(t.c.b,i.b))}t.c!==i&&(p(i.b.e,i),p(t,i)),R(e),t=n.a,e=n}return t}function k(e,t,r,n,i,o){for(var s=!0;C(e,t,r.b),(r=r.c)!==n;);for(null===i&&(i=le(t).a.b.c);(r=(n=le(t)).a.b).a===i.a;)r.c!==i&&(p(r.b.e,r),p(i.b.e,r)),n.f=t.f-r.f,n.d=P(e,n.f),t.b=!0,!s&&F(e,t)&&(T(r,i),j(t),f(i)),s=!1,t=n,i=r;t.b=!0,o&&B(e,t)}function I(e,t,r,n,i){var o=[t.g[0],t.g[1],t.g[2]];t.d=null,t.d=e.o&&e.o(o,r,n,e.c)||null,null===t.d&&(i?e.n||(X(e,100156),e.n=!0):t.d=r[0])}function D(e,t,r){var n=[null,null,null,null];n[0]=t.a.d,n[1]=r.a.d,I(e,t.a,n,[.5,.5,0,0],!1),p(t,r)}function N(e,t,r,n,i){var o=Math.abs(t.b-e.b)+Math.abs(t.a-e.a),s=Math.abs(r.b-e.b)+Math.abs(r.a-e.a),a=i+1;n[i]=.5*s/(o+s),n[a]=.5*o/(o+s),e.g[0]+=n[i]*t.g[0]+n[a]*r.g[0],e.g[1]+=n[i]*t.g[1]+n[a]*r.g[1],e.g[2]+=n[i]*t.g[2]+n[a]*r.g[2]}function F(e,t){var r=le(t),n=t.a,s=r.a;if(o(n.a,s.a)){if(0<a(s.b.a,n.a,s.a))return;if(i(n.a,s.a)){if(n.a!==s.a){r=e.e;var l=n.a.h;if(0<=l){var c=(r=r.b).d,u=r.e,h=r.c,d=h[l];c[d]=c[r.a],(h[c[d]]=d)<=--r.a&&(d<=1||o(u[c[d>>1]],u[c[d]])?oe:se)(r,d),u[l]=null,h[l]=r.b,r.b=l}else for(r.c[-(l+1)]=null;0<r.a&&null===r.c[r.d[r.a-1]];)--r.a;D(e,s.b.e,n)}}else m(s.b),p(n,s.b.e),t.b=r.b=!0}else{if(a(n.b.a,s.a,n.a)<0)return;ce(t).b=t.b=!0,m(n.b),p(s.b.e,n)}return 1}function U(e,t){var r=le(t),n=t.a,d=r.a,f=n.a,y=d.a,g=n.b.a,v=d.b.a,b=new K;if(a(g,e.a,f),a(v,e.a,y),!(f===y||Math.min(f.a,g.a)>Math.max(y.a,v.a))){if(o(f,y)){if(0<a(v,f,y))return}else if(a(g,y,f)<0)return;var _,x,w=g,S=f,M=v,T=y;if(o(w,S)||(_=w,w=S,S=_),o(M,T)||(_=M,M=T,T=_),o(w,M)||(_=w,w=M,M=_,_=S,S=T,T=_),o(M,S)?o(S,T)?((_=s(w,M,S))+(x=s(M,S,T))<0&&(_=-_,x=-x),b.b=h(_,M.b,x,S.b)):((_=a(w,M,S))+(x=-a(w,T,S))<0&&(_=-_,x=-x),b.b=h(_,M.b,x,T.b)):b.b=(M.b+S.b)/2,l(w,S)||(_=w,w=S,S=_),l(M,T)||(_=M,M=T,T=_),l(w,M)||(_=w,w=M,M=_,_=S,S=T,T=_),l(M,S)?l(S,T)?((_=c(w,M,S))+(x=c(M,S,T))<0&&(_=-_,x=-x),b.a=h(_,M.a,x,S.a)):((_=u(w,M,S))+(x=-u(w,T,S))<0&&(_=-_,x=-x),b.a=h(_,M.a,x,T.a)):b.a=(M.a+S.a)/2,o(b,e.a)&&(b.b=e.a.b,b.a=e.a.a),w=o(f,y)?f:y,o(w,b)&&(b.b=w.b,b.a=w.a),i(b,f)||i(b,y))return F(e,t),0;if(!i(g,e.a)&&0<=a(g,e.a,b)||!i(v,e.a)&&a(v,e.a,b)<=0){if(v===e.a)m(n.b),p(d.b,n),n=le(t=L(t)).a,O(e,le(t),r),k(e,t,n.b.e,n,n,!0);else{if(g!==e.a)return 0<=a(g,e.a,b)&&(ce(t).b=t.b=!0,m(n.b),n.a.b=e.a.b,n.a.a=e.a.a),void(a(v,e.a,b)<=0&&(t.b=r.b=!0,m(d.b),d.a.b=e.a.b,d.a.a=e.a.a));for(m(d.b),p(n.e,d.b.e),y=(f=r=t).a.b.a;(f=ce(f)).a.b.a===y;);f=le(t=f).a.b.c,r.a=d.b.e,k(e,t,(d=O(e,r,null)).c,n.b.c,f,!0)}return 1}m(n.b),m(d.b),p(d.b.e,n),n.a.b=b.b,n.a.a=b.a,n.a.h=$(e.e,n.a),n=n.a,d=[0,0,0,0],b=[f.d,g.d,y.d,v.d],n.g[0]=n.g[1]=n.g[2]=0,N(n,f,g,d,0),N(n,y,v,d,2),I(e,n,b,d,!0),ce(t).b=t.b=r.b=!0}}function B(e,t){for(var r=le(t);;){for(;r.b;)r=le(t=r);if(!(t.b||null!==(t=ce(r=t))&&t.b))break;t.b=!1;var n=t.a,i=r.a;if(s=n.b.a!==i.b.a)e:{var s,l=le(s=t),c=s.a,u=l.a,h=void 0;if(o(c.b.a,u.b.a)){if(a(c.b.a,u.b.a,c.a)<0){s=!1;break e}ce(s).b=s.b=!0,h=m(c),p(u.b,h),h.d.c=s.d}else{if(0<a(u.b.a,c.b.a,u.a)){s=!1;break e}s.b=l.b=!0,h=m(u),p(c.e,u.b),h.b.d.c=s.d}s=!0}if(s&&(r.c?(j(r),f(i),i=(r=le(t)).a):t.c&&(j(t),f(n),n=(t=ce(r)).a)),n.a!==i.a)if(n.b.a===i.b.a||t.c||r.c||n.b.a!==e.a&&i.b.a!==e.a)F(e,t);else if(U(e,t))break;n.a===i.a&&n.b.a===i.b.a&&(T(i,n),j(t),f(n),t=ce(r))}}function z(e,t){var r=new ae,n=d(e.b);n.a.b=4e150,n.a.a=t,n.b.a.b=-4e150,n.b.a.a=t,e.a=n.b.a,r.a=n,r.f=0,r.d=!1,r.c=!1,r.h=!0,r.b=!1,n=V(n=e.f,n.a,r),r.e=n}function G(e){this.a=new H,this.b=e,this.c=E}function V(e,t,r){for(;null!==(t=t.c).b&&!e.c(e.b,t.b,r););return e=new H(r,t.a,t),t.a.c=e,t.a=e}function H(e,t,r){this.b=e||null,this.a=t||this,this.c=r||this}function W(){this.d=0,this.p=this.b=this.q=null,this.j=[0,0,0],this.s=100130,this.n=!1,this.o=this.a=this.e=this.f=null,this.m=!1,this.c=this.r=this.i=this.k=this.l=this.h=null}function q(e,t){if(e.d!==t)for(;e.d!==t;)if(e.d<t)switch(e.d){case 0:X(e,100151),e.u(null);break;case 1:X(e,100152),e.t()}else switch(e.d){case 2:X(e,100154),e.v();break;case 1:X(e,100153),e.w()}}function X(e,t){e.p&&e.p(t,e.c)}function Y(e,t){this.b=e||this,this.d=t||this,this.a=null,this.c=!1}function Z(){(this.h=this).i=this.d=this.a=this.e=this.c=this.b=null,this.f=0}function J(){this.c=new K,this.a=new Y,this.b=new Z,this.d=new Z,this.b.b=this.d,this.d.b=this.b}function K(e,t){this.e=e||this,this.f=t||this,this.d=this.c=null,this.g=[0,0,0],this.h=this.a=this.b=0}function Q(){this.c=[],this.d=null,this.a=0,this.e=!1,this.b=new te}function $(e,t){var r,n,i;return e.e?(2*(n=++(r=e.b).a)>r.f&&(r.f*=2,r.c=re(r.c,r.f+1)),0===r.b?i=n:(i=r.b,r.b=r.c[r.b]),r.e[i]=t,r.c[i]=n,r.d[n]=i,r.h&&se(r,n),i):(r=e.a++,e.c[r]=t,-(r+1))}function ee(e){if(0===e.a)return ie(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&o(ne(e.b),t))return ie(e.b);for(;--e.a,0<e.a&&null===e.c[e.d[e.a-1]];);return t}function te(){this.d=re([0],33),this.e=[null,null],this.c=[0,0],this.a=0,this.f=32,this.b=0,this.h=!1,this.d[1]=1}function re(e,t){for(var r=Array(t),n=0;n<e.length;n++)r[n]=e[n];for(;n<t;n++)r[n]=0;return r}function ne(e){return e.e[e.d[1]]}function ie(e){var t=e.d,r=e.e,n=e.c,i=t[1],o=r[i];return 0<e.a&&(t[1]=t[e.a],n[t[1]]=1,r[i]=null,n[i]=e.b,e.b=i,0<--e.a&&oe(e,1)),o}function oe(e,t){for(var r=e.d,n=e.e,i=e.c,s=t,a=r[s];;){var l=s<<1,c=(l<e.a&&o(n[r[l+1]],n[r[l]])&&(l+=1),r[l]);if(l>e.a||o(n[a],n[c])){i[r[s]=a]=s;break}i[r[s]=c]=s,s=l}}function se(e,t){for(var r=e.d,n=e.e,i=e.c,s=t,a=r[s];;){var l=s>>1,c=r[l];if(0==l||o(n[c],n[a])){i[r[s]=a]=s;break}i[r[s]=c]=s,s=l}}function ae(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function le(e){return e.e.c.b}function ce(e){return e.e.a.b}(n=W.prototype).x=function(){q(this,0)},n.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void X(this,100900)}X(this,100901)},n.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:X(this,100900)}return!1},n.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},n.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:X(this,100900)}},n.C=function(e,t){var r=!1,n=[0,0,0];q(this,2);for(var i=0;i<3;++i){var o=e[i];o<-1e150&&(o=-1e150,r=!0),1e150<o&&(o=1e150,r=!0),n[i]=o}r&&X(this,100155),null===(r=this.q)?p(r=d(this.b),r.b):(m(r),r=r.e),r.a.d=t,r.a.g[0]=n[0],r.a.g[1]=n[1],r.a.g[2]=n[2],r.f=1,r.b.f=-1,this.q=r},n.u=function(e){q(this,0),this.d=1,this.b=new J,this.c=e},n.t=function(){q(this,1),this.d=2,this.q=null},n.v=function(){q(this,2),this.d=1},n.w=function(){q(this,1),this.d=0;var e,t,r=!1,n=[h=this.j[0],s=this.j[1],c=this.j[2]];if(0===h&&0===s&&0===c){for(var s=[-2e150,-2e150,-2e150],l=[2e150,2e150,2e150],c=[],u=[],h=(r=this.b.c).e;h!==r;h=h.e)for(var d=0;d<3;++d){var g=h.g[d];g<l[d]&&(l[d]=g,u[d]=h),g>s[d]&&(s[d]=g,c[d]=h)}if(s[1]-l[1]>s[h=0]-l[0]&&(h=1),l[h=s[2]-l[2]>s[h]-l[h]?2:h]>=s[h])n[0]=0,n[1]=0,n[2]=1;else{for(l=u[h],c=c[h],u=[s=0,0,0],l=[l.g[0]-c.g[0],l.g[1]-c.g[1],l.g[2]-c.g[2]],d=[0,0,0],h=r.e;h!==r;h=h.e)d[0]=h.g[0]-c.g[0],d[1]=h.g[1]-c.g[1],d[2]=h.g[2]-c.g[2],u[0]=l[1]*d[2]-l[2]*d[1],u[1]=l[2]*d[0]-l[0]*d[2],u[2]=l[0]*d[1]-l[1]*d[0],s<(g=u[0]*u[0]+u[1]*u[1]+u[2]*u[2])&&(s=g,n[0]=u[0],n[1]=u[1],n[2]=u[2]);s<=0&&(n[0]=n[1]=n[2]=0,n[M(l)]=1)}r=!0}for(u=M(n),h=this.b.c,s=(u+1)%3,c=(u+2)%3,u=0<n[u]?1:-1,n=h.e;n!==h;n=n.e)n.b=n.g[s],n.a=u*n.g[c];if(r){for(n=0,h=(r=this.b.a).b;h!==r;h=h.b)if(!((s=h.a).f<=0))for(;n+=(s.a.b-s.b.a.b)*(s.a.a+s.b.a.a),(s=s.e)!==h.a;);if(n<0)for(r=(n=this.b.c).e;r!==n;r=r.e)r.a=-r.a}for(this.n=!1,h=(n=this.b.b).h;h!==n;h=r)r=h.h,s=h.e,i(h.a,h.b.a)&&h.e.e!==h&&(D(this,s,h),f(h),s=(h=s).e),s.e===h&&(s!==h&&(s!==r&&s!==r.b||(r=r.h),f(s)),h!==r&&h!==r.b||(r=r.h),f(h));for(this.e=n=new Q,h=(r=this.b.c).e;h!==r;h=h.e)h.h=$(n,h);var b=n;b.d=[];for(var _=0;_<b.a;_++)b.d[_]=_;b.d.sort(function(e){return function(t,r){return o(e[t],e[r])?1:-1}}(b.c)),b.e=!0;for(var S=b.b,E=S.a;1<=E;--E)oe(S,E);for(S.h=!0,this.f=new G(this),z(this,-4e150),z(this,4e150);null!==(n=ee(this.e));){for(;;){e:if(0===(h=this.e).a)r=ne(h.b);else if(r=h.c[h.d[h.a-1]],0!==h.b.a&&o(h=ne(h.b),r)){r=h;break e}if(null===r||!i(r,n))break;r=ee(this.e),D(this,n.c,r.c)}!function e(t,r){for(var n,s=(t.a=r).c;null===s.i;)if((s=s.c)===r.c){s=t;var l=r;(g=new ae).a=l.c.b;for(var c=(u=s.f).a;null!==(c=c.a).b&&!u.c(u.b,g,c.b););var u,h,d=le(u=c.b),g=u.a;return c=d.a,void(0===a(g.b.a,l,g.a)?i((g=u.a).a,l)||i(g.b.a,l)||(m(g.b),u.c&&(f(g.c),u.c=!1),p(l.c,g),e(s,l)):(h=o(c.b.a,g.b.a)?u:d,d=void 0,u.d||h.c?(d=h===u?y(l.c.b,g.e):y(c.b.c.b,l.c).b,h.c?A(h,d):((u=C(g=s,u,d)).f=ce(u).f+u.a.f,u.d=P(g,u.f)),e(s,l)):k(s,u,l.c,l.c,null,!0)))}u=(g=le(s=L(s.i))).a,(g=O(t,g,null)).c===u?(g=(u=g).c,c=le(s),d=s.a,h=c.a,n=!1,d.b.a!==h.b.a&&U(t,s),i(d.a,t.a)&&(p(g.b.e,d),g=le(s=L(s)).a,O(t,le(s),c),n=!0),i(h.a,t.a)&&(p(u,h.b.e),u=O(t,c,null),n=!0),n?k(t,s,u.c,g,g,!0):(l=o(h.a,d.a)?h.b.e:d,k(t,s,l=y(u.c.b,l),l.c,l.c,!1),l.b.i.c=!0,B(t,s))):k(t,s,g.c,u,u,!0)}(this,n)}for(this.a=this.f.a.a.b.a.a,n=0;null!==(r=this.f.a.a.b);)r.h||++n,j(r);for(this.f=null,(n=this.e).b=null,n.d=null,this.e=n.c=null,h=(n=this.b).a.b;h!==n.a;h=r)r=h.b,(h=h.a).e.e===h&&(T(h.c,h),f(h));if(!this.n){if(n=this.b,this.m)for(h=n.b.h;h!==n.b;h=r)r=h.h,h.b.d.c!==h.d.c?h.f=h.d.c?1:-1:f(h);else for(h=n.a.b;h!==n.a;h=r)if(r=h.b,h.c){for(h=h.a;o(h.b.a,h.a);h=h.c.b);for(;o(h.a,h.b.a);h=h.e);for(s=h.c.b,c=void 0;h.e!==s;)if(o(h.b.a,s.a)){for(;s.e!==h&&(o((t=s.e).b.a,t.a)||a(s.a,s.b.a,s.e.b.a)<=0);)s=(c=y(s.e,s)).b;s=s.c.b}else{for(;s.e!==h&&(o((e=h.c.b).a,e.b.a)||0<=a(h.b.a,h.a,h.c.b.a));)h=(c=y(h,h.c.b)).b;h=h.e}for(;s.e.e!==h;)s=(c=y(s.e,s)).b}if(this.h||this.i||this.k||this.l)if(this.m){for(r=(n=this.b).a.b;r!==n.a;r=r.b)if(r.c){for(this.h&&this.h(2,this.c),h=r.a;this.k&&this.k(h.a.d,this.c),(h=h.e)!==r.a;);this.i&&this.i(this.c)}}else{for(n=this.b,r=!!this.l,h=!1,s=-1,c=n.a.d;c!==n.a;c=c.d)if(c.c)for(h||(this.h&&this.h(4,this.c),h=!0),u=c.a;r&&s!==(l=u.b.d.c?0:1)&&(s=l,this.l&&this.l(!!s,this.c)),this.k&&this.k(u.a.d,this.c),(u=u.e)!==c.a;);h&&this.i&&this.i(this.c)}if(this.r){for(h=(n=this.b).a.b;h!==n.a;h=r)if(r=h.b,!h.c){for(c=(s=h.a).e,u=void 0;c=(u=c).e,(u.d=null)===u.b.d&&(u.c===u?w(u.a,null):(u.a.c=u.c,v(u,u.b.e)),(l=u.b).c===l?w(l.a,null):(l.a.c=l.c,v(l,l.b.e)),x(u)),u!==s;);s=h.d,((h=h.b).d=s).b=h}return this.r(this.b),void(this.c=this.b=null)}}this.b=this.c=null},this.libtess={GluTesselator:W,windingRule:{GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131,GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},primitiveType:{GL_LINE_LOOP:2,GL_TRIANGLES:4,GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},errorType:{GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156},gluEnum:{GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901,GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111}},W.prototype.gluDeleteTess=W.prototype.x,W.prototype.gluTessProperty=W.prototype.B,W.prototype.gluGetTessProperty=W.prototype.y,W.prototype.gluTessNormal=W.prototype.A,W.prototype.gluTessCallback=W.prototype.z,W.prototype.gluTessVertex=W.prototype.C,W.prototype.gluTessBeginPolygon=W.prototype.u,W.prototype.gluTessBeginContour=W.prototype.t,W.prototype.gluTessEndContour=W.prototype.v,W.prototype.gluTessEndPolygon=W.prototype.w,void 0!==t&&(t.exports=this.libtess)},{}],256:[function(e,t,r){"use strict";function n(e,t,r,n){for(var i=e[t++],o=1<<i,s=1+o,a=1+s,l=i+1,c=(1<<l)-1,u=0,h=0,d=0,p=e[t++],f=new Int32Array(4096),m=null;;){for(;u<16&&0!==p;)h|=e[t++]<<u,u+=8,1===p?p=e[t++]:--p;if(u<l)break;var y=h&c;if(h>>=l,u-=l,y==o)a=1+s,c=(1<<(l=i+1))-1,m=null;else{if(y==s)break;for(var g=y<a?y:m,v=0,b=g;o<b;)b=f[b]>>8,++v;var _=b;if(n<d+v+(g!==y?1:0))return void console.log("Warning, gif stream longer than expected.");r[d++]=_;var x=d+=v;for(g!==y&&(r[d++]=_),b=g;v--;)b=f[b],r[--x]=255&b,b>>=8;null!==m&&a<4096&&(f[a++]=m<<8|_,c+1<=a&&l<12&&(++l,c=c<<1|1)),m=y}}d!==n&&console.log("Warning, gif stream shorter than expected.")}try{r.GifWriter=function(e,t,r,n){var i=0,o=void 0===(n=void 0===n?{}:n).loop?null:n.loop,s=void 0===n.palette?null:n.palette;if(t<=0||r<=0||65535<t||65535<r)throw new Error("Width/Height invalid.");function a(e){if((e=e.length)<2||256<e||e&e-1)throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return e}e[i++]=71,e[i++]=73,e[i++]=70,e[i++]=56,e[i++]=57,e[i++]=97;var l=0,c=0;if(null!==s){for(var u=a(s);u>>=1;)++l;if(u=1<<l,--l,void 0!==n.background){if(u<=(c=n.background))throw new Error("Background index out of range.");if(0===c)throw new Error("Background index explicitly passed as 0.")}}if(e[i++]=255&t,e[i++]=t>>8&255,e[i++]=255&r,e[i++]=r>>8&255,e[i++]=(null!==s?128:0)|l,e[i++]=c,e[i++]=0,null!==s)for(var h=0,d=s.length;h<d;++h){var p=s[h];e[i++]=p>>16&255,e[i++]=p>>8&255,e[i++]=255&p}if(null!==o){if(o<0||65535<o)throw new Error("Loop count invalid.");e[i++]=33,e[i++]=255,e[i++]=11,e[i++]=78,e[i++]=69,e[i++]=84,e[i++]=83,e[i++]=67,e[i++]=65,e[i++]=80,e[i++]=69,e[i++]=50,e[i++]=46,e[i++]=48,e[i++]=3,e[i++]=1,e[i++]=255&o,e[i++]=o>>8&255,e[i++]=0}var f=!1;this.addFrame=function(t,r,n,o,l,c){if(!0===f&&(--i,f=!1),c=void 0===c?{}:c,t<0||r<0||65535<t||65535<r)throw new Error("x/y invalid.");if(n<=0||o<=0||65535<n||65535<o)throw new Error("Width/Height invalid.");if(l.length<n*o)throw new Error("Not enough pixels for the frame size.");var u=!0,h=c.palette;if(null==h&&(u=!1,h=s),null==h)throw new Error("Must supply either a local or global palette.");for(var d=a(h),p=0;d>>=1;)++p;d=1<<p;var m=void 0===c.delay?0:c.delay,y=void 0===c.disposal?0:c.disposal;if(y<0||3<y)throw new Error("Disposal out of range.");var g=!1,v=0;if(void 0!==c.transparent&&null!==c.transparent&&(g=!0,(v=c.transparent)<0||d<=v))throw new Error("Transparent color index.");if(0===y&&!g&&0===m||(e[i++]=33,e[i++]=249,e[i++]=4,e[i++]=y<<2|(!0===g?1:0),e[i++]=255&m,e[i++]=m>>8&255,e[i++]=v,e[i++]=0),e[i++]=44,e[i++]=255&t,e[i++]=t>>8&255,e[i++]=255&r,e[i++]=r>>8&255,e[i++]=255&n,e[i++]=n>>8&255,e[i++]=255&o,e[i++]=o>>8&255,e[i++]=!0===u?128|p-1:0,!0===u)for(var b=0,_=h.length;b<_;++b){var x=h[b];e[i++]=x>>16&255,e[i++]=x>>8&255,e[i++]=255&x}return i=function(e,t,r,n){e[t++]=r;var i=t++,o=1<<r,s=o-1,a=1+o,l=1+a,c=r+1,u=0,h=0;function d(r){for(;r<=u;)e[t++]=255&h,h>>=8,u-=8,t===i+256&&(e[i]=255,i=t++)}function p(e){h|=e<<u,u+=c,d(8)}var f=n[0]&s,m={};p(o);for(var y=1,g=n.length;y<g;++y){var v=n[y]&s,b=f<<8|v,_=m[b];if(void 0===_){for(h|=f<<u,u+=c;8<=u;)e[t++]=255&h,h>>=8,u-=8,t===i+256&&(e[i]=255,i=t++);4096===l?(p(o),l=1+a,c=r+1,m={}):(1<<c<=l&&++c,m[b]=l++),f=v}else f=_}return p(f),p(a),d(1),i+1===t?e[i]=0:(e[i]=t-i-1,e[t++]=0),t}(e,i,p<2?2:p,l)},this.end=function(){return!1===f&&(e[i++]=59,f=!0),i},this.getOutputBuffer=function(){return e},this.setOutputBuffer=function(t){e=t},this.getOutputBufferPosition=function(){return i},this.setOutputBufferPosition=function(e){i=e}},r.GifReader=function(e){var t=0;if(71!==e[t++]||73!==e[t++]||70!==e[t++]||56!==e[t++]||56!=(e[t++]+1&253)||97!==e[t++])throw new Error("Invalid GIF 87a/89a header.");var r=e[t++]|e[t++]<<8,i=e[t++]|e[t++]<<8,o=e[t++],s=1<<1+(7&o),a=(e[t++],e[t++],null),l=null,c=(o>>7&&(a=t,t+=3*(l=s)),!0),u=[],h=0,d=null,p=0,f=null;for(this.width=r,this.height=i;c&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(11!==e[t]||78==e[t+1]&&69==e[t+2]&&84==e[t+3]&&83==e[t+4]&&67==e[t+5]&&65==e[t+6]&&80==e[t+7]&&69==e[t+8]&&50==e[t+9]&&46==e[t+10]&&48==e[t+11]&&3==e[t+12]&&1==e[t+13]&&0==e[t+16])t+=14,f=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!(0<=(y=e[t++])))throw Error("Invalid block size");if(0===y)break;t+=y}break;case 249:if(4!==e[t++]||0!==e[t+4])throw new Error("Invalid graphics extension block.");var m=e[t++];h=e[t++]|e[t++]<<8,d=e[t++],!(1&m)&&(d=null),p=m>>2&7,t++;break;case 254:for(;;){if(!(0<=(y=e[t++])))throw Error("Invalid block size");if(0===y)break;t+=y}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var y,g=e[t++]|e[t++]<<8,v=e[t++]|e[t++]<<8,b=e[t++]|e[t++]<<8,_=e[t++]|e[t++]<<8,x=(T=e[t++])>>6&1,w=a,S=l,M=!1,T=(T>>7&&(M=!0,w=t,t+=3*(S=1<<1+(7&T))),t);for(t++;;){if(!(0<=(y=e[t++])))throw Error("Invalid block size");if(0===y)break;t+=y}u.push({x:g,y:v,width:b,height:_,has_local_palette:M,palette_offset:w,palette_size:S,data_offset:T,data_length:t-T,transparent_index:d,interlaced:!!x,delay:h,disposal:p});break;case 59:c=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return u.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=u.length)throw new Error("Frame index out of range.");return u[e]},this.decodeAndBlitFrameBGRA=function(t,i){for(var o=(t=this.frameInfo(t)).width*t.height,s=new Uint8Array(o),a=(n(e,t.data_offset,s,o),t.palette_offset),l=t.transparent_index,c=(null===l&&(l=256),t.width),u=r-c,h=c,d=4*(t.y*r+t.x),p=4*((t.y+t.height)*r+t.x),f=d,m=4*u,y=(!0===t.interlaced&&(m+=4*r*7),8),g=0,v=s.length;g<v;++g){var b,_,x=s[g];0===h&&(h=c,p<=(f+=m)&&(m=4*u+4*r*(y-1),f=d+(c+u)*(y<<1),y>>=1)),x===l?f+=4:(b=e[a+3*x],_=e[a+3*x+1],x=e[a+3*x+2],i[f++]=x,i[f++]=_,i[f++]=b,i[f++]=255),--h}},this.decodeAndBlitFrameRGBA=function(t,i){for(var o=(t=this.frameInfo(t)).width*t.height,s=new Uint8Array(o),a=(n(e,t.data_offset,s,o),t.palette_offset),l=t.transparent_index,c=(null===l&&(l=256),t.width),u=r-c,h=c,d=4*(t.y*r+t.x),p=4*((t.y+t.height)*r+t.x),f=d,m=4*u,y=(!0===t.interlaced&&(m+=4*r*7),8),g=0,v=s.length;g<v;++g){var b,_,x=s[g];0===h&&(h=c,p<=(f+=m)&&(m=4*u+4*r*(y-1),f=d+(c+u)*(y<<1),y>>=1)),x===l?f+=4:(b=e[a+3*x],_=e[a+3*x+1],x=e[a+3*x+2],i[f++]=b,i[f++]=_,i[f++]=x,i[f++]=255),--h}}}}catch(e){}},{}],257:[function(e,t,r){(function(n){var i;i=function(t){"use strict";function r(e){if(null==this)throw TypeError();var t,r=String(this),n=r.length;if(!((e=(e=e?Number(e):0)!=e?0:e)<0||n<=e))return 55296<=(t=r.charCodeAt(e))&&t<=56319&&e+1<n&&56320<=(n=r.charCodeAt(e+1))&&n<=57343?1024*(t-55296)+n-56320+65536:t}var i;function o(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function s(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new o,this.dtree=new o}String.prototype.codePointAt||((i=function(){try{var e={},t=Object.defineProperty,r=t(e,e,e)&&t}catch(e){}return r}())?i(String.prototype,"codePointAt",{value:r,configurable:!0,writable:!0}):String.prototype.codePointAt=r);var a=new o,l=new o,c=new Uint8Array(30),u=new Uint16Array(30),h=new Uint8Array(30),d=new Uint16Array(30),p=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=new o,m=new Uint8Array(320);function y(e,t,r,n){for(var i,o=0;o<r;++o)e[o]=0;for(o=0;o<30-r;++o)e[o+r]=o/r|0;for(i=n,o=0;o<30;++o)t[o]=i,i+=1<<e[o]}var g=new Uint16Array(16);function v(e,t,r,n){for(var i,o=0;o<16;++o)e.table[o]=0;for(o=0;o<n;++o)e.table[t[r+o]]++;for(o=i=e.table[0]=0;o<16;++o)g[o]=i,i+=e.table[o];for(o=0;o<n;++o)t[r+o]&&(e.trans[g[t[r+o]]++]=o)}function b(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,n+r}function _(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;for(var r=0,n=0,i=0,o=e.tag;n=2*n+(1&o),o>>>=1,r+=t.table[++i],0<=(n-=t.table[i]););return e.tag=o,e.bitcount-=i,t.trans[r+n]}function x(e,t,r){for(;;){if(256===(o=_(e,t)))return 0;if(o<256)e.dest[e.destLen++]=o;else for(var n,i=b(e,c[o-=257],u[o]),o=_(e,r),s=n=e.destLen-b(e,h[o],d[o]);s<n+i;++s)e.dest[e.destLen++]=e.dest[s]}}for(var w=a,S=l,M=0;M<7;++M)w.table[M]=0;for(w.table[7]=24,w.table[8]=152,w.table[9]=112,M=0;M<24;++M)w.trans[M]=256+M;for(M=0;M<144;++M)w.trans[24+M]=M;for(M=0;M<8;++M)w.trans[168+M]=280+M;for(M=0;M<112;++M)w.trans[176+M]=144+M;for(M=0;M<5;++M)S.table[M]=0;for(S.table[5]=32,M=0;M<32;++M)S.trans[M]=M;function T(e,t,r,n,i){return Math.pow(1-i,3)*e+3*Math.pow(1-i,2)*i*t+3*(1-i)*Math.pow(i,2)*r+Math.pow(i,3)*n}function E(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}function j(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}function A(e){throw new Error(e)}function L(e,t){e||A(t)}y(c,u,4,3),y(h,d,2,1),c[28]=0,u[28]=258,E.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},E.prototype.addPoint=function(e,t){"number"==typeof e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},E.prototype.addX=function(e){this.addPoint(e,null)},E.prototype.addY=function(e){this.addPoint(null,e)},E.prototype.addBezier=function(e,t,r,n,i,o,s,a){var l=[e,t],c=[r,n],u=[i,o],h=[s,a];this.addPoint(e,t),this.addPoint(s,a);for(var d=0;d<=1;d++){var p,f=6*l[d]-12*c[d]+6*u[d],m=-3*l[d]+9*c[d]-9*u[d]+3*h[d],y=3*c[d]-3*l[d];0==m?0==f||0<(p=-y/f)&&p<1&&(0===d&&this.addX(T(l[d],c[d],u[d],h[d],p)),1===d&&this.addY(T(l[d],c[d],u[d],h[d],p))):(p=Math.pow(f,2)-4*y*m)<0||(0<(y=(-f+Math.sqrt(p))/(2*m))&&y<1&&(0===d&&this.addX(T(l[d],c[d],u[d],h[d],y)),1===d&&this.addY(T(l[d],c[d],u[d],h[d],y))),0<(y=(-f-Math.sqrt(p))/(2*m))&&y<1&&(0===d&&this.addX(T(l[d],c[d],u[d],h[d],y)),1===d&&this.addY(T(l[d],c[d],u[d],h[d],y))))}},E.prototype.addQuad=function(e,t,r,n,i,o){r=e+2/3*(r-e),n=t+2/3*(n-t),this.addBezier(e,t,r,n,r+1/3*(i-e),n+1/3*(o-t),i,o)},j.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},j.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},j.prototype.curveTo=j.prototype.bezierCurveTo=function(e,t,r,n,i,o){this.commands.push({type:"C",x1:e,y1:t,x2:r,y2:n,x:i,y:o})},j.prototype.quadTo=j.prototype.quadraticCurveTo=function(e,t,r,n){this.commands.push({type:"Q",x1:e,y1:t,x:r,y:n})},j.prototype.close=j.prototype.closePath=function(){this.commands.push({type:"Z"})},j.prototype.extend=function(e){var t;if(e.commands)e=e.commands;else if(e instanceof E)return t=e,this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close();Array.prototype.push.apply(this.commands,e)},j.prototype.getBoundingBox=function(){for(var e=new E,t=0,r=0,n=0,i=0,o=0;o<this.commands.length;o++){var s=this.commands[o];switch(s.type){case"M":e.addPoint(s.x,s.y),t=n=s.x,r=i=s.y;break;case"L":e.addPoint(s.x,s.y),n=s.x,i=s.y;break;case"Q":e.addQuad(n,i,s.x1,s.y1,s.x,s.y),n=s.x,i=s.y;break;case"C":e.addBezier(n,i,s.x1,s.y1,s.x2,s.y2,s.x,s.y),n=s.x,i=s.y;break;case"Z":n=t,i=r;break;default:throw new Error("Unexpected path command "+s.type)}}return e.isEmpty()&&e.addPoint(0,0),e},j.prototype.draw=function(e){e.beginPath();for(var t=0;t<this.commands.length;t+=1){var r=this.commands[t];"M"===r.type?e.moveTo(r.x,r.y):"L"===r.type?e.lineTo(r.x,r.y):"C"===r.type?e.bezierCurveTo(r.x1,r.y1,r.x2,r.y2,r.x,r.y):"Q"===r.type?e.quadraticCurveTo(r.x1,r.y1,r.x,r.y):"Z"===r.type&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},j.prototype.toPathData=function(e){function t(){for(var t=arguments,r="",n=0;n<arguments.length;n+=1){var i=t[n];0<=i&&0<n&&(r+=" "),r+=Math.round(i)===i?""+Math.round(i):i.toFixed(e)}return r}e=void 0!==e?e:2;for(var r="",n=0;n<this.commands.length;n+=1){var i=this.commands[n];"M"===i.type?r+="M"+t(i.x,i.y):"L"===i.type?r+="L"+t(i.x,i.y):"C"===i.type?r+="C"+t(i.x1,i.y1,i.x2,i.y2,i.x,i.y):"Q"===i.type?r+="Q"+t(i.x1,i.y1,i.x,i.y):"Z"===i.type&&(r+="Z")}return r},j.prototype.toSVG=function(e){var t=(t='<path d="')+this.toPathData(e)+'"';return this.fill&&"black"!==this.fill&&(null===this.fill?t+=' fill="none"':t+=' fill="'+this.fill+'"'),this.stroke&&(t+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),t+"/>"},j.prototype.toDOMElement=function(e){e=this.toPathData(e);var t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",e),t};var C={fail:A,argument:L,assert:L},P={},R={},O={};function k(e){return function(){return e}}R.BYTE=function(e){return C.argument(0<=e&&e<=255,"Byte value should be between 0 and 255."),[e]},O.BYTE=k(1),R.CHAR=function(e){return[e.charCodeAt(0)]},O.CHAR=k(1),R.CHARARRAY=function(e){for(var t=[],r=0;r<e.length;r+=1)t[r]=e.charCodeAt(r);return t},O.CHARARRAY=function(e){return e.length},R.USHORT=function(e){return[e>>8&255,255&e]},O.USHORT=k(2),R.SHORT=function(e){return[(e=32768<=e?-(65536-e):e)>>8&255,255&e]},O.SHORT=k(2),R.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},O.UINT24=k(3),R.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},O.ULONG=k(4),R.LONG=function(e){return[(e=2147483648<=e?-(4294967296-e):e)>>24&255,e>>16&255,e>>8&255,255&e]},O.LONG=k(4),R.FIXED=R.ULONG,O.FIXED=O.ULONG,R.FWORD=R.SHORT,O.FWORD=O.SHORT,R.UFWORD=R.USHORT,O.UFWORD=O.USHORT,R.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},O.LONGDATETIME=k(8),R.TAG=function(e){return C.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},O.TAG=k(4),R.Card8=R.BYTE,O.Card8=O.BYTE,R.Card16=R.USHORT,O.Card16=O.USHORT,R.OffSize=R.BYTE,O.OffSize=O.BYTE,R.SID=R.USHORT,O.SID=O.USHORT,R.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?R.NUMBER16(e):R.NUMBER32(e)},O.NUMBER=function(e){return R.NUMBER(e).length},R.NUMBER16=function(e){return[28,e>>8&255,255&e]},O.NUMBER16=k(3),R.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},O.NUMBER32=k(5),R.REAL=function(e){for(var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t),n=(r&&(r=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length)),t=(Math.round(e*r)/r).toString()),""),i=0,o=t.length;i<o;i+=1){var s=t[i];n+="e"===s?"-"===t[++i]?"c":"b":"."===s?"a":"-"===s?"e":s}for(var a=[30],l=0,c=(n+=1&n.length?"f":"ff").length;l<c;l+=2)a.push(parseInt(n.substr(l,2),16));return a},O.REAL=function(e){return R.REAL(e).length},R.NAME=R.CHARARRAY,O.NAME=O.CHARARRAY,R.STRING=R.CHARARRAY,O.STRING=O.CHARARRAY,P.UTF8=function(e,t,r){for(var n=[],i=r,o=0;o<i;o++,t+=1)n[o]=e.getUint8(t);return String.fromCharCode.apply(null,n)},P.UTF16=function(e,t,r){for(var n=[],i=r/2,o=0;o<i;o++,t+=2)n[o]=e.getUint16(t);return String.fromCharCode.apply(null,n)},R.UTF16=function(e){for(var t=[],r=0;r<e.length;r+=1){var n=e.charCodeAt(r);t[t.length]=n>>8&255,t[t.length]=255&n}return t},O.UTF16=function(e){return 2*e.length};var I,D={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ä¹²É³ÖÜ΅àâä΄¨çéèêë£™îï•½‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆćéŹźĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņŃ¬√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›ﬁﬂ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"},N=(P.MACSTRING=function(e,t,r,n){var i=D[n];if(void 0!==i){for(var o="",s=0;s<r;s++){var a=e.getUint8(t+s);o+=a<=127?String.fromCharCode(a):i[127&a]}return o}},"function"==typeof WeakMap&&new WeakMap);function F(e){return-128<=e&&e<=127}R.MACSTRING=function(e,t){var r=function(e){if(!I)for(var t in I={},D)I[t]=new String(t);var r=I[e];if(void 0!==r){if(N){var n=N.get(r);if(void 0!==n)return n}var i=D[e];if(void 0!==i){for(var o={},s=0;s<i.length;s++)o[i.charCodeAt(s)]=s+128;return N&&N.set(r,o),o}}}(t);if(void 0!==r){for(var n=[],i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128<=o&&void 0===(o=r[o]))return;n[i]=o}return n}},O.MACSTRING=function(e,t){return void 0!==(e=R.MACSTRING(e,t))?e.length:0},R.VARDELTAS=function(e){for(var t=0,r=[];t<e.length;){var n=e[t];t=(0===n?function(e,t,r){for(var n=0,i=e.length;t<i&&n<64&&0===e[t];)++t,++n;return r.push(128|n-1),t}:-128<=n&&n<=127?function(e,t,r){for(var n=0,i=e.length,o=t;o<i&&n<64;){var s=e[o];if(!F(s))break;if(0===s&&o+1<i&&0===e[o+1])break;++o,++n}r.push(n-1);for(var a=t;a<o;++a)r.push(e[a]+256&255);return o}:function(e,t,r){for(var n=0,i=e.length,o=t;o<i&&n<64;){var s=e[o];if(0===s)break;if(F(s)&&o+1<i&&F(e[o+1]))break;++o,++n}r.push(64|n-1);for(var a=t;a<o;++a){var l=e[a];r.push(l+65536>>8&255,l+256&255)}return o})(e,t,r)}return r},R.INDEX=function(e){for(var t=1,r=[t],n=[],i=0;i<e.length;i+=1){var o=R.OBJECT(e[i]);Array.prototype.push.apply(n,o),t+=o.length,r.push(t)}if(0===n.length)return[0,0];for(var s=[],a=1+Math.floor(Math.log(t)/Math.log(2))/8|0,l=[void 0,R.BYTE,R.USHORT,R.UINT24,R.ULONG][a],c=0;c<r.length;c+=1){var u=l(r[c]);Array.prototype.push.apply(s,u)}return Array.prototype.concat(R.Card16(e.length),R.OffSize(a),s,n)},O.INDEX=function(e){return R.INDEX(e).length},R.DICT=function(e){for(var t=[],r=Object.keys(e),n=r.length,i=0;i<n;i+=1){var o=parseInt(r[i],0),s=e[o];t=(t=t.concat(R.OPERAND(s.value,s.type))).concat(R.OPERATOR(o))}return t},O.DICT=function(e){return R.DICT(e).length},R.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},R.OPERAND=function(e,t){var r=[];if(Array.isArray(t))for(var n=0;n<t.length;n+=1)C.argument(e.length===t.length,"Not enough arguments given for type"+t),r=r.concat(R.OPERAND(e[n],t[n]));else if("SID"===t)r=r.concat(R.NUMBER(e));else if("offset"===t)r=r.concat(R.NUMBER32(e));else if("number"===t)r=r.concat(R.NUMBER(e));else{if("real"!==t)throw new Error("Unknown operand type "+t);r=r.concat(R.REAL(e))}return r},R.OP=R.BYTE,O.OP=O.BYTE;var U="function"==typeof WeakMap&&new WeakMap;function B(e,t,r){for(var n=0;n<t.length;n+=1){var i=t[n];this[i.name]=i.value}if(this.tableName=e,this.fields=t,r)for(var o=Object.keys(r),s=0;s<o.length;s+=1){var a=o[s],l=r[a];void 0!==this[a]&&(this[a]=l)}}function z(e,t,r){void 0===r&&(r=t.length);var n=new Array(t.length+1);n[0]={name:e+"Count",type:"USHORT",value:r};for(var i=0;i<t.length;i++)n[i+1]={name:e+i,type:"USHORT",value:t[i]};return n}function G(e,t,r){var n=t.length,i=new Array(n+1);i[0]={name:e+"Count",type:"USHORT",value:n};for(var o=0;o<n;o++)i[o+1]={name:e+o,type:"TABLE",value:r(t[o],o)};return i}function V(e,t,r){var n=t.length,i=[];i[0]={name:e+"Count",type:"USHORT",value:n};for(var o=0;o<n;o++)i=i.concat(r(t[o],o));return i}function H(e){1===e.format?B.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(z("glyph",e.glyphs))):C.assert(!1,"Can't create coverage table format 2 yet.")}function W(e){B.call(this,"scriptListTable",V("scriptRecord",e,(function(e,t){var r=e.script,n=r.defaultLangSys;return C.assert(!!n,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new B("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new B("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:n.reqFeatureIndex}].concat(z("featureIndex",n.featureIndexes)))}].concat(V("langSys",r.langSysRecords,(function(e,t){var r=e.langSys;return[{name:"langSysTag"+t,type:"TAG",value:e.tag},{name:"langSys"+t,type:"TABLE",value:new B("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:r.reqFeatureIndex}].concat(z("featureIndex",r.featureIndexes)))}]}))))}]})))}function q(e){B.call(this,"featureListTable",V("featureRecord",e,(function(e,t){var r=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new B("featureTable",[{name:"featureParams",type:"USHORT",value:r.featureParams}].concat(z("lookupListIndex",r.lookupListIndexes)))}]})))}function X(e,t){B.call(this,"lookupListTable",G("lookup",e,(function(e){var r=t[e.lookupType];return C.assert(!!r,"Unable to write GSUB lookup type "+e.lookupType+" tables."),new B("lookupTable",[{name:"lookupType",type:"USHORT",value:e.lookupType},{name:"lookupFlag",type:"USHORT",value:e.lookupFlag}].concat(G("subtable",e.subtables,r)))})))}R.CHARSTRING=function(e){if(U){var t=U.get(e);if(void 0!==t)return t}for(var r=[],n=e.length,i=0;i<n;i+=1){var o=e[i];r=r.concat(R[o.type](o.value))}return U&&U.set(e,r),r},O.CHARSTRING=function(e){return R.CHARSTRING(e).length},R.OBJECT=function(e){var t=R[e.type];return C.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},O.OBJECT=function(e){var t=O[e.type];return C.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},R.TABLE=function(e){for(var t=[],r=e.fields.length,n=[],i=[],o=0;o<r;o+=1){var s=e.fields[o],a=R[s.type],l=(C.argument(void 0!==a,"No encoding function for field type "+s.type+" ("+s.name+")"),e[s.name]);a=a(l=void 0===l?s.value:l),"TABLE"===s.type?(i.push(t.length),t=t.concat([0,0]),n.push(a)):t=t.concat(a)}for(var c=0;c<n.length;c+=1){var u=i[c],h=t.length;C.argument(h<65536,"Table "+e.tableName+" too big."),t[u]=h>>8,t[u+1]=255&h,t=t.concat(n[c])}return t},O.TABLE=function(e){for(var t=0,r=e.fields.length,n=0;n<r;n+=1){var i=e.fields[n],o=O[i.type],s=(C.argument(void 0!==o,"No sizeOf function for field type "+i.type+" ("+i.name+")"),e[i.name]);t+=o(s=void 0===s?i.value:s),"TABLE"===i.type&&(t+=2)}return t},R.RECORD=R.TABLE,O.RECORD=O.TABLE,R.LITERAL=function(e){return e},O.LITERAL=function(e){return e.length},B.prototype.encode=function(){return R.TABLE(this)},B.prototype.sizeOf=function(){return O.TABLE(this)};var Y={Table:B,Record:B,Coverage:(H.prototype=Object.create(B.prototype)).constructor=H,ScriptList:(W.prototype=Object.create(B.prototype)).constructor=W,FeatureList:(q.prototype=Object.create(B.prototype)).constructor=q,LookupList:(X.prototype=Object.create(B.prototype)).constructor=X,ushortList:z,tableList:G,recordList:V};function Z(e,t){return e.getUint8(t)}function J(e,t){return e.getUint16(t,!1)}function K(e,t){return e.getUint32(t,!1)}function Q(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}var $={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function ee(e,t){this.data=e,this.offset=t,this.relativeOffset=0}ee.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},ee.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},ee.prototype.parseCard8=ee.prototype.parseByte,ee.prototype.parseCard16=ee.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},ee.prototype.parseSID=ee.prototype.parseUShort,ee.prototype.parseOffset16=ee.prototype.parseUShort,ee.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},ee.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},ee.prototype.parseOffset32=ee.prototype.parseULong=function(){var e=K(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},ee.prototype.parseFixed=function(){var e=Q(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},ee.prototype.parseString=function(e){var t=this.data,r=this.offset+this.relativeOffset,n="";this.relativeOffset+=e;for(var i=0;i<e;i++)n+=String.fromCharCode(t.getUint8(r+i));return n},ee.prototype.parseTag=function(){return this.parseString(4)},ee.prototype.parseLongDateTime=function(){var e=K(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},ee.prototype.parseVersion=function(e){var t=J(this.data,this.offset+this.relativeOffset),r=J(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,t+r/(e=void 0===e?4096:e)/10},ee.prototype.skip=function(e,t){this.relativeOffset+=$[e]*(t=void 0===t?1:t)},ee.prototype.parseULongList=function(e){void 0===e&&(e=this.parseULong());for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=r.getUint32(n),n+=4;return this.relativeOffset+=4*e,t},ee.prototype.parseOffset16List=ee.prototype.parseUShortList=function(e){void 0===e&&(e=this.parseUShort());for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=r.getUint16(n),n+=2;return this.relativeOffset+=2*e,t},ee.prototype.parseShortList=function(e){for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=r.getInt16(n),n+=2;return this.relativeOffset+=2*e,t},ee.prototype.parseByteList=function(e){for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=r.getUint8(n++);return this.relativeOffset+=e,t},ee.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());for(var r=new Array(e),n=0;n<e;n++)r[n]=t.call(this);return r},ee.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());for(var r=new Array(e),n=0;n<e;n++)r[n]=t.call(this);return r},ee.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());for(var r=new Array(e),n=Object.keys(t),i=0;i<e;i++){for(var o={},s=0;s<n.length;s++){var a=n[s],l=t[a];o[a]=l.call(this)}r[i]=o}return r},ee.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());for(var r=new Array(e),n=Object.keys(t),i=0;i<e;i++){for(var o={},s=0;s<n.length;s++){var a=n[s],l=t[a];o[a]=l.call(this)}r[i]=o}return r},ee.prototype.parseStruct=function(e){if("function"==typeof e)return e.call(this);for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var i=t[n],o=e[i];r[i]=o.call(this)}return r},ee.prototype.parseValueRecord=function(e){var t;if(0!==(e=void 0===e?this.parseUShort():e))return t={},1&e&&(t.xPlacement=this.parseShort()),2&e&&(t.yPlacement=this.parseShort()),4&e&&(t.xAdvance=this.parseShort()),8&e&&(t.yAdvance=this.parseShort()),16&e&&(t.xPlaDevice=void 0,this.parseShort()),32&e&&(t.yPlaDevice=void 0,this.parseShort()),64&e&&(t.xAdvDevice=void 0,this.parseShort()),128&e&&(t.yAdvDevice=void 0,this.parseShort()),t},ee.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),t=this.parseUShort(),r=new Array(t),n=0;n<t;n++)r[n]=this.parseValueRecord(e);return r},ee.prototype.parsePointer=function(e){var t=this.parseOffset16();if(0<t)return new ee(this.data,this.offset+t).parseStruct(e)},ee.prototype.parsePointer32=function(e){var t=this.parseOffset32();if(0<t)return new ee(this.data,this.offset+t).parseStruct(e)},ee.prototype.parseListOfLists=function(e){for(var t=this.parseOffset16List(),r=t.length,n=this.relativeOffset,i=new Array(r),o=0;o<r;o++){var s=t[o];if(0===s)i[o]=void 0;else if(this.relativeOffset=s,e){for(var a=this.parseOffset16List(),l=new Array(a.length),c=0;c<a.length;c++)this.relativeOffset=s+a[c],l[c]=e.call(this);i[o]=l}else i[o]=this.parseUShortList()}return this.relativeOffset=n,i},ee.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort(),r=this.parseUShort();if(1===t)return{format:1,glyphs:this.parseUShortList(r)};if(2!==t)throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.");for(var n=new Array(r),i=0;i<r;i++)n[i]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}},ee.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(2===t)return{format:2,ranges:this.parseRecordList({start:ee.uShort,end:ee.uShort,classId:ee.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")},ee.list=function(e,t){return function(){return this.parseList(e,t)}},ee.list32=function(e,t){return function(){return this.parseList32(e,t)}},ee.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},ee.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},ee.pointer=function(e){return function(){return this.parsePointer(e)}},ee.pointer32=function(e){return function(){return this.parsePointer32(e)}},ee.tag=ee.prototype.parseTag,ee.byte=ee.prototype.parseByte,ee.uShort=ee.offset16=ee.prototype.parseUShort,ee.uShortList=ee.prototype.parseUShortList,ee.uLong=ee.offset32=ee.prototype.parseULong,ee.uLongList=ee.prototype.parseULongList,ee.struct=ee.prototype.parseStruct,ee.coverage=ee.prototype.parseCoverage,ee.classDef=ee.prototype.parseClassDef;var te={reserved:ee.uShort,reqFeatureIndex:ee.uShort,featureIndexes:ee.uShortList},re=(ee.prototype.parseScriptList=function(){return this.parsePointer(ee.recordList({tag:ee.tag,script:ee.pointer({defaultLangSys:ee.pointer(te),langSysRecords:ee.recordList({tag:ee.tag,langSys:ee.pointer(te)})})}))||[]},ee.prototype.parseFeatureList=function(){return this.parsePointer(ee.recordList({tag:ee.tag,feature:ee.pointer({featureParams:ee.offset16,lookupListIndexes:ee.uShortList})}))||[]},ee.prototype.parseLookupList=function(e){return this.parsePointer(ee.list(ee.pointer((function(){var t=this.parseUShort(),r=(C.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown."),this.parseUShort()),n=16&r;return{lookupType:t,lookupFlag:r,subtables:this.parseList(ee.pointer(e[t])),markFilteringSet:n?this.parseUShort():void 0}}))))||[]},ee.prototype.parseFeatureVariationsList=function(){return this.parsePointer32((function(){var e=this.parseUShort(),t=this.parseUShort();return C.argument(1===e&&t<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:ee.offset32,featureTableSubstitutionOffset:ee.offset32})}))||[]},{getByte:Z,getCard8:Z,getUShort:J,getCard16:J,getShort:function(e,t){return e.getInt16(t,!1)},getULong:K,getFixed:Q,getTag:function(e,t){for(var r="",n=t;n<t+4;n+=1)r+=String.fromCharCode(e.getInt8(n));return r},getOffset:function(e,t,r){for(var n=0,i=0;i<r;i+=1)n=(n<<=8)+e.getUint8(t+i);return n},getBytes:function(e,t,r){for(var n=[],i=t;i<r;i+=1)n.push(e.getUint8(i));return n},bytesToString:function(e){for(var t="",r=0;r<e.length;r+=1)t+=String.fromCharCode(e[r]);return t},Parser:ee}),ne=function(e,t){for(var r={},n=(r.version=re.getUShort(e,t),C.argument(0===r.version,"cmap table version should be 0."),r.numTables=re.getUShort(e,t+2),-1),i=r.numTables-1;0<=i;--i){var o=re.getUShort(e,t+4+8*i),s=re.getUShort(e,t+4+8*i+2);if(3===o&&(0===s||1===s||10===s)||0===o&&(0===s||1===s||2===s||3===s||4===s)){n=re.getULong(e,t+4+8*i+4);break}}if(-1===n)throw new Error("No valid cmap sub-tables found.");var a=new re.Parser(e,t+n);if(r.format=a.parseUShort(),12===r.format){var l,c=r,u=a;u.parseUShort(),c.length=u.parseULong(),c.language=u.parseULong(),c.groupCount=l=u.parseULong(),c.glyphIndexMap={};for(var h=0;h<l;h+=1)for(var d=u.parseULong(),p=u.parseULong(),f=u.parseULong(),m=d;m<=p;m+=1)c.glyphIndexMap[m]=f,f++}else{if(4!==r.format)throw new Error("Only format 4 and 12 cmap tables are supported (found format "+r.format+").");var y=r,g=e,v=t,b=n;y.length=a.parseUShort(),y.language=a.parseUShort(),y.segCount=_=a.parseUShort()>>1,a.skip("uShort",3),y.glyphIndexMap={};for(var _,x=new re.Parser(g,v+b+14),w=new re.Parser(g,v+b+16+2*_),S=new re.Parser(g,v+b+16+4*_),M=new re.Parser(g,v+b+16+6*_),T=v+b+16+8*_,E=0;E<_-1;E+=1)for(var j=void 0,A=x.parseUShort(),L=w.parseUShort(),P=S.parseShort(),R=M.parseUShort(),O=L;O<=A;O+=1)0!==R?(T=(T=M.offset+M.relativeOffset-2)+R+2*(O-L),0!==(j=re.getUShort(g,T))&&(j=j+P&65535)):j=O+P&65535,y.glyphIndexMap[O]=j}return r},ie=function(e){for(var t=!0,r=e.length-1;0<r;--r)if(65535<e.get(r).unicode){console.log("Adding CMAP format 12 (needed!)"),t=!1;break}var n,i,o=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:t?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:t?12:20}],s=(o=(o=t?o:o.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])).concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]),new Y.Table("cmap",o));for(s.segments=[],r=0;r<e.length;r+=1){for(var a=e.get(r),l=0;l<a.unicodes.length;l+=1)n=a.unicodes[l],i=r,s.segments.push({end:n,start:n,delta:-(n-i),offset:0,glyphIndex:i});s.segments=s.segments.sort((function(e,t){return e.start-t.start}))}s.segments.push({end:65535,start:65535,delta:1,offset:0});var c=s.segments.length,u=0,h=[],d=[],p=[],f=[],m=[],y=[];for(r=0;r<c;r+=1){var g=s.segments[r];g.end<=65535&&g.start<=65535?(h=h.concat({name:"end_"+r,type:"USHORT",value:g.end}),d=d.concat({name:"start_"+r,type:"USHORT",value:g.start}),p=p.concat({name:"idDelta_"+r,type:"SHORT",value:g.delta}),f=f.concat({name:"idRangeOffset_"+r,type:"USHORT",value:g.offset}),void 0!==g.glyphId&&(m=m.concat({name:"glyph_"+r,type:"USHORT",value:g.glyphId}))):u+=1,t||void 0===g.glyphIndex||(y=(y=(y=y.concat({name:"cmap12Start_"+r,type:"ULONG",value:g.start})).concat({name:"cmap12End_"+r,type:"ULONG",value:g.end})).concat({name:"cmap12Glyph_"+r,type:"ULONG",value:g.glyphIndex}))}return s.segCountX2=2*(c-u),s.searchRange=2*Math.pow(2,Math.floor(Math.log(c-u)/Math.log(2))),s.entrySelector=Math.log(s.searchRange/2)/Math.log(2),s.rangeShift=s.segCountX2-s.searchRange,s.fields=s.fields.concat(h),s.fields.push({name:"reservedPad",type:"USHORT",value:0}),s.fields=s.fields.concat(d),s.fields=s.fields.concat(p),s.fields=s.fields.concat(f),s.fields=s.fields.concat(m),s.cmap4Length=14+2*h.length+2+2*d.length+2*p.length+2*f.length+2*m.length,t||(o=16+4*y.length,s.cmap12Offset=20+s.cmap4Length,s.fields=s.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:o},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:y.length/3}]),s.fields=s.fields.concat(y)),s},oe=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],se=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],ae=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],le=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function ce(e){this.font=e}function ue(e){this.cmap=e}function he(e,t){this.encoding=e,this.charset=t}function de(e){switch(e.version){case 1:this.names=le.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<le.length?this.names[t]=le[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-le.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(var r=0;r<e.numberOfGlyphs;r++)this.names[r]=le[r+e.glyphNameIndex[r]];break;default:this.names=[]}}ce.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),r=this.font.glyphs;if(r)for(var n=0;n<r.length;n+=1)for(var i=r.get(n),o=0;o<i.unicodes.length;o+=1)if(i.unicodes[o]===t)return n;return null},ue.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0},he.prototype.charToGlyphIndex=function(e){return e=e.codePointAt(0),e=this.encoding[e],this.charset.indexOf(e)},de.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},de.prototype.glyphIndexToName=function(e){return this.names[e]};var pe=function(e,t,r,n,i){e.beginPath(),e.moveTo(t,r),e.lineTo(n,i),e.stroke()};function fe(e){this.bindConstructorValues(e)}function me(e,t,r){Object.defineProperty(e,t,{get:function(){return e.path,e[r]},set:function(t){e[r]=t},enumerable:!0,configurable:!0})}function ye(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(var r=0;r<t.length;r++)this.glyphs[r]=t[r];this.length=t&&t.length||0}fe.prototype.bindConstructorValues=function(e){var t;this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||void 0!==e.unicode?[e.unicode]:[],e.xMin&&(this.xMin=e.xMin),e.yMin&&(this.yMin=e.yMin),e.xMax&&(this.xMax=e.xMax),e.yMax&&(this.yMax=e.yMax),e.advanceWidth&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",(e=e.path,t=e||new j,{configurable:!0,get:function(){return t="function"==typeof t?t():t},set:function(e){t=e}}))},fe.prototype.addUnicode=function(e){0===this.unicodes.length&&(this.unicode=e),this.unicodes.push(e)},fe.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},fe.prototype.getPath=function(e,t,r,n,i){e=void 0!==e?e:0,t=void 0!==t?t:0,r=void 0!==r?r:72;for(var o,s,a=(n=n||{}).xScale,l=n.yScale,c=((o=n.hinting&&i&&i.hinting?this.path&&i.hinting.exec(this,r):o)?(s=i.hinting.getCommands(o),e=Math.round(e),t=Math.round(t),a=l=1):(s=this.path.commands,n=1/this.path.unitsPerEm*r,void 0===a&&(a=n),void 0===l&&(l=n)),new j),u=0;u<s.length;u+=1){var h=s[u];"M"===h.type?c.moveTo(e+h.x*a,t+-h.y*l):"L"===h.type?c.lineTo(e+h.x*a,t+-h.y*l):"Q"===h.type?c.quadraticCurveTo(e+h.x1*a,t+-h.y1*l,e+h.x*a,t+-h.y*l):"C"===h.type?c.curveTo(e+h.x1*a,t+-h.y1*l,e+h.x2*a,t+-h.y2*l,e+h.x*a,t+-h.y*l):"Z"===h.type&&c.closePath()}return c},fe.prototype.getContours=function(){if(void 0===this.points)return[];for(var e=[],t=[],r=0;r<this.points.length;r+=1){var n=this.points[r];t.push(n),n.lastPointOfContour&&(e.push(t),t=[])}return C.argument(0===t.length,"There are still points left in the current contour."),e},fe.prototype.getMetrics=function(){for(var e=this.path.commands,t=[],r=[],n=0;n<e.length;n+=1){var i=e[n];"Z"!==i.type&&(t.push(i.x),r.push(i.y)),"Q"!==i.type&&"C"!==i.type||(t.push(i.x1),r.push(i.y1)),"C"===i.type&&(t.push(i.x2),r.push(i.y2))}var o={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,r),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,r),leftSideBearing:this.leftSideBearing};return isFinite(o.xMin)||(o.xMin=0),isFinite(o.xMax)||(o.xMax=this.advanceWidth),isFinite(o.yMin)||(o.yMin=0),isFinite(o.yMax)||(o.yMax=0),o.rightSideBearing=this.advanceWidth-o.leftSideBearing-(o.xMax-o.xMin),o},fe.prototype.draw=function(e,t,r,n,i){this.getPath(t,r,n,i).draw(e)},fe.prototype.drawPoints=function(e,t,r,n){function i(t,r,n,i){var o=2*Math.PI;e.beginPath();for(var s=0;s<t.length;s+=1)e.moveTo(r+t[s].x*i,n+t[s].y*i),e.arc(r+t[s].x*i,n+t[s].y*i,2,0,o,!1);e.closePath(),e.fill()}t=void 0!==t?t:0,r=void 0!==r?r:0,n=1/this.path.unitsPerEm*(n=void 0!==n?n:24);for(var o=[],s=[],a=this.path,l=0;l<a.commands.length;l+=1){var c=a.commands[l];void 0!==c.x&&o.push({x:c.x,y:-c.y}),void 0!==c.x1&&s.push({x:c.x1,y:-c.y1}),void 0!==c.x2&&s.push({x:c.x2,y:-c.y2})}e.fillStyle="blue",i(o,t,r,n),e.fillStyle="red",i(s,t,r,n)},fe.prototype.drawMetrics=function(e,t,r,n){t=void 0!==t?t:0,r=void 0!==r?r:0,n=1/this.path.unitsPerEm*(n=void 0!==n?n:24),e.lineWidth=1,e.strokeStyle="black",pe(e,t,-1e4,t,1e4),pe(e,-1e4,r,1e4,r);var i=this.xMin||0,o=this.yMin||0,s=this.xMax||0,a=this.yMax||0,l=this.advanceWidth||0;e.strokeStyle="blue",pe(e,t+i*n,-1e4,t+i*n,1e4),pe(e,t+s*n,-1e4,t+s*n,1e4),pe(e,-1e4,r+-o*n,1e4,r+-o*n),pe(e,-1e4,r+-a*n,1e4,r+-a*n),e.strokeStyle="green",pe(e,t+l*n,-1e4,t+l*n,1e4)},ye.prototype.get=function(e){return"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]()),this.glyphs[e]},ye.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};var ge={GlyphSet:ye,glyphLoader:function(e,t){return new fe({index:t,font:e})},ttfGlyphLoader:function(e,t,r,n,i,o){return function(){var s=new fe({index:t,font:e});return s.path=function(){r(s,n,i);var t=o(e.glyphs,s);return t.unitsPerEm=e.unitsPerEm,t},me(s,"xMin","_xMin"),me(s,"xMax","_xMax"),me(s,"yMin","_yMin"),me(s,"yMax","_yMax"),s}},cffGlyphLoader:function(e,t,r,n){return function(){var i=new fe({index:t,font:e});return i.path=function(){var t=r(e,i,n);return t.unitsPerEm=e.unitsPerEm,t},i}}};function ve(e){return e.length<1240?107:e.length<33900?1131:32768}function be(e,t,r){var n,i=[],o=[],s=re.getCard16(e,t);if(0!==s){for(var a=re.getByte(e,t+2),l=t+(s+1)*a+2,c=t+3,u=0;u<s+1;u+=1)i.push(re.getOffset(e,c,a)),c+=a;n=l+i[s]}else n=t+2;for(var h=0;h<i.length-1;h+=1){var d=re.getBytes(e,l+i[h],l+i[h+1]);r&&(d=r(d)),o.push(d)}return{objects:o,startOffset:t,endOffset:n}}function _e(e,t){if(28===t)return e.parseByte()<<8|e.parseByte();if(29===t)return e.parseByte()<<24|e.parseByte()<<16|e.parseByte()<<8|e.parseByte();if(30===t){for(var r=e,n="",i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var o=(s=r.parseByte())>>4,s=15&s;if(15==o)break;if(n+=i[o],15==s)break;n+=i[s]}return parseFloat(n)}if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function xe(e,t,r){var n=new re.Parser(e,t=void 0!==t?t:0),i=[],o=[];for(r=void 0!==r?r:e.length;n.relativeOffset<r;){var s=n.parseByte();s<=21?(12===s&&(s=1200+n.parseByte()),i.push([s,o]),o=[]):o.push(_e(n,s))}for(var a=i,l={},c=0;c<a.length;c+=1){var u=a[c][0],h=a[c][1],d=1===h.length?h[0]:h;if(l.hasOwnProperty(u)&&!isNaN(l[u]))throw new Error("Object "+l+" already has key "+u);l[u]=d}return l}function we(e,t){return t<=390?oe[t]:e[t-391]}function Se(e,t,r){for(var n,i={},o=0;o<t.length;o+=1){var s=t[o];if(Array.isArray(s.type)){var a=[];a.length=s.type.length;for(var l=0;l<s.type.length;l++)void 0===(n=void 0!==e[s.op]?e[s.op][l]:void 0)&&(n=void 0!==s.value&&void 0!==s.value[l]?s.value[l]:null),"SID"===s.type[l]&&(n=we(r,n)),a[l]=n;i[s.name]=a}else void 0===(n=e[s.op])&&(n=void 0!==s.value?s.value:null),"SID"===s.type&&(n=we(r,n)),i[s.name]=n}return i}var Me=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],Te=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function Ee(e,t,r,n){return Se(xe(e,t,r),Te,n)}function je(e,t,r,n){for(var i=[],o=0;o<r.length;o+=1){var s,a=((a=n,s=Se(xe(s=new DataView(new Uint8Array(r[o]).buffer),0,s.byteLength),Me,a))._subrs=[],s._subrsBias=0,s.private[0]),l=s.private[1];0!==a&&0!==l&&(a=Ee(e,l+t,a,n),s._defaultWidthX=a.defaultWidthX,s._nominalWidthX=a.nominalWidthX,0!==a.subrs&&(l=be(e,l+a.subrs+t),s._subrs=l.objects,s._subrsBias=ve(s._subrs)),s._privateDict=a),i.push(s)}return i}function Ae(e,t,r){var n,i,o,s,a,l,c,u,h,d=new j,p=[],f=0,m=!1,y=!1,g=0,v=0,b=(h=(e.isCIDFont?(a=e.tables.cff.topDict._fdSelect[t.index],a=e.tables.cff.topDict._fdArray[a],l=a._subrs,c=a._subrsBias,u=a._defaultWidthX,a):(l=e.tables.cff.topDict._subrs,c=e.tables.cff.topDict._subrsBias,u=e.tables.cff.topDict._defaultWidthX,e.tables.cff.topDict))._nominalWidthX,u);function _(e,t){y&&d.closePath(),d.moveTo(e,t),y=!0}function x(){p.length%2==0||m||(b=p.shift()+h),f+=p.length>>1,p.length=0,m=!0}return function r(a){for(var u,w,S,M,T,E,j,A,L,C,P,R,O=0;O<a.length;){var k=a[O];switch(O+=1,k){case 1:case 3:case 18:case 23:x();break;case 4:1<p.length&&!m&&(b=p.shift()+h,m=!0),v+=p.pop(),_(g,v);break;case 5:for(;0<p.length;)g+=p.shift(),v+=p.shift(),d.lineTo(g,v);break;case 6:for(;0<p.length&&(g+=p.shift(),d.lineTo(g,v),0!==p.length);)v+=p.shift(),d.lineTo(g,v);break;case 7:for(;0<p.length&&(v+=p.shift(),d.lineTo(g,v),0!==p.length);)g+=p.shift(),d.lineTo(g,v);break;case 8:for(;0<p.length;)n=g+p.shift(),i=v+p.shift(),o=n+p.shift(),s=i+p.shift(),g=o+p.shift(),v=s+p.shift(),d.curveTo(n,i,o,s,g,v);break;case 10:T=p.pop()+c,(E=l[T])&&r(E);break;case 11:return;case 12:switch(k=a[O],O+=1,k){case 35:n=g+p.shift(),i=v+p.shift(),o=n+p.shift(),s=i+p.shift(),j=o+p.shift(),A=s+p.shift(),L=j+p.shift(),C=A+p.shift(),P=L+p.shift(),R=C+p.shift(),g=P+p.shift(),v=R+p.shift(),p.shift(),d.curveTo(n,i,o,s,j,A),d.curveTo(L,C,P,R,g,v);break;case 34:n=g+p.shift(),i=v,o=n+p.shift(),s=i+p.shift(),j=o+p.shift(),A=s,L=j+p.shift(),C=s,P=L+p.shift(),R=v,g=P+p.shift(),d.curveTo(n,i,o,s,j,A),d.curveTo(L,C,P,R,g,v);break;case 36:n=g+p.shift(),i=v+p.shift(),o=n+p.shift(),s=i+p.shift(),j=o+p.shift(),A=s,L=j+p.shift(),C=s,P=L+p.shift(),R=C+p.shift(),g=P+p.shift(),d.curveTo(n,i,o,s,j,A),d.curveTo(L,C,P,R,g,v);break;case 37:n=g+p.shift(),i=v+p.shift(),o=n+p.shift(),s=i+p.shift(),j=o+p.shift(),A=s+p.shift(),L=j+p.shift(),C=A+p.shift(),P=L+p.shift(),R=C+p.shift(),Math.abs(P-g)>Math.abs(R-v)?g=P+p.shift():v=R+p.shift(),d.curveTo(n,i,o,s,j,A),d.curveTo(L,C,P,R,g,v);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+k),p.length=0}break;case 14:0<p.length&&!m&&(b=p.shift()+h,m=!0),y&&(d.closePath(),y=!1);break;case 19:case 20:x(),O+=f+7>>3;break;case 21:2<p.length&&!m&&(b=p.shift()+h,m=!0),v+=p.pop(),_(g+=p.pop(),v);break;case 22:1<p.length&&!m&&(b=p.shift()+h,m=!0),_(g+=p.pop(),v);break;case 24:for(;2<p.length;)n=g+p.shift(),i=v+p.shift(),o=n+p.shift(),s=i+p.shift(),g=o+p.shift(),v=s+p.shift(),d.curveTo(n,i,o,s,g,v);g+=p.shift(),v+=p.shift(),d.lineTo(g,v);break;case 25:for(;6<p.length;)g+=p.shift(),v+=p.shift(),d.lineTo(g,v);n=g+p.shift(),i=v+p.shift(),o=n+p.shift(),s=i+p.shift(),g=o+p.shift(),v=s+p.shift(),d.curveTo(n,i,o,s,g,v);break;case 26:for(p.length%2&&(g+=p.shift());0<p.length;)n=g,i=v+p.shift(),o=n+p.shift(),s=i+p.shift(),g=o,v=s+p.shift(),d.curveTo(n,i,o,s,g,v);break;case 27:for(p.length%2&&(v+=p.shift());0<p.length;)n=g+p.shift(),i=v,o=n+p.shift(),s=i+p.shift(),g=o+p.shift(),v=s,d.curveTo(n,i,o,s,g,v);break;case 28:u=a[O],w=a[O+1],p.push((u<<24|w<<16)>>16),O+=2;break;case 29:T=p.pop()+e.gsubrsBias,(E=e.gsubrs[T])&&r(E);break;case 30:for(;0<p.length&&(n=g,i=v+p.shift(),o=n+p.shift(),s=i+p.shift(),g=o+p.shift(),v=s+(1===p.length?p.shift():0),d.curveTo(n,i,o,s,g,v),0!==p.length);)n=g+p.shift(),i=v,o=n+p.shift(),s=i+p.shift(),v=s+p.shift(),g=o+(1===p.length?p.shift():0),d.curveTo(n,i,o,s,g,v);break;case 31:for(;0<p.length&&(n=g+p.shift(),i=v,o=n+p.shift(),s=i+p.shift(),v=s+p.shift(),g=o+(1===p.length?p.shift():0),d.curveTo(n,i,o,s,g,v),0!==p.length);)n=g,i=v+p.shift(),o=n+p.shift(),s=i+p.shift(),g=o+p.shift(),v=s+(1===p.length?p.shift():0),d.curveTo(n,i,o,s,g,v);break;default:k<32?console.log("Glyph "+t.index+": unknown operator "+k):k<247?p.push(k-139):k<251?(u=a[O],O+=1,p.push(256*(k-247)+u+108)):k<255?(u=a[O],O+=1,p.push(256*-(k-251)-u-108)):(u=a[O],w=a[O+1],S=a[O+2],M=a[O+3],O+=4,p.push((u<<24|w<<16|S<<8|M)/65536))}}}(r),t.advanceWidth=b,d}function Le(e,t){var r,n=oe.indexOf(e);return 0<=n&&(r=n),0<=(n=t.indexOf(e))?r=n+oe.length:(r=oe.length+t.length,t.push(e)),r}function Ce(e,t,r){for(var n={},i=0;i<e.length;i+=1){var o=e[i],s=t[o.name];void 0===s||function e(t,r){if(t===r)return 1;if(Array.isArray(t)&&Array.isArray(r)&&t.length===r.length){for(var n=0;n<t.length;n+=1)if(!e(t[n],r[n]))return;return 1}}(s,o.value)||("SID"===o.type&&(s=Le(s,r)),n[o.op]={name:o.name,type:o.type,value:s})}return n}function Pe(e,t){var r=new Y.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return r.dict=Ce(Me,e,t),r}function Re(e){var t=new Y.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}var Oe=function(e,t,r){r.tables.cff={},n=e,i=t,(o={}).formatMajor=re.getCard8(n,i),o.formatMinor=re.getCard8(n,i+1),o.size=re.getCard8(n,i+2),o.offsetSize=re.getCard8(n,i+3),o.startOffset=i,o.endOffset=i+4;var n=be(e,o.endOffset,re.bytesToString),i=be(e,n.endOffset),o=be(e,i.endOffset,re.bytesToString);if(n=be(e,o.endOffset),r.gsubrs=n.objects,r.gsubrsBias=ve(r.gsubrs),1!==(n=je(e,t,i.objects,o.objects)).length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+n.length);if(i=n[0],(r.tables.cff.topDict=i)._privateDict&&(r.defaultWidthX=i._privateDict.defaultWidthX,r.nominalWidthX=i._privateDict.nominalWidthX),void 0!==i.ros[0]&&void 0!==i.ros[1]&&(r.isCIDFont=!0),r.isCIDFont){n=i.fdArray;var s=i.fdSelect;if(0===n||0===s)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");n=je(e,t,be(e,n+=t).objects,o.objects),i._fdArray=n,i._fdSelect=function(e,t,r,n){var i,o=[],s=new re.Parser(e,t);if(0===(e=s.parseCard8()))for(var a=0;a<r;a++){if(n<=(i=s.parseCard8()))throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+n+")");o.push(i)}else{if(3!==e)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+e);var l,c=s.parseCard16(),u=s.parseCard16();if(0!==u)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+u);for(var h=0;h<c;h++){if(i=s.parseCard8(),l=s.parseCard16(),n<=i)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+n+")");if(r<l)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+l);for(;u<l;u++)o.push(i);u=l}if(l!==r)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+l)}return o}(e,s+=t,r.numGlyphs,n.length)}n=Ee(e,s=t+i.private[1],i.private[0],o.objects);var a=(r.defaultWidthX=n.defaultWidthX,r.nominalWidthX=n.nominalWidthX,0!==n.subrs?(s=be(e,s+n.subrs),r.subrs=s.objects,r.subrsBias=ve(r.subrs)):(r.subrs=[],r.subrsBias=0),be(e,t+i.charStrings));r.nGlyphs=a.objects.length,n=function(e,t,r,n){var i=new re.Parser(e,t),o=(--r,[".notdef"]);if(0===(e=i.parseCard8()))for(var s=0;s<r;s+=1)a=i.parseSID(),o.push(we(n,a));else if(1===e)for(;o.length<=r;)for(var a=i.parseSID(),l=i.parseCard8(),c=0;c<=l;c+=1)o.push(we(n,a)),a+=1;else{if(2!==e)throw new Error("Unknown charset format "+e);for(;o.length<=r;){a=i.parseSID(),l=i.parseCard16();for(var u=0;u<=l;u+=1)o.push(we(n,a)),a+=1}}return o}(e,t+i.charset,r.nGlyphs,o.objects),0===i.encoding?r.cffEncoding=new he(se,n):1===i.encoding?r.cffEncoding=new he(ae,n):r.cffEncoding=function(e,t,r){var n={},i=new re.Parser(e,t);if(0===(e=i.parseCard8()))for(var o=i.parseCard8(),s=0;s<o;s+=1)n[l=i.parseCard8()]=s;else{if(1!==e)throw new Error("Unknown encoding format "+e);for(var a=i.parseCard8(),l=1,c=0;c<a;c+=1)for(var u=i.parseCard8(),h=i.parseCard8(),d=u;d<=u+h;d+=1)n[d]=l,l+=1}return new he(n,r)}(e,t+i.encoding,n),r.encoding=r.encoding||r.cffEncoding,r.glyphs=new ge.GlyphSet(r);for(var l=0;l<r.nGlyphs;l+=1){var c=a.objects[l];r.glyphs.push(l,ge.cffGlyphLoader(r,l,Ae,c))}},ke=function(e,t){for(var r,n=new Y.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),i=1/t.unitsPerEm,o=(i={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[i,0,0,i,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},[]),s=1;s<e.length;s+=1)r=e.get(s),o.push(r.name);var a,l,c=[],u=(n.header=new Y.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}]),n.nameIndex=function(e){var t=new Y.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(var r=0;r<e.length;r+=1)t.names.push({name:"name_"+r,type:"NAME",value:e[r]});return t}([t.postScriptName]),t=Pe(i,c),n.topDictIndex=Re(t),n.globalSubrIndex=new Y.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}]),n.charsets=function(e,t){for(var r=new Y.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<e.length;n+=1){var i=Le(e[n],t);r.fields.push({name:"glyph_"+n,type:"SID",value:i})}return r}(o,c),n.charStringsIndex=function(e){for(var t=new Y.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),r=0;r<e.length;r+=1){var n=e.get(r),i=function(e){for(var t=[],r=e.path,n=(t.push({name:"width",type:"NUMBER",value:e.advanceWidth}),0),i=0,o=0;o<r.commands.length;o+=1){var s,a,l,c,u=void 0,h=void 0,d=r.commands[o];"M"===(d="Q"===d.type?{type:"C",x:d.x,y:d.y,x1:1/3*n+2/3*d.x1,y1:1/3*i+2/3*d.y1,x2:1/3*d.x+2/3*d.x1,y2:1/3*d.y+2/3*d.y1}:d).type?(u=Math.round(d.x-n),h=Math.round(d.y-i),t.push({name:"dx",type:"NUMBER",value:u}),t.push({name:"dy",type:"NUMBER",value:h}),t.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(d.x),i=Math.round(d.y)):"L"===d.type?(u=Math.round(d.x-n),h=Math.round(d.y-i),t.push({name:"dx",type:"NUMBER",value:u}),t.push({name:"dy",type:"NUMBER",value:h}),t.push({name:"rlineto",type:"OP",value:5}),n=Math.round(d.x),i=Math.round(d.y)):"C"===d.type&&(s=Math.round(d.x1-n),a=Math.round(d.y1-i),l=Math.round(d.x2-d.x1),c=Math.round(d.y2-d.y1),u=Math.round(d.x-d.x2),h=Math.round(d.y-d.y2),t.push({name:"dx1",type:"NUMBER",value:s}),t.push({name:"dy1",type:"NUMBER",value:a}),t.push({name:"dx2",type:"NUMBER",value:l}),t.push({name:"dy2",type:"NUMBER",value:c}),t.push({name:"dx",type:"NUMBER",value:u}),t.push({name:"dy",type:"NUMBER",value:h}),t.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(d.x),i=Math.round(d.y))}return t.push({name:"endchar",type:"OP",value:14}),t}(n);t.charStrings.push({name:n.name,type:"CHARSTRING",value:i})}return t}(e),n.privateDict=(u={},a=c,(l=new Y.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}])).dict=Ce(Te,u,a),l),n.stringIndex=function(e){var t=new Y.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(var r=0;r<e.length;r+=1)t.strings.push({name:"string_"+r,type:"STRING",value:e[r]});return t}(c),n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf());return i.charset=u,i.encoding=0,i.charStrings=i.charset+n.charsets.sizeOf(),i.private[1]=i.charStrings+n.charStringsIndex.sizeOf(),t=Pe(i,c),n.topDictIndex=Re(t),n},Ie=function(e,t){var r={};return e=new re.Parser(e,t),r.version=e.parseVersion(),r.fontRevision=Math.round(1e3*e.parseFixed())/1e3,r.checkSumAdjustment=e.parseULong(),r.magicNumber=e.parseULong(),C.argument(1594834165===r.magicNumber,"Font header has wrong magic number."),r.flags=e.parseUShort(),r.unitsPerEm=e.parseUShort(),r.created=e.parseLongDateTime(),r.modified=e.parseLongDateTime(),r.xMin=e.parseShort(),r.yMin=e.parseShort(),r.xMax=e.parseShort(),r.yMax=e.parseShort(),r.macStyle=e.parseUShort(),r.lowestRecPPEM=e.parseUShort(),r.fontDirectionHint=e.parseShort(),r.indexToLocFormat=e.parseShort(),r.glyphDataFormat=e.parseShort(),r},De=function(e){var t=Math.round((new Date).getTime()/1e3)+2082844800,r=t;return e.createdTimestamp&&(r=e.createdTimestamp+2082844800),new Y.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:r},{name:"modified",type:"LONGDATETIME",value:t},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)},Ne=function(e,t){var r={};return e=new re.Parser(e,t),r.version=e.parseVersion(),r.ascender=e.parseShort(),r.descender=e.parseShort(),r.lineGap=e.parseShort(),r.advanceWidthMax=e.parseUShort(),r.minLeftSideBearing=e.parseShort(),r.minRightSideBearing=e.parseShort(),r.xMaxExtent=e.parseShort(),r.caretSlopeRise=e.parseShort(),r.caretSlopeRun=e.parseShort(),r.caretOffset=e.parseShort(),e.relativeOffset+=8,r.metricDataFormat=e.parseShort(),r.numberOfHMetrics=e.parseUShort(),r},Fe=function(e){return new Y.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],e)},Ue=function(e){for(var t=new Y.Table("hmtx",[]),r=0;r<e.length;r+=1){var n=(i=e.get(r)).advanceWidth||0,i=i.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+r,type:"USHORT",value:n}),t.fields.push({name:"leftSideBearing_"+r,type:"SHORT",value:i})}return t},Be=function(e){for(var t=new Y.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]),r="",n=12+4*e.length,i=0;i<e.length;++i){var o=r.indexOf(e[i]);o<0&&(o=r.length,r+=e[i]),t.fields.push({name:"offset "+i,type:"USHORT",value:n+o}),t.fields.push({name:"length "+i,type:"USHORT",value:e[i].length})}return t.fields.push({name:"stringPool",type:"CHARARRAY",value:r}),t},ze=function(e,t){for(var r=new re.Parser(e,t),n=r.parseULong(),i=(C.argument(1===n,"Unsupported ltag table version."),r.skip("uLong",1),r.parseULong()),o=[],s=0;s<i;s++){for(var a="",l=t+r.parseUShort(),c=r.parseUShort(),u=l;u<l+c;++u)a+=String.fromCharCode(e.getInt8(u));o.push(a)}return o},Ge=function(e,t){var r={};return e=new re.Parser(e,t),r.version=e.parseVersion(),r.numGlyphs=e.parseUShort(),1===r.version&&(r.maxPoints=e.parseUShort(),r.maxContours=e.parseUShort(),r.maxCompositePoints=e.parseUShort(),r.maxCompositeContours=e.parseUShort(),r.maxZones=e.parseUShort(),r.maxTwilightPoints=e.parseUShort(),r.maxStorage=e.parseUShort(),r.maxFunctionDefs=e.parseUShort(),r.maxInstructionDefs=e.parseUShort(),r.maxStackElements=e.parseUShort(),r.maxSizeOfInstructions=e.parseUShort(),r.maxComponentElements=e.parseUShort(),r.maxComponentDepth=e.parseUShort()),r},Ve=function(e){return new Y.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])},He=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],We={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},qe={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},Xe={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"},Ye="utf-16",Ze={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},Je={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function Ke(e,t,r){switch(e){case 0:return Ye;case 1:return Je[r]||Ze[t];case 3:if(1===t||10===t)return Ye}}function Qe(e){var t,r={};for(t in e)r[e[t]]=parseInt(t);return r}function $e(e,t,r,n,i,o){return new Y.Record("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:t},{name:"languageID",type:"USHORT",value:r},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:i},{name:"offset",type:"USHORT",value:o}])}function et(e,t){if((r=function(e,t){var r=e.length,n=t.length-r+1;e:for(var i=0;i<n;i++)for(;i<n;i++){for(var o=0;o<r;o++)if(t[i+o]!==e[o])continue e;return i}return-1}(e,t))<0)for(var r=t.length,n=0,i=e.length;n<i;++n)t.push(e[n]);return r}var tt=function(e,t,r){for(var n={},i=new re.Parser(e,t),o=(t=i.parseUShort(),i.parseUShort()),s=i.offset+i.parseUShort(),a=0;a<o;a++){var l=i.parseUShort(),c=i.parseUShort(),u=i.parseUShort(),h=i.parseUShort(),d=(h=He[h]||h,i.parseUShort()),p=i.parseUShort(),f=function(e,t,r){switch(e){case 0:if(65535===t)return"und";if(r)return r[t];break;case 1:return We[t];case 3:return Xe[t]}}(l,u,r);void 0!==(l=Ke(l,c,u))&&void 0!==f&&(c=void 0,(c=l===Ye?P.UTF16(e,s+p,d):P.MACSTRING(e,s+p,d,l))&&((u=void 0===(u=n[h])?n[h]={}:u)[f]=c))}return 1===t&&i.parseUShort(),n},rt=function(e,t){var r,n=[],i={},o=Qe(He);for(r in e){var s=o[r];if(void 0===s&&(s=r),d=parseInt(s),isNaN(d))throw new Error('Name table entry "'+r+'" does not exist, see nameTableNames for complete list.');i[d]=e[r],n.push(d)}for(var a=Qe(We),l=Qe(Xe),c=[],u=[],h=0;h<n.length;h++){var d,p,f=i[d=n[h]];for(p in f){var m=f[p],y=1,g=a[p],v=qe[g],b=Ke(y,v,g),_=(void 0===(b=R.MACSTRING(m,b))&&(y=0,(g=t.indexOf(p))<0&&(g=t.length,t.push(p)),v=4,b=R.UTF16(m)),et(b,u));void 0!==(c.push($e(y,v,g,d,b.length,_)),y=l[p])&&(g=et(v=R.UTF16(m),u),c.push($e(3,1,y,d,v.length,g)))}}c.sort((function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID}));for(var x=new Y.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:c.length},{name:"stringOffset",type:"USHORT",value:6+12*c.length}]),w=0;w<c.length;w++)x.fields.push({name:"record_"+w,type:"RECORD",value:c[w]});return x.fields.push({name:"strings",type:"LITERAL",value:u}),x},nt=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}],it=function(e,t){var r={},n=new re.Parser(e,t);r.version=n.parseUShort(),r.xAvgCharWidth=n.parseShort(),r.usWeightClass=n.parseUShort(),r.usWidthClass=n.parseUShort(),r.fsType=n.parseUShort(),r.ySubscriptXSize=n.parseShort(),r.ySubscriptYSize=n.parseShort(),r.ySubscriptXOffset=n.parseShort(),r.ySubscriptYOffset=n.parseShort(),r.ySuperscriptXSize=n.parseShort(),r.ySuperscriptYSize=n.parseShort(),r.ySuperscriptXOffset=n.parseShort(),r.ySuperscriptYOffset=n.parseShort(),r.yStrikeoutSize=n.parseShort(),r.yStrikeoutPosition=n.parseShort(),r.sFamilyClass=n.parseShort(),r.panose=[];for(var i=0;i<10;i++)r.panose[i]=n.parseByte();return r.ulUnicodeRange1=n.parseULong(),r.ulUnicodeRange2=n.parseULong(),r.ulUnicodeRange3=n.parseULong(),r.ulUnicodeRange4=n.parseULong(),r.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),r.fsSelection=n.parseUShort(),r.usFirstCharIndex=n.parseUShort(),r.usLastCharIndex=n.parseUShort(),r.sTypoAscender=n.parseShort(),r.sTypoDescender=n.parseShort(),r.sTypoLineGap=n.parseShort(),r.usWinAscent=n.parseUShort(),r.usWinDescent=n.parseUShort(),1<=r.version&&(r.ulCodePageRange1=n.parseULong(),r.ulCodePageRange2=n.parseULong()),2<=r.version&&(r.sxHeight=n.parseShort(),r.sCapHeight=n.parseShort(),r.usDefaultChar=n.parseUShort(),r.usBreakChar=n.parseUShort(),r.usMaxContent=n.parseUShort()),r},ot=function(e){return new Y.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)},st=function(e){for(var t=0;t<nt.length;t+=1){var r=nt[t];if(e>=r.begin&&e<r.end)return t}return-1},at=function(e,t){var r={},n=new re.Parser(e,t);switch(r.version=n.parseVersion(),r.italicAngle=n.parseFixed(),r.underlinePosition=n.parseShort(),r.underlineThickness=n.parseShort(),r.isFixedPitch=n.parseULong(),r.minMemType42=n.parseULong(),r.maxMemType42=n.parseULong(),r.minMemType1=n.parseULong(),r.maxMemType1=n.parseULong(),r.version){case 1:r.names=le.slice();break;case 2:r.numberOfGlyphs=n.parseUShort(),r.glyphNameIndex=new Array(r.numberOfGlyphs);for(var i=0;i<r.numberOfGlyphs;i++)r.glyphNameIndex[i]=n.parseUShort();r.names=[];for(var o,s=0;s<r.numberOfGlyphs;s++)r.glyphNameIndex[s]>=le.length&&(o=n.parseChar(),r.names.push(n.parseString(o)));break;case 2.5:r.numberOfGlyphs=n.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var a=0;a<r.numberOfGlyphs;a++)r.offset[a]=n.parseChar()}return r},lt=function(){return new Y.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])},ct=new Array(9),ut=(ct[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(ee.coverage),deltaGlyphId:this.parseUShort()}:2===t?{substFormat:2,coverage:this.parsePointer(ee.coverage),substitute:this.parseOffset16List()}:void C.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},ct[2]=function(){var e=this.parseUShort();return C.argument(1===e,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(ee.coverage),sequences:this.parseListOfLists()}},ct[3]=function(){var e=this.parseUShort();return C.argument(1===e,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(ee.coverage),alternateSets:this.parseListOfLists()}},ct[4]=function(){var e=this.parseUShort();return C.argument(1===e,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(ee.coverage),ligatureSets:this.parseListOfLists((function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}}))}},{sequenceIndex:ee.uShort,lookupListIndex:ee.uShort});ct[5]=function(){var e,t,r=this.offset+this.relativeOffset,n=this.parseUShort();return 1===n?{substFormat:n,coverage:this.parsePointer(ee.coverage),ruleSets:this.parseListOfLists((function(){var e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,ut)}}))}:2===n?{substFormat:n,coverage:this.parsePointer(ee.coverage),classDef:this.parsePointer(ee.classDef),classSets:this.parseListOfLists((function(){var e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,ut)}}))}:3===n?(e=this.parseUShort(),t=this.parseUShort(),{substFormat:n,coverages:this.parseList(e,ee.pointer(ee.coverage)),lookupRecords:this.parseRecordList(t,ut)}):void C.assert(!1,"0x"+r.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},ct[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(ee.coverage),chainRuleSets:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(ut)}}))}:2===t?{substFormat:2,coverage:this.parsePointer(ee.coverage),backtrackClassDef:this.parsePointer(ee.classDef),inputClassDef:this.parsePointer(ee.classDef),lookaheadClassDef:this.parsePointer(ee.classDef),chainClassSet:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(ut)}}))}:3===t?{substFormat:3,backtrackCoverage:this.parseList(ee.pointer(ee.coverage)),inputCoverage:this.parseList(ee.pointer(ee.coverage)),lookaheadCoverage:this.parseList(ee.pointer(ee.coverage)),lookupRecords:this.parseRecordList(ut)}:void C.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},ct[7]=function(){var e=this.parseUShort(),t=(C.argument(1===e,"GSUB Extension Substitution subtable identifier-format must be 1"),e=this.parseUShort(),new ee(this.data,this.offset+this.parseULong()));return{substFormat:1,lookupType:e,extension:ct[e].call(t)}},ct[8]=function(){var e=this.parseUShort();return C.argument(1===e,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(ee.coverage),backtrackCoverage:this.parseList(ee.pointer(ee.coverage)),lookaheadCoverage:this.parseList(ee.pointer(ee.coverage)),substitutes:this.parseUShortList()}};var ht=new Array(9);ht[1]=function(e){return 1===e.substFormat?new Y.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Y.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new Y.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new Y.Coverage(e.coverage)}].concat(Y.ushortList("substitute",e.substitute)))},ht[3]=function(e){return C.assert(1===e.substFormat,"Lookup type 3 substFormat must be 1."),new Y.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Y.Coverage(e.coverage)}].concat(Y.tableList("altSet",e.alternateSets,(function(e){return new Y.Table("alternateSetTable",Y.ushortList("alternate",e))}))))},ht[4]=function(e){return C.assert(1===e.substFormat,"Lookup type 4 substFormat must be 1."),new Y.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Y.Coverage(e.coverage)}].concat(Y.tableList("ligSet",e.ligatureSets,(function(e){return new Y.Table("ligatureSetTable",Y.tableList("ligature",e,(function(e){return new Y.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:e.ligGlyph}].concat(Y.ushortList("component",e.components,e.components.length+1)))})))}))))};var dt=function(e,t){return t=(e=new ee(e,t=t||0)).parseVersion(1),C.argument(1===t||1.1===t,"Unsupported GSUB table version."),1===t?{version:t,scripts:e.parseScriptList(),features:e.parseFeatureList(),lookups:e.parseLookupList(ct)}:{version:t,scripts:e.parseScriptList(),features:e.parseFeatureList(),lookups:e.parseLookupList(ct),variations:e.parseFeatureVariationsList()}},pt=function(e){return new Y.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new Y.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new Y.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new Y.LookupList(e.lookups,ht)}])},ft=function(e,t){for(var r=new re.Parser(e,t),n=r.parseULong(),i=(C.argument(1===n,"Unsupported META table version."),r.parseULong(),r.parseULong(),r.parseULong()),o={},s=0;s<i;s++){var a=r.parseTag(),l=r.parseULong(),c=r.parseULong();l=P.UTF8(e,t+l,c),o[a]=l}return o},mt=function(e){var t,r=Object.keys(e).length,n="",i=16+12*r,o=new Y.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:i},{name:"numTags",type:"ULONG",value:r}]);for(t in e){var s=n.length;n+=e[t],o.fields.push({name:"tag "+t,type:"TAG",value:t}),o.fields.push({name:"offset "+t,type:"ULONG",value:i+s}),o.fields.push({name:"length "+t,type:"ULONG",value:e[t].length})}return o.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),o};function yt(e){return Math.log(e)/Math.log(2)|0}function gt(e){for(;e.length%4!=0;)e.push(0);for(var t=0,r=0;r<e.length;r+=4)t+=(e[r]<<24)+(e[r+1]<<16)+(e[r+2]<<8)+e[r+3];return t%Math.pow(2,32)}function vt(e,t,r,n){return new Y.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==e?e:""},{name:"checkSum",type:"ULONG",value:void 0!==t?t:0},{name:"offset",type:"ULONG",value:void 0!==r?r:0},{name:"length",type:"ULONG",value:void 0!==n?n:0}])}function bt(e){for(var t=new Y.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]),r=(t.tables=e,t.numTables=e.length,Math.pow(2,yt(t.numTables))),n=(t.searchRange=16*r,t.entrySelector=yt(r),t.rangeShift=16*t.numTables-t.searchRange,[]),i=[],o=t.sizeOf()+vt().sizeOf()*t.numTables;o%4!=0;)o+=1,i.push({name:"padding",type:"BYTE",value:0});for(var s=0;s<e.length;s+=1){var a=e[s],l=(C.argument(4===a.tableName.length,"Table name"+a.tableName+" is invalid."),a.sizeOf()),c=vt(a.tableName,gt(a.encode()),o,l);for(n.push({name:c.tag+" Table Record",type:"RECORD",value:c}),i.push({name:a.tableName+" table",type:"RECORD",value:a}),o+=l,C.argument(!isNaN(o),"Something went wrong calculating the offset.");o%4!=0;)o+=1,i.push({name:"padding",type:"BYTE",value:0})}return n.sort((function(e,t){return e.value.tag>t.value.tag?1:-1})),t.fields=t.fields.concat(n),t.fields=t.fields.concat(i),t}function _t(e,t,r){for(var n=0;n<t.length;n+=1){var i=e.charToGlyphIndex(t[n]);if(0<i)return e.glyphs.get(i).getMetrics()}return r}function xt(e,t){for(var r=0,n=e.length-1;r<=n;){var i=r+n>>>1,o=e[i].tag;if(o===t)return i;o<t?r=1+i:n=i-1}return-r-1}function wt(e,t){for(var r=0,n=e.length-1;r<=n;){var i=r+n>>>1,o=e[i];if(o===t)return i;o<t?r=1+i:n=i-1}return-r-1}function St(e,t){for(var r=0,n=e.length-1;r<=n;){var i,o=r+n>>>1,s=(i=e[o]).start;if(s===t)return i;s<t?r=1+o:n=o-1}if(0<r)return t>(i=e[r-1]).end?0:i}function Mt(e,t){this.font=e,this.tableName=t}function Tt(e){Mt.call(this,e,"gpos")}function Et(e){Mt.call(this,e,"gsub")}function jt(e,t,r){for(var n=e.subtables,i=0;i<n.length;i++){var o=n[i];if(o.substFormat===t)return o}if(r)return n.push(r),r}function At(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n<e.length;++n)r[n]=e[n];return t}function Lt(e,t){if(!e)throw t}function Ct(e,t,r,n,i){var o=0<(t&n)?(o=e.parseByte(),r+(o=t&i?o:-o)):0<(t&i)?r:r+e.parseShort();return o}function Pt(e,t,r){var n,i=new re.Parser(t,r);if(e.numberOfContours=i.parseShort(),e._xMin=i.parseShort(),e._yMin=i.parseShort(),e._xMax=i.parseShort(),e._yMax=i.parseShort(),0<e.numberOfContours){for(var o=e.endPointIndices=[],s=0;s<e.numberOfContours;s+=1)o.push(i.parseUShort());e.instructionLength=i.parseUShort(),e.instructions=[];for(var a=0;a<e.instructionLength;a+=1)e.instructions.push(i.parseByte());for(var l=o[o.length-1]+1,c=[],u=0;u<l;u+=1)if(n=i.parseByte(),c.push(n),0<(8&n))for(var h=i.parseByte(),d=0;d<h;d+=1)c.push(n),u+=1;if(C.argument(c.length===l,"Bad flags."),0<o.length){var p,f=[];if(0<l){for(var m=0;m<l;m+=1)n=c[m],(p={}).onCurve=!!(1&n),p.lastPointOfContour=0<=o.indexOf(m),f.push(p);for(var y=0,g=0;g<l;g+=1)n=c[g],(p=f[g]).x=Ct(i,n,y,2,16),y=p.x;for(var v=0,b=0;b<l;b+=1)n=c[b],(p=f[b]).y=Ct(i,n,v,4,32),v=p.y}e.points=f}else e.points=[]}else if(0===e.numberOfContours)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var _=!0;_;){c=i.parseUShort();var x={glyphIndex:i.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};0<(1&c)?0<(2&c)?(x.dx=i.parseShort(),x.dy=i.parseShort()):x.matchedPoints=[i.parseUShort(),i.parseUShort()]:0<(2&c)?(x.dx=i.parseChar(),x.dy=i.parseChar()):x.matchedPoints=[i.parseByte(),i.parseByte()],0<(8&c)?x.xScale=x.yScale=i.parseF2Dot14():0<(64&c)?(x.xScale=i.parseF2Dot14(),x.yScale=i.parseF2Dot14()):0<(128&c)&&(x.xScale=i.parseF2Dot14(),x.scale01=i.parseF2Dot14(),x.scale10=i.parseF2Dot14(),x.yScale=i.parseF2Dot14()),e.components.push(x),_=!!(32&c)}if(256&c){e.instructionLength=i.parseUShort(),e.instructions=[];for(var w=0;w<e.instructionLength;w+=1)e.instructions.push(i.parseByte())}}}function Rt(e,t){for(var r=[],n=0;n<e.length;n+=1){var i=e[n];i={x:t.xScale*i.x+t.scale01*i.y+t.dx,y:t.scale10*i.x+t.yScale*i.y+t.dy,onCurve:i.onCurve,lastPointOfContour:i.lastPointOfContour},r.push(i)}return r}function Ot(e){var t=new j;if(e)for(var r=function(e){for(var t=[],r=[],n=0;n<e.length;n+=1){var i=e[n];r.push(i),i.lastPointOfContour&&(t.push(r),r=[])}return C.argument(0===r.length,"There are still points left in the current contour."),t}(e),n=0;n<r.length;++n){var i,o=r[n],s=o[o.length-1],a=o[0];s.onCurve?t.moveTo(s.x,s.y):a.onCurve?t.moveTo(a.x,a.y):(i={x:.5*(s.x+a.x),y:.5*(s.y+a.y)},t.moveTo(i.x,i.y));for(var l=0;l<o.length;++l){var c,u=s;s=a,a=o[(l+1)%o.length],s.onCurve?t.lineTo(s.x,s.y):(c=a,u.onCurve||(s.x,u.x,s.y,u.y),a.onCurve||(c={x:.5*(s.x+a.x),y:.5*(s.y+a.y)}),t.quadraticCurveTo(s.x,s.y,c.x,c.y))}t.closePath()}return t}function kt(e,t){if(t.isComposite)for(var r=0;r<t.components.length;r+=1){var n=t.components[r],i=e.get(n.glyphIndex);if(i.getPath(),i.points){var o=void 0;if(void 0===n.matchedPoints)o=Rt(i.points,n);else{if(n.matchedPoints[0]>t.points.length-1||n.matchedPoints[1]>i.points.length-1)throw Error("Matched points out of range in "+t.name);var s=t.points[n.matchedPoints[0]],a=Rt([a=i.points[n.matchedPoints[1]]],n={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0})[0];n.dx=s.x-a.x,n.dy=s.y-a.y,o=Rt(i.points,n)}t.points=t.points.concat(o)}}return Ot(t.points)}(Tt.prototype=Mt.prototype={searchTag:xt,binSearch:wt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e?this.font.tables[this.tableName]=this.createDefaultTable():t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map((function(e){return e.tag})):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r<e.scripts.length;r++){var n=e.scripts[r].tag;if("DFLT"===n)return n;"latn"===n&&(t=!0)}return t?"latn":void 0}},getScriptTable:function(e,t){var r,n=this.getTable(t);if(n)return r=n.scripts,0<=(n=xt(n.scripts,e=e||"DFLT"))?r[n].script:t?(r.splice(-1-n,0,t={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}),t.script):void 0},getLangSysTable:function(e,t,r){var n;if(e=this.getScriptTable(e,r))return t&&"dflt"!==t&&"DFLT"!==t?0<=(n=xt(e.langSysRecords,t))?e.langSysRecords[n].langSys:r?(e.langSysRecords.splice(-1-n,0,r={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}}),r.langSys):void 0:e.defaultLangSys},getFeatureTable:function(e,t,r,n){if(e=this.getLangSysTable(e,t,n)){for(var i,o=e.featureIndexes,s=this.font.tables[this.tableName].features,a=0;a<o.length;a++)if((i=s[o[a]]).tag===r)return i.feature;if(n)return t=s.length,C.assert(0===t||r>=s[t-1].tag,"Features must be added in alphabetical order."),s.push(i={tag:r,feature:{params:0,lookupListIndexes:[]}}),o.push(t),i.feature}},getLookupTables:function(e,t,r,n,i){var o=[];if(e=this.getFeatureTable(e,t,r,i)){for(var s,a=e.lookupListIndexes,l=this.font.tables[this.tableName].lookups,c=0;c<a.length;c++)(s=l[a[c]]).lookupType===n&&o.push(s);if(0===o.length&&i)return t=l.length,l.push(s={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0}),a.push(t),[s]}return o},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:var r=St(e.ranges,t);return r?r.classId:0}},getCoverageIndex:function(e,t){switch(e.format){case 1:var r=wt(e.glyphs,t);return 0<=r?r:-1;case 2:return(r=St(e.ranges,t))?r.index+t-r.start:-1}},expandCoverage:function(e){if(1===e.format)return e.glyphs;for(var t=[],r=e.ranges,n=0;n<r.length;n++)for(var i=r[n],o=i.start,s=i.end,a=o;a<=s;a++)t.push(a);return t}}).init=function(){var e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},Tt.prototype.getKerningValue=function(e,t,r){for(var n=0;n<e.length;n++)for(var i=e[n].subtables,o=0;o<i.length;o++){var s=i[o],a=this.getCoverageIndex(s.coverage,t);if(!(a<0))switch(s.posFormat){case 1:for(var l=s.pairSets[a],c=0;c<l.length;c++){var u=l[c];if(u.secondGlyph===r)return u.value1&&u.value1.xAdvance||0}break;case 2:var h=this.getGlyphClass(s.classDef1,t),d=this.getGlyphClass(s.classDef2,r);return(h=s.classRecords[h][d]).value1&&h.value1.xAdvance||0}}return 0},Tt.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)},(Et.prototype=Mt.prototype).createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},Et.prototype.getSingle=function(e,t,r){for(var n=[],i=this.getLookupTables(t,r,e,1),o=0;o<i.length;o++)for(var s=i[o].subtables,a=0;a<s.length;a++){var l=s[a],c=this.expandCoverage(l.coverage),u=void 0;if(1===l.substFormat){var h=l.deltaGlyphId;for(u=0;u<c.length;u++){var d=c[u];n.push({sub:d,by:d+h})}}else{var p=l.substitute;for(u=0;u<c.length;u++)n.push({sub:c[u],by:p[u]})}}return n},Et.prototype.getAlternates=function(e,t,r){for(var n=[],i=this.getLookupTables(t,r,e,3),o=0;o<i.length;o++)for(var s=i[o].subtables,a=0;a<s.length;a++)for(var l=s[a],c=this.expandCoverage(l.coverage),u=l.alternateSets,h=0;h<c.length;h++)n.push({sub:c[h],by:u[h]});return n},Et.prototype.getLigatures=function(e,t,r){for(var n=[],i=this.getLookupTables(t,r,e,4),o=0;o<i.length;o++)for(var s=i[o].subtables,a=0;a<s.length;a++)for(var l=s[a],c=this.expandCoverage(l.coverage),u=l.ligatureSets,h=0;h<c.length;h++)for(var d=c[h],p=u[h],f=0;f<p.length;f++){var m=p[f];n.push({sub:[d].concat(m.components),by:m.ligGlyph})}return n},Et.prototype.addSingle=function(e,t,r,n){r=jt(this.getLookupTables(r,n,e,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]}),C.assert(1===r.coverage.format,"Ligature: unable to modify coverage table format "+r.coverage.format),n=t.sub,(e=this.binSearch(r.coverage.glyphs,n))<0&&(r.coverage.glyphs.splice(e=-1-e,0,n),r.substitute.splice(e,0,0)),r.substitute[e]=t.by},Et.prototype.addAlternate=function(e,t,r,n){r=jt(this.getLookupTables(r,n,e,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]}),C.assert(1===r.coverage.format,"Ligature: unable to modify coverage table format "+r.coverage.format),n=t.sub,(e=this.binSearch(r.coverage.glyphs,n))<0&&(r.coverage.glyphs.splice(e=-1-e,0,n),r.alternateSets.splice(e,0,0)),r.alternateSets[e]=t.by},Et.prototype.addLigature=function(e,t,r,n){(n=(r=this.getLookupTables(r,n,e,4,!0)[0]).subtables[0])||(r.subtables[0]=n={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]}),C.assert(1===n.coverage.format,"Ligature: unable to modify coverage table format "+n.coverage.format),e=t.sub[0];var i=t.sub.slice(1);if(r={ligGlyph:t.by,components:i},0<=(t=this.binSearch(n.coverage.glyphs,e))){for(var o=n.ligatureSets[t],s=0;s<o.length;s++)if(function(e,t){var r=e.length;if(r===t.length){for(var n=0;n<r;n++)if(e[n]!==t[n])return;return 1}}(o[s].components,i))return;o.push(r)}else n.coverage.glyphs.splice(t=-1-t,0,e),n.ligatureSets.splice(t,0,[r])},Et.prototype.getFeature=function(e,t,r){if(/ss\d\d/.test(e))return this.getSingle(e,t,r);switch(e){case"aalt":case"salt":return this.getSingle(e,t,r).concat(this.getAlternates(e,t,r));case"dlig":case"liga":case"rlig":return this.getLigatures(e,t,r)}},Et.prototype.add=function(e,t,r,n){if(/ss\d\d/.test(e))return this.addSingle(e,t,r,n);switch(e){case"aalt":case"salt":return"number"==typeof t.by?this.addSingle(e,t,r,n):this.addAlternate(e,t,r,n);case"dlig":case"liga":case"rlig":return this.addLigature(e,t,r,n)}};var It={getPath:Ot,parse:function(e,t,r,n){for(var i=new ge.GlyphSet(n),o=0;o<r.length-1;o+=1){var s=r[o];s!==r[o+1]?i.push(o,ge.ttfGlyphLoader(n,o,Pt,e,t+s,kt)):i.push(o,ge.glyphLoader(n,o))}return i}};function Dt(e){this.font=e,this.getCommands=function(e){return It.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Nt(e){return e}function Ft(e){return Math.sign(e)*Math.round(Math.abs(e))}function Ut(e){return Math.sign(e)*Math.round(Math.abs(2*e))/2}function Bt(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function zt(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function Gt(e){return Math.sign(e)*Math.floor(Math.abs(e))}function Vt(e){var t=this.srPeriod,r=this.srPhase,n=1;return e<0&&(e=-e,n=-1),e+=this.srThreshold-r,e=Math.trunc(e/t)*t,(e+=r)<0?r*n:e*n}var Ht={x:1,y:0,axis:"x",distance:function(e,t,r,n){return(r?e.xo:e.x)-(n?t.xo:t.x)},interpolate:function(e,t,r,n){var i,o,s,a,l,c,u;if(!n||n===this)return i=e.xo-t.xo,o=e.xo-r.xo,l=t.x-t.xo,c=r.x-r.xo,0===(u=(s=Math.abs(i))+(a=Math.abs(o)))?void(e.x=e.xo+(l+c)/2):void(e.x=e.xo+(l*a+c*s)/u);i=n.distance(e,t,!0,!0),o=n.distance(e,r,!0,!0),l=n.distance(t,t,!1,!0),c=n.distance(r,r,!1,!0),0===(u=(s=Math.abs(i))+(a=Math.abs(o)))?Ht.setRelative(e,e,(l+c)/2,n,!0):Ht.setRelative(e,e,(l*a+c*s)/u,n,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,r,n,i){var o,s;n&&n!==this?(o=i?t.xo:t.x,s=i?t.yo:t.y,o+=r*n.x,s+=r*n.y,e.x=o+(e.y-s)/n.normalSlope):e.x=(i?t.xo:t.x)+r},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},Wt={x:0,y:1,axis:"y",distance:function(e,t,r,n){return(r?e.yo:e.y)-(n?t.yo:t.y)},interpolate:function(e,t,r,n){var i,o,s,a,l,c,u;if(!n||n===this)return i=e.yo-t.yo,o=e.yo-r.yo,l=t.y-t.yo,c=r.y-r.yo,0===(u=(s=Math.abs(i))+(a=Math.abs(o)))?void(e.y=e.yo+(l+c)/2):void(e.y=e.yo+(l*a+c*s)/u);i=n.distance(e,t,!0,!0),o=n.distance(e,r,!0,!0),l=n.distance(t,t,!1,!0),c=n.distance(r,r,!1,!0),0===(u=(s=Math.abs(i))+(a=Math.abs(o)))?Wt.setRelative(e,e,(l+c)/2,n,!0):Wt.setRelative(e,e,(l*a+c*s)/u,n,!0)},normalSlope:0,setRelative:function(e,t,r,n,i){var o,s;n&&n!==this?(o=i?t.xo:t.x,s=i?t.yo:t.y,o+=r*n.x,s+=r*n.y,e.y=s+n.normalSlope*(e.x-o)):e.y=(i?t.yo:t.y)+r},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function qt(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function Xt(e,t){var r=Math.sqrt(e*e+t*t);return t/=r,1==(e/=r)&&0===t?Ht:0===e&&1===t?Wt:new qt(e,t)}function Yt(e,t,r,n){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=r,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(Ht),Object.freeze(Wt),qt.prototype.distance=function(e,t,r,n){return this.x*Ht.distance(e,t,r,n)+this.y*Wt.distance(e,t,r,n)},qt.prototype.interpolate=function(e,t,r,n){var i=n.distance(e,t,!0,!0),o=n.distance(e,r,!0,!0),s=(t=n.distance(t,t,!1,!0),r=n.distance(r,r,!1,!0),(i=Math.abs(i))+(o=Math.abs(o)));0===s?this.setRelative(e,e,(t+r)/2,n,!0):this.setRelative(e,e,(t*o+r*i)/s,n,!0)},qt.prototype.setRelative=function(e,t,r,n,i){var o=i?t.xo:t.x,s=(i=i?t.yo:t.y,t=o+r*(n=n||this).x,o=i+r*n.y,i=n.normalSlope,r=this.slope,n=e.x,e.y);e.x=(r*n-i*t+o-s)/(r-i),e.y=r*(e.x-n)+s},qt.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},Yt.prototype.nextTouched=function(e){for(var t=this.nextPointOnContour;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},Yt.prototype.prevTouched=function(e){for(var t=this.prevPointOnContour;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var Zt=Object.freeze(new Yt(0,0)),Jt={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function Kt(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=Ht,this.round=Ft}}function Qt(e){for(var t=e.tZone=new Array(e.gZone.length),r=0;r<t.length;r++)t[r]=new Yt(0,0)}function $t(e,t){var r,n=e.prog,i=e.ip,o=1;do{if(88===(r=n[++i]))o++;else if(89===r)o--;else if(64===r)i+=n[i+1]+1;else if(65===r)i+=2*n[i+1]+1;else if(176<=r&&r<=183)i+=r-176+1;else if(184<=r&&r<=191)i+=2*(r-184+1);else if(t&&1===o&&27===r)break}while(0<o);e.ip=i}function er(e,r){t.DEBUG&&console.log(r.step,"SVTCA["+e.axis+"]"),r.fv=r.pv=r.dpv=e}function tr(e,r){t.DEBUG&&console.log(r.step,"SPVTCA["+e.axis+"]"),r.pv=r.dpv=e}function rr(e,r){t.DEBUG&&console.log(r.step,"SFVTCA["+e.axis+"]"),r.fv=e}function nr(e,r){var n,i=(o=r.stack).pop(),o=o.pop(),s=r.z2[i],a=r.z1[o];t.DEBUG&&console.log("SPVTL["+e+"]",i,o),i=e?(n=s.y-a.y,a.x-s.x):(n=a.x-s.x,a.y-s.y),r.pv=r.dpv=Xt(n,i)}function ir(e,r){var n,i=(o=r.stack).pop(),o=o.pop(),s=r.z2[i],a=r.z1[o];t.DEBUG&&console.log("SFVTL["+e+"]",i,o),i=e?(n=s.y-a.y,a.x-s.x):(n=a.x-s.x,a.y-s.y),r.fv=Xt(n,i)}function or(e){t.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function sr(e,r){var n=r.stack.pop(),i=r.z0[n],o=r.fv,s=r.pv,a=(t.DEBUG&&console.log(r.step,"MDAP["+e+"]",n),s.distance(i,Zt));e&&(a=r.round(a)),o.setRelative(i,Zt,a,s),o.touch(i),r.rp0=r.rp1=n}function ar(e,r){var n,i,o,s=r.z2,a=s.length-2;t.DEBUG&&console.log(r.step,"IUP["+e.axis+"]");for(var l=0;l<a;l++)n=s[l],e.touched(n)||(i=n.prevTouched(e))!==n&&(i===(o=n.nextTouched(e))&&e.setRelative(n,n,e.distance(i,i,!1,!0),e,!0),e.interpolate(n,i,o,e))}function lr(e,r){for(var n=r.stack,i=e?r.rp1:r.rp2,o=(e?r.z0:r.z1)[i],s=r.fv,a=r.pv,l=r.loop,c=r.z2;l--;){var u=n.pop(),h=c[u],d=a.distance(o,o,!1,!0);s.setRelative(h,h,d,a),s.touch(h),t.DEBUG&&console.log(r.step,(1<r.loop?"loop "+(r.loop-l)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",u)}r.loop=1}function cr(e,r){for(var n=r.stack,i=e?r.rp1:r.rp2,o=(e?r.z0:r.z1)[i],s=r.fv,a=r.pv,l=(i=n.pop(),r.z2[r.contours[i]]),c=l,u=(t.DEBUG&&console.log(r.step,"SHC["+e+"]",i),a.distance(o,o,!1,!0));c!==o&&s.setRelative(c,c,u,a),(c=c.nextPointOnContour)!==l;);}function ur(e,r){var n,i,o=r.stack,s=e?r.rp1:r.rp2,a=(s=(e?r.z0:r.z1)[s],r.fv),l=r.pv;switch(o=o.pop(),t.DEBUG&&console.log(r.step,"SHZ["+e+"]",o),o){case 0:n=r.tZone;break;case 1:n=r.gZone;break;default:throw new Error("Invalid zone")}for(var c=l.distance(s,s,!1,!0),u=n.length-2,h=0;h<u;h++)i=n[h],a.setRelative(i,i,c,l)}function hr(e,r){var n=(i=r.stack).pop()/64,i=i.pop(),o=r.z1[i],s=r.z0[r.rp0],a=r.fv,l=r.pv;a.setRelative(o,s,n,l),a.touch(o),t.DEBUG&&console.log(r.step,"MSIRP["+e+"]",n,i),r.rp1=r.rp0,r.rp2=i,e&&(r.rp0=i)}function dr(e,r){var n=(i=r.stack).pop(),i=i.pop(),o=r.z0[i],s=r.fv,a=r.pv,l=r.cvt[n];t.DEBUG&&console.log(r.step,"MIAP["+e+"]",n,"(",l,")",i),n=a.distance(o,Zt),e&&(Math.abs(n-l)<r.cvCutIn&&(n=l),n=r.round(n)),s.setRelative(o,Zt,n,a),0===r.zp0&&(o.xo=o.x,o.yo=o.y),s.touch(o),r.rp0=r.rp1=i}function pr(e,r){var n=r.stack,i=n.pop(),o=r.z2[i];t.DEBUG&&console.log(r.step,"GC["+e+"]",i),n.push(64*r.dpv.distance(o,Zt,e,!1))}function fr(e,r){var n=(i=r.stack).pop(),i=i.pop(),o=r.z1[n],s=r.z0[i];s=r.dpv.distance(s,o,e,e),t.DEBUG&&console.log(r.step,"MD["+e+"]",n,i,"->",s),r.stack.push(Math.round(64*s))}function mr(e,r){var n=r.stack,i=n.pop(),o=r.fv,s=r.pv,a=r.ppem,l=r.deltaBase+16*(e-1),c=r.deltaShift,u=r.z0;t.DEBUG&&console.log(r.step,"DELTAP["+e+"]",i,n);for(var h=0;h<i;h++){var d=n.pop(),p=n.pop();l+((240&p)>>4)===a&&(0<=(p=(15&p)-8)&&p++,t.DEBUG&&console.log(r.step,"DELTAPFIX",d,"by",p*c),d=u[d],o.setRelative(d,d,p*c,s))}}function yr(e,r){var n=r.stack,i=n.pop();t.DEBUG&&console.log(r.step,"ROUND[]"),n.push(64*r.round(i/64))}function gr(e,r){var n=r.stack,i=n.pop(),o=r.ppem,s=r.deltaBase+16*(e-1),a=r.deltaShift;t.DEBUG&&console.log(r.step,"DELTAC["+e+"]",i,n);for(var l=0;l<i;l++){var c=n.pop(),u=n.pop();s+((240&u)>>4)===o&&(0<=(u=(15&u)-8)&&u++,u*=a,t.DEBUG&&console.log(r.step,"DELTACFIX",c,"by",u),r.cvt[c]+=u)}}function vr(e,r){var n,i=(o=r.stack).pop(),o=o.pop(),s=r.z2[i],a=r.z1[o];t.DEBUG&&console.log(r.step,"SDPVTL["+e+"]",i,o),i=e?(n=s.y-a.y,a.x-s.x):(n=a.x-s.x,a.y-s.y),r.dpv=Xt(n,i)}function br(e,r){var n=r.stack,i=r.prog,o=r.ip;t.DEBUG&&console.log(r.step,"PUSHB["+e+"]");for(var s=0;s<e;s++)n.push(i[++o]);r.ip=o}function _r(e,r){var n=r.ip,i=r.prog,o=r.stack;t.DEBUG&&console.log(r.ip,"PUSHW["+e+"]");for(var s=0;s<e;s++){var a=i[++n]<<8|i[++n];32768&a&&(a=-(1+(65535^a))),o.push(a)}r.ip=n}function xr(e,r,n,i,o,s){var a,l,c=s.stack,u=e&&c.pop(),h=(c=c.pop(),s.rp0),d=(h=s.z0[h],s.z1[c]),p=s.minDis,f=s.fv,m=s.dpv,y=a=m.distance(d,h,!0,!0),g=0<=y?1:-1;y=Math.abs(y),e&&(l=s.cvt[u],i&&Math.abs(y-l)<s.cvCutIn&&(y=l)),n&&y<p&&(y=p),i&&(y=s.round(y)),f.setRelative(d,h,g*y,m),f.touch(d),t.DEBUG&&console.log(s.step,(e?"MIRP[":"MDRP[")+(r?"M":"m")+(n?">":"_")+(i?"R":"_")+(0===o?"Gr":1===o?"Bl":2===o?"Wh":"")+"]",e?u+"("+s.cvt[u]+","+l+")":"",c,"(d =",a,"->",g*y,")"),s.rp1=s.rp0,s.rp2=c,r&&(s.rp0=c)}Dt.prototype.exec=function(e,r){if("number"!=typeof r)throw new Error("Point size is not a number!");if(!(2<this._errorState)){var n=this.font,i=this._prepState;if(!i||i.ppem!==r){var o=this._fpgmState;if(!o){Kt.prototype=Jt,(o=this._fpgmState=new Kt("fpgm",n.tables.fpgm)).funcs=[],o.font=n,t.DEBUG&&(console.log("---EXEC FPGM---"),o.step=-1);try{Mr(o)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}Kt.prototype=o,(i=this._prepState=new Kt("prep",n.tables.prep)).ppem=r;var s=n.tables.cvt;if(s)for(var a=i.cvt=new Array(s.length),l=r/n.unitsPerEm,c=0;c<s.length;c++)a[c]=s[c]*l;else i.cvt=[];t.DEBUG&&(console.log("---EXEC PREP---"),i.step=-1);try{Mr(i)}catch(e){this._errorState<2&&console.log("Hinting error in PREP:"+e),this._errorState=2}}if(!(1<this._errorState))try{return wr(e,i)}catch(e){this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),this._errorState=1}}};var wr=function(e,r){var n=r.ppem/r.font.unitsPerEm,i=n,o=e.components;if(Kt.prototype=r,o){for(var s=r.font,a=[],l=[],c=0;c<o.length;c++){var u=o[c],h=s.glyphs.get(u.glyphIndex),d=new Kt("glyf",h.instructions);t.DEBUG&&(console.log("---EXEC COMP "+c+"---"),d.step=-1),Sr(h,d,n,i);for(var p=Math.round(u.dx*n),f=Math.round(u.dy*i),m=d.gZone,y=d.contours,g=0;g<m.length;g++){var v=m[g];v.xTouched=v.yTouched=!1,v.xo=v.x=v.x+p,v.yo=v.y=v.y+f}var b=a.length;a.push.apply(a,m);for(var _=0;_<y.length;_++)l.push(y[_]+b)}e.instructions&&!d.inhibitGridFit&&((d=new Kt("glyf",e.instructions)).gZone=d.z0=d.z1=d.z2=a,d.contours=l,a.push(new Yt(0,0),new Yt(Math.round(e.advanceWidth*n),0)),t.DEBUG&&(console.log("---EXEC COMPOSITE---"),d.step=-1),Mr(d),a.length-=2)}else d=new Kt("glyf",e.instructions),t.DEBUG&&(console.log("---EXEC GLYPH---"),d.step=-1),Sr(e,d,n,i),a=d.gZone;return a},Sr=function(e,r,n,i){for(var o,s,a,l=e.points||[],c=l.length,u=r.gZone=r.z0=r.z1=r.z2=[],h=r.contours=[],d=0;d<c;d++)o=l[d],u[d]=new Yt(o.x*n,o.y*i,o.lastPointOfContour,o.onCurve);for(var p=0;p<c;p++)o=u[p],s||(s=o,h.push(p)),o.lastPointOfContour?((o.nextPointOnContour=s).prevPointOnContour=o,s=void 0):(a=u[p+1],(o.nextPointOnContour=a).prevPointOnContour=o);if(!r.inhibitGridFit){if(t.DEBUG){console.log("PROCESSING GLYPH",r.stack);for(var f=0;f<c;f++)console.log(f,u[f].x,u[f].y)}if(u.push(new Yt(0,0),new Yt(Math.round(e.advanceWidth*n),0)),Mr(r),u.length-=2,t.DEBUG){console.log("FINISHED GLYPH",r.stack);for(var m=0;m<c;m++)console.log(m,u[m].x,u[m].y)}}},Mr=function(e){var r=e.prog;if(r){var n,i=r.length;for(e.ip=0;e.ip<i;e.ip++){if(t.DEBUG&&e.step++,!(n=Tr[r[e.ip]]))throw new Error("unknown instruction: 0x"+Number(r[e.ip]).toString(16));n(e)}}},Tr=[er.bind(void 0,Wt),er.bind(void 0,Ht),tr.bind(void 0,Wt),tr.bind(void 0,Ht),rr.bind(void 0,Wt),rr.bind(void 0,Ht),nr.bind(void 0,0),nr.bind(void 0,1),ir.bind(void 0,0),ir.bind(void 0,1),function(e){var r=(n=e.stack).pop(),n=n.pop();t.DEBUG&&console.log(e.step,"SPVFS[]",r,n),e.pv=e.dpv=Xt(n,r)},function(e){var r=(n=e.stack).pop(),n=n.pop();t.DEBUG&&console.log(e.step,"SPVFS[]",r,n),e.fv=Xt(n,r)},function(e){var r=e.stack,n=e.pv;t.DEBUG&&console.log(e.step,"GPV[]"),r.push(16384*n.x),r.push(16384*n.y)},function(e){var r=e.stack,n=e.fv;t.DEBUG&&console.log(e.step,"GFV[]"),r.push(16384*n.x),r.push(16384*n.y)},function(e){e.fv=e.pv,t.DEBUG&&console.log(e.step,"SFVTPV[]")},function(e){var r=(s=e.stack).pop(),n=s.pop(),i=s.pop(),o=s.pop(),s=s.pop(),a=e.z0,l=e.z1,c=a[r],u=(a=a[n],l[i]),h=(l=l[o],e=e.z2[s],t.DEBUG&&console.log("ISECT[], ",r,n,i,o,s),r=c.x,n=c.y,i=a.x,o=a.y,s=u.x,c=u.y,a=l.x,l=(r-i)*(c-(u=l.y))-(n-o)*(s-a),r*o-n*i),d=s*u-c*a;e.x=(h*(s-a)-d*(r-i))/l,e.y=(h*(c-u)-d*(n-o))/l},function(e){e.rp0=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)},function(e){e.rp1=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)},function(e){e.rp2=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)},function(e){var r=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP0[]",r),e.zp0=r){case 0:e.tZone||Qt(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var r=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP1[]",r),e.zp1=r){case 0:e.tZone||Qt(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var r=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP2[]",r),e.zp2=r){case 0:e.tZone||Qt(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var r=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZPS[]",r),e.zp0=e.zp1=e.zp2=r){case 0:e.tZone||Qt(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){e.loop=e.stack.pop(),t.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)},function(e){t.DEBUG&&console.log(e.step,"RTG[]"),e.round=Ft},function(e){t.DEBUG&&console.log(e.step,"RTHG[]"),e.round=Bt},function(e){var r=e.stack.pop();t.DEBUG&&console.log(e.step,"SMD[]",r),e.minDis=r/64},function(e){t.DEBUG&&console.log(e.step,"ELSE[]"),$t(e,!1)},function(e){var r=e.stack.pop();t.DEBUG&&console.log(e.step,"JMPR[]",r),e.ip+=r-1},function(e){var r=e.stack.pop();t.DEBUG&&console.log(e.step,"SCVTCI[]",r),e.cvCutIn=r/64},void 0,void 0,function(e){var r=e.stack;t.DEBUG&&console.log(e.step,"DUP[]"),r.push(r[r.length-1])},or,function(e){t.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"SWAP[]"),r.push(n),r.push(i)},function(e){var r=e.stack;t.DEBUG&&console.log(e.step,"DEPTH[]"),r.push(r.length)},function(e){var r=e.stack,n=r.pop();t.DEBUG&&console.log(e.step,"CINDEX[]",n),r.push(r[r.length-n])},function(e){var r=e.stack,n=r.pop();t.DEBUG&&console.log(e.step,"MINDEX[]",n),r.push(r.splice(r.length-n,1)[0])},void 0,void 0,void 0,function(e){var r=(i=e.stack).pop(),n=i.pop(),i=(t.DEBUG&&console.log(e.step,"LOOPCALL[]",r,n),e.ip),o=e.prog;e.prog=e.funcs[r];for(var s=0;s<n;s++)Mr(e),t.DEBUG&&console.log(++e.step,s+1<n?"next loopcall":"done loopcall",s);e.ip=i,e.prog=o},function(e){var r=e.stack.pop(),n=(t.DEBUG&&console.log(e.step,"CALL[]",r),e.ip),i=e.prog;e.prog=e.funcs[r],Mr(e),e.ip=n,e.prog=i,t.DEBUG&&console.log(++e.step,"returning from",r)},function(e){if("fpgm"!==e.env)throw new Error("FDEF not allowed here");var r=e.stack,n=e.prog,i=e.ip,o=(r=r.pop(),i);for(t.DEBUG&&console.log(e.step,"FDEF[]",r);45!==n[++i];);e.ip=i,e.funcs[r]=n.slice(o+1,i)},void 0,sr.bind(void 0,0),sr.bind(void 0,1),ar.bind(void 0,Wt),ar.bind(void 0,Ht),lr.bind(void 0,0),lr.bind(void 0,1),cr.bind(void 0,0),cr.bind(void 0,1),ur.bind(void 0,0),ur.bind(void 0,1),function(e){for(var r=e.stack,n=e.loop,i=e.fv,o=r.pop()/64,s=e.z2;n--;){var a=r.pop(),l=s[a];t.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-n)+": ":"")+"SHPIX[]",a,o),i.setRelative(l,l,o),i.touch(l)}e.loop=1},function(e){for(var r=e.stack,n=e.rp1,i=e.rp2,o=e.loop,s=e.z0[n],a=e.z1[i],l=e.fv,c=e.dpv,u=e.z2;o--;){var h=r.pop(),d=u[h];t.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-o)+": ":"")+"IP[]",h,n,"<->",i),l.interpolate(d,s,a,c),l.touch(d)}e.loop=1},hr.bind(void 0,0),hr.bind(void 0,1),function(e){for(var r=e.stack,n=e.rp0,i=e.z0[n],o=e.loop,s=e.fv,a=e.pv,l=e.z1;o--;){var c=r.pop(),u=l[c];t.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-o)+": ":"")+"ALIGNRP[]",c),s.setRelative(u,i,0,a),s.touch(u)}e.loop=1},function(e){t.DEBUG&&console.log(e.step,"RTDG[]"),e.round=Ut},dr.bind(void 0,0),dr.bind(void 0,1),function(e){var r=e.prog,n=e.ip,i=e.stack,o=r[++n];t.DEBUG&&console.log(e.step,"NPUSHB[]",o);for(var s=0;s<o;s++)i.push(r[++n]);e.ip=n},function(e){var r=e.ip,n=e.prog,i=e.stack,o=n[++r];t.DEBUG&&console.log(e.step,"NPUSHW[]",o);for(var s=0;s<o;s++){var a=n[++r]<<8|n[++r];32768&a&&(a=-(1+(65535^a))),i.push(a)}e.ip=r},function(e){var r=e.stack,n=(n=e.store)||(e.store=[]),i=r.pop();r=r.pop(),t.DEBUG&&console.log(e.step,"WS",i,r),n[r]=i},function(e){var r=e.stack,n=e.store,i=r.pop();t.DEBUG&&console.log(e.step,"RS",i),e=n&&n[i]||0,r.push(e)},function(e){var r=(n=e.stack).pop(),n=n.pop();t.DEBUG&&console.log(e.step,"WCVTP",r,n),e.cvt[n]=r/64},function(e){var r=e.stack,n=r.pop();t.DEBUG&&console.log(e.step,"RCVT",n),r.push(64*e.cvt[n])},pr.bind(void 0,0),pr.bind(void 0,1),void 0,fr.bind(void 0,0),fr.bind(void 0,1),function(e){t.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)},void 0,function(e){t.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0},void 0,void 0,function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"LT[]",n,i),r.push(i<n?1:0)},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"LTEQ[]",n,i),r.push(i<=n?1:0)},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"GT[]",n,i),r.push(n<i?1:0)},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"GTEQ[]",n,i),r.push(n<=i?1:0)},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"EQ[]",n,i),r.push(n===i?1:0)},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"NEQ[]",n,i),r.push(n!==i?1:0)},function(e){var r=e.stack,n=r.pop();t.DEBUG&&console.log(e.step,"ODD[]",n),r.push(Math.trunc(n)%2?1:0)},function(e){var r=e.stack,n=r.pop();t.DEBUG&&console.log(e.step,"EVEN[]",n),r.push(Math.trunc(n)%2?0:1)},function(e){var r=e.stack.pop();t.DEBUG&&console.log(e.step,"IF[]",r),r||($t(e,!0),t.DEBUG&&console.log(e.step,"EIF[]"))},function(e){t.DEBUG&&console.log(e.step,"EIF[]")},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"AND[]",n,i),r.push(n&&i?1:0)},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"OR[]",n,i),r.push(n||i?1:0)},function(e){var r=e.stack,n=r.pop();t.DEBUG&&console.log(e.step,"NOT[]",n),r.push(n?0:1)},mr.bind(void 0,1),function(e){var r=e.stack.pop();t.DEBUG&&console.log(e.step,"SDB[]",r),e.deltaBase=r},function(e){var r=e.stack.pop();t.DEBUG&&console.log(e.step,"SDS[]",r),e.deltaShift=Math.pow(.5,r)},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"ADD[]",n,i),r.push(i+n)},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"SUB[]",n,i),r.push(i-n)},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"DIV[]",n,i),r.push(64*i/n)},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"MUL[]",n,i),r.push(i*n/64)},function(e){var r=e.stack,n=r.pop();t.DEBUG&&console.log(e.step,"ABS[]",n),r.push(Math.abs(n))},function(e){var r=e.stack,n=r.pop();t.DEBUG&&console.log(e.step,"NEG[]",n),r.push(-n)},function(e){var r=e.stack,n=r.pop();t.DEBUG&&console.log(e.step,"FLOOR[]",n),r.push(64*Math.floor(n/64))},function(e){var r=e.stack,n=r.pop();t.DEBUG&&console.log(e.step,"CEILING[]",n),r.push(64*Math.ceil(n/64))},yr.bind(void 0,0),yr.bind(void 0,1),yr.bind(void 0,2),yr.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){var r=(n=e.stack).pop(),n=n.pop();t.DEBUG&&console.log(e.step,"WCVTF[]",r,n),e.cvt[n]=r*e.ppem/e.font.unitsPerEm},mr.bind(void 0,2),mr.bind(void 0,3),gr.bind(void 0,1),gr.bind(void 0,2),gr.bind(void 0,3),function(e){var r,n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SROUND[]",n),e.round=Vt,192&n){case 0:r=.5;break;case 64:r=1;break;case 128:r=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=r,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*r;break;case 32:e.srPhase=.5*r;break;case 48:e.srPhase=.75*r;break;default:throw new Error("invalid SROUND value")}e.srThreshold=0==(n&=15)?0:(n/8-.5)*r},function(e){var r,n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"S45ROUND[]",n),e.round=Vt,192&n){case 0:r=Math.sqrt(2)/2;break;case 64:r=Math.sqrt(2);break;case 128:r=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=r,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*r;break;case 32:e.srPhase=.5*r;break;case 48:e.srPhase=.75*r;break;default:throw new Error("invalid S45ROUND value")}e.srThreshold=0==(n&=15)?0:(n/8-.5)*r},void 0,void 0,function(e){t.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Nt},void 0,function(e){t.DEBUG&&console.log(e.step,"RUTG[]"),e.round=zt},function(e){t.DEBUG&&console.log(e.step,"RDTG[]"),e.round=Gt},or,or,void 0,void 0,void 0,void 0,void 0,function(e){var r=e.stack.pop();t.DEBUG&&console.log(e.step,"SCANCTRL[]",r)},vr.bind(void 0,0),vr.bind(void 0,1),function(e){var r=e.stack,n=r.pop(),i=0;t.DEBUG&&console.log(e.step,"GETINFO[]",n),1&n&&(i=35),32&n&&(i|=4096),r.push(i)},void 0,function(e){var r=e.stack,n=r.pop(),i=r.pop(),o=r.pop();t.DEBUG&&console.log(e.step,"ROLL[]"),r.push(i),r.push(n),r.push(o)},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"MAX[]",n,i),r.push(Math.max(i,n))},function(e){var r=e.stack,n=r.pop(),i=r.pop();t.DEBUG&&console.log(e.step,"MIN[]",n,i),r.push(Math.min(i,n))},function(e){var r=e.stack.pop();t.DEBUG&&console.log(e.step,"SCANTYPE[]",r)},function(e){var r=e.stack.pop(),n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"INSTCTRL[]",r,n),r){case 1:return void(e.inhibitGridFit=!!n);case 2:return void(e.ignoreCvt=!!n);default:throw new Error("invalid INSTCTRL[] selector")}},void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,br.bind(void 0,1),br.bind(void 0,2),br.bind(void 0,3),br.bind(void 0,4),br.bind(void 0,5),br.bind(void 0,6),br.bind(void 0,7),br.bind(void 0,8),_r.bind(void 0,1),_r.bind(void 0,2),_r.bind(void 0,3),_r.bind(void 0,4),_r.bind(void 0,5),_r.bind(void 0,6),_r.bind(void 0,7),_r.bind(void 0,8),xr.bind(void 0,0,0,0,0,0),xr.bind(void 0,0,0,0,0,1),xr.bind(void 0,0,0,0,0,2),xr.bind(void 0,0,0,0,0,3),xr.bind(void 0,0,0,0,1,0),xr.bind(void 0,0,0,0,1,1),xr.bind(void 0,0,0,0,1,2),xr.bind(void 0,0,0,0,1,3),xr.bind(void 0,0,0,1,0,0),xr.bind(void 0,0,0,1,0,1),xr.bind(void 0,0,0,1,0,2),xr.bind(void 0,0,0,1,0,3),xr.bind(void 0,0,0,1,1,0),xr.bind(void 0,0,0,1,1,1),xr.bind(void 0,0,0,1,1,2),xr.bind(void 0,0,0,1,1,3),xr.bind(void 0,0,1,0,0,0),xr.bind(void 0,0,1,0,0,1),xr.bind(void 0,0,1,0,0,2),xr.bind(void 0,0,1,0,0,3),xr.bind(void 0,0,1,0,1,0),xr.bind(void 0,0,1,0,1,1),xr.bind(void 0,0,1,0,1,2),xr.bind(void 0,0,1,0,1,3),xr.bind(void 0,0,1,1,0,0),xr.bind(void 0,0,1,1,0,1),xr.bind(void 0,0,1,1,0,2),xr.bind(void 0,0,1,1,0,3),xr.bind(void 0,0,1,1,1,0),xr.bind(void 0,0,1,1,1,1),xr.bind(void 0,0,1,1,1,2),xr.bind(void 0,0,1,1,1,3),xr.bind(void 0,1,0,0,0,0),xr.bind(void 0,1,0,0,0,1),xr.bind(void 0,1,0,0,0,2),xr.bind(void 0,1,0,0,0,3),xr.bind(void 0,1,0,0,1,0),xr.bind(void 0,1,0,0,1,1),xr.bind(void 0,1,0,0,1,2),xr.bind(void 0,1,0,0,1,3),xr.bind(void 0,1,0,1,0,0),xr.bind(void 0,1,0,1,0,1),xr.bind(void 0,1,0,1,0,2),xr.bind(void 0,1,0,1,0,3),xr.bind(void 0,1,0,1,1,0),xr.bind(void 0,1,0,1,1,1),xr.bind(void 0,1,0,1,1,2),xr.bind(void 0,1,0,1,1,3),xr.bind(void 0,1,1,0,0,0),xr.bind(void 0,1,1,0,0,1),xr.bind(void 0,1,1,0,0,2),xr.bind(void 0,1,1,0,0,3),xr.bind(void 0,1,1,0,1,0),xr.bind(void 0,1,1,0,1,1),xr.bind(void 0,1,1,0,1,2),xr.bind(void 0,1,1,0,1,3),xr.bind(void 0,1,1,1,0,0),xr.bind(void 0,1,1,1,0,1),xr.bind(void 0,1,1,1,0,2),xr.bind(void 0,1,1,1,0,3),xr.bind(void 0,1,1,1,1,0),xr.bind(void 0,1,1,1,1,1),xr.bind(void 0,1,1,1,1,2),xr.bind(void 0,1,1,1,1,3)],Er=Array.from||function(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g)||[]};function jr(e){(e=e||{}).empty||(Lt(e.familyName,"When creating a new Font object, familyName is required."),Lt(e.styleName,"When creating a new Font object, styleName is required."),Lt(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Lt(e.ascender,"When creating a new Font object, ascender is required."),Lt(e.descender,"When creating a new Font object, descender is required."),Lt(e.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,"")},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables={os2:{usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new ge.GlyphSet(this,e.glyphs||[]),this.encoding=new ce(this),this.position=new Tt(this),this.substitution=new Et(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){return this._hinting||("truetype"===this.outlinesFormat?this._hinting=new Dt(this):void 0)}})}jr.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},jr.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},jr.prototype.charToGlyph=function(e){return e=this.charToGlyphIndex(e),this.glyphs.get(e)||this.glyphs.get(0)},jr.prototype.stringToGlyphs=function(e,t){t=t||this.defaultRenderOptions;for(var r=Er(e),n=[],i=0;i<r.length;i+=1){var o=r[i];n.push(this.charToGlyphIndex(o))}var s=n.length;if(t.features){e=t.script||this.substitution.getDefaultScriptName();var a=[];t.features.liga&&(a=a.concat(this.substitution.getFeature("liga",e,t.language))),t.features.rlig&&(a=a.concat(this.substitution.getFeature("rlig",e,t.language)));for(var l=0;l<s;l+=1)for(var c=0;c<a.length;c++){for(var u=a[c],h=u.sub,d=h.length,p=0;p<d&&h[p]===n[l+p];)p++;p===d&&(n.splice(l,d,u.by),s=s-d+1)}}for(var f=new Array(s),m=this.glyphs.get(0),y=0;y<s;y+=1)f[y]=this.glyphs.get(n[y])||m;return f},jr.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},jr.prototype.nameToGlyph=function(e){return e=this.nameToGlyphIndex(e),this.glyphs.get(e)||this.glyphs.get(0)},jr.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},jr.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;var r=this.position.defaultKerningTables;return r?this.position.getKerningValue(r,e,t):this.kerningPairs[e+","+t]||0},jr.prototype.defaultRenderOptions={kerning:!0,features:{liga:!0,rlig:!0}},jr.prototype.forEachGlyph=function(e,t,r,n,i,o){t=void 0!==t?t:0,r=void 0!==r?r:0,i=i||this.defaultRenderOptions;var s,a=1/this.unitsPerEm*(n=void 0!==n?n:72),l=this.stringToGlyphs(e,i);i.kerning&&(e=i.script||this.position.getDefaultScriptName(),s=this.position.getKerningTables(e,i.language));for(var c=0;c<l.length;c+=1){var u=l[c];o.call(this,u,t,r,n,i),u.advanceWidth&&(t+=u.advanceWidth*a),i.kerning&&c<l.length-1&&(t+=(s?this.position.getKerningValue(s,u.index,l[c+1].index):this.getKerningValue(u,l[c+1]))*a),i.letterSpacing?t+=i.letterSpacing*n:i.tracking&&(t+=i.tracking/1e3*n)}return t},jr.prototype.getPath=function(e,t,r,n,i){var o=new j;return this.forEachGlyph(e,t,r,n,i,(function(e,t,r,n){e=e.getPath(t,r,n,i,this),o.extend(e)})),o},jr.prototype.getPaths=function(e,t,r,n,i){var o=[];return this.forEachGlyph(e,t,r,n,i,(function(e,t,r,n){e=e.getPath(t,r,n,i,this),o.push(e)})),o},jr.prototype.getAdvanceWidth=function(e,t,r){return this.forEachGlyph(e,0,0,t,r,(function(){}))},jr.prototype.draw=function(e,t,r,n,i,o){this.getPath(t,r,n,i,o).draw(e)},jr.prototype.drawPoints=function(e,t,r,n,i,o){this.forEachGlyph(t,r,n,i,o,(function(t,r,n,i){t.drawPoints(e,r,n,i)}))},jr.prototype.drawMetrics=function(e,t,r,n,i,o){this.forEachGlyph(t,r,n,i,o,(function(t,r,n,i){t.drawMetrics(e,r,n,i)}))},jr.prototype.getEnglishName=function(e){if(e=this.names[e])return e.en},jr.prototype.validate=function(){var e=this;function t(t){(t=e.getEnglishName(t))&&t.trim().length}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm},jr.prototype.toTables=function(){return function(e){for(var t,r=[],n=[],i=[],o=[],s=[],a=[],l=[],c=0,u=0,h=0,d=0,p=0,f=0;f<e.glyphs.length;f+=1){var m=e.glyphs.get(f),y=0|m.unicode;if(isNaN(m.advanceWidth))throw new Error("Glyph "+m.name+" ("+f+"): advanceWidth is not a number.");if((y<t||void 0===t)&&0<y&&(t=y),c<y&&(c=y),(y=st(y))<32)u|=1<<y;else if(y<64)h|=1<<y-32;else if(y<96)d|=1<<y-64;else{if(!(y<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");p|=1<<y-96}".notdef"!==m.name&&(y=m.getMetrics(),r.push(y.xMin),n.push(y.yMin),i.push(y.xMax),o.push(y.yMax),a.push(y.leftSideBearing),l.push(y.rightSideBearing),s.push(m.advanceWidth))}var g,v={xMin:Math.min.apply(null,r),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,i),yMax:Math.max.apply(null,o),advanceWidthMax:Math.max.apply(null,s),advanceWidthAvg:function(e){for(var t=0,r=0;r<e.length;r+=1)t+=e[r];return t/e.length}(s),minLeftSideBearing:Math.min.apply(null,a),maxLeftSideBearing:Math.max.apply(null,a),minRightSideBearing:Math.min.apply(null,l)},b=(v.ascender=e.ascender,v.descender=e.descender,De({flags:3,unitsPerEm:e.unitsPerEm,xMin:v.xMin,yMin:v.yMin,xMax:v.xMax,yMax:v.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp})),_=Fe({ascender:v.ascender,descender:v.descender,advanceWidthMax:v.advanceWidthMax,minLeftSideBearing:v.minLeftSideBearing,minRightSideBearing:v.minRightSideBearing,xMaxExtent:v.maxLeftSideBearing+(v.xMax-v.xMin),numberOfHMetrics:e.glyphs.length}),x=Ve(e.glyphs.length),w=ot({xAvgCharWidth:Math.round(v.advanceWidthAvg),usWeightClass:e.tables.os2.usWeightClass,usWidthClass:e.tables.os2.usWidthClass,usFirstCharIndex:t,usLastCharIndex:c,ulUnicodeRange1:u,ulUnicodeRange2:h,ulUnicodeRange3:d,ulUnicodeRange4:p,fsSelection:e.tables.os2.fsSelection,sTypoAscender:v.ascender,sTypoDescender:v.descender,sTypoLineGap:0,usWinAscent:v.yMax,usWinDescent:Math.abs(v.yMin),ulCodePageRange1:1,sxHeight:_t(e,"xyvw",{yMax:Math.round(v.ascender/2)}).yMax,sCapHeight:_t(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",v).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0}),S=Ue(e.glyphs),M=ie(e.glyphs),T=(P=e.getEnglishName("fontFamily"))+" "+(R=e.getEnglishName("fontSubfamily")),E=(E=e.getEnglishName("postScriptName"))||P.replace(/\s/g,"")+"-"+R,j={};for(g in e.names)j[g]=e.names[g];j.uniqueID||(j.uniqueID={en:e.getEnglishName("manufacturer")+":"+T}),j.postScriptName||(j.postScriptName={en:E}),j.preferredFamily||(j.preferredFamily=e.names.fontFamily),j.preferredSubfamily||(j.preferredSubfamily=e.names.fontSubfamily);var A=rt(j,L=[]),L=0<L.length?Be(L):void 0,C=lt(),P=(T=ke(e.glyphs,{version:e.getEnglishName("version"),fullName:T,familyName:P,weightName:R,postScriptName:E,unitsPerEm:e.unitsPerEm,fontBBox:[0,v.yMin,v.ascender,v.advanceWidthMax]}),e.metas&&0<Object.keys(e.metas).length?mt(e.metas):void 0),R=[b,_,x,w,A,M,C,T,S];L&&R.push(L),e.tables.gsub&&R.push(pt(e.tables.gsub)),P&&R.push(P);for(var O=gt((E=bt(R)).encode()),k=E.fields,I=!1,D=0;D<k.length;D+=1)if("head table"===k[D].name){k[D].value.checkSumAdjustment=2981146554-O,I=!0;break}if(I)return E;throw new Error("Could not find head table with checkSum to adjust.")}(this)},jr.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},jr.prototype.toArrayBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n<e.length;n++)r[n]=e[n];return t},jr.prototype.download=function(t){var r=this.getEnglishName("fontFamily"),i=this.getEnglishName("fontSubfamily"),o=(t=t||r.replace(/\s/g,"")+"-"+i+".otf",this.toArrayBuffer());"undefined"!=typeof window?(window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.requestFileSystem(window.TEMPORARY,o.byteLength,(function(e){e.root.getFile(t,{create:!0},(function(e){e.createWriter((function(t){var r=new DataView(o);r=new Blob([r],{type:"font/opentype"}),t.write(r),t.addEventListener("writeend",(function(){location.href=e.toURL()}),!1)}))}))}),(function(e){throw new Error(e.name+": "+e.message)}))):(r=e("fs"),i=function(e){for(var t=new n(e.byteLength),r=new Uint8Array(e),i=0;i<t.length;++i)t[i]=r[i];return t}(o),r.writeFileSync(t,i))},jr.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},jr.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},jr.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var Ar=new Array(10);Ar[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{posFormat:1,coverage:this.parsePointer(ee.coverage),value:this.parseValueRecord()}:2===t?{posFormat:2,coverage:this.parsePointer(ee.coverage),values:this.parseValueRecordList()}:void C.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},Ar[2]=function(){var e,t,r,n,i=this.offset+this.relativeOffset,o=this.parseUShort(),s=(C.assert(1===o||2===o,"0x"+i.toString(16)+": GPOS lookup type 2 format must be 1 or 2."),i=this.parsePointer(ee.coverage),this.parseUShort()),a=this.parseUShort();return 1===o?{posFormat:o,coverage:i,valueFormat1:s,valueFormat2:a,pairSets:this.parseList(ee.pointer(ee.list((function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(s),value2:this.parseValueRecord(a)}}))))}:2===o?(e=this.parsePointer(ee.classDef),t=this.parsePointer(ee.classDef),r=this.parseUShort(),n=this.parseUShort(),{posFormat:o,coverage:i,valueFormat1:s,valueFormat2:a,classDef1:e,classDef2:t,class1Count:r,class2Count:n,classRecords:this.parseList(r,ee.list(n,(function(){return{value1:this.parseValueRecord(s),value2:this.parseValueRecord(a)}})))}):void 0},Ar[3]=function(){return{error:"GPOS Lookup 3 not supported"}},Ar[4]=function(){return{error:"GPOS Lookup 4 not supported"}},Ar[5]=function(){return{error:"GPOS Lookup 5 not supported"}},Ar[6]=function(){return{error:"GPOS Lookup 6 not supported"}},Ar[7]=function(){return{error:"GPOS Lookup 7 not supported"}},Ar[8]=function(){return{error:"GPOS Lookup 8 not supported"}},Ar[9]=function(){return{error:"GPOS Lookup 9 not supported"}},new Array(10);var Lr=function(e,t){return t=(e=new ee(e,t=t||0)).parseVersion(1),C.argument(1===t||1.1===t,"Unsupported GPOS table version "+t),1===t?{version:t,scripts:e.parseScriptList(),features:e.parseFeatureList(),lookups:e.parseLookupList(Ar)}:{version:t,scripts:e.parseScriptList(),features:e.parseFeatureList(),lookups:e.parseLookupList(Ar),variations:e.parseFeatureVariationsList()}};function Cr(t,r){e("fs").readFile(t,(function(e,t){if(e)return r(e.message);r(null,At(t))}))}function Pr(e,t){var r=new XMLHttpRequest;r.open("get",e,!0),r.responseType="arraybuffer",r.onload=function(){return r.response?t(null,r.response):t("Font could not be loaded: "+r.statusText)},r.onerror=function(){t("Font could not be loaded")},r.send()}function Rr(e,t){for(var r=[],n=12,i=0;i<t;i+=1){var o=re.getTag(e,n),s=re.getULong(e,n+4),a=re.getULong(e,n+8),l=re.getULong(e,n+12);r.push({tag:o,checksum:s,offset:a,length:l,compression:!1}),n+=16}return r}function Or(e,t){if("WOFF"!==t.compression)return{data:e,offset:t.offset};e=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2);var r=new Uint8Array(t.length);if(function(e,t){var r,n,i,o=new s(e,t);do{switch((n=o).bitcount--||(n.tag=n.source[n.sourceIndex++],n.bitcount=7),i=1&n.tag,n.tag>>>=1,n=i,b(o,2,0)){case 0:r=function(e){for(var t,r;8<e.bitcount;)e.sourceIndex--,e.bitcount-=8;if((t=256*e.source[e.sourceIndex+1]+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return-3;for(e.sourceIndex+=4,r=t;r;--r)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,0}(o);break;case 1:r=x(o,a,l);break;case 2:E=T=M=j=c=S=void 0;for(var c,u=o,h=o.ltree,d=o.dtree,y=b(u,5,257),g=b(u,5,1),w=b(u,4,4),S=0;S<19;++S)m[S]=0;for(S=0;S<w;++S){var M=b(u,3,0);m[p[S]]=M}for(v(f,m,0,19),c=0;c<y+g;){var T=_(u,f);switch(T){case 16:for(var E=m[c-1],j=b(u,2,3);j;--j)m[c++]=E;break;case 17:for(j=b(u,3,3);j;--j)m[c++]=0;break;case 18:for(j=b(u,7,11);j;--j)m[c++]=0;break;default:m[c++]=T}}v(h,m,0,y),v(d,m,y,g),r=x(o,o.ltree,o.dtree);break;default:r=-3}if(0!==r)throw new Error("Data error")}while(!n);o.destLen<o.dest.length?"function"==typeof o.dest.slice?o.dest.slice(0,o.destLen):o.dest.subarray(0,o.destLen):o.dest}(e,r),r.byteLength!==t.length)throw new Error("Decompression error: "+t.tag+" decompressed length doesn't match recorded length");return{data:new DataView(r.buffer,0),offset:0}}function kr(e){var t,r,n,i,o,s,a,l,c,u,h,d,p,f,m=new jr({empty:!0}),y=new DataView(e,0),g=[];if((e=re.getTag(y,0))===String.fromCharCode(0,1,0,0)||"true"===e||"typ1"===e)m.outlinesFormat="truetype",g=Rr(y,n=re.getUShort(y,4));else if("OTTO"===e)m.outlinesFormat="cff",g=Rr(y,n=re.getUShort(y,4));else{if("wOFF"!==e)throw new Error("Unsupported OpenType signature "+e);if((x=re.getTag(y,4))===String.fromCharCode(0,1,0,0))m.outlinesFormat="truetype";else{if("OTTO"!==x)throw new Error("Unsupported OpenType flavor "+e);m.outlinesFormat="cff"}g=function(e,t){for(var r=[],n=44,i=0;i<t;i+=1){var o=re.getTag(e,n),s=re.getULong(e,n+4),a=re.getULong(e,n+8),l=re.getULong(e,n+12),c=a<l&&"WOFF";r.push({tag:o,offset:s,compression:c,compressedLength:a,length:l}),n+=20}return r}(y,n=re.getUShort(y,12))}for(var v=0;v<n;v+=1){var b=g[v],_=void 0;switch(b.tag){case"cmap":_=Or(y,b),m.tables.cmap=ne(_.data,_.offset),m.encoding=new ue(m.tables.cmap);break;case"cvt ":_=Or(y,b),f=new re.Parser(_.data,_.offset),m.tables.cvt=f.parseShortList(b.length/2);break;case"fvar":o=b;break;case"fpgm":_=Or(y,b),f=new re.Parser(_.data,_.offset),m.tables.fpgm=f.parseByteList(b.length);break;case"head":_=Or(y,b),m.tables.head=Ie(_.data,_.offset),m.unitsPerEm=m.tables.head.unitsPerEm,t=m.tables.head.indexToLocFormat;break;case"hhea":_=Or(y,b),m.tables.hhea=Ne(_.data,_.offset),m.ascender=m.tables.hhea.ascender,m.descender=m.tables.hhea.descender,m.numberOfHMetrics=m.tables.hhea.numberOfHMetrics;break;case"hmtx":c=b;break;case"ltag":_=Or(y,b),r=ze(_.data,_.offset);break;case"maxp":_=Or(y,b),m.tables.maxp=Ge(_.data,_.offset),m.numGlyphs=m.tables.maxp.numGlyphs;break;case"name":d=b;break;case"OS/2":_=Or(y,b),m.tables.os2=it(_.data,_.offset);break;case"post":_=Or(y,b),m.tables.post=at(_.data,_.offset),m.glyphNames=new de(m.tables.post);break;case"prep":_=Or(y,b),f=new re.Parser(_.data,_.offset),m.tables.prep=f.parseByteList(b.length);break;case"glyf":s=b;break;case"loca":h=b;break;case"CFF ":i=b;break;case"kern":u=b;break;case"GPOS":a=b;break;case"GSUB":l=b;break;case"meta":p=b}}if(x=Or(y,d),m.tables.name=tt(x.data,x.offset,r),m.names=m.tables.name,s&&h)e=0===t,x=function(e,t,r,n){for(var i=new re.Parser(e,t),o=n?i.parseUShort:i.parseULong,s=[],a=0;a<r+1;a+=1){var l=o.call(i);n&&(l*=2),s.push(l)}return s}((x=Or(y,h)).data,x.offset,m.numGlyphs,e),e=Or(y,s),m.glyphs=It.parse(e.data,e.offset,x,m);else{if(!i)throw new Error("Font doesn't contain TrueType or CFF outlines.");e=Or(y,i),Oe(e.data,e.offset,m)}for(var x=Or(y,c),w=(function(e,t,r,n,i){for(var o,s,a=new re.Parser(e,t),l=0;l<n;l+=1){l<r&&(o=a.parseUShort(),s=a.parseShort());var c=i.get(l);c.advanceWidth=o,c.leftSideBearing=s}}(x.data,x.offset,m.numberOfHMetrics,m.numGlyphs,m.glyphs),m),S=w.tables.cmap.glyphIndexMap,M=Object.keys(S),T=0;T<M.length;T+=1){var E,j=M[T],A=S[j];(E=w.glyphs.get(A)).addUnicode(parseInt(j))}for(var L=0;L<w.glyphs.length;L+=1)E=w.glyphs.get(L),w.cffEncoding?w.isCIDFont?E.name="gid"+L:E.name=w.cffEncoding.charset[L]:w.glyphNames.names&&(E.name=w.glyphNames.glyphIndexToName(L));return u?(e=Or(y,u),m.kerningPairs=function(e,t){if(0===(t=(e=new re.Parser(e,t)).parseUShort())){var r=e,n={},i=(r.skip("uShort"),r.parseUShort()),o=(C.argument(0===i,"Unsupported kern sub-table version."),r.skip("uShort",2),r.parseUShort());r.skip("uShort",3);for(var s=0;s<o;s+=1){var a=r.parseUShort(),l=r.parseUShort(),c=r.parseShort();n[a+","+l]=c}return n}if(1!==t)throw new Error("Unsupported kern table version ("+t+").");var u=e,h={};if(u.skip("uShort"),1<u.parseULong()&&console.warn("Only the first kern subtable is supported."),u.skip("uLong"),i=255&u.parseUShort(),u.skip("uShort"),0==i){var d=u.parseUShort();u.skip("uShort",3);for(var p=0;p<d;p+=1){var f=u.parseUShort(),m=u.parseUShort(),y=u.parseShort();h[f+","+m]=y}}return h}(e.data,e.offset)):m.kerningPairs={},a&&(x=Or(y,a),m.tables.gpos=Lr(x.data,x.offset),m.position.init()),l&&(e=Or(y,l),m.tables.gsub=dt(e.data,e.offset)),o&&(x=Or(y,o),m.tables.fvar=function(e,t,r){for(var n,i,o,s,a=new re.Parser(e,t),l=a.parseULong(),c=(C.argument(65536===l,"Unsupported fvar table version."),a.parseOffset16()),u=(a.skip("uShort",1),a.parseUShort()),h=a.parseUShort(),d=a.parseUShort(),p=a.parseUShort(),f=[],m=0;m<u;m++)f.push((n=e,i=t+c+m*h,o=r,s={},n=new re.Parser(n,i),s.tag=n.parseTag(),s.minValue=n.parseFixed(),s.defaultValue=n.parseFixed(),s.maxValue=n.parseFixed(),n.skip("uShort",1),s.name=o[n.parseUShort()]||{},s));for(var y=[],g=t+c+u*h,v=0;v<d;v++)y.push(function(e,t,r,n){var i={},o=new re.Parser(e,t);i.name=n[o.parseUShort()]||{},o.skip("uShort",1),i.coordinates={};for(var s=0;s<r.length;++s)i.coordinates[r[s].tag]=o.parseFixed();return i}(e,g+v*p,f,r));return{axes:f,instances:y}}(x.data,x.offset,m.names)),p&&(e=Or(y,p),m.tables.meta=ft(e.data,e.offset),m.metas=m.tables.meta),m}t.Font=jr,t.Glyph=fe,t.Path=j,t.BoundingBox=E,t._parse=re,t.parse=kr,t.load=function(e,t){("undefined"==typeof window?Cr:Pr)(e,(function(e,r){if(e)return t(e);var n;try{n=kr(r)}catch(e){return t(e,null)}return t(null,n)}))},t.loadSync=function(t){return kr(At(e("fs").readFileSync(t)))},Object.defineProperty(t,"__esModule",{value:!0})},i("object"==typeof r&&void 0!==t?r:this.opentype={})}).call(this,e("buffer").Buffer)},{buffer:4,fs:2}],258:[function(e,t,r){(function(e){function t(e,t){for(var r=0,n=e.length-1;0<=n;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}r.resolve=function(){for(var r="",i=!1,o=arguments.length-1;-1<=o&&!i;o--){var s=0<=o?arguments[o]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,i="/"===s.charAt(0))}return(i?"/":"")+(r=t(n(r.split("/"),(function(e){return!!e})),!i).join("/"))||"."},r.normalize=function(e){var o=r.isAbsolute(e),s="/"===i(e,-1);return(e=(e=t(n(e.split("/"),(function(e){return!!e})),!o).join("/"))||o?e:".")&&s&&(e+="/"),(o?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;0<=r&&""===e[r];r--);return r<t?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),o=n(t.split("/")),s=Math.min(i.length,o.length),a=s,l=0;l<s;l++)if(i[l]!==o[l]){a=l;break}var c=[];for(l=a;l<i.length;l++)c.push("..");return(c=c.concat(o.slice(a))).join("/")},r.sep="/",r.delimiter=":",r.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=47===e.charCodeAt(0),r=-1,n=!0,i=e.length-1;1<=i;--i)if(47===e.charCodeAt(i)){if(!n){r=i;break}}else n=!1;return-1===r?t?"/":".":t&&1===r?"/":e.slice(0,r)},r.basename=function(e,t){return e=function(e){"string"!=typeof e&&(e+="");for(var t=0,r=-1,n=!0,i=e.length-1;0<=i;--i)if(47===e.charCodeAt(i)){if(!n){t=i+1;break}}else-1===r&&(n=!1,r=i+1);return-1===r?"":e.slice(t,r)}(e),t&&e.substr(-1*t.length)===t?e.substr(0,e.length-t.length):e},r.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,n=-1,i=!0,o=0,s=e.length-1;0<=s;--s){var a=e.charCodeAt(s);if(47===a){if(i)continue;r=s+1;break}-1===n&&(i=!1,n=s+1),46===a?-1===t?t=s:1!==o&&(o=1):-1!==t&&(o=-1)}return-1===t||-1===n||0===o||1===o&&t===n-1&&t===r+1?"":e.slice(t,n)};var i=function(e,t,r){return e.substr(t,r)}}).call(this,e("_process"))},{_process:259}],259:[function(e,t,r){var n,i;function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}t=t.exports={};try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return(n=setTimeout)(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}var l,c=[],u=!1,h=-1;function d(){u&&l&&(u=!1,l.length?c=l.concat(c):h=-1,c.length&&p())}function p(){if(!u){for(var e=a(d),t=(u=!0,c.length);t;){for(l=c,c=[];++h<t;)l&&l[h].run();h=-1,t=c.length}l=null,u=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return(i=clearTimeout)(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function m(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new f(e,t)),1!==c.length||u||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=m,t.addListener=m,t.once=m,t.off=m,t.removeListener=m,t.removeAllListeners=m,t.emit=m,t.prependListener=m,t.prependOnceListener=m,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],260:[function(e,t,r){t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i=(g="function"==typeof Symbol?Symbol:{}).iterator||"@@iterator",o=g.asyncIterator||"@@asyncIterator",s=g.toStringTag||"@@toStringTag";function a(e,r,n,i){var o,s,a,m;return r=r&&r.prototype instanceof f?r:f,r=Object.create(r.prototype),i=new M(i||[]),r._invoke=(o=e,s=n,a=i,m=c,function(e,r){if(m===h)throw new Error("Generator is already running");if(m===d){if("throw"===e)throw r;return E()}for(a.method=e,a.arg=r;;){var n=a.delegate;if(n&&(n=function e(r,n){var i=r.iterator[n.method];if(i===t){if(n.delegate=null,"throw"===n.method){if(r.iterator.return&&(n.method="return",n.arg=t,e(r,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}return"throw"===(i=l(i,r.iterator,n.arg)).type?(n.method="throw",n.arg=i.arg,n.delegate=null,p):(i=i.arg)?i.done?(n[r.resultName]=i.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,p):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,a),n)){if(n===p)continue;return n}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(m===c)throw m=d,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);if(m=h,"normal"===(n=l(o,s,a)).type){if(m=a.done?d:u,n.arg!==p)return{value:n.arg,done:a.done}}else"throw"===n.type&&(m=d,a.method="throw",a.arg=n.arg)}}),r}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=a;var c="suspendedStart",u="suspendedYield",h="executing",d="completed",p={};function f(){}function m(){}function y(){}var g,v,b=((g={})[i]=function(){return this},(v=(v=Object.getPrototypeOf)&&v(v(T([]))))&&v!==r&&n.call(v,i)&&(g=v),y.prototype=f.prototype=Object.create(g));function _(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function x(e){var t;this._invoke=function(r,i){function o(){return new Promise((function(t,o){!function t(r,i,o,s){var a;if("throw"!==(r=l(e[r],e,i)).type)return(i=(a=r.arg).value)&&"object"==typeof i&&n.call(i,"__await")?Promise.resolve(i.__await).then((function(e){t("next",e,o,s)}),(function(e){t("throw",e,o,s)})):Promise.resolve(i).then((function(e){a.value=e,o(a)}),(function(e){return t("throw",e,o,s)}));s(r.arg)}(r,i,t,o)}))}return t=t?t.then(o,o):o()}}function w(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 S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function T(e){if(e){var r,o=e[i];if(o)return o.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(o=function i(){for(;++r<e.length;)if(n.call(e,r))return i.value=e[r],i.done=!1,i;return i.value=t,i.done=!0,i}).next=o}return{next:E}}function E(){return{value:t,done:!0}}return(m.prototype=b.constructor=y).constructor=m,y[s]=m.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){return!!(e="function"==typeof e&&e.constructor)&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},_(x.prototype),x.prototype[o]=function(){return this},e.AsyncIterator=x,e.async=function(t,r,n,i){var o=new x(a(t,r,n,i));return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},_(b),b[s]="Generator",b[i]=function(){return this},b.toString=function(){return"[object Generator]"},e.keys=function(e){var t,r=[];for(t in e)r.push(t);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,M.prototype={constructor:M,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.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function i(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;0<=o;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var l=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}var s=(o=o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc?null:o)?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(s)},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),p},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,i=this.tryEntries[t];if(i.tryLoc===e)return"throw"===(r=i.completion).type&&(n=r.arg,S(i)),n}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}("object"==typeof t?t.exports:{});try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},{}],261:[function(e,t,r){!function(e){"use strict";var t,r,n,i,o,s,a,l,c,u;function h(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function d(e){return"string"!=typeof e?String(e):e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function m(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function y(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=y(t);return t.readAsArrayBuffer(e),r}function v(e){var t;return e.slice?e.slice(0):((t=new Uint8Array(e.byteLength)).set(new Uint8Array(e)),t.buffer)}function b(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e)if("string"==typeof e)this._bodyText=e;else if(n&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(i&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(o&&n&&a(e))this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!o||!ArrayBuffer.prototype.isPrototypeOf(e)&&!l(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=v(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var e=m(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?m(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r=m(this);if(r)return r;if(this._bodyBlob)return r=this._bodyBlob,t=y(e=new FileReader),e.readAsText(r),t;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(x)}),this.json=function(){return this.text().then(JSON.parse)},this}function _(e,t){var r,n=(t=t||{}).body;if(e instanceof _){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(r=(e=t.method||this.method||"GET").toUpperCase(),-1<c.indexOf(r)?r:e),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){var r;e&&(r=(e=e.split("=")).shift().replace(/\+/g," "),e=e.join("=").replace(/\+/g," "),t.append(decodeURIComponent(r),decodeURIComponent(e)))})),t}function w(e,t){t=t||{},this.type="default",this.status=void 0===t.status?200:t.status,this.ok=200<=this.status&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}e.fetch||(t="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,n="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in e,(o="ArrayBuffer"in e)&&(s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=function(e){return e&&DataView.prototype.isPrototypeOf(e)},l=ArrayBuffer.isView||function(e){return e&&-1<s.indexOf(Object.prototype.toString.call(e))}),f.prototype.append=function(e,t){e=h(e),t=d(t);var r=this.map[e];this.map[e]=r?r+","+t:t},f.prototype.delete=function(e){delete this.map[h(e)]},f.prototype.get=function(e){return e=h(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(h(e))},f.prototype.set=function(e,t){this.map[h(e)]=d(t)},f.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),p(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),p(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),p(e)},r&&(f.prototype[Symbol.iterator]=f.prototype.entries),c=["DELETE","GET","HEAD","OPTIONS","POST","PUT"],_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},b.call(_.prototype),b.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e},u=[301,302,303,307,308],w.redirect=function(e,t){if(-1===u.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},e.Headers=f,e.Request=_,e.Response=w,e.fetch=function(e,t){return new Promise((function(r,i){var o=new _(e,t),s=new XMLHttpRequest;s.onload=function(){var e,t={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new f,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=(t=t.split(":")).shift().trim();r&&(t=t.join(":").trim(),e.append(r,t))})),e)},n=(t.url="responseURL"in s?s.responseURL:t.headers.get("X-Request-URL"),"response"in s?s.response:s.responseText);r(new w(n,t))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&n&&(s.responseType="blob"),o.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),s.send(void 0===o._bodyInit?null:o._bodyInit)}))},e.fetch.polyfill=!0)}("undefined"!=typeof self?self:this)},{}],262:[function(e,t,r){"use strict";e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.split"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=s(e("../core/main")),o=s(e("../color/color_conversion"));function s(e){return e&&e.__esModule?e:{default:e}}var a=[{h:0,s:0,b:.8275,name:"gray"},{h:0,s:0,b:.8627,name:"gray"},{h:0,s:0,b:.7529,name:"gray"},{h:.0167,s:.1176,b:1,name:"light pink"}],l=[{h:0,s:0,b:0,name:"black"},{h:0,s:0,b:.5,name:"gray"},{h:0,s:0,b:1,name:"white"},{h:0,s:.5,b:.5,name:"dark maroon"},{h:0,s:.5,b:1,name:"salmon pink"},{h:0,s:1,b:0,name:"black"},{h:0,s:1,b:.5,name:"dark red"},{h:0,s:1,b:1,name:"red"},{h:5,s:0,b:1,name:"very light peach"},{h:5,s:.5,b:.5,name:"brown"},{h:5,s:.5,b:1,name:"peach"},{h:5,s:1,b:.5,name:"brick red"},{h:5,s:1,b:1,name:"crimson"},{h:10,s:0,b:1,name:"light peach"},{h:10,s:.5,b:.5,name:"brown"},{h:10,s:.5,b:1,name:"light orange"},{h:10,s:1,b:.5,name:"brown"},{h:10,s:1,b:1,name:"orange"},{h:15,s:0,b:1,name:"very light yellow"},{h:15,s:.5,b:.5,name:"olive green"},{h:15,s:.5,b:1,name:"light yellow"},{h:15,s:1,b:0,name:"dark olive green"},{h:15,s:1,b:.5,name:"olive green"},{h:15,s:1,b:1,name:"yellow"},{h:20,s:0,b:1,name:"very light yellow"},{h:20,s:.5,b:.5,name:"olive green"},{h:20,s:.5,b:1,name:"light yellow green"},{h:20,s:1,b:0,name:"dark olive green"},{h:20,s:1,b:.5,name:"dark yellow green"},{h:20,s:1,b:1,name:"yellow green"},{h:25,s:.5,b:.5,name:"dark yellow green"},{h:25,s:.5,b:1,name:"light green"},{h:25,s:1,b:.5,name:"dark green"},{h:25,s:1,b:1,name:"green"},{h:30,s:.5,b:1,name:"light green"},{h:30,s:1,b:.5,name:"dark green"},{h:30,s:1,b:1,name:"green"},{h:35,s:0,b:.5,name:"light green"},{h:35,s:0,b:1,name:"very light green"},{h:35,s:.5,b:.5,name:"dark green"},{h:35,s:.5,b:1,name:"light green"},{h:35,s:1,b:0,name:"very dark green"},{h:35,s:1,b:.5,name:"dark green"},{h:35,s:1,b:1,name:"green"},{h:40,s:0,b:1,name:"very light green"},{h:40,s:.5,b:.5,name:"dark green"},{h:40,s:.5,b:1,name:"light green"},{h:40,s:1,b:.5,name:"dark green"},{h:40,s:1,b:1,name:"green"},{h:45,s:.5,b:1,name:"light turquoise"},{h:45,s:1,b:.5,name:"dark turquoise"},{h:45,s:1,b:1,name:"turquoise"},{h:50,s:0,b:1,name:"light sky blue"},{h:50,s:.5,b:.5,name:"dark cyan"},{h:50,s:.5,b:1,name:"light cyan"},{h:50,s:1,b:.5,name:"dark cyan"},{h:50,s:1,b:1,name:"cyan"},{h:55,s:0,b:1,name:"light sky blue"},{h:55,s:.5,b:1,name:"light sky blue"},{h:55,s:1,b:.5,name:"dark blue"},{h:55,s:1,b:1,name:"sky blue"},{h:60,s:0,b:.5,name:"gray"},{h:60,s:0,b:1,name:"very light blue"},{h:60,s:.5,b:.5,name:"blue"},{h:60,s:.5,b:1,name:"light blue"},{h:60,s:1,b:.5,name:"navy blue"},{h:60,s:1,b:1,name:"blue"},{h:65,s:0,b:1,name:"lavender"},{h:65,s:.5,b:.5,name:"navy blue"},{h:65,s:.5,b:1,name:"light purple"},{h:65,s:1,b:.5,name:"dark navy blue"},{h:65,s:1,b:1,name:"blue"},{h:70,s:0,b:1,name:"lavender"},{h:70,s:.5,b:.5,name:"navy blue"},{h:70,s:.5,b:1,name:"lavender blue"},{h:70,s:1,b:.5,name:"dark navy blue"},{h:70,s:1,b:1,name:"blue"},{h:75,s:.5,b:1,name:"lavender"},{h:75,s:1,b:.5,name:"dark purple"},{h:75,s:1,b:1,name:"purple"},{h:80,s:.5,b:1,name:"pinkish purple"},{h:80,s:1,b:.5,name:"dark purple"},{h:80,s:1,b:1,name:"purple"},{h:85,s:0,b:1,name:"light pink"},{h:85,s:.5,b:.5,name:"purple"},{h:85,s:.5,b:1,name:"light fuchsia"},{h:85,s:1,b:.5,name:"dark fuchsia"},{h:85,s:1,b:1,name:"fuchsia"},{h:90,s:.5,b:.5,name:"dark fuchsia"},{h:90,s:.5,b:1,name:"hot pink"},{h:90,s:1,b:.5,name:"dark fuchsia"},{h:90,s:1,b:1,name:"fuchsia"},{h:95,s:0,b:1,name:"pink"},{h:95,s:.5,b:1,name:"light pink"},{h:95,s:1,b:.5,name:"dark magenta"},{h:95,s:1,b:1,name:"magenta"}];i.default.prototype._rgbColorName=function(e){e=o.default._rgbaToHSBA(e);var t,r,i=[(n=e)[0],e[1],e[2]];0!==i[0]&&(i[0]=Math.round(100*i[0]),(e=i[0].toString().split(""))[r=e.length-1]=parseInt(e[r]),e[r]<2.5?e[r]=0:2.5<=e[r]&&e[r]<7.5&&(e[r]=5),2===e.length?(e[0]=parseInt(e[0]),7.5<=e[r]&&(e[r]=0,e[0]=e[0]+1),i[0]=10*e[0]+e[1]):7.5<=e[r]?i[0]=10:i[0]=e[r]),i[2]=i[2]/255;for(var s=i.length-1;1<=s;s--)i[s]<=.25?i[s]=0:.25<i[s]&&i[s]<.75?i[s]=.5:i[s]=1;if(0===i[0]&&0===i[1]&&1===i[2]){for(var c=2;0<=c;c--)n[c]=Math.round(1e4*n[c])/1e4;for(var u=0;u<a.length;u++){if(a[u].h===n[0]&&a[u].s===n[1]&&a[u].b===n[2]){t=a[u].name;break}t="white"}}else for(var h=0;h<l.length;h++)if(l[h].h===i[0]&&l[h].s===i[1]&&l[h].b===i[2]){t=l[h].name;break}return t},e=i.default,r.default=e},{"../color/color_conversion":268,"../core/main":283,"core-js/modules/es.function.name":174,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.split":206}],263:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.ends-with"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.ends-with"),e("core-js/modules/es.string.replace"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e},i="_Description",o="_fallbackDesc",s="_fallbackTable",a="_Label",l="_labelDesc",c="_labelTable";function u(e){if("label"===e||"fallback"===e)throw new Error("description should not be LABEL or FALLBACK");return e.endsWith(".")||e.endsWith(";")||e.endsWith(",")||e.endsWith("?")||e.endsWith("!")||(e+="."),e}n.default.prototype.describe=function(e,t){var r;n.default._validateParameters("describe",arguments),"string"==typeof e&&(r=this.canvas.id,e=u(e),this.dummyDOM||(this.dummyDOM=document.getElementById(r).parentNode),this.descriptions||(this.descriptions={}),this.descriptions.fallback?this.descriptions.fallback.innerHTML!==e&&(this.descriptions.fallback.innerHTML=e):this._describeHTML("fallback",e),t===this.LABEL&&(this.descriptions.label?this.descriptions.label.innerHTML!==e&&(this.descriptions.label.innerHTML=e):this._describeHTML("label",e)))},n.default.prototype.describeElement=function(e,t,r){var i,o;n.default._validateParameters("describeElement",arguments),"string"==typeof t&&"string"==typeof e&&(i=this.canvas.id,t=u(t),o=function(e){if("label"===e||"fallback"===e)throw new Error("element name should not be LABEL or FALLBACK");return e.endsWith(".")||e.endsWith(";")||e.endsWith(",")?e=e.replace(/.$/,":"):e.endsWith(":")||(e+=":"),e}(e),e=e.replace(/[^a-zA-Z0-9]/g,""),o='<th scope="row">'.concat(o,"</th><td>").concat(t,"</td>"),this.dummyDOM||(this.dummyDOM=document.getElementById(i).parentNode),this.descriptions?this.descriptions.fallbackElements||(this.descriptions.fallbackElements={}):this.descriptions={fallbackElements:{}},this.descriptions.fallbackElements[e]?this.descriptions.fallbackElements[e].innerHTML!==o&&(this.descriptions.fallbackElements[e].innerHTML=o):this._describeElementHTML("fallback",e,o),r===this.LABEL&&(this.descriptions.labelElements||(this.descriptions.labelElements={}),this.descriptions.labelElements[e]?this.descriptions.labelElements[e].innerHTML!==o&&(this.descriptions.labelElements[e].innerHTML=o):this._describeElementHTML("label",e,o)))},n.default.prototype._describeHTML=function(e,t){var r,n=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(n+i))?this.dummyDOM.querySelector("#"+n+s).insertAdjacentHTML("beforebegin",'<p id="'.concat(n+o,'"></p>')):(r='<div id="'.concat(n).concat(i,'" role="region" aria-label="Canvas Description"><p id="').concat(n).concat(o,'"></p></div>'),this.dummyDOM.querySelector("#".concat(n,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutput")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#".concat(n)).innerHTML=r),this.descriptions.fallback=this.dummyDOM.querySelector("#".concat(n).concat(o)),this.descriptions.fallback.innerHTML=t):"label"===e&&(this.dummyDOM.querySelector("#".concat(n+a))?this.dummyDOM.querySelector("#".concat(n+c))&&this.dummyDOM.querySelector("#".concat(n+c)).insertAdjacentHTML("beforebegin",'<p id="'.concat(n).concat(l,'"></p>')):(r='<div id="'.concat(n).concat(a,'" class="p5Label"><p id="').concat(n).concat(l,'"></p></div>'),this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#"+n).insertAdjacentHTML("afterend",r)),this.descriptions.label=this.dummyDOM.querySelector("#"+n+l),this.descriptions.label.innerHTML=t)},n.default.prototype._describeElementHTML=function(e,t,r){var n,u=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(u+i))?this.dummyDOM.querySelector("#"+u+s)||this.dummyDOM.querySelector("#"+u+o).insertAdjacentHTML("afterend",'<table id="'.concat(u).concat(s,'"><caption>Canvas elements and their descriptions</caption></table>')):(n='<div id="'.concat(u).concat(i,'" role="region" aria-label="Canvas Description"><table id="').concat(u).concat(s,'"><caption>Canvas elements and their descriptions</caption></table></div>'),this.dummyDOM.querySelector("#".concat(u,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(u,"accessibleOutput")).insertAdjacentHTML("beforebegin",n):this.dummyDOM.querySelector("#"+u).innerHTML=n),(n=document.createElement("tr")).id=u+"_fte_"+t,this.dummyDOM.querySelector("#"+u+s).appendChild(n),this.descriptions.fallbackElements[t]=this.dummyDOM.querySelector("#".concat(u).concat("_fte_").concat(t)),this.descriptions.fallbackElements[t].innerHTML=r):"label"===e&&(this.dummyDOM.querySelector("#".concat(u+a))?this.dummyDOM.querySelector("#".concat(u+c))||this.dummyDOM.querySelector("#"+u+l).insertAdjacentHTML("afterend",'<table id="'.concat(u+c,'"></table>')):(n='<div id="'.concat(u).concat(a,'" class="p5Label"><table id="').concat(u).concat(c,'"></table></div>'),this.dummyDOM.querySelector("#".concat(u,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(u,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",n):this.dummyDOM.querySelector("#"+u).insertAdjacentHTML("afterend",n)),(e=document.createElement("tr")).id=u+"_lte_"+t,this.dummyDOM.querySelector("#"+u+c).appendChild(e),this.descriptions.labelElements[t]=this.dummyDOM.querySelector("#".concat(u).concat("_lte_").concat(t)),this.descriptions.labelElements[t].innerHTML=r)},e=n.default,r.default=e},{"../core/main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.string.ends-with":198,"core-js/modules/es.string.replace":204}],264:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.map"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.map"),e("core-js/modules/es.string.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.prototype._updateGridOutput=function(e){var t,r,n,i;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],n=function(e,t,r,n){return t="".concat(t," canvas, ").concat(r," by ").concat(n," pixels, contains ").concat(e[0]),(1===e[0]?"".concat(t," shape: "):"".concat(t," shapes: ")).concat(e[1])}((r=function(e,t){var r,n="",i="",o=0;for(r in t){var s,a=0;for(s in t[r]){var l='<li id="'.concat(e,"shape").concat(o,'">').concat(t[r][s].color," ").concat(r,",");"line"===r?l+=" location = ".concat(t[r][s].pos,", length = ").concat(t[r][s].length," pixels"):(l+=" location = ".concat(t[r][s].pos),"point"!==r&&(l+=", area = ".concat(t[r][s].area," %")),l+="</li>"),n+=l,a++,o++}i=1<a?"".concat(i," ").concat(a," ").concat(r,"s"):"".concat(i," ").concat(a," ").concat(r)}return{numShapes:[o,i],details:n}}(e,this.ingredients.shapes)).numShapes,this.ingredients.colors.background,this.width,this.height),i=function(e,t){var r,n,i=0,o="",s=Array.from(Array(10),(function(){return Array(10)}));for(r in t)for(var a in t[r]){var l;l="line"!==r?'<a href="#'.concat(e,"shape").concat(i,'">').concat(t[r][a].color," ").concat(r,"</a>"):'<a href="#'.concat(e,"shape").concat(i,'">').concat(t[r][a].color," ").concat(r," midpoint</a>"),t[r][a].loc.locY<s.length&&t[r][a].loc.locX<s[t[r][a].loc.locY].length&&(s[t[r][a].loc.locY][t[r][a].loc.locX]?s[t[r][a].loc.locY][t[r][a].loc.locX]=s[t[r][a].loc.locY][t[r][a].loc.locX]+"  "+l:s[t[r][a].loc.locY][t[r][a].loc.locX]=l,i++)}for(n in s){var c,u="<tr>";for(c in s[n])u+="<td>",void 0!==s[n][c]&&(u+=s[n][c]),u+="</td>";o=o+u+"</tr>"}return o}(e,this.ingredients.shapes),n!==t.summary.innerHTML&&(t.summary.innerHTML=n),i!==t.map.innerHTML&&(t.map.innerHTML=i),r.details!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=r.details),this._accessibleOutputs[e]=t)},e=e.default,r.default=e},{"../core/main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.from":162,"core-js/modules/es.array.map":168,"core-js/modules/es.string.iterator":200}],265:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};function i(e,t,r){return 10===(t=Math.floor(e[0]/t*10))&&(t-=1),10===(e=Math.floor(e[1]/r*10))&&(e-=1),{locX:t,locY:e}}n.default.prototype.textOutput=function(e){n.default._validateParameters("textOutput",arguments),this._accessibleOutputs.text||(this._accessibleOutputs.text=!0,this._createOutput("textOutput","Fallback"),e===this.LABEL&&(this._accessibleOutputs.textLabel=!0,this._createOutput("textOutput","Label")))},n.default.prototype.gridOutput=function(e){n.default._validateParameters("gridOutput",arguments),this._accessibleOutputs.grid||(this._accessibleOutputs.grid=!0,this._createOutput("gridOutput","Fallback"),e===this.LABEL&&(this._accessibleOutputs.gridLabel=!0,this._createOutput("gridOutput","Label")))},n.default.prototype._addAccsOutput=function(){return this._accessibleOutputs||(this._accessibleOutputs={text:!1,grid:!1,textLabel:!1,gridLabel:!1}),this._accessibleOutputs.grid||this._accessibleOutputs.text},n.default.prototype._createOutput=function(e,t){var r,n,i,o=this.canvas.id,s=(this.ingredients||(this.ingredients={shapes:{},colors:{background:"white",fill:"white",stroke:"black"},pShapes:"",pBackground:""}),this.dummyDOM||(this.dummyDOM=document.getElementById(o).parentNode),"");"Fallback"===t?(r=o+e,this.dummyDOM.querySelector("#".concat(n=o+"accessibleOutput"))||(this.dummyDOM.querySelector("#".concat(o,"_Description"))?this.dummyDOM.querySelector("#".concat(o,"_Description")).insertAdjacentHTML("afterend",'<div id="'.concat(n,'" role="region" aria-label="Canvas Outputs"></div>')):this.dummyDOM.querySelector("#".concat(o)).innerHTML='<div id="'.concat(n,'" role="region" aria-label="Canvas Outputs"></div>'))):"Label"===t&&(r=o+e+(s=t),this.dummyDOM.querySelector("#".concat(n=o+"accessibleOutput"+t))||(this.dummyDOM.querySelector("#".concat(o,"_Label"))?this.dummyDOM.querySelector("#".concat(o,"_Label")):this.dummyDOM.querySelector("#".concat(o))).insertAdjacentHTML("afterend",'<div id="'.concat(n,'"></div>'))),this._accessibleOutputs[r]={},"textOutput"===e?(s="#".concat(o,"gridOutput").concat(s),i='<div id="'.concat(r,'">Text Output<div id="').concat(r,'Summary" aria-label="text output summary"><p id="').concat(r,'_summary"></p><ul id="').concat(r,'_list"></ul></div><table id="').concat(r,'_shapeDetails" summary="text output shape details"></table></div>'),this.dummyDOM.querySelector(s)?this.dummyDOM.querySelector(s).insertAdjacentHTML("beforebegin",i):this.dummyDOM.querySelector("#".concat(n)).innerHTML=i,this._accessibleOutputs[r].list=this.dummyDOM.querySelector("#".concat(r,"_list"))):"gridOutput"===e&&(s="#".concat(o,"textOutput").concat(s),i='<div id="'.concat(r,'">Grid Output<p id="').concat(r,'_summary" aria-label="grid output summary"><table id="').concat(r,'_map" summary="grid output content"></table><ul id="').concat(r,'_shapeDetails" aria-label="grid output shape details"></ul></div>'),this.dummyDOM.querySelector(s)?this.dummyDOM.querySelector(s).insertAdjacentHTML("afterend",i):this.dummyDOM.querySelector("#".concat(n)).innerHTML=i,this._accessibleOutputs[r].map=this.dummyDOM.querySelector("#".concat(r,"_map"))),this._accessibleOutputs[r].shapeDetails=this.dummyDOM.querySelector("#".concat(r,"_shapeDetails")),this._accessibleOutputs[r].summary=this.dummyDOM.querySelector("#".concat(r,"_summary"))},n.default.prototype._updateAccsOutput=function(){var e=this.canvas.id;JSON.stringify(this.ingredients.shapes)===this.ingredients.pShapes&&this.ingredients.colors.background===this.ingredients.pBackground||(this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this._accessibleOutputs.text&&this._updateTextOutput(e+"textOutput"),this._accessibleOutputs.grid&&this._updateGridOutput(e+"gridOutput"),this._accessibleOutputs.textLabel&&this._updateTextOutput(e+"textOutputLabel"),this._accessibleOutputs.gridLabel&&this._updateGridOutput(e+"gridOutputLabel"))},n.default.prototype._accsBackground=function(e){this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this.ingredients.pBackground=this.ingredients.colors.background,this.ingredients.shapes={},this.ingredients.colors.backgroundRGBA!==e&&(this.ingredients.colors.backgroundRGBA=e,this.ingredients.colors.background=this._rgbColorName(e))},n.default.prototype._accsCanvasColors=function(e,t){"fill"===e?this.ingredients.colors.fillRGBA!==t&&(this.ingredients.colors.fillRGBA=t,this.ingredients.colors.fill=this._rgbColorName(t)):"stroke"===e&&this.ingredients.colors.strokeRGBA!==t&&(this.ingredients.colors.strokeRGBA=t,this.ingredients.colors.stroke=this._rgbColorName(t))},n.default.prototype._accsOutput=function(e,t){"ellipse"===e&&t[2]===t[3]?e="circle":"rectangle"===e&&t[2]===t[3]&&(e="square");var r,n,o={},s=!0,a=function(e,t){var r;return e="rectangle"===e||"ellipse"===e||"arc"===e||"circle"===e||"square"===e?(r=Math.round(t[0]+t[2]/2),Math.round(t[1]+t[3]/2)):"triangle"===e?(r=(t[0]+t[2]+t[4])/3,(t[1]+t[3]+t[5])/3):"quadrilateral"===e?(r=(t[0]+t[2]+t[4]+t[6])/4,(t[1]+t[3]+t[5]+t[7])/4):"line"===e?(r=(t[0]+t[2])/2,(t[1]+t[3])/2):(r=t[0],t[1]),[r,e]}(e,t);if("line"===e?(o.color=this.ingredients.colors.stroke,o.length=Math.round(this.dist(t[0],t[1],t[2],t[3])),r=this._getPos(t[0],[1]),n=this._getPos(t[2],[3]),o.loc=i(a,this.width,this.height),o.pos=r===n?"at ".concat(r):"from ".concat(r," to ").concat(n)):("point"===e?o.color=this.ingredients.colors.stroke:(o.color=this.ingredients.colors.fill,o.area=this._getArea(e,t)),o.pos=this._getPos.apply(this,function(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(a)),o.loc=i(a,this.width,this.height)),this.ingredients.shapes[e]){if(this.ingredients.shapes[e]!==[o]){for(var l in this.ingredients.shapes[e])JSON.stringify(this.ingredients.shapes[e][l])===JSON.stringify(o)&&(s=!1);!0===s&&this.ingredients.shapes[e].push(o)}}else this.ingredients.shapes[e]=[o]},n.default.prototype._getPos=function(e,t){e=new DOMPointReadOnly(e,t),t=this._renderer.isP3D?new DOMMatrix(this._renderer.uMVMatrix.mat4):this.drawingContext.getTransform(),t=(e=e.matrixTransform(t)).x,e=e.y;var r=this.width*this._pixelDensity,n=this.height*this._pixelDensity;return t<.4*r?e<.4*n?"top left":.6*n<e?"bottom left":"mid left":.6*r<t?e<.4*n?"top right":.6*n<e?"bottom right":"mid right":e<.4*n?"top middle":.6*n<e?"bottom middle":"middle"},n.default.prototype._getArea=function(e,t){var r,n,i=0,o=("arc"===e?(i=(r=((t[5]-t[4])%(2*Math.PI)+2*Math.PI)%(2*Math.PI))*t[2]*t[3]/8,"open"!==t[6]&&"chord"!==t[6]||(n=t[0],c=t[1],o=t[0]+t[2]/2*Math.cos(t[4]).toFixed(2),u=t[1]+t[3]/2*Math.sin(t[4]).toFixed(2),a=t[0]+t[2]/2*Math.cos(t[5]).toFixed(2),s=t[1]+t[3]/2*Math.sin(t[5]).toFixed(2),n=Math.abs(n*(u-s)+o*(s-c)+a*(c-u))/2,r>Math.PI?i+=n:i-=n)):"ellipse"===e||"circle"===e?i=3.14*t[2]/2*t[3]/2:"line"===e||"point"===e?i=0:"quadrilateral"===e?i=Math.abs((t[6]+t[0])*(t[7]-t[1])+(t[0]+t[2])*(t[1]-t[3])+(t[2]+t[4])*(t[3]-t[5])+(t[4]+t[6])*(t[5]-t[7]))/2:"rectangle"===e||"square"===e?i=t[2]*t[3]:"triangle"===e&&(i=Math.abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2),this.width*this._pixelDensity),s=this.height*this._pixelDensity,a=[new DOMPoint(0,0),new DOMPoint(o,0),new DOMPoint(o,s),new DOMPoint(0,s)],l=(this._renderer.isP3D?new DOMMatrix(this._renderer.uMVMatrix.mat4):this.drawingContext.getTransform()).inverse(),c=a.map((function(e){return e.matrixTransform(l)})),u=Math.abs((c[3].x+c[0].x)*(c[3].y-c[0].y)+(c[0].x+c[1].x)*(c[0].y-c[1].y)+(c[1].x+c[2].x)*(c[1].y-c[2].y)+(c[2].x+c[3].x)*(c[2].y-c[3].y))/2;return Math.round(100*i/u)},e=n.default,r.default=e},{"../core/main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.fill":156,"core-js/modules/es.array.from":162,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.map":168,"core-js/modules/es.number.to-fixed":182,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/web.dom-collections.iterator":246}],266:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.concat"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.prototype._updateTextOutput=function(e){var t,r,n,i;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],n=function(e,t,r,n){return r="Your output is a, ".concat(r," by ").concat(n," pixels, ").concat(t," canvas containing the following"),1===e?"".concat(r," shape:"):"".concat(r," ").concat(e," shapes:")}((r=function(e,t){var r,n="",i=0;for(r in t)for(var o in t[r]){var s='<li><a href="#'.concat(e,"shape").concat(i,'">').concat(t[r][o].color," ").concat(r,"</a>");"line"===r?s+=", ".concat(t[r][o].pos,", ").concat(t[r][o].length," pixels long.</li>"):(s+=", at ".concat(t[r][o].pos),"point"!==r&&(s+=", covering ".concat(t[r][o].area,"% of the canvas")),s+=".</li>"),n+=s,i++}return{numShapes:i,listShapes:n}}(e,this.ingredients.shapes)).numShapes,this.ingredients.colors.background,this.width,this.height),i=function(e,t){var r,n="",i=0;for(r in t)for(var o in t[r]){var s='<tr id="'.concat(e,"shape").concat(i,'"><th>').concat(t[r][o].color," ").concat(r,"</th>");"line"===r?s+="<td>location = ".concat(t[r][o].pos,"</td><td>length = ").concat(t[r][o].length," pixels</td></tr>"):(s+="<td>location = ".concat(t[r][o].pos,"</td>"),"point"!==r&&(s+="<td> area = ".concat(t[r][o].area,"%</td>")),s+="</tr>"),n+=s,i++}return n}(e,this.ingredients.shapes),n!==t.summary.innerHTML&&(t.summary.innerHTML=n),r.listShapes!==t.list.innerHTML&&(t.list.innerHTML=r.listShapes),i!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=i),this._accessibleOutputs[e]=t)},e=e.default,r.default=e},{"../core/main":283,"core-js/modules/es.array.concat":153}],267:[function(e,t,r){"use strict";var n=(n=e("./core/main"))&&n.__esModule?n:{default:n};e("./core/constants"),e("./core/environment"),e("./core/friendly_errors/stacktrace"),e("./core/friendly_errors/validate_params"),e("./core/friendly_errors/file_errors"),e("./core/friendly_errors/fes_core"),e("./core/friendly_errors/sketch_reader"),e("./core/helpers"),e("./core/legacy"),e("./core/preload"),e("./core/p5.Element"),e("./core/p5.Graphics"),e("./core/p5.Renderer"),e("./core/p5.Renderer2D"),e("./core/rendering"),e("./core/shim"),e("./core/structure"),e("./core/transform"),e("./core/shape/2d_primitives"),e("./core/shape/attributes"),e("./core/shape/curves"),e("./core/shape/vertex"),e("./accessibility/outputs"),e("./accessibility/textOutput"),e("./accessibility/gridOutput"),e("./accessibility/color_namer"),e("./color/color_conversion"),e("./color/creating_reading"),e("./color/p5.Color"),e("./color/setting"),e("./data/p5.TypedDict"),e("./data/local_storage.js"),e("./dom/dom"),e("./accessibility/describe"),e("./events/acceleration"),e("./events/keyboard"),e("./events/mouse"),e("./events/touch"),e("./image/filters"),e("./image/image"),e("./image/loading_displaying"),e("./image/p5.Image"),e("./image/pixels"),e("./io/files"),e("./io/p5.Table"),e("./io/p5.TableRow"),e("./io/p5.XML"),e("./math/calculation"),e("./math/math"),e("./math/noise"),e("./math/p5.Vector"),e("./math/random"),e("./math/trigonometry"),e("./typography/attributes"),e("./typography/loading_displaying"),e("./typography/p5.Font"),e("./utilities/array_functions"),e("./utilities/conversion"),e("./utilities/string_functions"),e("./utilities/time_date"),e("./webgl/3d_primitives"),e("./webgl/interaction"),e("./webgl/light"),e("./webgl/loading"),e("./webgl/material"),e("./webgl/p5.Camera"),e("./webgl/p5.DataArray"),e("./webgl/p5.Geometry"),e("./webgl/p5.Matrix"),e("./webgl/p5.Quat"),e("./webgl/p5.RendererGL.Immediate"),e("./webgl/p5.RendererGL"),e("./webgl/p5.RendererGL.Retained"),e("./webgl/p5.Framebuffer"),e("./webgl/p5.Shader"),e("./webgl/p5.RenderBuffer"),e("./webgl/p5.Texture"),e("./webgl/text"),e("./core/init"),t.exports=n.default},{"./accessibility/color_namer":262,"./accessibility/describe":263,"./accessibility/gridOutput":264,"./accessibility/outputs":265,"./accessibility/textOutput":266,"./color/color_conversion":268,"./color/creating_reading":269,"./color/p5.Color":270,"./color/setting":271,"./core/constants":272,"./core/environment":273,"./core/friendly_errors/fes_core":274,"./core/friendly_errors/file_errors":275,"./core/friendly_errors/sketch_reader":276,"./core/friendly_errors/stacktrace":277,"./core/friendly_errors/validate_params":278,"./core/helpers":279,"./core/init":280,"./core/legacy":282,"./core/main":283,"./core/p5.Element":284,"./core/p5.Graphics":285,"./core/p5.Renderer":286,"./core/p5.Renderer2D":287,"./core/preload":288,"./core/rendering":289,"./core/shape/2d_primitives":290,"./core/shape/attributes":291,"./core/shape/curves":292,"./core/shape/vertex":293,"./core/shim":294,"./core/structure":295,"./core/transform":296,"./data/local_storage.js":297,"./data/p5.TypedDict":298,"./dom/dom":299,"./events/acceleration":300,"./events/keyboard":301,"./events/mouse":302,"./events/touch":303,"./image/filters":304,"./image/image":305,"./image/loading_displaying":306,"./image/p5.Image":307,"./image/pixels":308,"./io/files":309,"./io/p5.Table":310,"./io/p5.TableRow":311,"./io/p5.XML":312,"./math/calculation":313,"./math/math":314,"./math/noise":315,"./math/p5.Vector":316,"./math/random":317,"./math/trigonometry":318,"./typography/attributes":319,"./typography/loading_displaying":320,"./typography/p5.Font":321,"./utilities/array_functions":322,"./utilities/conversion":323,"./utilities/string_functions":324,"./utilities/time_date":325,"./webgl/3d_primitives":326,"./webgl/interaction":328,"./webgl/light":329,"./webgl/loading":330,"./webgl/material":331,"./webgl/p5.Camera":332,"./webgl/p5.DataArray":333,"./webgl/p5.Framebuffer":334,"./webgl/p5.Geometry":335,"./webgl/p5.Matrix":336,"./webgl/p5.Quat":337,"./webgl/p5.RenderBuffer":338,"./webgl/p5.RendererGL":341,"./webgl/p5.RendererGL.Immediate":339,"./webgl/p5.RendererGL.Retained":340,"./webgl/p5.Shader":342,"./webgl/p5.Texture":343,"./webgl/text":344}],268:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.ColorConversion={_hsbaToHSLA:function(e){var t=e[0],r=e[1],n=e[2],i=(2-r)*n/2;return 0!=i&&(1==i?r=0:i<.5?r/=2-r:r=r*n/(2-2*i)),[t,r,i,e[3]]},_hsbaToRGBA:function(e){var t,r,n,i,o,s=6*e[0],a=e[1],l=e[2];return 0===a?[l,l,l,e[3]]:(r=l*(1-a),n=l*(1-a*(s-(t=Math.floor(s)))),a=l*(1-a*(1+t-s)),s=1===t?(i=n,o=l,r):2===t?(i=r,o=l,a):3===t?(i=r,o=n,l):4===t?(i=a,o=r,l):5===t?(i=l,o=r,n):(i=l,o=a,r),[i,o,s,e[3]])},_hslaToHSBA:function(e){var t=e[0],r=e[1],n=e[2],i=n<.5?(1+r)*n:n+r-n*r;return[t,r=2*(i-n)/i,i,e[3]]},_hslaToRGBA:function(e){var t,r=6*e[0],n=e[1],i=e[2];return 0===n?[i,i,i,e[3]]:[(t=function(e,t,r){return e<0?e+=6:6<=e&&(e-=6),e<1?t+(r-t)*e:e<3?r:e<4?t+(r-t)*(4-e):t})(2+r,n=2*i-(i=i<.5?(1+n)*i:i+n-i*n),i),t(r,n,i),t(r-2,n,i),e[3]]},_rgbaToHSBA:function(e){var t,r,n=e[0],i=e[1],o=e[2],s=Math.max(n,i,o),a=s-Math.min(n,i,o);return 0==a?r=t=0:(r=a/s,n===s?t=(i-o)/a:i===s?t=2+(o-n)/a:o===s&&(t=4+(n-i)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,s,e[3]]},_rgbaToHSLA:function(e){var t,r,n,i=e[0],o=e[1],s=e[2],a=Math.max(i,o,s),l=a+(n=Math.min(i,o,s));return 0==(n=a-n)?r=t=0:(r=l<1?n/l:n/(2-l),i===a?t=(o-s)/n:o===a?t=2+(s-i)/n:s===a&&(t=4+(i-o)/n),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,l/2,e[3]]}},e=e.default.ColorConversion,r.default=e},{"../core/main":283}],269:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(l=e("../core/main"))&&l.__esModule?l:{default:l},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Color"),e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),o.default.prototype.alpha=function(e){return o.default._validateParameters("alpha",arguments),this.color(e)._getAlpha()},o.default.prototype.blue=function(e){return o.default._validateParameters("blue",arguments),this.color(e)._getBlue()},o.default.prototype.brightness=function(e){return o.default._validateParameters("brightness",arguments),this.color(e)._getBrightness()},o.default.prototype.color=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return o.default._validateParameters("color",r),r[0]instanceof o.default.Color?r[0]:(e=Array.isArray(r[0])?r[0]:r,new o.default.Color(this,e))},o.default.prototype.green=function(e){return o.default._validateParameters("green",arguments),this.color(e)._getGreen()},o.default.prototype.hue=function(e){return o.default._validateParameters("hue",arguments),this.color(e)._getHue()},o.default.prototype.lerpColor=function(e,t,r){o.default._validateParameters("lerpColor",arguments),e instanceof o.default.Color||(e=color(e)),t instanceof o.default.Color||(t=color(t));var n,i,a,l=this._colorMode,c=this._colorMaxes;if(l===s.RGB)i=e.levels.map((function(e){return e/255})),a=t.levels.map((function(e){return e/255}));else if(l===s.HSB)e._getBrightness(),t._getBrightness(),i=e.hsba,a=t.hsba;else{if(l!==s.HSL)throw new Error("".concat(l," cannot be used for interpolation."));e._getLightness(),t._getLightness(),i=e.hsla,a=t.hsla}return r=Math.max(Math.min(r,1),0),void 0===this.lerp&&(this.lerp=function(e,t,r){return r*(t-e)+e}),l===s.RGB?n=this.lerp(i[0],a[0],r):(.5<Math.abs(i[0]-a[0])&&(i[0]>a[0]?a[0]+=1:i[0]+=1),1<=(n=this.lerp(i[0],a[0],r))&&--n),e=this.lerp(i[1],a[1],r),t=this.lerp(i[2],a[2],r),i=this.lerp(i[3],a[3],r),n*=c[l][0],e*=c[l][1],t*=c[l][2],i*=c[l][3],this.color(n,e,t,i)},o.default.prototype.paletteLerp=function(e,t){var r=e[0];if(t<r[1])return this.color(r[0]);for(var n=1;n<e.length;n++){var i,o=e[n];if(t<o[1])return i=e[n-1],this.lerpColor(this.color(i[0]),this.color(o[0]),(t-i[1])/(o[1]-i[1]))}return this.color(e[e.length-1][0])},o.default.prototype.lightness=function(e){return o.default._validateParameters("lightness",arguments),this.color(e)._getLightness()},o.default.prototype.red=function(e){return o.default._validateParameters("red",arguments),this.color(e)._getRed()},o.default.prototype.saturation=function(e){return o.default._validateParameters("saturation",arguments),this.color(e)._getSaturation()};var l=o.default;r.default=l},{"../core/constants":272,"../core/friendly_errors/fes_core":274,"../core/friendly_errors/file_errors":275,"../core/friendly_errors/validate_params":278,"../core/main":283,"./p5.Color":270,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.map":168,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],270:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=c(e("../core/main")),s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants")),a=c(e("./color_conversion"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}function c(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var h={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},d=(e=/\s*/,/(\d{1,3})/),p=/((?:\d+(?:\.\d+)?)|(?:\.\d+))/,f=new RegExp("".concat(p.source,"%")),m={HEX3:/^#([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX4:/^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX6:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,HEX8:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,RGB:new RegExp(["^rgb\\(",d.source,",",d.source,",",d.source,"\\)$"].join(e.source),"i"),RGB_PERCENT:new RegExp(["^rgb\\(",f.source,",",f.source,",",f.source,"\\)$"].join(e.source),"i"),RGBA:new RegExp(["^rgba\\(",d.source,",",d.source,",",d.source,",",p.source,"\\)$"].join(e.source),"i"),RGBA_PERCENT:new RegExp(["^rgba\\(",f.source,",",f.source,",",f.source,",",p.source,"\\)$"].join(e.source),"i"),HSL:new RegExp(["^hsl\\(",d.source,",",f.source,",",f.source,"\\)$"].join(e.source),"i"),HSLA:new RegExp(["^hsla\\(",d.source,",",f.source,",",f.source,",",p.source,"\\)$"].join(e.source),"i"),HSB:new RegExp(["^hsb\\(",d.source,",",f.source,",",f.source,"\\)$"].join(e.source),"i"),HSBA:new RegExp(["^hsba\\(",d.source,",",f.source,",",f.source,",",p.source,"\\)$"].join(e.source),"i")};o.default.Color=function(){function e(t,r){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");if(this._storeModeAndMaxes(t._colorMode,t._colorMaxes),![s.RGB,s.HSL,s.HSB].includes(this.mode))throw new Error("".concat(this.mode," is an invalid colorMode."));this._array=e._parseInputs.apply(this,r),this._calculateLevels()}var t,r,n;return t=e,n=[{key:"_parseInputs",value:function(t,r,n,i){var o,l=arguments.length,c=this.mode,u=this.maxes[c],d=[];if(3<=l){for(d[0]=t/u[0],d[1]=r/u[1],d[2]=n/u[2],d[3]="number"==typeof i?i/u[3]:1,o=d.length-1;0<=o;--o){var p=d[o];p<0?d[o]=0:1<p&&(d[o]=1)}return c===s.HSL?a.default._hslaToRGBA(d):c===s.HSB?a.default._hsbaToRGBA(d):d}if(1===l&&"string"==typeof t){if(n=t.trim().toLowerCase(),h[n])return e._parseInputs.call(this,h[n]);if(m.HEX3.test(n))return(d=m.HEX3.exec(n).slice(1).map((function(e){return parseInt(e+e,16)/255})))[3]=1,d;if(m.HEX6.test(n))return(d=m.HEX6.exec(n).slice(1).map((function(e){return parseInt(e,16)/255})))[3]=1,d;if(m.HEX4.test(n))return m.HEX4.exec(n).slice(1).map((function(e){return parseInt(e+e,16)/255}));if(m.HEX8.test(n))return m.HEX8.exec(n).slice(1).map((function(e){return parseInt(e,16)/255}));if(m.RGB.test(n))return(d=m.RGB.exec(n).slice(1).map((function(e){return e/255})))[3]=1,d;if(m.RGB_PERCENT.test(n))return(d=m.RGB_PERCENT.exec(n).slice(1).map((function(e){return parseFloat(e)/100})))[3]=1,d;if(m.RGBA.test(n))return m.RGBA.exec(n).slice(1).map((function(e,t){return 3===t?parseFloat(e):e/255}));if(m.RGBA_PERCENT.test(n))return m.RGBA_PERCENT.exec(n).slice(1).map((function(e,t){return 3===t?parseFloat(e):parseFloat(e)/100}));if(m.HSL.test(n)?(d=m.HSL.exec(n).slice(1).map((function(e,t){return 0===t?parseInt(e,10)/360:parseInt(e,10)/100})))[3]=1:m.HSLA.test(n)&&(d=m.HSLA.exec(n).slice(1).map((function(e,t){return 0===t?parseInt(e,10)/360:3===t?parseFloat(e):parseInt(e,10)/100}))),(d=d.map((function(e){return Math.max(Math.min(e,1),0)}))).length)return a.default._hslaToRGBA(d);if(m.HSB.test(n)?(d=m.HSB.exec(n).slice(1).map((function(e,t){return 0===t?parseInt(e,10)/360:parseInt(e,10)/100})))[3]=1:m.HSBA.test(n)&&(d=m.HSBA.exec(n).slice(1).map((function(e,t){return 0===t?parseInt(e,10)/360:3===t?parseFloat(e):parseInt(e,10)/100}))),d.length){for(o=d.length-1;0<=o;--o)d[o]=Math.max(Math.min(d[o],1),0);return a.default._hsbaToRGBA(d)}d=[1,1,1,1]}else{if(1!==l&&2!==l||"number"!=typeof t)throw new Error("".concat(arguments,"is not a valid color representation."));d[0]=t/u[2],d[1]=t/u[2],d[2]=t/u[2],d[3]="number"==typeof r?r/u[3]:1,d=d.map((function(e){return Math.max(Math.min(e,1),0)}))}return d}}],(r=[{key:"toString",value:function(e){var t=this.levels,r=this._array,n=r[3];switch(e){case"#rrggbb":return"#".concat(t[0]<16?"0".concat(t[0].toString(16)):t[0].toString(16),t[1]<16?"0".concat(t[1].toString(16)):t[1].toString(16),t[2]<16?"0".concat(t[2].toString(16)):t[2].toString(16));case"#rrggbbaa":return"#".concat(t[0]<16?"0".concat(t[0].toString(16)):t[0].toString(16),t[1]<16?"0".concat(t[1].toString(16)):t[1].toString(16),t[2]<16?"0".concat(t[2].toString(16)):t[2].toString(16),t[3]<16?"0".concat(t[3].toString(16)):t[3].toString(16));case"#rgb":return"#".concat(Math.round(15*r[0]).toString(16),Math.round(15*r[1]).toString(16),Math.round(15*r[2]).toString(16));case"#rgba":return"#".concat(Math.round(15*r[0]).toString(16),Math.round(15*r[1]).toString(16),Math.round(15*r[2]).toString(16),Math.round(15*r[3]).toString(16));case"rgb":return"rgb(".concat(t[0],", ",t[1],", ",t[2],")");case"rgb%":return"rgb(".concat((100*r[0]).toPrecision(3),"%, ",(100*r[1]).toPrecision(3),"%, ",(100*r[2]).toPrecision(3),"%)");case"rgba%":return"rgba(".concat((100*r[0]).toPrecision(3),"%, ",(100*r[1]).toPrecision(3),"%, ",(100*r[2]).toPrecision(3),"%, ",(100*r[3]).toPrecision(3),"%)");case"hsb":case"hsv":return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),"hsb(".concat(this.hsba[0]*this.maxes[s.HSB][0],", ",this.hsba[1]*this.maxes[s.HSB][1],", ",this.hsba[2]*this.maxes[s.HSB][2],")");case"hsb%":case"hsv%":return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),"hsb(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%)");case"hsba":case"hsva":return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),"hsba(".concat(this.hsba[0]*this.maxes[s.HSB][0],", ",this.hsba[1]*this.maxes[s.HSB][1],", ",this.hsba[2]*this.maxes[s.HSB][2],", ",n,")");case"hsba%":case"hsva%":return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),"hsba(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%, ",(100*n).toPrecision(3),"%)");case"hsl":return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),"hsl(".concat(this.hsla[0]*this.maxes[s.HSL][0],", ",this.hsla[1]*this.maxes[s.HSL][1],", ",this.hsla[2]*this.maxes[s.HSL][2],")");case"hsl%":return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%)");case"hsla":return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),"hsla(".concat(this.hsla[0]*this.maxes[s.HSL][0],", ",this.hsla[1]*this.maxes[s.HSL][1],", ",this.hsla[2]*this.maxes[s.HSL][2],", ",n,")");case"hsla%":return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%, ",(100*n).toPrecision(3),"%)");default:return"rgba(".concat(t[0],",",t[1],",",t[2],",",n,")")}}},{key:"setRed",value:function(e){this._array[0]=e/this.maxes[s.RGB][0],this._calculateLevels()}},{key:"setGreen",value:function(e){this._array[1]=e/this.maxes[s.RGB][1],this._calculateLevels()}},{key:"setBlue",value:function(e){this._array[2]=e/this.maxes[s.RGB][2],this._calculateLevels()}},{key:"setAlpha",value:function(e){this._array[3]=e/this.maxes[this.mode][3],this._calculateLevels()}},{key:"_calculateLevels",value:function(){for(var e=this._array,t=this.levels=new Array(e.length),r=e.length-1;0<=r;--r)t[r]=Math.round(255*e[r]);this.hsla=null,this.hsba=null}},{key:"_getAlpha",value:function(){return this._array[3]*this.maxes[this.mode][3]}},{key:"_storeModeAndMaxes",value:function(e,t){this.mode=e,this.maxes=t}},{key:"_getMode",value:function(){return this.mode}},{key:"_getMaxes",value:function(){return this.maxes}},{key:"_getBlue",value:function(){return this._array[2]*this.maxes[s.RGB][2]}},{key:"_getBrightness",value:function(){return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),this.hsba[2]*this.maxes[s.HSB][2]}},{key:"_getGreen",value:function(){return this._array[1]*this.maxes[s.RGB][1]}},{key:"_getHue",value:function(){return this.mode===s.HSB?(this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),this.hsba[0]*this.maxes[s.HSB][0]):(this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),this.hsla[0]*this.maxes[s.HSL][0])}},{key:"_getLightness",value:function(){return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),this.hsla[2]*this.maxes[s.HSL][2]}},{key:"_getRed",value:function(){return this._array[0]*this.maxes[s.RGB][0]}},{key:"_getSaturation",value:function(){return this.mode===s.HSB?(this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),this.hsba[1]*this.maxes[s.HSB][1]):(this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),this.hsla[1]*this.maxes[s.HSL][1])}}])&&u(t.prototype,r),n&&u(t,n),e}(),d=o.default.Color,r.default=d},{"../core/constants":272,"../core/main":283,"./color_conversion":268,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.join":166,"core-js/modules/es.array.map":168,"core-js/modules/es.array.slice":169,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.constructor":194,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.includes":199,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.trim":209,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],271:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.fill"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(l=e("../core/main"))&&l.__esModule?l:{default:l},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Color"),o.default.prototype.beginClip=function(){this._renderer.beginClip(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{})},o.default.prototype.endClip=function(){this._renderer.endClip()},o.default.prototype.clip=function(e,t){this._renderer.beginClip(t),e(),this._renderer.endClip(t)},o.default.prototype.background=function(){var e;return(e=this._renderer).background.apply(e,arguments),this},o.default.prototype.clear=function(){return this._renderer.clear((arguments.length<=0?void 0:arguments[0])||0,(arguments.length<=1?void 0:arguments[1])||0,(arguments.length<=2?void 0:arguments[2])||0,(arguments.length<=3?void 0:arguments[3])||0),this},o.default.prototype.colorMode=function(e,t,r,n,i){return o.default._validateParameters("colorMode",arguments),e!==s.RGB&&e!==s.HSB&&e!==s.HSL||(this._colorMode=e,e=this._colorMaxes[e],2===arguments.length?(e[0]=t,e[1]=t,e[2]=t,e[3]=t):4===arguments.length?(e[0]=t,e[1]=r,e[2]=n):5===arguments.length&&(e[0]=t,e[1]=r,e[2]=n,e[3]=i)),this},o.default.prototype.fill=function(){var e;return this._renderer._setProperty("_fillSet",!0),this._renderer._setProperty("_doFill",!0),(e=this._renderer).fill.apply(e,arguments),this},o.default.prototype.noFill=function(){return this._renderer._setProperty("_doFill",!1),this},o.default.prototype.noStroke=function(){return this._renderer._setProperty("_doStroke",!1),this},o.default.prototype.stroke=function(){var e;return this._renderer._setProperty("_strokeSet",!0),this._renderer._setProperty("_doStroke",!0),(e=this._renderer).stroke.apply(e,arguments),this},o.default.prototype.erase=function(){return this._renderer.erase(0<arguments.length&&void 0!==arguments[0]?arguments[0]:255,1<arguments.length&&void 0!==arguments[1]?arguments[1]:255),this},o.default.prototype.noErase=function(){return this._renderer.noErase(),this};var l=o.default;r.default=l},{"../core/constants":272,"../core/main":283,"./p5.Color":270,"core-js/modules/es.array.fill":156,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],272:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.QUADRATIC=r.LINEAR=r._CTX_MIDDLE=r._DEFAULT_LEADMULT=r._DEFAULT_TEXT_FILL=r.WORD=r.CHAR=r.BOLDITALIC=r.BOLD=r.ITALIC=r.NORMAL=r.BLUR=r.ERODE=r.DILATE=r.POSTERIZE=r.INVERT=r.OPAQUE=r.GRAY=r.THRESHOLD=r.BURN=r.DODGE=r.SOFT_LIGHT=r.HARD_LIGHT=r.OVERLAY=r.REPLACE=r.SCREEN=r.MULTIPLY=r.EXCLUSION=r.SUBTRACT=r.DIFFERENCE=r.LIGHTEST=r.DARKEST=r.ADD=r.REMOVE=r.BLEND=r.UP_ARROW=r.TAB=r.SHIFT=r.RIGHT_ARROW=r.RETURN=r.OPTION=r.LEFT_ARROW=r.ESCAPE=r.ENTER=r.DOWN_ARROW=r.DELETE=r.CONTROL=r.BACKSPACE=r.ALT=r.AUTO=r.HSL=r.HSB=r.RGB=r.MITER=r.BEVEL=r.ROUND=r.SQUARE=r.PROJECT=r.PIE=r.CHORD=r.OPEN=r.CLOSE=r.TESS=r.QUAD_STRIP=r.QUADS=r.TRIANGLE_STRIP=r.TRIANGLE_FAN=r.TRIANGLES=r.LINE_LOOP=r.LINE_STRIP=r.LINES=r.POINTS=r.BASELINE=r.BOTTOM=r.TOP=r.CENTER=r.LEFT=r.RIGHT=r.RADIUS=r.CORNERS=r.CORNER=r.RAD_TO_DEG=r.DEG_TO_RAD=r.RADIANS=r.DEGREES=r.TWO_PI=r.TAU=r.QUARTER_PI=r.PI=r.HALF_PI=r.WAIT=r.TEXT=r.MOVE=r.HAND=r.CROSS=r.ARROW=r.WEBGL2=r.WEBGL=r.P2D=r.VERSION=void 0,r.RGBA=r.HALF_FLOAT=r.FLOAT=r.UNSIGNED_INT=r.UNSIGNED_BYTE=r.COVER=r.CONTAIN=r.FALLBACK=r.LABEL=r.AXES=r.GRID=r._DEFAULT_FILL=r._DEFAULT_STROKE=r.PORTRAIT=r.LANDSCAPE=r.SMOOTH=r.FLAT=r.MIRROR=r.CLAMP=r.REPEAT=r.NEAREST=r.IMAGE=r.IMMEDIATE=r.TEXTURE=r.FILL=r.STROKE=r.CURVE=r.BEZIER=void 0;var n=Math.PI,i=(r.VERSION="1.11.3",r.P2D="p2d",r.WEBGL="webgl",r.WEBGL2="webgl2",r.ARROW="default",r.CROSS="crosshair",r.HAND="pointer",r.MOVE="move",r.TEXT="text",r.WAIT="wait",n/2);r.HALF_PI=i,i=n,r.PI=i,i=n/4,r.QUARTER_PI=i,i=2*n,r.TAU=i,i=2*n,r.TWO_PI=i,r.DEGREES="degrees",r.RADIANS="radians",i=n/180,r.DEG_TO_RAD=i,i=180/n,r.RAD_TO_DEG=i,r.CORNER="corner",r.CORNERS="corners",r.RADIUS="radius",r.RIGHT="right",r.LEFT="left",r.CENTER="center",r.TOP="top",r.BOTTOM="bottom",r.BASELINE="alphabetic",r.POINTS=0,r.LINES=1,r.LINE_STRIP=3,r.LINE_LOOP=2,r.TRIANGLES=4,r.TRIANGLE_FAN=6,r.TRIANGLE_STRIP=5,r.QUADS="quads",r.QUAD_STRIP="quad_strip",r.TESS="tess",r.CLOSE="close",r.OPEN="open",r.CHORD="chord",r.PIE="pie",r.PROJECT="square",r.SQUARE="butt",r.ROUND="round",r.BEVEL="bevel",r.MITER="miter",r.RGB="rgb",r.HSB="hsb",r.HSL="hsl",r.AUTO="auto",r.ALT=18,r.BACKSPACE=8,r.CONTROL=17,r.DELETE=46,r.DOWN_ARROW=40,r.ENTER=13,r.ESCAPE=27,r.LEFT_ARROW=37,r.OPTION=18,r.RETURN=13,r.RIGHT_ARROW=39,r.SHIFT=16,r.TAB=9,r.UP_ARROW=38,r.BLEND="source-over",r.REMOVE="destination-out",r.ADD="lighter",r.DARKEST="darken",r.LIGHTEST="lighten",r.DIFFERENCE="difference",r.SUBTRACT="subtract",r.EXCLUSION="exclusion",r.MULTIPLY="multiply",r.SCREEN="screen",r.REPLACE="copy",r.OVERLAY="overlay",r.HARD_LIGHT="hard-light",r.SOFT_LIGHT="soft-light",r.DODGE="color-dodge",r.BURN="color-burn",r.THRESHOLD="threshold",r.GRAY="gray",r.OPAQUE="opaque",r.INVERT="invert",r.POSTERIZE="posterize",r.DILATE="dilate",r.ERODE="erode",r.BLUR="blur",r.NORMAL="normal",r.ITALIC="italic",r.BOLD="bold",r.BOLDITALIC="bold italic",r.CHAR="CHAR",r.WORD="WORD",r._DEFAULT_TEXT_FILL="#000000",r._DEFAULT_LEADMULT=1.25,r._CTX_MIDDLE="middle",r.LINEAR="linear",r.QUADRATIC="quadratic",r.BEZIER="bezier",r.CURVE="curve",r.STROKE="stroke",r.FILL="fill",r.TEXTURE="texture",r.IMMEDIATE="immediate",r.IMAGE="image",r.NEAREST="nearest",r.REPEAT="repeat",r.CLAMP="clamp",r.MIRROR="mirror",r.FLAT="flat",r.SMOOTH="smooth",r.LANDSCAPE="landscape",r.PORTRAIT="portrait",r._DEFAULT_STROKE="#000000",r._DEFAULT_FILL="#FFFFFF",r.GRID="grid",r.AXES="axes",r.LABEL="label",r.FALLBACK="fallback",r.CONTAIN="contain",r.COVER="cover",r.UNSIGNED_BYTE="unsigned-byte",r.UNSIGNED_INT="unsigned-int",r.FLOAT="float",r.HALF_FLOAT="half-float",r.RGBA="rgba"},{}],273:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.search"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.search"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(s=e("./main"))&&s.__esModule?s:{default:s},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}var l=[s.ARROW,s.CROSS,s.HAND,s.MOVE,s.TEXT,s.WAIT],c=(o.default.prototype._frameRate=0,o.default.prototype._lastFrameTime=window.performance.now(),o.default.prototype._targetFrameRate=60,window.print),u=!1;function h(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}function d(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}o.default.prototype.print=function(){var e;arguments.length?(e=console).log.apply(e,arguments):u||(c(),window.confirm("You just tried to print the webpage. Do you want to prevent this from running again?")&&(u=!0))},o.default.prototype.frameCount=0,o.default.prototype.deltaTime=0,o.default.prototype.focused=document.hasFocus(),o.default.prototype.cursor=function(e,t,r){var n,i="auto",o=this._curElement.elt;l.includes(e)?i=e:"string"==typeof e&&(n="",t&&r&&"number"==typeof t&&"number"==typeof r&&(n="".concat(t," ").concat(r)),i="http://"===e.substring(0,7)||"https://"===e.substring(0,8)||/\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(e)?"url(".concat(e,") ").concat(n,", auto"):e),o.style.cursor=i},o.default.prototype.frameRate=function(e){return o.default._validateParameters("frameRate",arguments),"number"!=typeof e||e<0?this._frameRate:(this._setProperty("_targetFrameRate",e),0===e&&this._setProperty("_frameRate",e),this)},o.default.prototype.getFrameRate=function(){return this.frameRate()},o.default.prototype.setFrameRate=function(e){return this.frameRate(e)},o.default.prototype.getTargetFrameRate=function(){return this._targetFrameRate},o.default.prototype.noCursor=function(){this._curElement.elt.style.cursor="none"},o.default.prototype.webglVersion=s.P2D,o.default.prototype.displayWidth=screen.width,o.default.prototype.displayHeight=screen.height,o.default.prototype.windowWidth=0,o.default.prototype.windowHeight=0,o.default.prototype._onresize=function(e){this._setProperty("windowWidth",h()),this._setProperty("windowHeight",d());var t=this._isGlobal?window:this;"function"!=typeof t.windowResized||void 0===(t=t.windowResized(e))||t||e.preventDefault()},o.default.prototype._updateWindowSize=function(){this._setProperty("windowWidth",h()),this._setProperty("windowHeight",d())},o.default.prototype.width=0,o.default.prototype.height=0,o.default.prototype.fullscreen=function(e){if(o.default._validateParameters("fullscreen",arguments),void 0===e)return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;if(e){if(e=document.documentElement,!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled))throw new Error("Fullscreen not enabled in this browser.");e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()}else document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()},o.default.prototype.pixelDensity=function(e){var t;return o.default._validateParameters("pixelDensity",arguments),"number"==typeof e?(e!==this._pixelDensity&&(this._pixelDensity=this._maxAllowedPixelDimensions=e),(t=this).resizeCanvas(this.width,this.height,!0)):t=this._pixelDensity,t},o.default.prototype.displayDensity=function(){return window.devicePixelRatio},o.default.prototype.getURL=function(){return location.href},o.default.prototype.getURLPath=function(){return location.pathname.split("/").filter((function(e){return""!==e}))},o.default.prototype.getURLParams=function(){for(var e,t=/[?&]([^&=]+)(?:[&=])([^&=]+)/gim,r={};null!=(e=t.exec(location.search));)e.index===t.lastIndex&&t.lastIndex++,r[e[1]]=e[2];return r},e=o.default,r.default=e},{"./constants":272,"./main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.filter":157,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.string.includes":199,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.search":205,"core-js/modules/es.string.split":206,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],274:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-names"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.starts-with"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-names"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.starts-with"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(l=e("../main"))&&l.__esModule?l:{default:l};function i(e,t){t=t||console.log.bind(console),o||s(),o.some((function(r){var n;if(e.message&&null!==e.message.match("\\W?".concat(r.name,"\\W")))return n="function"===r.type?"".concat(r.name,"()"):r.name,t("Did you just try to use p5.js's ".concat(n," ").concat(r.type,"? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: ").concat(a)),!0}))}e("../internationalization");var o=null,s=null,a=(n.default._friendlyError=n.default._checkForUserDefinedFunctions=n.default._fesErrorMonitor=function(){},o=null,"https://github.com/processing/p5.js/wiki/p5.js-overview#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup"),l=(s=function(){function t(e){return Object.getOwnPropertyNames(e).filter((function(e){return"_"!==e[0]&&!(e in r)&&(r[e]=!0)})).map((function(t){var r="function"==typeof e[t]?"function":t===t.toUpperCase()?"constant":"variable";return{name:t,type:r}}))}var r={};(o=[].concat(t(n.default.prototype),t(e("../constants")))).sort((function(e,t){return t.name.length-e.name.length}))},n.default.prototype._helpForMisusedAtTopLevelCode=i,"complete"!==document.readyState&&(window.addEventListener("error",i,!1),window.addEventListener("load",(function(){window.removeEventListener("error",i,!1)}))),n.default);r.default=l},{"../constants":272,"../internationalization":281,"../main":283,"./browser_errors":void 0,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.filter":157,"core-js/modules/es.array.for-each":161,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.join":166,"core-js/modules/es.array.map":168,"core-js/modules/es.array.slice":169,"core-js/modules/es.array.some":170,"core-js/modules/es.function.name":174,"core-js/modules/es.object.assign":183,"core-js/modules/es.object.get-own-property-names":187,"core-js/modules/es.object.keys":189,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.constructor":194,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.match":201,"core-js/modules/es.string.replace":204,"core-js/modules/es.string.split":206,"core-js/modules/es.string.starts-with":207,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/web.dom-collections.for-each":245,"core-js/modules/web.dom-collections.iterator":246}],275:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(n=e("../main"))&&n.__esModule?n:{default:n};e("../internationalization"),n.default._friendlyFileLoadError=function(){},e=n.default,r.default=e},{"../internationalization":281,"../main":283}],276:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(e("../main"));function s(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,s=function(){return e},e)}e("../internationalization"),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r,n,o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&((n=a?Object.getOwnPropertyDescriptor(e,r):null)&&(n.get||n.set)?Object.defineProperty(o,r,n):o[r]=e[r]);o.default=e,t&&t.set(e,o)}(e("../constants")),o.default._fesCodeReader=function(){};var a=o.default;r.default=a},{"../constants":272,"../internationalization":281,"../main":283,"core-js/modules/es.array.filter":157,"core-js/modules/es.array.for-each":161,"core-js/modules/es.array.from":162,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.index-of":164,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.join":166,"core-js/modules/es.array.map":168,"core-js/modules/es.array.slice":169,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.keys":189,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.constructor":194,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.includes":199,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.match":201,"core-js/modules/es.string.split":206,"core-js/modules/es.string.trim":209,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.for-each":245,"core-js/modules/web.dom-collections.iterator":246}],277:[function(e,t,r){"use strict";function n(){var e=/(^|@)\S+:\d+/,t=/^\s*at .*(\S+:\d+|\(native\))/m,r=/^(eval@)?(\[native code])?$/;return{parse:function(e){return void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(t)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):void 0},extractLocation:function(e){return-1===e.indexOf(":")?[e]:[(e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,"")))[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(t)}),this).map((function(e){var t=(r=(e=-1<e.indexOf("(eval ")?e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""):e).replace(/^\s+/,"").replace(/\(eval code/g,"(")).match(/ (\((.+):(\d+):(\d+)\)$)/),r=(r=t?r.replace(t[0],""):r).split(/\s+/).slice(1);return t=this.extractLocation(t?t[1]:r.pop()),{functionName:r.join(" ")||void 0,fileName:-1<["eval","<anonymous>"].indexOf(t[0])?void 0:t[0],lineNumber:t[1],columnNumber:t[2],source:e}}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(r)}),this).map((function(e){var t,r;return-1===(e=-1<e.indexOf(" > eval")?e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1"):e).indexOf("@")&&-1===e.indexOf(":")?{functionName:e}:{functionName:(r=e.match(t=/((.*".+"[^@]*)?[^@]*)(?:@)/))&&r[1]?r[1]:void 0,fileName:(r=this.extractLocation(e.replace(t,"")))[0],lineNumber:r[1],columnNumber:r[2],source:e}}),this)},parseOpera:function(e){return!e.stacktrace||-1<e.message.indexOf("\n")&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],i=2,o=r.length;i<o;i+=2){var s=t.exec(r[i]);s&&n.push({fileName:s[2],lineNumber:s[1],source:r[i]})}return n},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],i=0,o=r.length;i<o;i+=2){var s=t.exec(r[i]);s&&n.push({functionName:s[3]||void 0,fileName:s[2],lineNumber:s[1],source:r[i]})}return n},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(e)&&!t.match(/^Error created at/)}),this).map((function(e){var t,r=e.split("@"),n=this.extractLocation(r.pop());return{functionName:(r=r.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,args:void 0===(t=r.match(/\(([^)]*)\)/)?r.replace(/^[^(]+\(([^)]*)\)$/,"$1"):t)||"[arguments not available]"===t?void 0:t.split(","),fileName:n[0],lineNumber:n[1],columnNumber:n[2],source:e}}),this)}}}e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../main"))&&e.__esModule?e:{default:e}).default._getErrorStackParser=function(){return new n},e=e.default,r.default=e},{"../main":283,"core-js/modules/es.array.filter":157,"core-js/modules/es.array.index-of":164,"core-js/modules/es.array.join":166,"core-js/modules/es.array.map":168,"core-js/modules/es.array.slice":169,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.string.match":201,"core-js/modules/es.string.replace":204,"core-js/modules/es.string.split":206}],278:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=(i=e("../main"))&&i.__esModule?i:{default:i};function o(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,o=function(){return e},e)}function s(e){return(s="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}(function(e){if(!(e&&e.__esModule||null===e||"object"!==s(e)&&"function"!=typeof e)){var t=o();if(t&&t.has(e))return t.get(e);var r,n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var a;Object.prototype.hasOwnProperty.call(e,r)&&((a=i?Object.getOwnPropertyDescriptor(e,r):null)&&(a.get||a.set)?Object.defineProperty(n,r,a):n[r]=e[r])}n.default=e,t&&t.set(e,n)}})(e("../constants")),e("../internationalization"),i.default._validateParameters=i.default._clearValidateParamsCache=function(){},e=i.default,r.default=e},{"../../../docs/parameterData.json":void 0,"../constants":272,"../internationalization":281,"../main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.for-each":161,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.index-of":164,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.join":166,"core-js/modules/es.array.last-index-of":167,"core-js/modules/es.array.map":168,"core-js/modules/es.array.slice":169,"core-js/modules/es.function.name":174,"core-js/modules/es.map":175,"core-js/modules/es.number.constructor":179,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.get-prototype-of":188,"core-js/modules/es.object.keys":189,"core-js/modules/es.object.to-string":190,"core-js/modules/es.reflect.construct":192,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.set":197,"core-js/modules/es.string.includes":199,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.split":206,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.for-each":245,"core-js/modules/web.dom-collections.iterator":246}],279:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var a;Object.prototype.hasOwnProperty.call(e,r)&&((a=o?Object.getOwnPropertyDescriptor(e,r):null)&&(a.get||a.set)?Object.defineProperty(n,r,a):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("./constants"));function s(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,s=function(){return e},e)}r.default={modeAdjust:function(e,t,r,n,i){var s;return i===o.CORNER?s={x:e,y:t,w:Math.abs(r),h:Math.abs(n)}:i===o.CORNERS?s={x:Math.min(e,r),y:Math.min(t,n),w:Math.abs(r-e),h:Math.abs(n-t)}:i===o.RADIUS?s={x:e-(r=Math.abs(r)),y:t-(n=Math.abs(n)),w:2*r,h:2*n}:i===o.CENTER&&(s={x:e-.5*(r=Math.abs(r)),y:t-.5*(n=Math.abs(n)),w:r,h:n}),s}}},{"./constants":272,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],280:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var n=(i=e("../core/main"))&&i.__esModule?i:{default:i};e("./internationalization");var i=Promise.resolve();Promise.all([new Promise((function(e,t){"complete"===document.readyState?e():window.addEventListener("load",e,!1)})),i]).then((function(){var e;void 0!==window._setupDone?console.warn("p5.js seems to have been imported multiple times. Please remove the duplicate import"):window.mocha||(e=new Event("p5Ready"),window.dispatchEvent(e),(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!n.default.instance&&new n.default)}))},{"../core/main":283,"./internationalization":281,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.to-string":190,"core-js/modules/es.promise":191,"core-js/modules/es.string.iterator":200,"core-js/modules/web.dom-collections.iterator":246}],281:[function(e,t,r){"use strict";e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.setTranslatorLanguage=r.currentTranslatorLanguage=r.availableTranslatorLanguages=r.initialize=r.translator=void 0;var n,i=s(e("i18next")),o=s(e("i18next-browser-languagedetector"));function s(e){return e&&e.__esModule?e:{default:e}}var a=function(){function e(t,r){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.init(t,r)}var t;return(t=[{key:"fetchWithTimeout",value:function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:2e3;return Promise.race([fetch(e,t),new Promise((function(e,t){return setTimeout((function(){return t(new Error("timeout"))}),r)}))])}},{key:"init",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};this.services=e,this.options=t}},{key:"read",value:function(e,t,r){var i=this.options.loadPath;e===this.options.fallback?r(null,n[e][t]):(void 0).includes(e)?(i=this.services.interpolator.interpolate(i,{lng:e,ns:t}),this.loadUrl(i,r)):r("Not found",!1)}},{key:"loadUrl",value:function(e,t){this.fetchWithTimeout(e).then((function(t){if(t.ok)return t.json();throw new Error("failed loading ".concat(e))}),(function(){throw new Error("failed loading ".concat(e))})).then((function(e){return t(null,e)})).catch(t)}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}();a.type="backend",r.translator=function(e,t){console.debug("p5.js translator called before translations were loaded"),i.default.t(e,t)},r.initialize=function(){return i.default.use(o.default).use(a).init({fallbackLng:"en",nestingPrefix:"$tr(",nestingSuffix:")",defaultNS:"translation",returnEmptyString:!1,interpolation:{escapeValue:!1},detection:{checkWhitelist:!1,order:["querystring","navigator","htmlTag","path","subdomain"],caches:[]},backend:{fallback:"en",loadPath:"https://cdn.jsdelivr.net/npm/p5/translations/{{lng}}/{{ns}}.json"},partialBundledLanguages:!0,resources:n}).then((function(e){r.translator=e}),(function(e){return console.debug("Translations failed to load (".concat(e,")"))}))},r.availableTranslatorLanguages=function(){return i.default.languages},r.currentTranslatorLanguage=function(e){return i.default.language},r.setTranslatorLanguage=function(e){return i.default.changeLanguage(e||void 0,(function(e){return console.debug("Translations failed to load (".concat(e,")"))}))}},{"../../translations":void 0,"../../translations/dev":void 0,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.join":166,"core-js/modules/es.array.slice":169,"core-js/modules/es.object.keys":189,"core-js/modules/es.object.to-string":190,"core-js/modules/es.promise":191,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.string.includes":199,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.split":206,"core-js/modules/web.dom-collections.iterator":246,i18next:3,"i18next-browser-languagedetector":3}],282:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("./main"))&&e.__esModule?e:{default:e}).default.prototype.pushStyle=function(){throw new Error("pushStyle() not used, see push()")},e.default.prototype.popStyle=function(){throw new Error("popStyle() not used, see pop()")},e.default.prototype.popMatrix=function(){throw new Error("popMatrix() not used, see pop()")},e.default.prototype.pushMatrix=function(){throw new Error("pushMatrix() not used, see push()")},e=e.default,r.default=e},{"./main":283}],283:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-own-property-names"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.get-own-property-names"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,e("./shim");var o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var a;Object.prototype.hasOwnProperty.call(e,r)&&((a=o?Object.getOwnPropertyDescriptor(e,r):null)&&(a.get||a.set)?Object.defineProperty(n,r,a):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("./constants"));function s(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,s=function(){return e},e)}var a,l=function(){function e(t,r){var n=this;if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this._setupDone=!1,this._preloadDone=!1,this._pixelDensity=Math.ceil(window.devicePixelRatio)||1,this._maxAllowedPixelDimensions=0,this._userNode=r,this._curElement=null,this._elements=[],this._glAttributes=null,this._requestAnimId=0,this._preloadCount=0,this._isGlobal=!1,this._loop=!0,this._startListener=null,this._initializeInstanceVariables(),this._defaultCanvasSize={width:100,height:100},this._events={mousemove:null,mousedown:null,mouseup:null,dragend:null,dragover:null,click:null,dblclick:null,mouseover:null,mouseout:null,keydown:null,keyup:null,keypress:null,touchstart:null,touchmove:null,touchend:null,resize:null,blur:null},this._millisStart=-1,this._recording=!1,this.touchstart=!1,this.touchend=!1,this._lcg_random_state=null,this._gaussian_previous=!1,this._events.wheel=null,this._loadingScreenId="p5_loading",this._registeredMethods={},r=Object.getOwnPropertyNames(e.prototype._registeredMethods);var i=!0,o=!1,s=void 0;try{for(var a,l=r[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var c=a.value;this._registeredMethods[c]=e.prototype._registeredMethods[c].slice()}}catch(t){o=!0,s=t}finally{try{i||null==l.return||l.return()}finally{if(o)throw s}}window.DeviceOrientationEvent&&(this._events.deviceorientation=null),window.DeviceMotionEvent&&!window._isNodeWebkit&&(this._events.devicemotion=null),e.prototype.callRegisteredHooksFor=function(t){var r=this||e.prototype,n=this._isGlobal?window:this;if(r._registeredMethods.hasOwnProperty(t)){r=r._registeredMethods[t];var i=!0,o=void(t=!1);try{for(var s,a=r[Symbol.iterator]();!(i=(s=a.next()).done);i=!0){var l=s.value;"function"==typeof l&&l.call(n)}}catch(r){t=!0,o=r}finally{try{i||null==a.return||a.return()}finally{if(t)throw o}}}},this._start=function(){n._userNode&&"string"==typeof n._userNode&&(n._userNode=document.getElementById(n._userNode));var t=n._isGlobal?window:n;if(t.preload){n.callRegisteredHooksFor("beforePreload");var r,i=document.getElementById(n._loadingScreenId),o=(i||((i=document.createElement("div")).innerHTML="Loading...",i.style.position="absolute",i.id=n._loadingScreenId,(n._userNode||document.body).appendChild(i)),n._preloadMethods);for(r in o){o[r]=o[r]||e;var s=o[r];s!==e.prototype&&s!==e||(n._isGlobal&&(window[r]=n._wrapPreload(n,r)),s=n),n._registeredPreloadMethods[r]=s[r],s[r]=n._wrapPreload(s,r)}t.preload(),n._runIfPreloadsAreDone()}else n._setup(),n._recording||n._draw()},this._runIfPreloadsAreDone=function(){var e,t=this._isGlobal?window:this;0===t._preloadCount&&((e=document.getElementById(t._loadingScreenId))&&e.parentNode.removeChild(e),this.callRegisteredHooksFor("afterPreload"),this._setupDone||(this._lastTargetFrameTime=window.performance.now(),this._lastRealFrameTime=window.performance.now(),t._setup(),this._recording||t._draw()))},this._decrementPreload=function(){var e=this._isGlobal?window:this;e._preloadDone||"function"!=typeof e.preload||(e._setProperty("_preloadCount",e._preloadCount-1),e._runIfPreloadsAreDone())},this._wrapPreload=function(e,t){var r=this;return function(){r._incrementPreload();for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r._registeredPreloadMethods[t].apply(e,i)}},this._incrementPreload=function(){var e=this._isGlobal?window:this;e._preloadDone||e._setProperty("_preloadCount",e._preloadCount+1)},this._setup=function(){n.callRegisteredHooksFor("beforeSetup"),n.createCanvas(n._defaultCanvasSize.width,n._defaultCanvasSize.height,"p2d");var e=n._isGlobal?window:n;if("function"==typeof e.preload)for(var t in n._preloadMethods)e[t]=n._preloadMethods[t][t],e[t]&&n&&(e[t]=e[t].bind(n));n._millisStart=window.performance.now(),e._preloadDone=!0,"function"==typeof e.setup&&e.setup();var r=document.getElementsByTagName("canvas"),i=!0,o=!1,s=void 0;try{for(var a,l=r[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var c=a.value;"true"===c.dataset.hidden&&(c.style.visibility="",delete c.dataset.hidden)}}catch(e){o=!0,s=e}finally{try{i||null==l.return||l.return()}finally{if(o)throw s}}n._lastTargetFrameTime=window.performance.now(),n._lastRealFrameTime=window.performance.now(),n._setupDone=!0,(n._accessibleOutputs.grid||n._accessibleOutputs.text)&&n._updateAccsOutput(),n.callRegisteredHooksFor("afterSetup")},this._draw=function(e){var t=(e=e||window.performance.now())-n._lastTargetFrameTime,r=1e3/n._targetFrameRate;(!n._loop||r-5<=t)&&(n.deltaTime=e-n._lastRealFrameTime,n._setProperty("deltaTime",n.deltaTime),n._frameRate=1e3/n.deltaTime,n.redraw(),n._lastTargetFrameTime=Math.max(n._lastTargetFrameTime+r,e),n._lastRealFrameTime=e,void 0!==n._updateMouseCoords&&(n._updateMouseCoords(),n._setProperty("movedX",0),n._setProperty("movedY",0))),n._loop&&(n._requestAnimId=window.requestAnimationFrame(n._draw))},this._setProperty=function(e,t){n[e]=t,n._isGlobal&&(window[e]=t)},this.remove=function(){if(n._startListener&&window.removeEventListener("load",n._startListener,!1),(i=document.getElementById(n._loadingScreenId))&&(i.parentNode.removeChild(i),n._incrementPreload()),n._curElement){for(var t in n._loop=!1,n._requestAnimId&&window.cancelAnimationFrame(n._requestAnimId),n._events)window.removeEventListener(t,n._events[t]);var r=!0,i=!1,o=void 0;try{for(var s,a=n._elements[Symbol.iterator]();!(r=(s=a.next()).done);r=!0){var l,c=s.value;for(l in c.elt&&c.elt.parentNode&&c.elt.parentNode.removeChild(c.elt),c._events)c.elt.removeEventListener(l,c._events[l])}}catch(t){i=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}var u=n;n._registeredMethods.remove.forEach((function(e){void 0!==e&&e.call(u)}))}if(n._isGlobal){for(var h in e.prototype)try{delete window[h]}catch(t){window[h]=void 0}for(var d in n)if(n.hasOwnProperty(d))try{delete window[d]}catch(t){window[d]=void 0}e.instance=null}},this._updateWindowSize(),this._registeredMethods.init.forEach((function(e){void 0!==e&&e.call(this)}),this),this._setupPromisePreloads();var u,h,d=this._createFriendlyGlobalFunctionBinder();if(t)t(this),e._checkForUserDefinedFunctions(this);else{for(var p in this._isGlobal=!0,e.instance=this,e.prototype)"function"==typeof e.prototype[p]?(u=p.substring(2),this._events.hasOwnProperty(u)||(Math.hasOwnProperty(p)&&Math[p]===e.prototype[p]?d(p,e.prototype[p]):d(p,e.prototype[p].bind(this)))):d(p,e.prototype[p]);for(var f in this)this.hasOwnProperty(f)&&d(f,this[f])}for(h in this._events){var m=this["_on".concat(h)];m&&(m=m.bind(this),window.addEventListener(h,m,{passive:!1}),this._events[h]=m)}function y(){n._setProperty("focused",!0)}function g(){n._setProperty("focused",!1)}window.addEventListener("focus",y),window.addEventListener("blur",g),this.registerMethod("remove",(function(){window.removeEventListener("focus",y),window.removeEventListener("blur",g)})),"complete"===document.readyState?this._start():(this._startListener=this._start.bind(this),window.addEventListener("load",this._startListener,!1))}var t;return(t=[{key:"_initializeInstanceVariables",value:function(){this._accessibleOutputs={text:!1,grid:!1,textLabel:!1,gridLabel:!1},this._styles=[],this._bezierDetail=20,this._curveDetail=20,this._colorMode=o.RGB,this._colorMaxes={rgb:[255,255,255,255],hsb:[360,100,100,1],hsl:[360,100,100,1]},this._downKeys={}}},{key:"registerPreloadMethod",value:function(t,r){e.prototype._preloadMethods.hasOwnProperty(t)||(e.prototype._preloadMethods[t]=r)}},{key:"registerMethod",value:function(t,r){var n=this||e.prototype;n._registeredMethods.hasOwnProperty(t)||(n._registeredMethods[t]=[]),n._registeredMethods[t].push(r)}},{key:"unregisterMethod",value:function(t,r){var n=this||e.prototype;if(n._registeredMethods.hasOwnProperty(t)){for(var i=n._registeredMethods[t],o=[],s=0;s<i.length;s++)i[s]===r&&o.push(s);for(var a=o.length-1;0<=a;a--)i.splice(o[a],1)}}},{key:"_createFriendlyGlobalFunctionBinder",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=t.globalObject||window;return t.log||console.log.bind(console),function(t,n){e.disableFriendlyErrors,r[t]=n}}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}();for(a in l.instance=null,l.disableFriendlyErrors=!1,o)l.prototype[a]=o[a];l.VERSION=o.VERSION,l.prototype._preloadMethods={loadJSON:l.prototype,loadImage:l.prototype,loadStrings:l.prototype,loadXML:l.prototype,loadBytes:l.prototype,loadTable:l.prototype,loadFont:l.prototype,loadModel:l.prototype,loadShader:l.prototype},l.prototype._registeredMethods={init:[],pre:[],post:[],remove:[]},l.prototype._registeredPreloadMethods={},r.default=l},{"./constants":272,"./shim":294,"core-js/modules/es.array.for-each":161,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.slice":169,"core-js/modules/es.array.splice":171,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.get-own-property-names":187,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.for-each":245,"core-js/modules/web.dom-collections.iterator":246}],284:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("./main"))&&e.__esModule?e:{default:e};function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}n.default.Element=function(){function e(t,r){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.elt=t,this._pInst=this._pixelsState=r,this._events={},this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight}var t,r,o;return t=e,o=[{key:"_adjustListener",value:function(e,t,r){return!1===t?n.default.Element._detachListener(e,r):n.default.Element._attachListener(e,t,r),this}},{key:"_attachListener",value:function(e,t,r){r._events[e]&&n.default.Element._detachListener(e,r),t=t.bind(r),r.elt.addEventListener(e,t,!1),r._events[e]=t}},{key:"_detachListener",value:function(e,t){var r=t._events[e];t.elt.removeEventListener(e,r,!1),t._events[e]=null}}],(r=[{key:"parent",value:function(e){return void 0===e?this.elt.parentNode:("string"==typeof e?("#"===e[0]&&(e=e.substring(1)),e=document.getElementById(e)):e instanceof n.default.Element&&(e=e.elt),e.appendChild(this.elt),this)}},{key:"id",value:function(e){return void 0===e?this.elt.id:(this.elt.id=e,this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight,this)}},{key:"class",value:function(e){return void 0===e?this.elt.className:(this.elt.className=e,this)}},{key:"mousePressed",value:function(e){return n.default.Element._adjustListener("mousedown",(function(t){return this._pInst._setProperty("mouseIsPressed",!0),this._pInst._setMouseButton(t),e.call(this,t)}),this),this}},{key:"doubleClicked",value:function(e){return n.default.Element._adjustListener("dblclick",e,this),this}},{key:"mouseWheel",value:function(e){return n.default.Element._adjustListener("wheel",e,this),this}},{key:"mouseReleased",value:function(e){return n.default.Element._adjustListener("mouseup",e,this),this}},{key:"mouseClicked",value:function(e){return n.default.Element._adjustListener("click",e,this),this}},{key:"mouseMoved",value:function(e){return n.default.Element._adjustListener("mousemove",e,this),this}},{key:"mouseOver",value:function(e){return n.default.Element._adjustListener("mouseover",e,this),this}},{key:"mouseOut",value:function(e){return n.default.Element._adjustListener("mouseout",e,this),this}},{key:"touchStarted",value:function(e){return n.default.Element._adjustListener("touchstart",e,this),this}},{key:"touchMoved",value:function(e){return n.default.Element._adjustListener("touchmove",e,this),this}},{key:"touchEnded",value:function(e){return n.default.Element._adjustListener("touchend",e,this),this}},{key:"dragOver",value:function(e){return n.default.Element._adjustListener("dragover",e,this),this}},{key:"dragLeave",value:function(e){return n.default.Element._adjustListener("dragleave",e,this),this}},{key:"_setProperty",value:function(e,t){this[e]=t}}])&&i(t.prototype,r),o&&i(t,o),e}(),e=n.default.Element,r.default=e},{"./main":283}],285:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.get-prototype-of"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(p=e("./main"))&&p.__esModule?p:{default:p},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){return function(){var t,r=d(e);return u(this,function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),1}catch(e){}}}()?(t=d(this).constructor,Reflect.construct(r,arguments,t)):r.apply(this,arguments))}}function u(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}o.default.Graphics=function(e){var t=n;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e);var r=c(n);function n(e,t,i,a,l){var c;if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");p=l||document.createElement("canvas"),(c=r.call(this,p,a)).canvas=p;var d,p=i||s.P2D;for(d in i=a._userNode||document.body,l||i.appendChild(c.canvas),o.default.prototype)c[d]||("function"==typeof o.default.prototype[d]?c[d]=o.default.prototype[d].bind(h(c)):c[d]=o.default.prototype[d]);return o.default.prototype._initializeInstanceVariables.apply(h(c)),c.width=e,c.height=t,c._pixelDensity=a._pixelDensity,p===s.WEBGL?(c._renderer=new o.default.RendererGL(c.canvas,h(c),!1),e=(l=c._renderer._adjustDimensions(e,t)).adjustedWidth,t=l.adjustedHeight):c._renderer=new o.default.Renderer2D(c.canvas,h(c),!1),a._elements.push(h(c)),Object.defineProperty(h(c),"deltaTime",{get:function(){return this._pInst.deltaTime}}),c._renderer.resize(e,t),c._renderer._applyDefaults(),u(c,h(c))}return t=n,(e=[{key:"reset",value:function(){this._renderer.resetMatrix(),this._renderer.isP3D&&this._renderer._update()}},{key:"remove",value:function(){this.elt.parentNode&&this.elt.parentNode.removeChild(this.elt);var e,t=this._pInst._elements.indexOf(this);for(e in-1!==t&&this._pInst._elements.splice(t,1),this._events)this.elt.removeEventListener(e,this._events[e]);this._renderer=void 0,this.canvas=void 0,this.elt=void 0}},{key:"createFramebuffer",value:function(e){return new o.default.Framebuffer(this,e)}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),n}(o.default.Element);var p=o.default.Graphics;r.default=p},{"./constants":272,"./main":283,"core-js/modules/es.array.index-of":164,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.splice":171,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.get-prototype-of":188,"core-js/modules/es.object.to-string":190,"core-js/modules/es.reflect.construct":192,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],286:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=(d=e("./main"))&&d.__esModule?d:{default:d},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r,n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var o;Object.prototype.hasOwnProperty.call(e,r)&&((o=i?Object.getOwnPropertyDescriptor(e,r):null)&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function s(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,s=function(){return e},e)}function a(e){return(a="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){return function(){var t,r,n=h(e);return t=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),1}catch(e){}}}()?(t=h(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(r=t)||"object"!==a(r)&&"function"!=typeof r?u(n):r}}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=function(e){var t=n;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e);var r=c(n);function n(e,t,i){var s;if(this instanceof n)return(s=r.call(this,e,t)).canvas=e,s._pixelsState=t,i?(s._isMainCanvas=!0,s._pInst._setProperty("_curElement",u(s)),s._pInst._setProperty("canvas",s.canvas),s._pInst._setProperty("width",s.width),s._pInst._setProperty("height",s.height)):(s.canvas.style.display="none",s._styles=[]),s._clipping=!1,s._clipInvert=!1,s._textSize=12,s._textLeading=15,s._textFont="sans-serif",s._textStyle=o.NORMAL,s._textAscent=null,s._textDescent=null,s._textAlign=o.LEFT,s._textBaseline=o.BASELINE,s._textWrap=o.WORD,s._rectMode=o.CORNER,s._ellipseMode=o.CENTER,s._curveTightness=0,s._imageMode=o.CORNER,s._tint=null,s._doStroke=!0,s._doFill=!0,s._strokeSet=!1,s._fillSet=!1,s._leadingSet=!1,s._pushPopDepth=0,s;throw new TypeError("Cannot call a class as a function")}return t=n,(e=[{key:"push",value:function(){return this._pushPopDepth++,{properties:{_doStroke:this._doStroke,_strokeSet:this._strokeSet,_doFill:this._doFill,_fillSet:this._fillSet,_tint:this._tint,_imageMode:this._imageMode,_rectMode:this._rectMode,_ellipseMode:this._ellipseMode,_textFont:this._textFont,_textLeading:this._textLeading,_leadingSet:this._leadingSet,_textSize:this._textSize,_textAlign:this._textAlign,_textBaseline:this._textBaseline,_textStyle:this._textStyle,_textWrap:this._textWrap}}}},{key:"pop",value:function(e){this._pushPopDepth--,e.properties&&Object.assign(this,e.properties)}},{key:"beginClip",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(this._clipping)throw new Error("It looks like you're trying to clip while already in the middle of clipping. Did you forget to endClip()?");this._clipping=!0,this._clipInvert=e.invert}},{key:"endClip",value:function(){if(!this._clipping)throw new Error("It looks like you've called endClip() without beginClip(). Did you forget to call beginClip() first?");this._clipping=!1}},{key:"resize",value:function(e,t){this.width=e,this.height=t,this.elt.width=e*this._pInst._pixelDensity,this.elt.height=t*this._pInst._pixelDensity,this.elt.style.width="".concat(e,"px"),this.elt.style.height="".concat(t,"px"),this._isMainCanvas&&(this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height))}},{key:"get",value:function(e,t,r,n){var o=this._pixelsState,s=o._pixelDensity,a=this.canvas;if(void 0===e&&void 0===t)e=t=0,r=o.width,n=o.height;else if(e*=s,t*=s,void 0===r&&void 0===n)return e<0||t<0||e>=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);return(o=new i.default.Image(r*s,n*s)).pixelDensity(s),o.canvas.getContext("2d").drawImage(a,e,t,r*s,n*s,0,0,r*s,n*s),o}},{key:"textLeading",value:function(e){return"number"==typeof e?(this._setProperty("_leadingSet",!0),this._setProperty("_textLeading",e),this._pInst):this._textLeading}},{key:"textStyle",value:function(e){return e?(e!==o.NORMAL&&e!==o.ITALIC&&e!==o.BOLD&&e!==o.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle}},{key:"textAscent",value:function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent}},{key:"textDescent",value:function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent}},{key:"textAlign",value:function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}}},{key:"textWrap",value:function(e){return this._setProperty("_textWrap",e),this._textWrap}},{key:"text",value:function(e,t,r,n,i){var s,a,l,c,u=this._pInst,h=this._textWrap,d=Number.MAX_VALUE,p=r;if((this._doFill||this._doStroke)&&void 0!==e){if(s=(e=(e="string"!=typeof e?e.toString():e).replace(/(\t)/g,"  ")).split("\n"),void 0!==n){switch(this._rectMode===o.CENTER&&(t-=n/2),this._textAlign){case o.CENTER:t+=n/2;break;case o.RIGHT:t+=n}if(void 0!==i){this._rectMode===o.CENTER&&(r-=i/2,p-=i/2),e=r;var f=u.textAscent();switch(this._textBaseline){case o.BOTTOM:c=r+i,r=Math.max(c,r),p+=f;break;case o.CENTER:c=r+i/2,r=Math.max(c,r),p+=f/2}d=r+i-f,this._textBaseline===o.CENTER&&(d=e+i-f/2)}else this._textBaseline!==o.BOTTOM&&this._textBaseline!==o.CENTER||(p=r-(e=u.textSize()*this._textLeading)/2,d=r+e/2);if(h===o.WORD){for(var m=[],y=0;y<s.length;y++){for(var g="",v=s[y].split(" "),b=0;b<v.length;b++)a="".concat(g+v[b])+" ",g=n<(l=this.textWidth(a))&&0<g.length?(m.push(g),"".concat(v[b])+" "):a;m.push(g)}var _=0;this._textBaseline===o.CENTER?_=(m.length-1)*u.textLeading()/2:this._textBaseline===o.BOTTOM&&(_=(m.length-1)*u.textLeading());for(var x=0;x<s.length;x++){g="",v=s[x].split(" ");for(var w=0;w<v.length;w++)a="".concat(g+v[w])+" ",n<(l=this.textWidth(a))&&0<g.length?(this._renderText(u,g.trim(),t,r-_,d,p),g="".concat(v[w])+" ",r+=u.textLeading()):g=a;this._renderText(u,g.trim(),t,r-_,d,p),r+=u.textLeading()}}else{for(var S=[],M=0;M<s.length;M++)for(var T=s[M].split(g=""),E=0;E<T.length;E++)a="".concat(g+T[E]),(l=this.textWidth(a))<=n?g+=T[E]:n<l&&0<g.length&&(S.push(g),g="".concat(T[E]));S.push(g);var j=0;this._textBaseline===o.CENTER?j=(S.length-1)*u.textLeading()/2:this._textBaseline===o.BOTTOM&&(j=(S.length-1)*u.textLeading());for(var A=0;A<s.length;A++){T=s[A].split(g="");for(var L=0;L<T.length;L++)a="".concat(g+T[L]),(l=this.textWidth(a))<=n?g+=T[L]:n<l&&0<g.length&&(this._renderText(u,g.trim(),t,r-j,d,p),r+=u.textLeading(),g="".concat(T[L]))}this._renderText(u,g.trim(),t,r-j,d,p),r+=u.textLeading()}}else{var C=0;this._textBaseline===o.CENTER?C=(s.length-1)*u.textLeading()/2:this._textBaseline===o.BOTTOM&&(C=(s.length-1)*u.textLeading());for(var P=0;P<s.length;P++)this._renderText(u,s[P],t,r-C,d,p-C),r+=u.textLeading()}return u}}},{key:"_applyDefaults",value:function(){return this}},{key:"_isOpenType",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this._textFont;return"object"===a(e)&&e.font&&e.font.supported}},{key:"_updateTextMetrics",value:function(){var e,t,r,n,i,o;return this._isOpenType()?(this._setProperty("_textAscent",this._textFont._textAscent()),this._setProperty("_textDescent",this._textFont._textDescent())):((e=document.createElement("span")).style.fontFamily=this._textFont,e.style.fontSize="".concat(this._textSize,"px"),e.innerHTML="ABCjgq|",(o=document.createElement("div")).style.display="inline-block",o.style.width="1px",o.style.height="0px",(t=document.createElement("div")).appendChild(e),t.appendChild(o),t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t),o.style.verticalAlign="baseline",n=p(o),i=p(e),r=n[1]-i[1],o.style.verticalAlign="bottom",n=p(o),i=p(e),o=n[1]-i[1]-r,document.body.removeChild(t),this._setProperty("_textAscent",r),this._setProperty("_textDescent",o)),this}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),n}(i.default.Element);function p(e){var t=0,r=0;if(e.offsetParent)for(;t+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;);else t+=e.offsetLeft,r+=e.offsetTop;return[t,r]}d.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._leadingSet||this._setProperty("_textLeading",e*o._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},i.default.Renderer=d,e=i.default.Renderer,r.default=e},{"../core/constants":272,"./main":283,"core-js/modules/es.array.iterator":165,"core-js/modules/es.number.constructor":179,"core-js/modules/es.object.assign":183,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.get-prototype-of":188,"core-js/modules/es.object.to-string":190,"core-js/modules/es.reflect.construct":192,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.replace":204,"core-js/modules/es.string.split":206,"core-js/modules/es.string.trim":209,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],287:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.reflect.get"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(d=e("./main"))&&d.__esModule?d:{default:d},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function l(e,t,r){return(l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){if(e=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t),e)return(e=Object.getOwnPropertyDescriptor(e,t)).get?e.get.call(r):e.value})(e,t,r||e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}e("./p5.Renderer");var h="rgba(0,0,0,0)",d=function(e){var t=n;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e);var r=function(e){return function(){var t,r=u(e);if(t=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),1}catch(e){}}}()?(t=u(this).constructor,Reflect.construct(r,arguments,t)):r.apply(this,arguments),r=this,!t||"object"!==i(t)&&"function"!=typeof t){if(void 0!==r)return r;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}}(n);function n(e,t,i){if(this instanceof n)return(e=r.call(this,e,t,i)).drawingContext=e.canvas.getContext("2d"),e._pInst._setProperty("drawingContext",e.drawingContext),e;throw new TypeError("Cannot call a class as a function")}return t=n,(e=[{key:"getFilterGraphicsLayer",value:function(){var e;return this.filterGraphicsLayer||(e=(this._pInst instanceof o.default.Graphics?this._pInst:this)._pInst,this.filterGraphicsLayer=new o.default.Graphics(this.width,this.height,s.WEBGL,e)),this.filterGraphicsLayer.width===this.width&&this.filterGraphicsLayer.height===this.height||this.filterGraphicsLayer.resizeCanvas(this.width,this.height),this.filterGraphicsLayer.pixelDensity()!==this._pInst.pixelDensity()&&this.filterGraphicsLayer.pixelDensity(this._pInst.pixelDensity()),this.filterGraphicsLayer}},{key:"_applyDefaults",value:function(){this._cachedFillStyle=this._cachedStrokeStyle=void 0,this._cachedBlendMode=s.BLEND,this._setFill(s._DEFAULT_FILL),this._setStroke(s._DEFAULT_STROKE),this.drawingContext.lineCap=s.ROUND,this.drawingContext.font="normal 12px sans-serif"}},{key:"resize",value:function(e,t){l(u(n.prototype),"resize",this).call(this,e,t),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity)}},{key:"background",value:function(){var e,t;this.drawingContext.save(),this.resetMatrix(),(arguments.length<=0?void 0:arguments[0])instanceof o.default.Image?0<=(arguments.length<=1?void 0:arguments[1])?(e=arguments.length<=0?void 0:arguments[0],this.drawingContext.globalAlpha=(arguments.length<=1?void 0:arguments[1])/255,this._pInst.image(e,0,0,this.width,this.height)):this._pInst.image(arguments.length<=0?void 0:arguments[0],0,0,this.width,this.height):(e=this._getFill(),t=(t=this._pInst).color.apply(t,arguments),this._pInst._addAccsOutput()&&this._pInst._accsBackground(t.levels),t=t.toString(),this._setFill(t),this._isErasing&&this.blendMode(this._cachedBlendMode),this.drawingContext.fillRect(0,0,this.width,this.height),this._setFill(e),this._isErasing&&this._pInst.erase()),this.drawingContext.restore()}},{key:"clear",value:function(){this.drawingContext.save(),this.resetMatrix(),this.drawingContext.clearRect(0,0,this.width,this.height),this.drawingContext.restore()}},{key:"fill",value:function(){var e=(e=this._pInst).color.apply(e,arguments);this._setFill(e.toString()),this._pInst._addAccsOutput()&&this._pInst._accsCanvasColors("fill",e.levels)}},{key:"stroke",value:function(){var e=(e=this._pInst).color.apply(e,arguments);this._setStroke(e.toString()),this._pInst._addAccsOutput()&&this._pInst._accsCanvasColors("stroke",e.levels)}},{key:"erase",value:function(e,t){this._isErasing||(this._cachedFillStyle=this.drawingContext.fillStyle,e=this._pInst.color(255,e).toString(),this.drawingContext.fillStyle=e,this._cachedStrokeStyle=this.drawingContext.strokeStyle,e=this._pInst.color(255,t).toString(),this.drawingContext.strokeStyle=e,t=this._cachedBlendMode,this.blendMode(s.REMOVE),this._cachedBlendMode=t,this._isErasing=!0)}},{key:"noErase",value:function(){this._isErasing&&(this.drawingContext.fillStyle=this._cachedFillStyle,this.drawingContext.strokeStyle=this._cachedStrokeStyle,this.blendMode(this._cachedBlendMode),this._isErasing=!1)}},{key:"beginClip",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};l(u(n.prototype),"beginClip",this).call(this,e),this._cachedFillStyle=this.drawingContext.fillStyle,e=this._pInst.color(255,0).toString(),this.drawingContext.fillStyle=e,this._cachedStrokeStyle=this.drawingContext.strokeStyle,e=this._pInst.color(255,0).toString(),this.drawingContext.strokeStyle=e,e=this._cachedBlendMode,this.blendMode(s.BLEND),this._cachedBlendMode=e,this.drawingContext.beginPath(),this._clipInvert&&(this.drawingContext.moveTo(-2*this.width,-2*this.height),this.drawingContext.lineTo(-2*this.width,2*this.height),this.drawingContext.lineTo(2*this.width,2*this.height),this.drawingContext.lineTo(2*this.width,-2*this.height),this.drawingContext.closePath())}},{key:"endClip",value:function(){this._doFillStrokeClose(),this.drawingContext.clip(),l(u(n.prototype),"endClip",this).call(this),this.drawingContext.fillStyle=this._cachedFillStyle,this.drawingContext.strokeStyle=this._cachedStrokeStyle,this.blendMode(this._cachedBlendMode)}},{key:"image",value:function(e,t,r,n,i,s,a,l,c){e.gifProperties&&e._animateGif(this._pInst);try{o.default.MediaElement&&e instanceof o.default.MediaElement&&e._ensureCanvas();var u=(u=this._tint&&e.canvas?this._getTintedImageCanvas(e):u)||e.canvas||e.elt,h=1;e.width&&0<e.width&&(h=u.width/e.width),this._isErasing&&this.blendMode(this._cachedBlendMode),this.drawingContext.drawImage(u,h*t,h*r,h*n,h*i,s,a,l,c),this._isErasing&&this._pInst.erase()}catch(e){if("NS_ERROR_NOT_AVAILABLE"!==e.name)throw e}}},{key:"_getTintedImageCanvas",value:function(e){if(!e.canvas)return e;e.tintCanvas||(e.tintCanvas=document.createElement("canvas")),e.tintCanvas.width!==e.canvas.width&&(e.tintCanvas.width=e.canvas.width),e.tintCanvas.height!==e.canvas.height&&(e.tintCanvas.height=e.canvas.height);var t=e.tintCanvas.getContext("2d");return t.save(),t.clearRect(0,0,e.canvas.width,e.canvas.height),(this._tint[0]<255||this._tint[1]<255||this._tint[2]<255)&&(t.drawImage(e.canvas,0,0),t.globalCompositeOperation="luminosity",t.drawImage(e.canvas,0,0),t.globalCompositeOperation="color",t.drawImage(e.canvas,0,0),t.globalCompositeOperation="multiply",t.fillStyle="rgb(".concat(this._tint.slice(0,3).join(", "),")"),t.fillRect(0,0,e.canvas.width,e.canvas.height),t.globalCompositeOperation="destination-in"),t.globalAlpha=this._tint[3]/255,t.drawImage(e.canvas,0,0),t.restore(),e.tintCanvas}},{key:"blendMode",value:function(e){if(e===s.SUBTRACT)console.warn("blendMode(SUBTRACT) only works in WEBGL mode.");else{if(e!==s.BLEND&&e!==s.REMOVE&&e!==s.DARKEST&&e!==s.LIGHTEST&&e!==s.DIFFERENCE&&e!==s.MULTIPLY&&e!==s.EXCLUSION&&e!==s.SCREEN&&e!==s.REPLACE&&e!==s.OVERLAY&&e!==s.HARD_LIGHT&&e!==s.SOFT_LIGHT&&e!==s.DODGE&&e!==s.BURN&&e!==s.ADD)throw new Error("Mode ".concat(e," not recognized."));this._cachedBlendMode=e,this.drawingContext.globalCompositeOperation=e}}},{key:"blend",value:function(){for(var e=this.drawingContext.globalCompositeOperation,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[r.length-1],s=Array.prototype.slice.call(r,0,r.length-1);this.drawingContext.globalCompositeOperation=i,o.default.prototype.copy.apply(this,s),this.drawingContext.globalCompositeOperation=e}},{key:"_getPixel",value:function(e,t){return[(e=this.drawingContext.getImageData(e,t,1,1).data)[0],e[1],e[2],e[3]]}},{key:"loadPixels",value:function(){var e=this._pixelsState,t=e._pixelDensity,r=this.width*t;t=this.height*t,r=this.drawingContext.getImageData(0,0,r,t),e._setProperty("imageData",r),e._setProperty("pixels",r.data)}},{key:"set",value:function(e,t,r){e=Math.floor(e),t=Math.floor(t);var n=this._pixelsState;if(r instanceof o.default.Image)this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(n._pixelDensity,n._pixelDensity),this.drawingContext.clearRect(e,t,r.width,r.height),this.drawingContext.drawImage(r.canvas,e,t),this.drawingContext.restore();else{var i=0,s=0,a=0,l=0,c=4*(t*n._pixelDensity*(this.width*n._pixelDensity)+e*n._pixelDensity);if(n.imageData||n.loadPixels(),"number"==typeof r)c<n.pixels.length&&(a=s=i=r,l=255);else if(Array.isArray(r)){if(r.length<4)throw new Error("pixel array must be of the form [R, G, B, A]");c<n.pixels.length&&(i=r[0],s=r[1],a=r[2],l=r[3])}else r instanceof o.default.Color&&c<n.pixels.length&&(i=r.levels[0],s=r.levels[1],a=r.levels[2],l=r.levels[3]);for(var u=0;u<n._pixelDensity;u++)for(var h=0;h<n._pixelDensity;h++)c=4*((t*n._pixelDensity+h)*this.width*n._pixelDensity+(e*n._pixelDensity+u)),n.pixels[c]=i,n.pixels[c+1]=s,n.pixels[c+2]=a,n.pixels[c+3]=l}}},{key:"updatePixels",value:function(e,t,r,n){var i=this._pixelsState,o=i._pixelDensity;void 0===e&&void 0===t&&void 0===r&&void 0===n&&(t=e=0,r=this.width,n=this.height),e*=o,t*=o,r*=o,n*=o,this.gifProperties&&(this.gifProperties.frames[this.gifProperties.displayIndex].image=i.imageData),this.drawingContext.putImageData(i.imageData,0,0,e,t,r,n)}},{key:"arc",value:function(e,t,r,n,i,o,a){var l=this.drawingContext,c=(e+=r/2,t+=n/2,r/=2,n/=2,!(a===s.CHORD||a===s.OPEN||(o-i)%s.TWO_PI==0));return this._doFill&&(this._clipping||l.beginPath(),l.ellipse(e,t,r,n,0,i,o),c&&l.lineTo(e,t),l.closePath(),this._clipping||l.fill()),this._doStroke&&(this._clipping||l.beginPath(),l.ellipse(e,t,r,n,0,i,o),a===s.PIE&&c&&l.lineTo(e,t),a!==s.PIE&&a!==s.CHORD||l.closePath(),this._clipping||l.stroke()),this}},{key:"ellipse",value:function(e){var t=this.drawingContext,r=this._doFill,n=this._doStroke,i=parseFloat(e[0]),o=parseFloat(e[1]),s=parseFloat(e[2]);if(e=parseFloat(e[3]),r&&!n){if(this._getFill()===h)return this}else if(!r&&n&&this._getStroke()===h)return this;i+=s/2,o+=e/2,s/=2,e/=2,this._clipping||t.beginPath(),t.ellipse(i,o,s,e,0,0,2*Math.PI),t.closePath(),!this._clipping&&r&&t.fill(),!this._clipping&&n&&t.stroke()}},{key:"line",value:function(e,t,r,n){var i=this.drawingContext;return this._doStroke&&this._getStroke()!==h&&(this._clipping||i.beginPath(),i.moveTo(e,t),i.lineTo(r,n),i.stroke()),this}},{key:"point",value:function(e,t){var r,n,i=this.drawingContext;return this._doStroke&&this._getStroke()!==h?(r=this._getStroke(),n=this._getFill(),this._clipping||this._setFill(r),this._clipping||i.beginPath(),i.arc(e,t,i.lineWidth/2,0,s.TWO_PI,!1),void(this._clipping||(i.fill(),this._setFill(n)))):this}},{key:"quad",value:function(e,t,r,n,i,o,s,a){var l=this.drawingContext,c=this._doFill,u=this._doStroke;if(c&&!u){if(this._getFill()===h)return this}else if(!c&&u&&this._getStroke()===h)return this;return this._clipping||l.beginPath(),l.moveTo(e,t),l.lineTo(r,n),l.lineTo(i,o),l.lineTo(s,a),l.closePath(),!this._clipping&&c&&l.fill(),!this._clipping&&u&&l.stroke(),this}},{key:"rect",value:function(e){var t,r,n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=(e=e[7],this.drawingContext),d=this._doFill,p=this._doStroke;if(d&&!p){if(this._getFill()===h)return this}else if(!d&&p&&this._getStroke()===h)return this;return this._clipping||u.beginPath(),void 0===a?u.rect(n,i,o,s):(void 0===l&&(l=a),void 0===c&&(c=l),void 0===e&&(e=c),p=(d=Math.abs(o))/2,r=(t=Math.abs(s))/2,u.roundRect(n,i,o,s,[a=t<2*(a=d<2*a?p:a)?r:a,l=t<2*(l=d<2*l?p:l)?r:l,c=t<2*(c=d<2*c?p:c)?r:c,e=t<2*(e=d<2*e?p:e)?r:e])),!this._clipping&&this._doFill&&u.fill(),!this._clipping&&this._doStroke&&u.stroke(),this}},{key:"triangle",value:function(e){var t=this.drawingContext,r=this._doFill,n=this._doStroke,i=e[0],o=e[1],s=e[2],a=e[3],l=e[4];if(e=e[5],r&&!n){if(this._getFill()===h)return this}else if(!r&&n&&this._getStroke()===h)return this;this._clipping||t.beginPath(),t.moveTo(i,o),t.lineTo(s,a),t.lineTo(l,e),t.closePath(),!this._clipping&&r&&t.fill(),!this._clipping&&n&&t.stroke()}},{key:"endShape",value:function(e,t,r,n,i,o,a){if(0!==t.length&&(this._doStroke||this._doFill)){var l,c,u,h=e===s.CLOSE,d=(h&&!o&&t.push(t[0]),t.length);if(r&&null===a){if(3<d){var p=[],f=1-this._curveTightness;for(this._clipping||this.drawingContext.beginPath(),this.drawingContext.moveTo(t[1][0],t[1][1]),c=1;c+2<d;c++)l=t[c],p[0]=[l[0],l[1]],p[1]=[l[0]+(f*t[c+1][0]-f*t[c-1][0])/6,l[1]+(f*t[c+1][1]-f*t[c-1][1])/6],p[2]=[t[c+1][0]+(f*t[c][0]-f*t[c+2][0])/6,t[c+1][1]+(f*t[c][1]-f*t[c+2][1])/6],p[3]=[t[c+1][0],t[c+1][1]],this.drawingContext.bezierCurveTo(p[1][0],p[1][1],p[2][0],p[2][1],p[3][0],p[3][1]);h&&this.drawingContext.lineTo(t[c+1][0],t[c+1][1]),this._doFillStrokeClose(h)}}else if(n&&null===a){for(this._clipping||this.drawingContext.beginPath(),c=0;c<d;c++)t[c].isVert?t[c].moveTo?this.drawingContext.moveTo(t[c][0],t[c][1]):this.drawingContext.lineTo(t[c][0],t[c][1]):this.drawingContext.bezierCurveTo(t[c][0],t[c][1],t[c][2],t[c][3],t[c][4],t[c][5]);this._doFillStrokeClose(h)}else if(i&&null===a){for(this._clipping||this.drawingContext.beginPath(),c=0;c<d;c++)t[c].isVert?t[c].moveTo?this.drawingContext.moveTo(t[c][0],t[c][1]):this.drawingContext.lineTo(t[c][0],t[c][1]):this.drawingContext.quadraticCurveTo(t[c][0],t[c][1],t[c][2],t[c][3]);this._doFillStrokeClose(h)}else if(a===s.POINTS)for(c=0;c<d;c++)l=t[c],this._doStroke&&this._pInst.stroke(l[6]),this._pInst.point(l[0],l[1]);else if(a===s.LINES)for(c=0;c+1<d;c+=2)l=t[c],this._doStroke&&this._pInst.stroke(t[c+1][6]),this._pInst.line(l[0],l[1],t[c+1][0],t[c+1][1]);else if(a===s.TRIANGLES)for(c=0;c+2<d;c+=3)l=t[c],this._clipping||this.drawingContext.beginPath(),this.drawingContext.moveTo(l[0],l[1]),this.drawingContext.lineTo(t[c+1][0],t[c+1][1]),this.drawingContext.lineTo(t[c+2][0],t[c+2][1]),this.drawingContext.closePath(),!this._clipping&&this._doFill&&(this._pInst.fill(t[c+2][5]),this.drawingContext.fill()),!this._clipping&&this._doStroke&&(this._pInst.stroke(t[c+2][6]),this.drawingContext.stroke());else if(a===s.TRIANGLE_STRIP)for(c=0;c+1<d;c++)l=t[c],this._clipping||this.drawingContext.beginPath(),this.drawingContext.moveTo(t[c+1][0],t[c+1][1]),this.drawingContext.lineTo(l[0],l[1]),!this._clipping&&this._doStroke&&this._pInst.stroke(t[c+1][6]),!this._clipping&&this._doFill&&this._pInst.fill(t[c+1][5]),c+2<d&&(this.drawingContext.lineTo(t[c+2][0],t[c+2][1]),!this._clipping&&this._doStroke&&this._pInst.stroke(t[c+2][6]),!this._clipping&&this._doFill&&this._pInst.fill(t[c+2][5])),this._doFillStrokeClose(h);else if(a===s.TRIANGLE_FAN){if(2<d){for(this._clipping||this.drawingContext.beginPath(),c=2;c<d;c++)l=t[c],this.drawingContext.moveTo(t[0][0],t[0][1]),this.drawingContext.lineTo(t[c-1][0],t[c-1][1]),this.drawingContext.lineTo(l[0],l[1]),this.drawingContext.lineTo(t[0][0],t[0][1]),c<d-1&&(this._doFill&&l[5]!==t[c+1][5]||this._doStroke&&l[6]!==t[c+1][6])&&(!this._clipping&&this._doFill&&(this._pInst.fill(l[5]),this.drawingContext.fill(),this._pInst.fill(t[c+1][5])),!this._clipping&&this._doStroke&&(this._pInst.stroke(l[6]),this.drawingContext.stroke(),this._pInst.stroke(t[c+1][6])),this.drawingContext.closePath(),this._clipping||this.drawingContext.beginPath());this._doFillStrokeClose(h)}}else if(a===s.QUADS)for(c=0;c+3<d;c+=4){for(l=t[c],this._clipping||this.drawingContext.beginPath(),this.drawingContext.moveTo(l[0],l[1]),u=1;u<4;u++)this.drawingContext.lineTo(t[c+u][0],t[c+u][1]);this.drawingContext.lineTo(l[0],l[1]),!this._clipping&&this._doFill&&this._pInst.fill(t[c+3][5]),!this._clipping&&this._doStroke&&this._pInst.stroke(t[c+3][6]),this._doFillStrokeClose(h)}else if(a===s.QUAD_STRIP){if(3<d)for(c=0;c+1<d;c+=2)l=t[c],this._clipping||this.drawingContext.beginPath(),c+3<d?(this.drawingContext.moveTo(t[c+2][0],t[c+2][1]),this.drawingContext.lineTo(l[0],l[1]),this.drawingContext.lineTo(t[c+1][0],t[c+1][1]),this.drawingContext.lineTo(t[c+3][0],t[c+3][1]),!this._clipping&&this._doFill&&this._pInst.fill(t[c+3][5]),!this._clipping&&this._doStroke&&this._pInst.stroke(t[c+3][6])):(this.drawingContext.moveTo(l[0],l[1]),this.drawingContext.lineTo(t[c+1][0],t[c+1][1])),this._doFillStrokeClose(h)}else{for(this._clipping||this.drawingContext.beginPath(),this.drawingContext.moveTo(t[0][0],t[0][1]),c=1;c<d;c++)(l=t[c]).isVert&&(l.moveTo?(h&&this.drawingContext.closePath(),this.drawingContext.moveTo(l[0],l[1])):this.drawingContext.lineTo(l[0],l[1]));this._doFillStrokeClose(h)}o=i=n=r=!1,h&&t.pop()}return this}},{key:"strokeCap",value:function(e){return e!==s.ROUND&&e!==s.SQUARE&&e!==s.PROJECT||(this.drawingContext.lineCap=e),this}},{key:"strokeJoin",value:function(e){return e!==s.ROUND&&e!==s.BEVEL&&e!==s.MITER||(this.drawingContext.lineJoin=e),this}},{key:"strokeWeight",value:function(e){return this.drawingContext.lineWidth=void 0===e||0===e?1e-4:e,this}},{key:"_getFill",value:function(){return this._cachedFillStyle||(this._cachedFillStyle=this.drawingContext.fillStyle),this._cachedFillStyle}},{key:"_setFill",value:function(e){e!==this._cachedFillStyle&&(this.drawingContext.fillStyle=e,this._cachedFillStyle=e)}},{key:"_getStroke",value:function(){return this._cachedStrokeStyle||(this._cachedStrokeStyle=this.drawingContext.strokeStyle),this._cachedStrokeStyle}},{key:"_setStroke",value:function(e){e!==this._cachedStrokeStyle&&(this.drawingContext.strokeStyle=e,this._cachedStrokeStyle=e)}},{key:"bezier",value:function(e,t,r,n,i,o,s,a){return this._pInst.beginShape(),this._pInst.vertex(e,t),this._pInst.bezierVertex(r,n,i,o,s,a),this._pInst.endShape(),this}},{key:"curve",value:function(e,t,r,n,i,o,s,a){return this._pInst.beginShape(),this._pInst.curveVertex(e,t),this._pInst.curveVertex(r,n),this._pInst.curveVertex(i,o),this._pInst.curveVertex(s,a),this._pInst.endShape(),this}},{key:"_doFillStrokeClose",value:function(e){e&&this.drawingContext.closePath(),!this._clipping&&this._doFill&&this.drawingContext.fill(),!this._clipping&&this._doStroke&&this.drawingContext.stroke()}},{key:"applyMatrix",value:function(e,t,r,n,i,o){this.drawingContext.transform(e,t,r,n,i,o)}},{key:"resetMatrix",value:function(){return this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),this}},{key:"rotate",value:function(e){this.drawingContext.rotate(e)}},{key:"scale",value:function(e,t){return this.drawingContext.scale(e,t),this}},{key:"translate",value:function(e,t){return e instanceof o.default.Vector&&(t=e.y,e=e.x),this.drawingContext.translate(e,t),this}},{key:"_renderText",value:function(e,t,r,n,i,o){if(!(n<o||i<=n))return e.push(),this._isOpenType()?this._textFont._renderPath(t,r,n,{renderer:this}):(this._doStroke&&this._strokeSet&&this.drawingContext.strokeText(t,r,n),!this._clipping&&this._doFill&&(this._fillSet||this._setFill(s._DEFAULT_TEXT_FILL),this.drawingContext.fillText(t,r,n))),e.pop(),e}},{key:"textWidth",value:function(e){return this._isOpenType()?this._textFont._textWidth(e,this._textSize):this.drawingContext.measureText(e).width}},{key:"_applyTextProperties",value:function(){var e=this._pInst,t=(this._setProperty("_textAscent",null),this._setProperty("_textDescent",null),t=this._textFont,this._isOpenType()&&(t=this._textFont.font.familyName,this._setProperty("_textStyle",this._textFont.font.styleName)),t||"sans-serif");return/\s/.exec(t)&&(t='"'.concat(t,'"')),this.drawingContext.font="".concat(this._textStyle||"normal"," ").concat(this._textSize||12,"px ").concat(t),this.drawingContext.textAlign=this._textAlign,this._textBaseline===s.CENTER?this.drawingContext.textBaseline=s._CTX_MIDDLE:this.drawingContext.textBaseline=this._textBaseline,e}},{key:"push",value:function(){return this.drawingContext.save(),l(u(n.prototype),"push",this).call(this)}},{key:"pop",value:function(e){this.drawingContext.restore(),this._cachedFillStyle=this.drawingContext.fillStyle,this._cachedStrokeStyle=this.drawingContext.strokeStyle,l(u(n.prototype),"pop",this).call(this,e)}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),n}(o.default.Renderer);d.prototype.text=function(e,t,r,n,i){var a;return void 0!==n&&this.drawingContext.textBaseline===s.BASELINE&&(a=!0,this.drawingContext.textBaseline=s.TOP),n=o.default.Renderer.prototype.text.apply(this,arguments),a&&(this.drawingContext.textBaseline=s.BASELINE),n},o.default.Renderer2D=d,e=o.default.Renderer2D,r.default=e},{"./constants":272,"./main":283,"./p5.Renderer":286,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.fill":156,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.join":166,"core-js/modules/es.array.slice":169,"core-js/modules/es.function.name":174,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.get-prototype-of":188,"core-js/modules/es.object.to-string":190,"core-js/modules/es.reflect.construct":192,"core-js/modules/es.reflect.get":193,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],288:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var n=(e=e("./main"))&&e.__esModule?e:{default:e};function i(){return{}}n.default.prototype._promisePreloads=[];var o=!(n.default.prototype.registerPromisePreload=function(e){n.default.prototype._promisePreloads.push(e)});n.default.prototype._setupPromisePreloads=function(){var e=!0,t=!1,r=void 0;try{for(var i,s=this._promisePreloads[Symbol.iterator]();!(e=(i=s.next()).done);e=!0){var a=i.value,l=this,c=a.method,u=a.addCallbacks,h=a.legacyPreloadSetup,d=a.target||this,p=d[c].bind(d);if(d===n.default.prototype){if(o)continue;l=null,p=d[c]}d[c]=this._wrapPromisePreload(l,p,u),h&&(d[h.method]=this._legacyPreloadGenerator(l,h,d[c]))}}catch(e){t=!0,r=e}finally{try{e||null==s.return||s.return()}finally{if(t)throw r}}o=!0},n.default.prototype._wrapPromisePreload=function(e,t,r){var n=function(){for(var e=this,n=(this._incrementPreload(),null),i=null,o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];if(r)for(var l=s.length-1;0<=l&&!i&&"function"==typeof s[l];l--)i=n,n=s.pop();var c=Promise.resolve(t.apply(this,s));return n&&c.then(n),i&&c.catch(i),c.then((function(){return e._decrementPreload()})),c};return e?n.bind(e):n},n.default.prototype._legacyPreloadGenerator=function(e,t,r){var n=t.createBaseObject||i;return t=function(){var e=this;this._incrementPreload();for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];var s=n.apply(this,i);return r.apply(this,i).then((function(t){Object.assign(s,t),e._decrementPreload()})),s},e?t.bind(e):t}},{"./main":283,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.assign":183,"core-js/modules/es.object.to-string":190,"core-js/modules/es.promise":191,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/web.dom-collections.iterator":246}],289:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=(c=e("./main"))&&c.__esModule?c:{default:c},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r,n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var o;Object.prototype.hasOwnProperty.call(e,r)&&((o=i?Object.getOwnPropertyDescriptor(e,r):null)&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("./constants"));function s(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,s=function(){return e},e)}function a(e){return(a="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("./p5.Graphics"),e("./p5.Renderer2D"),e("../webgl/p5.RendererGL");var l="defaultCanvas0",c=(i.default.prototype.createCanvas=function(e,t,r,n){var s,a,c;if(i.default._validateParameters("createCanvas",arguments),arguments[2]instanceof HTMLCanvasElement?(r=o.P2D,n=arguments[2]):s=r||o.P2D,n)(c=document.getElementById(l))&&c.parentNode.removeChild(c),c=n,this._defaultGraphicsCreated=!1;else{if(s===o.WEBGL)(c=document.getElementById(l))&&(c.parentNode.removeChild(c),a=this._renderer,this._elements=this._elements.filter((function(e){return e!==a}))),(c=document.createElement("canvas")).id=l,c.classList.add("p5Canvas");else if(this._defaultGraphicsCreated)c=this.canvas;else{c=n||document.createElement("canvas");for(var u=0;document.getElementById("defaultCanvas".concat(u));)u++;l="defaultCanvas".concat(u),c.id=l,c.classList.add("p5Canvas")}this._setupDone||(c.dataset.hidden=!0,c.style.visibility="hidden"),(this._userNode||(0===document.getElementsByTagName("main").length&&(r=document.createElement("main"),document.body.appendChild(r)),document.getElementsByTagName("main")[0])).appendChild(c)}return s===o.WEBGL?(this._setProperty("_renderer",new i.default.RendererGL(c,this,!0)),this._elements.push(this._renderer),e=(n=this._renderer._adjustDimensions(e,t)).adjustedWidth,t=n.adjustedHeight):this._defaultGraphicsCreated||(this._setProperty("_renderer",new i.default.Renderer2D(c,this,!0)),this._defaultGraphicsCreated=!0,this._elements.push(this._renderer)),this._renderer.resize(e,t),this._renderer._applyDefaults(),this._renderer},i.default.prototype.resizeCanvas=function(e,t,r){if(i.default._validateParameters("resizeCanvas",arguments),this._renderer){var n,o,s,l={};for(n in this.drawingContext){var c=this.drawingContext[n];"object"!==a(c)&&"function"!=typeof c&&(l[n]=c)}for(s in this._renderer instanceof i.default.RendererGL&&(e=(o=this._renderer._adjustDimensions(e,t)).adjustedWidth,t=o.adjustedHeight),this.width=e,this.height=t,this._renderer.resize(e,t),l)try{this.drawingContext[s]=l[s]}catch(e){}r||this.redraw()}this._addAccsOutput()&&this._updateAccsOutput()},i.default.prototype.noCanvas=function(){this.canvas&&this.canvas.parentNode.removeChild(this.canvas)},i.default.prototype.createGraphics=function(e,t){for(var r=arguments.length,n=new Array(2<r?r-2:0),s=2;s<r;s++)n[s-2]=arguments[s];return n[0]instanceof HTMLCanvasElement&&(n[1]=n[0],n[0]=o.P2D),i.default._validateParameters("createGraphics",arguments),new i.default.Graphics(e,t,n[0],this,n[1])},i.default.prototype.createFramebuffer=function(e){return new i.default.Framebuffer(this,e)},i.default.prototype.clearDepth=function(e){this._assert3d("clearDepth"),this._renderer.clearDepth(e)},i.default.prototype.blendMode=function(e){i.default._validateParameters("blendMode",arguments),e===o.NORMAL&&(console.warn("NORMAL has been deprecated for use in blendMode. defaulting to BLEND instead."),e=o.BLEND),this._renderer.blendMode(e)},i.default);r.default=c},{"../webgl/p5.RendererGL":341,"./constants":272,"./main":283,"./p5.Graphics":285,"./p5.Renderer2D":287,"core-js/modules/es.array.filter":157,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],290:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.slice"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=c(e("../main")),s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../constants")),a=c(e("../helpers"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}function c(e){return e&&e.__esModule?e:{default:e}}e("../friendly_errors/fes_core"),e("../friendly_errors/file_errors"),e("../friendly_errors/validate_params"),o.default.prototype._normalizeArcAngles=function(e,t,r,n,i){var o;return e-=s.TWO_PI*Math.floor(e/s.TWO_PI),t-=s.TWO_PI*Math.floor(t/s.TWO_PI),o=Math.min(Math.abs(e-t),s.TWO_PI-Math.abs(e-t)),i&&(e=e<=s.HALF_PI?Math.atan(r/n*Math.tan(e)):e>s.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/n*Math.tan(e))+s.PI:Math.atan(r/n*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/n*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/n*Math.tan(t))+s.PI:Math.atan(r/n*Math.tan(t))+s.TWO_PI),t<e&&(t+=s.TWO_PI),{start:e,stop:t,correspondToSamePoint:o<1e-5}},o.default.prototype.arc=function(e,t,r,n,i,s,l,c){return o.default._validateParameters("arc",arguments),(this._renderer._doStroke||this._renderer._doFill)&&i!==s&&(i=this._toRadians(i),s=this._toRadians(s),e=a.default.modeAdjust(e,t,r,n,this._renderer._ellipseMode),(t=this._normalizeArcAngles(i,s,e.w,e.h,!0)).correspondToSamePoint?this._renderer.ellipse([e.x,e.y,e.w,e.h,c]):(this._renderer.arc(e.x,e.y,e.w,e.h,t.start,t.stop,l,c),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("arc",[e.x,e.y,e.w,e.h,t.start,t.stop,l]))),this},o.default.prototype.ellipse=function(e,t,r,n,i){return o.default._validateParameters("ellipse",arguments),this._renderEllipse.apply(this,arguments)},o.default.prototype.circle=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.default._validateParameters("circle",t);var n=t.slice(0,2);return n.push(t[2],t[2]),this._renderEllipse.apply(this,function(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(n))},o.default.prototype._renderEllipse=function(e,t,r,n,i){return(this._renderer._doStroke||this._renderer._doFill)&&(e=a.default.modeAdjust(e,t,r,n=void 0===n?r:n,this._renderer._ellipseMode),this._renderer.ellipse([e.x,e.y,e.w,e.h,i]),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("ellipse",[e.x,e.y,e.w,e.h])),this},o.default.prototype.line=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return o.default._validateParameters("line",r),this._renderer._doStroke&&(e=this._renderer).line.apply(e,r),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("line",r),this},o.default.prototype.point=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return o.default._validateParameters("point",r),this._renderer._doStroke&&(1===r.length&&r[0]instanceof o.default.Vector?this._renderer.point.call(this._renderer,r[0].x,r[0].y,r[0].z):((e=this._renderer).point.apply(e,r),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("point",r))),this},o.default.prototype.quad=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return o.default._validateParameters("quad",r),(this._renderer._doStroke||this._renderer._doFill)&&(this._renderer.isP3D&&r.length<12?this._renderer.quad.call(this._renderer,r[0],r[1],0,r[2],r[3],0,r[4],r[5],0,r[6],r[7],0,r[8],r[9]):((e=this._renderer).quad.apply(e,r),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("quadrilateral",r))),this},o.default.prototype.rect=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return o.default._validateParameters("rect",t),this._renderRect.apply(this,t)},o.default.prototype.square=function(e,t,r,n,i,s,a){return o.default._validateParameters("square",arguments),this._renderRect.call(this,e,t,r,r,n,i,s,a)},o.default.prototype._renderRect=function(){if(this._renderer._doStroke||this._renderer._doFill){3===arguments.length&&(arguments[3]=arguments[2]);for(var e=a.default.modeAdjust(arguments[0],arguments[1],arguments[2],arguments[3],this._renderer._rectMode),t=(this._renderer._rectMode===s.CORNER&&(e.w=arguments[2],e.h=arguments[3]),[e.x,e.y,e.w,e.h]),r=4;r<arguments.length;r++)t[r]=arguments[r];this._renderer.rect(t),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("rectangle",[e.x,e.y,e.w,e.h])}return this},o.default.prototype.triangle=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return o.default._validateParameters("triangle",t),(this._renderer._doStroke||this._renderer._doFill)&&this._renderer.triangle(t),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("triangle",t),this},e=o.default,r.default=e},{"../constants":272,"../friendly_errors/fes_core":274,"../friendly_errors/file_errors":275,"../friendly_errors/validate_params":278,"../helpers":279,"../main":283,"core-js/modules/es.array.from":162,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.slice":169,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],291:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(l=e("../main"))&&l.__esModule?l:{default:l},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}o.default.prototype.ellipseMode=function(e){return o.default._validateParameters("ellipseMode",arguments),e!==s.CORNER&&e!==s.CORNERS&&e!==s.RADIUS&&e!==s.CENTER||(this._renderer._ellipseMode=e),this},o.default.prototype.noSmooth=function(){return this._renderer.isP3D?this.setAttributes("antialias",!1):"imageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.imageSmoothingEnabled=!1),this},o.default.prototype.rectMode=function(e){return o.default._validateParameters("rectMode",arguments),e!==s.CORNER&&e!==s.CORNERS&&e!==s.RADIUS&&e!==s.CENTER||(this._renderer._rectMode=e),this},o.default.prototype.smooth=function(){return this._renderer.isP3D?this.setAttributes("antialias",!0):"imageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.imageSmoothingEnabled=!0),this},o.default.prototype.strokeCap=function(e){return o.default._validateParameters("strokeCap",arguments),e!==s.ROUND&&e!==s.SQUARE&&e!==s.PROJECT||this._renderer.strokeCap(e),this},o.default.prototype.strokeJoin=function(e){return o.default._validateParameters("strokeJoin",arguments),e!==s.ROUND&&e!==s.BEVEL&&e!==s.MITER||this._renderer.strokeJoin(e),this},o.default.prototype.strokeWeight=function(e){return o.default._validateParameters("strokeWeight",arguments),this._renderer.strokeWeight(e),this};var l=o.default;r.default=l},{"../constants":272,"../main":283,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],292:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(i=e("../main"))&&i.__esModule?i:{default:i};e("../friendly_errors/fes_core"),e("../friendly_errors/file_errors"),e("../friendly_errors/validate_params"),n.default.prototype.bezier=function(){for(var e,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return n.default._validateParameters("bezier",r),(this._renderer._doStroke||this._renderer._doFill)&&(e=this._renderer).bezier.apply(e,r),this},n.default.prototype.bezierDetail=function(e){return n.default._validateParameters("bezierDetail",arguments),this._bezierDetail=e,this},n.default.prototype.bezierPoint=function(e,t,r,i,o){n.default._validateParameters("bezierPoint",arguments);var s=1-o;return Math.pow(s,3)*e+3*Math.pow(s,2)*o*t+3*s*Math.pow(o,2)*r+Math.pow(o,3)*i},n.default.prototype.bezierTangent=function(e,t,r,i,o){n.default._validateParameters("bezierTangent",arguments);var s=1-o;return 3*i*Math.pow(o,2)-3*r*Math.pow(o,2)+6*r*s*o-6*t*s*o+3*t*Math.pow(s,2)-3*e*Math.pow(s,2)},n.default.prototype.curve=function(){for(var e,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return n.default._validateParameters("curve",r),this._renderer._doStroke&&(e=this._renderer).curve.apply(e,r),this},n.default.prototype.curveDetail=function(e){return n.default._validateParameters("curveDetail",arguments),this._curveDetail=e<3?3:e,this},n.default.prototype.curveTightness=function(e){return n.default._validateParameters("curveTightness",arguments),this._renderer._curveTightness=e,this},n.default.prototype.curvePoint=function(e,t,r,i,o){n.default._validateParameters("curvePoint",arguments);var s=this._renderer._curveTightness,a=o*o*o,l=o*o;return e*((s-1)/2*a+(1-s)*l+(s-1)/2*o)+t*((s+3)/2*a+(-5-s)/2*l+1)+r*((-3-s)/2*a+(s+2)*l+(1-s)/2*o)+i*((1-s)/2*a+(s-1)/2*l)},n.default.prototype.curveTangent=function(e,t,r,i,o){n.default._validateParameters("curveTangent",arguments);var s=this._renderer._curveTightness,a=o*o*3;return e*((s-1)/2*a+(1-s)*(o*=2)+(s-1)/2)+t*((s+3)/2*a+(-5-s)/2*o)+r*((-3-s)/2*a+(s+2)*o+(1-s)/2)+i*((1-s)/2*a+(s-1)/2*o)};var i=n.default;r.default=i},{"../friendly_errors/fes_core":274,"../friendly_errors/file_errors":275,"../friendly_errors/validate_params":278,"../main":283}],293:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.slice"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(y=e("../main"))&&y.__esModule?y:{default:y},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}var l=null,c=[],u=[],h=!1,d=!1,p=!1,f=!1,m=!0,y=(o.default.prototype.beginContour=function(){return this._renderer.isP3D?this._renderer.beginContour():(u=[],f=!0),this},o.default.prototype.beginShape=function(e){var t;return o.default._validateParameters("beginShape",arguments),this._renderer.isP3D?(t=this._renderer).beginShape.apply(t,arguments):(l=e===s.POINTS||e===s.LINES||e===s.TRIANGLES||e===s.TRIANGLE_FAN||e===s.TRIANGLE_STRIP||e===s.QUADS||e===s.QUAD_STRIP?e:null,c=[],u=[]),this},o.default.prototype.bezierVertex=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(o.default._validateParameters("bezierVertex",r),this._renderer.isP3D)(e=this._renderer).bezierVertex.apply(e,r);else if(0===c.length)o.default._friendlyError("vertex() must be used once before calling bezierVertex()","bezierVertex");else{h=!0;for(var i=[],s=0;s<r.length;s++)i[s]=r[s];i.isVert=!1,(f?u:c).push(i)}return this},o.default.prototype.curveVertex=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return o.default._validateParameters("curveVertex",r),this._renderer.isP3D?(e=this._renderer).curveVertex.apply(e,r):(d=!0,this.vertex(r[0],r[1])),this},o.default.prototype.endContour=function(){if(!this._renderer.isP3D){var e=u[0].slice();e.isVert=u[0].isVert,e.moveTo=!1,u.push(e),m&&(c.push(c[0]),m=!1);for(var t=0;t<u.length;t++)c.push(u[t])}return this},o.default.prototype.endShape=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;if(o.default._validateParameters("endShape",arguments),t<1&&(console.log("🌸 p5.js says: You can not have less than one instance"),t=1),this._renderer.isP3D)this._renderer.endShape(e,d,h,p,f,l,t);else{if(1!==t&&console.log("🌸 p5.js says: Instancing is only supported in WebGL2 mode"),0===c.length)return this;if(!this._renderer._doStroke&&!this._renderer._doFill)return this;(t=e===s.CLOSE)&&!f&&c.push(c[0]),this._renderer.endShape(e,c,d,h,p,f,l),m=!(f=p=h=d=!1),t&&c.pop()}return this},o.default.prototype.quadraticVertex=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(o.default._validateParameters("quadraticVertex",r),this._renderer.isP3D)(e=this._renderer).quadraticVertex.apply(e,r);else{if(this._contourInited)return(e={}).x=r[0],e.y=r[1],e.x3=r[2],e.y3=r[3],e.type=s.QUADRATIC,this._contourVertices.push(e),this;if(0<c.length){p=!0;for(var i=[],a=0;a<r.length;a++)i[a]=r[a];i.isVert=!1,(f?u:c).push(i)}else o.default._friendlyError("vertex() must be used once before calling quadraticVertex()","quadraticVertex")}return this},o.default.prototype.vertex=function(e,t,r,n,i){var o;return this._renderer.isP3D?(o=this._renderer).vertex.apply(o,arguments):((o=[]).isVert=!0,o[0]=e,o[1]=t,o[2]=0,o[3]=0,o[4]=0,o[5]=this._renderer._getFill(),o[6]=this._renderer._getStroke(),r&&(o.moveTo=r),(f?(0===u.length&&(o.moveTo=!0),u):c).push(o)),this},o.default.prototype.normal=function(e,t,r){var n;return this._assert3d("normal"),o.default._validateParameters("normal",arguments),(n=this._renderer).normal.apply(n,arguments),this},o.default);r.default=y},{"../constants":272,"../main":283,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.slice":169,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],294:[function(e,t,r){},{}],295:[function(e,t,r){"use strict";e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.assign"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("./main"))&&e.__esModule?e:{default:e}).default.prototype.noLoop=function(){this._loop=!1},e.default.prototype.loop=function(){this._loop||(this._loop=!0,this._setupDone&&this._draw())},e.default.prototype.isLooping=function(){return this._loop},e.default.prototype.push=function(){this._styles.push({props:{_colorMode:this._colorMode},renderer:this._renderer.push()})},e.default.prototype.pop=function(){var e=this._styles.pop();e?(this._renderer.pop(e.renderer),Object.assign(this,e.props)):console.warn("pop() was called without matching push()")},e.default.prototype.redraw=function(e){if(!this._inUserDraw&&this._setupDone){var t=parseInt(e),r=((isNaN(t)||t<1)&&(t=1),this._isGlobal?window:this);if("function"==typeof r.draw){void 0===r.setup&&r.scale(r._pixelDensity,r._pixelDensity);for(var n=0;n<t;n++){r.resetMatrix(),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._updateAccsOutput(),r._renderer.isP3D&&r._renderer._update(),r._setProperty("frameCount",r.frameCount+1),this.callRegisteredHooksFor("pre"),this._inUserDraw=!0;try{r.draw()}finally{this._inUserDraw=!1}this.callRegisteredHooksFor("post")}}}},e=e.default,r.default=e},{"./main":283,"core-js/modules/es.object.assign":183}],296:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("./main"))&&e.__esModule?e:{default:e};n.default.prototype.applyMatrix=function(){var e=(arguments.length<=0?void 0:arguments[0])instanceof Object.getPrototypeOf(Uint8Array);return Array.isArray(arguments.length<=0?void 0:arguments[0])||e?(e=this._renderer).applyMatrix.apply(e,function(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(arguments.length<=0?void 0:arguments[0])):(e=this._renderer).applyMatrix.apply(e,arguments),this},n.default.prototype.resetMatrix=function(){return this._renderer.resetMatrix(),this},n.default.prototype.rotate=function(e,t){return n.default._validateParameters("rotate",arguments),this._renderer.rotate(this._toRadians(e),t),this},n.default.prototype.rotateX=function(e){return this._assert3d("rotateX"),n.default._validateParameters("rotateX",arguments),this._renderer.rotateX(this._toRadians(e)),this},n.default.prototype.rotateY=function(e){return this._assert3d("rotateY"),n.default._validateParameters("rotateY",arguments),this._renderer.rotateY(this._toRadians(e)),this},n.default.prototype.rotateZ=function(e){return this._assert3d("rotateZ"),n.default._validateParameters("rotateZ",arguments),this._renderer.rotateZ(this._toRadians(e)),this},n.default.prototype.scale=function(e,t,r){var i;return n.default._validateParameters("scale",arguments),e instanceof n.default.Vector?(e=(i=e).x,t=i.y,r=i.z):Array.isArray(e)&&(e=(i=e)[0],t=i[1],r=i[2]||1),isNaN(t)?t=r=e:isNaN(r)&&(r=1),this._renderer.scale(e,t,r),this},n.default.prototype.shearX=function(e){return n.default._validateParameters("shearX",arguments),e=this._toRadians(e),this._renderer.applyMatrix(1,0,Math.tan(e),1,0,0),this},n.default.prototype.shearY=function(e){return n.default._validateParameters("shearY",arguments),e=this._toRadians(e),this._renderer.applyMatrix(1,Math.tan(e),0,1,0,0),this},n.default.prototype.translate=function(e,t,r){return n.default._validateParameters("translate",arguments),this._renderer.isP3D?this._renderer.translate(e,t,r):this._renderer.translate(e,t),this},e=n.default,r.default=e},{"./main":283,"core-js/modules/es.array.from":162,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-prototype-of":188,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.typed-array.copy-within":213,"core-js/modules/es.typed-array.every":214,"core-js/modules/es.typed-array.fill":215,"core-js/modules/es.typed-array.filter":216,"core-js/modules/es.typed-array.find":218,"core-js/modules/es.typed-array.find-index":217,"core-js/modules/es.typed-array.for-each":221,"core-js/modules/es.typed-array.includes":222,"core-js/modules/es.typed-array.index-of":223,"core-js/modules/es.typed-array.iterator":226,"core-js/modules/es.typed-array.join":227,"core-js/modules/es.typed-array.last-index-of":228,"core-js/modules/es.typed-array.map":229,"core-js/modules/es.typed-array.reduce":231,"core-js/modules/es.typed-array.reduce-right":230,"core-js/modules/es.typed-array.reverse":232,"core-js/modules/es.typed-array.set":233,"core-js/modules/es.typed-array.slice":234,"core-js/modules/es.typed-array.some":235,"core-js/modules/es.typed-array.sort":236,"core-js/modules/es.typed-array.subarray":237,"core-js/modules/es.typed-array.to-locale-string":238,"core-js/modules/es.typed-array.to-string":239,"core-js/modules/es.typed-array.uint8-array":242,"core-js/modules/web.dom-collections.iterator":246}],297:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.ends-with"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.ends-with"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator");var i=(e=e("../core/main"))&&e.__esModule?e:{default:e};function o(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(e){return(s="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}i.default.prototype.storeItem=function(e,t){"string"!=typeof e&&console.log("The argument that you passed to storeItem() - ".concat(e," is not a string.")),e.endsWith("p5TypeID")&&console.log("The argument that you passed to storeItem() - ".concat(e," must not end with 'p5TypeID'.")),void 0===t&&console.log("You cannot store undefined variables using storeItem().");var r=s(t);switch(r){case"number":case"boolean":t=t.toString();break;case"object":t instanceof i.default.Color?r="p5.Color":t instanceof i.default.Vector&&(r="p5.Vector",t=[t.x,t.y,t.z]),t=JSON.stringify(t)}localStorage.setItem(e,t),e="".concat(e,"p5TypeID"),localStorage.setItem(e,r)},i.default.prototype.getItem=function(e){var t=localStorage.getItem(e),r=localStorage.getItem("".concat(e,"p5TypeID"));if(void 0===r)console.log("Unable to determine type of item stored under ".concat(e,"in local storage. Did you save the item with something other than setItem()?"));else if(null!==t)switch(r){case"number":t=parseFloat(t);break;case"boolean":t="true"===t;break;case"object":t=JSON.parse(t);break;case"p5.Color":t=JSON.parse(t),t=this.color.apply(this,o(t.levels));break;case"p5.Vector":t=JSON.parse(t),t=this.createVector.apply(this,o(t))}return t},i.default.prototype.clearStorage=function(){var e=this;Object.keys(localStorage).forEach((function(t){t.endsWith("p5TypeID")&&e.removeItem(t.replace("p5TypeID",""))}))},i.default.prototype.removeItem=function(e){"string"!=typeof e&&console.log("The argument that you passed to removeItem() - ".concat(e," is not a string.")),localStorage.removeItem(e),localStorage.removeItem("".concat(e,"p5TypeID"))}},{"../core/main":283,"core-js/modules/es.array.for-each":161,"core-js/modules/es.array.from":162,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.keys":189,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.ends-with":198,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.replace":204,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/web.dom-collections.for-each":245,"core-js/modules/web.dom-collections.iterator":246}],298:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.object.keys"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};function s(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&&a(e,t)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){return function(){var t,r=c(e);if(t=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),1}catch(e){}}}()?(t=c(this).constructor,Reflect.construct(r,arguments,t)):r.apply(this,arguments),r=this,!t||"object"!==i(t)&&"function"!=typeof t){if(void 0!==r)return r;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(e,t,r){t&&h(e.prototype,t),r&&h(e,r)}o.default.prototype.createStringDict=function(e,t){return o.default._validateParameters("createStringDict",arguments),new o.default.StringDict(e,t)},o.default.prototype.createNumberDict=function(e,t){return o.default._validateParameters("createNumberDict",arguments),new o.default.NumberDict(e,t)},o.default.TypedDict=function(){function e(t,r){return u(this,e),t instanceof Object?this.data=t:(this.data={},this.data[t]=r),this}return d(e,[{key:"size",value:function(){return Object.keys(this.data).length}},{key:"hasKey",value:function(e){return this.data.hasOwnProperty(e)}},{key:"get",value:function(e){if(this.data.hasOwnProperty(e))return this.data[e];console.log("".concat(e," does not exist in this Dictionary"))}},{key:"set",value:function(e,t){this._validate(t)?this.data[e]=t:console.log("Those values dont work for this dictionary type.")}},{key:"_addObj",value:function(e){for(var t in e)this.set(t,e[t])}},{key:"create",value:function(e,t){e instanceof Object&&void 0===t?this._addObj(e):void 0!==e?this.set(e,t):console.log("In order to create a new Dictionary entry you must pass an object or a key, value pair")}},{key:"clear",value:function(){this.data={}}},{key:"remove",value:function(e){if(!this.data.hasOwnProperty(e))throw new Error("".concat(e," does not exist in this Dictionary"));delete this.data[e]}},{key:"print",value:function(){for(var e in this.data)console.log("key:".concat(e," value:").concat(this.data[e]))}},{key:"saveTable",value:function(e){var t,r="";for(t in this.data)r+="".concat(t,",").concat(this.data[t],"\n");var n=new Blob([r],{type:"text/csv"});o.default.prototype.downloadFile(n,e||"mycsv","csv")}},{key:"saveJSON",value:function(e,t){o.default.prototype.saveJSON(this.data,e,t)}},{key:"_validate",value:function(e){return!0}}]),e}(),o.default.StringDict=function(){s(t,o.default.TypedDict);var e=l(t);function t(){u(this,t);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.call.apply(e,[this].concat(n))}return d(t,[{key:"_validate",value:function(e){return"string"==typeof e}}]),t}(),o.default.NumberDict=function(){s(t,o.default.TypedDict);var e=l(t);function t(){u(this,t);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.call.apply(e,[this].concat(n))}return d(t,[{key:"_validate",value:function(e){return"number"==typeof e}},{key:"add",value:function(e,t){this.data.hasOwnProperty(e)?this.data[e]+=t:console.log("The key - ".concat(e," does not exist in this dictionary."))}},{key:"sub",value:function(e,t){this.add(e,-t)}},{key:"mult",value:function(e,t){this.data.hasOwnProperty(e)?this.data[e]*=t:console.log("The key - ".concat(e," does not exist in this dictionary."))}},{key:"div",value:function(e,t){this.data.hasOwnProperty(e)?this.data[e]/=t:console.log("The key - ".concat(e," does not exist in this dictionary."))}},{key:"_valueTest",value:function(e){if(0===Object.keys(this.data).length)throw new Error("Unable to search for a minimum or maximum value on an empty NumberDict");if(1===Object.keys(this.data).length)return this.data[Object.keys(this.data)[0]];var t,r=this.data[Object.keys(this.data)[0]];for(t in this.data)this.data[t]*e<r*e&&(r=this.data[t]);return r}},{key:"minValue",value:function(){return this._valueTest(1)}},{key:"maxValue",value:function(){return this._valueTest(-1)}},{key:"_keyTest",value:function(e){if(0===Object.keys(this.data).length)throw new Error("Unable to use minValue on an empty NumberDict");if(1===Object.keys(this.data).length)return Object.keys(this.data)[0];for(var t=Object.keys(this.data)[0],r=1;r<Object.keys(this.data).length;r++)Object.keys(this.data)[r]*e<t*e&&(t=Object.keys(this.data)[r]);return t}},{key:"minKey",value:function(){return this._keyTest(1)}},{key:"maxKey",value:function(){return this._keyTest(-1)}}]),t}(),e=o.default.TypedDict,r.default=e},{"../core/main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-prototype-of":188,"core-js/modules/es.object.keys":189,"core-js/modules/es.object.to-string":190,"core-js/modules/es.reflect.construct":192,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/web.dom-collections.iterator":246}],299:[function(t,r,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t("core-js/modules/es.symbol"),t("core-js/modules/es.symbol.description"),t("core-js/modules/es.symbol.iterator"),t("core-js/modules/es.array.every"),t("core-js/modules/es.array.filter"),t("core-js/modules/es.array.for-each"),t("core-js/modules/es.array.from"),t("core-js/modules/es.array.index-of"),t("core-js/modules/es.array.iterator"),t("core-js/modules/es.array.map"),t("core-js/modules/es.array.slice"),t("core-js/modules/es.array.splice"),t("core-js/modules/es.function.name"),t("core-js/modules/es.object.assign"),t("core-js/modules/es.object.get-prototype-of"),t("core-js/modules/es.object.to-string"),t("core-js/modules/es.promise"),t("core-js/modules/es.reflect.construct"),t("core-js/modules/es.regexp.exec"),t("core-js/modules/es.regexp.to-string"),t("core-js/modules/es.string.iterator"),t("core-js/modules/es.string.replace"),t("core-js/modules/es.string.split"),t("core-js/modules/es.string.trim"),t("core-js/modules/web.dom-collections.for-each"),t("core-js/modules/web.dom-collections.iterator"),t("core-js/modules/web.url"),t("core-js/modules/es.symbol"),t("core-js/modules/es.symbol.description"),t("core-js/modules/es.symbol.iterator"),t("core-js/modules/es.array.every"),t("core-js/modules/es.array.filter"),t("core-js/modules/es.array.for-each"),t("core-js/modules/es.array.from"),t("core-js/modules/es.array.index-of"),t("core-js/modules/es.array.iterator"),t("core-js/modules/es.array.map"),t("core-js/modules/es.array.slice"),t("core-js/modules/es.array.splice"),t("core-js/modules/es.function.name"),t("core-js/modules/es.object.assign"),t("core-js/modules/es.object.to-string"),t("core-js/modules/es.promise"),t("core-js/modules/es.regexp.exec"),t("core-js/modules/es.regexp.to-string"),t("core-js/modules/es.string.iterator"),t("core-js/modules/es.string.replace"),t("core-js/modules/es.string.split"),t("core-js/modules/es.string.trim"),t("core-js/modules/web.dom-collections.for-each"),t("core-js/modules/web.dom-collections.iterator"),t("core-js/modules/web.url"),Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=(t=t("../core/main"))&&t.__esModule?t:{default:t};function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t,r){t&&s(e.prototype,t),r&&s(e,r)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){return function(){var t,r,n=h(e);return t=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),1}catch(e){}}}()?(t=h(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(r=t)||"object"!==p(r)&&"function"!=typeof r?u(n):r}}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e){return(p="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}function f(e,t,r){return(t._userNode||document.body).appendChild(e),r=new(r?o.default.MediaElement:o.default.Element)(e,t),t._elements.push(r),r}o.default.prototype.select=function(e,t){return o.default._validateParameters("select",arguments),(t=this._getContainer(t).querySelector(e))?this._wrapElement(t):null},o.default.prototype.selectAll=function(e,t){o.default._validateParameters("selectAll",arguments);var r=[],n=this._getContainer(t).querySelectorAll(e);if(n)for(var i=0;i<n.length;i++){var s=this._wrapElement(n[i]);r.push(s)}return r},o.default.prototype._getContainer=function(e){var t=document;return"string"==typeof e?t=document.querySelector(e)||document:e instanceof o.default.Element?t=e.elt:e instanceof HTMLElement&&(t=e),t},o.default.prototype._wrapElement=function(e){var t,r=Array.prototype.slice.call(e.children);return"INPUT"===e.tagName&&"checkbox"===e.type?((t=new o.default.Element(e,this)).checked=function(){return 0===arguments.length?this.elt.checked:(this.elt.checked=!(arguments.length<=0||!arguments[0]),this)},t):"VIDEO"===e.tagName||"AUDIO"===e.tagName?new o.default.MediaElement(e,this):"SELECT"===e.tagName?this.createSelect(new o.default.Element(e,this)):0<r.length&&r.every((function(e){return"INPUT"===e.tagName||"LABEL"===e.tagName}))&&("DIV"===e.tagName||"SPAN"===e.tagName)?this.createRadio(new o.default.Element(e,this)):new o.default.Element(e,this)},o.default.prototype.removeElements=function(e){o.default._validateParameters("removeElements",arguments),this._elements.filter((function(e){return!(e.elt instanceof HTMLCanvasElement)})).map((function(e){return e.remove()}))},o.default.Element.prototype.changed=function(e){return o.default.Element._adjustListener("change",e,this),this},o.default.Element.prototype.input=function(e){return o.default.Element._adjustListener("input",e,this),this},o.default.prototype.createDiv=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("div");return t.innerHTML=e,f(t,this)},o.default.prototype.createP=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("p");return t.innerHTML=e,f(t,this)},o.default.prototype.createSpan=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("span");return t.innerHTML=e,f(t,this)},o.default.prototype.createImg=function(){o.default._validateParameters("createImg",arguments);var e,t=document.createElement("img"),r=arguments;return 1<r.length&&"string"==typeof r[1]&&(t.alt=r[1]),2<r.length&&"string"==typeof r[2]&&(t.crossOrigin=r[2]),t.src=r[0],e=f(t,this),t.addEventListener("load",(function(){e.width=t.offsetWidth||t.width,e.height=t.offsetHeight||t.height;var n=r[r.length-1];"function"==typeof n&&n(e)})),e},o.default.prototype.createA=function(e,t,r){o.default._validateParameters("createA",arguments);var n=document.createElement("a");return n.href=e,n.innerHTML=t,r&&(n.target=r),f(n,this)},o.default.prototype.createSlider=function(e,t,r,n){o.default._validateParameters("createSlider",arguments);var i=document.createElement("input");return i.type="range",i.min=e,i.max=t,0===n?i.step=1e-18:n&&(i.step=n),"number"==typeof r&&(i.value=r),f(i,this)},o.default.prototype.createButton=function(e,t){o.default._validateParameters("createButton",arguments);var r=document.createElement("button");return r.innerHTML=e,t&&(r.value=t),f(r,this)},o.default.prototype.createCheckbox=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.default._validateParameters("createCheckbox",t);var n=document.createElement("div"),i=document.createElement("input"),s=(i.type="checkbox",document.createElement("label")),a=(s.appendChild(i),n.appendChild(s),f(n,this));return a.checked=function(){var e=a.elt.firstElementChild.getElementsByTagName("input")[0];if(e){if(0===arguments.length)return e.checked;e.checked=!(arguments.length<=0||!arguments[0])}return a},this.value=function(e){return a.value=e,this},t[0]&&(a.value(t[0]),(n=document.createElement("span")).innerHTML=t[0],s.appendChild(n)),t[1]&&(i.checked=!0),a},o.default.prototype.createSelect=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];o.default._validateParameters("createSelect",r);var i,s=r[0];return s instanceof o.default.Element&&s.elt instanceof HTMLSelectElement?this.elt=(e=s).elt:s instanceof HTMLSelectElement?(e=f(s,this),this.elt=s):(i=document.createElement("select"),s&&"boolean"==typeof s&&i.setAttribute("multiple","true"),e=f(i,this),this.elt=i),e.option=function(e,t){var r;if(void 0!==e){for(var n,i=0;i<this.elt.length;i+=1)if(this.elt[i].textContent===e){r=i;break}void 0!==r?!1===t?this.elt.remove(r):this.elt[r].value=t:((n=document.createElement("option")).textContent=e,n.value=void 0===t?e:t,this.elt.appendChild(n),this._pInst._elements.push(n))}},e.selected=function(e){if(void 0!==e){for(var t=0;t<this.elt.length;t+=1)this.elt[t].value.toString()===e.toString()&&(this.elt.selectedIndex=t);return this}if(this.elt.getAttribute("multiple")){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=this.elt.selectedOptions[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var l=s.value;r.push(l.value)}}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}return this.elt.value},e.disable=function(e){if("string"==typeof e)for(var t=0;t<this.elt.length;t++)this.elt[t].value.toString()===e&&(this.elt[t].disabled=!0,this.elt[t].selected=!1);else this.elt.disabled=!0;return this},e.enable=function(e){if("string"==typeof e)for(var t=0;t<this.elt.length;t++)this.elt[t].value.toString()===e&&(this.elt[t].disabled=!1,this.elt[t].selected=!1);else{this.elt.disabled=!1;for(var r=0;r<this.elt.length;r++)this.elt[r].disabled=!1,this.elt[r].selected=!1}return this},e};var m=0;function y(e,t,r,n){var i=document.createElement(t),o=("string"==typeof(r=r||"")&&(r=[r]),!0),s=void(t=!1);try{for(var a,l=r[Symbol.iterator]();!(o=(a=l.next()).done);o=!0){var c=a.value,u=document.createElement("source");u.setAttribute("src",c),i.appendChild(u)}}catch(e){t=!0,s=e}finally{try{o||null==l.return||l.return()}finally{if(t)throw s}}"function"==typeof n&&i.addEventListener("canplaythrough",(function e(){n(),i.removeEventListener("canplaythrough",e)}));var h=f(i,e,!0);return h.loadedmetadata=!1,i.addEventListener("loadedmetadata",(function(){h.width=i.videoWidth,h.height=i.videoHeight,0===h.elt.width&&(h.elt.width=i.videoWidth),0===h.elt.height&&(h.elt.height=i.videoHeight),h.presetPlaybackRate&&(h.elt.playbackRate=h.presetPlaybackRate,delete h.presetPlaybackRate),h.loadedmetadata=!0})),h}function g(e,t,r,n){d(this,g),this.callback=e,this.time=t,this.id=r,this.val=n}o.default.prototype.createRadio=function(){function e(e){return e instanceof HTMLInputElement&&"radio"===e.type}function t(e){return e instanceof HTMLLabelElement}var r,n,i,s=arguments.length<=0?void 0:arguments[0];return s instanceof o.default.Element&&(s.elt instanceof HTMLDivElement||s.elt instanceof HTMLSpanElement)?(r=s,this.elt=s.elt):s instanceof HTMLDivElement||s instanceof HTMLSpanElement?(r=f(s,this),n=this.elt=s,"string"==typeof(arguments.length<=1?void 0:arguments[1])&&(i=arguments.length<=1?void 0:arguments[1])):("string"==typeof s&&(i=s),n=document.createElement("div"),r=f(n,this),this.elt=n),r._name=i||"radioOption_".concat(m++),r._getOptionsArray=function(){return Array.from(this.elt.children).filter((function(r){return e(r)||t(r)&&e(r.firstElementChild)})).map((function(t){return e(t)?t:t.firstElementChild}))},r.option=function(e,n){var i,o,s,a=!0,l=!1,c=void 0;try{for(var u,h=r._getOptionsArray()[Symbol.iterator]();!(a=(u=h.next()).done);a=!0){var d=u.value;if(d.value===e){i=d;break}}}catch(e){l=!0,c=e}finally{try{a||null==h.return||h.return()}finally{if(l)throw c}}return void 0===i&&((i=document.createElement("input")).setAttribute("type","radio"),i.setAttribute("value",e)),i.setAttribute("name",r._name),t(i.parentElement)?o=i.parentElement:(o=document.createElement("label")).insertAdjacentElement("afterbegin",i),o.lastElementChild instanceof HTMLSpanElement?s=o.lastElementChild:(s=document.createElement("span"),i.insertAdjacentElement("afterend",s)),s.innerHTML=void 0===n?e:n,this.elt.appendChild(o),i},r.remove=function(e){var n=!0,i=!1,o=void 0;try{for(var s,a=r._getOptionsArray()[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var l=s.value;if(l.value===e)return void(t(l.parentElement)?l.parentElement:l).remove()}}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}},r.value=function(){var e="",t=!0,n=!1,i=void 0;try{for(var o,s=r._getOptionsArray()[Symbol.iterator]();!(t=(o=s.next()).done);t=!0){var a=o.value;if(a.checked){e=a.value;break}}}catch(e){n=!0,i=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw i}}return e},r.selected=function(e){var t=null;if(void 0===e){var n=!0,i=!1,o=void 0;try{for(var s,a=r._getOptionsArray()[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var l=s.value;if(l.checked){t=l;break}}}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}}else{r._getOptionsArray().forEach((function(e){e.checked=!1,e.removeAttribute("checked")}));var c=!0;i=!1,o=void 0;try{for(var u,h=r._getOptionsArray()[Symbol.iterator]();!(c=(u=h.next()).done);c=!0){var d=u.value;d.value===e&&(d.setAttribute("checked",!0),d.checked=!0,t=d)}}catch(e){i=!0,o=e}finally{try{c||null==h.return||h.return()}finally{if(i)throw o}}}return t},r.disable=function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],t=!0,n=!1,i=void 0;try{for(var o,s=r._getOptionsArray()[Symbol.iterator]();!(t=(o=s.next()).done);t=!0)o.value.setAttribute("disabled",e)}catch(e){n=!0,i=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw i}}},r},o.default.prototype.createColorPicker=function(e){o.default._validateParameters("createColorPicker",arguments);var t=document.createElement("input");return t.type="color",e?e instanceof o.default.Color?t.value=e.toString("#rrggbb"):(o.default.prototype._colorMode="rgb",o.default.prototype._colorMaxes={rgb:[255,255,255,255],hsb:[360,100,100,1],hsl:[360,100,100,1]},t.value=o.default.prototype.color(e).toString("#rrggbb")):t.value="#000000",(t=f(t,this)).color=function(){return e&&(e.mode&&(o.default.prototype._colorMode=e.mode),e.maxes&&(o.default.prototype._colorMaxes=e.maxes)),o.default.prototype.color(this.elt.value)},t},o.default.prototype.createInput=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"text",r=(o.default._validateParameters("createInput",arguments),document.createElement("input"));return r.setAttribute("value",e),r.setAttribute("type",t),f(r,this)},o.default.prototype.createFileInput=function(e){var t,r=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(o.default._validateParameters("createFileInput",arguments),window.File&&window.FileReader&&window.FileList&&window.Blob)return(t=document.createElement("input")).setAttribute("type","file"),r&&t.setAttribute("multiple",!0),t.addEventListener("change",(function(t){var r=!0,n=!1,i=void 0;try{for(var s,a=t.target.files[Symbol.iterator]();!(r=(s=a.next()).done);r=!0){var l=s.value;o.default.File._load(l,e)}}catch(t){n=!0,i=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw i}}}),!1),f(t,this);console.log("The File APIs are not fully supported in this browser. Cannot create element.")},o.default.prototype.createVideo=function(e,t){return o.default._validateParameters("createVideo",arguments),y(this,"video",e,t)},o.default.prototype.createAudio=function(e,t){return o.default._validateParameters("createAudio",arguments),y(this,"audio",e,t)},o.default.prototype.VIDEO="video",o.default.prototype.AUDIO="audio",void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(e){var t=navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return t?new Promise((function(r,n){t.call(navigator,e,r,n)})):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),o.default.prototype.createCapture=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(o.default._validateParameters("createCapture",t),!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new DOMException("getUserMedia not supported in this browser");for(var n,i=!0,s=!0,a=!1,l=0,c=t;l<c.length;l++){var u=c[l];u===o.default.prototype.VIDEO?s=!1:u===o.default.prototype.AUDIO?i=!1:"object"===p(u)?(void 0!==u.flipped&&(a=u.flipped,delete u.flipped),h=Object.assign({},h,u)):"function"==typeof u&&(n=u)}var h=Object.assign({},{video:i,audio:s},h),d=document.createElement("video"),m=(d.setAttribute("playsinline",""),navigator.mediaDevices.getUserMedia(h).then((function(e){try{"srcObject"in d?d.srcObject=e:d.src=window.URL.createObjectURL(e)}catch(t){d.src=e}})).catch((function(e){"NotFoundError"===e.name&&o.default._friendlyError("No webcam found on this device","createCapture"),"NotAllowedError"===e.name&&o.default._friendlyError("Access to the camera was denied","createCapture"),console.error(e)})),f(d,this,!0));return m.loadedmetadata=!1,d.addEventListener("loadedmetadata",(function(){d.play(),d.width?(m.width=d.width,m.height=d.height,a&&(m.elt.style.transform="scaleX(-1)")):(m.width=m.elt.width=d.videoWidth,m.height=m.elt.height=d.videoHeight),m.loadedmetadata=!0,n&&n(d.srcObject)})),m.flipped=a,m},o.default.prototype.createElement=function(e,t){return o.default._validateParameters("createElement",arguments),e=document.createElement(e),void 0!==t&&(e.innerHTML=t),f(e,this)},o.default.Element.prototype.addClass=function(e){return this.elt.className?this.hasClass(e)||(this.elt.className=this.elt.className+" "+e):this.elt.className=e,this},o.default.Element.prototype.removeClass=function(e){return this.elt.classList.remove(e),this},o.default.Element.prototype.hasClass=function(e){return this.elt.classList.contains(e)},o.default.Element.prototype.toggleClass=function(e){return this.elt.classList.contains(e)?this.elt.classList.remove(e):this.elt.classList.add(e),this},o.default.Element.prototype.child=function(e){return void 0===e?this.elt.childNodes:("string"==typeof e?("#"===e[0]&&(e=e.substring(1)),e=document.getElementById(e)):e instanceof o.default.Element&&(e=e.elt),e instanceof HTMLElement&&this.elt.appendChild(e),this)},o.default.Element.prototype.center=function(e){var t=this.elt.style.display,r="none"===this.elt.style.display,n="none"===this.parent().style.display,i={x:this.elt.offsetLeft,y:this.elt.offsetTop},o=(r&&this.show(),n&&this.parent().show(),this.elt.style.display="block",this.position(0,0),Math.abs(this.parent().offsetWidth-this.elt.offsetWidth)),s=Math.abs(this.parent().offsetHeight-this.elt.offsetHeight);return"both"===e||void 0===e?this.position(o/2+this.parent().offsetLeft,s/2+this.parent().offsetTop):"horizontal"===e?this.position(o/2+this.parent().offsetLeft,i.y):"vertical"===e&&this.position(i.x,s/2+this.parent().offsetTop),this.style("display",t),r&&this.hide(),n&&this.parent().hide(),this},o.default.Element.prototype.html=function(){return 0===arguments.length?this.elt.innerHTML:(arguments.length<=1||!arguments[1]?this.elt.innerHTML=arguments.length<=0?void 0:arguments[0]:this.elt.insertAdjacentHTML("beforeend",arguments.length<=0?void 0:arguments[0]),this)},o.default.Element.prototype.position=function(){return 0===arguments.length?{x:this.elt.offsetLeft,y:this.elt.offsetTop}:(this.elt.style.position="static"!==(arguments.length<=2?void 0:arguments[2])&&"fixed"!==(arguments.length<=2?void 0:arguments[2])&&"relative"!==(arguments.length<=2?void 0:arguments[2])&&"sticky"!==(arguments.length<=2?void 0:arguments[2])&&"initial"!==(arguments.length<=2?void 0:arguments[2])&&"inherit"!==(arguments.length<=2?void 0:arguments[2])?"absolute":arguments.length<=2?void 0:arguments[2],this.elt.style.left=(arguments.length<=0?void 0:arguments[0])+"px",this.elt.style.top=(arguments.length<=1?void 0:arguments[1])+"px",this.x=arguments.length<=0?void 0:arguments[0],this.y=arguments.length<=1?void 0:arguments[1],this)},o.default.Element.prototype._translate=function(){this.elt.style.position="absolute";var e="";return this.elt.style.transform&&(e=(e=this.elt.style.transform.replace(/translate3d\(.*\)/g,"")).replace(/translate[X-Z]?\(.*\)/g,"")),2===arguments.length?this.elt.style.transform="translate("+(arguments.length<=0?void 0:arguments[0])+"px, "+(arguments.length<=1?void 0:arguments[1])+"px)":2<arguments.length&&(this.elt.style.transform="translate3d("+(arguments.length<=0?void 0:arguments[0])+"px,"+(arguments.length<=1?void 0:arguments[1])+"px,"+(arguments.length<=2?void 0:arguments[2])+"px)",this.elt.parentElement.style.perspective=3===arguments.length?"1000px":(arguments.length<=3?void 0:arguments[3])+"px"),this.elt.style.transform+=e,this},o.default.Element.prototype._rotate=function(){var e="";return this.elt.style.transform&&(e=(e=this.elt.style.transform.replace(/rotate3d\(.*\)/g,"")).replace(/rotate[X-Z]?\(.*\)/g,"")),1===arguments.length?this.elt.style.transform="rotate("+(arguments.length<=0?void 0:arguments[0])+"deg)":2===arguments.length?this.elt.style.transform="rotate("+(arguments.length<=0?void 0:arguments[0])+"deg, "+(arguments.length<=1?void 0:arguments[1])+"deg)":3===arguments.length&&(this.elt.style.transform="rotateX("+(arguments.length<=0?void 0:arguments[0])+"deg)",this.elt.style.transform+="rotateY("+(arguments.length<=1?void 0:arguments[1])+"deg)",this.elt.style.transform+="rotateZ("+(arguments.length<=2?void 0:arguments[2])+"deg)"),this.elt.style.transform+=e,this},o.default.Element.prototype.style=function(e,t){if(void 0===(t=t instanceof o.default.Color?"rgba("+t.levels[0]+","+t.levels[1]+","+t.levels[2]+","+t.levels[3]/255+")":t)){if(-1===e.indexOf(":"))return window.getComputedStyle(this.elt).getPropertyValue(e);for(var r=e.split(";"),n=0;n<r.length;n++){var i=r[n].split(":");i[0]&&i[1]&&(this.elt.style[i[0].trim()]=i[1].trim())}}else this.elt.style[e]=t,"width"!==e&&"height"!==e&&"left"!==e&&"top"!==e||(t=window.getComputedStyle(this.elt).getPropertyValue(e).replace(/[^\d.]/g,""),this[e]=Math.round(parseFloat(t,10)));return this},o.default.Element.prototype.attribute=function(e,t){if(null==this.elt.firstChild||"checkbox"!==this.elt.firstChild.type&&"radio"!==this.elt.firstChild.type)return void 0===t?this.elt.getAttribute(e):(this.elt.setAttribute(e,t),this);if(void 0===t)return this.elt.firstChild.getAttribute(e);for(var r=0;r<this.elt.childNodes.length;r++)this.elt.childNodes[r].setAttribute(e,t)},o.default.Element.prototype.removeAttribute=function(e){if(null!=this.elt.firstChild&&("checkbox"===this.elt.firstChild.type||"radio"===this.elt.firstChild.type))for(var t=0;t<this.elt.childNodes.length;t++)this.elt.childNodes[t].removeAttribute(e);return this.elt.removeAttribute(e),this},o.default.Element.prototype.value=function(){return 0<arguments.length?(this.elt.value=arguments.length<=0?void 0:arguments[0],this):"range"===this.elt.type?parseFloat(this.elt.value):this.elt.value},o.default.Element.prototype.show=function(){return this.elt.style.display="block",this},o.default.Element.prototype.hide=function(){return this.elt.style.display="none",this},o.default.Element.prototype.size=function(e,t){if(0===arguments.length)return{width:this.elt.offsetWidth,height:this.elt.offsetHeight};var r=e,n=t,i=o.default.prototype.AUTO;if(r!==i||n!==i){if(r===i?r=t*this.width/this.height:n===i&&(n=e*this.height/this.width),this.elt instanceof HTMLCanvasElement){var s,a={},l=this.elt.getContext("2d");for(s in l)a[s]=l[s];for(s in this.elt.setAttribute("width",r*this._pInst._pixelDensity),this.elt.setAttribute("height",n*this._pInst._pixelDensity),this.elt.style.width=r+"px",this.elt.style.height=n+"px",this._pInst.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),a)this.elt.getContext("2d")[s]=a[s]}else this.elt.style.width=r+"px",this.elt.style.height=n+"px",this.elt.width=r,this.elt.height=n;this.width=r,this.height=n,this._pInst&&this._pInst._curElement&&this._pInst._curElement.elt===this.elt&&(this._pInst._setProperty("width",r),this._pInst._setProperty("height",n))}return this},o.default.Element.prototype.remove=function(){this instanceof o.default.MediaElement&&(this.stop(),null!==(t=this.elt.srcObject)&&t.getTracks().forEach((function(e){e.stop()})));var e,t=this._pInst._elements.indexOf(this);for(e in-1!==t&&this._pInst._elements.splice(t,1),this._events)this.elt.removeEventListener(e,this._events[e]);this.elt&&this.elt.parentNode&&this.elt.parentNode.removeChild(this.elt)},o.default.Element.prototype.drop=function(e,t){var r;return window.File&&window.FileReader&&window.FileList&&window.Blob?(this._dragDisabled||(this._dragDisabled=!0,this.elt.addEventListener("dragover",r=function(e){e.preventDefault()}),this.elt.addEventListener("dragleave",r)),o.default.Element._attachListener("drop",(function(r){r.preventDefault(),"function"==typeof t&&t.call(this,r),r=r.dataTransfer.files;var n=!0,i=!1,s=void 0;try{for(var a,l=r[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){var c=a.value;o.default.File._load(c,e)}}catch(r){i=!0,s=r}finally{try{n||null==l.return||l.return()}finally{if(i)throw s}}}),this)):console.log("The File APIs are not fully supported in this browser."),this},o.default.Element.prototype.draggable=function(e){var t,r="ontouchstart"in window,n=0,i=0,o=0,s=0,a=r?"touchend":"mouseup",l=r?"touchmove":"mousemove";function c(t){var a;t=t||window.event,s=r?(a=t.changedTouches,n=o-parseInt(a[0].clientX),i=s-parseInt(a[0].clientY),o=parseInt(a[0].clientX),parseInt(a[0].clientY)):(n=o-parseInt(t.clientX),i=s-parseInt(t.clientY),o=parseInt(t.clientX),parseInt(t.clientY)),e.style.left=e.offsetLeft-n+"px",e.style.top=e.offsetTop-i+"px"}function u(){document.removeEventListener(a,u,!1),document.removeEventListener(l,c,!1)}return void 0===e?t=e=this.elt:e!==this.elt&&e.elt!==this.elt&&(e=e.elt,t=this.elt),t.addEventListener(r?"touchstart":"mousedown",(function(e){var t;return e=e||window.event,s=r?(t=e.changedTouches,o=parseInt(t[0].clientX),parseInt(t[0].clientY)):(o=parseInt(e.clientX),parseInt(e.clientY)),document.addEventListener(a,u,!1),document.addEventListener(l,c,!1),!1}),!1),t.style.cursor="move",this},t=function(t){var r=i;if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),t&&l(r,t);var n=c(i);function i(e,t){d(this,i);var r=u(t=n.call(this,e,t));return t.elt.crossOrigin="anonymous",t._prevTime=0,t._cueIDCounter=0,t._cues=[],t.pixels=[],t._pixelsState=u(t),t._pixelDensity=1,t._modified=!1,t._frameOnCanvas=-1,Object.defineProperty(r,"src",{get:function(){var e=r.elt.children[0].src,t=r.elt.src===window.location.href?"":r.elt.src;return e===window.location.href?t:e},set:function(t){for(var n=0;n<r.elt.children.length;n++)r.elt.removeChild(r.elt.children[n]);var i=document.createElement("source");i.src=t,e.appendChild(i),r.elt.src=t,r.modified=!0}}),r._onended=function(){},r.elt.onended=function(){r._onended(r)},t}return a(i,[{key:"play",value:function(){var e;return this.elt.currentTime===this.elt.duration&&(this.elt.currentTime=0),1<this.elt.readyState||this.elt.load(),(e=this.elt.play())&&e.catch&&e.catch((function(e){"NotAllowedError"===e.name?console.error(e):console.error("Media play method encountered an unexpected error",e)})),this}},{key:"stop",value:function(){return this.elt.pause(),this.elt.currentTime=0,this}},{key:"pause",value:function(){return this.elt.pause(),this}},{key:"loop",value:function(){return this.elt.setAttribute("loop",!0),this.play(),this}},{key:"noLoop",value:function(){return this.elt.removeAttribute("loop"),this}},{key:"_setupAutoplayFailDetection",value:function(){var t=setTimeout((function(){console.error(e)}),500);this.elt.addEventListener("play",(function(){return clearTimeout(t)}),{passive:!0,once:!0})}},{key:"autoplay",value:function(e){var t=this,r=this.elt.getAttribute("autoplay");return this.elt.setAttribute("autoplay",e),e&&!r&&(e=function(){return t._setupAutoplayFailDetection()},4===this.elt.readyState?e():this.elt.addEventListener("canplay",e,{passive:!0,once:!0})),this}},{key:"volume",value:function(e){if(void 0===e)return this.elt.volume;this.elt.volume=e}},{key:"speed",value:function(e){if(void 0===e)return this.presetPlaybackRate||this.elt.playbackRate;this.loadedmetadata?this.elt.playbackRate=e:this.presetPlaybackRate=e}},{key:"time",value:function(e){return void 0===e?this.elt.currentTime:(this.elt.currentTime=e,this)}},{key:"duration",value:function(){return this.elt.duration}},{key:"_ensureCanvas",value:function(){this.canvas||(this.canvas=document.createElement("canvas"),this.drawingContext=this.canvas.getContext("2d"),this.setModified(!0));var e=this._frameOnCanvas!==this._pInst.frameCount;this.loadedmetadata&&e&&(this.canvas.width!==this.elt.width&&(this.canvas.width=this.elt.width,this.canvas.height=this.elt.height,this.width=this.canvas.width,this.height=this.canvas.height),this.drawingContext.clearRect(0,0,this.canvas.width,this.canvas.height),!0===this.flipped&&(this.drawingContext.save(),this.drawingContext.scale(-1,1),this.drawingContext.translate(-this.canvas.width,0)),this.drawingContext.drawImage(this.elt,0,0,this.canvas.width,this.canvas.height),!0===this.flipped&&this.drawingContext.restore(),this.setModified(!0),this._frameOnCanvas=this._pInst.frameCount)}},{key:"loadPixels",value:function(){this._ensureCanvas();for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return o.default.Renderer2D.prototype.loadPixels.apply(this,t)}},{key:"updatePixels",value:function(e,t,r,n){return this.loadedmetadata&&(this._ensureCanvas(),o.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,n)),this.setModified(!0),this}},{key:"get",value:function(){this._ensureCanvas();for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return o.default.Renderer2D.prototype.get.apply(this,t)}},{key:"_getPixel",value:function(){this.loadPixels();for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return o.default.Renderer2D.prototype._getPixel.apply(this,t)}},{key:"set",value:function(e,t,r){this.loadedmetadata&&(this._ensureCanvas(),o.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0))}},{key:"copy",value:function(){this._ensureCanvas();for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.default.prototype.copy.apply(this,t)}},{key:"mask",value:function(){this.loadPixels(),this.setModified(!0);for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.default.Image.prototype.mask.apply(this,t)}},{key:"isModified",value:function(){return this._modified}},{key:"setModified",value:function(e){this._modified=e}},{key:"onended",value:function(e){return this._onended=e,this}},{key:"connect",value:function(e){var t,r;if("function"==typeof o.default.prototype.getAudioContext)t=o.default.prototype.getAudioContext(),r=o.default.soundOut.input;else try{r=(t=e.context).destination}catch(e){throw"connect() is meant to be used with Web Audio API or p5.sound.js"}this.audioSourceNode||(this.audioSourceNode=t.createMediaElementSource(this.elt),this.audioSourceNode.connect(r)),e?e.input?this.audioSourceNode.connect(e.input):this.audioSourceNode.connect(e):this.audioSourceNode.connect(r)}},{key:"disconnect",value:function(){if(!this.audioSourceNode)throw"nothing to disconnect";this.audioSourceNode.disconnect()}},{key:"showControls",value:function(){this.elt.style["text-align"]="inherit",this.elt.controls=!0}},{key:"hideControls",value:function(){this.elt.controls=!1}},{key:"addCue",value:function(e,t,r){var n=this._cueIDCounter++;return t=new g(t,e,n,r),this._cues.push(t),this.elt.ontimeupdate||(this.elt.ontimeupdate=this._onTimeUpdate.bind(this)),n}},{key:"removeCue",value:function(e){for(var t=0;t<this._cues.length;t++)this._cues[t].id===e&&(console.log(e),this._cues.splice(t,1));0===this._cues.length&&(this.elt.ontimeupdate=null)}},{key:"clearCues",value:function(){this._cues=[],this.elt.ontimeupdate=null}},{key:"_onTimeUpdate",value:function(){for(var e=this.time(),t=0;t<this._cues.length;t++){var r=this._cues[t].time,n=this._cues[t].val;this._prevTime<r&&r<=e&&this._cues[t].callback(n)}this._prevTime=e}}]),i}(o.default.Element),o.default.MediaElement=t,t=function(){function e(t,r){d(this,e),this.file=t,this._pInst=r,r=t.type.split("/"),this.type=r[0],this.subtype=r[1],this.name=t.name,this.size=t.size,this.data=void 0}return a(e,null,[{key:"_createLoader",value:function(e,t){var r=new FileReader;return r.onload=function(r){var n,i=new o.default.File(e);"application/json"===i.file.type?i.data=JSON.parse(r.target.result):"text/xml"===i.file.type?(n=(new DOMParser).parseFromString(r.target.result,"text/xml"),i.data=new o.default.XML(n.documentElement)):i.data=r.target.result,t(i)},r}},{key:"_load",value:function(e,t){var r;/^text\//.test(e.type)||"application/json"===e.type?o.default.File._createLoader(e,t).readAsText(e):/^(video|audio)\//.test(e.type)?((r=new o.default.File(e)).data=URL.createObjectURL(e),t(r)):o.default.File._createLoader(e,t).readAsDataURL(e)}}]),e}(),o.default.File=t,t=o.default,n.default=t},{"../core/main":283,"core-js/modules/es.array.every":155,"core-js/modules/es.array.filter":157,"core-js/modules/es.array.for-each":161,"core-js/modules/es.array.from":162,"core-js/modules/es.array.index-of":164,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.map":168,"core-js/modules/es.array.slice":169,"core-js/modules/es.array.splice":171,"core-js/modules/es.function.name":174,"core-js/modules/es.object.assign":183,"core-js/modules/es.object.get-prototype-of":188,"core-js/modules/es.object.to-string":190,"core-js/modules/es.promise":191,"core-js/modules/es.reflect.construct":192,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.replace":204,"core-js/modules/es.string.split":206,"core-js/modules/es.string.trim":209,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/web.dom-collections.for-each":245,"core-js/modules/web.dom-collections.iterator":246,"core-js/modules/web.url":248}],300:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};n.default.prototype.deviceOrientation=1<window.innerWidth/window.innerHeight?"landscape":"portrait",n.default.prototype.accelerationX=0,n.default.prototype.accelerationY=0,n.default.prototype.accelerationZ=0,n.default.prototype.pAccelerationX=0,n.default.prototype.pAccelerationY=0,n.default.prototype.pAccelerationZ=0,n.default.prototype._updatePAccelerations=function(){this._setProperty("pAccelerationX",this.accelerationX),this._setProperty("pAccelerationY",this.accelerationY),this._setProperty("pAccelerationZ",this.accelerationZ)},n.default.prototype.rotationX=0,n.default.prototype.rotationY=0,n.default.prototype.rotationZ=0,n.default.prototype.pRotationX=0,n.default.prototype.pRotationY=0;var i=n.default.prototype.pRotationZ=0,o=0,s=0,a="clockwise",l="clockwise",c="clockwise",u=(n.default.prototype.pRotateDirectionX=void 0,n.default.prototype.pRotateDirectionY=void 0,n.default.prototype.pRotateDirectionZ=void 0,n.default.prototype._updatePRotations=function(){this._setProperty("pRotationX",this.rotationX),this._setProperty("pRotationY",this.rotationY),this._setProperty("pRotationZ",this.rotationZ)},n.default.prototype.turnAxis=void 0,.5),h=30;n.default.prototype.setMoveThreshold=function(e){n.default._validateParameters("setMoveThreshold",arguments),u=e},n.default.prototype.setShakeThreshold=function(e){n.default._validateParameters("setShakeThreshold",arguments),h=e},n.default.prototype._ondeviceorientation=function(e){this._updatePRotations(),this._setProperty("rotationX",this._fromDegrees(e.beta)),this._setProperty("rotationY",this._fromDegrees(e.gamma)),this._setProperty("rotationZ",this._fromDegrees(e.alpha)),this._handleMotion()},n.default.prototype._ondevicemotion=function(e){this._updatePAccelerations(),this._setProperty("accelerationX",2*e.acceleration.x),this._setProperty("accelerationY",2*e.acceleration.y),this._setProperty("accelerationZ",2*e.acceleration.z),this._handleMotion()},n.default.prototype._handleMotion=function(){90===window.orientation||-90===window.orientation?this._setProperty("deviceOrientation","landscape"):0===window.orientation?this._setProperty("deviceOrientation","portrait"):void 0===window.orientation&&this._setProperty("deviceOrientation","undefined");var e,t,r,n,d,p=this._isGlobal?window:this;"function"==typeof p.deviceMoved&&(Math.abs(this.accelerationX-this.pAccelerationX)>u||Math.abs(this.accelerationY-this.pAccelerationY)>u||Math.abs(this.accelerationZ-this.pAccelerationZ)>u)&&p.deviceMoved(),"function"==typeof p.deviceTurned&&(t=this._toDegrees(this.rotationX)+180,r=this._toDegrees(this.pRotationX)+180,e=i+180,0<t-r&&t-r<270||t-r<-270?a="clockwise":(t-r<0||270<t-r)&&(a="counter-clockwise"),a!==this.pRotateDirectionX&&(e=t),90<Math.abs(t-e)&&Math.abs(t-e)<270&&(e=t,this._setProperty("turnAxis","X"),p.deviceTurned()),this.pRotateDirectionX=a,i=e-180,r=this._toDegrees(this.rotationY)+180,t=this._toDegrees(this.pRotationY)+180,e=o+180,0<r-t&&r-t<270||r-t<-270?l="clockwise":(r-t<0||270<r-this.pRotationY)&&(l="counter-clockwise"),l!==this.pRotateDirectionY&&(e=r),90<Math.abs(r-e)&&Math.abs(r-e)<270&&(e=r,this._setProperty("turnAxis","Y"),p.deviceTurned()),this.pRotateDirectionY=l,o=e-180,0<(t=this._toDegrees(this.rotationZ))-(r=this._toDegrees(this.pRotationZ))&&t-r<270||t-r<-270?c="clockwise":(t-r<0||270<t-r)&&(c="counter-clockwise"),c!==this.pRotateDirectionZ&&(s=t),90<Math.abs(t-s)&&Math.abs(t-s)<270&&(s=t,this._setProperty("turnAxis","Z"),p.deviceTurned()),this.pRotateDirectionZ=c,this._setProperty("turnAxis",void 0)),"function"==typeof p.deviceShaken&&(null!==this.pAccelerationX&&(n=Math.abs(this.accelerationX-this.pAccelerationX),d=Math.abs(this.accelerationY-this.pAccelerationY)),h<n+d&&p.deviceShaken())},e=n.default,r.default=e},{"../core/main":283}],301:[function(e,t,r){"use strict";e("core-js/modules/es.array.for-each"),e("core-js/modules/es.string.repeat"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.string.repeat"),e("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};n.default.prototype.isKeyPressed=!1,n.default.prototype.keyIsPressed=!1,n.default.prototype.key="",n.default.prototype.keyCode=0,n.default.prototype._onkeydown=function(e){var t;e.repeat||(this._setProperty("isKeyPressed",!0),this._setProperty("keyIsPressed",!0),this._setProperty("keyCode",e.which),this._downKeys[e.which]=!0,this._setProperty("key",e.key||String.fromCharCode(e.which)||e.which),e.metaKey&&(this._metaKeys||(this._metaKeys=[]),this._metaKeys.push(e.which)),"function"!=typeof(t=this._isGlobal?window:this).keyPressed||e.charCode||!1===t.keyPressed(e)&&e.preventDefault())},n.default.prototype._onkeyup=function(e){var t=this,r=(this._setProperty("isKeyPressed",!1),this._setProperty("keyIsPressed",!1),this._setProperty("_lastKeyCodePressed",this._keyCode),this._downKeys[e.which]=!1,"Meta"===e.key&&this._metaKeys&&(this._metaKeys.forEach((function(e){t._downKeys[e]=!1})),this._metaKeys=[]),this._isGlobal?window:this);"function"==typeof r.keyReleased&&!1===r.keyReleased(e)&&e.preventDefault()},n.default.prototype._onkeypress=function(e){var t;e.which!==this._lastKeyCodeTyped&&(this._setProperty("_lastKeyCodeTyped",e.which),this._setProperty("key",e.key||String.fromCharCode(e.which)||e.which),"function"==typeof(t=this._isGlobal?window:this).keyTyped&&!1===t.keyTyped(e)&&e.preventDefault())},n.default.prototype._onblur=function(e){this._downKeys={}},n.default.prototype.keyIsDown=function(e){return n.default._validateParameters("keyIsDown",arguments),this._downKeys[e]||!1},n.default.prototype._areDownKeys=function(){for(var e in this._downKeys)if(this._downKeys.hasOwnProperty(e)&&!0===this._downKeys[e])return!0;return!1},e=n.default,r.default=e},{"../core/main":283,"core-js/modules/es.array.for-each":161,"core-js/modules/es.string.repeat":203,"core-js/modules/web.dom-collections.for-each":245}],302:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(o=e("../core/main"))&&o.__esModule?o:{default:o},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}o.default.prototype.movedX=0,o.default.prototype.movedY=0,o.default.prototype._hasMouseInteracted=!1,o.default.prototype.mouseX=0,o.default.prototype.mouseY=0,o.default.prototype.pmouseX=0,o.default.prototype.pmouseY=0,o.default.prototype.winMouseX=0,o.default.prototype.winMouseY=0,o.default.prototype.pwinMouseX=0,o.default.prototype.pwinMouseY=0,o.default.prototype.mouseButton=0,o.default.prototype.mouseIsPressed=!1,o.default.prototype._updateNextMouseCoords=function(e){var t,r,n,i,o;null!==this._curElement&&(!e.touches||0<e.touches.length)&&(t=this._curElement.elt,r=this.width,n=this.height,(i=e)&&!i.clientX&&(i.touches?i=i.touches[0]:i.changedTouches&&(i=i.changedTouches[0])),o=t.getBoundingClientRect(),r=t.scrollWidth/r||1,t=t.scrollHeight/n||1,n={x:(i.clientX-o.left)/r,y:(i.clientY-o.top)/t,winX:i.clientX,winY:i.clientY,id:i.identifier},this._setProperty("movedX",e.movementX),this._setProperty("movedY",e.movementY),this._setProperty("mouseX",n.x),this._setProperty("mouseY",n.y),this._setProperty("winMouseX",n.winX),this._setProperty("winMouseY",n.winY)),this._hasMouseInteracted||(this._updateMouseCoords(),this._setProperty("_hasMouseInteracted",!0))},o.default.prototype._updateMouseCoords=function(){this._setProperty("pmouseX",this.mouseX),this._setProperty("pmouseY",this.mouseY),this._setProperty("pwinMouseX",this.winMouseX),this._setProperty("pwinMouseY",this.winMouseY),this._setProperty("_pmouseWheelDeltaY",this._mouseWheelDeltaY)},o.default.prototype._setMouseButton=function(e){1===e.button?this._setProperty("mouseButton",s.CENTER):2===e.button?this._setProperty("mouseButton",s.RIGHT):this._setProperty("mouseButton",s.LEFT)},o.default.prototype._onmousemove=function(e){var t=this._isGlobal?window:this;this._updateNextMouseCoords(e),this.mouseIsPressed?"function"==typeof t.mouseDragged?!1===t.mouseDragged(e)&&e.preventDefault():"function"==typeof t.touchMoved&&!1===t.touchMoved(e)&&e.preventDefault():"function"==typeof t.mouseMoved&&!1===t.mouseMoved(e)&&e.preventDefault()},o.default.prototype._onmousedown=function(e){var t=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!0),this._setMouseButton(e),this._updateNextMouseCoords(e),this.touchstart||("function"==typeof t.mousePressed?!1===t.mousePressed(e)&&e.preventDefault():"function"==typeof t.touchStarted&&!1===t.touchStarted(e)&&e.preventDefault(),this.touchstart=!1)},o.default.prototype._onmouseup=function(e){var t=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!1),this.touchend||("function"==typeof t.mouseReleased?!1===t.mouseReleased(e)&&e.preventDefault():"function"==typeof t.touchEnded&&!1===t.touchEnded(e)&&e.preventDefault(),this.touchend=!1)},o.default.prototype._ondragend=o.default.prototype._onmouseup,o.default.prototype._ondragover=o.default.prototype._onmousemove,o.default.prototype._onclick=function(e){var t=this._isGlobal?window:this;"function"==typeof t.mouseClicked&&!1===t.mouseClicked(e)&&e.preventDefault()},o.default.prototype._ondblclick=function(e){var t=this._isGlobal?window:this;"function"==typeof t.doubleClicked&&!1===t.doubleClicked(e)&&e.preventDefault()},o.default.prototype._mouseWheelDeltaY=0,o.default.prototype._pmouseWheelDeltaY=0,o.default.prototype._onwheel=function(e){var t=this._isGlobal?window:this;this._setProperty("_mouseWheelDeltaY",e.deltaY),"function"==typeof t.mouseWheel&&(e.delta=e.deltaY,!1===t.mouseWheel(e)&&e.preventDefault())},o.default.prototype.requestPointerLock=function(){var e=this._curElement.elt;return e.requestPointerLock=e.requestPointerLock||e.mozRequestPointerLock,e.requestPointerLock?(e.requestPointerLock(),!0):(console.log("requestPointerLock is not implemented in this browser"),!1)},o.default.prototype.exitPointerLock=function(){document.exitPointerLock()},e=o.default,r.default=e},{"../core/constants":272,"../core/main":283,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],303:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.prototype.touches=[],e.default.prototype._updateTouchCoords=function(e){if(null!==this._curElement){for(var t=[],r=0;r<e.touches.length;r++)t[r]=function(e,t,r,n){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=e.getBoundingClientRect();return t=e.scrollWidth/t||1,e=e.scrollHeight/r||1,{x:((r=n.touches[i]||n.changedTouches[i]).clientX-o.left)/t,y:(r.clientY-o.top)/e,winX:r.clientX,winY:r.clientY,id:r.identifier}}(this._curElement.elt,this.width,this.height,e,r);this._setProperty("touches",t)}},e.default.prototype._ontouchstart=function(e){var t=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!0),this._updateTouchCoords(e),this._updateNextMouseCoords(e),this._updateMouseCoords(),"function"==typeof t.touchStarted&&(!1===t.touchStarted(e)&&e.preventDefault(),this.touchstart=!0)},e.default.prototype._ontouchmove=function(e){var t=this._isGlobal?window:this;this._updateTouchCoords(e),this._updateNextMouseCoords(e),"function"==typeof t.touchMoved?!1===t.touchMoved(e)&&e.preventDefault():"function"==typeof t.mouseDragged&&!1===t.mouseDragged(e)&&e.preventDefault()},e.default.prototype._ontouchend=function(e){this._setProperty("mouseIsPressed",!1),this._updateTouchCoords(e),this._updateNextMouseCoords(e);var t=this._isGlobal?window:this;"function"==typeof t.touchEnded&&(!1===t.touchEnded(e)&&e.preventDefault(),this.touchend=!0)},e=e.default,r.default=e},{"../core/main":283}],304:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.int32-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.int32-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i,o,s,a={_toPixels:function(e){var t,r;return e instanceof ImageData?e.data:e.getContext("2d")?e.getContext("2d").getImageData(0,0,e.width,e.height).data:e.getContext("webgl")?(r=(t=e.getContext("webgl")).drawingBufferWidth*t.drawingBufferHeight*4,r=new Uint8Array(r),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,r),r):void 0},_getARGB:function(e,t){return e[3+(t*=4)]<<24&4278190080|e[t]<<16&16711680|e[1+t]<<8&65280|255&e[2+t]},_setPixels:function(e,t){for(var r,n=0,i=e.length;n<i;n++)e[0+(r=4*n)]=(16711680&t[n])>>>16,e[1+r]=(65280&t[n])>>>8,e[2+r]=255&t[n],e[3+r]=(4278190080&t[n])>>>24},_toImageData:function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},_createImageData:function(e,t){return a._tmpCanvas=document.createElement("canvas"),a._tmpCtx=a._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},apply:function(e,t,r){var n=e.getContext("2d"),i=n.getImageData(0,0,e.width,e.height);(t=t(i,r))instanceof ImageData?n.putImageData(t,0,0,0,0,e.width,e.height):n.putImageData(i,0,0,0,0,e.width,e.height)},threshold:function(e){for(var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:.5,r=a._toPixels(e),n=Math.floor(255*t),i=0;i<r.length;i+=4){var o=n<=.2126*r[i]+.7152*r[i+1]+.0722*r[i+2]?255:0;r[i]=r[i+1]=r[i+2]=o}},gray:function(e){for(var t=a._toPixels(e),r=0;r<t.length;r+=4){var n=t[r],i=t[r+1],o=t[r+2];t[r]=t[r+1]=t[r+2]=.2126*n+.7152*i+.0722*o}},opaque:function(e){for(var t=a._toPixels(e),r=0;r<t.length;r+=4)t[r+3]=255;return t},invert:function(e){for(var t=a._toPixels(e),r=0;r<t.length;r+=4)t[r]=255-t[r],t[r+1]=255-t[r+1],t[r+2]=255-t[r+2]},posterize:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:4,r=a._toPixels(e);if(t<2||255<t)throw new Error("Level must be greater than 2 and less than 255 for posterize");for(var n=t-1,i=0;i<r.length;i+=4){var o=r[i],s=r[i+1],l=r[i+2];r[i]=255*(o*t>>8)/n,r[i+1]=255*(s*t>>8)/n,r[i+2]=255*(l*t>>8)/n}},dilate:function(e){for(var t,r,n,i,o,s,l,c,u,h=a._toPixels(e),d=0,p=h.length?h.length/4:0,f=new Int32Array(p);d<p;)for(r=(t=d)+e.width;d<r;)i=n=a._getARGB(h,d),(u=d-1)<t&&(u=d),r<=(c=d+1)&&(c=d),(o=d-e.width)<0&&(o=0),p<=(s=d+e.width)&&(s=d),o=a._getARGB(h,o),u=a._getARGB(h,u),s=a._getARGB(h,s),(i=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))<(l=77*(u>>16&255)+151*(u>>8&255)+28*(255&u))&&(n=u,i=l),i<(l=77*((u=a._getARGB(h,c))>>16&255)+151*(u>>8&255)+28*(255&u))&&(n=u,i=l),i<(c=77*(o>>16&255)+151*(o>>8&255)+28*(255&o))&&(n=o,i=c),i<(u=77*(s>>16&255)+151*(s>>8&255)+28*(255&s))&&(n=s,i=u),f[d++]=n;a._setPixels(h,f)},erode:function(e){for(var t,r,n,i,o,s,l,c,u,h=a._toPixels(e),d=0,p=h.length?h.length/4:0,f=new Int32Array(p);d<p;)for(r=(t=d)+e.width;d<r;)i=n=a._getARGB(h,d),(u=d-1)<t&&(u=d),r<=(c=d+1)&&(c=d),(o=d-e.width)<0&&(o=0),p<=(s=d+e.width)&&(s=d),o=a._getARGB(h,o),u=a._getARGB(h,u),s=a._getARGB(h,s),(l=77*(u>>16&255)+151*(u>>8&255)+28*(255&u))<(i=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=u,i=l),(l=77*((u=a._getARGB(h,c))>>16&255)+151*(u>>8&255)+28*(255&u))<i&&(n=u,i=l),(c=77*(o>>16&255)+151*(o>>8&255)+28*(255&o))<i&&(n=o,i=c),(u=77*(s>>16&255)+151*(s>>8&255)+28*(255&s))<i&&(n=s,i=u),f[d++]=n;a._setPixels(h,f)},blur:function(e,t){for(var r,l,c,u,h,d,p,f,m,y,g=a._toPixels(e),v=e.width,b=e.height,_=v*b,x=new Int32Array(_),w=0;w<_;w++)x[w]=a._getARGB(g,w);var S,M,T,E,j,A,L,C,P=new Int32Array(_),R=new Int32Array(_),O=new Int32Array(_),k=new Int32Array(_),I=0,D=3.5*t|0;if(n!==(D=D<1?1:D<248?D:248)){i=1+(n=D)<<1,o=new Int32Array(i),s=new Array(i);for(var N=0;N<i;N++)s[N]=new Int32Array(256);for(var F=1,U=D-1;F<D;F++){o[D+F]=o[U]=A=U*U,L=s[D+F],C=s[U--];for(var B=0;B<256;B++)L[B]=C[B]=A*B}j=o[D]=D*D,L=s[D];for(var z=0;z<256;z++)L[z]=j*z}for(M=0;M<b;M++){for(S=0;S<v;S++){if(u=c=l=h=r=0,(d=S-n)<0)y=-d,d=0;else{if(v<=d)break;y=0}for(T=y;T<i&&!(v<=d);T++){var G=x[d+I];h+=(E=s[T])[(-16777216&G)>>>24],l+=E[(16711680&G)>>16],c+=E[(65280&G)>>8],u+=E[255&G],r+=o[T],d++}P[p=I+S]=h/r,R[p]=l/r,O[p]=c/r,k[p]=u/r}I+=v}for(m=(f=-n)*v,M=I=0;M<b;M++){for(S=0;S<v;S++){if(u=c=l=h=r=0,f<0)y=p=-f,d=S;else{if(b<=f)break;y=0,p=f,d=S+m}for(T=y;T<i&&!(b<=p);T++)h+=(E=s[T])[P[d]],l+=E[R[d]],c+=E[O[d]],u+=E[k[d]],r+=o[T],p++,d+=v;x[S+I]=h/r<<24|l/r<<16|c/r<<8|u/r}I+=v,m+=v,f++}a._setPixels(g,x)}};r.default=a},{"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.to-string":190,"core-js/modules/es.typed-array.copy-within":213,"core-js/modules/es.typed-array.every":214,"core-js/modules/es.typed-array.fill":215,"core-js/modules/es.typed-array.filter":216,"core-js/modules/es.typed-array.find":218,"core-js/modules/es.typed-array.find-index":217,"core-js/modules/es.typed-array.for-each":221,"core-js/modules/es.typed-array.includes":222,"core-js/modules/es.typed-array.index-of":223,"core-js/modules/es.typed-array.int32-array":225,"core-js/modules/es.typed-array.iterator":226,"core-js/modules/es.typed-array.join":227,"core-js/modules/es.typed-array.last-index-of":228,"core-js/modules/es.typed-array.map":229,"core-js/modules/es.typed-array.reduce":231,"core-js/modules/es.typed-array.reduce-right":230,"core-js/modules/es.typed-array.reverse":232,"core-js/modules/es.typed-array.set":233,"core-js/modules/es.typed-array.slice":234,"core-js/modules/es.typed-array.some":235,"core-js/modules/es.typed-array.sort":236,"core-js/modules/es.typed-array.subarray":237,"core-js/modules/es.typed-array.to-locale-string":238,"core-js/modules/es.typed-array.to-string":239,"core-js/modules/es.typed-array.uint8-array":242}],305:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("../core/main")),i=o(e("omggif"));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n.default.prototype.createImage=function(e,t){return n.default._validateParameters("createImage",arguments),new n.default.Image(e,t)},n.default.prototype.saveCanvas=function(){for(var e,t,r,i,o,s,a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];switch(n.default._validateParameters("saveCanvas",l),l[0]instanceof HTMLCanvasElement?(e=l[0],l.shift()):l[0]instanceof n.default.Element?(e=l[0].elt,l.shift()):l[0]instanceof n.default.Framebuffer?(i=l[0],(o=this.createGraphics(i.width,i.height)).pixelDensity(pixelDensity()),i.loadPixels(),o.loadPixels(),o.pixels.set(i.pixels),o.updatePixels(),e=o.elt,l.shift()):e=this._curElement&&this._curElement.elt,1<=l.length&&(t=l[0]),r=(r=2<=l.length?l[1]:r)||n.default.prototype._checkFileExtension(t,r)[1]||"png"){default:s="image/png";break;case"webp":s="image/webp";break;case"jpeg":case"jpg":s="image/jpeg"}e.toBlob((function(e){n.default.prototype.downloadFile(e,t,r),o&&o.remove()}),s)},n.default.prototype.encodeAndDownloadGif=function(e,t){for(var r=e.gifProperties,o=(1===(A=r.loopLimit)?A=null:null===A&&(A=0),new Uint8Array(e.width*e.height*r.numFrames)),a=[],l={},c=0;c<r.numFrames;c++){for(var u=new Set,h=r.frames[c].image.data,d=h.length,p=new Uint32Array(e.width*e.height),f=0,m=0;f<d;f+=4,m++){var y=h[f+0]<<16|h[f+1]<<8|h[f+2];u.add(y),p[m]=y}var g=s(u).sort().toString();void 0===l[g]?l[g]={freq:1,frames:[c]}:(l[g].freq+=1,l[g].frames.push(c)),a.push(p)}for(var v=[],b=Object.keys(l).sort((function(e,t){return l[t].freq-l[e].freq})),_=b[0].split(",").map((function(e){return parseInt(e)})),x=(v=v.concat(l[_].frames),new Set(_)),w=1;w<b.length;w++){var S=b[w].split(",").map((function(e){return parseInt(e)})).filter((function(e){return!x.has(e)}));if(_.length+S.length<=256){for(var M=0;M<S.length;M++)_.push(S[M]),x.add(S[M]);v=v.concat(l[b[w]].frames)}}v=new Set(v);for(var T={},E=0;E<_.length;E++)T[_[E]]||(T[_[E]]=E);for(var j=1;j<_.length;)j<<=1;_.length=j;for(var A={loop:A,palette:new Uint32Array(_)},L=new i.default.GifWriter(o,e.width,e.height,A),C={},P=0;P<r.numFrames;P++)!function(t){var n=!v.has(t),i=n?[]:_,o=new Uint8Array(e.width*e.height),s={},l=new Set,c=(a[t].forEach((function(e,r){n?(void 0===s[e]&&(s[e]=i.length,i.push(e)),o[r]=s[e]):o[r]=T[e],0<t&&a[t-1][r]!==e&&l.add(e)})),{}),u=i.filter((function(e){return!l.has(e)}));if(0<u.length){u=u[0];var h=(n?s:T)[u];if(0<t){for(var d=0;d<a[t].length;d++)a[t-1][d]===a[t][d]&&(o[d]=h);c.transparent=h,C.frameOpts.disposal=1}}if(c.delay=r.frames[t].delay/10,n){for(var p=1;p<i.length;)p<<=1;i.length=p,c.palette=new Uint32Array(i)}0<t&&L.addFrame(0,0,e.width,e.height,C.pixelPaletteIndex,C.frameOpts),C={pixelPaletteIndex:o,frameOpts:c}}(P);C.frameOpts.disposal=1,L.addFrame(0,0,e.width,e.height,C.pixelPaletteIndex,C.frameOpts),A=new Blob([o.slice(0,L.end())],{type:"image/gif"}),n.default.prototype.downloadFile(A,t,"gif")},n.default.prototype.saveFrames=function(e,t,r,i,o){n.default._validateParameters("saveFrames",arguments),r=n.default.prototype.constrain(r=r||3,0,15),r*=1e3,i=n.default.prototype.constrain(i||15,0,22);var s=0,a=n.default.prototype._makeFrame,l=this._curElement.elt,c=[],u=setInterval((function(){c.push(a(e+s,t,l)),s++}),1e3/i);setTimeout((function(){if(clearInterval(u),o)o(c);else for(var e=0,t=c;e<t.length;e++){var r=t[e];n.default.prototype.downloadFile(r.imageData,r.filename,r.ext)}c=[]}),.01+r)},n.default.prototype._makeFrame=function(e,t,r){var n;if(r=this?this._curElement.elt:r,t)switch(t.toLowerCase()){case"png":default:n="image/png";break;case"jpeg":case"jpg":n="image/jpeg"}else t="png",n="image/png";r=(r=r.toDataURL(n)).replace(n,"image/octet-stream");var i={};return i.imageData=r,i.filename=e,i.ext=t,i},e=n.default,r.default=e},{"../core/main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.filter":157,"core-js/modules/es.array.for-each":161,"core-js/modules/es.array.from":162,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.map":168,"core-js/modules/es.array.slice":169,"core-js/modules/es.object.keys":189,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.set":197,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.replace":204,"core-js/modules/es.string.split":206,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.typed-array.copy-within":213,"core-js/modules/es.typed-array.every":214,"core-js/modules/es.typed-array.fill":215,"core-js/modules/es.typed-array.filter":216,"core-js/modules/es.typed-array.find":218,"core-js/modules/es.typed-array.find-index":217,"core-js/modules/es.typed-array.for-each":221,"core-js/modules/es.typed-array.includes":222,"core-js/modules/es.typed-array.index-of":223,"core-js/modules/es.typed-array.iterator":226,"core-js/modules/es.typed-array.join":227,"core-js/modules/es.typed-array.last-index-of":228,"core-js/modules/es.typed-array.map":229,"core-js/modules/es.typed-array.reduce":231,"core-js/modules/es.typed-array.reduce-right":230,"core-js/modules/es.typed-array.reverse":232,"core-js/modules/es.typed-array.set":233,"core-js/modules/es.typed-array.slice":234,"core-js/modules/es.typed-array.some":235,"core-js/modules/es.typed-array.sort":236,"core-js/modules/es.typed-array.subarray":237,"core-js/modules/es.typed-array.to-locale-string":238,"core-js/modules/es.typed-array.to-string":239,"core-js/modules/es.typed-array.uint32-array":241,"core-js/modules/es.typed-array.uint8-array":242,"core-js/modules/web.dom-collections.for-each":245,"core-js/modules/web.dom-collections.iterator":246,omggif:256}],306:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,e("regenerator-runtime/runtime");var o=h(e("../core/main")),s=h(e("../core/helpers")),a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants")),l=h(e("omggif")),c=e("gifenc");function u(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,u=function(){return e},e)}function h(e){return e&&e.__esModule?e:{default:e}}function d(e,t,r,n,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,i)}function p(e,t){return 0<e&&e<t?e:t}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),o.default.prototype.loadImage=function(e,t,r){o.default._validateParameters("loadImage",arguments);var n=new o.default.Image(1,1,this),i=this,s=new Request(e,{method:"GET",mode:"cors"});return fetch(e,s).then((function(s){var a,c=s.headers.get("content-type");null===c&&console.warn("The image you loaded does not have a Content-Type header. If you are using the online editor consider reuploading the asset."),c&&c.includes("image/gif")?s.arrayBuffer().then((function(e){if(e){e=new Uint8Array(e);for(var s=n,a=t,c=r,u=function(e){i._decrementPreload()}.bind(i),h=new l.default.GifReader(e),d=(s.width=s.canvas.width=h.width,s.height=s.canvas.height=h.height,[]),p=h.numFrames(),f=new Uint8ClampedArray(s.width*s.height*4),m=0;m<p;m++){var y=h.frameInfo(m),g=s.drawingContext.getImageData(0,0,s.width,s.height),v=(f=g.data.slice(),function(e,t){try{t.decodeAndBlitFrameRGBA(e,f)}catch(e){o.default._friendlyFileLoadError(8,s.src),"function"==typeof c?c(e):console.error(e)}}(m,h),new ImageData(f,s.width,s.height));0===(s.drawingContext.putImageData(v,0,0),v=y.delay)&&(v=10),d.push({image:s.drawingContext.getImageData(0,0,s.width,s.height),delay:10*v}),2===y.disposal?s.drawingContext.clearRect(y.x,y.y,y.width,y.height):3===y.disposal&&s.drawingContext.putImageData(g,0,0,y.x,y.y,y.width,y.height)}null===(e=h.loopCount())?e=1:0===e&&(e=null),s.drawingContext.putImageData(d[0].image,0,0),1<d.length&&(s.gifProperties={displayIndex:0,loopLimit:e,loopCount:0,frames:d,numFrames:p,playing:!0,timeDisplayed:0,lastChangeTime:0}),"function"==typeof a&&a(s),u()}}),(function(e){"function"==typeof r?(r(e),i._decrementPreload()):console.error(e)})):((a=new Image).onload=function(){n.width=n.canvas.width=a.width,n.height=n.canvas.height=a.height,n.drawingContext.drawImage(a,0,0),n.modified=!0,"function"==typeof t&&t(n),i._decrementPreload()},a.onerror=function(e){o.default._friendlyFileLoadError(0,a.src),"function"==typeof r?(r(e),i._decrementPreload()):console.error(e)},0!==e.indexOf("data:image/")&&(a.crossOrigin="Anonymous"),a.src=e),n.modified=!0})).catch((function(t){o.default._friendlyFileLoadError(0,e),"function"==typeof r?(r(t),i._decrementPreload()):console.error(t)})),n},o.default.prototype.saveGif=function(){e=regeneratorRuntime.mark((function e(t,r){var n,i,s,a,l,u,h,d,p,f,m,y,g,v,b,_,x,w,S,M,T,E,j,A,L,C,P=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=2<P.length&&void 0!==P[2]?P[2]:{delay:0,units:"seconds",silent:!1,notificationDuration:0,notificationID:"progressBar"},"string"!=typeof t)throw TypeError("fileName parameter must be a string");e.next=3;break;case 3:if("number"!=typeof r)throw TypeError("Duration parameter must be a number");e.next=5;break;case 5:if(i=n&&n.delay||0,s=n&&n.units||"seconds",a=n&&n.silent||!1,l=n&&n.notificationDuration||0,u=n&&n.notificationID||"progressBar","number"!=typeof i)throw TypeError("Delay parameter must be a number");e.next=12;break;case 12:if("seconds"!==s&&"frames"!==s)throw TypeError('Units parameter must be either "frames" or "seconds"');e.next=14;break;case 14:if("boolean"!=typeof a)throw TypeError("Silent parameter must be a boolean");e.next=16;break;case 16:if("number"!=typeof l)throw TypeError("Notification duration parameter must be a number");e.next=18;break;case 18:if("string"!=typeof u)throw TypeError("Notification ID parameter must be a string");e.next=20;break;case 20:return this._recording=!0,f=this._targetFrameRate,h=(h=1/(f=f!==1/0&&void 0!==f&&0!==f?f:60)*1e3)<20?20:h,p=(d="seconds"===s?r*f:r)+(f="seconds"===s?i*f:i),this.frameCount=f,m=this._pixelDensity,this.pixelDensity(1),y=[],null!==document.getElementById(u)&&document.getElementById(u).remove(),a||((g=this.createP("")).id(u),g.style("font-size","16px"),g.style("font-family","Montserrat"),g.style("background-color","#ffffffa0"),g.style("padding","8px"),g.style("border-radius","10px"),g.position(0,0)),this._renderer instanceof o.default.RendererGL&&(b=this.drawingContext,v=new Uint8Array(b.drawingBufferWidth*b.drawingBufferHeight*4)),this.noLoop(),e.next=39,Promise.resolve();case 39:if(f<p)return this.redraw(),A=void 0,A=this._renderer instanceof o.default.RendererGL?(v=new Uint8Array(b.drawingBufferWidth*b.drawingBufferHeight*4),b.readPixels(0,0,b.drawingBufferWidth,b.drawingBufferHeight,b.RGBA,b.UNSIGNED_BYTE,v),function(e,t,r){for(var n=parseInt(r/2),i=4*t,o=new Uint8Array(4*t),s=0;s<n;++s){var a=s*i,l=(r-s-1)*i;o.set(e.subarray(a,a+i)),e.copyWithin(a,l,l+i),e.set(o,l)}return e}(v,this.width,this.height)):this.drawingContext.getImageData(0,0,this.width,this.height).data,y.push(A),f++,a||g.html("Saved frame <b>"+y.length.toString()+"</b> out of "+d.toString()),e.next=48,new Promise((function(e){return setTimeout(e,0)}));e.next=50;break;case 48:e.next=39;break;case 50:a||g.html("Frames processed, generating color palette..."),this.loop(),this.pixelDensity(m),_=(0,c.GIFEncoder)(),x=function(e){for(var t=new Uint8Array(e.length*e[0].length),r=0;r<e.length;r++)t.set(e[r],r*e[0].length);var n=(0,c.quantize)(t,256,{format:"rgba4444",oneBitAlpha:!0});return 256===n.length?n[n.length-1]=[255*Math.random(),255*Math.random(),255*Math.random(),0]:n.push([255*Math.random(),255*Math.random(),255*Math.random(),0]),n}(y),w={},S=function(e){for(var t=e.length/4,r=new Uint8Array(t),n=0;n<t;n++){var i=e[4*n]<<24|e[4*n+1]<<16|e[4*n+2]<<8|e[4*n+3];void 0===w[i]&&(w[i]=(0,c.nearestColorIndex)(x,e.slice(4*n,4*(n+1)))),r[n]=w[i]}return r},M=x.length-1,T=[],E=0;case 60:if(!(E<y.length)){e.next=71;break}if(j=S(y[E]),A=j.slice(),0===E)_.writeFrame(j,this.width,this.height,{palette:x,delay:h,dispose:1});else{for(L=0;L<j.length;L++)j[L]===T[L]&&(j[L]=M);_.writeFrame(j,this.width,this.height,{delay:h,transparent:!0,transparentIndex:M,dispose:1})}return T=A,a||g.html("Rendered frame <b>"+E.toString()+"</b> out of "+d.toString()),e.next=68,new Promise((function(e){return setTimeout(e,0)}));case 68:E++,e.next=60;break;case 71:_.finish(),C=_.bytesView(),C=new Blob([C],{type:"image/gif"}),y=[],this._recording=!1,this.loop(),a||(g.html("Done. Downloading your gif!🌸"),0<l&&setTimeout((function(){return g.remove()}),1e3*l)),o.default.prototype.downloadFile(C,t,"gif");case 80:case"end":return e.stop()}}),e,this)}));var e,t=function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function s(e){d(o,n,i,s,a,"next",e)}function a(e){d(o,n,i,s,a,"throw",e)}s(void 0)}))};return function(e,r){return t.apply(this,arguments)}}(),o.default.prototype.image=function(e,t,r,n,i,l,c,u,h,d,f,m){o.default._validateParameters("image",arguments);var y=e.width,g=e.height,v=(m=m||a.CENTER,f=f||a.CENTER,e.elt&&(y=void 0!==y?y:e.elt.width,g=void 0!==g?g:e.elt.height),e.elt&&e.elt.videoWidth&&!e.canvas&&(y=void 0!==y?y:e.elt.videoWidth,g=void 0!==g?g:e.elt.videoHeight),n||y);i=i||g,l=l||0,c=c||0,u=p(void 0!==u?u:y,y),y=p(void 0!==h?h:g,g),h=1,e.elt&&!e.canvas&&e.elt.style.width&&(h=e.elt.videoWidth&&!n?e.elt.videoWidth:e.elt.width,h/=parseInt(e.elt.style.width,10)),l*=h,c*=h,y*=h,u*=h,g=function(e,t,r,n,i,o,s,l,c,u,h){var d,p,f,m,y,g,v,b,_;return e===a.COVER&&(d=t,f=r,v=o,b=s,g=l,_=c,p=u,m=h,v/=y=Math.max(v/p,b/m),b/=y,y=g,g=_,d===a.CENTER?y+=(p-v)/2:d===a.RIGHT&&(y+=p-v),f===a.CENTER?g+=(m-b)/2:f===a.BOTTOM&&(g+=m-b),l=(_={x:y,y:g,w:v,h:b}).x,c=_.y,u=_.w,h=_.h),e===a.CONTAIN&&(d=t,p=r,f=n,m=i,y=o,g=s,v=u,b=h,v/=_=Math.max(v/y,b/g),b/=_,_=f,f=m,d===a.CENTER?_+=(y-v)/2:d===a.RIGHT&&(_+=y-v),p===a.CENTER?f+=(g-b)/2:p===a.BOTTOM&&(f+=g-b),n=(e={x:_,y:f,w:v,h:b}).x,i=e.y,o=e.w,s=e.h),{sx:l,sy:c,sw:u,sh:h,dx:n,dy:i,dw:o,dh:s}}(d,f,m,(g=s.default.modeAdjust(t,r,v,i,this._renderer._imageMode)).x,g.y,g.w,g.h,l,c,u,y),this._renderer.image(e,g.sx,g.sy,g.sw,g.sh,g.dx,g.dy,g.dw,g.dh)},o.default.prototype.tint=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.default._validateParameters("tint",t);var n=this.color.apply(this,t);this._renderer._tint=n.levels},o.default.prototype.noTint=function(){this._renderer._tint=null},o.default.prototype._getTintedImageCanvas=o.default.Renderer2D.prototype._getTintedImageCanvas,o.default.prototype.imageMode=function(e){o.default._validateParameters("imageMode",arguments),e!==a.CORNER&&e!==a.CORNERS&&e!==a.CENTER||(this._renderer._imageMode=e)},e=o.default,r.default=e},{"../core/constants":272,"../core/friendly_errors/fes_core":274,"../core/friendly_errors/file_errors":275,"../core/friendly_errors/validate_params":278,"../core/helpers":279,"../core/main":283,"core-js/modules/es.array.copy-within":154,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.index-of":164,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.slice":169,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.promise":191,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.includes":199,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.typed-array.copy-within":213,"core-js/modules/es.typed-array.every":214,"core-js/modules/es.typed-array.fill":215,"core-js/modules/es.typed-array.filter":216,"core-js/modules/es.typed-array.find":218,"core-js/modules/es.typed-array.find-index":217,"core-js/modules/es.typed-array.for-each":221,"core-js/modules/es.typed-array.includes":222,"core-js/modules/es.typed-array.index-of":223,"core-js/modules/es.typed-array.iterator":226,"core-js/modules/es.typed-array.join":227,"core-js/modules/es.typed-array.last-index-of":228,"core-js/modules/es.typed-array.map":229,"core-js/modules/es.typed-array.reduce":231,"core-js/modules/es.typed-array.reduce-right":230,"core-js/modules/es.typed-array.reverse":232,"core-js/modules/es.typed-array.set":233,"core-js/modules/es.typed-array.slice":234,"core-js/modules/es.typed-array.some":235,"core-js/modules/es.typed-array.sort":236,"core-js/modules/es.typed-array.subarray":237,"core-js/modules/es.typed-array.to-locale-string":238,"core-js/modules/es.typed-array.to-string":239,"core-js/modules/es.typed-array.uint8-array":242,"core-js/modules/es.typed-array.uint8-clamped-array":243,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246,gifenc:253,omggif:256,"regenerator-runtime/runtime":260}],307:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("../core/main")),i=o(e("./filters"));function o(e){return e&&e.__esModule?e:{default:e}}n.default.Image=function(){function e(t,r){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.width=t,this.height=r,this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.drawingContext=this.canvas.getContext("2d"),(this._pixelsState=this)._pixelDensity=1,this.gifProperties=null,this._modified=!1,this.pixels=[]}var t;return(t=[{key:"pixelDensity",value:function(e){return void 0!==e?(e<=0&&(n.default._friendlyParamError({type:"INVALID_VALUE",format:{types:["Number"]},position:1},"pixelDensity"),e=1),this._pixelDensity=e,this.width/=e,this.height/=e,this):this._pixelDensity}},{key:"_animateGif",value:function(e){var t,r=this.gifProperties;e=e._lastRealFrameTime||window.performance.now(),0===r.lastChangeTime&&(r.lastChangeTime=e),r.playing&&(r.timeDisplayed=e-r.lastChangeTime,t=r.frames[r.displayIndex].delay,r.timeDisplayed>=t&&(t=Math.floor(r.timeDisplayed/t),r.timeDisplayed=0,r.lastChangeTime=e,r.displayIndex+=t,r.loopCount=Math.floor(r.displayIndex/r.numFrames),null!==r.loopLimit&&r.loopCount>=r.loopLimit?r.playing=!1:(e=r.displayIndex%r.numFrames,this.drawingContext.putImageData(r.frames[e].image,0,0),r.displayIndex=e,this.setModified(!0))))}},{key:"_setProperty",value:function(e,t){this[e]=t,this.setModified(!0)}},{key:"loadPixels",value:function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)}},{key:"updatePixels",value:function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)}},{key:"get",value:function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)}},{key:"_getPixel",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.default.Renderer2D.prototype._getPixel.apply(this,t)}},{key:"set",value:function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)}},{key:"resize",value:function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var n=this.gifProperties,i=0;i<n.numFrames;i++){for(var o=this.drawingContext.createImageData(e,t),s=(h=h=u=c=l=void 0,n.frames[i].image),a=o,l=0,c=0;c<a.height;c++)for(var u=0;u<a.width;u++){var h=Math.floor(u*s.width/a.width);h=4*(Math.floor(c*s.height/a.height)*s.width+h),a.data[l++]=s.data[h++],a.data[l++]=s.data[h++],a.data[l++]=s.data[h++],a.data[l++]=s.data[+h]}n.frames[i].image=o}r.getContext("2d").drawImage(this.canvas,0,0,this.canvas.width,this.canvas.height,0,0,r.width,r.height),this.canvas.width=this.width=e,this.canvas.height=this.height=t,this.drawingContext.drawImage(r,0,0,e,t,0,0,e,t),0<this.pixels.length&&this.loadPixels(),this.setModified(!0)}},{key:"copy",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.default.prototype.copy.apply(this,t)}},{key:"mask",value:function(e){var t=this.drawingContext.globalCompositeOperation,r=this._pixelDensity,i=1,o=[e=void 0===e?this:e,0,0,(i=e instanceof n.default.Renderer?e._pInst._pixelDensity:i)*e.width,i*e.height,0,0,r*this.width,r*this.height];if(this.drawingContext.globalCompositeOperation="destination-in",this.gifProperties){for(var s=0;s<this.gifProperties.frames.length;s++)this.drawingContext.putImageData(this.gifProperties.frames[s].image,0,0),this.copy.apply(this,o),this.gifProperties.frames[s].image=this.drawingContext.getImageData(0,0,r*this.width,r*this.height);this.drawingContext.putImageData(this.gifProperties.frames[this.gifProperties.displayIndex].image,0,0)}else this.copy.apply(this,o);this.drawingContext.globalCompositeOperation=t,this.setModified(!0)}},{key:"filter",value:function(e,t){i.default.apply(this.canvas,i.default[e],t),this.setModified(!0)}},{key:"blend",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.default._validateParameters("p5.Image.blend",arguments),n.default.prototype.blend.apply(this,t),this.setModified(!0)}},{key:"setModified",value:function(e){this._modified=e}},{key:"isModified",value:function(){return this._modified}},{key:"save",value:function(e,t){this.gifProperties?n.default.prototype.encodeAndDownloadGif(this,e):n.default.prototype.saveCanvas(this.canvas,e,t)}},{key:"reset",value:function(){var e;this.gifProperties&&((e=this.gifProperties).playing=!0,e.timeSinceStart=0,e.timeDisplayed=0,e.lastChangeTime=0,e.loopCount=0,e.displayIndex=0,this.drawingContext.putImageData(e.frames[0].image,0,0))}},{key:"getCurrentFrame",value:function(){var e;if(this.gifProperties)return(e=this.gifProperties).displayIndex%e.numFrames}},{key:"setFrame",value:function(e){var t;this.gifProperties&&(e<(t=this.gifProperties).numFrames&&0<=e?(t.timeDisplayed=0,t.lastChangeTime=0,t.displayIndex=e,this.drawingContext.putImageData(t.frames[e].image,0,0)):console.log("Cannot set GIF to a frame number that is higher than total number of frames or below zero."))}},{key:"numFrames",value:function(){if(this.gifProperties)return this.gifProperties.numFrames}},{key:"play",value:function(){this.gifProperties&&(this.gifProperties.playing=!0)}},{key:"pause",value:function(){this.gifProperties&&(this.gifProperties.playing=!1)}},{key:"delay",value:function(e,t){if(this.gifProperties){var r=this.gifProperties;if(t<r.numFrames&&0<=t)r.frames[t].delay=e;else{var n=!0,i=void(t=!1);try{for(var o,s=r.frames[Symbol.iterator]();!(n=(o=s.next()).done);n=!0)o.value.delay=e}catch(e){t=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(t)throw i}}}}}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),e=n.default.Image,r.default=e},{"../core/main":283,"./filters":304,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/web.dom-collections.iterator":246}],308:[function(e,t,r){"use strict";e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.filter"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("../core/main")),i=o(e("./filters"));function o(e){return e&&e.__esModule?e:{default:e}}e("../color/p5.Color"),n.default.prototype.pixels=[],n.default.prototype.blend=function(){for(var e,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];n.default._validateParameters("blend",r),this._renderer?(e=this._renderer).blend.apply(e,r):n.default.Renderer2D.prototype.blend.apply(this,r)},n.default.prototype.copy=function(){for(var e,t,r,i,o,s,a,l,c,u=arguments.length,h=new Array(u),d=0;d<u;d++)h[d]=arguments[d];if(n.default._validateParameters("copy",h),9===h.length)e=h[0],t=h[1],r=h[2],i=h[3],o=h[4],s=h[5],a=h[6],l=h[7],c=h[8];else{if(8!==h.length)throw new Error("Signature not supported");e=this,t=h[0],r=h[1],i=h[2],o=h[3],s=h[4],a=h[5],l=h[6],c=h[7]}n.default.prototype._copyHelper(this,e,t,r,i,o,s,a,l,c)},n.default.prototype._copyHelper=function(e,t,r,i,o,s,a,l,c,u){var h=t.canvas.width/t.width,d=0,p=0;t._renderer&&t._renderer.isP3D&&(d=t.width/2,p=t.height/2),e._renderer&&e._renderer.isP3D?(e.push(),e.resetMatrix(),e.noLights(),e.blendMode(e.BLEND),e.imageMode(e.CORNER),n.default.RendererGL.prototype.image.call(e._renderer,t,r+d,i+p,o,s,a,l,c,u),e.pop()):e.drawingContext.drawImage(t.canvas,h*(r+d),h*(i+p),h*o,h*s,a,l,c,u)},n.default.prototype.getFilterGraphicsLayer=function(){return this._renderer.getFilterGraphicsLayer()},n.default.prototype.filter=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.default._validateParameters("filter",t);var o=function(){var e,t={shader:void 0,operation:void 0,value:void 0,useWebGL:!0};return(arguments.length<=0?void 0:arguments[0])instanceof n.default.Shader?t.shader=arguments.length<=0?void 0:arguments[0]:(t.operation=arguments.length<=0?void 0:arguments[0],1<arguments.length&&"number"==typeof(arguments.length<=1?void 0:arguments[1])&&(t.value=arguments.length<=1?void 0:arguments[1]),!1===((e=arguments.length-1)<0||arguments.length<=e?void 0:arguments[e])&&(t.useWebGL=!1)),t}.apply(void 0,t),s=o.shader,a=o.operation,l=o.value;o=o.useWebGL,this._renderer.isP3D&&s?n.default.RendererGL.prototype.filter.call(this._renderer,s):o||this._renderer.isP3D?(!o&&this._renderer.isP3D&&console.warn("filter() with useWebGL=false is not supported in WEBGL"),this._renderer.isP3D?n.default.RendererGL.prototype.filter.call(this._renderer,a,l):((s=this.getFilterGraphicsLayer()).copy(this._renderer,0,0,this.width,this.height,-this.width/2,-this.height/2,this.width,this.height),this._renderer.clear(),this._renderer.resetMatrix(),s.filter.apply(s,t),this.copy(s._renderer,0,0,this.width,this.height,0,0,this.width,this.height),s.clear())):void 0!==this.canvas?i.default.apply(this.canvas,i.default[a],l):i.default.apply(this.elt,i.default[a],l)},n.default.prototype.get=function(e,t,r,i){var o;return n.default._validateParameters("get",arguments),(o=this._renderer).get.apply(o,arguments)},n.default.prototype.loadPixels=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.default._validateParameters("loadPixels",t),this._renderer.loadPixels()},n.default.prototype.set=function(e,t,r){this._renderer.set(e,t,r)},n.default.prototype.updatePixels=function(e,t,r,i){n.default._validateParameters("updatePixels",arguments),0!==this.pixels.length&&this._renderer.updatePixels(e,t,r,i)},e=n.default,r.default=e},{"../color/p5.Color":270,"../core/main":283,"./filters":304,"core-js/modules/es.array.filter":157}],309:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.from-entries"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/web.url"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.from-entries"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/web.url"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=a(e("../core/main")),o=(e("whatwg-fetch"),e("es6-promise/auto"),a(e("fetch-jsonp"))),s=a(e("file-saver"));function a(e){return e&&e.__esModule?e:{default:e}}function l(e){return(l="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}function c(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function u(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),i.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.default._validateParameters("loadJSON",t);for(var n,o,s,a=t[0],c={},u="json",h=1;h<t.length;h++){var d=t[h];"string"==typeof d?"jsonp"!==d&&"json"!==d||(u=d):"function"==typeof d?n?o=d:n=d:"object"===l(d)&&(d.hasOwnProperty("jsonpCallback")||d.hasOwnProperty("jsonpCallbackFunction"))&&(u="jsonp",s=d)}var p=this;return this.httpDo(a,"GET",s,u,(function(e){for(var t in e)c[t]=e[t];void 0!==n&&n(e),p._decrementPreload()}),(function(e){if(i.default._friendlyFileLoadError(5,a),!o)throw e;o(e)})),c},i.default.prototype.loadStrings=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.default._validateParameters("loadStrings",t);for(var n,o,s=[],a=1;a<t.length;a++){var l=t[a];"function"==typeof l&&(void 0===n?n=l:void 0===o&&(o=l))}var c=this;return i.default.prototype.httpDo.call(this,t[0],"GET","text",(function(e){for(var t=e.replace(/\r\n/g,"\r").replace(/\n/g,"\r").split(/\r/),r=0,i=t.length;r<i;r+=32768)Array.prototype.push.apply(s,t.slice(r,Math.min(r+32768,i)));void 0!==n&&n(s),c._decrementPreload()}),(function(e){if(i.default._friendlyFileLoadError(3,e),!o)throw e;o(e)})),s},i.default.prototype.loadTable=function(e){var t,r,n,o=[],s=!1,a=e.substring(e.lastIndexOf(".")+1,e.length);"csv"===a?n=",":"ssv"===a?n=";":"tsv"===a&&(n="\t");for(var l=1;l<arguments.length;l++)"function"==typeof arguments[l]?void 0===t?t=arguments[l]:void 0===r&&(r=arguments[l]):"string"==typeof arguments[l]&&(o.push(arguments[l]),"header"===arguments[l]&&(s=!0),"csv"===arguments[l]?n=",":"ssv"===arguments[l]?n=";":"tsv"===arguments[l]&&(n="\t"));var c=new i.default.Table,u=this;return this.httpDo(e,"GET","table",(function(e){for(var r,o,a={},l=[],h=0,d=null,p=function(){a.currentState=0,a.token=""},f=function(){d.push(a.token),p()},m=function(){a.currentState=4,l.push(d),d=null};;){if(null==(r=e[h++])){if(a.escaped)throw new Error("Unclosed quote in file.");if(d){f(),m();break}}if(null===d&&(a.escaped=!1,d=[],p()),0===a.currentState){if('"'===r){a.escaped=!0,a.currentState=1;continue}a.currentState=1}if(1===a.currentState&&a.escaped)if('"'===r)'"'===e[h]?(a.token+='"',h++):(a.escaped=!1,a.currentState=2);else{if("\r"===r)continue;a.token+=r}else"\r"===r?("\n"===e[h]&&h++,f(),m()):"\n"===r?(f(),m()):r===n?f():1===a.currentState&&(a.token+=r)}if(s)c.columns=l.shift();else for(var y=0;y<l[0].length;y++)c.columns[y]="null";for(var g=0;g<l.length;g++)(1!==l[g].length||"undefined"!==l[g][0]&&""!==l[g][0])&&((o=new i.default.TableRow).arr=l[g],o.obj=function(e,t){if(void 0===(t=t||[]))for(var r=0;r<e.length;r++)t[r.toString()]=r;return Object.fromEntries(t.map((function(t,r){return[t,e[r]]})))}(l[g],c.columns),c.addRow(o));"function"==typeof t&&t(c),u._decrementPreload()}),(function(t){i.default._friendlyFileLoadError(2,e),r?r(t):console.error(t)})),c},i.default.prototype.loadXML=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n,o,s=new i.default.XML,a=1;a<t.length;a++){var l=t[a];"function"==typeof l&&(void 0===n?n=l:void 0===o&&(o=l))}var c=this;return this.httpDo(t[0],"GET","xml",(function(e){for(var t in e)s[t]=e[t];void 0!==n&&n(s),c._decrementPreload()}),(function(e){if(i.default._friendlyFileLoadError(1,e),!o)throw e;o(e)})),s},i.default.prototype.loadBytes=function(e,t,r){var n={},o=this;return this.httpDo(e,"GET","arrayBuffer",(function(e){n.bytes=new Uint8Array(e),"function"==typeof t&&t(n),o._decrementPreload()}),(function(t){if(i.default._friendlyFileLoadError(6,e),!r)throw t;r(t)})),n},i.default.prototype.httpGet=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.default._validateParameters("httpGet",t),t.splice(1,0,"GET"),i.default.prototype.httpDo.apply(this,t)},i.default.prototype.httpPost=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.default._validateParameters("httpPost",t),t.splice(1,0,"POST"),i.default.prototype.httpDo.apply(this,t)},i.default.prototype.httpDo=function(){for(var e,t,r,n={},s=0,a="text/plain",c=arguments.length-1;0<c&&"function"==typeof(c<0||arguments.length<=c?void 0:arguments[c]);c--)s++;var u=arguments.length<=0?void 0:arguments[0];if(2==(y=arguments.length-s)&&"string"==typeof u&&"object"===l(arguments.length<=1?void 0:arguments[1]))g=new Request(u,arguments.length<=1?void 0:arguments[1]),t=arguments.length<=2?void 0:arguments[2],r=arguments.length<=3?void 0:arguments[3];else{for(var h,d="GET",p=1;p<arguments.length;p++){var f=p<0||arguments.length<=p?void 0:arguments[p];if("string"==typeof f)"GET"===f||"POST"===f||"PUT"===f||"DELETE"===f?d=f:"json"===f||"jsonp"===f||"binary"===f||"arrayBuffer"===f||"xml"===f||"text"===f||"table"===f?e=f:h=f;else if("number"==typeof f)h=f.toString();else if("object"===l(f))if(f.hasOwnProperty("jsonpCallback")||f.hasOwnProperty("jsonpCallbackFunction"))for(var m in f)n[m]=f[m];else a=f instanceof i.default.XML?(h=f.serialize(),"application/xml"):(h=JSON.stringify(f),"application/json");else"function"==typeof f&&(t?r=f:t=f)}var y="GET"===d?new Headers:new Headers({"Content-Type":a}),g=new Request(u,{method:d,mode:"cors",body:h,headers:y})}return(y=(y="jsonp"===(e=e||(u.includes("json")?"json":u.includes("xml")?"xml":"text"))?(0,o.default)(u,n):fetch(g)).then((function(t){if(!t.ok)throw(r=new Error(t.body)).status=t.status,r.ok=!1,r;var r=0;switch((r="jsonp"!==e?t.headers.get("content-length"):r)&&64e6<r&&i.default._friendlyFileLoadError(7,u),e){case"json":case"jsonp":return t.json();case"binary":return t.blob();case"arrayBuffer":return t.arrayBuffer();case"xml":return t.text().then((function(e){return e=(new DOMParser).parseFromString(e,"text/xml"),new i.default.XML(e.documentElement)}));default:return t.text()}}))).then(t||function(){}),y.catch(r||console.error),y},window.URL=window.URL||window.webkitURL,i.default.prototype._pWriters=[],i.default.prototype.createWriter=function(e,t){var r,n;for(n in i.default.prototype._pWriters)if(i.default.prototype._pWriters[n].name===e)return r=new i.default.PrintWriter(e+this.millis(),t),i.default.prototype._pWriters.push(r),r;return r=new i.default.PrintWriter(e,t),i.default.prototype._pWriters.push(r),r},i.default.PrintWriter=function(e,t){var r=this;this.name=e,this.content="",this.write=function(e){this.content+=e},this.print=function(e){this.content+="".concat(e,"\n")},this.clear=function(){this.content=""},this.close=function(){var n,o=[];for(n in o.push(this.content),i.default.prototype.writeFile(o,e,t),i.default.prototype._pWriters)i.default.prototype._pWriters[n].name===this.name&&i.default.prototype._pWriters.splice(n,1);r.clear(),r={}}},i.default.prototype.save=function(e,t,r){var n=arguments,o=(this._curElement||this).elt;if(0===n.length)i.default.prototype.saveCanvas(o);else if(n[0]instanceof i.default.Renderer||n[0]instanceof i.default.Graphics)i.default.prototype.saveCanvas(n[0].elt,n[1],n[2]);else if(1===n.length&&"string"==typeof n[0])i.default.prototype.saveCanvas(o,n[0]);else switch(u(n[1],n[2])[1]){case"json":return void i.default.prototype.saveJSON(n[0],n[1],n[2]);case"txt":return void i.default.prototype.saveStrings(n[0],n[1],n[2]);default:n[0]instanceof Array?i.default.prototype.saveStrings(n[0],n[1],n[2]):n[0]instanceof i.default.Table?i.default.prototype.saveTable(n[0],n[1],n[2]):n[0]instanceof i.default.Image?i.default.prototype.saveCanvas(n[0].canvas,n[1]):n[0]instanceof i.default.SoundFile&&i.default.prototype.saveSound(n[0],n[1],n[2],n[3])}},i.default.prototype.saveJSON=function(e,t,r){i.default._validateParameters("saveJSON",arguments),r=r?JSON.stringify(e):JSON.stringify(e,void 0,2),this.saveStrings(r.split("\n"),t,"json")},i.default.prototype.saveJSONObject=i.default.prototype.saveJSON,i.default.prototype.saveJSONArray=i.default.prototype.saveJSON,i.default.prototype.saveStrings=function(e,t,r,n){i.default._validateParameters("saveStrings",arguments);for(var o=this.createWriter(t,r||"txt"),s=0;s<e.length;s++)n?o.write(e[s]+"\r\n"):o.write(e[s]+"\n");o.close(),o.clear()},i.default.prototype.saveTable=function(e,t,r){i.default._validateParameters("saveTable",arguments),n=void 0===r?t.substring(t.lastIndexOf(".")+1,t.length):r;var n,o=this.createWriter(t,n),s=e.columns,a="tsv"===n?"\t":",";if("html"!==n){if("0"!==s[0]){for(var l=0;l<s.length;l++)l<s.length-1?o.write(s[l]+a):o.write(s[l]);o.write("\n")}for(var u=0;u<e.rows.length;u++){var h=void 0;for(h=0;h<e.rows[u].arr.length;h++)h<e.rows[u].arr.length-1?"csv"===n&&String(e.rows[u].arr[h]).includes(",")?o.write('"'+e.rows[u].arr[h]+'"'+a):o.write(e.rows[u].arr[h]+a):"csv"===n&&String(e.rows[u].arr[h]).includes(",")?o.write('"'+e.rows[u].arr[h]+'"'):o.write(e.rows[u].arr[h]);o.write("\n")}}else{if(o.print("<html>"),o.print("<head>"),o.print('  <meta http-equiv="content-type" content="text/html;charset=utf-8" />'),o.print("</head>"),o.print("<body>"),o.print("  <table>"),"0"!==s[0]){o.print("    <tr>");for(var d=0;d<s.length;d++){var p=c(s[d]);o.print("      <td>".concat(p)),o.print("      </td>")}o.print("    </tr>")}for(var f=0;f<e.rows.length;f++){o.print("    <tr>");for(var m=0;m<e.columns.length;m++){var y=c(e.rows[f].getString(m));o.print("      <td>".concat(y)),o.print("      </td>")}o.print("    </tr>")}o.print("  </table>"),o.print("</body>"),o.print("</html>")}o.close(),o.clear()},i.default.prototype.writeFile=function(e,t,r){var n="application/octet-stream";i.default.prototype._isSafari()&&(n="text/plain"),e=new Blob(e,{type:n}),i.default.prototype.downloadFile(e,t,r)},i.default.prototype.downloadFile=function(e,t,r){var n;r=(t=u(t,r))[0],e instanceof Blob?s.default.saveAs(e,r):((n=document.createElement("a")).href=e,n.download=r,n.onclick=function(e){document.body.removeChild(e.target),e.stopPropagation()},n.style.display="none",document.body.appendChild(n),i.default.prototype._isSafari()&&(e=(e='Hello, Safari user! To download this file...\n1. Go to File --\x3e Save As.\n2. Choose "Page Source" as the Format.\n')+'3. Name it with this extension: ."'.concat(t[1],'"'),alert(e)),n.click())},i.default.prototype._checkFileExtension=u,i.default.prototype._isSafari=function(){return window.HTMLElement.toString().includes("Constructor")},e=i.default,r.default=e},{"../core/friendly_errors/fes_core":274,"../core/friendly_errors/file_errors":275,"../core/friendly_errors/validate_params":278,"../core/main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.last-index-of":167,"core-js/modules/es.array.map":168,"core-js/modules/es.array.slice":169,"core-js/modules/es.array.splice":171,"core-js/modules/es.function.name":174,"core-js/modules/es.object.from-entries":185,"core-js/modules/es.object.to-string":190,"core-js/modules/es.promise":191,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.includes":199,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.replace":204,"core-js/modules/es.string.split":206,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.typed-array.copy-within":213,"core-js/modules/es.typed-array.every":214,"core-js/modules/es.typed-array.fill":215,"core-js/modules/es.typed-array.filter":216,"core-js/modules/es.typed-array.find":218,"core-js/modules/es.typed-array.find-index":217,"core-js/modules/es.typed-array.for-each":221,"core-js/modules/es.typed-array.includes":222,"core-js/modules/es.typed-array.index-of":223,"core-js/modules/es.typed-array.iterator":226,"core-js/modules/es.typed-array.join":227,"core-js/modules/es.typed-array.last-index-of":228,"core-js/modules/es.typed-array.map":229,"core-js/modules/es.typed-array.reduce":231,"core-js/modules/es.typed-array.reduce-right":230,"core-js/modules/es.typed-array.reverse":232,"core-js/modules/es.typed-array.set":233,"core-js/modules/es.typed-array.slice":234,"core-js/modules/es.typed-array.some":235,"core-js/modules/es.typed-array.sort":236,"core-js/modules/es.typed-array.subarray":237,"core-js/modules/es.typed-array.to-locale-string":238,"core-js/modules/es.typed-array.to-string":239,"core-js/modules/es.typed-array.uint8-array":242,"core-js/modules/web.dom-collections.iterator":246,"core-js/modules/web.url":248,"es6-promise/auto":249,"fetch-jsonp":251,"file-saver":252,"whatwg-fetch":261}],310:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};n.default.Table=function(){function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.columns=[],this.rows=t}var t;return(t=[{key:"addRow",value:function(e){if(void 0===(e=e||new n.default.TableRow).arr||void 0===e.obj)throw new Error("invalid TableRow: ".concat(e));return(e.table=this).rows.push(e),e}},{key:"removeRow",value:function(e){this.rows[e].table=null,e=this.rows.splice(e+1,this.rows.length),this.rows.pop(),this.rows=this.rows.concat(e)}},{key:"getRow",value:function(e){return this.rows[e]}},{key:"getRows",value:function(){return this.rows}},{key:"findRow",value:function(e,t){if("string"==typeof t){for(var r=0;r<this.rows.length;r++)if(this.rows[r].obj[t]===e)return this.rows[r]}else for(var n=0;n<this.rows.length;n++)if(this.rows[n].arr[t]===e)return this.rows[n];return null}},{key:"findRows",value:function(e,t){var r=[];if("string"==typeof t)for(var n=0;n<this.rows.length;n++)this.rows[n].obj[t]===e&&r.push(this.rows[n]);else for(var i=0;i<this.rows.length;i++)this.rows[i].arr[t]===e&&r.push(this.rows[i]);return r}},{key:"matchRow",value:function(e,t){if("number"==typeof t){for(var r=0;r<this.rows.length;r++)if(this.rows[r].arr[t].match(e))return this.rows[r]}else for(var n=0;n<this.rows.length;n++)if(this.rows[n].obj[t].match(e))return this.rows[n];return null}},{key:"matchRows",value:function(e,t){var r=[];if("number"==typeof t)for(var n=0;n<this.rows.length;n++)this.rows[n].arr[t].match(e)&&r.push(this.rows[n]);else for(var i=0;i<this.rows.length;i++)this.rows[i].obj[t].match(e)&&r.push(this.rows[i]);return r}},{key:"getColumn",value:function(e){var t=[];if("string"==typeof e)for(var r=0;r<this.rows.length;r++)t.push(this.rows[r].obj[e]);else for(var n=0;n<this.rows.length;n++)t.push(this.rows[n].arr[e]);return t}},{key:"clearRows",value:function(){delete this.rows,this.rows=[]}},{key:"addColumn",value:function(e){this.columns.push(e||null)}},{key:"getColumnCount",value:function(){return this.columns.length}},{key:"getRowCount",value:function(){return this.rows.length}},{key:"removeTokens",value:function(e,t){for(var r=[],n=0;n<e.length;n++)r.push(e.charAt(n).replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"));var i=new RegExp(r.join("|"),"g");if(void 0===t)for(var o=0;o<this.columns.length;o++)for(var s=0;s<this.rows.length;s++){var a=(a=this.rows[s].arr[o]).replace(i,"");this.rows[s].arr[o]=a,this.rows[s].obj[this.columns[o]]=a}else if("string"==typeof t)for(var l=0;l<this.rows.length;l++){var c=(c=this.rows[l].obj[t]).replace(i,""),u=(this.rows[l].obj[t]=c,this.columns.indexOf(t));this.rows[l].arr[u]=c}else for(var h=0;h<this.rows.length;h++){var d=(d=this.rows[h].arr[t]).replace(i,"");this.rows[h].arr[t]=d,this.rows[h].obj[this.columns[t]]=d}}},{key:"trim",value:function(e){var t=new RegExp(" ","g");if(void 0===e)for(var r=0;r<this.columns.length;r++)for(var n=0;n<this.rows.length;n++){var i=(i=this.rows[n].arr[r]).replace(t,"");this.rows[n].arr[r]=i,this.rows[n].obj[this.columns[r]]=i}else if("string"==typeof e)for(var o=0;o<this.rows.length;o++){var s=(s=this.rows[o].obj[e]).replace(t,""),a=(this.rows[o].obj[e]=s,this.columns.indexOf(e));this.rows[o].arr[a]=s}else for(var l=0;l<this.rows.length;l++){var c=(c=this.rows[l].arr[e]).replace(t,"");this.rows[l].arr[e]=c,this.rows[l].obj[this.columns[e]]=c}}},{key:"removeColumn",value:function(e){var t,r;"string"==typeof e?r=this.columns.indexOf(t=e):t=this.columns[r=e],e=this.columns.splice(r+1,this.columns.length),this.columns.pop(),this.columns=this.columns.concat(e);for(var n=0;n<this.rows.length;n++){var i=this.rows[n].arr,o=i.splice(r+1,i.length);i.pop(),this.rows[n].arr=i.concat(o),delete this.rows[n].obj[t]}}},{key:"set",value:function(e,t,r){this.rows[e].set(t,r)}},{key:"setNum",value:function(e,t,r){this.rows[e].setNum(t,r)}},{key:"setString",value:function(e,t,r){this.rows[e].setString(t,r)}},{key:"get",value:function(e,t){return this.rows[e].get(t)}},{key:"getNum",value:function(e,t){return this.rows[e].getNum(t)}},{key:"getString",value:function(e,t){return this.rows[e].getString(t)}},{key:"getObject",value:function(e){for(var t,r={},n=0;n<this.rows.length;n++)if(t=this.rows[n].obj,"string"==typeof e){if(!(0<=this.columns.indexOf(e)))throw new Error('This table has no column named "'.concat(e,'"'));r[t[e]]=t}else r[n]=this.rows[n].obj;return r}},{key:"getArray",value:function(){for(var e=[],t=0;t<this.rows.length;t++)e.push(this.rows[t].arr);return e}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),e=n.default,r.default=e},{"../core/main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.index-of":164,"core-js/modules/es.array.join":166,"core-js/modules/es.array.splice":171,"core-js/modules/es.regexp.constructor":194,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.match":201,"core-js/modules/es.string.replace":204}],311:[function(e,t,r){"use strict";e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.from-entries"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.from-entries"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.TableRow=function(){function e(t,r){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");var n=[];t&&(n=t.split(r=r||",")),this.arr=n,this.obj=Object.fromEntries(n.entries()),this.table=null}var t;return(t=[{key:"set",value:function(e,t){if("string"==typeof e){var r=this.table.columns.indexOf(e);if(!(0<=r))throw new Error('This table has no column named "'.concat(e,'"'));this.obj[e]=t,this.arr[r]=t}else{if(!(e<this.table.columns.length))throw new Error("Column #".concat(e," is out of the range of this table"));this.arr[e]=t,r=this.table.columns[e],this.obj[r]=t}}},{key:"setNum",value:function(e,t){t=parseFloat(t),this.set(e,t)}},{key:"setString",value:function(e,t){t=t.toString(),this.set(e,t)}},{key:"get",value:function(e){return("string"==typeof e?this.obj:this.arr)[e]}},{key:"getNum",value:function(e){var t="string"==typeof e?parseFloat(this.obj[e]):parseFloat(this.arr[e]);if("NaN"===t.toString())throw"Error: ".concat(this.obj[e]," is NaN (Not a Number)");return t}},{key:"getString",value:function(e){return("string"==typeof e?this.obj:this.arr)[e].toString()}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),e=e.default,r.default=e},{"../core/main":283,"core-js/modules/es.array.index-of":164,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.from-entries":185,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.split":206,"core-js/modules/web.dom-collections.iterator":246}],312:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};n.default.XML=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");t?this.DOM=t:(t=document.implementation.createDocument(null,"doc"),this.DOM=t.createElement("root"))}var t;return(t=[{key:"getParent",value:function(){return new n.default.XML(this.DOM.parentElement)}},{key:"getName",value:function(){return this.DOM.tagName}},{key:"setName",value:function(e){var t=this.DOM.innerHTML,r=this.DOM.attributes,n=document.implementation.createDocument(null,"default").createElement(e);n.innerHTML=t;for(var i=0;i<r.length;i++)n.setAttribute(r[i].nodeName,r[i].nodeValue);this.DOM=n}},{key:"hasChildren",value:function(){return 0<this.DOM.children.length}},{key:"listChildren",value:function(){for(var e=[],t=0;t<this.DOM.childNodes.length;t++)e.push(this.DOM.childNodes[t].nodeName);return e}},{key:"getChildren",value:function(e){return function(e){for(var t=[],r=0;r<e.length;r++)t.push(new n.default.XML(e[r]));return t}(e?this.DOM.getElementsByTagName(e):this.DOM.children)}},{key:"getChild",value:function(e){if("string"!=typeof e)return new n.default.XML(this.DOM.children[e]);var t=!0,r=!1,i=void 0;try{for(var o,s=this.DOM.children[Symbol.iterator]();!(t=(o=s.next()).done);t=!0){var a=o.value;if(a.tagName===e)return new n.default.XML(a)}}catch(e){r=!0,i=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw i}}}},{key:"addChild",value:function(e){e instanceof n.default.XML&&this.DOM.appendChild(e.DOM)}},{key:"removeChild",value:function(e){var t=-1;if("string"==typeof e){for(var r=0;r<this.DOM.children.length;r++)if(this.DOM.children[r].tagName===e){t=r;break}}else t=e;-1!==t&&this.DOM.removeChild(this.DOM.children[t])}},{key:"getAttributeCount",value:function(){return this.DOM.attributes.length}},{key:"listAttributes",value:function(){var e=[],t=!0,r=!1,n=void 0;try{for(var i,o=this.DOM.attributes[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var s=i.value;e.push(s.nodeName)}}catch(e){r=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}return e}},{key:"hasAttribute",value:function(e){var t={},r=!0,n=!1,i=void 0;try{for(var o,s=this.DOM.attributes[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var a=o.value;t[a.nodeName]=a.nodeValue}}catch(e){n=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw i}}return!!t[e]}},{key:"getNum",value:function(e,t){var r={},n=!0,i=!1,o=void 0;try{for(var s,a=this.DOM.attributes[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var l=s.value;r[l.nodeName]=l.nodeValue}}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return Number(r[e])||t||0}},{key:"getString",value:function(e,t){var r={},n=!0,i=!1,o=void 0;try{for(var s,a=this.DOM.attributes[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var l=s.value;r[l.nodeName]=l.nodeValue}}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r[e]?String(r[e]):t||null}},{key:"setAttribute",value:function(e,t){this.DOM.setAttribute(e,t)}},{key:"getContent",value:function(e){var t=this.DOM.textContent;return(t=t.replace(/\s\s+/g,","))||e||null}},{key:"setContent",value:function(e){this.DOM.children.length||(this.DOM.textContent=e)}},{key:"serialize",value:function(){return(new XMLSerializer).serializeToString(this.DOM)}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),e=n.default,r.default=e},{"../core/main":283,"core-js/modules/es.array.iterator":165,"core-js/modules/es.number.constructor":179,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.replace":204,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/web.dom-collections.iterator":246}],313:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.string.includes"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};function i(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n.default.prototype.abs=Math.abs,n.default.prototype.ceil=Math.ceil,n.default.prototype.constrain=function(e,t,r){return n.default._validateParameters("constrain",arguments),Math.max(Math.min(e,r),t)},n.default.prototype.dist=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.default._validateParameters("dist",t),4===t.length?Math.hypot(t[2]-t[0],t[3]-t[1]):6===t.length?Math.hypot(t[3]-t[0],t[4]-t[1],t[5]-t[2]):void 0},n.default.prototype.exp=Math.exp,n.default.prototype.floor=Math.floor,n.default.prototype.lerp=function(e,t,r){return n.default._validateParameters("lerp",arguments),r*(t-e)+e},n.default.prototype.log=Math.log,n.default.prototype.mag=function(e,t){return n.default._validateParameters("mag",arguments),Math.hypot(e,t)},n.default.prototype.map=function(e,t,r,i,o,s){return n.default._validateParameters("map",arguments),e=(e-t)/(r-t)*(o-i)+i,s?i<o?this.constrain(e,i,o):this.constrain(e,o,i):e},n.default.prototype.max=function(){for(var e=function(e){return Math.max.apply(Math,i(e))},t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Array.isArray(r[0])?e(r[0]):e(r)},n.default.prototype.min=function(){for(var e=function(e){return Math.min.apply(Math,i(e))},t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Array.isArray(r[0])?e(r[0]):e(r)},n.default.prototype.norm=function(e,t,r){return n.default._validateParameters("norm",arguments),this.map(e,t,r,0,1)},n.default.prototype.pow=Math.pow,n.default.prototype.round=function(e,t){return t?(t=Math.pow(10,t),Math.round(e*t)/t):Math.round(e)},n.default.prototype.sq=function(e){return e*e},n.default.prototype.sqrt=Math.sqrt,n.default.prototype.fract=function(e){n.default._validateParameters("fract",arguments);var t,r=0;return e=Number(e),isNaN(e)||Math.abs(e)===1/0?e:(e<0&&(e=-e,r=1),String(e).includes(".")&&!String(e).includes("e")?(t=String(e),t=Number("0"+t.slice(t.indexOf("."))),Math.abs(r-t)):e<1?Math.abs(r-e):0)},e=n.default,r.default=e},{"../core/main":283,"core-js/modules/es.array.from":162,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.index-of":164,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.map":168,"core-js/modules/es.array.slice":169,"core-js/modules/es.math.hypot":176,"core-js/modules/es.number.constructor":179,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.includes":199,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/web.dom-collections.iterator":246}],314:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.slice"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};function i(e,t,r){return(i=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),1}catch(e){}}}()?Reflect.construct:function(e,t,r){var n=[null];return n.push.apply(n,t),t=new(Function.bind.apply(e,n)),r&&o(t,r.prototype),t}).apply(null,arguments)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.default.prototype.createVector=function(e,t,r){return this instanceof n.default?i(n.default.Vector,[this._fromRadians.bind(this),this._toRadians.bind(this)].concat(Array.prototype.slice.call(arguments))):new n.default.Vector(e,t,r)},e=n.default,r.default=e},{"../core/main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.slice":169,"core-js/modules/es.object.to-string":190,"core-js/modules/es.reflect.construct":192,"core-js/modules/es.regexp.to-string":196}],315:[function(e,t,r){"use strict";function n(e){return.5*(1-Math.cos(e*Math.PI))}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,e=(e=e("../core/main"))&&e.__esModule?e:{default:e};var i,o=4095,s=4,a=.5;e.default.prototype.noise=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;if(null==i){i=new Array(4096);for(var l=0;l<4096;l++)i[l]=Math.random()}e<0&&(e=-e),t<0&&(t=-t),r<0&&(r=-r);for(var c,u,h=Math.floor(e),d=Math.floor(t),p=Math.floor(r),f=e-h,m=t-d,y=r-p,g=0,v=.5,b=0;b<s;b++){var _=h+(d<<4)+(p<<8),x=n(f),w=n(m),S=i[_&o];S+=x*(i[_+1&o]-S),c=i[_+16&o],S+=w*((c+=x*(i[_+16+1&o]-c))-S),c=i[(_+=256)&o],c+=x*(i[_+1&o]-c),u=i[_+16&o],c+=w*((u+=x*(i[_+16+1&o]-u))-c),g+=(S+=n(y)*(c-S))*v,v*=a,h<<=1,d<<=1,p<<=1,1<=(f*=2)&&(h++,f--),1<=(m*=2)&&(d++,m--),1<=(y*=2)&&(p++,y--)}return g},e.default.prototype.noiseDetail=function(e,t){0<e&&(s=e),0<t&&(a=t)},e.default.prototype.noiseSeed=function(e){r=4294967296;var t,r;(function(e){t=(null==e?Math.random()*r:e)>>>0})(e),i=new Array(4096);for(var n=0;n<4096;n++)i[n]=(t=(1664525*t+1013904223)%r)/r},e=e.default,r.default=e},{"../core/main":283}],316:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.epsilon"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.epsilon"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(c=e("../core/main"))&&c.__esModule?c:{default:c},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}o.default.Vector=function(){function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");var t,r,n="function"==typeof(arguments.length<=0?void 0:arguments[0])?(this.isPInst=!0,this._fromRadians=arguments.length<=0?void 0:arguments[0],this._toRadians=arguments.length<=1?void 0:arguments[1],t=(arguments.length<=2?void 0:arguments[2])||0,r=(arguments.length<=3?void 0:arguments[3])||0,(arguments.length<=4?void 0:arguments[4])||0):(t=(arguments.length<=0?void 0:arguments[0])||0,r=(arguments.length<=1?void 0:arguments[1])||0,(arguments.length<=2?void 0:arguments[2])||0);this.x=t,this.y=r,this.z=n}var t,r,n;return t=e,n=[{key:"fromAngle",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;return new o.default.Vector(t*Math.cos(e),t*Math.sin(e),0)}},{key:"fromAngles",value:function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,n=Math.cos(t),i=(t=Math.sin(t),Math.cos(e));return e=Math.sin(e),new o.default.Vector(r*e*t,-r*i,r*e*n)}},{key:"random2D",value:function(){return this.fromAngle(Math.random()*s.TWO_PI)}},{key:"random3D",value:function(){var e=Math.random()*s.TWO_PI,t=2*Math.random()-1,r=(n=Math.sqrt(1-t*t))*Math.cos(e),n=n*Math.sin(e);return new o.default.Vector(r,n,t)}},{key:"copy",value:function(e){return e.copy(e)}},{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1],s=t[2];return s?s.set(n):(s=n.copy(),3===t.length&&o.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.add")),s.add(i),s}},{key:"rem",value:function(e,t){if(e instanceof o.default.Vector&&t instanceof o.default.Vector)return(e=e.copy()).rem(t),e}},{key:"sub",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1],s=t[2];return s?s.set(n):(s=n.copy(),3===t.length&&o.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.sub")),s.sub(i),s}},{key:"mult",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1],s=t[2];return s?s.set(n):(s=n.copy(),3===t.length&&o.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.mult")),s.mult(i),s}},{key:"rotate",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1],s=t[2];return 2===t.length?s=n.copy():(s instanceof o.default.Vector||o.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.rotate"),s.set(n)),s.rotate(i),s}},{key:"div",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1],s=t[2];return s?s.set(n):(s=n.copy(),3===t.length&&o.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.div")),s.div(i),s}},{key:"dot",value:function(e,t){return e.dot(t)}},{key:"cross",value:function(e,t){return e.cross(t)}},{key:"dist",value:function(e,t){return e.dist(t)}},{key:"lerp",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1],s=t[2],a=t[3];return a?a.set(n):(a=n.copy(),4===t.length&&o.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.lerp")),a.lerp(i,s),a}},{key:"slerp",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1],s=t[2],a=t[3];return a?a.set(n):(a=n.copy(),4===t.length&&o.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.slerp")),a.slerp(i,s),a}},{key:"mag",value:function(e){return e.mag()}},{key:"magSq",value:function(e){return e.magSq()}},{key:"normalize",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1];return t.length<2?i=n.copy():(i instanceof o.default.Vector||o.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.normalize"),i.set(n)),i.normalize()}},{key:"limit",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1],s=t[2];return t.length<3?s=n.copy():(s instanceof o.default.Vector||o.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.limit"),s.set(n)),s.limit(i)}},{key:"setMag",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1],s=t[2];return t.length<3?s=n.copy():(s instanceof o.default.Vector||o.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.setMag"),s.set(n)),s.setMag(i)}},{key:"heading",value:function(e){return e.heading()}},{key:"angleBetween",value:function(e,t){return e.angleBetween(t)}},{key:"reflect",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1],s=t[2];return t.length<3?s=n.copy():(s instanceof o.default.Vector||o.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.reflect"),s.set(n)),s.reflect(i)}},{key:"array",value:function(e){return e.array()}},{key:"equals",value:function(e,t){var r;return e instanceof o.default.Vector?r=e:Array.isArray(e)?r=(new o.default.Vector).set(e):o.default._friendlyError("The v1 parameter should be of type Array or p5.Vector","p5.Vector.equals"),r.equals(t)}}],(r=[{key:"toString",value:function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")}},{key:"set",value:function(e,t,r){return e instanceof o.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):Array.isArray(e)?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this}},{key:"copy",value:function(){return this.isPInst?new o.default.Vector(this._fromRadians,this._toRadians,this.x,this.y,this.z):new o.default.Vector(this.x,this.y,this.z)}},{key:"add",value:function(e,t,r){return e instanceof o.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):Array.isArray(e)?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this}},{key:"calculateRemainder2D",value:function(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}},{key:"calculateRemainder3D",value:function(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}},{key:"rem",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i,s,a=t[0],l=t[1],c=t[2];if(a instanceof o.default.Vector){if([a.x,a.y,a.z].every(Number.isFinite))return n=parseFloat(a.x),i=parseFloat(a.y),s=parseFloat(a.z),this.calculateRemainder3D(n,i,s)}else if(Array.isArray(a)){if(a.every(Number.isFinite))return 2===a.length?this.calculateRemainder2D(a[0],a[1]):3===a.length?this.calculateRemainder3D(a[0],a[1],a[2]):void 0}else if(1===t.length){if(Number.isFinite(a)&&0!==a)return this.x=this.x%a,this.y=this.y%a,this.z=this.z%a,this}else if(2===t.length){if(t.every(Number.isFinite))return this.calculateRemainder2D(a,l)}else if(3===t.length&&t.every(Number.isFinite))return this.calculateRemainder3D(a,l,c)}},{key:"sub",value:function(e,t,r){return e instanceof o.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):Array.isArray(e)?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this}},{key:"mult",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=t[0],s=t[1],a=t[2];return i instanceof o.default.Vector?Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z)&&"number"==typeof i.x&&"number"==typeof i.y&&"number"==typeof i.z?(this.x*=i.x,this.y*=i.y,this.z*=i.z):console.warn("p5.Vector.prototype.mult:","x contains components that are either undefined or not finite numbers"):Array.isArray(i)?i.every((function(e){return Number.isFinite(e)}))&&i.every((function(e){return"number"==typeof e}))?1===i.length?(this.x*=i[0],this.y*=i[0],this.z*=i[0]):2===i.length?(this.x*=i[0],this.y*=i[1]):3===i.length&&(this.x*=i[0],this.y*=i[1],this.z*=i[2]):console.warn("p5.Vector.prototype.mult:","x contains elements that are either undefined or not finite numbers"):(n=t).every((function(e){return Number.isFinite(e)}))&&n.every((function(e){return"number"==typeof e}))?(1===t.length&&(this.x*=i,this.y*=i,this.z*=i),2===t.length&&(this.x*=i,this.y*=s),3===t.length&&(this.x*=i,this.y*=s,this.z*=a)):console.warn("p5.Vector.prototype.mult:","x, y, or z arguments are either undefined or not a finite number"),this}},{key:"div",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1],s=t[2];if(n instanceof o.default.Vector)if(Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z)&&"number"==typeof n.x&&"number"==typeof n.y&&"number"==typeof n.z){var a=0===n.z&&0===this.z;if(0===n.x||0===n.y||!a&&0===n.z)return console.warn("p5.Vector.prototype.div:","divide by 0"),this;this.x/=n.x,this.y/=n.y,a||(this.z/=n.z)}else console.warn("p5.Vector.prototype.div:","x contains components that are either undefined or not finite numbers");else if(Array.isArray(n))if(n.every(Number.isFinite)&&n.every((function(e){return"number"==typeof e}))){if(n.some((function(e){return 0===e})))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;1===n.length?(this.x/=n[0],this.y/=n[0],this.z/=n[0]):2===n.length?(this.x/=n[0],this.y/=n[1]):3===n.length&&(this.x/=n[0],this.y/=n[1],this.z/=n[2])}else console.warn("p5.Vector.prototype.div:","x contains components that are either undefined or not finite numbers");else if(t.every(Number.isFinite)&&t.every((function(e){return"number"==typeof e}))){if(t.some((function(e){return 0===e})))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;1===t.length&&(this.x/=n,this.y/=n,this.z/=n),2===t.length&&(this.x/=n,this.y/=i),3===t.length&&(this.x/=n,this.y/=i,this.z/=s)}else console.warn("p5.Vector.prototype.div:","x, y, or z arguments are either undefined or not a finite number");return this}},{key:"mag",value:function(){return Math.sqrt(this.magSq())}},{key:"magSq",value:function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r}},{key:"dot",value:function(e,t,r){return e instanceof o.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)}},{key:"cross",value:function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z;return e=this.x*e.y-this.y*e.x,this.isPInst?new o.default.Vector(this._fromRadians,this._toRadians,t,r,e):new o.default.Vector(t,r,e)}},{key:"dist",value:function(e){return e.copy().sub(this).mag()}},{key:"normalize",value:function(){var e=this.mag();return 0!==e&&this.mult(1/e),this}},{key:"limit",value:function(e){var t=this.magSq();return e*e<t&&this.div(Math.sqrt(t)).mult(e),this}},{key:"setMag",value:function(e){return this.normalize().mult(e)}},{key:"heading",value:function(){var e=Math.atan2(this.y,this.x);return this.isPInst?this._fromRadians(e):e}},{key:"setHeading",value:function(e){this.isPInst&&(e=this._toRadians(e));var t=this.mag();return this.x=t*Math.cos(e),this.y=t*Math.sin(e),this}},{key:"rotate",value:function(e){e=this.heading()+e;var t=(this.isPInst&&(e=this._toRadians(e)),this.mag());return this.x=Math.cos(e)*t,this.y=Math.sin(e)*t,this}},{key:"angleBetween",value:function(e){var t;return 0==this.magSq()*e.magSq()?NaN:(t=this.cross(e),e=Math.atan2(t.mag(),this.dot(e))*Math.sign(t.z||1),this.isPInst?this._fromRadians(e):e)}},{key:"lerp",value:function(e,t,r,n){return e instanceof o.default.Vector?this.lerp(e.x,e.y,e.z,t):(this.x+=(e-this.x)*n||0,this.y+=(t-this.y)*n||0,this.z+=(r-this.z)*n||0,this)}},{key:"slerp",value:function(e,t){if(0!==t){if(1===t)return this.set(e);var r=this.mag(),n=e.mag();if(0==r*n)this.mult(1-t).add(e.x*t,e.y*t,e.z*t);else{var i=this.cross(e),o=i.mag(),s=Math.atan2(o,this.dot(e));if(0<o)i.x/=o,i.y/=o,i.z/=o;else{if(s<.5*Math.PI)return this.mult(1-t).add(e.x*t,e.y*t,e.z*t),this;0===this.z&&0===e.z?i.set(0,0,1):0!==this.x?i.set(this.y,-this.x,0).normalize():i.set(1,0,0)}o=i.cross(this),i=(e=1-t+t*n/r)*Math.cos(t*s),n=e*Math.sin(t*s),this.x=this.x*i+o.x*n,this.y=this.y*i+o.y*n,this.z=this.z*i+o.z*n}}return this}},{key:"reflect",value:function(e){return e=o.default.Vector.normalize(e),this.sub(e.mult(2*this.dot(e)))}},{key:"array",value:function(){return[this.x||0,this.y||0,this.z||0]}},{key:"equals",value:function(e,t,r){var n,i;return e=e instanceof o.default.Vector?(n=e.x||0,i=e.y||0,e.z||0):Array.isArray(e)?(n=e[0]||0,i=e[1]||0,e[2]||0):(n=e||0,i=t||0,r||0),this.x===n&&this.y===i&&this.z===e}},{key:"clampToZero",value:function(){return this.x=this._clampToZero(this.x),this.y=this._clampToZero(this.y),this.z=this._clampToZero(this.z),this}},{key:"_clampToZero",value:function(e){return Math.abs(+(e||0))<=Number.EPSILON?0:e}}])&&l(t.prototype,r),n&&l(t,n),e}();var c=o.default.Vector;r.default=c},{"../core/constants":272,"../core/main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.every":155,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.some":170,"core-js/modules/es.math.sign":178,"core-js/modules/es.number.constructor":179,"core-js/modules/es.number.epsilon":180,"core-js/modules/es.number.is-finite":181,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.sub":208,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],317:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e},i="_lcg_random_state",o=4294967296,s=0;n.default.prototype._lcg=function(e){return this[e]=(1664525*this[e]+1013904223)%o,this[e]/o},n.default.prototype._lcgSetSeed=function(e,t){this[e]=(null==t?Math.random()*o:t)>>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(i,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r,o;return n.default._validateParameters("random",arguments),r=null!=this[i]?this._lcg(i):Math.random(),void 0===e?r:void 0===t?Array.isArray(e)?e[Math.floor(r*e.length)]:r*e:(t<e&&(o=e,e=t,t=o),r*(t-e)+e)},n.default.prototype.randomGaussian=function(e){var t,r,n,i,o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;if(this._gaussian_previous)t=s,this._gaussian_previous=!1;else{for(;1<=(i=(r=this.random(2)-1)*r+(n=this.random(2)-1)*n););t=r*(i=Math.sqrt(-2*Math.log(i)/i)),s=n*i,this._gaussian_previous=!0}return t*o+(e||0)},e=n.default,r.default=e},{"../core/main":283}],318:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(l=e("../core/main"))&&l.__esModule?l:{default:l},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}o.default.prototype._angleMode=s.RADIANS,o.default.prototype.acos=function(e){return this._fromRadians(Math.acos(e))},o.default.prototype.asin=function(e){return this._fromRadians(Math.asin(e))},o.default.prototype.atan=function(e){return this._fromRadians(Math.atan(e))},o.default.prototype.atan2=function(e,t){return this._fromRadians(Math.atan2(e,t))},o.default.prototype.cos=function(e){return Math.cos(this._toRadians(e))},o.default.prototype.sin=function(e){return Math.sin(this._toRadians(e))},o.default.prototype.tan=function(e){return Math.tan(this._toRadians(e))},o.default.prototype.degrees=function(e){return e*s.RAD_TO_DEG},o.default.prototype.radians=function(e){return e*s.DEG_TO_RAD},o.default.prototype.angleMode=function(e){if(o.default._validateParameters("angleMode",arguments),void 0===e)return this._angleMode;e!==s.DEGREES&&e!==s.RADIANS||e!==this._angleMode&&(e===s.RADIANS?(this._setProperty("pRotationX",this.pRotationX*s.DEG_TO_RAD),this._setProperty("pRotationY",this.pRotationY*s.DEG_TO_RAD),this._setProperty("pRotationZ",this.pRotationZ*s.DEG_TO_RAD)):(this._setProperty("pRotationX",this.pRotationX*s.RAD_TO_DEG),this._setProperty("pRotationY",this.pRotationY*s.RAD_TO_DEG),this._setProperty("pRotationZ",this.pRotationZ*s.RAD_TO_DEG)),this._angleMode=e)},o.default.prototype._toRadians=function(e){return this._angleMode===s.DEGREES?e*s.DEG_TO_RAD:e},o.default.prototype._toDegrees=function(e){return this._angleMode===s.RADIANS?e*s.RAD_TO_DEG:e},o.default.prototype._fromRadians=function(e){return this._angleMode===s.DEGREES?e*s.RAD_TO_DEG:e},o.default.prototype._fromDegrees=function(e){return this._angleMode===s.RADIANS?e*s.DEG_TO_RAD:e};var l=o.default;r.default=l},{"../core/constants":272,"../core/main":283,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],319:[function(e,t,r){"use strict";e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};n.default.prototype.textAlign=function(e,t){var r;return n.default._validateParameters("textAlign",arguments),(r=this._renderer).textAlign.apply(r,arguments)},n.default.prototype.textLeading=function(e){var t;return n.default._validateParameters("textLeading",arguments),(t=this._renderer).textLeading.apply(t,arguments)},n.default.prototype.textSize=function(e){var t;return n.default._validateParameters("textSize",arguments),(t=this._renderer).textSize.apply(t,arguments)},n.default.prototype.textStyle=function(e){var t;return n.default._validateParameters("textStyle",arguments),(t=this._renderer).textStyle.apply(t,arguments)},n.default.prototype.textWidth=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t[0]+="",n.default._validateParameters("textWidth",t),0===t[0].length)return 0;for(var i=t[0].replace(/\t/g,"  ").split(/\r?\n|\r|\n/g),o=[],s=0;s<i.length;s++)o.push(this._renderer.textWidth(i[s]));return Math.max.apply(Math,o)},n.default.prototype.textAscent=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.default._validateParameters("textAscent",t),this._renderer.textAscent()},n.default.prototype.textDescent=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.default._validateParameters("textDescent",t),this._renderer.textDescent()},n.default.prototype._updateTextMetrics=function(){return this._renderer._updateTextMetrics()},n.default.prototype.textWrap=function(e){return n.default._validateParameters("textWrap",[e]),this._renderer.textWrap(e)},e=n.default,r.default=e},{"../core/main":283,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.string.replace":204,"core-js/modules/es.string.split":206}],320:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(u=e("../core/main"))&&u.__esModule?u:{default:u},s=c(e("../core/constants")),a=c(e("opentype.js"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,n,o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&((n=s?Object.getOwnPropertyDescriptor(e,r):null)&&(n.get||n.set)?Object.defineProperty(o,r,n):o[r]=e[r]);return o.default=e,t&&t.set(e,o),o}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),o.default.prototype.loadFont=function(e,t,r){o.default._validateParameters("loadFont",arguments);var n=new o.default.Font(this),i=this;return a.load(e,(function(s,a){if(s)return o.default._friendlyFileLoadError(4,e),void 0!==r?r(s):void console.error(s,e);n.font=a,void 0!==t&&t(n),i._decrementPreload();var l=(a=(s=e.split("\\").pop().split("/").pop()).lastIndexOf("."))<1?null:s.slice(a+1);["ttf","otf","woff","woff2"].includes(l)&&(l=s.slice(0,-1!==a?a:0),(s=document.createElement("style")).appendChild(document.createTextNode("\n@font-face {\nfont-family: ".concat(l,";\nsrc: url(").concat(e,");\n}\n"))),document.head.appendChild(s))})),n},o.default.prototype.text=function(e,t,r,n,i){var s;return o.default._validateParameters("text",arguments),this._renderer._doFill||this._renderer._doStroke?(s=this._renderer).text.apply(s,arguments):this},o.default.prototype.textFont=function(e,t){if(o.default._validateParameters("textFont",arguments),arguments.length){if(e)return this._renderer._setProperty("_textFont",e),t&&(this._renderer._setProperty("_textSize",t),this._renderer._leadingSet||this._renderer._setProperty("_textLeading",t*s._DEFAULT_LEADMULT)),this._renderer._applyTextProperties();throw new Error("null font passed to textFont")}return this._renderer._textFont};var u=o.default;r.default=u},{"../core/constants":272,"../core/friendly_errors/fes_core":274,"../core/friendly_errors/file_errors":275,"../core/friendly_errors/validate_params":278,"../core/main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.last-index-of":167,"core-js/modules/es.array.slice":169,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.split":206,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246,"opentype.js":257}],321:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r,n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var o;Object.prototype.hasOwnProperty.call(e,r)&&((o=i?Object.getOwnPropertyDescriptor(e,r):null)&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function s(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,s=function(){return e},e)}function a(e){return(a="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}function l(e,t){var r=e.length;return e[t<0?t%r+r:t%r]}function c(e,t,r,n){var i,o,s;return n?(void 0===c.tmpPoint1&&(c.tmpPoint1=[],c.tmpPoint2=[]),o=c.tmpPoint1,s=c.tmpPoint2,o.x=t.x-e.x,o.y=t.y-e.y,s.x=r.x-t.x,s.y=r.y-t.y,i=o.x*s.x+o.y*s.y,o=Math.sqrt(o.x*o.x+o.y*o.y),s=Math.sqrt(s.x*s.x+s.y*s.y),Math.acos(i/(o*s))<n):0==(t[0]-e[0])*(r[1]-e[1])-(r[0]-e[0])*(t[1]-e[1])}function u(e,t,r,n,i,o,s,a,l){var c=1-l,u=(h=Math.pow(c,3))*e+3*(d=Math.pow(c,2))*l*r+3*c*l*l*i+(p=(m=l*l)*l)*s,h=h*t+3*d*l*n+3*c*l*l*o+p*a,d=e+2*l*(r-e)+m*(i-2*r+e),p=t+2*l*(n-t)+m*(o-2*n+t),f=r+2*l*(i-r)+m*(s-2*i+r),m=n+2*l*(o-n)+m*(a-2*o+n);return e=c*e+l*r,r=c*t+l*n,t=c*i+l*s,n=c*o+l*a,i=90-180*Math.atan2(d-f,p-m)/Math.PI,(f<d||p<m)&&(i+=180),{x:u,y:h,m:{x:d,y:p},n:{x:f,y:m},start:{x:e,y:r},end:{x:t,y:n},alpha:i}}function h(e,t,r,n,i,o,s,a,l){return null==l?g(e,t,r,n,i,o,s,a):u(e,t,r,n,i,o,s,a,function(e,t,r,n,i,o,s,a,l){if(!(l<0||g(e,t,r,n,i,o,s,a)<l)){var c,u=.5,h=1-u;for(c=g(e,t,r,n,i,o,s,a,h);.01<Math.abs(c-l);)c=g(e,t,r,n,i,o,s,a,h+=(c<l?1:-1)*(u/=2));return h}}(e,t,r,n,i,o,s,a,l))}function d(e,t,r){for(var n,i,o,s,a,l=0,c=0,d=(e=function(e){function t(e,t,r){var n,i;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(e[0]in{T:1,Q:1}||(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C"].concat(p.apply(0,[t.x,t.y].concat(e.slice(1))));break;case"S":i="C"===r||"S"===r?(n=2*t.x-t.bx,2*t.y-t.by):(n=t.x,t.y),e=["C",n,i].concat(e.slice(1));break;case"T":"Q"===r||"T"===r?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C"].concat(y(t.x,t.y,t.qx,t.qy,e[1],e[2]));break;case"Q":t.qx=e[1],t.qy=e[2],e=["C"].concat(y(t.x,t.y,e[1],e[2],e[3],e[4]));break;case"L":e=["C"].concat(m(t.x,t.y,e[1],e[2]));break;case"H":e=["C"].concat(m(t.x,t.y,e[1],t.y));break;case"V":e=["C"].concat(m(t.x,t.y,t.x,e[1]));break;case"Z":e=["C"].concat(m(t.x,t.y,t.X,t.Y))}return e}function r(e,t){if(7<e[t].length){e[t].shift();for(var r=e[t];r.length;)c[t]="A",s&&(u[t]="A"),e.splice(t++,0,["C"].concat(r.splice(0,6)));e.splice(t,1),i=Math.max(o.length,s&&s.length||0)}}function n(e,t,r,n,a){e&&t&&"M"===e[a][0]&&"M"!==t[a][0]&&(t.splice(a,0,["M",n.x,n.y]),r.bx=0,r.by=0,r.x=e[a][1],r.y=e[a][2],i=Math.max(o.length,s&&s.length||0))}var i,o=function(e){var t=[],r=0,n=0,i=0,o=0,s=0;if(e){"M"===e[0][0]&&(i=r=+e[0][1],o=n=+e[0][2],s++,t[0]=["M",r,n]);for(var a,l,c=3===e.length&&"M"===e[0][0]&&"R"===e[1][0].toUpperCase()&&"Z"===e[2][0].toUpperCase(),u=s,h=e.length;u<h;u++){if(t.push(a=[]),(l=e[u])[0]!==l[0].toUpperCase())switch(a[0]=l[0].toUpperCase(),a[0]){case"A":a[1]=l[1],a[2]=l[2],a[3]=l[3],a[4]=l[4],a[5]=l[5],a[6]=+(l[6]+r),a[7]=+(l[7]+n);break;case"V":a[1]=+l[1]+n;break;case"H":a[1]=+l[1]+r;break;case"R":for(var d,p=2,m=(d=[r,n].concat(l.slice(1))).length;p<m;p++)d[p]=+d[p]+r,d[++p]=+d[p]+n;t.pop(),t=t.concat(f(d,c));break;case"M":i=+l[1]+r,o=+l[2]+n;break;default:for(var y=1,g=l.length;y<g;y++)a[y]=+l[y]+(y%2?r:n)}else if("R"===l[0])d=[r,n].concat(l.slice(1)),t.pop(),t=t.concat(f(d,c)),a=["R"].concat(l.slice(-2));else for(var v=0,b=l.length;v<b;v++)a[v]=l[v];switch(a[0]){case"Z":r=i,n=o;break;case"H":r=a[1];break;case"V":n=a[1];break;case"M":i=a[a.length-2],o=a[a.length-1];break;default:r=a[a.length-2],n=a[a.length-1]}}}return t}(e),s=void 0,a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},l={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},c=[],u=[],h="",d="";i=Math.max(o.length,s&&s.length||0);for(var g=0;g<i;g++){"C"!==(h=o[g]?o[g][0]:h)&&(c[g]=h,g&&(d=c[g-1])),o[g]=t(o[g],a,d),"A"!==c[g]&&"C"===h&&(c[g]="C"),r(o,g),s&&("C"!==(h=s[g]?s[g][0]:h)&&(u[g]=h,g&&(d=u[g-1])),s[g]=t(s[g],l,d),"A"!==u[g]&&"C"===h&&(u[g]="C"),r(s,g)),n(o,s,a,l,g),n(s,o,l,a,g);var v=o[g],b=s&&s[g],_=v.length,x=s&&b.length;a.x=v[_-2],a.y=v[_-1],a.bx=parseFloat(v[_-4])||a.x,a.by=parseFloat(v[_-3])||a.y,l.bx=s&&(parseFloat(b[x-4])||l.x),l.by=s&&(parseFloat(b[x-3])||l.y),l.x=s&&b[x-2],l.y=s&&b[x-1]}return s?[o,s]:o}(e)).length;c<d;c++){if("M"===(o=e[c])[0])n=+o[1],i=+o[2];else{if(t<l+(s=h(n,i,o[1],o[2],o[3],o[4],o[5],o[6]))&&!r)return{x:(a=h(n,i,o[1],o[2],o[3],o[4],o[5],o[6],t-l)).x,y:a.y,alpha:a.alpha};l+=s,n=+o[5],i=+o[6]}o.shift()}return(a=r?l:u(n,i,o[0],o[1],o[2],o[3],o[4],o[5],1)).alpha?{x:a.x,y:a.y,alpha:a.alpha}:a}function p(e,t,r,n,i,o,s,a,l,c){function u(e,t,r){return{x:e*Math.cos(r)-t*Math.sin(r),y:e*Math.sin(r)+t*Math.cos(r)}}var h,d=120*(v=Math.PI)/180,f=v/180*(+i||0),m=[],y=(c?(S=c[0],h=c[1],x=c[2],w=c[3]):(e=(b=u(e,t,-f)).x,t=b.y,1<(y=(g=(e-(a=(b=u(a,l,-f)).x))/2)*g/(r*r)+(b=(t-(l=b.y))/2)*b/(n*n))&&(r*=y=Math.sqrt(y),n*=y),y=r*r,_=n*n,x=(o=(o===s?-1:1)*Math.sqrt(Math.abs((y*_-y*b*b-_*g*g)/(y*b*b+_*g*g))))*r*b/n+(e+a)/2,w=o*-n*g/r+(t+l)/2,S=Math.asin(((t-w)/n).toFixed(9)),h=Math.asin(((l-w)/n).toFixed(9)),(S=e<x?v-S:S)<0&&(S=2*v+S),(h=a<x?v-h:h)<0&&(h=2*v+h),s&&h<S&&(S-=2*v),!s&&S<h&&(h-=2*v)),h-S),g=(Math.abs(y)>d&&(_=h,b=a,o=l,h=S+d*(s&&S<h?1:-1),m=p(a=x+r*Math.cos(h),l=w+n*Math.sin(h),r,n,i,0,s,b,o,[h,_,x,w])),y=h-S,Math.cos(S)),v=Math.sin(S),b=(d=Math.cos(h),i=Math.sin(h),4/3*r*(s=Math.tan(y/4))),_=[e,t],x=[e+b*v,t-(o=4/3*n*s)*g],w=[a+b*i,l-o*d],S=[a,l];if(x[0]=2*_[0]-x[0],x[1]=2*_[1]-x[1],c)return[x,w,S].concat(m);for(var M=[],T=0,E=(m=[x,w,S].concat(m).join().split(",")).length;T<E;T++)M[T]=T%2?u(m[T-1],m[T],f).y:u(m[T],m[T+1],f).x;return M}function f(e,t){for(var r=[],n=0,i=e.length;n<i-2*!t;n+=2){var o=[{x:+e[n-2],y:+e[n-1]},{x:+e[n],y:+e[n+1]},{x:+e[n+2],y:+e[n+3]},{x:+e[n+4],y:+e[n+5]}];t?n?i-4===n?o[3]={x:+e[0],y:+e[1]}:i-2===n&&(o[2]={x:+e[0],y:+e[1]},o[3]={x:+e[2],y:+e[3]}):o[0]={x:+e[i-2],y:+e[i-1]}:i-4===n?o[3]=o[2]:n||(o[0]={x:+e[n],y:+e[n+1]}),r.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return r}function m(e,t,r,n){return[e,t,r,n,r,n]}function y(e,t,r,n,i,o){return[1/3*e+2/3*r,1/3*t+2/3*n,1/3*i+2/3*r,1/3*o+2/3*n,i,o]}function g(e,t,r,n,i,o,s,a,l){for(var c=(l=1<(l=null==l?1:l)?1:l<0?0:l)/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=0,d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],p=0;p<12;p++){var f=v(m=c*u[p]+c,e,r,i,s),m=v(m,t,n,o,a);h+=d[p]*Math.sqrt(f*f+m*m)}return c*h}function v(e,t,r,n,i){return e*(e*(-3*t+9*r-9*n+3*i)+6*t-12*r+6*n)-3*t+3*r}i.default.Font=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.parent=t,this.cache={},this.font=void 0}var t;return(t=[{key:"textBounds",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,n=3<arguments.length?arguments[3]:void 0,i=4<arguments.length?arguments[4]:void 0,s=i&&i.renderer&&i.renderer._pInst||this.parent;if((g=s._renderer.drawingContext).textAlign||o.LEFT,g.textBaseline||o.BASELINE,n=n||s._renderer._textSize,!v){for(var a=[],l=[],c=[],u=(c[0]=[],[]),h=this._scale(n),d=s._renderer.textLeading(),p=0,f=(this.font.forEachGlyph(e,t,r,n,i,(function(e,t,r,n){var i=e.getMetrics();0===e.index?c[p+=1]=[]:(c[p].push(t+i.xMin*h),c[p].push(t+i.xMax*h),u.push(r+p*d+-i.yMin*h),u.push(r+p*d+-i.yMax*h))})),0<c[p].length&&(a[p]=Math.min.apply(null,c[p]),l[p]=Math.max.apply(null,c[p])),0),m=0;m<=p;m++){a[m]=Math.min.apply(null,c[m]),l[m]=Math.max.apply(null,c[m]);var y=l[m]-a[m];f<y&&(f=y)}var g,v={x:g=Math.min.apply(null,a),y:r=Math.min.apply(null,u),h:Math.max.apply(null,u)-r,w:f,advance:g-t};n=this._handleAlignment(s._renderer,e,v.x,v.y,v.w+v.advance),v.x=n.x,v.y=n.y}return v}},{key:"textToPoints",value:function(e,t,r,n,i){var o,s=t,u=[],h=this.parent,p=e.split(/\r?\n|\r|\n/g);n=n||this.parent._renderer._textSize;for(var f,m,y,g=0;g<p.length;g++){var v=0;t=s;for(var b=(b=p[g]).replace("\t","  "),_=this._getGlyphs(b),x=0;x<_.length;x++){if(m=b,!((y=_)[f=x].name&&"space"===y[f].name||m.length===y.length&&" "===m[f]))for(var w=function(e){for(var t,r=[],n=0;n<e.length;n++)"M"===e[n].type&&(t&&r.push(t),t=[]),t.push(function(e){var t=[e.type];return"M"===e.type||"L"===e.type?t.push(e.x,e.y):"C"===e.type?t.push(e.x1,e.y1,e.x2,e.y2,e.x,e.y):"Q"===e.type&&t.push(e.x1,e.y1,e.x,e.y),t}(e[n]));return r.push(t),r}(_[x].getPath(t,r,n).commands),S=0;S<w.length;S++)for(var M=function(e,t){t=function(e,t){if("object"!==a(e))e=t;else for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e}(t,{sampleFactor:.1,simplifyThreshold:0});for(var r=d(e,0,1),n=r/(r*t.sampleFactor),i=[],o=0;o<r;o+=n)i.push(d(e,o));return t.simplifyThreshold&&function(e){for(var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=e.length-1;3<e.length&&0<=r;--r)c(l(e,r-1),l(e,r),l(e,r+1),t)&&e.splice(r%e.length,1)}(i,t.simplifyThreshold),i}(w[S],i),T=0;T<M.length;T++)M[T].x+=v,o=this._handleAlignment(h._renderer,b,M[T].x,M[T].y),M[T].x=o.x,M[T].y=o.y,u.push(M[T]);v+=_[x].advanceWidth*this._scale(n)}r+=this.parent._renderer._textLeading}return u}},{key:"_getGlyphs",value:function(e){return this.font.stringToGlyphs(e)}},{key:"_getPath",value:function(e,t,r,n){var i=(n&&n.renderer&&n.renderer._pInst||this.parent)._renderer;return t=this._handleAlignment(i,e,t,r),this.font.getPath(e,t.x,t.y,i._textSize,n)}},{key:"_getPathData",value:function(e,t,r,n){var i=3;return"string"==typeof e&&2<arguments.length?e=this._getPath(e,t,r,n):"object"===a(t)&&(n=t),n&&"number"==typeof n.decimals&&(i=n.decimals),e.toPathData(i)}},{key:"_getSVG",value:function(e,t,r,n){var i=3;return"string"==typeof e&&2<arguments.length?e=this._getPath(e,t,r,n):"object"===a(t)&&(n=t),n&&("number"==typeof n.decimals&&(i=n.decimals),"number"==typeof n.strokeWidth&&(e.strokeWidth=n.strokeWidth),void 0!==n.fill&&(e.fill=n.fill),void 0!==n.stroke&&(e.stroke=n.stroke)),e.toSVG(i)}},{key:"_renderPath",value:function(e,t,r,n){var i=n&&n.renderer||this.parent._renderer,s=i.drawingContext,l=(e=("object"===a(e)&&e.commands?e:this._getPath(e,t,r,n)).commands,i._clipping||s.beginPath(),!0);t=!1,r=void 0;try{for(var c,u=e[Symbol.iterator]();!(l=(c=u.next()).done);l=!0){var h=c.value;"M"===h.type?s.moveTo(h.x,h.y):"L"===h.type?s.lineTo(h.x,h.y):"C"===h.type?s.bezierCurveTo(h.x1,h.y1,h.x2,h.y2,h.x,h.y):"Q"===h.type?s.quadraticCurveTo(h.x1,h.y1,h.x,h.y):"Z"===h.type&&s.closePath()}}catch(e){t=!0,r=e}finally{try{l||null==u.return||u.return()}finally{if(t)throw r}}return i._doStroke&&i._strokeSet&&!i._clipping&&s.stroke(),i._doFill&&!i._clipping&&(i._fillSet||i._setFill(o._DEFAULT_TEXT_FILL),s.fill()),this}},{key:"_textWidth",value:function(e,t){return this.font.getAdvanceWidth(e,t)}},{key:"_textAscent",value:function(e){return this.font.ascender*this._scale(e)}},{key:"_textDescent",value:function(e){return-this.font.descender*this._scale(e)}},{key:"_scale",value:function(e){return 1/this.font.unitsPerEm*(e||this.parent._renderer._textSize)}},{key:"_handleAlignment",value:function(e,t,r,n,i){var s=e._textSize;switch(void 0===i&&(i=this._textWidth(t,s)),e._textAlign){case o.CENTER:r-=i/2;break;case o.RIGHT:r-=i}switch(e._textBaseline){case o.TOP:n+=this._textAscent(s);break;case o.CENTER:n+=this._textAscent(s)/2;break;case o.BOTTOM:n-=this._textDescent(s)}return{x:r,y:n}}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),e=i.default,r.default=e},{"../core/constants":272,"../core/main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.fill":156,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.join":166,"core-js/modules/es.array.slice":169,"core-js/modules/es.array.splice":171,"core-js/modules/es.function.name":174,"core-js/modules/es.number.to-fixed":182,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.replace":204,"core-js/modules/es.string.split":206,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],322:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.array-buffer.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.array-buffer.constructor"),e("core-js/modules/es.object.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.prototype.append=function(e,t){return e.push(t),e},e.default.prototype.arrayCopy=function(e,t,r,n,i){var o,s;e=void 0!==i?(s=Math.min(i,e.length),o=n,e.slice(t,s+t)):(s=void 0!==r?(s=r,Math.min(s,e.length)):e.length,r=t,e.slice(o=0,s)),Array.prototype.splice.apply(r,[o,s].concat(e))},e.default.prototype.concat=function(e,t){return e.concat(t)},e.default.prototype.reverse=function(e){return e.reverse()},e.default.prototype.shorten=function(e){return e.pop(),e},e.default.prototype.shuffle=function(e,t){for(var r,n,i=ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(e),o=(e=t||i?e:e.slice()).length;1<o;)r=this.random(0,1)*o|0,n=e[--o],e[o]=e[r],e[r]=n;return e},e.default.prototype.sort=function(e,t){var r=t?e.slice(0,Math.min(t,e.length)):e;return t=t?e.slice(Math.min(t,e.length)):[],(r="string"==typeof r[0]?r.sort():r.sort((function(e,t){return e-t}))).concat(t)},e.default.prototype.splice=function(e,t,r){return Array.prototype.splice.apply(e,[r,0].concat(t)),e},e.default.prototype.subset=function(e,t,r){return void 0!==r?e.slice(t,t+r):e.slice(t,e.length)},e=e.default,r.default=e},{"../core/main":283,"core-js/modules/es.array-buffer.constructor":152,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.slice":169,"core-js/modules/es.array.splice":171,"core-js/modules/es.object.to-string":190}],323:[function(e,t,r){"use strict";e("core-js/modules/es.array.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.repeat"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.repeat"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};n.default.prototype.float=function(e){return e instanceof Array?e.map(parseFloat):parseFloat(e)},n.default.prototype.int=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:10;return e===1/0||"Infinity"===e?1/0:e===-1/0||"-Infinity"===e?-1/0:"string"==typeof e?parseInt(e,t):"number"==typeof e?0|e:"boolean"==typeof e?e?1:0:e instanceof Array?e.map((function(e){return n.default.prototype.int(e,t)})):void 0},n.default.prototype.str=function(e){return e instanceof Array?e.map(n.default.prototype.str):String(e)},n.default.prototype.boolean=function(e){return"number"==typeof e?0!==e:"string"==typeof e?"true"===e.toLowerCase():"boolean"==typeof e?e:e instanceof Array?e.map(n.default.prototype.boolean):void 0},n.default.prototype.byte=function(e){return"number"==typeof(e=n.default.prototype.int(e,10))?(e+128)%256-128:e instanceof Array?e.map(n.default.prototype.byte):void 0},n.default.prototype.char=function(e){return"number"!=typeof e||isNaN(e)?e instanceof Array?e.map(n.default.prototype.char):"string"==typeof e?n.default.prototype.char(parseInt(e,10)):void 0:String.fromCharCode(e)},n.default.prototype.unchar=function(e){return"string"==typeof e&&1===e.length?e.charCodeAt(0):e instanceof Array?e.map(n.default.prototype.unchar):void 0},n.default.prototype.hex=function(e,t){if(t=null==t?8:t,e instanceof Array)return e.map((function(e){return n.default.prototype.hex(e,t)}));if(e===1/0||e===-1/0)return(e===1/0?"F":"0").repeat(t);if("number"==typeof e){e<0&&(e=4294967295+e+1);for(var r=Number(e).toString(16).toUpperCase();r.length<t;)r="0".concat(r);return r.length>=t?r.substring(r.length-t,r.length):r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)},e=n.default,r.default=e},{"../core/main":283,"core-js/modules/es.array.map":168,"core-js/modules/es.number.constructor":179,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.repeat":203}],324:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.pad-start"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.pad-start"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(c=e("../core/main"))&&c.__esModule?c:{default:c};function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e,t,r){var n,o=e<0,s=(a=i((e=Math.abs(e)).toString().split("."),2))[0],a=a[1];return void 0===r?(s=s.padStart(t,"0"),n=a?s+"."+a:s,o?"-"+n:n):(s=(n=i(e.toFixed(r).toString().split("."),2))[0],a=n[1],s=s.padStart(t,"0"),e=void 0===a?s:s+"."+a,o?"-"+e:e)}function s(e,t){var r=(e=e.toString()).indexOf("."),n=-1!==r?e.substring(r):"";if(e=(e=-1!==r?e.substring(0,r):e).toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),0===t)n="";else if(void 0!==t)if(t>n.length)for(var i=t-(n+=-1===r?".":"").length+1,o=0;o<i;o++)n+="0";else n=n.substring(0,t+1);return e+n}function a(e){return 0<parseFloat(e)?"+".concat(e.toString()):e.toString()}function l(e){return 0<=parseFloat(e)?" ".concat(e.toString()):e.toString()}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),n.default.prototype.join=function(e,t){return n.default._validateParameters("join",arguments),e.join(t)},n.default.prototype.match=function(e,t){return n.default._validateParameters("match",arguments),e.match(t)},n.default.prototype.matchAll=function(e,t){n.default._validateParameters("matchAll",arguments);for(var r=new RegExp(t,"g"),i=r.exec(e),o=[];null!==i;)o.push(i),i=r.exec(e);return o},n.default.prototype.nf=function(e,t,r){return n.default._validateParameters("nf",arguments),e instanceof Array?e.map((function(e){return o(e,t,r)})):"[object Arguments]"===Object.prototype.toString.call(e)?3===e.length?this.nf(e[0],e[1],e[2]):2===e.length?this.nf(e[0],e[1]):this.nf(e[0]):o(e,t,r)},n.default.prototype.nfc=function(e,t){return n.default._validateParameters("nfc",arguments),e instanceof Array?e.map((function(e){return s(e,t)})):s(e,t)},n.default.prototype.nfp=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.default._validateParameters("nfp",t);var i=n.default.prototype.nf.apply(this,t);return i instanceof Array?i.map(a):a(i)},n.default.prototype.nfs=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.default._validateParameters("nfs",t);var i=n.default.prototype.nf.apply(this,t);return i instanceof Array?i.map(l):l(i)},n.default.prototype.split=function(e,t){return n.default._validateParameters("split",arguments),e.split(t)},n.default.prototype.splitTokens=function(e,t){var r,i;return n.default._validateParameters("splitTokens",arguments),i=void 0!==t?(i=/\]/g.exec(t),(r=/\[/g.exec(t))&&i?(t=t.slice(0,i.index)+t.slice(i.index+1),r=/\[/g.exec(t),t=t.slice(0,r.index)+t.slice(r.index+1),new RegExp("[\\[".concat(t,"\\]]"),"g")):i?(t=t.slice(0,i.index)+t.slice(i.index+1),new RegExp("[".concat(t,"\\]]"),"g")):r?(t=t.slice(0,r.index)+t.slice(r.index+1),new RegExp("[".concat(t,"\\[]"),"g")):new RegExp("[".concat(t,"]"),"g")):/\s/g,e.split(i).filter((function(e){return e}))},n.default.prototype.trim=function(e){return n.default._validateParameters("trim",arguments),e instanceof Array?e.map(this.trim):e.trim()};var c=n.default;r.default=c},{"../core/friendly_errors/fes_core":274,"../core/friendly_errors/file_errors":275,"../core/friendly_errors/validate_params":278,"../core/main":283,"core-js/modules/es.array.filter":157,"core-js/modules/es.array.index-of":164,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.join":166,"core-js/modules/es.array.map":168,"core-js/modules/es.array.slice":169,"core-js/modules/es.number.to-fixed":182,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.constructor":194,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.match":201,"core-js/modules/es.string.pad-start":202,"core-js/modules/es.string.replace":204,"core-js/modules/es.string.split":206,"core-js/modules/es.string.trim":209,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/web.dom-collections.iterator":246}],325:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.prototype.day=function(){return(new Date).getDate()},e.default.prototype.hour=function(){return(new Date).getHours()},e.default.prototype.minute=function(){return(new Date).getMinutes()},e.default.prototype.millis=function(){return-1===this._millisStart?0:window.performance.now()-this._millisStart},e.default.prototype.month=function(){return(new Date).getMonth()+1},e.default.prototype.second=function(){return(new Date).getSeconds()},e.default.prototype.year=function(){return(new Date).getFullYear()},e=e.default,r.default=e},{"../core/main":283}],326:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(c=e("../core/main"))&&c.__esModule?c:{default:c},s=(e("./p5.Geometry"),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants")));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function l(e,t,r,n,i,s,a){e=e<=0?1:e,t=t<0?0:t,r=r<=0?e:r,n=n<3?3:n;for(var l,c,u=(s=void 0===s||s)?-2:0,h=(i=i<1?1:i)+((a=void 0===a?0!==t:a)?2:0),d=Math.atan2(e-t,r),p=Math.sin(d),f=Math.cos(d),m=u;m<=h;++m){var y=m/i,g=r*y,v=void 0;for(v=m<0?(y=g=0,e):i<m?(g=r,y=1,t):e+(t-e)*y,-2!==m&&m!==i+2||(v=0),g-=r/2,l=0;l<n;++l){var b=l/(n-1),_=2*Math.PI*b,x=Math.sin(_),w=(_=Math.cos(_),this.vertices.push(new o.default.Vector(x*v,g,_*v)));w=m<0?new o.default.Vector(0,-1,0):i<m&&t?new o.default.Vector(0,1,0):new o.default.Vector(x*f,p,_*f),this.vertexNormals.push(w),this.uvs.push(b,y)}}var S=0;if(s){for(c=0;c<n;++c)this.faces.push([S+c,S+n+(c+1)%n,S+n+c]);S+=2*n}for(m=0;m<i;++m){for(l=0;l<n;++l){var M=(l+1)%n;this.faces.push([S+l,S+M,S+n+M]),this.faces.push([S+l,S+n+M,S+n+l])}S+=n}if(a)for(S+=n,l=0;l<n;++l)this.faces.push([S+l,S+(l+1)%n,S+n])}o.default.prototype.beginGeometry=function(){return this._renderer.beginGeometry()},o.default.prototype.endGeometry=function(){return this._renderer.endGeometry()},o.default.prototype.buildGeometry=function(e){return this._renderer.buildGeometry(e)},o.default.prototype.freeGeometry=function(e){this._renderer._freeBuffers(e.gid)},o.default.prototype.plane=function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:50,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1,s=(this._assert3d("plane"),o.default._validateParameters("plane",arguments),"plane|".concat(n,"|").concat(i));return this._renderer.geometryInHash(s)||((e=new o.default.Geometry(n,i,(function(){for(var e,t,r=0;r<=this.detailY;r++)for(var n=r/this.detailY,i=0;i<=this.detailX;i++)e=i/this.detailX,t=new o.default.Vector(e-.5,n-.5,0),this.vertices.push(t),this.uvs.push(e,n)}))).computeFaces().computeNormals(),n<=1&&i<=1?e._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on plane objects with more than 1 detailX or 1 detailY"),this._renderer.createBuffers(s,e)),this._renderer.drawBuffersScaled(s,t,r,1),this},o.default.prototype.box=function(e,t,r,n,i){this._assert3d("box"),o.default._validateParameters("box",arguments),void 0===e&&(e=50),void 0===t&&(t=e),void 0===r&&(r=t);var s,a=this._renderer.attributes&&this._renderer.attributes.perPixelLighting;return void 0===i&&(i=a?1:4),a="box|".concat(n=void 0===n?a?1:4:n,"|").concat(i),this._renderer.geometryInHash(a)||((s=new o.default.Geometry(n,i,(function(){var e=this;this.edges=[[0,1],[1,3],[3,2],[6,7],[8,9],[9,11],[14,15],[16,17],[17,19],[18,19],[20,21],[22,23]],[[0,4,2,6],[1,3,5,7],[0,1,4,5],[2,6,3,7],[0,2,1,3],[4,5,6,7]].forEach((function(t,r){r*=4;for(var n=0;n<4;n++){var i=t[n];i=new o.default.Vector((2*(1&i)-1)/2,((2&i)-1)/2,((4&i)/2-1)/2),e.vertices.push(i),e.uvs.push(1&n,(2&n)/2)}e.faces.push([r,1+r,2+r]),e.faces.push([2+r,1+r,3+r])}))}))).computeNormals(),n<=4&&i<=4?s._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on box objects with more than 4 detailX or 4 detailY"),this._renderer.createBuffers(a,s)),this._renderer.drawBuffersScaled(a,e,t,r),this},o.default.prototype.sphere=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:50,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:24,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:16;return this._assert3d("sphere"),o.default._validateParameters("sphere",arguments),this.ellipsoid(e,e,e,t,r),this},o.default.prototype.cylinder=function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:50,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:24,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1,s=!(4<arguments.length&&void 0!==arguments[4])||arguments[4],a=!(5<arguments.length&&void 0!==arguments[5])||arguments[5],c=(this._assert3d("cylinder"),o.default._validateParameters("cylinder",arguments),"cylinder|".concat(n,"|").concat(i,"|").concat(s,"|").concat(a));return this._renderer.geometryInHash(c)||(e=new o.default.Geometry(n,i),l.call(e,1,1,1,n,i,s,a),n<=24&&i<=16?e._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on cylinder objects with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(c,e)),this._renderer.drawBuffersScaled(c,t,r,t),this},o.default.prototype.cone=function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:50,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:24,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1,s=!(4<arguments.length&&void 0!==arguments[4])||arguments[4],a=(this._assert3d("cone"),o.default._validateParameters("cone",arguments),"cone|".concat(n,"|").concat(i,"|").concat(s));return this._renderer.geometryInHash(a)||(e=new o.default.Geometry(n,i),l.call(e,1,0,1,n,i,s,!1),n<=24&&i<=16?e._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on cone objects with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(a,e)),this._renderer.drawBuffersScaled(a,t,r,t),this},o.default.prototype.ellipsoid=function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:50,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:t,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:24,s=4<arguments.length&&void 0!==arguments[4]?arguments[4]:16,a=(this._assert3d("ellipsoid"),o.default._validateParameters("ellipsoid",arguments),"ellipsoid|".concat(i,"|").concat(s));return this._renderer.geometryInHash(a)||((e=new o.default.Geometry(i,s,(function(){for(var e=0;e<=this.detailY;e++)for(var t=e/this.detailY,r=Math.PI*t-Math.PI/2,n=Math.cos(r),i=Math.sin(r),s=0;s<=this.detailX;s++){var a=s/this.detailX,l=2*Math.PI*a,c=Math.cos(l);l=Math.sin(l),l=new o.default.Vector(n*l,i,n*c),this.vertices.push(l),this.vertexNormals.push(l),this.uvs.push(a,t)}}))).computeFaces(),i<=24&&s<=24?e._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on ellipsoids with more than 24 detailX or 24 detailY"),this._renderer.createBuffers(a,e)),this._renderer.drawBuffersScaled(a,t,r,n),this},o.default.prototype.torus=function(e,t,r,n){if(this._assert3d("torus"),o.default._validateParameters("torus",arguments),void 0===e)e=50;else if(!e)return;if(void 0===t)t=10;else if(!t)return;void 0===r&&(r=24),void 0===n&&(n=16);var i,s=(t/e).toPrecision(4);return t="torus|".concat(s,"|").concat(r,"|").concat(n),this._renderer.geometryInHash(t)||((i=new o.default.Geometry(r,n,(function(){for(var e=0;e<=this.detailY;e++)for(var t=e/this.detailY,r=2*Math.PI*t,n=Math.cos(r),i=Math.sin(r),a=1+s*n,l=0;l<=this.detailX;l++){var c=l/this.detailX,u=2*Math.PI*c,h=Math.cos(u),d=(u=Math.sin(u),new o.default.Vector(a*h,a*u,s*i));h=new o.default.Vector(n*h,n*u,i),this.vertices.push(d),this.vertexNormals.push(h),this.uvs.push(c,t)}}))).computeFaces(),r<=24&&n<=16?i._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw strokes on torus object with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(t,i)),this._renderer.drawBuffersScaled(t,e,e,e),this},o.default.RendererGL.prototype.point=function(e,t){var r=[];return r.push(new o.default.Vector(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:0)),this._drawPoints(r,this.immediateMode.buffers.point),this},o.default.RendererGL.prototype.triangle=function(e){var t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],a=(e=e[5],this.geometryInHash("tri")||((a=new o.default.Geometry(1,1,(function(){var e=[];e.push(new o.default.Vector(0,0,0)),e.push(new o.default.Vector(1,0,0)),e.push(new o.default.Vector(0,1,0)),this.edges=[[0,1],[1,2],[2,0]],this.vertices=e,this.faces=[[0,1,2]],this.uvs=[0,0,1,0,1,1]})))._edgesToVertices(),a.computeNormals(),this.createBuffers("tri",a)),this.uModelMatrix.copy());try{var l=Math.sign(t*i-n*r+n*e-s*i+s*r-t*e),c=new o.default.Matrix([n-t,i-r,0,0,s-t,e-r,0,0,0,0,l,0,t,r,0,1]).mult(this.uModelMatrix);this.uModelMatrix=c,this.drawBuffers("tri")}finally{this.uModelMatrix=a}return this},o.default.RendererGL.prototype.ellipse=function(e){this.arc(e[0],e[1],e[2],e[3],0,s.TWO_PI,s.OPEN,e[4])},o.default.RendererGL.prototype.arc=function(){var e,t=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2],i=arguments.length<=3?void 0:arguments[3],a=arguments.length<=4?void 0:arguments[4],l=arguments.length<=5?void 0:arguments[5],c=arguments.length<=6?void 0:arguments[6],u=(arguments.length<=7?void 0:arguments[7])||25,h=(Math.abs(l-a)>=s.TWO_PI?"".concat(d="ellipse","|"):"".concat(d="arc","|").concat(a,"|").concat(l,"|").concat(c,"|")).concat(u,"|"),d=(this.geometryInHash(h)||((e=new o.default.Geometry(u,1,(function(){if(a.toFixed(10)!==l.toFixed(10)){c!==s.PIE&&void 0!==c||(this.vertices.push(new o.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=e/u*(l-a)+a,r=.5+Math.cos(t)/2;t=.5+Math.sin(t)/2,this.vertices.push(new o.default.Vector(r,t,0)),this.uvs.push([r,t]),e<u-1&&(this.faces.push([0,e+1,e+2]),this.edges.push([e+1,e+2]))}switch(c){case s.PIE:this.faces.push([0,this.vertices.length-2,this.vertices.length-1]),this.edges.push([0,1]),this.edges.push([this.vertices.length-2,this.vertices.length-1]),this.edges.push([0,this.vertices.length-1]);break;case s.CHORD:this.edges.push([0,1]),this.edges.push([0,this.vertices.length-1]);break;case s.OPEN:this.edges.push([0,1]);break;default:this.faces.push([0,this.vertices.length-2,this.vertices.length-1]),this.edges.push([this.vertices.length-2,this.vertices.length-1])}}}))).computeNormals(),u<=50?e._edgesToVertices(e):this._doStroke&&console.log("Cannot apply a stroke to an ".concat(d," with more than 50 detail")),this.createBuffers(h,e)),this.uModelMatrix.copy());try{this.uModelMatrix.translate([t,r,0]),this.uModelMatrix.scale(n,i,1),this.drawBuffers(h)}finally{this.uModelMatrix=d}return this},o.default.RendererGL.prototype.rect=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];if(void 0===e[4]){var a=this._pInst._glAttributes.perPixelLighting,l=e[4]||(a?1:24),c=e[5]||(a?1:16),u=(a="rect|".concat(l,"|").concat(c),this.geometryInHash(a)||((u=new o.default.Geometry(l,c,(function(){for(var e=0;e<=this.detailY;e++)for(var t=e/this.detailY,r=0;r<=this.detailX;r++){var n=r/this.detailX,i=new o.default.Vector(n,t,0);this.vertices.push(i),this.uvs.push(n,t)}0<l&&0<c&&(this.edges=[[0,l],[l,(l+1)*(c+1)-1],[(l+1)*(c+1)-1,(l+1)*c],[(l+1)*c,0]])}))).computeFaces().computeNormals()._edgesToVertices(),this.createBuffers(a,u)),this.uModelMatrix.copy());try{this.uModelMatrix.translate([t,r,0]),this.uModelMatrix.scale(n,i,1),this.drawBuffers(a)}finally{this.uModelMatrix=u}}else{a=e[4],u=void 0===e[5]?a:e[5];var h=void 0===e[6]?u:e[6],d=(e=void 0===e[7]?h:e[7],n),p=i,f=((d+=t)<t&&(y=t,t=d,d=y),(p+=r)<r&&(y=r,r=p,p=y),(y=Math.min((d-t)/2,(p-r)/2))<a&&(a=y),y<u&&(u=y),y<h&&(h=y),y<e&&(e=y),t),m=r,y=d,g=(t=p,this.beginShape(),0!==u?(this.vertex(y-u,m),this.quadraticVertex(y,m,y,m+u)):this.vertex(y,m),0!==h?(this.vertex(y,t-h),this.quadraticVertex(y,t,y-h,t)):this.vertex(y,t),0!==e?(this.vertex(f+e,t),this.quadraticVertex(f,t,f,t-e)):this.vertex(f,t),0!==a?(this.vertex(f,m+a),this.quadraticVertex(f,m,f+a,m)):this.vertex(f,m),!(this.immediateMode.geometry.uvs.length=0));r=!1,d=void 0;try{for(var v,b=this.immediateMode.geometry.vertices[Symbol.iterator]();!(g=(v=b.next()).done);g=!0){var _=v.value,x=(_.x-f)/n,w=(_.y-m)/i;this.immediateMode.geometry.uvs.push(x,w)}}catch(e){r=!0,d=e}finally{try{g||null==b.return||b.return()}finally{if(r)throw d}}this.endShape(s.CLOSE)}return this},o.default.RendererGL.prototype.quad=function(e,t,r,n,i,s,a,l,c,u,h,d){var p=12<arguments.length&&void 0!==arguments[12]?arguments[12]:2,f=13<arguments.length&&void 0!==arguments[13]?arguments[13]:2,m="quad|".concat(e,"|").concat(t,"|").concat(r,"|").concat(n,"|").concat(i,"|").concat(s,"|").concat(a,"|").concat(l,"|").concat(c,"|").concat(u,"|").concat(h,"|").concat(d,"|").concat(p,"|").concat(f);if(!this.geometryInHash(m)){var y=new o.default.Geometry(p,f,(function(){for(var p=1/(this.detailX-1),f=1/(this.detailY-1),m=0;m<this.detailY;m++)for(var y=0;y<this.detailX;y++){var g=y*p,v=m*f;this.vertices.push(new o.default.Vector((1-g)*((1-v)*e+v*u)+g*((1-v)*n+v*a),(1-g)*((1-v)*t+v*h)+g*((1-v)*i+v*l),(1-g)*((1-v)*r+v*d)+g*((1-v)*s+v*c))),this.uvs.push([g,v])}}));y.faces=[];for(var g=0;g<f-1;g++)for(var v=0;v<p-1;v++){var b=v+g*p,_=v+1+(g+1)*p,x=v+(g+1)*p;y.faces.push([b,v+1+g*p,_]),y.faces.push([b,_,x])}y.computeNormals();for(var w=[y.edges.length=0,2,3,1],S=0;S<w.length;S++)y.edges.push([w[S],w[(S+1)%w.length]]);y._edgesToVertices(),this.createBuffers(m,y)}return this.drawBuffers(m),this},o.default.RendererGL.prototype.bezier=function(e,t,r,n,i,o,s,a,l,c,u,h){8===arguments.length&&(u=a,c=s,a=o,s=i,i=n,n=r,r=o=l=h=0);var d=this._pInst._bezierDetail||20;this.beginShape();for(var p=0;p<=d;p++){var f=Math.pow(1-p/d,3),m=p/d*3*Math.pow(1-p/d,2),y=3*Math.pow(p/d,2)*(1-p/d),g=Math.pow(p/d,3);this.vertex(e*f+n*m+s*y+c*g,t*f+i*m+a*y+u*g,r*f+o*m+l*y+h*g)}return this.endShape(),this},o.default.RendererGL.prototype.curve=function(e,t,r,n,i,o,s,a,l,c,u,h){8===arguments.length&&(c=s,u=a,s=i,a=n,i=n=r,r=o=l=h=0);var d=this._pInst._curveDetail;this.beginShape();for(var p=0;p<=d;p++){var f=.5*Math.pow(p/d,3),m=.5*Math.pow(p/d,2),y=p/d*.5;this.vertex(f*(3*n-e-3*s+c)+m*(2*e-5*n+4*s-c)+y*(-e+s)+2*n*.5,f*(3*i-t-3*a+u)+m*(2*t-5*i+4*a-u)+y*(-t+a)+2*i*.5,f*(3*o-r-3*l+h)+m*(2*r-5*o+4*l-h)+y*(-r+l)+2*o*.5)}return this.endShape(),this},o.default.RendererGL.prototype.line=function(){return 6===arguments.length?(this.beginShape(s.LINES),this.vertex(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2]),this.vertex(arguments.length<=3?void 0:arguments[3],arguments.length<=4?void 0:arguments[4],arguments.length<=5?void 0:arguments[5]),this.endShape()):4===arguments.length&&(this.beginShape(s.LINES),this.vertex(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],0),this.vertex(arguments.length<=2?void 0:arguments[2],arguments.length<=3?void 0:arguments[3],0),this.endShape()),this},o.default.RendererGL.prototype.bezierVertex=function(){if(0===this.immediateMode._bezierVertex.length)throw Error("vertex() must be used once before calling bezierVertex()");var e,t,r,n,i,o,s=[],a=[],l=arguments.length;if(0===this._lookUpTableBezier.length||this._lutBezierDetail!==this._pInst._curveDetail){this._lookUpTableBezier=[],this._lutBezierDetail=this._pInst._curveDetail;for(var c=1/this._lutBezierDetail,u=c,h=1,d=0;u<1;){if(o=parseFloat(u.toFixed(6)),this._lookUpTableBezier[d]=this._bezierCoefficients(o),h.toFixed(6)===c.toFixed(6)){o=parseFloat(h.toFixed(6))+parseFloat(u.toFixed(6)),++d,this._lookUpTableBezier[d]=this._bezierCoefficients(o);break}u+=c,h-=c,++d}}for(var p=this._lookUpTableBezier.length,f=[],m=0;m<4;m++)f.push([]);f[0]=this.immediateMode.geometry.vertexColors.slice(-4),f[3]=this.curFillColor.slice();var y=[];for(m=0;m<4;m++)y.push([]);if(y[0]=this.immediateMode.geometry.vertexStrokeColors.slice(-4),y[3]=this.curStrokeColor.slice(),6===l){this.isBezier=!0,s=[this.immediateMode._bezierVertex[0],arguments.length<=0?void 0:arguments[0],arguments.length<=2?void 0:arguments[2],arguments.length<=4?void 0:arguments[4]],a=[this.immediateMode._bezierVertex[1],arguments.length<=1?void 0:arguments[1],arguments.length<=3?void 0:arguments[3],arguments.length<=5?void 0:arguments[5]];var g=Math.hypot(s[0]-s[1],a[0]-a[1]),v=Math.hypot(s[1]-s[2],a[1]-a[2]),b=Math.hypot(s[2]-s[3],a[2]-a[3]);for(g/=v=g+v+b,b/=v,i=0;i<4;i++)f[1].push(f[0][i]*(1-g)+f[3][i]*g),f[2].push(f[0][i]*b+f[3][i]*(1-b)),y[1].push(y[0][i]*(1-g)+y[3][i]*g),y[2].push(y[0][i]*b+y[3][i]*(1-b));for(n=0;n<p;n++){for(this.curFillColor=[0,0,0,0],this.curStrokeColor=[0,0,0,0],m=e=t=0;m<4;m++){for(i=0;i<4;i++)this.curFillColor[i]+=this._lookUpTableBezier[n][m]*f[m][i],this.curStrokeColor[i]+=this._lookUpTableBezier[n][m]*y[m][i];e+=s[m]*this._lookUpTableBezier[n][m],t+=a[m]*this._lookUpTableBezier[n][m]}this.vertex(e,t)}this.curFillColor=f[3],this.curStrokeColor=y[3],this.immediateMode._bezierVertex[0]=arguments.length<=4?void 0:arguments[4],this.immediateMode._bezierVertex[1]=arguments.length<=5?void 0:arguments[5]}else if(9===l){this.isBezier=!0,s=[this.immediateMode._bezierVertex[0],arguments.length<=0?void 0:arguments[0],arguments.length<=3?void 0:arguments[3],arguments.length<=6?void 0:arguments[6]],a=[this.immediateMode._bezierVertex[1],arguments.length<=1?void 0:arguments[1],arguments.length<=4?void 0:arguments[4],arguments.length<=7?void 0:arguments[7]];var _=[this.immediateMode._bezierVertex[2],arguments.length<=2?void 0:arguments[2],arguments.length<=5?void 0:arguments[5],arguments.length<=8?void 0:arguments[8]],x=Math.hypot(s[0]-s[1],a[0]-a[1],_[0]-_[1]),w=(v=Math.hypot(s[1]-s[2],a[1]-a[2],_[1]-_[2]),Math.hypot(s[2]-s[3],a[2]-a[3],_[2]-_[3]));for(x/=l=x+v+w,w/=l,i=0;i<4;i++)f[1].push(f[0][i]*(1-x)+f[3][i]*x),f[2].push(f[0][i]*w+f[3][i]*(1-w)),y[1].push(y[0][i]*(1-x)+y[3][i]*x),y[2].push(y[0][i]*w+y[3][i]*(1-w));for(n=0;n<p;n++){for(this.curFillColor=[0,0,0,0],this.curStrokeColor=[0,0,0,0],m=e=t=r=0;m<4;m++){for(i=0;i<4;i++)this.curFillColor[i]+=this._lookUpTableBezier[n][m]*f[m][i],this.curStrokeColor[i]+=this._lookUpTableBezier[n][m]*y[m][i];e+=s[m]*this._lookUpTableBezier[n][m],t+=a[m]*this._lookUpTableBezier[n][m],r+=_[m]*this._lookUpTableBezier[n][m]}this.vertex(e,t,r)}this.curFillColor=f[3],this.curStrokeColor=y[3],this.immediateMode._bezierVertex[0]=arguments.length<=6?void 0:arguments[6],this.immediateMode._bezierVertex[1]=arguments.length<=7?void 0:arguments[7],this.immediateMode._bezierVertex[2]=arguments.length<=8?void 0:arguments[8]}},o.default.RendererGL.prototype.quadraticVertex=function(){if(0===this.immediateMode._quadraticVertex.length)throw Error("vertex() must be used once before calling quadraticVertex()");var e,t,r,n,i,o,s=[],a=[],l=arguments.length;if(0===this._lookUpTableQuadratic.length||this._lutQuadraticDetail!==this._pInst._curveDetail){this._lookUpTableQuadratic=[],this._lutQuadraticDetail=this._pInst._curveDetail;for(var c=1/this._lutQuadraticDetail,u=c,h=1,d=0;u<1;){if(o=parseFloat(u.toFixed(6)),this._lookUpTableQuadratic[d]=this._quadraticCoefficients(o),h.toFixed(6)===c.toFixed(6)){o=parseFloat(h.toFixed(6))+parseFloat(u.toFixed(6)),++d,this._lookUpTableQuadratic[d]=this._quadraticCoefficients(o);break}u+=c,h-=c,++d}}for(var p=this._lookUpTableQuadratic.length,f=[],m=0;m<3;m++)f.push([]);f[0]=this.immediateMode.geometry.vertexColors.slice(-4),f[2]=this.curFillColor.slice();var y=[];for(m=0;m<3;m++)y.push([]);if(y[0]=this.immediateMode.geometry.vertexStrokeColors.slice(-4),y[2]=this.curStrokeColor.slice(),4===l){this.isQuadratic=!0,s=[this.immediateMode._quadraticVertex[0],arguments.length<=0?void 0:arguments[0],arguments.length<=2?void 0:arguments[2]],a=[this.immediateMode._quadraticVertex[1],arguments.length<=1?void 0:arguments[1],arguments.length<=3?void 0:arguments[3]];var g=Math.hypot(s[0]-s[1],a[0]-a[1]);for(g/=g+Math.hypot(s[1]-s[2],a[1]-a[2]),i=0;i<4;i++)f[1].push(f[0][i]*(1-g)+f[2][i]*g),y[1].push(y[0][i]*(1-g)+y[2][i]*g);for(n=0;n<p;n++){for(this.curFillColor=[0,0,0,0],this.curStrokeColor=[0,0,0,0],m=e=t=0;m<3;m++){for(i=0;i<4;i++)this.curFillColor[i]+=this._lookUpTableQuadratic[n][m]*f[m][i],this.curStrokeColor[i]+=this._lookUpTableQuadratic[n][m]*y[m][i];e+=s[m]*this._lookUpTableQuadratic[n][m],t+=a[m]*this._lookUpTableQuadratic[n][m]}this.vertex(e,t)}this.curFillColor=f[2],this.curStrokeColor=y[2],this.immediateMode._quadraticVertex[0]=arguments.length<=2?void 0:arguments[2],this.immediateMode._quadraticVertex[1]=arguments.length<=3?void 0:arguments[3]}else if(6===l){this.isQuadratic=!0,s=[this.immediateMode._quadraticVertex[0],arguments.length<=0?void 0:arguments[0],arguments.length<=3?void 0:arguments[3]],a=[this.immediateMode._quadraticVertex[1],arguments.length<=1?void 0:arguments[1],arguments.length<=4?void 0:arguments[4]];var v=[this.immediateMode._quadraticVertex[2],arguments.length<=2?void 0:arguments[2],arguments.length<=5?void 0:arguments[5]],b=Math.hypot(s[0]-s[1],a[0]-a[1],v[0]-v[1]);for(b/=b+Math.hypot(s[1]-s[2],a[1]-a[2],v[1]-v[2]),i=0;i<4;i++)f[1].push(f[0][i]*(1-b)+f[2][i]*b),y[1].push(y[0][i]*(1-b)+y[2][i]*b);for(n=0;n<p;n++){for(this.curFillColor=[0,0,0,0],this.curStrokeColor=[0,0,0,0],m=e=t=r=0;m<3;m++){for(i=0;i<4;i++)this.curFillColor[i]+=this._lookUpTableQuadratic[n][m]*f[m][i],this.curStrokeColor[i]+=this._lookUpTableQuadratic[n][m]*y[m][i];e+=s[m]*this._lookUpTableQuadratic[n][m],t+=a[m]*this._lookUpTableQuadratic[n][m],r+=v[m]*this._lookUpTableQuadratic[n][m]}this.vertex(e,t,r)}this.curFillColor=f[2],this.curStrokeColor=y[2],this.immediateMode._quadraticVertex[0]=arguments.length<=3?void 0:arguments[3],this.immediateMode._quadraticVertex[1]=arguments.length<=4?void 0:arguments[4],this.immediateMode._quadraticVertex[2]=arguments.length<=5?void 0:arguments[5]}},o.default.RendererGL.prototype.curveVertex=function(){var e,t,r,n,i,o,s=[],a=[],l=arguments.length;if(0===this._lookUpTableBezier.length||this._lutBezierDetail!==this._pInst._curveDetail){this._lookUpTableBezier=[],this._lutBezierDetail=this._pInst._curveDetail;for(var c=1/this._lutBezierDetail,u=c,h=1,d=0;u<1;){if(o=parseFloat(u.toFixed(6)),this._lookUpTableBezier[d]=this._bezierCoefficients(o),h.toFixed(6)===c.toFixed(6)){o=parseFloat(h.toFixed(6))+parseFloat(u.toFixed(6)),++d,this._lookUpTableBezier[d]=this._bezierCoefficients(o);break}u+=c,h-=c,++d}}var p=this._lookUpTableBezier.length;if(2===l){if(this.immediateMode._curveVertex.push(arguments.length<=0?void 0:arguments[0]),this.immediateMode._curveVertex.push(arguments.length<=1?void 0:arguments[1]),8===this.immediateMode._curveVertex.length){for(this.isCurve=!0,s=this._bezierToCatmull([this.immediateMode._curveVertex[0],this.immediateMode._curveVertex[2],this.immediateMode._curveVertex[4],this.immediateMode._curveVertex[6]]),a=this._bezierToCatmull([this.immediateMode._curveVertex[1],this.immediateMode._curveVertex[3],this.immediateMode._curveVertex[5],this.immediateMode._curveVertex[7]]),i=0;i<p;i++)t=s[0]*this._lookUpTableBezier[i][0]+s[1]*this._lookUpTableBezier[i][1]+s[2]*this._lookUpTableBezier[i][2]+s[3]*this._lookUpTableBezier[i][3],r=a[0]*this._lookUpTableBezier[i][0]+a[1]*this._lookUpTableBezier[i][1]+a[2]*this._lookUpTableBezier[i][2]+a[3]*this._lookUpTableBezier[i][3],this.vertex(t,r);for(i=0;i<l;i++)this.immediateMode._curveVertex.shift()}}else if(3===l&&(this.immediateMode._curveVertex.push(arguments.length<=0?void 0:arguments[0]),this.immediateMode._curveVertex.push(arguments.length<=1?void 0:arguments[1]),this.immediateMode._curveVertex.push(arguments.length<=2?void 0:arguments[2]),12===this.immediateMode._curveVertex.length)){for(this.isCurve=!0,s=this._bezierToCatmull([this.immediateMode._curveVertex[0],this.immediateMode._curveVertex[3],this.immediateMode._curveVertex[6],this.immediateMode._curveVertex[9]]),a=this._bezierToCatmull([this.immediateMode._curveVertex[1],this.immediateMode._curveVertex[4],this.immediateMode._curveVertex[7],this.immediateMode._curveVertex[10]]),e=this._bezierToCatmull([this.immediateMode._curveVertex[2],this.immediateMode._curveVertex[5],this.immediateMode._curveVertex[8],this.immediateMode._curveVertex[11]]),i=0;i<p;i++)t=s[0]*this._lookUpTableBezier[i][0]+s[1]*this._lookUpTableBezier[i][1]+s[2]*this._lookUpTableBezier[i][2]+s[3]*this._lookUpTableBezier[i][3],r=a[0]*this._lookUpTableBezier[i][0]+a[1]*this._lookUpTableBezier[i][1]+a[2]*this._lookUpTableBezier[i][2]+a[3]*this._lookUpTableBezier[i][3],n=e[0]*this._lookUpTableBezier[i][0]+e[1]*this._lookUpTableBezier[i][1]+e[2]*this._lookUpTableBezier[i][2]+e[3]*this._lookUpTableBezier[i][3],this.vertex(t,r,n);for(i=0;i<l;i++)this.immediateMode._curveVertex.shift()}},o.default.RendererGL.prototype.image=function(e,t,r,n,i,o,a,l,c){this._isErasing&&this.blendMode(this._cachedBlendMode),this._pInst.push(),this._pInst.noLights(),this._pInst.noStroke(),this._pInst.texture(e),this._pInst.textureMode(s.NORMAL);var u=0,h=(t<=e.width&&(u=t/e.width),1);t+n<=e.width&&(h=(t+n)/e.width),t=0,r<=e.height&&(t=r/e.height),n=1,r+i<=e.height&&(n=(r+i)/e.height),this.beginShape(),this.vertex(o,a,0,u,t),this.vertex(o+l,a,0,h,t),this.vertex(o+l,a+c,0,h,n),this.vertex(o,a+c,0,u,n),this.endShape(s.CLOSE),this._pInst.pop(),this._isErasing&&this.blendMode(s.REMOVE)};var c=o.default;r.default=c},{"../core/constants":272,"../core/main":283,"./p5.Geometry":335,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.for-each":161,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.slice":169,"core-js/modules/es.math.hypot":176,"core-js/modules/es.math.sign":178,"core-js/modules/es.number.to-fixed":182,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],327:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.map"),e("core-js/modules/es.object.assign"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(c=e("../core/main"))&&c.__esModule?c:{default:c},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function l(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var c=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");(this.renderer=t)._pInst.push(),this.identityMatrix=new o.default.Matrix,t.uModelMatrix=new o.default.Matrix,this.geometry=new o.default.Geometry,this.geometry.gid="_p5_GeometryBuilder_".concat(e.nextGeometryId),e.nextGeometryId++,this.hasTransform=!1}var t;return(t=[{key:"transformVertices",value:function(e){var t=this;return this.hasTransform?e.map((function(e){return t.renderer.uModelMatrix.multiplyPoint(e)})):e}},{key:"transformNormals",value:function(e){var t=this;return this.hasTransform?e.map((function(e){return t.renderer.uNMatrix.multiplyVec3(e)})):e}},{key:"addGeometry",value:function(e){for(var t,r=this,n=(this.hasTransform=!this.renderer.uModelMatrix.mat4.every((function(e,t){return e===r.identityMatrix.mat4[t]})),this.hasTransform&&this.renderer.uNMatrix.inverseTranspose(this.renderer.uModelMatrix),this.geometry.vertices.length),i=((t=this.geometry.vertices).push.apply(t,l(this.transformVertices(e.vertices))),(t=this.geometry.vertexNormals).push.apply(t,l(this.transformNormals(e.vertexNormals))),(t=this.geometry.uvs).push.apply(t,l(e.uvs)),this.renderer._doFill&&(t=this.geometry.faces).push.apply(t,l(e.faces.map((function(e){return e.map((function(e){return e+n}))})))),this.renderer._doStroke&&(t=this.geometry.edges).push.apply(t,l(e.edges.map((function(e){return e.map((function(e){return e+n}))})))),l(e.vertexColors));i.length<4*e.vertices.length;)i.push.apply(i,l(this.renderer.curFillColor));(t=this.geometry.vertexColors).push.apply(t,l(i))}},{key:"addImmediate",value:function(){var e=this.renderer.immediateMode.geometry,t=this.renderer.immediateMode.shapeMode,r=[];if(this.renderer._doFill)if(t===s.TRIANGLE_STRIP||t===s.QUAD_STRIP)for(var n=2;n<e.vertices.length;n++)n%2==0?r.push([n,n-1,n-2]):r.push([n,n-2,n-1]);else if(t===s.TRIANGLE_FAN)for(var i=2;i<e.vertices.length;i++)r.push([0,i-1,i]);else for(var o=0;o<e.vertices.length;o+=3)r.push([o,o+1,o+2]);this.addGeometry(Object.assign({},e,{faces:r}))}},{key:"addRetained",value:function(e){this.addGeometry(e.model)}},{key:"finish",value:function(){return this.renderer._pInst.pop(),this.geometry}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}();c.nextGeometryId=0,r.default=c},{"../core/constants":272,"../core/main":283,"core-js/modules/es.array.every":155,"core-js/modules/es.array.from":162,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.map":168,"core-js/modules/es.object.assign":183,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],328:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=(l=e("../core/main"))&&l.__esModule?l:{default:l},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r,n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var o;Object.prototype.hasOwnProperty.call(e,r)&&((o=i?Object.getOwnPropertyDescriptor(e,r):null)&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function s(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,s=function(){return e},e)}function a(e){return(a="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}i.default.prototype.orbitControl=function(e,t,r,n){var o=this,s=(this._assert3d("orbitControl"),i.default._validateParameters("orbitControl",arguments),this._renderer._curCamera);void 0===e&&(e=1),void 0===t&&(t=e),void 0===r&&(r=1),"object"!==a(n)&&(n={}),!0!==this.contextMenuDisabled&&(this.canvas.oncontextmenu=function(){return!1},this._setProperty("contextMenuDisabled",!0)),!0!==this.wheelDefaultDisabled&&(this.canvas.onwheel=function(){return!1},this._setProperty("wheelDefaultDisabled",!0));var l=n.disableTouchActions;!0===this.touchActionsDisabled||void 0!==l&&!l||(this.canvas.style["touch-action"]="none",this._setProperty("touchActionsDisabled",!0)),n=void 0!==(l=n.freeRotation)&&l;var c,u,h,d=[],p=(this.touches.forEach((function(e){o._renderer.prevTouches.forEach((function(t){e.id===t.id&&(t={x:e.x,y:e.y,px:t.x,py:t.y},d.push(t))}))})),this._renderer.prevTouches=this.touches,l=0,0),f=0,m=0,y=0,g=this.height<this.width?this.height:this.width,v=!1;return 0<d.length?(v=0<d[0].x&&d[0].x<this.width&&0<d[0].y&&d[0].y<this.height,1===d.length?(p=-e*((c=d[0]).x-c.px)/g,f=t*(c.y-c.py)/g):(c=d[0],u=d[1],l=-(Math.hypot(c.x-u.x,c.y-u.y)-Math.hypot(c.px-u.px,c.py-u.py))*r*4e-4,m=.5*(c.x+u.x)-.5*(c.px+u.px),y=.5*(c.y+u.y)-.5*(c.py+u.py)),0<this.touches.length?v&&(this._renderer.executeRotateAndMove=!0,this._renderer.executeZoom=!0):(this._renderer.executeRotateAndMove=!1,this._renderer.executeZoom=!1)):(v=0<this.mouseX&&this.mouseX<this.width&&0<this.mouseY&&this.mouseY<this.height,0!==this._mouseWheelDeltaY?(l=Math.sign(this._mouseWheelDeltaY)*r,l*=.01,this._mouseWheelDeltaY=0,v&&(this._renderer.executeZoom=!0)):this._renderer.executeZoom=!1,this.mouseIsPressed?(this.mouseButton===this.LEFT?(p=-e*this.movedX/g,f=t*this.movedY/g):this.mouseButton===this.RIGHT&&(m=this.movedX,y=this.movedY*s.yScale),v&&(this._renderer.executeRotateAndMove=!0)):this._renderer.executeRotateAndMove=!1),0!==l&&this._renderer.executeZoom&&(this._renderer.zoomVelocity+=l),.001<Math.abs(this._renderer.zoomVelocity)?(n?s._orbitFree(0,0,this._renderer.zoomVelocity):s._orbit(0,0,this._renderer.zoomVelocity),0!==s.projMatrix.mat4[15]&&(s.projMatrix.mat4[0]*=Math.pow(10,-this._renderer.zoomVelocity),s.projMatrix.mat4[5]*=Math.pow(10,-this._renderer.zoomVelocity),this._renderer.uPMatrix.mat4[0]=s.projMatrix.mat4[0],this._renderer.uPMatrix.mat4[5]=s.projMatrix.mat4[5]),this._renderer.zoomVelocity*=.85):this._renderer.zoomVelocity=0,0===p&&0===f||!this._renderer.executeRotateAndMove||this._renderer.rotateVelocity.add(.6*p,.6*f),1e-6<this._renderer.rotateVelocity.magSq()?(n?s._orbitFree(-this._renderer.rotateVelocity.x,this._renderer.rotateVelocity.y,0):s._orbit(this._renderer.rotateVelocity.x,this._renderer.rotateVelocity.y,0),this._renderer.rotateVelocity.mult(.85)):this._renderer.rotateVelocity.set(0,0),0===m&&0===y||!this._renderer.executeRotateAndMove||(c=2*m/this.width,u=2*-y/this.height,this._renderer.moveVelocity.add(.15*c,.15*u)),1e-6<this._renderer.moveVelocity.magSq()?(r=s._getLocalAxes(),e=s.eyeX-s.centerX,t=s.eyeY-s.centerY,g=s.eyeZ-s.centerZ,v=Math.sqrt(e*e+t*t+g*g),l=new i.default.Vector(s.centerX,s.centerY,s.centerZ),l=s.cameraMatrix.multiplyPoint(l),(l=this._renderer.uPMatrix.multiplyAndNormalizePoint(l)).x-=this._renderer.moveVelocity.x,l.y-=this._renderer.moveVelocity.y,f=0===(p=this._renderer.uPMatrix.mat4)[15]?(h=(p[8]+l.x)/p[0]*v,(p[9]+l.y)/p[5]*v):(h=(l.x-p[12])/p[0],(l.y-p[13])/p[5]),s.setPosition(s.eyeX+h*r.x[0]+f*r.y[0],s.eyeY+h*r.x[1]+f*r.y[1],s.eyeZ+h*r.x[2]+f*r.y[2]),this._renderer.moveVelocity.mult(.85)):this._renderer.moveVelocity.set(0,0),this},i.default.prototype.debugMode=function(){this._assert3d("debugMode");for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.default._validateParameters("debugMode",t);for(var n=this._registeredMethods.post.length-1;0<=n;n--)this._registeredMethods.post[n].toString()!==this._grid().toString()&&this._registeredMethods.post[n].toString()!==this._axesIcon().toString()||this._registeredMethods.post.splice(n,1);t[0]===o.GRID?this.registerMethod("post",this._grid(t[1],t[2],t[3],t[4],t[5])):t[0]===o.AXES?this.registerMethod("post",this._axesIcon(t[1],t[2],t[3],t[4])):(this.registerMethod("post",this._grid(t[0],t[1],t[2],t[3],t[4])),this.registerMethod("post",this._axesIcon(t[5],t[6],t[7],t[8])))},i.default.prototype.noDebugMode=function(){this._assert3d("noDebugMode");for(var e=this._registeredMethods.post.length-1;0<=e;e--)this._registeredMethods.post[e].toString()!==this._grid().toString()&&this._registeredMethods.post[e].toString()!==this._axesIcon().toString()||this._registeredMethods.post.splice(e,1)},i.default.prototype._grid=function(e,t,r,n,i){void 0===e&&(e=this.width/2),void 0===t&&(t=Math.round(e/30)<4?4:Math.round(e/30)),void 0===r&&(r=0),void 0===n&&(n=0),void 0===i&&(i=0);var o=e/t,s=e/2;return function(){this.push(),this.stroke(255*this._renderer.curStrokeColor[0],255*this._renderer.curStrokeColor[1],255*this._renderer.curStrokeColor[2]),this._renderer.uModelMatrix.reset();for(var e=0;e<=t;e++)this.beginShape(this.LINES),this.vertex(-s+r,n,e*o-s+i),this.vertex(s+r,n,e*o-s+i),this.endShape();for(var a=0;a<=t;a++)this.beginShape(this.LINES),this.vertex(a*o-s+r,n,-s+i),this.vertex(a*o-s+r,n,s+i),this.endShape();this.pop()}},i.default.prototype._axesIcon=function(e,t,r,n){return void 0===e&&(e=40<this.width/20?this.width/20:40),void 0===t&&(t=-this.width/4),void 0===r&&(r=t),void 0===n&&(n=t),function(){this.push(),this._renderer.uModelMatrix.reset(),this.strokeWeight(2),this.stroke(255,0,0),this.beginShape(this.LINES),this.vertex(t,r,n),this.vertex(t+e,r,n),this.endShape(),this.stroke(0,255,0),this.beginShape(this.LINES),this.vertex(t,r,n),this.vertex(t,r+e,n),this.endShape(),this.stroke(0,0,255),this.beginShape(this.LINES),this.vertex(t,r,n),this.vertex(t,r,n+e),this.endShape(),this.pop()}};var l=i.default;r.default=l},{"../core/constants":272,"../core/main":283,"core-js/modules/es.array.for-each":161,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.splice":171,"core-js/modules/es.math.hypot":176,"core-js/modules/es.math.sign":178,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.for-each":245,"core-js/modules/web.dom-collections.iterator":246}],329:[function(e,t,r){"use strict";e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.filter"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};n.default.prototype.ambientLight=function(e,t,r,i){this._assert3d("ambientLight"),n.default._validateParameters("ambientLight",arguments);var o=this.color.apply(this,arguments);return this._renderer.ambientLightColors.push(o._array[0],o._array[1],o._array[2]),this._renderer._enableLighting=!0,this},n.default.prototype.specularColor=function(e,t,r){this._assert3d("specularColor"),n.default._validateParameters("specularColor",arguments);var i=this.color.apply(this,arguments);return this._renderer.specularColors=[i._array[0],i._array[1],i._array[2]],this},n.default.prototype.directionalLight=function(e,t,r,i,o,s){var a,l;return this._assert3d("directionalLight"),n.default._validateParameters("directionalLight",arguments),e=e instanceof n.default.Color?e:this.color(e,t,r),r="number"==typeof(t=arguments[arguments.length-1])?(a=arguments[arguments.length-3],l=arguments[arguments.length-2],arguments[arguments.length-1]):(a=t.x,l=t.y,t.z),t=Math.sqrt(a*a+l*l+r*r),this._renderer.directionalLightDirections.push(a/t,l/t,r/t),this._renderer.directionalLightDiffuseColors.push(e._array[0],e._array[1],e._array[2]),Array.prototype.push.apply(this._renderer.directionalLightSpecularColors,this._renderer.specularColors),this._renderer._enableLighting=!0,this},n.default.prototype.pointLight=function(e,t,r,i,o,s){var a,l;return this._assert3d("pointLight"),n.default._validateParameters("pointLight",arguments),e=e instanceof n.default.Color?e:this.color(e,t,r),r="number"==typeof(t=arguments[arguments.length-1])?(a=arguments[arguments.length-3],l=arguments[arguments.length-2],arguments[arguments.length-1]):(a=t.x,l=t.y,t.z),this._renderer.pointLightPositions.push(a,l,r),this._renderer.pointLightDiffuseColors.push(e._array[0],e._array[1],e._array[2]),Array.prototype.push.apply(this._renderer.pointLightSpecularColors,this._renderer.specularColors),this._renderer._enableLighting=!0,this},n.default.prototype.imageLight=function(e){this._renderer.activeImageLight=e,this._renderer._enableLighting=!0},n.default.prototype.panorama=function(e){this.filter(this._renderer._getSphereMapping(e))},n.default.prototype.lights=function(){this._assert3d("lights");var e=this.color("rgb(128,128,128)");return this.ambientLight(e),this.directionalLight(e,0,0,-1),this},n.default.prototype.lightFalloff=function(e,t,r){return this._assert3d("lightFalloff"),n.default._validateParameters("lightFalloff",arguments),e<0&&(e=0,console.warn("Value of constant argument in lightFalloff() should be never be negative. Set to 0.")),t<0&&(t=0,console.warn("Value of linear argument in lightFalloff() should be never be negative. Set to 0.")),r<0&&(r=0,console.warn("Value of quadratic argument in lightFalloff() should be never be negative. Set to 0.")),0===e&&0===t&&0===r&&(e=1,console.warn("Either one of the three arguments in lightFalloff() should be greater than zero. Set constant argument to 1.")),this._renderer.constantAttenuation=e,this._renderer.linearAttenuation=t,this._renderer.quadraticAttenuation=r,this},n.default.prototype.spotLight=function(e,t,r,i,o,s,a,l,c,u,h){this._assert3d("spotLight"),n.default._validateParameters("spotLight",arguments);var d,p,f,m=arguments.length;switch(m){case 11:case 10:d=this.color(e,t,r),p=new n.default.Vector(i,o,s),f=new n.default.Vector(a,l,c);break;case 9:e instanceof n.default.Color?(d=e,p=new n.default.Vector(t,r,i),f=new n.default.Vector(o,s,a),u=l,h=c):i instanceof n.default.Vector?(d=this.color(e,t,r),p=i,f=new n.default.Vector(o,s,a),u=l,h=c):a instanceof n.default.Vector?(d=this.color(e,t,r),p=new n.default.Vector(i,o,s),f=a,u=l,h=c):(d=this.color(e,t,r),p=new n.default.Vector(i,o,s),f=new n.default.Vector(a,l,c));break;case 8:f=e instanceof n.default.Color?(d=e,p=new n.default.Vector(t,r,i),new n.default.Vector(o,s,a)):i instanceof n.default.Vector?(d=this.color(e,t,r),p=i,new n.default.Vector(o,s,a)):(d=this.color(e,t,r),p=new n.default.Vector(i,o,s),a),u=l;break;case 7:e instanceof n.default.Color&&t instanceof n.default.Vector?(d=e,p=t,f=new n.default.Vector(r,i,o),u=s,h=a):e instanceof n.default.Color&&o instanceof n.default.Vector?(d=e,p=new n.default.Vector(t,r,i),f=o,u=s,h=a):i instanceof n.default.Vector&&o instanceof n.default.Vector?(d=this.color(e,t,r),p=i,f=o,u=s,h=a):f=e instanceof n.default.Color?(d=e,p=new n.default.Vector(t,r,i),new n.default.Vector(o,s,a)):i instanceof n.default.Vector?(d=this.color(e,t,r),p=i,new n.default.Vector(o,s,a)):(d=this.color(e,t,r),p=new n.default.Vector(i,o,s),a);break;case 6:i instanceof n.default.Vector&&o instanceof n.default.Vector?(d=this.color(e,t,r),p=i,f=o,u=s):e instanceof n.default.Color&&o instanceof n.default.Vector?(d=e,p=new n.default.Vector(t,r,i),f=o,u=s):e instanceof n.default.Color&&t instanceof n.default.Vector&&(d=e,p=t,f=new n.default.Vector(r,i,o),u=s);break;case 5:e instanceof n.default.Color&&t instanceof n.default.Vector&&r instanceof n.default.Vector?(d=e,p=t,f=r,u=i,h=o):i instanceof n.default.Vector&&o instanceof n.default.Vector?(d=this.color(e,t,r),p=i,f=o):e instanceof n.default.Color&&o instanceof n.default.Vector?(d=e,p=new n.default.Vector(t,r,i),f=o):e instanceof n.default.Color&&t instanceof n.default.Vector&&(d=e,p=t,f=new n.default.Vector(r,i,o));break;case 4:d=e,p=t,f=r,u=i;break;case 3:d=e,p=t,f=r;break;default:return console.warn("Sorry, input for spotlight() is not in prescribed format. Too ".concat(m<3?"few":"many"," arguments were provided")),this}return this._renderer.spotLightDiffuseColors.push(d._array[0],d._array[1],d._array[2]),Array.prototype.push.apply(this._renderer.spotLightSpecularColors,this._renderer.specularColors),this._renderer.spotLightPositions.push(p.x,p.y,p.z),f.normalize(),this._renderer.spotLightDirections.push(f.x,f.y,f.z),void 0===u&&(u=Math.PI/3),void 0!==h&&h<1?(h=1,console.warn("Value of concentration needs to be greater than 1. Setting it to 1")):void 0===h&&(h=100),u=this._renderer._pInst._toRadians(u),this._renderer.spotLightAngle.push(Math.cos(u)),this._renderer.spotLightConc.push(h),this._renderer._enableLighting=!0,this},n.default.prototype.noLights=function(){this._assert3d("noLights");for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.default._validateParameters("noLights",t),this._renderer.activeImageLight=null,this._renderer._enableLighting=!1,this._renderer.ambientLightColors.length=0,this._renderer.specularColors=[1,1,1],this._renderer.directionalLightDirections.length=0,this._renderer.directionalLightDiffuseColors.length=0,this._renderer.directionalLightSpecularColors.length=0,this._renderer.pointLightPositions.length=0,this._renderer.pointLightDiffuseColors.length=0,this._renderer.pointLightSpecularColors.length=0,this._renderer.spotLightPositions.length=0,this._renderer.spotLightDirections.length=0,this._renderer.spotLightDiffuseColors.length=0,this._renderer.spotLightSpecularColors.length=0,this._renderer.spotLightAngle.length=0,this._renderer.spotLightConc.length=0,this._renderer.constantAttenuation=1,this._renderer.linearAttenuation=0,this._renderer.quadraticAttenuation=0,this._renderer._useShininess=1,this._renderer._useMetalness=0,this},e=n.default,r.default=e},{"../core/main":283,"core-js/modules/es.array.filter":157}],330:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.set"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,e("regenerator-runtime/runtime");var i=(d=e("../core/main"))&&d.__esModule?d:{default:d};function o(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(e,t,r,n,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){s(o,n,i,a,l,"next",e)}function l(e){s(o,n,i,a,l,"throw",e)}a(void 0)}))}}function l(e){return(l="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}function c(e,t,r){for(var n=2<arguments.length&&void 0!==r?r:{},o={v:[],vt:[],vn:[]},s={},a=null,l=new Set,c=!1,u=!1,h=0;h<t.length;++h){var d=t[h].trim().split(/\b\s+/);if(0<d.length)if("usemtl"===d[0])a=d[1];else if("v"===d[0]||"vn"===d[0]){var p=new i.default.Vector(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));o[d[0]].push(p)}else if("vt"===d[0])p=[parseFloat(d[1]),1-parseFloat(d[2])],o[d[0]].push(p);else if("f"===d[0])for(var f=3;f<d.length;++f){for(var m=[],y=[1,f-1,f],g=0;g<y.length;++g){for(var v,b=d[y[g]],_=b.split("/"),x=0;x<_.length;x++)_[x]=parseInt(_[x])-1;s[b]||(s[b]={}),void 0===s[b][a]?(v=e.vertices.length,e.vertices.push(o.v[_[0]].copy()),e.uvs.push(o.vt[_[1]]?o.vt[_[1]].slice():[0,0]),e.vertexNormals.push(o.vn[_[2]]?o.vn[_[2]].copy():new i.default.Vector),s[b][a]=v,m.push(v),a&&n[a]&&n[a].diffuseColor&&l.add(o.v[_[0]])):m.push(s[b][a])}if(m[0]!==m[1]&&m[0]!==m[2]&&m[1]!==m[2])if(e.faces.push(m),a&&n[a]&&n[a].diffuseColor){c=c=!0;for(var w=n[a].diffuseColor,S=0;S<m.length;S++)e.vertexColors.push(w[0]),e.vertexColors.push(w[1]),e.vertexColors.push(w[2])}else u=!0}}if(0===e.vertexNormals.length&&e.computeNormals(),c===u)throw new Error("Model coloring is inconsistent. Either all vertices should have colors or none should.")}function u(e,t){if(function(e){for(var t=new DataView(e),r=[115,111,108,105,100],n=0;n<5;n++)if(function(e,t,r){for(var n=0,i=e.length;n<i;n++)if(e[n]!==t.getUint8(r+n,!1))return;return 1}(r,t,n))return;return 1}(t)){for(var r,n,o,s,a,l,c,u=e,h=new DataView(t),d=h.getUint32(80,!0),p=!1,f=0;f<70;f++)1129270351===h.getUint32(f,!1)&&82===h.getUint8(f+4)&&61===h.getUint8(f+5)&&(p=!0,s=[],a=h.getUint8(f+6)/255,l=h.getUint8(f+7)/255,c=h.getUint8(f+8)/255);for(var m=0;m<d;m++){for(var y,g=84+50*m,v=h.getFloat32(g,!0),b=h.getFloat32(4+g,!0),_=h.getFloat32(8+g,!0),x=(p&&(o=32768&(y=h.getUint16(48+g,!0))?(r=a,n=l,c):(r=(31&y)/31,n=(y>>5&31)/31,(y>>10&31)/31)),new i.default.Vector(v,b,_)),w=1;w<=3;w++){var S=g+12*w;S=new i.default.Vector(h.getFloat32(S,!0),h.getFloat32(4+S,!0),h.getFloat32(8+S,!0)),u.vertices.push(S),u.vertexNormals.push(x),p&&s.push(r,n,o)}u.faces.push([3*m,3*m+1,3*m+2]),u.uvs.push([0,0],[0,0],[0,0])}}else if(t=new DataView(t),"TextDecoder"in window)for(var M,T,E=e,j=new TextDecoder("utf-8").decode(t).split("\n"),A="",L=[],C=0;C<j.length;++C){for(var P=j[C].trim(),R=P.split(" "),O=0;O<R.length;++O)""===R[O]&&R.splice(O,1);if(0!==R.length)switch(A){case"":if("solid"!==R[0])return console.error(P),void console.error('Invalid state "'.concat(R[0],'", should be "solid"'));A="solid";break;case"solid":if("facet"!==R[0]||"normal"!==R[1])return console.error(P),void console.error('Invalid state "'.concat(R[0],'", should be "facet normal"'));M=new i.default.Vector(parseFloat(R[2]),parseFloat(R[3]),parseFloat(R[4])),E.vertexNormals.push(M,M,M),A="facet normal";break;case"facet normal":if("outer"!==R[0]||"loop"!==R[1])return console.error(P),void console.error('Invalid state "'.concat(R[0],'", should be "outer loop"'));A="vertex";break;case"vertex":if("vertex"===R[0])T=new i.default.Vector(parseFloat(R[1]),parseFloat(R[2]),parseFloat(R[3])),E.vertices.push(T),E.uvs.push([0,0]),L.push(E.vertices.indexOf(T));else{if("endloop"!==R[0])return console.error(P),void console.error('Invalid state "'.concat(R[0],'", should be "vertex" or "endloop"'));E.faces.push(L),L=[],A="endloop"}break;case"endloop":if("endfacet"!==R[0])return console.error(P),void console.error('Invalid state "'.concat(R[0],'", should be "endfacet"'));A="endfacet";break;case"endfacet":if("endsolid"!==R[0]){if("facet"!==R[0]||"normal"!==R[1])return console.error(P),void console.error('Invalid state "'.concat(R[0],'", should be "endsolid" or "facet normal"'));M=new i.default.Vector(parseFloat(R[2]),parseFloat(R[3]),parseFloat(R[4])),E.vertexNormals.push(M,M,M),A="facet normal"}break;default:console.error('Invalid state "'.concat(A,'"'))}}else console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)")}e("./p5.Geometry"),i.default.prototype.loadModel=function(e,t){i.default._validateParameters("loadModel",arguments);var r,n,s=!1,h=!1,d=!1,p=e.slice(-4),f=(t&&"object"===l(t)?(s=t.normalize||!1,r=t.successCallback,n=t.failureCallback,p=t.fileType||p,h=t.flipU||!1,d=t.flipV||!1):"boolean"==typeof t?(s=t,r=arguments[2],n=arguments[3],void 0!==arguments[4]&&(p=arguments[4])):(r="function"==typeof t?t:void 0,n=arguments[2],void 0!==arguments[3]&&(p=arguments[3])),new i.default.Geometry),m=(f.gid="".concat(e,"|").concat(s),this);function y(){return(y=a(regeneratorRuntime.mark((function t(r){var n,i,s,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n=[],i=0;i<r.length;i++)(s=r[i].match(/^mtllib (.+)/))&&function(){var t,r=s[1],i=e.split("/");t=1<i.length?(i.pop(),i.join("/")+"/"+r):r,n.push(function(){return g.apply(this,arguments)}(t).then((function(e){return e?(r=m,n=t,new Promise((function(e,t){var i=null,o={};r.loadStrings(n,(function(t){for(var r=0;r<t.length;++r){var n,s=t[r].trim().split(/\s+/);"newmtl"===s[0]?(n=s[1],o[i=n]={}):"Kd"===s[0]?o[i].diffuseColor=[parseFloat(s[1]),parseFloat(s[2]),parseFloat(s[3])]:"Ka"===s[0]?o[i].ambientColor=[parseFloat(s[1]),parseFloat(s[2]),parseFloat(s[3])]:"Ks"===s[0]?o[i].specularColor=[parseFloat(s[1]),parseFloat(s[2]),parseFloat(s[3])]:"map_Kd"===s[0]&&(o[i].texturePath=s[1])}e(o)}),t)}))):(console.warn("MTL file not found or error in parsing; proceeding without materials: ".concat(t)),{});var r,n})).catch((function(e){return console.warn("Error loading MTL file: ".concat(t),e),{}})))}();return t.prev=2,t.next=5,Promise.all(n);case 5:return a=t.sent,a=Object.assign.apply(Object,[{}].concat(o(a))),t.abrupt("return",a);case 10:return t.prev=10,t.t0=t.catch(2),t.abrupt("return",{});case 13:case"end":return t.stop()}}),t,null,[[2,10]])})))).apply(this,arguments)}function g(){return(g=a(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t,{method:"HEAD"});case 3:return r=e.sent,e.abrupt("return",r.ok);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}return p.match(/\.stl$/i)?this.httpDo(e,"GET","arrayBuffer",(function(e){u(f,e),s&&f.normalize(),h&&f.flipU(),d&&f.flipV(),m._decrementPreload(),"function"==typeof r&&r(f)}),n):p.match(/\.obj$/i)?this.loadStrings(e,function(){var e=a(regeneratorRuntime.mark((function e(t){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,function(){return y.apply(this,arguments)}(t);case 3:o=e.sent,c(f,t,o),e.next=11;break;case 7:return e.prev=7,e.t0=e.catch(0),n?n(e.t0):i.default._friendlyError("Error during parsing: "+e.t0.message),e.abrupt("return");case 11:return e.prev=11,s&&f.normalize(),h&&f.flipU(),d&&f.flipV(),f._makeTriangleEdges(),m._decrementPreload(),"function"==typeof r&&r(f),e.finish(11);case 19:case"end":return e.stop()}}),e,null,[[0,7,11,19]])})));return function(t){return e.apply(this,arguments)}}(),n):(i.default._friendlyFileLoadError(3,e),n?n():i.default._friendlyError("Sorry, the file type is invalid. Only OBJ and STL files are supported.")),f},i.default.prototype.model=function(e){this._assert3d("model"),i.default._validateParameters("model",arguments),0<e.vertices.length&&(this._renderer.geometryInHash(e.gid)||(e._edgesToVertices(),this._renderer.createBuffers(e.gid,e)),this._renderer.drawBuffers(e.gid))};var h=0,d=(i.default.prototype.createModel=function(e){var t,r,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:" ",o=2<arguments.length?arguments[2]:void 0,s=(i.default._validateParameters("createModel",arguments),!1),a=!1,d=!1;if((o&&"object"===l(o)?(s=o.normalize||!1,t=o.successCallback,r=o.failureCallback,a=o.flipU||!1,d=o.flipV||!1):r="boolean"==typeof o?(s=o,t=arguments[3],arguments[4]):(t="function"==typeof arguments[2]?arguments[2]:void 0,arguments[3]),o=new i.default.Geometry).gid="".concat(n,"|").concat(s,"|").concat(h++),n.match(/\.stl$/i))try{u(o,(new TextEncoder).encode(e).buffer)}catch(e){return void(r?r(e):i.default._friendlyError("Error during parsing: "+e.message))}else if(n.match(/\.obj$/i))try{c(o,e.split("\n"))}catch(e){return void(r?r(e):i.default._friendlyError("Error during parsing: "+e.message))}else i.default._friendlyFileLoadError(3,e),r?r():i.default._friendlyError("Sorry, the file type is invalid. Only OBJ and STL files are supported.");return s&&o.normalize(),a&&o.flipU(),d&&o.flipV(),o._makeTriangleEdges(),"function"==typeof t&&t(o),o},i.default);r.default=d},{"../core/main":283,"./p5.Geometry":335,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.from":162,"core-js/modules/es.array.index-of":164,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.join":166,"core-js/modules/es.array.slice":169,"core-js/modules/es.array.splice":171,"core-js/modules/es.object.assign":183,"core-js/modules/es.object.to-string":190,"core-js/modules/es.promise":191,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.set":197,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.match":201,"core-js/modules/es.string.split":206,"core-js/modules/es.string.trim":209,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/web.dom-collections.iterator":246,"regenerator-runtime/runtime":260}],331:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(l=e("../core/main"))&&l.__esModule?l:{default:l},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Texture"),o.default.prototype.loadShader=function(e,t,r,n){function i(){a._decrementPreload(),r&&r(s)}o.default._validateParameters("loadShader",arguments),n=n||console.error;var s=new o.default.Shader,a=this,l=!1,c=!1;return this.loadStrings(e,(function(e){s._vertSrc=e.join("\n"),c=!0,l&&i()}),n),this.loadStrings(t,(function(e){s._fragSrc=e.join("\n"),l=!0,c&&i()}),n),s},o.default.prototype.createShader=function(e,t,r){return o.default._validateParameters("createShader",arguments),new o.default.Shader(this._renderer,e,t,r)},o.default.prototype.createFilterShader=function(e){o.default._validateParameters("createFilterShader",arguments);var t=e.includes("#version 300 es")?"#version 300 es\n    uniform mat4 uModelViewMatrix;\n    uniform mat4 uProjectionMatrix;\n\n    in vec3 aPosition;\n    in vec2 aTexCoord;\n    out vec2 vTexCoord;\n\n    void main() {\n      // transferring texcoords for the frag shader\n      vTexCoord = aTexCoord;\n\n      // copy position with a fourth coordinate for projection (1.0 is normal)\n      vec4 positionVec4 = vec4(aPosition, 1.0);\n\n      // project to 3D space\n      gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n    }\n  ":"\n    uniform mat4 uModelViewMatrix;\n    uniform mat4 uProjectionMatrix;\n\n    attribute vec3 aPosition;\n    // texcoords only come from p5 to vertex shader\n    // so pass texcoords on to the fragment shader in a varying variable\n    attribute vec2 aTexCoord;\n    varying vec2 vTexCoord;\n\n    void main() {\n      // transferring texcoords for the frag shader\n      vTexCoord = aTexCoord;\n\n      // copy position with a fourth coordinate for projection (1.0 is normal)\n      vec4 positionVec4 = vec4(aPosition, 1.0);\n\n      // project to 3D space\n      gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n    }\n  ";return t=new o.default.Shader(this._renderer,t,e),this._renderer.GL?t.ensureCompiledOnContext(this):t.ensureCompiledOnContext(this._renderer.getFilterGraphicsLayer()),t},o.default.prototype.shader=function(e){return this._assert3d("shader"),o.default._validateParameters("shader",arguments),e.ensureCompiledOnContext(this),e.isStrokeShader()?this._renderer.userStrokeShader=e:(this._renderer.userFillShader=e,this._renderer._useNormalMaterial=!1),e.setDefaultUniforms(),this},o.default.prototype.baseMaterialShader=function(){return this._assert3d("baseMaterialShader"),this._renderer.baseMaterialShader()},o.default.prototype.baseNormalShader=function(){return this._assert3d("baseNormalShader"),this._renderer.baseNormalShader()},o.default.prototype.baseColorShader=function(){return this._assert3d("baseColorShader"),this._renderer.baseColorShader()},o.default.prototype.baseStrokeShader=function(){return this._assert3d("baseStrokeShader"),this._renderer.baseStrokeShader()},o.default.prototype.resetShader=function(){return this._renderer.userFillShader=this._renderer.userStrokeShader=null,this},o.default.prototype.texture=function(e){return this._assert3d("texture"),o.default._validateParameters("texture",arguments),e.gifProperties&&e._animateGif(this),this._renderer.drawMode=s.TEXTURE,this._renderer._useNormalMaterial=!1,this._renderer._tex=e,this._renderer._setProperty("_doFill",!0),this},o.default.prototype.textureMode=function(e){e!==s.IMAGE&&e!==s.NORMAL?console.warn("You tried to set ".concat(e," textureMode only supports IMAGE & NORMAL ")):this._renderer.textureMode=e},o.default.prototype.textureWrap=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:e,r=(this._renderer.textureWrapX=e,this._renderer.textureWrapY=t,!0),n=!1,i=void 0;try{for(var o,s=this._renderer.textures.values()[Symbol.iterator]();!(r=(o=s.next()).done);r=!0)o.value.setWrapMode(e,t)}catch(e){n=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw i}}},o.default.prototype.normalMaterial=function(){this._assert3d("normalMaterial");for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return o.default._validateParameters("normalMaterial",t),this._renderer.drawMode=s.FILL,this._renderer._useSpecularMaterial=!1,this._renderer._useEmissiveMaterial=!1,this._renderer._useNormalMaterial=!0,this._renderer.curFillColor=[1,1,1,1],this._renderer._setProperty("_doFill",!0),this.noStroke(),this},o.default.prototype.ambientMaterial=function(e,t,r){this._assert3d("ambientMaterial"),o.default._validateParameters("ambientMaterial",arguments);var n=o.default.prototype.color.apply(this,arguments);return this._renderer._hasSetAmbient=!0,this._renderer.curAmbientColor=n._array,this._renderer._useNormalMaterial=!1,this._renderer._enableLighting=!0,this._renderer._setProperty("_doFill",!0),this},o.default.prototype.emissiveMaterial=function(e,t,r,n){this._assert3d("emissiveMaterial"),o.default._validateParameters("emissiveMaterial",arguments);var i=o.default.prototype.color.apply(this,arguments);return this._renderer.curEmissiveColor=i._array,this._renderer._useEmissiveMaterial=!0,this._renderer._useNormalMaterial=!1,this._renderer._enableLighting=!0,this},o.default.prototype.specularMaterial=function(e,t,r,n){this._assert3d("specularMaterial"),o.default._validateParameters("specularMaterial",arguments);var i=o.default.prototype.color.apply(this,arguments);return this._renderer.curSpecularColor=i._array,this._renderer._useSpecularMaterial=!0,this._renderer._useNormalMaterial=!1,this._renderer._enableLighting=!0,this},o.default.prototype.shininess=function(e){return this._assert3d("shininess"),o.default._validateParameters("shininess",arguments),this._renderer._useShininess=e=e<1?1:e,this},o.default.prototype.metalness=function(e){return this._assert3d("metalness"),e=1-Math.exp(-e/100),this._renderer._useMetalness=e,this},o.default.RendererGL.prototype._applyColorBlend=function(e,t){var r=this.GL,n=this.drawMode===s.TEXTURE;return(t=t||this.userFillShader||this.userStrokeShader||this.userPointShader||n||this.curBlendMode!==s.BLEND||e[e.length-1]<1||this._isErasing)!==this._isBlending&&(t||this.curBlendMode!==s.BLEND&&this.curBlendMode!==s.ADD?r.enable(r.BLEND):r.disable(r.BLEND),r.depthMask(!0),this._isBlending=t),this._applyBlendMode(),e},o.default.RendererGL.prototype._applyBlendMode=function(){if(this._cachedBlendMode!==this.curBlendMode){var e=this.GL;switch(this.curBlendMode){case s.BLEND:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case s.ADD:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE);break;case s.REMOVE:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_ALPHA);break;case s.MULTIPLY:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA);break;case s.SCREEN:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_COLOR);break;case s.EXCLUSION:e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE_MINUS_DST_COLOR,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE);break;case s.REPLACE:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO);break;case s.SUBTRACT:e.blendEquationSeparate(e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case s.DARKEST:this.blendExt?(e.blendEquationSeparate(this.blendExt.MIN||this.blendExt.MIN_EXT,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):console.warn("blendMode(DARKEST) does not work in your browser in WEBGL mode.");break;case s.LIGHTEST:this.blendExt?(e.blendEquationSeparate(this.blendExt.MAX||this.blendExt.MAX_EXT,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):console.warn("blendMode(LIGHTEST) does not work in your browser in WEBGL mode.");break;default:console.error("Oops! Somehow RendererGL set curBlendMode to an unsupported mode.")}this._isErasing||(this._cachedBlendMode=this.curBlendMode)}};var l=o.default;r.default=l},{"../core/constants":272,"../core/main":283,"./p5.Texture":343,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.join":166,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.includes":199,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],332:[function(e,t,r){"use strict";e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};n.default.prototype.camera=function(){var e;this._assert3d("camera");for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return n.default._validateParameters("camera",r),(e=this._renderer._curCamera).camera.apply(e,r),this},n.default.prototype.perspective=function(){var e;this._assert3d("perspective");for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return n.default._validateParameters("perspective",r),(e=this._renderer._curCamera).perspective.apply(e,r),this},n.default.prototype.linePerspective=function(e){if(n.default._validateParameters("linePerspective",arguments),!(this._renderer instanceof n.default.RendererGL))throw new Error("linePerspective() must be called in WebGL mode.");if(void 0===e)return this._renderer._curCamera.useLinePerspective;this._renderer._curCamera.useLinePerspective=e},n.default.prototype.ortho=function(){var e;this._assert3d("ortho");for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return n.default._validateParameters("ortho",r),(e=this._renderer._curCamera).ortho.apply(e,r),this},n.default.prototype.frustum=function(){var e;this._assert3d("frustum");for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return n.default._validateParameters("frustum",r),(e=this._renderer._curCamera).frustum.apply(e,r),this},n.default.prototype.createCamera=function(){this._assert3d("createCamera");var e=new n.default.Camera(this._renderer);return e._computeCameraDefaultSettings(),e._setDefaultCamera(),this._renderer._curCamera=e},n.default.Camera=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this._renderer=t,this.cameraType="default",this.useLinePerspective=!0,this.cameraMatrix=new n.default.Matrix,this.projMatrix=new n.default.Matrix,this.yScale=1}var t;return(t=[{key:"perspective",value:function(e,t,r,i){this.cameraType=0<arguments.length?"custom":"default",void 0===e?(e=this.defaultCameraFOV,this.cameraFOV=e):this.cameraFOV=this._renderer._pInst._toRadians(e),void 0===t&&(t=this.defaultAspectRatio),void 0===r&&(r=this.defaultCameraNear),void 0===i&&(i=this.defaultCameraFar),r<=1e-4&&(r=.01,console.log("Avoid perspective near plane values close to or below 0. Setting value to 0.01.")),i<r&&console.log("Perspective far plane value is less than near plane value. Nothing will be shown."),this.aspectRatio=t,this.cameraNear=r,this.cameraFar=i,this.projMatrix=n.default.Matrix.identity(),e=1/Math.tan(this.cameraFOV/2);var o=1/(this.cameraNear-this.cameraFar);this.projMatrix.set(e/t,0,0,0,0,-e*this.yScale,0,0,0,0,(i+r)*o,-1,0,0,2*i*r*o,0),this._isActive()&&this._renderer.uPMatrix.set(this.projMatrix)}},{key:"ortho",value:function(e,t,r,i,o,s){var a=this.fbo||this._renderer,l=(void 0===e&&(e=-a.width/2),void 0===t&&(t=+a.width/2),void 0===r&&(r=-a.height/2),void 0===i&&(i=+a.height/2),void 0===o&&(o=0),void 0===s&&(s=Math.max(a.width,a.height)+800),this.cameraNear=o,a=t-e,i-r),c=(this.cameraFar=s)-o,u=2/a,h=2/l*this.yScale,d=-2/c;t=-(t+e)/a,e=-(i+r)/l,a=-(s+o)/c,this.projMatrix=n.default.Matrix.identity(),this.projMatrix.set(u,0,0,0,0,-h,0,0,0,0,d,0,t,e,a,1),this._isActive()&&this._renderer.uPMatrix.set(this.projMatrix),this.cameraType="custom"}},{key:"frustum",value:function(e,t,r,i,o,s){void 0===e&&(e=.05*-this._renderer.width),void 0===t&&(t=.05*+this._renderer.width),void 0===r&&(r=.05*+this._renderer.height),void 0===i&&(i=.05*-this._renderer.height),void 0===o&&(o=this.defaultCameraNear),void 0===s&&(s=this.defaultCameraFar),this.cameraNear=o;var a=t-e,l=i-r,c=(this.cameraFar=s)-o,u=2*o/a,h=2*o/l*this.yScale,d=-2*s*o/c;t=(t+e)/a,e=(i+r)/l,a=-(s+o)/c,this.projMatrix=n.default.Matrix.identity(),this.projMatrix.set(u,0,0,0,0,-h,0,0,t,e,a,-1,0,0,d,0),this._isActive()&&this._renderer.uPMatrix.set(this.projMatrix),this.cameraType="custom"}},{key:"_rotateView",value:function(e,t,r,i){var o=this.centerX,s=this.centerY,a=this.centerZ,l=(o-=this.eyeX,s-=this.eyeY,a-=this.eyeZ,n.default.Matrix.identity(this._renderer._pInst));(l.rotate(this._renderer._pInst._toRadians(e),t,r,i),e=[o*l.mat4[0]+s*l.mat4[4]+a*l.mat4[8],o*l.mat4[1]+s*l.mat4[5]+a*l.mat4[9],o*l.mat4[2]+s*l.mat4[6]+a*l.mat4[10]])[0]+=this.eyeX,e[1]+=this.eyeY,e[2]+=this.eyeZ,this.camera(this.eyeX,this.eyeY,this.eyeZ,e[0],e[1],e[2],this.upX,this.upY,this.upZ)}},{key:"roll",value:function(e){var t=this._getLocalAxes();e=n.default.Quat.fromAxisAngle(this._renderer._pInst._toRadians(e),t.z[0],t.z[1],t.z[2]).rotateVector(new n.default.Vector(this.upX,this.upY,this.upZ)),this.camera(this.eyeX,this.eyeY,this.eyeZ,this.centerX,this.centerY,this.centerZ,e.x,e.y,e.z)}},{key:"pan",value:function(e){var t=this._getLocalAxes();this._rotateView(e,t.y[0],t.y[1],t.y[2])}},{key:"tilt",value:function(e){var t=this._getLocalAxes();this._rotateView(e,t.x[0],t.x[1],t.x[2])}},{key:"lookAt",value:function(e,t,r){this.camera(this.eyeX,this.eyeY,this.eyeZ,e,t,r,this.upX,this.upY,this.upZ)}},{key:"camera",value:function(e,t,r,n,i,o,s,a,l){return void 0===e&&(e=this.defaultEyeX,t=this.defaultEyeY,r=this.defaultEyeZ,n=e,i=t,a=1,l=s=o=0),this.eyeX=e,this.eyeY=t,this.eyeZ=r,void 0!==n&&(this.centerX=n,this.centerY=i,this.centerZ=o),void 0!==s&&(this.upX=s,this.upY=a,this.upZ=l),n=this._getLocalAxes(),this.cameraMatrix.set(n.x[0],n.y[0],n.z[0],0,n.x[1],n.y[1],n.z[1],0,n.x[2],n.y[2],n.z[2],0,0,0,0,1),i=-e,this.cameraMatrix.translate([i,-t,-r]),this._isActive()&&this._renderer.uViewMatrix.set(this.cameraMatrix),this}},{key:"move",value:function(e,t,r){e=[(n=this._getLocalAxes()).x[0]*e,n.x[1]*e,n.x[2]*e],t=[n.y[0]*t,n.y[1]*t,n.y[2]*t];var n=[n.z[0]*r,n.z[1]*r,n.z[2]*r];this.camera(this.eyeX+e[0]+t[0]+n[0],this.eyeY+e[1]+t[1]+n[1],this.eyeZ+e[2]+t[2]+n[2],this.centerX+e[0]+t[0]+n[0],this.centerY+e[1]+t[1]+n[1],this.centerZ+e[2]+t[2]+n[2],this.upX,this.upY,this.upZ)}},{key:"setPosition",value:function(e,t,r){var n=e-this.eyeX,i=t-this.eyeY,o=r-this.eyeZ;this.camera(e,t,r,this.centerX+n,this.centerY+i,this.centerZ+o,this.upX,this.upY,this.upZ)}},{key:"set",value:function(e){for(var t=0,r=["eyeX","eyeY","eyeZ","centerX","centerY","centerZ","upX","upY","upZ","cameraFOV","aspectRatio","cameraNear","cameraFar","cameraType","yScale","useLinePerspective"];t<r.length;t++){var n=r[t];this[n]=e[n]}this.cameraMatrix=e.cameraMatrix.copy(),this.projMatrix=e.projMatrix.copy(),this._isActive()&&(this._renderer.uModelMatrix.reset(),this._renderer.uViewMatrix.set(this.cameraMatrix),this._renderer.uPMatrix.set(this.projMatrix))}},{key:"slerp",value:function(e,t,r){var i,o,s,a,l,c,u,h,d,p,f,m,y,g,v,b,_,x;0===r?this.set(e):1===r?this.set(t):(0!==this.projMatrix.mat4[15]&&(this.projMatrix.mat4[0]=e.projMatrix.mat4[0]*Math.pow(t.projMatrix.mat4[0]/e.projMatrix.mat4[0],r),this.projMatrix.mat4[5]=e.projMatrix.mat4[5]*Math.pow(t.projMatrix.mat4[5]/e.projMatrix.mat4[5],r),this._isActive()&&(this._renderer.uPMatrix.mat4=this.projMatrix.mat4.slice())),a=new n.default.Vector(e.eyeX,e.eyeY,e.eyeZ),l=new n.default.Vector(t.eyeX,t.eyeY,t.eyeZ),b=new n.default.Vector(e.centerX,e.centerY,e.centerZ),x=new n.default.Vector(t.centerX,t.centerY,t.centerZ),s=n.default.Vector.dist(a,b),i=n.default.Vector.dist(l,x),i=s*Math.pow(i/s,r),s=n.default.Vector.sub(a,l),o=1,1e-6<(_=(g=a.copy().sub(l).sub(b).add(x)).magSq())&&(o=n.default.Vector.dot(s,g)/_,o=Math.max(0,Math.min(o,1))),s=n.default.Vector.lerp(n.default.Vector.lerp(a,b,o),n.default.Vector.lerp(l,x,o),r),g=e.cameraMatrix.createSubMatrix3x3(),_=t.cameraMatrix.createSubMatrix3x3(),a=g.row(2),b=_.row(2),l=g.row(1),x=_.row(1),e=new n.default.Vector,t=new n.default.Vector,c=new n.default.Vector,u=new n.default.Vector,1-(h=.5*((g=(_=_.mult3x3(g.copy().transpose3x3())).diagonal())[0]+g[1]+g[2]-1))<1e-7?(e.set(n.default.Vector.lerp(a,b,r)).normalize(),c.set(e).mult(o*i).add(s),u.set(e).mult((o-1)*i).add(s),t.set(n.default.Vector.lerp(l,x,r)).normalize()):(b=1/(1-h),x=Math.max(g[0],g[1],g[2]),m=_.mat3[1]+_.mat3[3],y=_.mat3[2]+_.mat3[6],v=_.mat3[5]+_.mat3[7],x=x===g[0]?(p=.5*m*(b/=d=Math.sqrt((g[0]-h)*b)),f=.5*y*b,.5*(_.mat3[7]-_.mat3[5])/d):x===g[1]?(f=.5*v*(b/=p=Math.sqrt((g[1]-h)*b)),d=.5*m*b,.5*(_.mat3[2]-_.mat3[6])/p):(d=.5*y*(b/=f=Math.sqrt((g[2]-h)*b)),p=.5*v*b,.5*(_.mat3[3]-_.mat3[1])/f),m=r*Math.atan2(x,h),y=Math.cos(m),g=Math.sin(m),(x=new n.default.Matrix("mat3",[y+(v=1-y)*d*d,v*(b=d*p)+g*f,v*(_=f*d)-g*p,v*b-g*f,y+v*p*p,v*(r=p*f)+g*d,v*_+g*p,v*r-g*d,y+v*f*f])).multiplyVec3(a,e),c.set(e).mult(o*i).add(s),u.set(e).mult((o-1)*i).add(s),x.multiplyVec3(l,t)),this.camera(c.x,c.y,c.z,u.x,u.y,u.z,t.x,t.y,t.z))}},{key:"_computeCameraDefaultSettings",value:function(){this.defaultAspectRatio=this._renderer.width/this._renderer.height,this.defaultEyeX=0,this.defaultEyeY=0,this.defaultEyeZ=800,this.defaultCameraFOV=2*Math.atan(this._renderer.height/2/this.defaultEyeZ),this.defaultCenterX=0,this.defaultCenterY=0,this.defaultCenterZ=0,this.defaultCameraNear=.1*this.defaultEyeZ,this.defaultCameraFar=10*this.defaultEyeZ}},{key:"_setDefaultCamera",value:function(){this.cameraFOV=this.defaultCameraFOV,this.aspectRatio=this.defaultAspectRatio,this.eyeX=this.defaultEyeX,this.eyeY=this.defaultEyeY,this.eyeZ=this.defaultEyeZ,this.centerX=this.defaultCenterX,this.centerY=this.defaultCenterY,this.centerZ=this.defaultCenterZ,this.upX=0,this.upY=1,this.upZ=0,this.cameraNear=this.defaultCameraNear,this.cameraFar=this.defaultCameraFar,this.perspective(),this.camera(),this.cameraType="default"}},{key:"_resize",value:function(){"default"===this.cameraType&&(this._computeCameraDefaultSettings(),this.cameraFOV=this.defaultCameraFOV,this.aspectRatio=this.defaultAspectRatio,this.perspective())}},{key:"copy",value:function(){var e=new n.default.Camera(this._renderer);return e.cameraFOV=this.cameraFOV,e.aspectRatio=this.aspectRatio,e.eyeX=this.eyeX,e.eyeY=this.eyeY,e.eyeZ=this.eyeZ,e.centerX=this.centerX,e.centerY=this.centerY,e.centerZ=this.centerZ,e.upX=this.upX,e.upY=this.upY,e.upZ=this.upZ,e.cameraNear=this.cameraNear,e.cameraFar=this.cameraFar,e.cameraType=this.cameraType,e.useLinePerspective=this.useLinePerspective,e.cameraMatrix=this.cameraMatrix.copy(),e.projMatrix=this.projMatrix.copy(),e.yScale=this.yScale,e}},{key:"_getLocalAxes",value:function(){var e,t=this.eyeX-this.centerX,r=this.eyeY-this.centerY,n=this.eyeZ-this.centerZ,i=(0!==(i=Math.sqrt(t*t+r*r+n*n))&&(t/=i,r/=i,n/=i),this.upX),o=(l=this.upY)*n-(c=this.upZ)*r,s=-i*n+c*t,a=i*r-l*t,l=(i=r*a-n*s,-t*a+n*o),c=t*s-r*o;return 0!==(0!==(e=Math.sqrt(o*o+s*s+a*a))&&(o/=e,s/=e,a/=e),e=Math.sqrt(i*i+l*l+c*c))&&(i/=e,l/=e,c/=e),{x:[o,s,a],y:[i,l,c],z:[t,r,n]}}},{key:"_orbit",value:function(e,t,r){var i=this.eyeX-this.centerX,o=this.eyeY-this.centerY,s=this.eyeZ-this.centerZ,a=Math.hypot(i,o,s),l=(i=new n.default.Vector(i,o,s).normalize(),o=new n.default.Vector(this.upX,this.upY,this.upZ).normalize(),s=n.default.Vector.cross(o,i).normalize(),n.default.Vector.cross(s,o));(a=(a*=Math.pow(10,r))<this.cameraNear?this.cameraNear:a)>this.cameraFar&&(a=this.cameraFar),r=Math.acos(Math.max(-1,Math.min(1,n.default.Vector.dot(i,o))))+t,t=e,(r<=0||r>=Math.PI)&&(this.upX*=-1,this.upY*=-1,this.upZ*=-1),o.mult(Math.cos(r)),l.mult(Math.cos(t)*Math.sin(r)),s.mult(Math.sin(t)*Math.sin(r)),i.set(o).add(l).add(s),this.eyeX=a*i.x+this.centerX,this.eyeY=a*i.y+this.centerY,this.eyeZ=a*i.z+this.centerZ,this.camera(this.eyeX,this.eyeY,this.eyeZ,this.centerX,this.centerY,this.centerZ,this.upX,this.upY,this.upZ)}},{key:"_orbitFree",value:function(e,t,r){var i=this.eyeX-this.centerX,o=this.eyeY-this.centerY,s=this.eyeZ-this.centerZ,a=Math.hypot(i,o,s),l=(i=new n.default.Vector(i,o,s).normalize(),o=new n.default.Vector(this.upX,this.upY,this.upZ),s=n.default.Vector.cross(o,i).normalize(),n.default.Vector.cross(i,s)),c=Math.atan2(t,e),u=(l.mult(Math.sin(c)),s.mult(Math.cos(c)).add(l),c=Math.sqrt(e*e+t*t),l=n.default.Vector.cross(i,s),(a=(a*=Math.pow(10,r))<this.cameraNear?this.cameraNear:a)>this.cameraFar&&(a=this.cameraFar),e=Math.cos(c),t=Math.sin(c),(r=o.dot(i))*e+(c=o.dot(s))*t);r=-r*t+c*e,c=o.dot(l),o.x=u*i.x+r*s.x+c*l.x,o.y=u*i.y+r*s.y+c*l.y,o.z=u*i.z+r*s.z+c*l.z,s.mult(-t),i.mult(e).add(s).mult(a),this.camera(i.x+this.centerX,i.y+this.centerY,i.z+this.centerZ,this.centerX,this.centerY,this.centerZ,o.x,o.y,o.z)}},{key:"_isActive",value:function(){return this===this._renderer._curCamera}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),n.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix),this._renderer.uViewMatrix.set(e.cameraMatrix)},e=n.default.Camera,r.default=e},{"../core/main":283,"core-js/modules/es.array.slice":169,"core-js/modules/es.math.hypot":176,"core-js/modules/es.string.sub":208}],333:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.log2"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.log2"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.DataArray=function(){function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:128;if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.length=0,this.data=new Float32Array(t),this.initialLength=t}var t;return(t=[{key:"dataArray",value:function(){return this.subArray(0,this.length)}},{key:"clear",value:function(){this.length=0}},{key:"rescale",value:function(){var e;this.length<this.data.length/2&&(e=1<<Math.ceil(Math.log2(this.length)),(e=new Float32Array(e)).set(this.data.subarray(0,this.length),0),this.data=e)}},{key:"reset",value:function(){this.clear(),this.data=new Float32Array(this.initialLength)}},{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.ensureLength(this.length+t.length),this.data.set(t,this.length),this.length+=t.length}},{key:"slice",value:function(e,t){return this.data.slice(e,Math.min(t,this.length))}},{key:"subArray",value:function(e,t){return this.data.subarray(e,Math.min(t,this.length))}},{key:"ensureLength",value:function(e){for(;this.data.length<e;){var t=new Float32Array(2*this.data.length);t.set(this.data,0),this.data=t}}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),e=e.default.DataArray,r.default=e},{"../core/main":283,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.slice":169,"core-js/modules/es.math.log2":177,"core-js/modules/es.object.to-string":190,"core-js/modules/es.typed-array.copy-within":213,"core-js/modules/es.typed-array.every":214,"core-js/modules/es.typed-array.fill":215,"core-js/modules/es.typed-array.filter":216,"core-js/modules/es.typed-array.find":218,"core-js/modules/es.typed-array.find-index":217,"core-js/modules/es.typed-array.float32-array":219,"core-js/modules/es.typed-array.for-each":221,"core-js/modules/es.typed-array.includes":222,"core-js/modules/es.typed-array.index-of":223,"core-js/modules/es.typed-array.iterator":226,"core-js/modules/es.typed-array.join":227,"core-js/modules/es.typed-array.last-index-of":228,"core-js/modules/es.typed-array.map":229,"core-js/modules/es.typed-array.reduce":231,"core-js/modules/es.typed-array.reduce-right":230,"core-js/modules/es.typed-array.reverse":232,"core-js/modules/es.typed-array.set":233,"core-js/modules/es.typed-array.slice":234,"core-js/modules/es.typed-array.some":235,"core-js/modules/es.typed-array.sort":236,"core-js/modules/es.typed-array.subarray":237,"core-js/modules/es.typed-array.to-locale-string":238,"core-js/modules/es.typed-array.to-string":239}],334:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.reflect.get"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(_=e("../core/main"))&&_.__esModule?_:{default:_},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants")),a=e("./p5.Texture"),l=e("./p5.RendererGL");function c(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,c=function(){return e},e)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t,r){t&&p(e.prototype,t),r&&p(e,r)}function m(e,t,r){return(m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){if(e=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=g(e)););return e}(e,t),e)return(e=Object.getOwnPropertyDescriptor(e,t)).get?e.get.call(r):e.value})(e,t,r||e)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){var t=n;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e);var r=function(e){return function(){var t,r=g(e);if(t=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),1}catch(e){}}}()?(t=g(this).constructor,Reflect.construct(r,arguments,t)):r.apply(this,arguments),r=this,!t||"object"!==i(t)&&"function"!=typeof t){if(void 0!==r)return r;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}}(n);function n(e){var t;return d(this,n),(t=r.call(this,e.target._renderer)).fbo=e,t.yScale=-1,t}return f(n,[{key:"_computeCameraDefaultSettings",value:function(){m(g(n.prototype),"_computeCameraDefaultSettings",this).call(this),this.defaultAspectRatio=this.fbo.width/this.fbo.height,this.defaultCameraFOV=2*Math.atan(this.fbo.height/2/this.defaultEyeZ)}}]),n}(o.default.Camera),b=(o.default.FramebufferCamera=v,function(){function e(t,r){d(this,e),this.framebuffer=t,this.property=r}return f(e,[{key:"rawTexture",value:function(){return this.framebuffer[this.property]}},{key:"width",get:function(){return this.framebuffer.width*this.framebuffer.density}},{key:"height",get:function(){return this.framebuffer.height*this.framebuffer.density}}]),e}()),_=(o.default.FramebufferTexture=b,function(){function e(t){var r=this,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=(d(this,e),this.target=t,this.target._renderer.framebuffers.add(this),this._isClipApplied=!1,this.pixels=[],this.format=n.format||s.UNSIGNED_BYTE,this.channels=n.channels||(t._renderer._pInst._glAttributes.alpha?s.RGBA:s.RGB),this.useDepth=void 0===n.depth||n.depth,this.depthFormat=n.depthFormat||s.FLOAT,this.textureFiltering=n.textureFiltering||s.LINEAR,void 0===n.antialias?this.antialiasSamples=t._renderer._pInst._glAttributes.antialias?2:0:"number"==typeof n.antialias?this.antialiasSamples=n.antialias:this.antialiasSamples=n.antialias?2:0,this.antialias=0<this.antialiasSamples,this.antialias&&t.webglVersion!==s.WEBGL2&&(console.warn("Antialiasing is unsupported in a WebGL 1 context"),this.antialias=!1),this.density=n.density||t.pixelDensity(),t._renderer.GL);if(this.gl=i,n.width&&n.height?(o=t._renderer._adjustDimensions(n.width,n.height),this.width=o.adjustedWidth,this.height=o.adjustedHeight,this._autoSized=!1):(void 0===n.width!=(void 0===n.height)&&console.warn("Please supply both width and height for a framebuffer to give it a size. Only one was given, so the framebuffer will match the size of its canvas."),this.width=t.width,this.height=t.height,this._autoSized=!0),this._checkIfFormatsAvailable(),n.stencil&&!this.useDepth&&console.warn("A stencil buffer can only be used if also using depth. Since the framebuffer has no depth buffer, the stencil buffer will be ignored."),this.useStencil=this.useDepth&&(void 0===n.stencil||n.stencil),this.framebuffer=i.createFramebuffer(),!this.framebuffer)throw new Error("Unable to create a framebuffer");if(this.antialias&&(this.aaFramebuffer=i.createFramebuffer(),!this.aaFramebuffer))throw new Error("Unable to create a framebuffer for antialiasing");this._recreateTextures();var o=this.target._renderer._curCamera;this.defaultCamera=this.createCamera(),this.filterCamera=this.createCamera(),this.target._renderer._curCamera=o,this.draw((function(){return r.target.clear()}))}return f(e,[{key:"resize",value:function(e,t){this._autoSized=!1;var r=this.target._renderer._adjustDimensions(e,t);e=r.adjustedWidth,t=r.adjustedHeight,this.width=e,this.height=t,this._handleResize()}},{key:"pixelDensity",value:function(e){if(!e)return this.density;this._autoSized=!1,this.density=e,this._handleResize()}},{key:"autoSized",value:function(e){if(void 0===e)return this._autoSized;this._autoSized=e,this._handleResize()}},{key:"_checkIfFormatsAvailable",value:function(){var e=this.gl;(this.useDepth&&this.target.webglVersion===s.WEBGL&&!e.getExtension("WEBGL_depth_texture")&&(console.warn("Unable to create depth textures in this environment. Falling back to a framebuffer without depth."),this.useDepth=!1),this.useDepth&&this.target.webglVersion===s.WEBGL&&this.depthFormat===s.FLOAT&&(console.warn("FLOAT depth format is unavailable in WebGL 1. Defaulting to UNSIGNED_INT."),this.depthFormat=s.UNSIGNED_INT),[s.UNSIGNED_BYTE,s.FLOAT,s.HALF_FLOAT].includes(this.format)||(console.warn("Unknown Framebuffer format. Please use UNSIGNED_BYTE, FLOAT, or HALF_FLOAT. Defaulting to UNSIGNED_BYTE."),this.format=s.UNSIGNED_BYTE),this.useDepth&&![s.UNSIGNED_INT,s.FLOAT].includes(this.depthFormat)&&(console.warn("Unknown Framebuffer depth format. Please use UNSIGNED_INT or FLOAT. Defaulting to FLOAT."),this.depthFormat=s.FLOAT),e=(0,a.checkWebGLCapabilities)(this.target._renderer)).float||this.format!==s.FLOAT||(console.warn("This environment does not support FLOAT textures. Falling back to UNSIGNED_BYTE."),this.format=s.UNSIGNED_BYTE),this.useDepth&&!e.float&&this.depthFormat===s.FLOAT&&(console.warn("This environment does not support FLOAT depth textures. Falling back to UNSIGNED_INT."),this.depthFormat=s.UNSIGNED_INT),e.halfFloat||this.format!==s.HALF_FLOAT||(console.warn("This environment does not support HALF_FLOAT textures. Falling back to UNSIGNED_BYTE."),this.format=s.UNSIGNED_BYTE),this.channels===s.RGB&&[s.FLOAT,s.HALF_FLOAT].includes(this.format)&&(console.warn("FLOAT and HALF_FLOAT formats do not work cross-platform with only RGB channels. Falling back to RGBA."),this.channels=s.RGBA)}},{key:"_recreateTextures",value:function(){var e=this.gl,t=(this._updateSize(),e.getParameter(e.TEXTURE_BINDING_2D)),r=e.getParameter(e.FRAMEBUFFER_BINDING);if(!(i=e.createTexture()))throw new Error("Unable to create color texture");e.bindTexture(e.TEXTURE_2D,i);var n=this._glColorFormat();if(e.texImage2D(e.TEXTURE_2D,0,n.internalFormat,this.width*this.density,this.height*this.density,0,n.format,n.type,null),this.colorTexture=i,e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0),this.useDepth){var i;if(!(i=e.createTexture()))throw new Error("Unable to create depth texture");var a=this._glDepthFormat();e.bindTexture(e.TEXTURE_2D,i),e.texImage2D(e.TEXTURE_2D,0,a.internalFormat,this.width*this.density,this.height*this.density,0,a.format,a.type,null),e.framebufferTexture2D(e.FRAMEBUFFER,this.useStencil?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,e.TEXTURE_2D,i,0),this.depthTexture=i}this.antialias&&(this.colorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this.colorRenderbuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,Math.max(0,Math.min(this.antialiasSamples,e.getParameter(e.MAX_SAMPLES))),n.internalFormat,this.width*this.density,this.height*this.density),this.useDepth&&(a=this._glDepthFormat(),this.depthRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this.depthRenderbuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,Math.max(0,Math.min(this.antialiasSamples,e.getParameter(e.MAX_SAMPLES))),a.internalFormat,this.width*this.density,this.height*this.density)),e.bindFramebuffer(e.FRAMEBUFFER,this.aaFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,this.colorRenderbuffer),this.useDepth&&e.framebufferRenderbuffer(e.FRAMEBUFFER,this.useStencil?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthRenderbuffer)),this.useDepth&&(this.depth=new b(this,"depthTexture"),i=e.NEAREST,this.depthP5Texture=new o.default.Texture(this.target._renderer,this.depth,{minFilter:i,magFilter:i}),this.target._renderer.textures.set(this.depth,this.depthP5Texture)),this.color=new b(this,"colorTexture"),n=this.textureFiltering===s.LINEAR?e.LINEAR:e.NEAREST,this.colorP5Texture=new o.default.Texture(this.target._renderer,this.color,{minFilter:n,magFilter:n}),this.target._renderer.textures.set(this.color,this.colorP5Texture),e.bindTexture(e.TEXTURE_2D,t),e.bindFramebuffer(e.FRAMEBUFFER,r)}},{key:"_glColorFormat",value:function(){var e,t,r=this.gl,n=this.format===s.FLOAT?r.FLOAT:this.format===s.HALF_FLOAT?this.target.webglVersion===s.WEBGL2?r.HALF_FLOAT:r.getExtension("OES_texture_half_float").HALF_FLOAT_OES:r.UNSIGNED_BYTE,i=this.channels===s.RGBA?r.RGBA:r.RGB;return{internalFormat:this.target.webglVersion===s.WEBGL2?(h(t={},r.FLOAT,h({},r.RGBA,r.RGBA32F)),h(t,r.HALF_FLOAT,h({},r.RGBA,r.RGBA16F)),h(t,r.UNSIGNED_BYTE,(h(e={},r.RGBA,r.RGBA8),h(e,r.RGB,r.RGB8),e)),t[n][i]):this.format===s.HALF_FLOAT?r.RGBA:i,format:i,type:n}}},{key:"_glDepthFormat",value:function(){var e=this.gl,t=this.useStencil?this.depthFormat===s.FLOAT?e.FLOAT_32_UNSIGNED_INT_24_8_REV:this.target.webglVersion===s.WEBGL2?e.UNSIGNED_INT_24_8:e.getExtension("WEBGL_depth_texture").UNSIGNED_INT_24_8_WEBGL:this.depthFormat===s.FLOAT?e.FLOAT:e.UNSIGNED_INT,r=this.useStencil?e.DEPTH_STENCIL:e.DEPTH_COMPONENT;return{internalFormat:e=this.useStencil?this.depthFormat===s.FLOAT?e.DEPTH32F_STENCIL8:this.target.webglVersion===s.WEBGL2?e.DEPTH24_STENCIL8:e.DEPTH_STENCIL:this.target.webglVersion===s.WEBGL2?this.depthFormat===s.FLOAT?e.DEPTH_COMPONENT32F:e.DEPTH_COMPONENT24:e.DEPTH_COMPONENT,format:r,type:t}}},{key:"_updateSize",value:function(){this._autoSized&&(this.width=this.target.width,this.height=this.target.height,this.density=this.target.pixelDensity())}},{key:"_canvasSizeChanged",value:function(){this._autoSized&&this._handleResize()}},{key:"_handleResize",value:function(){var e=this.color,t=this.depth,r=this.colorRenderbuffer,n=this.depthRenderbuffer;this._deleteTexture(e),t&&this._deleteTexture(t),e=this.gl,r&&e.deleteRenderbuffer(r),n&&e.deleteRenderbuffer(n),this._recreateTextures(),this.defaultCamera._resize()}},{key:"createCamera",value:function(){var e=new v(this);return e._computeCameraDefaultSettings(),e._setDefaultCamera(),this.target._renderer._curCamera=e}},{key:"_deleteTexture",value:function(e){this.gl.deleteTexture(e.rawTexture()),this.target._renderer.textures.delete(e)}},{key:"remove",value:function(){var e=this.gl;this._deleteTexture(this.color),this.depth&&this._deleteTexture(this.depth),e.deleteFramebuffer(this.framebuffer),this.aaFramebuffer&&e.deleteFramebuffer(this.aaFramebuffer),this.depthRenderbuffer&&e.deleteRenderbuffer(this.depthRenderbuffer),this.colorRenderbuffer&&e.deleteRenderbuffer(this.colorRenderbuffer),this.target._renderer.framebuffers.delete(this)}},{key:"begin",value:function(){this.prevFramebuffer=this.target._renderer.activeFramebuffer(),this.prevFramebuffer&&this.prevFramebuffer._beforeEnd(),this.target._renderer.activeFramebuffers.push(this),this._beforeBegin(),this.target.push(),this.target.setCamera(this.defaultCamera),this.target.resetMatrix(),this.target._renderer.uViewMatrix.set(this.target._renderer._curCamera.cameraMatrix),this.target._renderer.uModelMatrix.reset(),this.target._renderer._applyStencilTestIfClipping()}},{key:"_framebufferToBind",value:function(){return this.antialias?this.aaFramebuffer:this.framebuffer}},{key:"_beforeBegin",value:function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebufferToBind()),this.target._renderer.viewport(this.width*this.density,this.height*this.density)}},{key:"_beforeEnd",value:function(){if(this.antialias){var e=this.gl,t=(e.bindFramebuffer(e.READ_FRAMEBUFFER,this.aaFramebuffer),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.framebuffer),[[e.COLOR_BUFFER_BIT,this.colorP5Texture.glMagFilter]]);this.useDepth&&t.push([e.DEPTH_BUFFER_BIT,this.depthP5Texture.glMagFilter]);for(var r=0,n=t;r<n.length;r++){var i=(o=u(n[r],2))[0],o=o[1];e.blitFramebuffer(0,0,this.width*this.density,this.height*this.density,0,0,this.width*this.density,this.height*this.density,i,o)}}}},{key:"end",value:function(){var e=this.gl;if(this.target.pop(),this.target._renderer.activeFramebuffers.pop()!==this)throw new Error("It looks like you've called end() while another Framebuffer is active.");this._beforeEnd(),this.prevFramebuffer?this.prevFramebuffer._beforeBegin():(e.bindFramebuffer(e.FRAMEBUFFER,null),this.target._renderer.viewport(this.target._renderer._origViewport.width,this.target._renderer._origViewport.height)),this.target._renderer._applyStencilTestIfClipping()}},{key:"draw",value:function(e){this.begin(),e(),this.end()}},{key:"loadPixels",value:function(){var e=this.gl,t=this.target._renderer.activeFramebuffer(),r=(e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer),this._glColorFormat());this.pixels=(0,l.readPixelsWebGL)(this.pixels,e,this.framebuffer,0,0,this.width*this.density,this.height*this.density,r.format,r.type),t?e.bindFramebuffer(e.FRAMEBUFFER,t._framebufferToBind()):e.bindFramebuffer(e.FRAMEBUFFER,null)}},{key:"get",value:function(e,t,r,n){o.default._validateParameters("p5.Framebuffer.get",arguments);var i=this._glColorFormat();if(void 0===e&&void 0===t)t=e=0,r=this.width,n=this.height;else if(void 0===r&&void 0===n)return(e<0||t<0||e>=this.width||t>=this.height)&&(console.warn("The x and y values passed to p5.Framebuffer.get are outside of its range and will be clamped."),e=this.target.constrain(e,0,this.width-1),t=this.target.constrain(t,0,this.height-1)),(0,l.readPixelWebGL)(this.gl,this.framebuffer,e*this.density,t*this.density,i.format,i.type);e=this.target.constrain(e,0,this.width-1),t=this.target.constrain(t,0,this.height-1),r=this.target.constrain(r,1,this.width-e),n=this.target.constrain(n,1,this.height-t);for(var s=(0,l.readPixelsWebGL)(void 0,this.gl,this.framebuffer,e*this.density,t*this.density,r*this.density,n*this.density,i.format,i.type),a=new Uint8ClampedArray(r*n*this.density*this.density*4),c=(a.fill(255),i.type===this.gl.RGB?3:4),u=0;u<n*this.density;u++)for(var h=0;h<r*this.density;h++)for(var d=0;d<4;d++){var p,f=4*(u*r*this.density+h)+d;d<c&&(p=4==c?f:(u*r*this.density+h)*c+d,a[f]=s[p])}return(e=new o.default.Image(r*this.density,n*this.density)).imageData=e.canvas.getContext("2d").createImageData(e.width,e.height),e.imageData.data.set(a),e.pixels=e.imageData.data,e.updatePixels(),1!==this.density&&e.resize(r,n),e}},{key:"updatePixels",value:function(){var e=this.gl,t=(this.colorP5Texture.bindTexture(),this._glColorFormat()),r=t.format===e.RGBA?4:3,n=(r=this.width*this.height*this.density*this.density*r,t.type===e.UNSIGNED_BYTE?Uint8Array:Float32Array);if(!(this.pixels instanceof n)||this.pixels.length!==r)throw new Error("The pixels array has not been set correctly. Please call loadPixels() before updatePixels().");e.texImage2D(e.TEXTURE_2D,0,t.internalFormat,this.width*this.density,this.height*this.density,0,t.format,t.type,this.pixels),this.colorP5Texture.unbindTexture(),n=this.target._renderer.activeFramebuffer(),this.antialias?(this.begin(),this.target.push(),this.target.imageMode(this.target.CENTER),this.target.resetMatrix(),this.target.noStroke(),this.target.clear(),this.target.image(this,0,0),this.target.pop(),this.useDepth&&(e.clearDepth(1),e.clear(e.DEPTH_BUFFER_BIT)),this.end()):(e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer),this.useDepth&&(e.clearDepth(1),e.clear(e.DEPTH_BUFFER_BIT)),n?e.bindFramebuffer(e.FRAMEBUFFER,n._framebufferToBind()):e.bindFramebuffer(e.FRAMEBUFFER,null))}}]),e}());e=o.default.Framebuffer=_,r.default=e},{"../core/constants":272,"../core/main":283,"./p5.RendererGL":341,"./p5.Texture":343,"core-js/modules/es.array.fill":156,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.get-prototype-of":188,"core-js/modules/es.object.to-string":190,"core-js/modules/es.reflect.construct":192,"core-js/modules/es.reflect.get":193,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.includes":199,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.typed-array.copy-within":213,"core-js/modules/es.typed-array.every":214,"core-js/modules/es.typed-array.fill":215,"core-js/modules/es.typed-array.filter":216,"core-js/modules/es.typed-array.find":218,"core-js/modules/es.typed-array.find-index":217,"core-js/modules/es.typed-array.float32-array":219,"core-js/modules/es.typed-array.for-each":221,"core-js/modules/es.typed-array.includes":222,"core-js/modules/es.typed-array.index-of":223,"core-js/modules/es.typed-array.iterator":226,"core-js/modules/es.typed-array.join":227,"core-js/modules/es.typed-array.last-index-of":228,"core-js/modules/es.typed-array.map":229,"core-js/modules/es.typed-array.reduce":231,"core-js/modules/es.typed-array.reduce-right":230,"core-js/modules/es.typed-array.reverse":232,"core-js/modules/es.typed-array.set":233,"core-js/modules/es.typed-array.slice":234,"core-js/modules/es.typed-array.some":235,"core-js/modules/es.typed-array.sort":236,"core-js/modules/es.typed-array.subarray":237,"core-js/modules/es.typed-array.to-locale-string":238,"core-js/modules/es.typed-array.to-string":239,"core-js/modules/es.typed-array.uint8-array":242,"core-js/modules/es.typed-array.uint8-clamped-array":243,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],335:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.flat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.unscopables.flat"),e("core-js/modules/es.array-buffer.constructor"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.entries"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.flat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.unscopables.flat"),e("core-js/modules/es.array-buffer.constructor"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.entries"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.sub"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(u=e("../core/main"))&&u.__esModule?u:{default:u},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function l(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}o.default.Geometry=function(){function e(t,r,n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.vertices=[],this.boundingBoxCache=null,this.lineVertices=new o.default.DataArray,this.lineTangentsIn=new o.default.DataArray,this.lineTangentsOut=new o.default.DataArray,this.lineSides=new o.default.DataArray,this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.vertexStrokeColors=[],this.lineVertexColors=new o.default.DataArray,this.detailX=void 0!==t?t:1,this.detailY=void 0!==r?r:1,this.dirtyFlags={},this._hasFillTransparency=void 0,this._hasStrokeTransparency=void 0,n instanceof Function&&n.call(this)}var t;return(t=[{key:"calculateBoundingBox",value:function(){if(!this.boundingBoxCache){for(var e=new o.default.Vector(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),t=new o.default.Vector(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE),r=0;r<this.vertices.length;r++){var n=this.vertices[r];e.x=Math.min(e.x,n.x),e.y=Math.min(e.y,n.y),e.z=Math.min(e.z,n.z),t.x=Math.max(t.x,n.x),t.y=Math.max(t.y,n.y),t.z=Math.max(t.z,n.z)}var i=new o.default.Vector(t.x-e.x,t.y-e.y,t.z-e.z),s=new o.default.Vector((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2);this.boundingBoxCache={min:e,max:t,size:i,offset:s}}return this.boundingBoxCache}},{key:"reset",value:function(){this._hasFillTransparency=void 0,this._hasStrokeTransparency=void 0,this.lineVertices.clear(),this.lineTangentsIn.clear(),this.lineTangentsOut.clear(),this.lineSides.clear(),this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexStrokeColors.length=0,this.lineVertexColors.clear(),this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}}},{key:"hasFillTransparency",value:function(){if(void 0===this._hasFillTransparency){this._hasFillTransparency=!1;for(var e=0;e<this.vertexColors.length;e+=4)if(this.vertexColors[e+3]<1){this._hasFillTransparency=!0;break}}return this._hasFillTransparency}},{key:"hasStrokeTransparency",value:function(){if(void 0===this._hasStrokeTransparency){this._hasStrokeTransparency=!1;for(var e=0;e<this.lineVertexColors.length;e+=4)if(this.lineVertexColors[e+3]<1){this._hasStrokeTransparency=!0;break}}return this._hasStrokeTransparency}},{key:"clearColors",value:function(){return this.vertexColors=[],this}},{key:"saveObj",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"model.obj",r="";if(this.vertices.forEach((function(e){r+="v ".concat(e.x," ").concat(e.y," ").concat(e.z,"\n")})),this.uvs&&0<this.uvs.length)for(var n=0;n<this.uvs.length;n+=2)r+="vt ".concat(this.uvs[n]," ").concat(this.uvs[n+1],"\n");this.vertexNormals&&0<this.vertexNormals.length&&this.vertexNormals.forEach((function(e){r+="vn ".concat(e.x," ").concat(e.y," ").concat(e.z,"\n")})),this.faces.forEach((function(t){var n="f";t.forEach((function(t){n=n+" "+(t+1),(0<e.vertexNormals.length||0<e.uvs.length)&&(n+="/",0<e.uvs.length&&(n+=t+1),n+="/",0<e.vertexNormals.length&&(n+=t+1))})),r+=n+"\n"}));var i=new Blob([r],{type:"text/plain"});o.default.prototype.downloadFile(i,t,"obj")}},{key:"saveStl",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"model.stl",t=void 0!==(t=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).binary)&&t,r=e.substring(0,e.lastIndexOf(".")),n=[],i=!0,s=!1,a=void 0;try{for(var l,u=this.faces[Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var h=l.value,d=o.default.Vector.sub(this.vertices[h[1]],this.vertices[h[0]]),p=o.default.Vector.sub(this.vertices[h[2]],this.vertices[h[0]]),f=d.y*p.z-d.z*p.y,m=d.z*p.x-d.x*p.z,y=d.x*p.y-d.y*p.x;n.push(new o.default.Vector(f,m,y).normalize())}}catch(e){s=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(s)throw a}}if(t){var g,v=80;s=2*this.faces.length+3*this.faces.length*4*4+80+4,a=new ArrayBuffer(s),(g=new DataView(a)).setUint32(v,this.faces.length,!0),v+=4;for(var b=0,_=Object.entries(this.faces);b<_.length;b++){var x=(w=c(_[b],2))[0],w=w[1],S=(x=n[x],g.setFloat32(v,x.x,!0),v+=4,g.setFloat32(v,x.y,!0),v+=4,g.setFloat32(v,x.z,!0),v+=4,!0),M=void(x=!1);try{for(var T,E=w[Symbol.iterator]();!(S=(T=E.next()).done);S=!0){var j=T.value,A=this.vertices[j];g.setFloat32(v,A.x,!0),v+=4,g.setFloat32(v,A.y,!0),v+=4,g.setFloat32(v,A.z,!0),v+=4}}catch(e){x=!0,M=e}finally{try{S||null==E.return||E.return()}finally{if(x)throw M}}g.setUint16(v,0,!0),v+=2}}else{g="solid "+r+"\n";for(var L=0,C=Object.entries(this.faces);L<C.length;L++){var P=(R=c(C[L],2))[0],R=R[1],O=(g=g+" facet norm "+(P=n[P]).x+" "+P.y+" "+P.z+"\n  outer loop\n",!0),k=void(P=!1);try{for(var I,D=R[Symbol.iterator]();!(O=(I=D.next()).done);O=!0){var N=I.value,F=this.vertices[N];g+="   vertex "+F.x+" "+F.y+" "+F.z+"\n"}}catch(e){P=!0,k=e}finally{try{O||null==D.return||D.return()}finally{if(P)throw k}}g+="  endloop\n endfacet\n"}g+="endsolid "+r+"\n"}t=new Blob([g],{type:"text/plain"}),o.default.prototype.downloadFile(t,e,"stl")}},{key:"flipU",value:function(){this.uvs=this.uvs.flat().map((function(e,t){return t%2==0?1-e:e}))}},{key:"flipV",value:function(){this.uvs=this.uvs.flat().map((function(e,t){return t%2==0?e:1-e}))}},{key:"computeFaces",value:function(){this.faces.length=0;for(var e,t,r,n=this.detailX+1,i=0;i<this.detailY;i++)for(var o=0;o<this.detailX;o++)t=(i+1)*n+o+1,this.faces.push([i*n+o,e=i*n+o+1,r=(i+1)*n+o]),this.faces.push([r,e,t]);return this}},{key:"_getFaceNormal",value:function(e){e=this.faces[e];var t=this.vertices[e[0]],r=this.vertices[e[1]],n=(e=this.vertices[e[2]],r=o.default.Vector.sub(r,t),e=o.default.Vector.sub(e,t),t=o.default.Vector.cross(r,e),o.default.Vector.mag(t));return 0==(r=n/(o.default.Vector.mag(r)*o.default.Vector.mag(e)))||isNaN(r)?(console.warn("p5.Geometry.prototype._getFaceNormal:","face has colinear sides or a repeated vertex"),t):(1<r&&(r=1),t.mult(Math.asin(r)/n))}},{key:"computeNormals",value:function(){var e,t=this,r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:s.FLAT,n=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).roundToPrecision,i=this.vertexNormals,a=this.vertices,l=this.faces;if(r===s.SMOOTH){for(var c={},u=[],h=Math.pow(10,void 0===n?3:n),d=function(e){return Math.round(e*h)/h},p=function(e){return"".concat(d(e.x),",").concat(d(e.y),",").concat(d(e.z))},f=0;f<a.length;f++){var m=a[f],y=p(m);void 0===c[y]&&(c[y]=u.length,u.push(m))}l.forEach((function(e){for(var t=0;t<3;++t){var r=e[t];r=a[r],r=p(r),e[t]=c[r]}})),this.edges.forEach((function(e){for(var t=0;t<2;++t){var r=e[t];r=a[r],r=p(r),e[t]=c[r]}})),this.vertices=a=u}for(e=i.length=0;e<a.length;++e)i.push(new o.default.Vector);for(l.forEach((function(e,r){for(var n=t._getFaceNormal(r),o=0;o<3;++o){var s=e[o];i[s].add(n)}})),e=0;e<a.length;++e)i[e].normalize();return this}},{key:"averageNormals",value:function(){for(var e=0;e<=this.detailY;e++){var t=this.detailX+1,r=o.default.Vector.add(this.vertexNormals[e*t],this.vertexNormals[e*t+this.detailX]);r=o.default.Vector.div(r,2),this.vertexNormals[e*t]=r,this.vertexNormals[e*t+this.detailX]=r}return this}},{key:"averagePoleNormals",value:function(){for(var e=new o.default.Vector(0,0,0),t=0;t<this.detailX;t++)e.add(this.vertexNormals[t]);e=o.default.Vector.div(e,this.detailX);for(var r=0;r<this.detailX;r++)this.vertexNormals[r]=e;e=new o.default.Vector(0,0,0);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)e.add(this.vertexNormals[n]);e=o.default.Vector.div(e,this.detailX);for(var i=this.vertices.length-1;i>this.vertices.length-1-this.detailX;i--)this.vertexNormals[i]=e;return this}},{key:"_makeTriangleEdges",value:function(){for(var e=this.edges.length=0;e<this.faces.length;e++)this.edges.push([this.faces[e][0],this.faces[e][1]]),this.edges.push([this.faces[e][1],this.faces[e][2]]),this.edges.push([this.faces[e][2],this.faces[e][0]]);return this}},{key:"_edgesToVertices",value:function(){this.lineVertices.clear(),this.lineTangentsIn.clear(),this.lineTangentsOut.clear(),this.lineSides.clear();for(var e,t=new Map,r=new Set,n=0;n<this.edges.length;n++){var i,o=this.edges[n-1],s=this.edges[n],a=this.vertices[s[0]],l=this.vertices[s[1]],c=0<this.vertexStrokeColors.length&&o?this.vertexStrokeColors.slice(4*o[1],4*(o[1]+1)):[0,0,0,0],u=0<this.vertexStrokeColors.length?this.vertexStrokeColors.slice(4*s[0],4*(s[0]+1)):[0,0,0,0],h=0<this.vertexStrokeColors.length?this.vertexStrokeColors.slice(4*s[1],4*(s[1]+1)):[0,0,0,0],d=l.copy().sub(a).normalize(),p=0<d.magSq();p&&this._addSegment(a,l,u,h,d),0<n&&o[1]===s[0]?r.has(s[0])||(r.add(s[0]),t.delete(s[0]),e&&p&&d.dot(e)<1-1e-8&&this._addJoin(a,e,d,u)):(p&&!r.has(s[0])&&((i=t.get(s[0]))?(this._addJoin(a,i.dir,d,u),t.delete(s[0]),r.add(s[0])):t.set(s[0],{point:a,dir:d.copy().mult(-1),color:u})),e&&!r.has(o[1])&&((i=t.get(o[1]))?(this._addJoin(this.vertices[o[1]],e,i.dir.copy().mult(-1),c),t.delete(o[1]),r.add(o[1])):t.set(o[1],{point:this.vertices[o[1]],dir:e,color:c}),e=void 0)),n!==this.edges.length-1||r.has(s[1])||((a=t.get(s[1]))?(this._addJoin(l,d,a.dir.copy().mult(-1),h),t.delete(s[1]),r.add(s[1])):t.set(s[1],{point:l,dir:d,color:h})),p&&(e=d)}var f=!0,m=!1,y=void 0;try{for(var g,v=t.values()[Symbol.iterator]();!(f=(g=v.next()).done);f=!0){var b=g.value,_=b.point,x=b.dir,w=b.color;this._addCap(_,x,w)}}catch(e){m=!0,y=e}finally{try{f||null==v.return||v.return()}finally{if(m)throw y}}return this}},{key:"_addSegment",value:function(e,t,r,n,i){e=e.array(),t=t.array();var o=i.array();this.lineSides.push(1,1,-1,1,-1,-1);for(var s=0,a=[this.lineTangentsIn,this.lineTangentsOut];s<a.length;s++)for(var c=a[s],u=0;u<6;u++)c.push.apply(c,l(o));return(i=this.lineVertices).push.apply(i,l(e).concat(l(t),l(e),l(t),l(t),l(e))),(i=this.lineVertexColors).push.apply(i,l(r).concat(l(n),l(r),l(n),l(n),l(r))),this}},{key:"_addCap",value:function(e,t,r){for(var n,i=e.array(),o=t.array(),s=[0,0,0],a=0;a<6;a++)(n=this.lineVertices).push.apply(n,l(i)),(n=this.lineTangentsIn).push.apply(n,l(o)),(n=this.lineTangentsOut).push.apply(n,s),(n=this.lineVertexColors).push.apply(n,l(r));return this.lineSides.push(-1,2,-2,1,2,-1),this}},{key:"_addJoin",value:function(e,t,r,n){for(var i,o=e.array(),s=t.array(),a=r.array(),c=0;c<12;c++)(i=this.lineVertices).push.apply(i,l(o)),(i=this.lineTangentsIn).push.apply(i,l(s)),(i=this.lineTangentsOut).push.apply(i,l(a)),(i=this.lineVertexColors).push.apply(i,l(n));return this.lineSides.push(-1,-3,-2,-1,0,-3),this.lineSides.push(3,1,2,3,0,1),this}},{key:"normalize",value:function(){if(0<this.vertices.length){for(var e=this.vertices[0].copy(),t=this.vertices[0].copy(),r=0;r<this.vertices.length;r++)e.x=Math.max(e.x,this.vertices[r].x),t.x=Math.min(t.x,this.vertices[r].x),e.y=Math.max(e.y,this.vertices[r].y),t.y=Math.min(t.y,this.vertices[r].y),e.z=Math.max(e.z,this.vertices[r].z),t.z=Math.min(t.z,this.vertices[r].z);for(var n=o.default.Vector.lerp(e,t,.5),i=o.default.Vector.sub(e,t),s=200/Math.max(Math.max(i.x,i.y),i.z),a=0;a<this.vertices.length;a++)this.vertices[a].sub(n),this.vertices[a].mult(s)}return this}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}();var u=o.default.Geometry;r.default=u},{"../core/constants":272,"../core/main":283,"core-js/modules/es.array-buffer.constructor":152,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.flat":160,"core-js/modules/es.array.for-each":161,"core-js/modules/es.array.from":162,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.last-index-of":167,"core-js/modules/es.array.map":168,"core-js/modules/es.array.slice":169,"core-js/modules/es.array.unscopables.flat":173,"core-js/modules/es.map":175,"core-js/modules/es.number.constructor":179,"core-js/modules/es.object.entries":184,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.set":197,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.sub":208,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.for-each":245,"core-js/modules/web.dom-collections.iterator":246}],336:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var o=Array,s=function(e){return Array.isArray(e)};"undefined"!=typeof Float32Array&&(o=Float32Array,s=function(e){return Array.isArray(e)||e instanceof Float32Array}),n.default.Matrix=function(){function e(){var t=this,r=e;if(t instanceof r)return arguments.length&&((t=arguments.length-1)<0||arguments.length<=t?void 0:arguments[t])instanceof n.default&&(this.p5=(r=arguments.length-1)<0||arguments.length<=r?void 0:arguments[r]),"mat3"===(arguments.length<=0?void 0:arguments[0])?this.mat3=Array.isArray(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:new o([1,0,0,0,1,0,0,0,1]):this.mat4=Array.isArray(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:new o([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this;throw new TypeError("Cannot call a class as a function")}var t,r,a;return t=e,a=[{key:"identity",value:function(e){return new n.default.Matrix(e)}}],(r=[{key:"reset",value:function(){return this.mat3?this.mat3.set([1,0,0,0,1,0,0,0,1]):this.mat4&&this.mat4.set([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this}},{key:"set",value:function(e){var t=arguments;if(e instanceof n.default.Matrix?t=e.mat4:s(e)&&(t=e),16!==t.length)n.default._friendlyError("Expected 16 values but received ".concat(t.length,"."),"p5.Matrix.set");else for(var r=0;r<16;r++)this.mat4[r]=t[r];return this}},{key:"get",value:function(){return new n.default.Matrix(this.mat4,this.p5)}},{key:"copy",value:function(){var e;return void 0!==this.mat3?((e=new n.default.Matrix("mat3",this.p5)).mat3[0]=this.mat3[0],e.mat3[1]=this.mat3[1],e.mat3[2]=this.mat3[2],e.mat3[3]=this.mat3[3],e.mat3[4]=this.mat3[4],e.mat3[5]=this.mat3[5],e.mat3[6]=this.mat3[6],e.mat3[7]=this.mat3[7],e.mat3[8]=this.mat3[8]):((e=new n.default.Matrix(this.p5)).mat4[0]=this.mat4[0],e.mat4[1]=this.mat4[1],e.mat4[2]=this.mat4[2],e.mat4[3]=this.mat4[3],e.mat4[4]=this.mat4[4],e.mat4[5]=this.mat4[5],e.mat4[6]=this.mat4[6],e.mat4[7]=this.mat4[7],e.mat4[8]=this.mat4[8],e.mat4[9]=this.mat4[9],e.mat4[10]=this.mat4[10],e.mat4[11]=this.mat4[11],e.mat4[12]=this.mat4[12],e.mat4[13]=this.mat4[13],e.mat4[14]=this.mat4[14],e.mat4[15]=this.mat4[15]),e}},{key:"transpose",value:function(e){var t,r,i,o,a,l;return e instanceof n.default.Matrix?(t=e.mat4[1],r=e.mat4[2],i=e.mat4[3],o=e.mat4[6],a=e.mat4[7],l=e.mat4[11],this.mat4[0]=e.mat4[0],this.mat4[1]=e.mat4[4],this.mat4[2]=e.mat4[8],this.mat4[3]=e.mat4[12],this.mat4[4]=t,this.mat4[5]=e.mat4[5],this.mat4[6]=e.mat4[9],this.mat4[7]=e.mat4[13],this.mat4[8]=r,this.mat4[9]=o,this.mat4[10]=e.mat4[10],this.mat4[11]=e.mat4[14],this.mat4[12]=i,this.mat4[13]=a,this.mat4[14]=l,this.mat4[15]=e.mat4[15]):s(e)&&(t=e[1],r=e[2],i=e[3],o=e[6],a=e[7],l=e[11],this.mat4[0]=e[0],this.mat4[1]=e[4],this.mat4[2]=e[8],this.mat4[3]=e[12],this.mat4[4]=t,this.mat4[5]=e[5],this.mat4[6]=e[9],this.mat4[7]=e[13],this.mat4[8]=r,this.mat4[9]=o,this.mat4[10]=e[10],this.mat4[11]=e[14],this.mat4[12]=i,this.mat4[13]=a,this.mat4[14]=l,this.mat4[15]=e[15]),this}},{key:"invert",value:function(e){e instanceof n.default.Matrix?(t=e.mat4[0],r=e.mat4[1],i=e.mat4[2],o=e.mat4[3],a=e.mat4[4],l=e.mat4[5],c=e.mat4[6],u=e.mat4[7],h=e.mat4[8],d=e.mat4[9],p=e.mat4[10],f=e.mat4[11],m=e.mat4[12],y=e.mat4[13],g=e.mat4[14],v=e.mat4[15]):s(e)&&(t=e[0],r=e[1],i=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],m=e[12],y=e[13],g=e[14],v=e[15]);var t,r,i,o,a,l,c,u,h,d,p,f,m,y,g,v,b=t*c-i*a,_=t*u-o*a,x=r*c-i*l,w=r*u-o*l,S=i*u-o*c,M=h*y-d*m,T=h*g-p*m,E=h*v-f*m,j=d*g-p*y,A=d*v-f*y,L=p*v-f*g,C=(e=t*l-r*a)*L-b*A+_*j+x*E-w*T+S*M;return C?(this.mat4[0]=(l*L-c*A+u*j)*(C=1/C),this.mat4[1]=(i*A-r*L-o*j)*C,this.mat4[2]=(y*S-g*w+v*x)*C,this.mat4[3]=(p*w-d*S-f*x)*C,this.mat4[4]=(c*E-a*L-u*T)*C,this.mat4[5]=(t*L-i*E+o*T)*C,this.mat4[6]=(g*_-m*S-v*b)*C,this.mat4[7]=(h*S-p*_+f*b)*C,this.mat4[8]=(a*A-l*E+u*M)*C,this.mat4[9]=(r*E-t*A-o*M)*C,this.mat4[10]=(m*w-y*_+v*e)*C,this.mat4[11]=(d*_-h*w-f*e)*C,this.mat4[12]=(l*T-a*j-c*M)*C,this.mat4[13]=(t*j-r*T+i*M)*C,this.mat4[14]=(y*b-m*x-g*e)*C,this.mat4[15]=(h*x-d*b+p*e)*C,this):null}},{key:"invert3x3",value:function(){var e=this.mat3[0],t=this.mat3[1],r=this.mat3[2],n=this.mat3[3],i=this.mat3[4],o=this.mat3[5],s=this.mat3[6],a=this.mat3[7],l=this.mat3[8],c=l*i-o*a,u=-l*n+o*s,h=a*n-i*s,d=e*c+t*u+r*h;return d?(this.mat3[0]=c*(d=1/d),this.mat3[1]=(-l*t+r*a)*d,this.mat3[2]=(o*t-r*i)*d,this.mat3[3]=u*d,this.mat3[4]=(l*e-r*s)*d,this.mat3[5]=(-o*e+r*n)*d,this.mat3[6]=h*d,this.mat3[7]=(-a*e+t*s)*d,this.mat3[8]=(i*e-t*n)*d,this):null}},{key:"transpose3x3",value:function(e){var t=(e=void 0===e?this.mat3:e)[1],r=e[2],n=e[5];return this.mat3[0]=e[0],this.mat3[1]=e[3],this.mat3[2]=e[6],this.mat3[3]=t,this.mat3[4]=e[4],this.mat3[5]=e[7],this.mat3[6]=r,this.mat3[7]=n,this.mat3[8]=e[8],this}},{key:"inverseTranspose",value:function(e){if(e=e.mat4,void 0===this.mat3?n.default._friendlyError("sorry, this function only works with mat3"):(this.mat3[0]=e[0],this.mat3[1]=e[1],this.mat3[2]=e[2],this.mat3[3]=e[4],this.mat3[4]=e[5],this.mat3[5]=e[6],this.mat3[6]=e[8],this.mat3[7]=e[9],this.mat3[8]=e[10]),e=this.invert3x3())e.transpose3x3(this.mat3);else for(var t=0;t<9;t++)this.mat3[t]=0;return this}},{key:"determinant",value:function(){var e=this.mat4[0]*this.mat4[5]-this.mat4[1]*this.mat4[4],t=this.mat4[0]*this.mat4[6]-this.mat4[2]*this.mat4[4],r=this.mat4[0]*this.mat4[7]-this.mat4[3]*this.mat4[4],n=this.mat4[1]*this.mat4[6]-this.mat4[2]*this.mat4[5],i=this.mat4[1]*this.mat4[7]-this.mat4[3]*this.mat4[5],o=this.mat4[2]*this.mat4[7]-this.mat4[3]*this.mat4[6],s=this.mat4[8]*this.mat4[13]-this.mat4[9]*this.mat4[12],a=this.mat4[8]*this.mat4[14]-this.mat4[10]*this.mat4[12],l=this.mat4[8]*this.mat4[15]-this.mat4[11]*this.mat4[12],c=this.mat4[9]*this.mat4[14]-this.mat4[10]*this.mat4[13],u=this.mat4[9]*this.mat4[15]-this.mat4[11]*this.mat4[13];return e*(this.mat4[10]*this.mat4[15]-this.mat4[11]*this.mat4[14])-t*u+r*c+n*l-i*a+o*s}},{key:"mult",value:function(e){var t;if(e===this||e===this.mat4)t=this.copy().mat4;else if(e instanceof n.default.Matrix)t=e.mat4;else if(s(e))t=e;else{if(16!==arguments.length)return;t=arguments}e=this.mat4[0];var r=this.mat4[1],i=this.mat4[2],o=this.mat4[3];return this.mat4[0]=e*t[0]+r*t[4]+i*t[8]+o*t[12],this.mat4[1]=e*t[1]+r*t[5]+i*t[9]+o*t[13],this.mat4[2]=e*t[2]+r*t[6]+i*t[10]+o*t[14],this.mat4[3]=e*t[3]+r*t[7]+i*t[11]+o*t[15],e=this.mat4[4],r=this.mat4[5],i=this.mat4[6],o=this.mat4[7],this.mat4[4]=e*t[0]+r*t[4]+i*t[8]+o*t[12],this.mat4[5]=e*t[1]+r*t[5]+i*t[9]+o*t[13],this.mat4[6]=e*t[2]+r*t[6]+i*t[10]+o*t[14],this.mat4[7]=e*t[3]+r*t[7]+i*t[11]+o*t[15],e=this.mat4[8],r=this.mat4[9],i=this.mat4[10],o=this.mat4[11],this.mat4[8]=e*t[0]+r*t[4]+i*t[8]+o*t[12],this.mat4[9]=e*t[1]+r*t[5]+i*t[9]+o*t[13],this.mat4[10]=e*t[2]+r*t[6]+i*t[10]+o*t[14],this.mat4[11]=e*t[3]+r*t[7]+i*t[11]+o*t[15],e=this.mat4[12],r=this.mat4[13],i=this.mat4[14],o=this.mat4[15],this.mat4[12]=e*t[0]+r*t[4]+i*t[8]+o*t[12],this.mat4[13]=e*t[1]+r*t[5]+i*t[9]+o*t[13],this.mat4[14]=e*t[2]+r*t[6]+i*t[10]+o*t[14],this.mat4[15]=e*t[3]+r*t[7]+i*t[11]+o*t[15],this}},{key:"apply",value:function(e){var t;if(e===this||e===this.mat4)t=this.copy().mat4;else if(e instanceof n.default.Matrix)t=e.mat4;else if(s(e))t=e;else{if(16!==arguments.length)return;t=arguments}var r=(e=this.mat4)[0],i=e[4],o=e[8],a=e[12];return e[0]=t[0]*r+t[1]*i+t[2]*o+t[3]*a,e[4]=t[4]*r+t[5]*i+t[6]*o+t[7]*a,e[8]=t[8]*r+t[9]*i+t[10]*o+t[11]*a,e[12]=t[12]*r+t[13]*i+t[14]*o+t[15]*a,r=e[1],i=e[5],o=e[9],a=e[13],e[1]=t[0]*r+t[1]*i+t[2]*o+t[3]*a,e[5]=t[4]*r+t[5]*i+t[6]*o+t[7]*a,e[9]=t[8]*r+t[9]*i+t[10]*o+t[11]*a,e[13]=t[12]*r+t[13]*i+t[14]*o+t[15]*a,r=e[2],i=e[6],o=e[10],a=e[14],e[2]=t[0]*r+t[1]*i+t[2]*o+t[3]*a,e[6]=t[4]*r+t[5]*i+t[6]*o+t[7]*a,e[10]=t[8]*r+t[9]*i+t[10]*o+t[11]*a,e[14]=t[12]*r+t[13]*i+t[14]*o+t[15]*a,r=e[3],i=e[7],o=e[11],a=e[15],e[3]=t[0]*r+t[1]*i+t[2]*o+t[3]*a,e[7]=t[4]*r+t[5]*i+t[6]*o+t[7]*a,e[11]=t[8]*r+t[9]*i+t[10]*o+t[11]*a,e[15]=t[12]*r+t[13]*i+t[14]*o+t[15]*a,this}},{key:"scale",value:function(e,t,r){return e instanceof n.default.Vector?(t=e.y,r=e.z,e=e.x):e instanceof Array&&(t=e[1],r=e[2],e=e[0]),this.mat4[0]*=e,this.mat4[1]*=e,this.mat4[2]*=e,this.mat4[3]*=e,this.mat4[4]*=t,this.mat4[5]*=t,this.mat4[6]*=t,this.mat4[7]*=t,this.mat4[8]*=r,this.mat4[9]*=r,this.mat4[10]*=r,this.mat4[11]*=r,this}},{key:"rotate",value:function(e,t,r,i){t instanceof n.default.Vector?(r=t.y,i=t.z,t=t.x):t instanceof Array&&(r=t[1],i=t[2],t=t[0]);var o=(t*=1/(o=Math.sqrt(t*t+r*r+i*i)),r*=1/o,i*=1/o,this.mat4[0]),s=this.mat4[1],a=this.mat4[2],l=this.mat4[3],c=this.mat4[4],u=this.mat4[5],h=this.mat4[6],d=this.mat4[7],p=this.mat4[8],f=this.mat4[9],m=this.mat4[10],y=this.mat4[11],g=Math.sin(e),v=1-(e=Math.cos(e)),b=t*t*v+e,_=r*t*v+i*g,x=i*t*v-r*g,w=t*r*v-i*g,S=r*r*v+e,M=i*r*v+t*g,T=t*i*v+r*g;return r=r*i*v-t*g,t=i*i*v+e,this.mat4[0]=o*b+c*_+p*x,this.mat4[1]=s*b+u*_+f*x,this.mat4[2]=a*b+h*_+m*x,this.mat4[3]=l*b+d*_+y*x,this.mat4[4]=o*w+c*S+p*M,this.mat4[5]=s*w+u*S+f*M,this.mat4[6]=a*w+h*S+m*M,this.mat4[7]=l*w+d*S+y*M,this.mat4[8]=o*T+c*r+p*t,this.mat4[9]=s*T+u*r+f*t,this.mat4[10]=a*T+h*r+m*t,this.mat4[11]=l*T+d*r+y*t,this}},{key:"translate",value:function(e){var t=e[0],r=e[1];e=e[2]||0,this.mat4[12]+=this.mat4[0]*t+this.mat4[4]*r+this.mat4[8]*e,this.mat4[13]+=this.mat4[1]*t+this.mat4[5]*r+this.mat4[9]*e,this.mat4[14]+=this.mat4[2]*t+this.mat4[6]*r+this.mat4[10]*e,this.mat4[15]+=this.mat4[3]*t+this.mat4[7]*r+this.mat4[11]*e}},{key:"rotateX",value:function(e){this.rotate(e,1,0,0)}},{key:"rotateY",value:function(e){this.rotate(e,0,1,0)}},{key:"rotateZ",value:function(e){this.rotate(e,0,0,1)}},{key:"perspective",value:function(e,t,r,n){e=1/Math.tan(e/2);var i=1/(r-n);return this.mat4[0]=e/t,this.mat4[1]=0,this.mat4[2]=0,this.mat4[3]=0,this.mat4[4]=0,this.mat4[5]=e,this.mat4[6]=0,this.mat4[7]=0,this.mat4[8]=0,this.mat4[9]=0,this.mat4[10]=(n+r)*i,this.mat4[11]=-1,this.mat4[12]=0,this.mat4[13]=0,this.mat4[14]=2*n*r*i,this.mat4[15]=0,this}},{key:"ortho",value:function(e,t,r,n,i,o){var s=1/(e-t),a=1/(r-n),l=1/(i-o);return this.mat4[0]=-2*s,this.mat4[1]=0,this.mat4[2]=0,this.mat4[3]=0,this.mat4[4]=0,this.mat4[5]=-2*a,this.mat4[6]=0,this.mat4[7]=0,this.mat4[8]=0,this.mat4[9]=0,this.mat4[10]=2*l,this.mat4[11]=0,this.mat4[12]=(e+t)*s,this.mat4[13]=(n+r)*a,this.mat4[14]=(o+i)*l,this.mat4[15]=1,this}},{key:"multiplyVec4",value:function(e,t,r,n){var i=new Array(4),o=this.mat4;return i[0]=o[0]*e+o[4]*t+o[8]*r+o[12]*n,i[1]=o[1]*e+o[5]*t+o[9]*r+o[13]*n,i[2]=o[2]*e+o[6]*t+o[10]*r+o[14]*n,i[3]=o[3]*e+o[7]*t+o[11]*r+o[15]*n,i}},{key:"multiplyPoint",value:function(e){var t=e.x,r=e.y;return e=e.z,t=this.multiplyVec4(t,r,e,1),new n.default.Vector(t[0],t[1],t[2])}},{key:"multiplyAndNormalizePoint",value:function(e){var t=e.x,r=e.y;return e=e.z,(t=this.multiplyVec4(t,r,e,1))[0]/=t[3],t[1]/=t[3],t[2]/=t[3],new n.default.Vector(t[0],t[1],t[2])}},{key:"multiplyDirection",value:function(e){var t=e.x,r=e.y;return e=e.z,t=this.multiplyVec4(t,r,e,0),new n.default.Vector(t[0],t[1],t[2])}},{key:"mult3x3",value:function(e){var t;if(e===this||e===this.mat3)t=this.copy().mat3;else if(e instanceof n.default.Matrix)t=e.mat3;else if(s(e))t=e;else{if(9!==arguments.length)return;t=arguments}e=this.mat3[0];var r=this.mat3[1],i=this.mat3[2];return this.mat3[0]=e*t[0]+r*t[3]+i*t[6],this.mat3[1]=e*t[1]+r*t[4]+i*t[7],this.mat3[2]=e*t[2]+r*t[5]+i*t[8],e=this.mat3[3],r=this.mat3[4],i=this.mat3[5],this.mat3[3]=e*t[0]+r*t[3]+i*t[6],this.mat3[4]=e*t[1]+r*t[4]+i*t[7],this.mat3[5]=e*t[2]+r*t[5]+i*t[8],e=this.mat3[6],r=this.mat3[7],i=this.mat3[8],this.mat3[6]=e*t[0]+r*t[3]+i*t[6],this.mat3[7]=e*t[1]+r*t[4]+i*t[7],this.mat3[8]=e*t[2]+r*t[5]+i*t[8],this}},{key:"column",value:function(e){return new n.default.Vector(this.mat3[3*e],this.mat3[3*e+1],this.mat3[3*e+2])}},{key:"row",value:function(e){return new n.default.Vector(this.mat3[e],this.mat3[e+3],this.mat3[e+6])}},{key:"diagonal",value:function(){return void 0!==this.mat3?[this.mat3[0],this.mat3[4],this.mat3[8]]:[this.mat4[0],this.mat4[5],this.mat4[10],this.mat4[15]]}},{key:"multiplyVec3",value:function(e,t){return(t=void 0===t?e.copy():t).x=this.row(0).dot(e),t.y=this.row(1).dot(e),t.z=this.row(2).dot(e),t}},{key:"createSubMatrix3x3",value:function(){var e=new n.default.Matrix("mat3");return e.mat3[0]=this.mat4[0],e.mat3[1]=this.mat4[1],e.mat3[2]=this.mat4[2],e.mat3[3]=this.mat4[4],e.mat3[4]=this.mat4[5],e.mat3[5]=this.mat4[6],e.mat3[6]=this.mat4[8],e.mat3[7]=this.mat4[9],e.mat3[8]=this.mat4[10],e}}])&&i(t.prototype,r),a&&i(t,a),e}(),e=n.default.Matrix,r.default=e},{"../core/main":283,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.to-string":190,"core-js/modules/es.typed-array.copy-within":213,"core-js/modules/es.typed-array.every":214,"core-js/modules/es.typed-array.fill":215,"core-js/modules/es.typed-array.filter":216,"core-js/modules/es.typed-array.find":218,"core-js/modules/es.typed-array.find-index":217,"core-js/modules/es.typed-array.float32-array":219,"core-js/modules/es.typed-array.for-each":221,"core-js/modules/es.typed-array.includes":222,"core-js/modules/es.typed-array.index-of":223,"core-js/modules/es.typed-array.iterator":226,"core-js/modules/es.typed-array.join":227,"core-js/modules/es.typed-array.last-index-of":228,"core-js/modules/es.typed-array.map":229,"core-js/modules/es.typed-array.reduce":231,"core-js/modules/es.typed-array.reduce-right":230,"core-js/modules/es.typed-array.reverse":232,"core-js/modules/es.typed-array.set":233,"core-js/modules/es.typed-array.slice":234,"core-js/modules/es.typed-array.some":235,"core-js/modules/es.typed-array.sort":236,"core-js/modules/es.typed-array.subarray":237,"core-js/modules/es.typed-array.to-locale-string":238,"core-js/modules/es.typed-array.to-string":239}],337:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}n.default.Quat=function(){function e(t,r,i,o){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.w=t,this.vec=new n.default.Vector(r,i,o)}var t,r,o;return t=e,o=[{key:"fromAxisAngle",value:function(e,t,r,i){var o=Math.cos(e/2);return t=new n.default.Vector(t,r,i).normalize().mult(Math.sin(e/2)),new n.default.Quat(o,t.x,t.y,t.z)}}],(r=[{key:"conjugate",value:function(){return new n.default.Quat(this.w,-this.vec.x,-this.vec.y,-this.vec.z)}},{key:"multiply",value:function(e){return new n.default.Quat(this.w*e.w-this.vec.x*e.vec.x-this.vec.y*e.vec.y-this.vec.z-e.vec.z,this.w*e.vec.x+this.vec.x*e.w+this.vec.y*e.vec.z-this.vec.z*e.vec.y,this.w*e.vec.y-this.vec.x*e.vec.z+this.vec.y*e.w+this.vec.z*e.vec.x,this.w*e.vec.z+this.vec.x*e.vec.y-this.vec.y*e.vec.x+this.vec.z*e.w)}},{key:"rotateVector",value:function(e){return new n.default.Vector.mult(e,this.w*this.w-this.vec.dot(this.vec)).add(n.default.Vector.mult(this.vec,2*e.dot(this.vec))).add(n.default.Vector.mult(this.vec,2*this.w).cross(e)).clampToZero()}},{key:"rotateBy",value:function(e){return e.multiply(this).multiply(e.conjugate()).vec.clampToZero()}}])&&i(t.prototype,r),o&&i(t,o),e}(),e=n.default.Quat,r.default=e},{"../core/main":283}],338:[function(e,t,r){"use strict";e("core-js/modules/es.array.map"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.RenderBuffer=function(){function e(t,r,n,i,o,s){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.size=t,this.src=r,this.dst=n,this.attr=i,this._renderer=o,this.map=s}var t;return(t=[{key:"_prepareBuffer",value:function(e,t){var r,n,i,o=t.attributes,s=this._renderer.GL,a=e.model||e;(o=o[this.attr])&&(r=e[this.dst],0<(n=a[this.src]).length?((i=!r)&&(e[this.dst]=r=s.createBuffer()),s.bindBuffer(s.ARRAY_BUFFER,r),!i&&!1===a.dirtyFlags[this.src]||(i=(e=this.map)?e(n):n,this._renderer._bindBuffer(r,s.ARRAY_BUFFER,i),a.dirtyFlags[this.src]=!1),t.enableAttrib(o,this.size)):-1!==(e=o.location)&&this._renderer.registerEnabled.has(e)&&(s.disableVertexAttribArray(e),this._renderer.registerEnabled.delete(e)))}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),e=e.default.RenderBuffer,r.default=e},{"../core/main":283,"core-js/modules/es.array.map":168}],339:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.find-index"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.map"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.find-index"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.map"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(u=e("../core/main"))&&u.__esModule?u:{default:u},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function l(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}e("./p5.RenderBuffer"),o.default.RendererGL.prototype.beginShape=function(e){return this.immediateMode.shapeMode=void 0!==e?e:s.TESS,this.immediateMode.geometry.reset(),this.immediateMode.contourIndices=[],this};var c={vertices:1,vertexNormals:1,vertexColors:4,vertexStrokeColors:4,uvs:2},u=(o.default.RendererGL.prototype.beginContour=function(){if(this.immediateMode.shapeMode!==s.TESS)throw new Error("WebGL mode can only use contours with beginShape(TESS).");this.immediateMode.contourIndices.push(this.immediateMode.geometry.vertices.length)},o.default.RendererGL.prototype.vertex=function(e,t){if(this.immediateMode.shapeMode===s.QUADS&&this.immediateMode.geometry.vertices.length%6==3)for(var r in c){var n=c[r];(r=this.immediateMode.geometry[r]).push.apply(r,l(r.slice(r.length-3*n,r.length-2*n)).concat(l(r.slice(r.length-n,r.length))))}var i,a,u=i=a=0,h=(3===arguments.length?u=arguments[2]:4===arguments.length?(i=arguments[2],a=arguments[3]):5===arguments.length&&(u=arguments[2],i=arguments[3],a=arguments[4]),new o.default.Vector(e,t,u));return this.immediateMode.geometry.vertices.push(h),this.immediateMode.geometry.vertexNormals.push(this._currentNormal),h=this.curFillColor||[.5,.5,.5,1],this.immediateMode.geometry.vertexColors.push(h[0],h[1],h[2],h[3]),h=this.curStrokeColor||[.5,.5,.5,1],this.immediateMode.geometry.vertexStrokeColors.push(h[0],h[1],h[2],h[3]),this.textureMode!==s.IMAGE||this.isProcessingVertices||(null!==this._tex?0<this._tex.width&&0<this._tex.height&&(i/=this._tex.width,a/=this._tex.height):void 0===this.userFillShader&&void 0===this.userStrokeShader&&void 0===this.userPointShader&&null===this._tex&&4<=arguments.length&&console.warn("You must first call texture() before using vertex() with image based u and v coordinates")),this.immediateMode.geometry.uvs.push(i,a),this.immediateMode._bezierVertex[0]=e,this.immediateMode._bezierVertex[1]=t,this.immediateMode._bezierVertex[2]=u,this.immediateMode._quadraticVertex[0]=e,this.immediateMode._quadraticVertex[1]=t,this.immediateMode._quadraticVertex[2]=u,this},o.default.RendererGL.prototype.normal=function(e,t,r){return e instanceof o.default.Vector?this._currentNormal=e:this._currentNormal=new o.default.Vector(e,t,r),this},o.default.RendererGL.prototype.endShape=function(e,t,r,n,i,o){var a,l=6<arguments.length&&void 0!==arguments[6]?arguments[6]:1;return this.immediateMode.shapeMode===s.POINTS?this._drawPoints(this.immediateMode.geometry.vertices,this.immediateMode.buffers.point):(3===this.immediateMode.geometry.vertices.length&&this.immediateMode.shapeMode===s.TESS&&(this.immediateMode.shapeMode=s.TRIANGLES),this.isProcessingVertices=!0,this._processVertices.apply(this,arguments),a=this.isProcessingVertices=!1,this.immediateMode.shapeMode!==s.LINE_STRIP&&this.immediateMode.shapeMode!==s.LINES||(this.immediateMode.shapeMode=s.TRIANGLE_FAN,a=!0),this.immediateMode.shapeMode===s.QUADS?this.immediateMode.shapeMode=s.TRIANGLES:this.immediateMode.shapeMode===s.QUAD_STRIP&&(this.immediateMode.shapeMode=s.TRIANGLE_STRIP),this._doFill&&!a&&!this.geometryBuilder&&3<=this.immediateMode.geometry.vertices.length&&this._drawImmediateFill(l),this._doStroke&&!this.geometryBuilder&&1<=this.immediateMode.geometry.lineVertices.length&&this._drawImmediateStroke(),this.geometryBuilder&&this.geometryBuilder.addImmediate(),this.isBezier=!1,this.isQuadratic=!1,this.isCurve=!1,this.immediateMode._bezierVertex.length=0,this.immediateMode._quadraticVertex.length=0,this.immediateMode._curveVertex.length=0),this},o.default.RendererGL.prototype._processVertices=function(e){var t;0!==this.immediateMode.geometry.vertices.length&&(t=this._doStroke,e=e===s.CLOSE,t&&(this.immediateMode.geometry.edges=this._calculateEdges(this.immediateMode.shapeMode,this.immediateMode.geometry.vertices,e),this.geometryBuilder||this.immediateMode.geometry._edgesToVertices()),t=this.immediateMode.shapeMode===s.TESS,e=0<this.immediateMode.contourIndices.length,this._doFill&&(this.isBezier||this.isQuadratic||this.isCurve||t||e)&&this.immediateMode.shapeMode!==s.LINES&&this._tesselateShape())},o.default.RendererGL.prototype._calculateEdges=function(e,t,r){var n=[],i=0,o=this.immediateMode.contourIndices.slice(),a=0;switch(e){case s.TRIANGLE_STRIP:for(i=0;i<t.length-2;i++)n.push([i,i+1]),n.push([i,i+2]);n.push([i,i+1]);break;case s.TRIANGLE_FAN:for(i=1;i<t.length-1;i++)n.push([0,i]),n.push([i,i+1]);n.push([0,t.length-1]);break;case s.TRIANGLES:for(i=0;i<t.length-2;i+=3)n.push([i,i+1]),n.push([i+1,i+2]),n.push([i+2,i]);break;case s.LINES:for(i=0;i<t.length-1;i+=2)n.push([i,i+1]);break;case s.QUADS:for(i=0;i<t.length-5;i+=6)n.push([i,i+1]),n.push([i+1,i+2]),n.push([i+3,i+5]),n.push([i+4,i+5]);break;case s.QUAD_STRIP:for(i=0;i<t.length-2;i+=2)n.push([i,i+1]),n.push([i,i+2]),n.push([i+1,i+3]);n.push([i,i+1]);break;default:for(i=0;i<t.length;i++)i+1<t.length&&i+1!==o[0]?n.push([i,i+1]):((r||a)&&n.push([i,a]),0<o.length&&(a=o.shift()))}return e!==s.TESS&&r&&n.push([t.length-1,0]),n},o.default.RendererGL.prototype._tesselateShape=function(){for(var e=this,t=(this.immediateMode.shapeMode=s.TRIANGLES,[[]]),r=0;r<this.immediateMode.geometry.vertices.length;r++)0<this.immediateMode.contourIndices.length&&this.immediateMode.contourIndices[0]===r&&(this.immediateMode.contourIndices.shift(),t.push([])),t[t.length-1].push(this.immediateMode.geometry.vertices[r].x,this.immediateMode.geometry.vertices[r].y,this.immediateMode.geometry.vertices[r].z,this.immediateMode.geometry.uvs[2*r],this.immediateMode.geometry.uvs[2*r+1],this.immediateMode.geometry.vertexColors[4*r],this.immediateMode.geometry.vertexColors[4*r+1],this.immediateMode.geometry.vertexColors[4*r+2],this.immediateMode.geometry.vertexColors[4*r+3],this.immediateMode.geometry.vertexNormals[r].x,this.immediateMode.geometry.vertexNormals[r].y,this.immediateMode.geometry.vertexNormals[r].z);for(var n,i=this._triangulate(t),a=this.immediateMode.geometry.vertices,c=(this.immediateMode.geometry.vertices=[],this.immediateMode.geometry.vertexNormals=[],this.immediateMode.geometry.uvs=[],[]),u=0,h=i.length;u<h;u+=o.default.RendererGL.prototype.tessyVertexSize)c.push.apply(c,l(i.slice(u+5,u+9))),this.normal.apply(this,l(i.slice(u+9,u+12))),this.vertex.apply(this,l(i.slice(u,u+5)));this.geometryBuilder&&(n=new Map,this.immediateMode.geometry.edges=this.immediateMode.geometry.edges.map((function(t){return t.map((function(t){if(!n.has(t)){var r=a[t],i=e.immediateMode.geometry.vertices.findIndex((function(e){return r.x===e.x&&r.y===e.y&&r.z===e.z}));if(-1===i){for(var o=1/0,s=0,l=0;l<e.immediateMode.geometry.vertices.length;l++){var c=e.immediateMode.geometry.vertices[l],u=r.x-c.x,h=r.y-c.y;(u=u*u+h*h+(c=r.z-c.z)*c)<o&&(o=u,s=l)}i=s}n.set(t,i)}return n.get(t)}))}))),this.immediateMode.geometry.vertexColors=c},o.default.RendererGL.prototype._drawImmediateFill=function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,r=this.GL,n=(this._useVertexColor=0<this.immediateMode.geometry.vertexColors.length,e=this._getImmediateFillShader(),this._setFillUniforms(e),!0),i=!1,o=void 0;try{for(var s,a=this.immediateMode.buffers.fill[Symbol.iterator]();!(n=(s=a.next()).done);n=!0)s.value._prepareBuffer(this.immediateMode.geometry,e)}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}if(e.disableRemainingAttributes(),this._applyColorBlend(this.curFillColor,this.immediateMode.geometry.hasFillTransparency()),1===t)r.drawArrays(this.immediateMode.shapeMode,0,this.immediateMode.geometry.vertices.length);else try{r.drawArraysInstanced(this.immediateMode.shapeMode,0,this.immediateMode.geometry.vertices.length,t)}catch(e){console.log("🌸 p5.js says: Instancing is only supported in WebGL2 mode")}e.unbindShader()},o.default.RendererGL.prototype._drawImmediateStroke=function(){var e=this.GL,t=(this._useLineColor=0<this.immediateMode.geometry.vertexStrokeColors.length,this._getImmediateStrokeShader()),r=(this._setStrokeUniforms(t),!0),n=!1,i=void 0;try{for(var o,s=this.immediateMode.buffers.stroke[Symbol.iterator]();!(r=(o=s.next()).done);r=!0)o.value._prepareBuffer(this.immediateMode.geometry,t)}catch(e){n=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw i}}t.disableRemainingAttributes(),this._applyColorBlend(this.curStrokeColor,this.immediateMode.geometry.hasFillTransparency()),e.drawArrays(e.TRIANGLES,0,this.immediateMode.geometry.lineVertices.length/3),t.unbindShader()},o.default.RendererGL);r.default=u},{"../core/constants":272,"../core/main":283,"./p5.RenderBuffer":338,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.fill":156,"core-js/modules/es.array.find-index":158,"core-js/modules/es.array.from":162,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.map":168,"core-js/modules/es.array.slice":169,"core-js/modules/es.map":175,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],340:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.some"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.some"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(l=e("../core/main"))&&l.__esModule?l:{default:l},s=(e("./p5.RendererGL"),e("./p5.RenderBuffer"),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants")));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}o.default.RendererGL.prototype.freeGeometry=function(e){e.gid?this._freeBuffers(e.gid):console.warn("The model you passed to freeGeometry does not have an id!")},o.default.RendererGL.prototype._initBufferDefaults=function(e){var t;return this._freeBuffers(e),1e3<Object.keys(this.retainedMode.geometry).length&&(t=Object.keys(this.retainedMode.geometry)[0],this._freeBuffers(t)),this.retainedMode.geometry[e]={}},o.default.RendererGL.prototype._freeBuffers=function(e){var t,r=this.retainedMode.geometry[e];function n(e){var n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var l=s.value;r[l.dst]&&(t.deleteBuffer(r[l.dst]),r[l.dst]=null)}}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}}r&&(delete this.retainedMode.geometry[e],t=this.GL,r.indexBuffer&&t.deleteBuffer(r.indexBuffer),n(this.retainedMode.buffers.stroke),n(this.retainedMode.buffers.fill))},o.default.RendererGL.prototype.createBuffers=function(e,t){var r,n,i,s=this.GL,a=((e=this._initBufferDefaults(e)).model=t,e.indexBuffer);return t.faces.length?(a=a||(e.indexBuffer=s.createBuffer()),i=(n=(r=o.default.RendererGL.prototype._flatten(t.faces)).some((function(e){return 65535<e})))?Uint32Array:Uint16Array,this._bindBuffer(a,s.ELEMENT_ARRAY_BUFFER,r,i),e.indexBufferType=n?s.UNSIGNED_INT:s.UNSIGNED_SHORT,e.vertexCount=3*t.faces.length):(a&&(s.deleteBuffer(a),e.indexBuffer=null),e.vertexCount=t.vertices?t.vertices.length:0),e.lineVertexCount=t.lineVertices?t.lineVertices.length/3:0,e},o.default.RendererGL.prototype.drawBuffers=function(e){var t=this.GL,r=this.retainedMode.geometry[e];if(!this.geometryBuilder&&this._doFill&&0<this.retainedMode.geometry[e].vertexCount){this._useVertexColor=0<r.model.vertexColors.length;var n=this._getRetainedFillShader(),i=(this._setFillUniforms(n),!0),o=!1,s=void 0;try{for(var a,l=this.retainedMode.buffers.fill[Symbol.iterator]();!(i=(a=l.next()).done);i=!0)a.value._prepareBuffer(r,n)}catch(e){o=!0,s=e}finally{try{i||null==l.return||l.return()}finally{if(o)throw s}}n.disableRemainingAttributes(),r.indexBuffer&&this._bindBuffer(r.indexBuffer,t.ELEMENT_ARRAY_BUFFER),this._applyColorBlend(this.curFillColor,r.model.hasFillTransparency()),this._drawElements(t.TRIANGLES,e),n.unbindShader()}if(!this.geometryBuilder&&this._doStroke&&0<r.lineVertexCount){this._useLineColor=0<r.model.vertexStrokeColors.length;var c=this._getRetainedStrokeShader(),u=(this._setStrokeUniforms(c),!0);o=!1,s=void 0;try{for(var h,d=this.retainedMode.buffers.stroke[Symbol.iterator]();!(u=(h=d.next()).done);u=!0)h.value._prepareBuffer(r,c)}catch(e){o=!0,s=e}finally{try{u||null==d.return||d.return()}finally{if(o)throw s}}c.disableRemainingAttributes(),this._applyColorBlend(this.curStrokeColor,r.model.hasStrokeTransparency()),this._drawArrays(t.TRIANGLES,e),c.unbindShader()}return this.geometryBuilder&&this.geometryBuilder.addRetained(r),this},o.default.RendererGL.prototype.drawBuffersScaled=function(e,t,r,n){var i=this.uModelMatrix.copy();try{this.uModelMatrix.scale(t,r,n),this.drawBuffers(e)}finally{this.uModelMatrix=i}},o.default.RendererGL.prototype._drawArrays=function(e,t){return this.GL.drawArrays(e,0,this.retainedMode.geometry[t].lineVertexCount),this},o.default.RendererGL.prototype._drawElements=function(e,t){t=this.retainedMode.geometry[t];var r=this.GL;if(t.indexBuffer){if(this._pInst.webglVersion!==s.WEBGL2&&t.indexBufferType===r.UNSIGNED_INT&&!r.getExtension("OES_element_index_uint"))throw new Error("Unable to render a 3d model with > 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.");r.drawElements(r.TRIANGLES,t.vertexCount,t.indexBufferType,0)}else r.drawArrays(e||r.TRIANGLES,0,t.vertexCount)},o.default.RendererGL.prototype._drawPoints=function(e,t){var r=this.GL,n=this._getImmediatePointShader();this._setPointUniforms(n),this._bindBuffer(t,r.ARRAY_BUFFER,this._vToNArray(e),Float32Array,r.STATIC_DRAW),n.enableAttrib(n.attributes.aPosition,3),this._applyColorBlend(this.curStrokeColor),r.drawArrays(r.Points,0,e.length),n.unbindShader()};var l=o.default.RendererGL;r.default=l},{"../core/constants":272,"../core/main":283,"./p5.RenderBuffer":338,"./p5.RendererGL":341,"core-js/modules/es.array.fill":156,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.some":170,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.keys":189,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.typed-array.copy-within":213,"core-js/modules/es.typed-array.every":214,"core-js/modules/es.typed-array.fill":215,"core-js/modules/es.typed-array.filter":216,"core-js/modules/es.typed-array.find":218,"core-js/modules/es.typed-array.find-index":217,"core-js/modules/es.typed-array.float32-array":219,"core-js/modules/es.typed-array.for-each":221,"core-js/modules/es.typed-array.includes":222,"core-js/modules/es.typed-array.index-of":223,"core-js/modules/es.typed-array.iterator":226,"core-js/modules/es.typed-array.join":227,"core-js/modules/es.typed-array.last-index-of":228,"core-js/modules/es.typed-array.map":229,"core-js/modules/es.typed-array.reduce":231,"core-js/modules/es.typed-array.reduce-right":230,"core-js/modules/es.typed-array.reverse":232,"core-js/modules/es.typed-array.set":233,"core-js/modules/es.typed-array.slice":234,"core-js/modules/es.typed-array.some":235,"core-js/modules/es.typed-array.sort":236,"core-js/modules/es.typed-array.subarray":237,"core-js/modules/es.typed-array.to-locale-string":238,"core-js/modules/es.typed-array.to-string":239,"core-js/modules/es.typed-array.uint16-array":240,"core-js/modules/es.typed-array.uint32-array":241,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],341:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.flat"),e("core-js/modules/es.array.flat-map"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.array.unscopables.flat"),e("core-js/modules/es.array.unscopables.flat-map"),e("core-js/modules/es.map"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.reflect.get"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.flat"),e("core-js/modules/es.array.flat-map"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.array.unscopables.flat"),e("core-js/modules/es.array.unscopables.flat-map"),e("core-js/modules/es.map"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.readPixelsWebGL=j,r.readPixelWebGL=A,r.default=void 0;var o=h(e("../core/main")),s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants")),a=h(e("./GeometryBuilder")),l=h(e("libtess")),c=(e("./p5.Shader"),e("./p5.Camera"),e("../core/p5.Renderer"),e("./p5.Matrix"),e("./p5.Framebuffer"),e("path"),e("./p5.Texture"));function u(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,u=function(){return e},e)}function h(e){return e&&e.__esModule?e:{default:e}}function d(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function p(e,t,r){return(p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){if(e=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}(e,t),e)return(e=Object.getOwnPropertyDescriptor(e,t)).get?e.get.call(r):e.value})(e,t,r||e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}function v(e,t){S+="#define STROKE_CAP_".concat(e," ").concat(t,"\n"),x[s[e]]=t}function b(e,t){S+="#define STROKE_JOIN_".concat(e," ").concat(t,"\n"),w[s[e]]=t}var _,x={},w={},S="",M={sphereMappingFrag:"#define PI 3.141592\n\nprecision highp float;\n  \nuniform sampler2D uSampler;\nuniform mat3 uNewNormalMatrix;\nuniform float uFovY;\nuniform float uAspect;\n\nvarying vec2 vTexCoord;\n  \nvoid main() {\n    float uFovX = uFovY * uAspect; \n    vec4 newTexColor = texture2D(uSampler, vTexCoord);\n    float angleY = mix(uFovY/2.0,  -uFovY/2.0, vTexCoord.y);\n    float angleX = mix(uFovX/2.0, -uFovX/2.0, vTexCoord.x);\n    vec3 rotatedNormal = vec3( angleX, angleY, 1.0 );\n    rotatedNormal = uNewNormalMatrix * normalize(rotatedNormal);\n    float temp = rotatedNormal.z;\n    rotatedNormal.z = rotatedNormal.x;\n    rotatedNormal.x = -temp;\n    vec2 suv;\n    suv.y = 0.5 + 0.5 * (-rotatedNormal.y);\n    suv.x = atan(rotatedNormal.z, rotatedNormal.x) / (2.0 * PI) + 0.5;\n    newTexColor = texture2D(uSampler, suv.xy);\n    gl_FragColor = newTexColor;\n}\n",immediateVert:"IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nOUT vec4 vColor;\nvoid main(void) {\n  vec4 positionVec4 = vec4(aPosition, 1.0);\n  gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n  vColor = aVertexColor;\n  gl_PointSize = uPointSize;\n}\n",vertexColorVert:"IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nOUT vec4 vColor;\n\nvoid main(void) {\n  vec4 positionVec4 = vec4(aPosition, 1.0);\n  gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n  vColor = aVertexColor;\n}\n",vertexColorFrag:"IN vec4 vColor;\nvoid main(void) {\n  OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n",normalVert:"IN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform vec4 uMaterialColor;\nuniform bool uUseVertexColor;\n\nOUT vec3 vVertexNormal;\nOUT highp vec2 vVertTexCoord;\nOUT vec4 vColor;\n\nvoid main(void) {\n  HOOK_beforeVertex();\n  vec4 positionVec4 = vec4(HOOK_getWorldPosition(\n    (uModelViewMatrix * vec4(HOOK_getLocalPosition(aPosition), 1.0)).xyz\n  ), 1.);\n\n  gl_Position = uProjectionMatrix * positionVec4;\n\n  vVertexNormal = HOOK_getWorldNormal(normalize(uNormalMatrix * HOOK_getLocalNormal(aNormal)));\n  vVertTexCoord = HOOK_getUV(aTexCoord);\n  vColor = HOOK_getVertexColor(uUseVertexColor ? aVertexColor : uMaterialColor);\n  HOOK_afterVertex();\n}\n",normalFrag:"IN vec3 vVertexNormal;\nvoid main(void) {\n  HOOK_beforeFragment();\n  OUT_COLOR = HOOK_getFinalColor(vec4(vVertexNormal, 1.0));\n  HOOK_afterFragment();\n}\n",basicFrag:"IN vec4 vColor;\nvoid main(void) {\n  HOOK_beforeFragment();\n  OUT_COLOR = HOOK_getFinalColor(vec4(vColor.rgb, 1.) * vColor.a);\n  HOOK_afterFragment();\n}\n",lightVert:(v("ROUND",0),v("PROJECT",1),v("SQUARE",2),b("ROUND",0),b("MITER",1),b("BEVEL",2),(e='#define PI 3.141592\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 uViewMatrix;\n\nuniform bool uUseLighting;\n\nuniform int uAmbientLightCount;\nuniform vec3 uAmbientColor[5];\nuniform mat3 uCameraRotation;\nuniform int uDirectionalLightCount;\nuniform vec3 uLightingDirection[5];\nuniform vec3 uDirectionalDiffuseColors[5];\nuniform vec3 uDirectionalSpecularColors[5];\n\nuniform int uPointLightCount;\nuniform vec3 uPointLightLocation[5];\nuniform vec3 uPointLightDiffuseColors[5];\t\nuniform vec3 uPointLightSpecularColors[5];\n\nuniform int uSpotLightCount;\nuniform float uSpotLightAngle[5];\nuniform float uSpotLightConc[5];\nuniform vec3 uSpotLightDiffuseColors[5];\nuniform vec3 uSpotLightSpecularColors[5];\nuniform vec3 uSpotLightLocation[5];\nuniform vec3 uSpotLightDirection[5];\n\nuniform bool uSpecular;\nuniform float uShininess;\nuniform float uMetallic;\n\nuniform float uConstantAttenuation;\nuniform float uLinearAttenuation;\nuniform float uQuadraticAttenuation;\n\n// setting from  _setImageLightUniforms()\n// boolean to initiate the calculateImageDiffuse and calculateImageSpecular\nuniform bool uUseImageLight;\n// texture for use in calculateImageDiffuse\nuniform sampler2D environmentMapDiffused;\n// texture for use in calculateImageSpecular\nuniform sampler2D environmentMapSpecular;\n\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n  float specular;\n  float diffuse;\n};\n\nfloat _phongSpecular(\n  vec3 lightDirection,\n  vec3 viewDirection,\n  vec3 surfaceNormal,\n  float shininess) {\n\n  vec3 R = reflect(lightDirection, surfaceNormal);\n  return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat _lambertDiffuse(vec3 lightDirection, vec3 surfaceNormal) {\n  return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult _light(vec3 viewDirection, vec3 normal, vec3 lightVector, float shininess, float metallic) {\n\n  vec3 lightDir = normalize(lightVector);\n\n  //compute our diffuse & specular terms\n  LightResult lr;\n  float specularIntensity = mix(1.0, 0.4, metallic);\n  float diffuseIntensity = mix(1.0, 0.1, metallic);\n  if (uSpecular)\n    lr.specular = (_phongSpecular(lightDir, viewDirection, normal, shininess)) * specularIntensity;\n    lr.diffuse = _lambertDiffuse(lightDir, normal) * diffuseIntensity;\n  return lr;\n}\n\n// converts the range of "value" from [min1 to max1] to [min2 to max2]\nfloat map(float value, float min1, float max1, float min2, float max2) {\n  return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nvec2 mapTextureToNormal( vec3 v ){\n  // x = r sin(phi) cos(theta)   \n  // y = r cos(phi)  \n  // z = r sin(phi) sin(theta)\n  float phi = acos( v.y );\n  // if phi is 0, then there are no x, z components\n  float theta = 0.0;\n  // else \n  theta = acos(v.x / sin(phi));\n  float sinTheta = v.z / sin(phi);\n  if (sinTheta < 0.0) {\n    // Turn it into -theta, but in the 0-2PI range\n    theta = 2.0 * PI - theta;\n  }\n  theta = theta / (2.0 * 3.14159);\n  phi = phi / 3.14159 ;\n  \n  vec2 angles = vec2( fract(theta + 0.25), 1.0 - phi );\n  return angles;\n}\n\n\nvec3 calculateImageDiffuse(vec3 vNormal, vec3 vViewPosition, float metallic){\n  // make 2 seperate builds \n  vec3 worldCameraPosition =  vec3(0.0, 0.0, 0.0);  // hardcoded world camera position\n  vec3 worldNormal = normalize(vNormal * uCameraRotation);\n  vec2 newTexCoor = mapTextureToNormal( worldNormal );\n  vec4 texture = TEXTURE( environmentMapDiffused, newTexCoor );\n  // this is to make the darker sections more dark\n  // png and jpg usually flatten the brightness so it is to reverse that\n  return mix(smoothstep(vec3(0.0), vec3(1.0), texture.xyz), vec3(0.0), metallic);\n}\n\nvec3 calculateImageSpecular(vec3 vNormal, vec3 vViewPosition, float shininess, float metallic){\n  vec3 worldCameraPosition =  vec3(0.0, 0.0, 0.0);\n  vec3 worldNormal = normalize(vNormal);\n  vec3 lightDirection = normalize( vViewPosition - worldCameraPosition );\n  vec3 R = reflect(lightDirection, worldNormal) * uCameraRotation;\n  vec2 newTexCoor = mapTextureToNormal( R );\n#ifdef WEBGL2\n  // In p5js the range of shininess is >= 1,\n  // Therefore roughness range will be ([0,1]*8)*20 or [0, 160]\n  // The factor of 8 is because currently the getSpecularTexture\n  // only calculated 8 different levels of roughness\n  // The factor of 20 is just to spread up this range so that,\n  // [1, max] of shininess is converted to [0,160] of roughness\n  float roughness = 20. / shininess;\n  vec4 outColor = textureLod(environmentMapSpecular, newTexCoor, roughness * 8.);\n#else\n  vec4 outColor = TEXTURE(environmentMapSpecular, newTexCoor);\n#endif\n  // this is to make the darker sections more dark\n  // png and jpg usually flatten the brightness so it is to reverse that\n  return mix(\n    pow(outColor.xyz, vec3(10)),\n    pow(outColor.xyz, vec3(1.2)),\n    metallic \n  );\n}\n\nvoid totalLight(\n  vec3 modelPosition,\n  vec3 normal,\n  float shininess,\n  float metallic,\n  out vec3 totalDiffuse,\n  out vec3 totalSpecular\n) {\n\n  totalSpecular = vec3(0.0);\n\n  if (!uUseLighting) {\n    totalDiffuse = vec3(1.0);\n    return;\n  }\n\n  totalDiffuse = vec3(0.0);\n\n  vec3 viewDirection = normalize(-modelPosition);\n\n  for (int j = 0; j < 5; j++) {\n    if (j < uDirectionalLightCount) {\n      vec3 lightVector = (uViewMatrix * vec4(uLightingDirection[j], 0.0)).xyz;\n      vec3 lightColor = uDirectionalDiffuseColors[j];\n      vec3 specularColor = uDirectionalSpecularColors[j];\n      LightResult result = _light(viewDirection, normal, lightVector, shininess, metallic);\n      totalDiffuse += result.diffuse * lightColor;\n      totalSpecular += result.specular * lightColor * specularColor;\n    }\n\n    if (j < uPointLightCount) {\n      vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[j], 1.0)).xyz;\n      vec3 lightVector = modelPosition - lightPosition;\n      //calculate attenuation\n      float lightDistance = length(lightVector);\n      float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n      vec3 lightColor = lightFalloff * uPointLightDiffuseColors[j];\n      vec3 specularColor = lightFalloff * uPointLightSpecularColors[j];\n\n      LightResult result = _light(viewDirection, normal, lightVector, shininess, metallic);\n      totalDiffuse += result.diffuse * lightColor;\n      totalSpecular += result.specular * lightColor * specularColor;\n    }\n\n    if(j < uSpotLightCount) {\n      vec3 lightPosition = (uViewMatrix * vec4(uSpotLightLocation[j], 1.0)).xyz;\n      vec3 lightVector = modelPosition - lightPosition;\n    \n      float lightDistance = length(lightVector);\n      float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n\n      vec3 lightDirection = (uViewMatrix * vec4(uSpotLightDirection[j], 0.0)).xyz;\n      float spotDot = dot(normalize(lightVector), normalize(lightDirection));\n      float spotFalloff;\n      if(spotDot < uSpotLightAngle[j]) {\n        spotFalloff = 0.0;\n      }\n      else {\n        spotFalloff = pow(spotDot, uSpotLightConc[j]);\n      }\n      lightFalloff *= spotFalloff;\n\n      vec3 lightColor = uSpotLightDiffuseColors[j];\n      vec3 specularColor = uSpotLightSpecularColors[j];\n     \n      LightResult result = _light(viewDirection, normal, lightVector, shininess, metallic);\n      \n      totalDiffuse += result.diffuse * lightColor * lightFalloff;\n      totalSpecular += result.specular * lightColor * specularColor * lightFalloff;\n    }\n  }\n\n  if( uUseImageLight ){\n    totalDiffuse += calculateImageDiffuse(normal, modelPosition, metallic);\n    totalSpecular += calculateImageSpecular(normal, modelPosition, shininess, metallic);\n  }\n\n  totalDiffuse *= diffuseFactor;\n  totalSpecular *= specularFactor;\n}\n')+"// include lighting.glgl\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT highp vec2 vVertTexCoord;\nOUT vec3 vDiffuseColor;\nOUT vec3 vSpecularColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n  vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n  gl_Position = uProjectionMatrix * viewModelPosition;\n\n  vec3 vertexNormal = normalize(uNormalMatrix * aNormal);\n  vVertTexCoord = aTexCoord;\n\n  totalLight(viewModelPosition.xyz, vertexNormal, vDiffuseColor, vSpecularColor);\n\n  for (int i = 0; i < 8; i++) {\n    if (i < uAmbientLightCount) {\n      vDiffuseColor += uAmbientColor[i];\n    }\n  }\n  \n  vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n"),lightTextureFrag:"uniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uEmissive;\n\nIN highp vec2 vVertTexCoord;\nIN vec3 vDiffuseColor;\nIN vec3 vSpecularColor;\nIN vec4 vColor;\n\nvoid main(void) {\n  if(uEmissive && !isTexture) {\n    OUT_COLOR = vColor;\n  }\n  else {\n    vec4 baseColor = isTexture\n      // Textures come in with premultiplied alpha. To apply tint and still have\n      // premultiplied alpha output, we need to multiply the RGB channels by the\n      // tint RGB, and all channels by the tint alpha.\n      ? TEXTURE(uSampler, vVertTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n      // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n      // channels by alpha to convert it to premultiplied alpha.\n      : vec4(vColor.rgb * vColor.a, vColor.a);\n    OUT_COLOR = vec4(baseColor.rgb * vDiffuseColor + vSpecularColor, baseColor.a);\n  }\n}\n",phongVert:"precision highp int;\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform vec3 uAmbientColor[5];\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT vec3 vNormal;\nOUT vec2 vTexCoord;\nOUT vec3 vViewPosition;\nOUT vec3 vAmbientColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n  HOOK_beforeVertex();\n  vec4 viewModelPosition = vec4(HOOK_getWorldPosition(\n    (uModelViewMatrix * vec4(HOOK_getLocalPosition(aPosition), 1.0)).xyz\n  ), 1.);\n\n  // Pass varyings to fragment shader\n  vViewPosition = viewModelPosition.xyz;\n  gl_Position = uProjectionMatrix * viewModelPosition;  \n\n  vNormal = HOOK_getWorldNormal(uNormalMatrix * HOOK_getLocalNormal(aNormal));\n  vTexCoord = HOOK_getUV(aTexCoord);\n\n  // TODO: this should be a uniform\n  vAmbientColor = vec3(0.0);\n  for (int i = 0; i < 5; i++) {\n    if (i < uAmbientLightCount) {\n      vAmbientColor += uAmbientColor[i];\n    }\n  }\n  \n  vColor = HOOK_getVertexColor((uUseVertexColor ? aVertexColor : uMaterialColor));\n  HOOK_afterVertex();\n}\n",phongFrag:e+"// include lighting.glsl\nprecision highp int;\n\nuniform bool uHasSetAmbient;\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nIN vec3 vNormal;\nIN vec2 vTexCoord;\nIN vec3 vViewPosition;\nIN vec3 vAmbientColor;\nIN vec4 vColor;\n\nstruct ColorComponents {\n  vec3 baseColor;\n  float opacity;\n  vec3 ambientColor;\n  vec3 specularColor;\n  vec3 diffuse;\n  vec3 ambient;\n  vec3 specular;\n  vec3 emissive;\n};\n\nstruct Inputs {\n  vec3 normal;\n  vec2 texCoord;\n  vec3 ambientLight;\n  vec3 ambientMaterial;\n  vec3 specularMaterial;\n  vec3 emissiveMaterial;\n  vec4 color;\n  float shininess;\n  float metalness;\n};\n\nvoid main(void) {\n  HOOK_beforeFragment();\n\n  Inputs inputs;\n  inputs.normal = normalize(vNormal);\n  inputs.texCoord = vTexCoord;\n  inputs.ambientLight = vAmbientColor;\n  inputs.color = isTexture\n      // Textures come in with premultiplied alpha. To apply tint and still have\n      // premultiplied alpha output, we need to multiply the RGB channels by the\n      // tint RGB, and all channels by the tint alpha.\n      ? TEXTURE(uSampler, vTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n      // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n      // channels by alpha to convert it to premultiplied alpha.\n      : vec4(vColor.rgb * vColor.a, vColor.a);\n  inputs.shininess = uShininess;\n  inputs.metalness = uMetallic;\n  inputs.ambientMaterial = uHasSetAmbient ? uAmbientMatColor.rgb : inputs.color.rgb;\n  inputs.specularMaterial = uSpecularMatColor.rgb;\n  inputs.emissiveMaterial = uEmissiveMatColor.rgb;\n  inputs = HOOK_getPixelInputs(inputs);\n\n  vec3 diffuse;\n  vec3 specular;\n  totalLight(vViewPosition, inputs.normal, inputs.shininess, inputs.metalness, diffuse, specular);\n\n  // Calculating final color as result of all lights (plus emissive term).\n\n  vec2 texCoord = inputs.texCoord;\n  vec4 baseColor = inputs.color;\n  ColorComponents c;\n  c.opacity = baseColor.a;\n  c.baseColor = baseColor.rgb;\n  c.ambientColor = inputs.ambientMaterial;\n  c.specularColor = inputs.specularMaterial;\n  c.diffuse = diffuse;\n  c.ambient = inputs.ambientLight;\n  c.specular = specular;\n  c.emissive = inputs.emissiveMaterial;\n  OUT_COLOR = HOOK_getFinalColor(HOOK_combineColors(c));\n  HOOK_afterFragment();\n}\n",fontVert:"IN vec3 aPosition;\nIN vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nOUT vec2 vTexCoord;\nOUT float w;\n\nvoid main() {\n  vec4 positionVec4 = vec4(aPosition, 1.0);\n\n  // scale by the size of the glyph's rectangle\n  positionVec4.xy *= uGlyphRect.zw - uGlyphRect.xy;\n\n  // Expand glyph bounding boxes by 1px on each side to give a bit of room\n  // for antialiasing\n  vec3 newOrigin = (uModelViewMatrix * vec4(0., 0., 0., 1.)).xyz;\n  vec3 newDX = (uModelViewMatrix * vec4(1., 0., 0., 1.)).xyz;\n  vec3 newDY = (uModelViewMatrix * vec4(0., 1., 0., 1.)).xyz;\n  vec2 pixelScale = vec2(\n    1. / length(newOrigin - newDX),\n    1. / length(newOrigin - newDY)\n  );\n  vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5)) * vec2(1., -1.);\n  vec2 textureOffset = offset * (1. / vec2(\n    uGlyphRect.z - uGlyphRect.x,\n    uGlyphRect.w - uGlyphRect.y\n  ));\n\n  // move to the corner of the glyph\n  positionVec4.xy += uGlyphRect.xy;\n\n  // move to the letter's line offset\n  positionVec4.x += uGlyphOffset;\n\n  positionVec4.xy += offset;\n  \n  gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n  vTexCoord = aTexCoord + textureOffset;\n  w = gl_Position.w;\n}\n",fontFrag:"#ifndef WEBGL2\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n#if 0\n  // simulate integer math using floats\n\t#define int float\n\t#define ivec2 vec2\n\t#define INT(x) float(x)\n\n\tint ifloor(float v) { return floor(v); }\n\tivec2 ifloor(vec2 v) { return floor(v); }\n\n#else\n  // use native integer math\n\tprecision highp int;\n\t#define INT(x) x\n\n\tint ifloor(float v) { return int(v); }\n\tint ifloor(int v) { return v; }\n\tivec2 ifloor(vec2 v) { return ivec2(v); }\n\n#endif\n\nuniform sampler2D uSamplerStrokes;\nuniform sampler2D uSamplerRowStrokes;\nuniform sampler2D uSamplerRows;\nuniform sampler2D uSamplerColStrokes;\nuniform sampler2D uSamplerCols;\n\nuniform ivec2 uStrokeImageSize;\nuniform ivec2 uCellsImageSize;\nuniform ivec2 uGridImageSize;\n\nuniform ivec2 uGridOffset;\nuniform ivec2 uGridSize;\nuniform vec4 uMaterialColor;\n\nIN vec2 vTexCoord;\n\n// some helper functions\nint ROUND(float v) { return ifloor(v + 0.5); }\nivec2 ROUND(vec2 v) { return ifloor(v + 0.5); }\nfloat saturate(float v) { return clamp(v, 0.0, 1.0); }\nvec2 saturate(vec2 v) { return clamp(v, 0.0, 1.0); }\n\nint mul(float v1, int v2) {\n  return ifloor(v1 * float(v2));\n}\n\nivec2 mul(vec2 v1, ivec2 v2) {\n  return ifloor(v1 * vec2(v2) + 0.5);\n}\n\n// unpack a 16-bit integer from a float vec2\nint getInt16(vec2 v) {\n  ivec2 iv = ROUND(v * 255.0);\n  return iv.x * INT(128) + iv.y;\n}\n\nvec2 pixelScale;\nvec2 coverage = vec2(0.0);\nvec2 weight = vec2(0.5);\nconst float minDistance = 1.0/8192.0;\nconst float hardness = 1.05; // amount of antialias\n\n// the maximum number of curves in a glyph\nconst int N = INT(250);\n\n// retrieves an indexed pixel from a sampler\nvec4 getTexel(sampler2D sampler, int pos, ivec2 size) {\n  int width = size.x;\n  int y = ifloor(pos / width);\n  int x = pos - y * width;  // pos % width\n\n  return TEXTURE(sampler, (vec2(x, y) + 0.5) / vec2(size));\n}\n\nvoid calulateCrossings(vec2 p0, vec2 p1, vec2 p2, out vec2 C1, out vec2 C2) {\n\n  // get the coefficients of the quadratic in t\n  vec2 a = p0 - p1 * 2.0 + p2;\n  vec2 b = p0 - p1;\n  vec2 c = p0 - vTexCoord;\n\n  // found out which values of 't' it crosses the axes\n  vec2 surd = sqrt(max(vec2(0.0), b * b - a * c));\n  vec2 t1 = ((b - surd) / a).yx;\n  vec2 t2 = ((b + surd) / a).yx;\n\n  // approximate straight lines to avoid rounding errors\n  if (abs(a.y) < 0.001)\n    t1.x = t2.x = c.y / (2.0 * b.y);\n\n  if (abs(a.x) < 0.001)\n    t1.y = t2.y = c.x / (2.0 * b.x);\n\n  // plug into quadratic formula to find the corrdinates of the crossings\n  C1 = ((a * t1 - b * 2.0) * t1 + c) * pixelScale;\n  C2 = ((a * t2 - b * 2.0) * t2 + c) * pixelScale;\n}\n\nvoid coverageX(vec2 p0, vec2 p1, vec2 p2) {\n\n  vec2 C1, C2;\n  calulateCrossings(p0, p1, p2, C1, C2);\n\n  // determine on which side of the x-axis the points lie\n  bool y0 = p0.y > vTexCoord.y;\n  bool y1 = p1.y > vTexCoord.y;\n  bool y2 = p2.y > vTexCoord.y;\n\n  // could web be under the curve (after t1)?\n  if (y1 ? !y2 : y0) {\n    // add the coverage for t1\n    coverage.x += saturate(C1.x + 0.5);\n    // calculate the anti-aliasing for t1\n    weight.x = min(weight.x, abs(C1.x));\n  }\n\n  // are we outside the curve (after t2)?\n  if (y1 ? !y0 : y2) {\n    // subtract the coverage for t2\n    coverage.x -= saturate(C2.x + 0.5);\n    // calculate the anti-aliasing for t2\n    weight.x = min(weight.x, abs(C2.x));\n  }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n  vec2 C1, C2;\n  calulateCrossings(p0, p1, p2, C1, C2);\n\n  bool x0 = p0.x > vTexCoord.x;\n  bool x1 = p1.x > vTexCoord.x;\n  bool x2 = p2.x > vTexCoord.x;\n\n  if (x1 ? !x2 : x0) {\n    coverage.y -= saturate(C1.y + 0.5);\n    weight.y = min(weight.y, abs(C1.y));\n  }\n\n  if (x1 ? !x0 : x2) {\n    coverage.y += saturate(C2.y + 0.5);\n    weight.y = min(weight.y, abs(C2.y));\n  }\n}\n\nvoid main() {\n\n  // calculate the pixel scale based on screen-coordinates\n  pixelScale = hardness / fwidth(vTexCoord);\n\n  // which grid cell is this pixel in?\n  ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n  // intersect curves in this row\n  {\n    // the index into the row info bitmap\n    int rowIndex = gridCoord.y + uGridOffset.y;\n    // fetch the info texel\n    vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n    // unpack the rowInfo\n    int rowStrokeIndex = getInt16(rowInfo.xy);\n    int rowStrokeCount = getInt16(rowInfo.zw);\n\n    for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n      if (iRowStroke >= rowStrokeCount)\n        break;\n\n      // each stroke is made up of 3 points: the start and control point\n      // and the start of the next curve.\n      // fetch the indices of this pair of strokes:\n      vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n      // unpack the stroke index\n      int strokePos = getInt16(strokeIndices.xy);\n\n      // fetch the two strokes\n      vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n      vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n      // calculate the coverage\n      coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n    }\n  }\n\n  // intersect curves in this column\n  {\n    int colIndex = gridCoord.x + uGridOffset.x;\n    vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n    int colStrokeIndex = getInt16(colInfo.xy);\n    int colStrokeCount = getInt16(colInfo.zw);\n    \n    for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n      if (iColStroke >= colStrokeCount)\n        break;\n\n      vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n      int strokePos = getInt16(strokeIndices.xy);\n      vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n      vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n      coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n    }\n  }\n\n  weight = saturate(1.0 - weight * 2.0);\n  float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n  float antialias = abs(dot(coverage, weight) / distance);\n  float cover = min(abs(coverage.x), abs(coverage.y));\n  OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n  OUT_COLOR *= saturate(max(antialias, cover));\n}\n",lineVert:S+"/*\n  Part of the Processing project - http://processing.org\n  Copyright (c) 2012-15 The Processing Foundation\n  Copyright (c) 2004-12 Ben Fry and Casey Reas\n  Copyright (c) 2001-04 Massachusetts Institute of Technology\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation, version 2.1.\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n  Lesser General Public License for more details.\n  You should have received a copy of the GNU Lesser General\n  Public License along with this library; if not, write to the\n  Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n  Boston, MA  02111-1307  USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nIN vec4 aPosition;\nIN vec3 aTangentIn;\nIN vec3 aTangentOut;\nIN float aSide;\nIN vec4 aVertexColor;\n\nOUT vec4 vColor;\nOUT vec2 vTangent;\nOUT vec2 vCenter;\nOUT vec2 vPosition;\nOUT float vMaxDist;\nOUT float vCap;\nOUT float vJoin;\nOUT float vStrokeWeight;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n  // Rotate and translate so a starts at the origin and goes out to the right\n  bPoint -= aPoint;\n  vec2 rotatedBFrom = vec2(\n    bPoint.x*aDir.x + bPoint.y*aDir.y,\n    bPoint.y*aDir.x - bPoint.x*aDir.y\n  );\n  vec2 bTo = bPoint + bDir;\n  vec2 rotatedBTo = vec2(\n    bTo.x*aDir.x + bTo.y*aDir.y,\n    bTo.y*aDir.x - bTo.x*aDir.y\n  );\n  float intersectionDistance =\n    rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n    (rotatedBTo.y - rotatedBFrom.y);\n  return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n  HOOK_beforeVertex();\n  // Caps have one of either the in or out tangent set to 0\n  vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n    ? 1. : 0.;\n\n  // Joins have two unique, defined tangents\n  vJoin = (\n    aTangentIn != vec3(0.) &&\n    aTangentOut != vec3(0.) &&\n    aTangentIn != aTangentOut\n  ) ? 1. : 0.;\n\n  vec4 localPosition = vec4(HOOK_getLocalPosition(aPosition.xyz), 1.);\n  vec4 posp = vec4(HOOK_getWorldPosition((uModelViewMatrix * localPosition).xyz), 1.);\n  vec4 posqIn = posp + uModelViewMatrix * vec4(aTangentIn, 0);\n  vec4 posqOut = posp + uModelViewMatrix * vec4(aTangentOut, 0);\n  float strokeWeight = HOOK_getStrokeWeight(uStrokeWeight);\n  vStrokeWeight = strokeWeight;\n\n  float facingCamera = pow(\n    // The word space tangent's z value is 0 if it's facing the camera\n    abs(normalize(posqIn-posp).z),\n\n    // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n    // so most lines get scaled and don't get clipped\n    0.25\n  );\n\n  // Moving vertices slightly toward the camera\n  // to avoid depth-fighting with the fill triangles.\n  // A mix of scaling and offsetting is used based on distance\n  // Discussion here:\n  // https://github.com/processing/p5.js/issues/7200 \n\n  // using a scale <1 moves the lines towards nearby camera\n  // in order to prevent popping effects due to half of\n  // the line disappearing behind the geometry faces.\n  float zDistance = -posp.z; \n  float distanceFactor = smoothstep(0.0, 800.0, zDistance); \n  \n  // Discussed here:\n  // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848  \n  float scale = mix(1., 0.995, facingCamera);\n  float dynamicScale = mix(scale, 1.0, distanceFactor); // Closer = more scale, farther = less\n\n  posp.xyz = posp.xyz * dynamicScale;\n  posqIn.xyz = posqIn.xyz * dynamicScale;\n  posqOut.xyz = posqOut.xyz * dynamicScale;\n\n  // Moving vertices slightly toward camera when far away \n  // https://github.com/processing/p5.js/issues/6956 \n  float zOffset = mix(-0.00045, -1., facingCamera);\n  float dynamicZAdjustment = mix(0.0, zOffset, distanceFactor); // Closer = less zAdjustment, farther = more\n\n  posp.z -= dynamicZAdjustment;\n  posqIn.z -= dynamicZAdjustment;\n  posqOut.z -= dynamicZAdjustment;\n  \n  vec4 p = uProjectionMatrix * posp;\n  vec4 qIn = uProjectionMatrix * posqIn;\n  vec4 qOut = uProjectionMatrix * posqOut;\n  vCenter = HOOK_getLineCenter(p.xy);\n\n  // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n  // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n  // prevent division by W by transforming the tangent formula (div by 0 causes\n  // the line to disappear, see https://github.com/processing/processing/issues/5183)\n  // t = screen_q - screen_p\n  //\n  // tangent is normalized and we don't care which aDirection it points to (+-)\n  // t = +- normalize( screen_q - screen_p )\n  // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n  //\n  // extract common factor, <1,1> - <1,1> cancels out\n  // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n  //\n  // convert to common divisor\n  // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n  //\n  // remove the common scalar divisor/factor, not needed due to normalize and +-\n  // (keep uViewport - can't remove because it has different components for x and y\n  //  and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n  // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n  vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n  vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n  vec2 curPerspScale;\n  if(uPerspective == 1) {\n    // Perspective ---\n    // convert from world to clip by multiplying with projection scaling factor\n    // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n    // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n    // Multiplying again by its sign here negates the flip to get just the scale.\n    curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n  } else {\n    // No Perspective ---\n    // multiply by W (to cancel out division by W later in the pipeline) and\n    // convert from screen to clip (derived from clip to screen above)\n    curPerspScale = p.w / (0.5 * uViewport.zw);\n  }\n\n  vec2 offset;\n  if (vJoin == 1.) {\n    vTangent = normalize(tangentIn + tangentOut);\n    vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n    vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n    float side = sign(aSide);\n    float sideEnum = abs(aSide);\n\n    // We generate vertices for joins on either side of the centerline, but\n    // the \"elbow\" side is the only one needing a join. By not setting the\n    // offset for the other side, all its vertices will end up in the same\n    // spot and not render, effectively discarding it.\n    if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n      // Side enums:\n      //   1: the side going into the join\n      //   2: the middle of the join\n      //   3: the side going out of the join\n      if (sideEnum == 2.) {\n        // Calculate the position + tangent on either side of the join, and\n        // find where the lines intersect to find the elbow of the join\n        vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n        vec2 intersection = lineIntersection(\n          c + (side * normalIn * strokeWeight / 2.),\n          tangentIn,\n          c + (side * normalOut * strokeWeight / 2.),\n          tangentOut\n        );\n        offset = (intersection - c);\n\n        // When lines are thick and the angle of the join approaches 180, the\n        // elbow might be really far from the center. We'll apply a limit to\n        // the magnitude to avoid lines going across the whole screen when this\n        // happens.\n        float mag = length(offset);\n        float maxMag = 3. * strokeWeight;\n        if (mag > maxMag) {\n          offset *= maxMag / mag;\n        }\n      } else if (sideEnum == 1.) {\n        offset = side * normalIn * strokeWeight / 2.;\n      } else if (sideEnum == 3.) {\n        offset = side * normalOut * strokeWeight / 2.;\n      }\n    }\n    if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n      vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n      vMaxDist = abs(dot(avgNormal, normalIn * strokeWeight / 2.));\n    } else {\n      vMaxDist = strokeWeight / 2.;\n    }\n  } else {\n    vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n    vTangent = tangent;\n    vec2 normal = vec2(-tangent.y, tangent.x);\n\n    float normalOffset = sign(aSide);\n    // Caps will have side values of -2 or 2 on the edge of the cap that\n    // extends out from the line\n    float tangentOffset = abs(aSide) - 1.;\n    offset = (normal * normalOffset + tangent * tangentOffset) *\n      strokeWeight * 0.5;\n    vMaxDist = strokeWeight / 2.;\n  }\n  vPosition = HOOK_getLinePosition(vCenter + offset);\n\n  gl_Position.xy = p.xy + offset.xy * curPerspScale;\n  gl_Position.zw = p.zw;\n  \n  vColor = HOOK_getVertexColor(uUseLineColor ? aVertexColor : uMaterialColor);\n  HOOK_afterVertex();\n}\n",lineFrag:S+"precision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\n\nIN vec4 vColor;\nIN vec2 vTangent;\nIN vec2 vCenter;\nIN vec2 vPosition;\nIN float vStrokeWeight;\nIN float vMaxDist;\nIN float vCap;\nIN float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n  vec2 aToB = b - a;\n  return dot(aToB, aToB);\n}\n\nstruct Inputs {\n  vec4 color;\n  vec2 tangent;\n  vec2 center;\n  vec2 position;\n  float strokeWeight;\n};\n\nvoid main() {\n  HOOK_beforeFragment();\n\n  Inputs inputs;\n  inputs.color = vColor;\n  inputs.tangent = vTangent;\n  inputs.center = vCenter;\n  inputs.position = vPosition;\n  inputs.strokeWeight = vStrokeWeight;\n  inputs = HOOK_getPixelInputs(inputs);\n\n  if (vCap > 0.) {\n    if (\n      uStrokeCap == STROKE_CAP_ROUND &&\n      HOOK_shouldDiscard(distSquared(inputs.position, inputs.center) > inputs.strokeWeight * inputs.strokeWeight * 0.25)\n    ) {\n      discard;\n    } else if (\n      uStrokeCap == STROKE_CAP_SQUARE &&\n      HOOK_shouldDiscard(dot(inputs.position - inputs.center, inputs.tangent) > 0.)\n    ) {\n      discard;\n    // Use full area for PROJECT\n    } else if (HOOK_shouldDiscard(false)) {\n      discard;\n    }\n  } else if (vJoin > 0.) {\n    if (\n      uStrokeJoin == STROKE_JOIN_ROUND &&\n      HOOK_shouldDiscard(distSquared(inputs.position, inputs.center) > inputs.strokeWeight * inputs.strokeWeight * 0.25)\n    ) {\n      discard;\n    } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n      vec2 normal = vec2(-inputs.tangent.y, inputs.tangent.x);\n      if (HOOK_shouldDiscard(abs(dot(inputs.position - inputs.center, normal)) > vMaxDist)) {\n        discard;\n      }\n    // Use full area for MITER\n    } else if (HOOK_shouldDiscard(false)) {\n      discard;\n    }\n  }\n  OUT_COLOR = HOOK_getFinalColor(vec4(inputs.color.rgb, 1.) * inputs.color.a);\n  HOOK_afterFragment();\n}\n",pointVert:"IN vec3 aPosition;\nuniform float uPointSize;\nOUT float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nvoid main() {\n  HOOK_beforeVertex();\n  vec4 viewModelPosition = vec4(HOOK_getWorldPosition(\n    (uModelViewMatrix * vec4(HOOK_getLocalPosition(aPosition), 1.0)).xyz\n  ), 1.);\n  gl_Position = uProjectionMatrix * viewModelPosition;  \n\n  float pointSize = HOOK_getPointSize(uPointSize);\n\n\tgl_PointSize = pointSize;\n\tvStrokeWeight = pointSize;\n  HOOK_afterVertex();\n}\n",pointFrag:"precision mediump int;\nuniform vec4 uMaterialColor;\nIN float vStrokeWeight;\n\nvoid main(){\n  HOOK_beforeFragment();\n  float mask = 0.0;\n\n  // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n  // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n  mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n  // if strokeWeight is 1 or less lets just draw a square\n  // this prevents weird artifacting from carving circles when our points are really small\n  // if strokeWeight is larger than 1, we just use it as is\n\n  mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n  // throw away the borders of the mask\n  // otherwise we get weird alpha blending issues\n\n  if(HOOK_shouldDiscard(mask > 0.98)){\n    discard;\n  }\n\n  OUT_COLOR = HOOK_getFinalColor(vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a);\n  HOOK_afterFragment();\n}\n",imageLightVert:"precision highp float;\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nvarying vec3 localPos;\nvarying vec3 vWorldNormal;\nvarying vec3 vWorldPosition;\nvarying vec2 vTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvoid main() {\n  // Multiply the position by the matrix.\n  vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n  gl_Position = uProjectionMatrix * viewModelPosition;  \n  \n  // orient the normals and pass to the fragment shader\n  vWorldNormal = uNormalMatrix * aNormal;\n  \n  // send the view position to the fragment shader\n  vWorldPosition = (uModelViewMatrix * vec4(aPosition, 1.0)).xyz;\n  \n  localPos = vWorldPosition;\n  vTexCoord = aTexCoord;\n}\n\n\n/*\nin the vertex shader we'll compute the world position and world oriented normal of the vertices and pass those to the fragment shader as varyings.\n*/\n",imageLightDiffusedFrag:"precision highp float;\nvarying vec3 localPos;\n\n// the HDR cubemap converted (can be from an equirectangular environment map.)\nuniform sampler2D environmentMap;\nvarying vec2 vTexCoord;\n\nconst float PI = 3.14159265359;\n\nvec2 nTOE( vec3 v ){\n  // x = r sin(phi) cos(theta)   \n  // y = r cos(phi)  \n  // z = r sin(phi) sin(theta)\n  float phi = acos( v.y );\n  // if phi is 0, then there are no x, z components\n  float theta = 0.0;\n  // else \n  theta = acos(v.x / sin(phi));\n  float sinTheta = v.z / sin(phi);\n  if (sinTheta < 0.0) {\n    // Turn it into -theta, but in the 0-2PI range\n    theta = 2.0 * PI - theta;\n  }\n  theta = theta / (2.0 * 3.14159);\n  phi = phi / 3.14159 ;\n  \n  vec2 angles = vec2( phi, theta );\n  return angles;\n}\n\nfloat random(vec2 p) {\n  vec3 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{   \t \n\t// the sample direction equals the hemisphere's orientation\n  float phi = vTexCoord.x * 2.0 * PI;\n  float theta = vTexCoord.y * PI;\n  float x = sin(theta) * cos(phi);\n  float y = sin(theta) * sin(phi);\n  float z = cos(theta);\n  vec3 normal = vec3( x, y, z);\n\n\t// Discretely sampling the hemisphere given the integral's\n  // spherical coordinates translates to the following fragment code:\n\tvec3 irradiance = vec3(0.0);  \n\tvec3 up\t= vec3(0.0, 1.0, 0.0);\n\tvec3 right = normalize(cross(up, normal));\n\tup = normalize(cross(normal, right));\n\n\t//  We specify a fixed sampleDelta delta value to traverse\n  // the hemisphere; decreasing or increasing the sample delta\n  // will increase or decrease the accuracy respectively.\n\tconst float sampleDelta = 0.100;\n\tfloat nrSamples = 0.0;\n  float randomOffset = random(gl_FragCoord.xy) * sampleDelta;\n\tfor(float rawPhi = 0.0; rawPhi < 2.0 * PI; rawPhi += sampleDelta)\n\t{\n    float phi = rawPhi + randomOffset;\n    for(float rawTheta = 0.0; rawTheta < ( 0.5 ) * PI; rawTheta += sampleDelta)\n    {\n      float theta = rawTheta + randomOffset;\n      // spherical to cartesian (in tangent space) // tangent space to world // add each sample result to irradiance\n      float x = sin(theta) * cos(phi);\n      float y = sin(theta) * sin(phi);\n      float z = cos(theta);\n      vec3 tangentSample = vec3( x, y, z);\n      \n      vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * normal;\n        irradiance += (texture2D(environmentMap, nTOE(sampleVec)).xyz) * cos(theta) * sin(theta);\n      nrSamples++;\n    }\n\t}\n\t// divide by the total number of samples taken, giving us the average sampled irradiance.\n\tirradiance = PI * irradiance * (1.0 / float(nrSamples )) ;\n  \n \n\tgl_FragColor = vec4(irradiance, 1.0);\n}",imageLightSpecularFrag:"precision highp float;\r\nvarying vec3 localPos;\r\nvarying vec2 vTexCoord;\r\n\r\n// our texture\r\nuniform sampler2D environmentMap;\r\nuniform float roughness;\r\n\r\nconst float PI = 3.14159265359;\r\n\r\nfloat VanDerCorput(int bits);\r\nvec2 HammersleyNoBitOps(int i, int N);\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness);\r\n\r\n\r\nvec2 nTOE( vec3 v ){\r\n  // x = r sin(phi) cos(theta)   \r\n  // y = r cos(phi)  \r\n  // z = r sin(phi) sin(theta)\r\n  float phi = acos( v.y );\r\n  // if phi is 0, then there are no x, z components\r\n  float theta = 0.0;\r\n  // else \r\n  theta = acos(v.x / sin(phi));\r\n  float sinTheta = v.z / sin(phi);\r\n  if (sinTheta < 0.0) {\r\n    // Turn it into -theta, but in the 0-2PI range\r\n    theta = 2.0 * PI - theta;\r\n  }\r\n  theta = theta / (2.0 * 3.14159);\r\n  phi = phi / 3.14159 ;\r\n  \r\n  vec2 angles = vec2( phi, theta );\r\n  return angles;\r\n}\r\n\r\n\r\nvoid main(){\r\n  const int SAMPLE_COUNT = 400; // 4096\r\n  int lowRoughnessLimit = int(pow(2.0,(roughness+0.1)*20.0));\r\n  float totalWeight = 0.0;\r\n  vec3 prefilteredColor = vec3(0.0);\r\n  float phi = vTexCoord.x * 2.0 * PI;\r\n  float theta = vTexCoord.y * PI;\r\n  float x = sin(theta) * cos(phi);\r\n  float y = sin(theta) * sin(phi);\r\n  float z = cos(theta);\r\n  vec3 N = vec3(x,y,z);\r\n  vec3 V = N;\r\n  for (int i = 0; i < SAMPLE_COUNT; ++i)\r\n  {\r\n    // break at smaller sample numbers for low roughness levels\r\n    if(i == lowRoughnessLimit)\r\n    {\r\n      break;\r\n    }\r\n    vec2 Xi = HammersleyNoBitOps(i, SAMPLE_COUNT);\r\n    vec3 H = ImportanceSampleGGX(Xi, N, roughness);\r\n    vec3 L = normalize(2.0 * dot(V, H) * H - V);\r\n\r\n    float NdotL = max(dot(N, L), 0.0);\r\n    if (NdotL > 0.0)\r\n    {\r\n      prefilteredColor += texture2D(environmentMap, nTOE(L)).xyz * NdotL;\r\n      totalWeight += NdotL;\r\n    }\r\n  }\r\n  prefilteredColor = prefilteredColor / totalWeight;\r\n\r\n  gl_FragColor = vec4(prefilteredColor, 1.0);\r\n}\r\n\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness){\r\n  float a = roughness * roughness;\r\n\r\n  float phi = 2.0 * PI * Xi.x;\r\n  float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a * a - 1.0) * Xi.y));\r\n  float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\r\n  // from spherical coordinates to cartesian coordinates\r\n  vec3 H;\r\n  H.x = cos(phi) * sinTheta;\r\n  H.y = sin(phi) * sinTheta;\r\n  H.z = cosTheta;\r\n\r\n  // from tangent-space vector to world-space sample vector\r\n  vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\r\n  vec3 tangent = normalize(cross(up, N));\r\n  vec3 bitangent = cross(N, tangent);\r\n\r\n  vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;\r\n  return normalize(sampleVec);\r\n}\r\n\r\n\r\nfloat VanDerCorput(int n, int base)\r\n{\r\n#ifdef WEBGL2\r\n\r\n    uint bits = uint(n);\r\n    bits = (bits << 16u) | (bits >> 16u);\r\n    bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\r\n    bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\r\n    bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\r\n    bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\r\n    return float(bits) * 2.3283064365386963e-10; // / 0x100000000\r\n\r\n#else\r\n\r\n  float invBase = 1.0 / float(base);\r\n  float denom = 1.0;\r\n  float result = 0.0;\r\n\r\n\r\n  for (int i = 0; i < 32; ++i)\r\n  {\r\n        if (n > 0)\r\n        {\r\n        denom = mod(float(n), 2.0);\r\n        result += denom * invBase;\r\n        invBase = invBase / 2.0;\r\n        n = int(float(n) / 2.0);\r\n        }\r\n  }\r\n\r\n\r\n  return result;\r\n\r\n#endif\r\n}\r\n\r\nvec2 HammersleyNoBitOps(int i, int N)\r\n{\r\n  return vec2(float(i) / float(N), VanDerCorput(i, 2));\r\n}\r\n"},T=M.sphereMappingFrag;for(_ in M)M[_]="#ifdef WEBGL2\n\n#define IN in\n#define OUT out\n\n#ifdef FRAGMENT_SHADER\nout vec4 outColor;\n#define OUT_COLOR outColor\n#endif\n#define TEXTURE texture\n\n#else\n\n#ifdef FRAGMENT_SHADER\n#define IN varying\n#else\n#define IN attribute\n#endif\n#define OUT varying\n#define TEXTURE texture2D\n\n#ifdef FRAGMENT_SHADER\n#define OUT_COLOR gl_FragColor\n#endif\n\n#endif\n"+M[_];g(e={},s.GRAY,"precision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nfloat luma(vec3 color) {\n  // weighted grayscale with luminance values\n  return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n  vec4 tex = texture2D(tex0, vTexCoord);\n  float gray = luma(tex.rgb);\n  gl_FragColor = vec4(gray, gray, gray, tex.a);\n}\n"),g(e,s.ERODE,"// Reduces the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n  // weighted grayscale with luminance values\n  // weights 77, 151, 28 taken from src/image/filters.js\n  return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n  vec4 color = texture2D(tex0, vTexCoord);\n  float lum = luma(color.rgb);\n\n  // set current color as the darkest neighbor color\n\n  vec4 neighbors[4];\n  neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n  neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n  neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0,  texelSize.y));\n  neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n  for (int i = 0; i < 4; i++) {\n    vec4 neighborColor = neighbors[i];\n    float neighborLum = luma(neighborColor.rgb);\n\n    if (neighborLum < lum) {\n      color = neighborColor;\n      lum = neighborLum;\n    }\n  }\n\n  gl_FragColor = color;\n}\n"),g(e,s.DILATE,"// Increase the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n  // weighted grayscale with luminance values\n  // weights 77, 151, 28 taken from src/image/filters.js\n  return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n  vec4 color = texture2D(tex0, vTexCoord);\n  float lum = luma(color.rgb);\n\n  // set current color as the brightest neighbor color\n\n  vec4 neighbors[4];\n  neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n  neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n  neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0,  texelSize.y));\n  neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n  for (int i = 0; i < 4; i++) {\n    vec4 neighborColor = neighbors[i];\n    float neighborLum = luma(neighborColor.rgb);\n\n    if (neighborLum > lum) {\n      color = neighborColor;\n      lum = neighborLum;\n    }\n  }\n\n  gl_FragColor = color;\n}\n"),g(e,s.BLUR,"precision highp float;\n\n// Two-pass blur filter, unweighted kernel.\n// See also a similar blur at Adam Ferriss' repo of shader examples:\n// https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag\n\n\nuniform sampler2D tex0;\nvarying vec2 vTexCoord;\nuniform vec2 direction;\nuniform vec2 canvasSize;\nuniform float radius;\n\nfloat random(vec2 p) {\n  vec3 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\n// This isn't a real Gaussian weight, it's a quadratic weight. It's what the\n// CPU mode's blur uses though, so we also use it here to match.\nfloat quadWeight(float x, float e) {\n  return pow(e-abs(x), 2.);\n}\n\nvoid main(){\n  vec2 uv = vTexCoord;\n\n  // A reasonable maximum number of samples\n  const float maxSamples = 64.0;\n\n  float numSamples = floor(7. * radius);\n  if (fract(numSamples / 2.) == 0.) {\n    numSamples++;\n  }\n  vec4 avg = vec4(0.0);\n  float total = 0.0;\n\n  // Calculate the spacing to avoid skewing if numSamples > maxSamples\n  float spacing = 1.0;\n  if (numSamples > maxSamples) {\n    spacing = numSamples / maxSamples;\n    numSamples = maxSamples;\n  }\n\n  float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy));\n  for (float i = 0.0; i < maxSamples; i++) {\n    if (i >= numSamples) break;\n\n    float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset;\n    vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction;\n    float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing);\n\n    avg += weight * texture2D(tex0, sampleCoord);\n    total += weight;\n  }\n\n  avg /= total;\n  gl_FragColor = avg;\n}\n"),g(e,s.POSTERIZE,"// Limit color space for a stylized cartoon / poster effect\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nvec3 quantize(vec3 color, float n) {\n  // restrict values to N options/bins\n  // and floor each channel to nearest value\n  //\n  // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0\n  // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0)\n\n  color = color * n;\n  color = floor(color);\n  color = color / (n - 1.0);\n  return color;\n}\n\nvoid main() {\n  vec4 color = texture2D(tex0, vTexCoord);\n\n  vec3 restrictedColor = quantize(color.rgb / color.a, filterParameter);\n\n  gl_FragColor = vec4(restrictedColor.rgb * color.a, color.a);\n}\n"),g(e,s.OPAQUE,"// Set alpha channel to entirely opaque\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n  vec4 color = texture2D(tex0, vTexCoord);\n  gl_FragColor = vec4(color.rgb / color.a, 1.0);\n}\n"),g(e,s.INVERT,"// Set each pixel to inverse value\n// Note that original INVERT does not change the opacity, so this follows suit\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\nvec4 color = texture2D(tex0, vTexCoord);\nvec3 origColor = color.rgb / color.a;\nvec3 invertedColor = vec3(1.0) - origColor;\ngl_FragColor = vec4(invertedColor * color.a, color.a);\n}\n"),g(e,s.THRESHOLD,"// Convert pixels to either white or black, \n// depending on if their luma is above or below filterParameter\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nfloat luma(vec3 color) {\n  // weighted grayscale with luminance values\n  return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n  vec4 color = texture2D(tex0, vTexCoord);\n  float gray = luma(color.rgb / color.a);\n  // floor() used to match src/image/filters.js\n  float threshold = floor(filterParameter * 255.0) / 255.0;\n  float blackOrWhite = step(threshold, gray);\n  gl_FragColor = vec4(vec3(blackOrWhite) * color.a, color.a);\n}\n");var E=e;function j(e,t,r,n,i,o,s,a,l,c){var u=t.getParameter(t.FRAMEBUFFER_BINDING),h=o*s*(t.bindFramebuffer(t.FRAMEBUFFER,r),r=a===t.RGBA?4:3),d=l===t.UNSIGNED_BYTE?Uint8Array:Float32Array;if(e instanceof d&&e.length===h||(e=new d(h)),t.readPixels(n,c?c-i-s:i,o,s,a,l,e),t.bindFramebuffer(t.FRAMEBUFFER,u),c)for(var p=Math.floor(s/2),f=new d(o*r),m=0;m<p;m++){var y=m*o*4,g=(s-m-1)*o*4;f.set(e.subarray(y,y+4*o)),e.copyWithin(y,g,g+4*o),e.set(f,g)}return e}function A(e,t,r,n,i,o,s){var a=e.getParameter(e.FRAMEBUFFER_BINDING);return e.bindFramebuffer(e.FRAMEBUFFER,t),t=i===e.RGBA?4:3,t=new(o===e.UNSIGNED_BYTE?Uint8Array:Float32Array)(t),e.readPixels(r,s?s-n-1:n,1,1,i,o,t),e.bindFramebuffer(e.FRAMEBUFFER,a),Array.from(t)}o.default.prototype.setAttributes=function(e,t){if(void 0===this._glAttributes)console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.");else{var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var n in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(n))return void o.default._friendlyError("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}},o.default.RendererGL=function(e){var t=n;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e);var r=function(e){return function(){var t,r,n=y(e);return t=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),1}catch(e){}}}()?(t=y(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(r=t)||"object"!==i(r)&&"function"!=typeof r?m(n):r}}(n);function n(e,t,i,a){if(this instanceof n)return(e=r.call(this,e,t,i))._setAttributeDefaults(t),e._initContext(),e.isP3D=!0,e.geometryBuilder=void 0,e.GL=e.drawingContext,e._pInst._setProperty("drawingContext",e.drawingContext),e._isErasing=!1,e._clipDepths=[],e._isClipApplied=!1,e._stencilTestOn=!1,e._enableLighting=!1,e.ambientLightColors=[],e.mixedAmbientLight=[],e.mixedSpecularColor=[],e.specularColors=[1,1,1],e.directionalLightDirections=[],e.directionalLightDiffuseColors=[],e.directionalLightSpecularColors=[],e.pointLightPositions=[],e.pointLightDiffuseColors=[],e.pointLightSpecularColors=[],e.spotLightPositions=[],e.spotLightDirections=[],e.spotLightDiffuseColors=[],e.spotLightSpecularColors=[],e.spotLightAngle=[],e.spotLightConc=[],e.activeImageLight=null,e.diffusedTextures=new Map,e.specularTextures=new Map,e.drawMode=s.FILL,e.curFillColor=e._cachedFillStyle=[1,1,1,1],e.curAmbientColor=e._cachedFillStyle=[1,1,1,1],e.curSpecularColor=e._cachedFillStyle=[0,0,0,0],e.curEmissiveColor=e._cachedFillStyle=[0,0,0,0],e.curStrokeColor=e._cachedStrokeStyle=[0,0,0,1],e.curBlendMode=s.BLEND,e.preEraseBlend=void 0,e._cachedBlendMode=void 0,e.webglVersion===s.WEBGL2?e.blendExt=e.GL:e.blendExt=e.GL.getExtension("EXT_blend_minmax"),e._isBlending=!1,e._hasSetAmbient=!1,e._useSpecularMaterial=!1,e._useEmissiveMaterial=!1,e._useNormalMaterial=!1,e._useShininess=1,e._useMetalness=0,e._useLineColor=!1,e._useVertexColor=!1,e.registerEnabled=new Set,e._tint=[255,255,255,255],e.constantAttenuation=1,e.linearAttenuation=0,e.quadraticAttenuation=0,e.uModelMatrix=new o.default.Matrix,e.uViewMatrix=new o.default.Matrix,e.uMVMatrix=new o.default.Matrix,e.uPMatrix=new o.default.Matrix,e.uNMatrix=new o.default.Matrix("mat3"),e.curMatrix=new o.default.Matrix("mat3"),e._currentNormal=new o.default.Vector(0,0,1),e._curCamera=new o.default.Camera(m(e)),e._curCamera._computeCameraDefaultSettings(),e._curCamera._setDefaultCamera(),e.filterCamera=new o.default.Camera(m(e)),e.filterCamera._computeCameraDefaultSettings(),e.filterCamera._setDefaultCamera(),e.prevTouches=[],e.zoomVelocity=0,e.rotateVelocity=new o.default.Vector(0,0),e.moveVelocity=new o.default.Vector(0,0),e.executeZoom=!1,e.executeRotateAndMove=!1,e.specularShader=void 0,e.sphereMapping=void 0,e.diffusedShader=void 0,e._defaultLightShader=void 0,e._defaultImmediateModeShader=void 0,e._defaultNormalShader=void 0,e._defaultColorShader=void 0,e._defaultPointShader=void 0,e.userFillShader=void 0,e.userStrokeShader=void 0,e.userPointShader=void 0,e.retainedMode={geometry:{},buffers:{stroke:[new o.default.RenderBuffer(4,"lineVertexColors","lineColorBuffer","aVertexColor",m(e)),new o.default.RenderBuffer(3,"lineVertices","lineVerticesBuffer","aPosition",m(e)),new o.default.RenderBuffer(3,"lineTangentsIn","lineTangentsInBuffer","aTangentIn",m(e)),new o.default.RenderBuffer(3,"lineTangentsOut","lineTangentsOutBuffer","aTangentOut",m(e)),new o.default.RenderBuffer(1,"lineSides","lineSidesBuffer","aSide",m(e))],fill:[new o.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",m(e),e._vToNArray),new o.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",m(e),e._vToNArray),new o.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",m(e)),new o.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",m(e)),new o.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",m(e),e._flatten)],text:[new o.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",m(e),e._vToNArray),new o.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",m(e),e._flatten)]}},e.immediateMode={geometry:new o.default.Geometry,shapeMode:s.TRIANGLE_FAN,contourIndices:[],_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new o.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",m(e),e._vToNArray),new o.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",m(e),e._vToNArray),new o.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",m(e)),new o.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",m(e)),new o.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",m(e),e._flatten)],stroke:[new o.default.RenderBuffer(4,"lineVertexColors","lineColorBuffer","aVertexColor",m(e)),new o.default.RenderBuffer(3,"lineVertices","lineVerticesBuffer","aPosition",m(e)),new o.default.RenderBuffer(3,"lineTangentsIn","lineTangentsInBuffer","aTangentIn",m(e)),new o.default.RenderBuffer(3,"lineTangentsOut","lineTangentsOutBuffer","aTangentOut",m(e)),new o.default.RenderBuffer(1,"lineSides","lineSidesBuffer","aSide",m(e))],point:e.GL.createBuffer()}},e.pointSize=5,e.curStrokeWeight=1,e.curStrokeCap=s.ROUND,e.curStrokeJoin=s.ROUND,e.textures=new Map,e.framebuffers=new Set,e.activeFramebuffers=[],e.filterShader=void 0,e.filterLayer=void 0,e.filterLayerTemp=void 0,e.defaultFilterShaders={},e.textureMode=s.IMAGE,e.textureWrapX=s.CLAMP,e.textureWrapY=s.CLAMP,e._tex=null,e._curveTightness=6,e._lookUpTableBezier=[],e._lookUpTableQuadratic=[],e._lutBezierDetail=0,e._lutQuadraticDetail=0,e.isProcessingVertices=!1,e._tessy=e._initTessy(),e.fontInfos={},e._curShader=void 0,e;throw new TypeError("Cannot call a class as a function")}return t=n,(e=[{key:"beginGeometry",value:function(){if(this.geometryBuilder)throw new Error("It looks like `beginGeometry()` is being called while another p5.Geometry is already being build.");this.geometryBuilder=new a.default(this)}},{key:"endGeometry",value:function(){var e;if(this.geometryBuilder)return e=this.geometryBuilder.finish(),this.geometryBuilder=void 0,e;throw new Error("Make sure you call beginGeometry() before endGeometry()!")}},{key:"buildGeometry",value:function(e){return this.beginGeometry(),e(),this.endGeometry()}},{key:"_setAttributeDefaults",value:function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!0,preserveDrawingBuffer:!0,perPixelLighting:!0,version:2};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)}},{key:"_initContext",value:function(){if(1!==this._pInst._glAttributes.version&&(this.drawingContext=this.canvas.getContext("webgl2",this._pInst._glAttributes)),this.webglVersion=this.drawingContext?s.WEBGL2:s.WEBGL,this._pInst._setProperty("webglVersion",this.webglVersion),this.drawingContext||(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes)),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}},{key:"_getParam",value:function(){var e=this.drawingContext;return e.getParameter(e.MAX_TEXTURE_SIZE)}},{key:"_adjustDimensions",value:function(e,t){this._maxTextureSize||(this._maxTextureSize=this._getParam());var r=this._maxTextureSize,n=(o.default.prototype._maxAllowedPixelDimensions,r=Math.floor(r/this.pixelDensity()),Math.min(e,r));return r=Math.min(t,r),n===e&&r===t||console.warn("Warning: The requested width/height exceeds hardware limits. "+"Adjusting dimensions to width: ".concat(n,", height: ").concat(r,".")),{adjustedWidth:n,adjustedHeight:r}}},{key:"_resetContext",value:function(e,t){var r,n=this.width,i=this.height,s=this.canvas.id,a=this._pInst instanceof o.default.Graphics;a?((r=this._pInst).canvas.parentNode.removeChild(r.canvas),r.canvas=document.createElement("canvas"),(r._pInst._userNode||document.body).appendChild(r.canvas),o.default.Element.call(r,r.canvas,r._pInst),r.width=n,r.height=i):((r=this.canvas)&&r.parentNode.removeChild(r),(r=document.createElement("canvas")).id=s,(this._pInst._userNode||document.body).appendChild(r),this._pInst.canvas=r,this.canvas=r),s=new o.default.RendererGL(this._pInst.canvas,this._pInst,!a),this._pInst._setProperty("_renderer",s),s.resize(n,i),s._applyDefaults(),a||this._pInst._elements.push(s),"function"==typeof t&&setTimeout((function(){t.apply(window._renderer,e)}),0)}},{key:"_update",value:function(){this.uModelMatrix.reset(),this.uViewMatrix.set(this._curCamera.cameraMatrix),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clearStencil(0),this.GL.clear(this.GL.DEPTH_BUFFER_BIT|this.GL.STENCIL_BUFFER_BIT),this.GL.disable(this.GL.STENCIL_TEST)}},{key:"background",value:function(){var e=(n=(n=this._pInst).color.apply(n,arguments)).levels[0]/255,t=n.levels[1]/255,r=n.levels[2]/255,n=n.levels[3]/255;this.clear(e,t,r,n)}},{key:"fill",value:function(e,t,r,n){var i=o.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=i._array,this.drawMode=s.FILL,this._useNormalMaterial=!1,this._tex=null}},{key:"stroke",value:function(e,t,r,n){var i=o.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=i._array}},{key:"strokeCap",value:function(e){this.curStrokeCap=e}},{key:"strokeJoin",value:function(e){this.curStrokeJoin=e}},{key:"getFilterLayer",value:function(){return this.filterLayer||(this.filterLayer=this._pInst.createFramebuffer()),this.filterLayer}},{key:"getFilterLayerTemp",value:function(){return this.filterLayerTemp||(this.filterLayerTemp=this._pInst.createFramebuffer()),this.filterLayerTemp}},{key:"matchSize",value:function(e,t){e.width===t.width&&e.height===t.height||e.resize(t.width,t.height),e.pixelDensity()!==t.pixelDensity()&&e.pixelDensity(t.pixelDensity())}},{key:"filter",value:function(){var e,t,r=this,n=this.getFilterLayer(),i=void 0,a=void 0,l=("string"==typeof(arguments.length<=0?void 0:arguments[0])?(a=arguments.length<=0?void 0:arguments[0],g(e={},s.BLUR,3),g(e,s.POSTERIZE,4),g(e,s.THRESHOLD,.5),i=a in e&&void 0===(arguments.length<=1?void 0:arguments[1])?e[a]:arguments.length<=1?void 0:arguments[1],a in this.defaultFilterShaders||(this.defaultFilterShaders[a]=new o.default.Shader(n._renderer,"uniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nattribute vec3 aPosition;\n// texcoords only come from p5 to vertex shader\n// so pass texcoords on to the fragment shader in a varying variable\nattribute vec2 aTexCoord;\nvarying vec2 vTexCoord;\n\nvoid main() {\n  // transferring texcoords for the frag shader\n  vTexCoord = aTexCoord;\n\n  // copy position with a fourth coordinate for projection (1.0 is normal)\n  vec4 positionVec4 = vec4(aPosition, 1.0);\n\n  gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n}\n",E[a])),this.filterShader=this.defaultFilterShaders[a]):this.filterShader=arguments.length<=0?void 0:arguments[0],this.activeFramebuffer()||this),c=(this.matchSize(n,l),n.draw((function(){return r._pInst.clear()})),[1/(l.width*l.pixelDensity()),1/(l.height*l.pixelDensity())]);a===s.BLUR?(t=this.getFilterLayerTemp(),this.matchSize(t,l),this._pInst.push(),this._pInst.noStroke(),this._pInst.blendMode(s.BLEND),this._pInst.shader(this.filterShader),this.filterShader.setUniform("texelSize",c),this.filterShader.setUniform("canvasSize",[l.width,l.height]),this.filterShader.setUniform("radius",Math.max(1,i)),t.draw((function(){r.filterShader.setUniform("direction",[1,0]),r.filterShader.setUniform("tex0",l),r._pInst.clear(),r._pInst.shader(r.filterShader),r._pInst.noLights(),r._pInst.plane(l.width,l.height)})),n.draw((function(){r.filterShader.setUniform("direction",[0,1]),r.filterShader.setUniform("tex0",t),r._pInst.clear(),r._pInst.shader(r.filterShader),r._pInst.noLights(),r._pInst.plane(l.width,l.height)})),this._pInst.pop()):n.draw((function(){r._pInst.noStroke(),r._pInst.blendMode(s.BLEND),r._pInst.shader(r.filterShader),r.filterShader.setUniform("tex0",l),r.filterShader.setUniform("texelSize",c),r.filterShader.setUniform("canvasSize",[l.width,l.height]),r.filterShader.setUniform("filterParameter",i),r._pInst.noLights(),r._pInst.plane(l.width,l.height)})),this._pInst.push(),this._pInst.noStroke(),this.clear(),this._pInst.push(),this._pInst.imageMode(s.CORNER),this._pInst.blendMode(s.BLEND),l.filterCamera._resize(),this._pInst.setCamera(l.filterCamera),this._pInst.resetMatrix(),this._pInst.image(n,-l.width/2,-l.height/2,l.width,l.height),this._pInst.clearDepth(),this._pInst.pop(),this._pInst.pop()}},{key:"pixelDensity",value:function(e){return e?this._pInst.pixelDensity(e):this._pInst.pixelDensity()}},{key:"blendMode",value:function(e){e===s.DARKEST||e===s.LIGHTEST||e===s.ADD||e===s.BLEND||e===s.SUBTRACT||e===s.SCREEN||e===s.EXCLUSION||e===s.REPLACE||e===s.MULTIPLY||e===s.REMOVE?this.curBlendMode=e:e!==s.BURN&&e!==s.OVERLAY&&e!==s.HARD_LIGHT&&e!==s.SOFT_LIGHT&&e!==s.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")}},{key:"erase",value:function(e,t){this._isErasing||(this.preEraseBlend=this.curBlendMode,this._isErasing=!0,this.blendMode(s.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255])}},{key:"noErase",value:function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.curBlendMode=this.preEraseBlend,this.blendMode(this.preEraseBlend),this._isErasing=!1,this._applyBlendMode())}},{key:"drawTarget",value:function(){return this.activeFramebuffers[this.activeFramebuffers.length-1]||this}},{key:"beginClip",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};(p(y(n.prototype),"beginClip",this).call(this,e),this.drawTarget()._isClipApplied=!0,e=this.GL).clearStencil(0),e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),this._stencilTestOn=!0,e.stencilFunc(e.ALWAYS,1,255),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.disable(e.DEPTH_TEST),this._pInst.push(),this._pInst.resetShader(),this._doFill&&this._pInst.fill(0,0),this._doStroke&&this._pInst.stroke(0,0)}},{key:"endClip",value:function(){this._pInst.pop();var e=this.GL;e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.stencilFunc(this._clipInvert?e.EQUAL:e.NOTEQUAL,0,255),e.enable(e.DEPTH_TEST),this._clipDepths.push(this._pushPopDepth),p(y(n.prototype),"endClip",this).call(this)}},{key:"_clearClip",value:function(){this.GL.clearStencil(1),this.GL.clear(this.GL.STENCIL_BUFFER_BIT),0<this._clipDepths.length&&this._clipDepths.pop(),this.drawTarget()._isClipApplied=!1}},{key:"strokeWeight",value:function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)}},{key:"_getPixel",value:function(e,t){var r=this.GL;return A(r,null,e,t,r.RGBA,r.UNSIGNED_BYTE,this._pInst.height*this._pInst.pixelDensity())}},{key:"loadPixels",value:function(){var e,t,r=this._pixelsState;!0!==this._pInst._glAttributes.preserveDrawingBuffer?console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true."):(e=this._pInst._pixelDensity,t=this.GL,r._setProperty("pixels",j(r.pixels,t,null,0,0,this.width*e,this.height*e,t.RGBA,t.UNSIGNED_BYTE,this.height*e)))}},{key:"updatePixels",value:function(){var e=this._getTempFramebuffer();e.pixels=this._pixelsState.pixels,e.updatePixels(),this._pInst.push(),this._pInst.resetMatrix(),this._pInst.clear(),this._pInst.imageMode(s.CENTER),this._pInst.image(e,0,0),this._pInst.pop(),this.GL.clearDepth(1),this.GL.clear(this.GL.DEPTH_BUFFER_BIT)}},{key:"_getTempFramebuffer",value:function(){return this._tempFramebuffer||(this._tempFramebuffer=this._pInst.createFramebuffer({format:s.UNSIGNED_BYTE,useDepth:this._pInst._glAttributes.depth,depthFormat:s.UNSIGNED_INT,antialias:this._pInst._glAttributes.antialias})),this._tempFramebuffer}},{key:"geometryInHash",value:function(e){return void 0!==this.retainedMode.geometry[e]}},{key:"viewport",value:function(e,t){this._viewport=[0,0,e,t],this.GL.viewport(0,0,e,t)}},{key:"resize",value:function(e,t){o.default.Renderer.prototype.resize.call(this,e,t),this._origViewport={width:this.GL.drawingBufferWidth,height:this.GL.drawingBufferHeight},this.viewport(this._origViewport.width,this._origViewport.height),this._curCamera._resize();var r=(void 0!==(e=this._pixelsState).pixels&&e._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4)),!0);t=!1,e=void 0;try{for(var n,i=this.framebuffers[Symbol.iterator]();!(r=(n=i.next()).done);r=!0)n.value._canvasSizeChanged()}catch(r){t=!0,e=r}finally{try{r||null==i.return||i.return()}finally{if(t)throw e}}}},{key:"clear",value:function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,n=(arguments.length<=3?void 0:arguments[3])||0,i=this.activeFramebuffer();i&&i.format===s.UNSIGNED_BYTE&&!i.antialias&&0===n&&(n=1e-10),this.GL.clearColor(e*n,t*n,r*n,n),this.GL.clearDepth(1),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)}},{key:"clearDepth",value:function(){this.GL.clearDepth(0<arguments.length&&void 0!==arguments[0]?arguments[0]:1),this.GL.clear(this.GL.DEPTH_BUFFER_BIT)}},{key:"applyMatrix",value:function(e,t,r,n,i,s){16===arguments.length?o.default.Matrix.prototype.apply.apply(this.uModelMatrix,arguments):this.uModelMatrix.apply([e,t,0,0,r,n,0,0,0,0,1,0,i,s,0,1])}},{key:"translate",value:function(e,t,r){return e instanceof o.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uModelMatrix.translate([e,t,r]),this}},{key:"scale",value:function(e,t,r){return this.uModelMatrix.scale(e,t,r),this}},{key:"rotate",value:function(e,t){return void 0===t?this.rotateZ(e):(o.default.Matrix.prototype.rotate.apply(this.uModelMatrix,arguments),this)}},{key:"rotateX",value:function(e){return this.rotate(e,1,0,0),this}},{key:"rotateY",value:function(e){return this.rotate(e,0,1,0),this}},{key:"rotateZ",value:function(e){return this.rotate(e,0,0,1),this}},{key:"push",value:function(){var e=o.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uModelMatrix=this.uModelMatrix.copy(),t.uViewMatrix=this.uViewMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t.curAmbientColor=this.curAmbientColor,t.curSpecularColor=this.curSpecularColor,t.curEmissiveColor=this.curEmissiveColor,t._hasSetAmbient=this._hasSetAmbient,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t._useMetalness=this._useMetalness,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,t._currentNormal=this._currentNormal,t.curBlendMode=this.curBlendMode,t.activeImageLight=this.activeImageLight,t.textureMode=this.textureMode,e}},{key:"pop",value:function(){var e;0<this._clipDepths.length&&this._pushPopDepth===this._clipDepths[this._clipDepths.length-1]&&this._clearClip();for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];(e=p(y(n.prototype),"pop",this)).call.apply(e,[this].concat(r)),this._applyStencilTestIfClipping()}},{key:"_applyStencilTestIfClipping",value:function(){var e=this.drawTarget();e._isClipApplied!==this._stencilTestOn&&(e._isClipApplied?(this.GL.enable(this.GL.STENCIL_TEST),this._stencilTestOn=!0):(this.GL.disable(this.GL.STENCIL_TEST),this._stencilTestOn=!1))}},{key:"resetMatrix",value:function(){return this.uModelMatrix.reset(),this.uViewMatrix.set(this._curCamera.cameraMatrix),this}},{key:"_getImmediateStrokeShader",value:function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()}},{key:"_getRetainedStrokeShader",value:function(){return this._getImmediateStrokeShader()}},{key:"_getSphereMapping",value:function(e){return this.sphereMapping||(this.sphereMapping=this._pInst.createFilterShader(T)),this.uNMatrix.inverseTranspose(this.uViewMatrix),this.uNMatrix.invert3x3(this.uNMatrix),this.sphereMapping.setUniform("uFovY",this._curCamera.cameraFOV),this.sphereMapping.setUniform("uAspect",this._curCamera.aspectRatio),this.sphereMapping.setUniform("uNewNormalMatrix",this.uNMatrix.mat3),this.sphereMapping.setUniform("uSampler",e),this.sphereMapping}},{key:"_getImmediateFillShader",value:function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e}},{key:"_getRetainedFillShader",value:function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e}},{key:"_getImmediatePointShader",value:function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()}},{key:"_getRetainedLineShader",value:function(){return this._getImmediateLineShader()}},{key:"baseMaterialShader",value:function(){if(this._pInst._glAttributes.perPixelLighting)return this._getLightShader();throw new Error("The material shader does not support hooks without perPixelLighting. Try turning it back on.")}},{key:"_getLightShader",value:function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new o.default.Shader(this,this._webGL2CompatibilityPrefix("vert","highp")+M.phongVert,this._webGL2CompatibilityPrefix("frag","highp")+M.phongFrag,{vertex:{"void beforeVertex":"() {}","vec3 getLocalPosition":"(vec3 position) { return position; }","vec3 getWorldPosition":"(vec3 position) { return position; }","vec3 getLocalNormal":"(vec3 normal) { return normal; }","vec3 getWorldNormal":"(vec3 normal) { return normal; }","vec2 getUV":"(vec2 uv) { return uv; }","vec4 getVertexColor":"(vec4 color) { return color; }","void afterVertex":"() {}"},fragment:{"void beforeFragment":"() {}","Inputs getPixelInputs":"(Inputs inputs) { return inputs; }","vec4 combineColors":"(ColorComponents components) {\n                vec4 color = vec4(0.);\n                color.rgb += components.diffuse * components.baseColor;\n                color.rgb += components.ambient * components.ambientColor;\n                color.rgb += components.specular * components.specularColor;\n                color.rgb += components.emissive;\n                color.a = components.opacity;\n                return color;\n              }","vec4 getFinalColor":"(vec4 color) { return color; }","void afterFragment":"() {}"}}):this._defaultLightShader=new o.default.Shader(this,this._webGL2CompatibilityPrefix("vert","highp")+M.lightVert,this._webGL2CompatibilityPrefix("frag","highp")+M.lightTextureFrag)),this._defaultLightShader}},{key:"_getImmediateModeShader",value:function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new o.default.Shader(this,this._webGL2CompatibilityPrefix("vert","mediump")+M.immediateVert,this._webGL2CompatibilityPrefix("frag","mediump")+M.vertexColorFrag)),this._defaultImmediateModeShader}},{key:"baseNormalShader",value:function(){return this._getNormalShader()}},{key:"_getNormalShader",value:function(){return this._defaultNormalShader||(this._defaultNormalShader=new o.default.Shader(this,this._webGL2CompatibilityPrefix("vert","mediump")+M.normalVert,this._webGL2CompatibilityPrefix("frag","mediump")+M.normalFrag,{vertex:{"void beforeVertex":"() {}","vec3 getLocalPosition":"(vec3 position) { return position; }","vec3 getWorldPosition":"(vec3 position) { return position; }","vec3 getLocalNormal":"(vec3 normal) { return normal; }","vec3 getWorldNormal":"(vec3 normal) { return normal; }","vec2 getUV":"(vec2 uv) { return uv; }","vec4 getVertexColor":"(vec4 color) { return color; }","void afterVertex":"() {}"},fragment:{"void beforeFragment":"() {}","vec4 getFinalColor":"(vec4 color) { return color; }","void afterFragment":"() {}"}})),this._defaultNormalShader}},{key:"baseColorShader",value:function(){return this._getColorShader()}},{key:"_getColorShader",value:function(){return this._defaultColorShader||(this._defaultColorShader=new o.default.Shader(this,this._webGL2CompatibilityPrefix("vert","mediump")+M.normalVert,this._webGL2CompatibilityPrefix("frag","mediump")+M.basicFrag,{vertex:{"void beforeVertex":"() {}","vec3 getLocalPosition":"(vec3 position) { return position; }","vec3 getWorldPosition":"(vec3 position) { return position; }","vec3 getLocalNormal":"(vec3 normal) { return normal; }","vec3 getWorldNormal":"(vec3 normal) { return normal; }","vec2 getUV":"(vec2 uv) { return uv; }","vec4 getVertexColor":"(vec4 color) { return color; }","void afterVertex":"() {}"},fragment:{"void beforeFragment":"() {}","vec4 getFinalColor":"(vec4 color) { return color; }","void afterFragment":"() {}"}})),this._defaultColorShader}},{key:"pointShader",value:function(){return this._getPointShader()}},{key:"_getPointShader",value:function(){return this._defaultPointShader||(this._defaultPointShader=new o.default.Shader(this,this._webGL2CompatibilityPrefix("vert","mediump")+M.pointVert,this._webGL2CompatibilityPrefix("frag","mediump")+M.pointFrag,{vertex:{"void beforeVertex":"() {}","vec3 getLocalPosition":"(vec3 position) { return position; }","vec3 getWorldPosition":"(vec3 position) { return position; }","float getPointSize":"(float size) { return size; }","void afterVertex":"() {}"},fragment:{"void beforeFragment":"() {}","vec4 getFinalColor":"(vec4 color) { return color; }","bool shouldDiscard":"(bool outside) { return outside; }","void afterFragment":"() {}"}})),this._defaultPointShader}},{key:"baseStrokeShader",value:function(){return this._getLineShader()}},{key:"_getLineShader",value:function(){return this._defaultLineShader||(this._defaultLineShader=new o.default.Shader(this,this._webGL2CompatibilityPrefix("vert","mediump")+M.lineVert,this._webGL2CompatibilityPrefix("frag","mediump")+M.lineFrag,{vertex:{"void beforeVertex":"() {}","vec3 getLocalPosition":"(vec3 position) { return position; }","vec3 getWorldPosition":"(vec3 position) { return position; }","float getStrokeWeight":"(float weight) { return weight; }","vec2 getLineCenter":"(vec2 center) { return center; }","vec2 getLinePosition":"(vec2 position) { return position; }","vec4 getVertexColor":"(vec4 color) { return color; }","void afterVertex":"() {}"},fragment:{"void beforeFragment":"() {}","Inputs getPixelInputs":"(Inputs inputs) { return inputs; }","vec4 getFinalColor":"(vec4 color) { return color; }","bool shouldDiscard":"(bool outside) { return outside; }","void afterFragment":"() {}"}})),this._defaultLineShader}},{key:"_getFontShader",value:function(){return this._defaultFontShader||(this.webglVersion===s.WEBGL&&this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new o.default.Shader(this,this._webGL2CompatibilityPrefix("vert","highp")+M.fontVert,this._webGL2CompatibilityPrefix("frag","highp")+M.fontFrag)),this._defaultFontShader}},{key:"_webGL2CompatibilityPrefix",value:function(e,t){var r="";return this.webglVersion===s.WEBGL2&&(r+="#version 300 es\n#define WEBGL2\n"),"vert"===e?r+="#define VERTEX_SHADER\n":"frag"===e&&(r+="#define FRAGMENT_SHADER\n"),t&&(r+="precision ".concat(t," float;\n")),r}},{key:"_getEmptyTexture",value:function(){var e;return this._emptyTexture||((e=new o.default.Image(1,1)).set(0,0,255),this._emptyTexture=new o.default.Texture(this,e)),this._emptyTexture}},{key:"getTexture",value:function(e){e instanceof o.default.Framebuffer&&(e=e.color);var t=this.textures.get(e);return t||(t=new o.default.Texture(this,e),this.textures.set(e,t),t)}},{key:"getDiffusedTexture",value:function(e){var t,r,n=this;return null!=this.diffusedTextures.get(e)?this.diffusedTextures.get(e):(t=Math.floor(e.height/e.width*200),r=this._pInst.createFramebuffer({width:200,height:t,density:1}),this.diffusedShader||(this.diffusedShader=this._pInst.createShader(M.imageLightVert,M.imageLightDiffusedFrag)),r.draw((function(){n._pInst.shader(n.diffusedShader),n.diffusedShader.setUniform("environmentMap",e),n._pInst.noStroke(),n._pInst.rectMode(s.CENTER),n._pInst.noLights(),n._pInst.rect(0,0,200,t)})),this.diffusedTextures.set(e,r),r)}},{key:"getSpecularTexture",value:function(e){var t=this;if(null!=this.specularTextures.get(e))return this.specularTextures.get(e);for(var r,n=[],i=this._pInst.createFramebuffer({width:512,height:512,density:1}),o=Math.log(512)/Math.log(2),s=(this.specularShader||(this.specularShader=this._pInst.createShader(M.imageLightVert,M.imageLightSpecularFrag)),512);1<=s;s/=2)!function(r){i.resize(r,r);var s=1-Math.log(r)/Math.log(2)/o;i.draw((function(){t._pInst.shader(t.specularShader),t._pInst.clear(),t.specularShader.setUniform("environmentMap",e),t.specularShader.setUniform("roughness",s),t._pInst.noStroke(),t._pInst.noLights(),t._pInst.plane(r,r)})),n.push(i.get().drawingContext.getImageData(0,0,r,r))}(s);return i.remove(),r=new c.MipmapTexture(this,n,{}),this.specularTextures.set(e,r),r}},{key:"activeFramebuffer",value:function(){return this.activeFramebuffers[this.activeFramebuffers.length-1]||null}},{key:"createFramebuffer",value:function(e){return new o.default.Framebuffer(this,e)}},{key:"_setStrokeUniforms",value:function(e){e.bindShader(),e.setUniform("uUseLineColor",this._useLineColor),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight),e.setUniform("uStrokeCap",x[this.curStrokeCap]),e.setUniform("uStrokeJoin",w[this.curStrokeJoin])}},{key:"_setFillUniforms",value:function(e){var t=this,r=(e.bindShader(),this.mixedSpecularColor=d(this.curSpecularColor),0<this._useMetalness&&(this.mixedSpecularColor=this.mixedSpecularColor.map((function(e,r){return t.curFillColor[r]*t._useMetalness+e*(1-t._useMetalness)}))),e.setUniform("uUseVertexColor",this._useVertexColor),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uHasSetAmbient",this._hasSetAmbient),e.setUniform("uAmbientMatColor",this.curAmbientColor),e.setUniform("uSpecularMatColor",this.mixedSpecularColor),e.setUniform("uEmissiveMatColor",this.curEmissiveColor),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uMetallic",this._useMetalness),this._setImageLightUniforms(e),e.setUniform("uUseLighting",this._enableLighting),this.pointLightDiffuseColors.length/3);e.setUniform("uPointLightCount",r),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors),r=this.directionalLightDiffuseColors.length/3,e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors),r=this.ambientLightColors.length/3,this.mixedAmbientLight=d(this.ambientLightColors),0<this._useMetalness&&(this.mixedAmbientLight=this.mixedAmbientLight.map((function(e){return e-=t._useMetalness,Math.max(0,e)}))),e.setUniform("uAmbientLightCount",r),e.setUniform("uAmbientColor",this.mixedAmbientLight),r=this.spotLightDiffuseColors.length/3,e.setUniform("uSpotLightCount",r),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()}},{key:"_setImageLightUniforms",value:function(e){var t;e.setUniform("uUseImageLight",null!=this.activeImageLight),this.activeImageLight&&(t=this.getDiffusedTexture(this.activeImageLight),e.setUniform("environmentMapDiffused",t),t=this.getSpecularTexture(this.activeImageLight),e.setUniform("environmentMapSpecular",t))}},{key:"_setPointUniforms",value:function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize*this._pInst._pixelDensity)}},{key:"_bindBuffer",value:function(e,t,r,n,i){t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r&&((e=r)instanceof o.default.DataArray?e=r.dataArray():e instanceof(n||Float32Array)||(e=new(n||Float32Array)(e)),this.GL.bufferData(t,e,i||this.GL.STATIC_DRAW))}},{key:"_arraysEqual",value:function(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))}},{key:"_isTypedArray",value:function(e){return[Float32Array,Float64Array,Int16Array,Uint16Array,Uint32Array].some((function(t){return e instanceof t}))}},{key:"_flatten",value:function(e){return e.flat()}},{key:"_vToNArray",value:function(e){return e.flatMap((function(e){return[e.x,e.y,e.z]}))}},{key:"_bezierCoefficients",value:function(e){var t=e*e,r=1-e,n=r*r;return[n*r,3*n*e,3*r*t,t*e]}},{key:"_quadraticCoefficients",value:function(e){var t=1-e;return[t*t,2*t*e,e*e]}},{key:"_bezierToCatmull",value:function(e){return[e[1],e[1]+(e[2]-e[0])/this._curveTightness,e[2]-(e[3]-e[1])/this._curveTightness,e[2]]}},{key:"_initTessy",value:function(){var e=new l.default.GluTesselator;return e.gluTessCallback(l.default.gluEnum.GLU_TESS_VERTEX_DATA,(function(e,t){var r=!0,n=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var a=o.value;t.push(a)}}catch(e){n=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw i}}})),e.gluTessCallback(l.default.gluEnum.GLU_TESS_BEGIN,(function(e){e!==l.default.primitiveType.GL_TRIANGLES&&console.log("expected TRIANGLES but got type: ".concat(e))})),e.gluTessCallback(l.default.gluEnum.GLU_TESS_ERROR,(function(e){console.log("error callback"),console.log("error number: ".concat(e))})),e.gluTessCallback(l.default.gluEnum.GLU_TESS_COMBINE,(function(e,t,r){for(var n=new Array(o.default.RendererGL.prototype.tessyVertexSize).fill(0),i=0;i<r.length;i++)for(var s=0;s<n.length;s++)0!==r[i]&&t[i]&&(n[s]+=t[i][s]*r[i]);return n})),e.gluTessCallback(l.default.gluEnum.GLU_TESS_EDGE_FLAG,(function(e){})),e.gluTessProperty(l.default.gluEnum.GLU_TESS_WINDING_RULE,l.default.windingRule.GLU_TESS_WINDING_NONZERO),e}},{key:"_triangulate",value:function(e){var t=e[0]?e[0][2]:void 0,r=!0,n=!0,i=!1,s=void 0;try{for(var a,l=e[Symbol.iterator]();!(n=(a=l.next()).done);n=!0)for(var c=a.value,u=0;u<c.length;u+=o.default.RendererGL.prototype.tessyVertexSize)if(c[u+2]!==t){r=!1;break}}catch(e){i=!0,s=e}finally{try{n||null==l.return||l.return()}finally{if(i)throw s}}r?this._tessy.gluTessNormal(0,0,1):this._tessy.gluTessNormal(0,0,0),i=[];var h=(this._tessy.gluTessBeginPolygon(i),!0),d=void(s=!1);try{for(var p,f=e[Symbol.iterator]();!(h=(p=f.next()).done);h=!0){var m=p.value;this._tessy.gluTessBeginContour();for(var y=0;y<m.length;y+=o.default.RendererGL.prototype.tessyVertexSize){var g=m.slice(y,y+o.default.RendererGL.prototype.tessyVertexSize);this._tessy.gluTessVertex(g,g)}this._tessy.gluTessEndContour()}}catch(e){s=!0,d=e}finally{try{h||null==f.return||f.return()}finally{if(s)throw d}}return this._tessy.gluTessEndPolygon(),i}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),n}(o.default.Renderer),o.default.prototype._assert3d=function(e){if(!this._renderer.isP3D)throw new Error("".concat(e,"() is only supported in WEBGL mode. If you'd like to use 3D graphics and WebGL, see  https://p5js.org/examples/form-3d-primitives.html for more information."))},o.default.RendererGL.prototype.tessyVertexSize=12,e=o.default.RendererGL,r.default=e},{"../core/constants":272,"../core/main":283,"../core/p5.Renderer":286,"./GeometryBuilder":327,"./p5.Camera":332,"./p5.Framebuffer":334,"./p5.Matrix":336,"./p5.Shader":342,"./p5.Texture":343,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.copy-within":154,"core-js/modules/es.array.every":155,"core-js/modules/es.array.fill":156,"core-js/modules/es.array.flat":160,"core-js/modules/es.array.flat-map":159,"core-js/modules/es.array.from":162,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.map":168,"core-js/modules/es.array.slice":169,"core-js/modules/es.array.some":170,"core-js/modules/es.array.unscopables.flat":173,"core-js/modules/es.array.unscopables.flat-map":172,"core-js/modules/es.map":175,"core-js/modules/es.object.assign":183,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.get-prototype-of":188,"core-js/modules/es.object.to-string":190,"core-js/modules/es.reflect.construct":192,"core-js/modules/es.reflect.get":193,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.set":197,"core-js/modules/es.string.includes":199,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.typed-array.copy-within":213,"core-js/modules/es.typed-array.every":214,"core-js/modules/es.typed-array.fill":215,"core-js/modules/es.typed-array.filter":216,"core-js/modules/es.typed-array.find":218,"core-js/modules/es.typed-array.find-index":217,"core-js/modules/es.typed-array.float32-array":219,"core-js/modules/es.typed-array.float64-array":220,"core-js/modules/es.typed-array.for-each":221,"core-js/modules/es.typed-array.includes":222,"core-js/modules/es.typed-array.index-of":223,"core-js/modules/es.typed-array.int16-array":224,"core-js/modules/es.typed-array.iterator":226,"core-js/modules/es.typed-array.join":227,"core-js/modules/es.typed-array.last-index-of":228,"core-js/modules/es.typed-array.map":229,"core-js/modules/es.typed-array.reduce":231,"core-js/modules/es.typed-array.reduce-right":230,"core-js/modules/es.typed-array.reverse":232,"core-js/modules/es.typed-array.set":233,"core-js/modules/es.typed-array.slice":234,"core-js/modules/es.typed-array.some":235,"core-js/modules/es.typed-array.sort":236,"core-js/modules/es.typed-array.subarray":237,"core-js/modules/es.typed-array.to-locale-string":238,"core-js/modules/es.typed-array.to-string":239,"core-js/modules/es.typed-array.uint16-array":240,"core-js/modules/es.typed-array.uint32-array":241,"core-js/modules/es.typed-array.uint8-array":242,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246,libtess:255,path:258}],342:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}n.default.Shader=function(){function e(t,r,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this._renderer=t,this._vertSrc=r,this._fragSrc=n,this._vertShader=-1,this._fragShader=-1,this._glProgram=0,this._loadedAttributes=!1,this.attributes={},this._loadedUniforms=!1,this.uniforms={},this._bound=!1,this.samplers=[],this.hooks={uniforms:i.uniforms||{},declarations:i.declarations,helpers:i.helpers||{},vertex:i.vertex||{},fragment:i.fragment||{},modified:{vertex:i.modified&&i.modified.vertex||{},fragment:i.modified&&i.modified.fragment||{}}}}var t;return(t=[{key:"shaderSrc",value:function(e,t){var r,n,o,s,a,l=(e=i(e.split("void main"),2))[0],c=(e=e[1],"");for(r in this.hooks.uniforms)c+="uniform ".concat(r,";\n");for(n in this.hooks.declarations&&(c+=this.hooks.declarations+"\n"),this.hooks[t].declarations&&(c+=this.hooks[t].declarations+"\n"),this.hooks.helpers)c+="".concat(n).concat(this.hooks.helpers[n],"\n");for(o in this.hooks[t])"declarations"!==o&&(s=(a=i(o.split(" "),2))[0],a=a[1],this.hooks.modified[t][o]&&(c+="#define AUGMENTED_HOOK_"+a+"\n"),c+=s+" HOOK_"+a+this.hooks[t][o]+"\n");return l+c+"void main"+e}},{key:"version",value:function(){var e=/#version (.+)$/.exec(this.vertSrc());return e?e[1]:"100 es"}},{key:"vertSrc",value:function(){return this.shaderSrc(this._vertSrc,"vertex")}},{key:"fragSrc",value:function(){return this.shaderSrc(this._fragSrc,"fragment")}},{key:"inspectHooks",value:function(){for(var e in console.log("==== Vertex shader hooks: ===="),this.hooks.vertex)console.log((this.hooks.modified.vertex[e]?"[MODIFIED] ":"")+e+this.hooks.vertex[e]);for(var t in console.log(""),console.log("==== Fragment shader hooks: ===="),this.hooks.fragment)console.log((this.hooks.modified.fragment[t]?"[MODIFIED] ":"")+t+this.hooks.fragment[t]);for(var r in console.log(""),console.log("==== Helper functions: ===="),this.hooks.helpers)console.log(r+this.hooks.helpers[r])}},{key:"modify",value:function(e){n.default._validateParameters("p5.Shader.modify",arguments);var t,r={vertex:{},fragment:{},helpers:{}};for(t in e)"declarations"!==t&&"uniforms"!==t&&("vertexDeclarations"===t?r.vertex.declarations=(r.vertex.declarations||"")+"\n"+e[t]:"fragmentDeclarations"===t?r.fragment.declarations=(r.fragment.declarations||"")+"\n"+e[t]:this.hooks.vertex[t]?r.vertex[t]=e[t]:this.hooks.fragment[t]?r.fragment[t]=e[t]:r.helpers[t]=e[t]);var i,o,s=Object.assign({},this.hooks.modified.vertex),a=Object.assign({},this.hooks.modified.fragment);for(i in r.vertex||{})"declarations"!==i&&(s[i]=!0);for(o in r.fragment||{})"declarations"!==o&&(a[o]=!0);return new n.default.Shader(this._renderer,this._vertSrc,this._fragSrc,{declarations:(this.hooks.declarations||"")+"\n"+(e.declarations||""),uniforms:Object.assign({},this.hooks.uniforms,e.uniforms||{}),fragment:Object.assign({},this.hooks.fragment,r.fragment||{}),vertex:Object.assign({},this.hooks.vertex,r.vertex||{}),helpers:Object.assign({},this.hooks.helpers,r.helpers||{}),modified:{vertex:s,fragment:a}})}},{key:"init",value:function(){if(0===this._glProgram){var e,t=this._renderer.GL;if(this._vertShader=t.createShader(t.VERTEX_SHADER),t.shaderSource(this._vertShader,this.vertSrc()),t.compileShader(this._vertShader),!t.getShaderParameter(this._vertShader,t.COMPILE_STATUS))return e=t.getShaderInfoLog(this._vertShader),console.error(e),null;if(this._fragShader=t.createShader(t.FRAGMENT_SHADER),t.shaderSource(this._fragShader,this.fragSrc()),t.compileShader(this._fragShader),!t.getShaderParameter(this._fragShader,t.COMPILE_STATUS))return e=t.getShaderInfoLog(this._fragShader),console.error(e),null;this._glProgram=t.createProgram(),t.attachShader(this._glProgram,this._vertShader),t.attachShader(this._glProgram,this._fragShader),t.linkProgram(this._glProgram),t.getProgramParameter(this._glProgram,t.LINK_STATUS)||n.default._friendlyError("Snap! Error linking shader program: ".concat(t.getProgramInfoLog(this._glProgram))),this._loadAttributes(),this._loadUniforms()}return this}},{key:"setDefaultUniforms",value:function(){for(var e in this.hooks.uniforms){var t,r=i(e.split(" "),2)[1];null!=(t=(e=this.hooks.uniforms[e])instanceof Function?e():e)&&this.setUniform(r,t)}}},{key:"copyToContext",value:function(e){var t=new n.default.Shader(e._renderer,this._vertSrc,this._fragSrc);return t.ensureCompiledOnContext(e),t}},{key:"ensureCompiledOnContext",value:function(e){if(0!==this._glProgram&&this._renderer!==e._renderer)throw new Error("The shader being run is attached to a different context. Do you need to copy it to this context first with .copyToContext()?");0===this._glProgram&&(this._renderer=e._renderer,this.init())}},{key:"_loadAttributes",value:function(){if(!this._loadedAttributes){this.attributes={};for(var e=this._renderer.GL,t=e.getProgramParameter(this._glProgram,e.ACTIVE_ATTRIBUTES),r=0;r<t;++r){var n=e.getActiveAttrib(this._glProgram,r),i=n.name,o=e.getAttribLocation(this._glProgram,i),s={};s.name=i,s.location=o,s.index=r,s.type=n.type,s.size=n.size,this.attributes[i]=s}this._loadedAttributes=!0}}},{key:"_loadUniforms",value:function(){if(!this._loadedUniforms){for(var e=this._renderer.GL,t=e.getProgramParameter(this._glProgram,e.ACTIVE_UNIFORMS),r=0,n=0;n<t;++n){var i=e.getActiveUniform(this._glProgram,n),o={},s=(o.location=e.getUniformLocation(this._glProgram,i.name),o.size=i.size,i.name);1<i.size&&(s=s.substring(0,s.indexOf("[0]"))),o.name=s,o.type=i.type,o._cachedData=void 0,o.type===e.SAMPLER_2D&&(o.samplerIndex=r,r++,this.samplers.push(o)),o.isArray=1<i.size||o.type===e.FLOAT_MAT3||o.type===e.FLOAT_MAT4||o.type===e.FLOAT_VEC2||o.type===e.FLOAT_VEC3||o.type===e.FLOAT_VEC4||o.type===e.INT_VEC2||o.type===e.INT_VEC4||o.type===e.INT_VEC3,this.uniforms[s]=o}this._loadedUniforms=!0}}},{key:"compile",value:function(){}},{key:"bindShader",value:function(){this.init(),this._bound||(this.useProgram(),this._bound=!0,this._setMatrixUniforms(),this.setUniform("uViewport",this._renderer._viewport))}},{key:"unbindShader",value:function(){return this._bound&&(this.unbindTextures(),this._bound=!1),this}},{key:"bindTextures",value:function(){var e=this._renderer.GL,t=!0,r=!1,n=void 0;try{for(var i,o=this.samplers[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var s=i.value,a=s.texture;void 0===a&&(a=this._renderer._getEmptyTexture()),e.activeTexture(e.TEXTURE0+s.samplerIndex),a.bindTexture(),a.update(),e.uniform1i(s.location,s.samplerIndex)}}catch(e){r=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}}},{key:"updateTextures",value:function(){var e=!0,t=!1,r=void 0;try{for(var n,i=this.samplers[Symbol.iterator]();!(e=(n=i.next()).done);e=!0){var o=n.value.texture;o&&o.update()}}catch(e){t=!0,r=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw r}}}},{key:"unbindTextures",value:function(){var e=!0,t=!1,r=void 0;try{for(var n,i=this.samplers[Symbol.iterator]();!(e=(n=i.next()).done);e=!0){var o=n.value;this.setUniform(o.name,this._renderer._getEmptyTexture())}}catch(e){t=!0,r=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw r}}}},{key:"_setMatrixUniforms",value:function(){var e=this._renderer.uModelMatrix,t=this._renderer.uViewMatrix,r=this._renderer.uPMatrix,n=e.copy().mult(t),i=(this._renderer.uMVMatrix=n).copy();i.mult(r),this.isStrokeShader()&&this.setUniform("uPerspective",this._renderer._curCamera.useLinePerspective?1:0),this.setUniform("uViewMatrix",t.mat4),this.setUniform("uProjectionMatrix",r.mat4),this.setUniform("uModelMatrix",e.mat4),this.setUniform("uModelViewMatrix",n.mat4),this.setUniform("uModelViewProjectionMatrix",i.mat4),this.uniforms.uNormalMatrix&&(this._renderer.uNMatrix.inverseTranspose(this._renderer.uMVMatrix),this.setUniform("uNormalMatrix",this._renderer.uNMatrix.mat3)),this.uniforms.uCameraRotation&&(this._renderer.curMatrix.inverseTranspose(this._renderer.uViewMatrix),this.setUniform("uCameraRotation",this._renderer.curMatrix.mat3))}},{key:"useProgram",value:function(){var e=this._renderer.GL;return this._renderer._curShader!==this&&(e.useProgram(this._glProgram),this._renderer._curShader=this),this}},{key:"setUniform",value:function(e,t){var r=this.uniforms[e];if(r){var i=this._renderer.GL;if(r.isArray){if(r._cachedData&&this._renderer._arraysEqual(r._cachedData,t))return;r._cachedData=t.slice(0)}else{if(r._cachedData&&r._cachedData===t)return;Array.isArray(t)?r._cachedData=t.slice(0):r._cachedData=t}var o=r.location;switch(this.useProgram(),r.type){case i.BOOL:!0===t?i.uniform1i(o,1):i.uniform1i(o,0);break;case i.INT:1<r.size?t.length&&i.uniform1iv(o,t):i.uniform1i(o,t);break;case i.FLOAT:1<r.size?t.length&&i.uniform1fv(o,t):i.uniform1f(o,t);break;case i.FLOAT_MAT3:i.uniformMatrix3fv(o,!1,t);break;case i.FLOAT_MAT4:i.uniformMatrix4fv(o,!1,t);break;case i.FLOAT_VEC2:1<r.size?t.length&&i.uniform2fv(o,t):i.uniform2f(o,t[0],t[1]);break;case i.FLOAT_VEC3:1<r.size?t.length&&i.uniform3fv(o,t):i.uniform3f(o,t[0],t[1],t[2]);break;case i.FLOAT_VEC4:1<r.size?t.length&&i.uniform4fv(o,t):i.uniform4f(o,t[0],t[1],t[2],t[3]);break;case i.INT_VEC2:1<r.size?t.length&&i.uniform2iv(o,t):i.uniform2i(o,t[0],t[1]);break;case i.INT_VEC3:1<r.size?t.length&&i.uniform3iv(o,t):i.uniform3i(o,t[0],t[1],t[2]);break;case i.INT_VEC4:1<r.size?t.length&&i.uniform4iv(o,t):i.uniform4i(o,t[0],t[1],t[2],t[3]);break;case i.SAMPLER_2D:if("number"==typeof t){if(t<i.TEXTURE0||t>i.TEXTURE31||t!==Math.ceil(t))return console.log("🌸 p5.js says: You're trying to use a number as the data for a texture.Please use a texture."),this;i.activeTexture(t),i.uniform1i(o,t)}else i.activeTexture(i.TEXTURE0+r.samplerIndex),r.texture=t instanceof n.default.Texture?t:this._renderer.getTexture(t),i.uniform1i(o,r.samplerIndex),r.texture.src.gifProperties&&r.texture.src._animateGif(this._renderer._pInst);break;case i.SAMPLER_CUBE:case i.SAMPLER_3D:case i.SAMPLER_2D_SHADOW:case i.SAMPLER_2D_ARRAY:case i.SAMPLER_2D_ARRAY_SHADOW:case i.SAMPLER_CUBE_SHADOW:case i.INT_SAMPLER_2D:case i.INT_SAMPLER_3D:case i.INT_SAMPLER_CUBE:case i.INT_SAMPLER_2D_ARRAY:case i.UNSIGNED_INT_SAMPLER_2D:case i.UNSIGNED_INT_SAMPLER_3D:case i.UNSIGNED_INT_SAMPLER_CUBE:case i.UNSIGNED_INT_SAMPLER_2D_ARRAY:"number"==typeof t&&(t<i.TEXTURE0||t>i.TEXTURE31||t!==Math.ceil(t)?console.log("🌸 p5.js says: You're trying to use a number as the data for a texture.Please use a texture."):(i.activeTexture(t),i.uniform1i(o,t)))}return this}}},{key:"isLightShader",value:function(){return[this.attributes.aNormal,this.uniforms.uUseLighting,this.uniforms.uAmbientLightCount,this.uniforms.uDirectionalLightCount,this.uniforms.uPointLightCount,this.uniforms.uAmbientColor,this.uniforms.uDirectionalDiffuseColors,this.uniforms.uDirectionalSpecularColors,this.uniforms.uPointLightLocation,this.uniforms.uPointLightDiffuseColors,this.uniforms.uPointLightSpecularColors,this.uniforms.uLightingDirection,this.uniforms.uSpecular].some((function(e){return void 0!==e}))}},{key:"isNormalShader",value:function(){return void 0!==this.attributes.aNormal}},{key:"isTextureShader",value:function(){return 0<this.samplers.length}},{key:"isColorShader",value:function(){return void 0!==this.attributes.aVertexColor||void 0!==this.uniforms.uMaterialColor}},{key:"isTexLightShader",value:function(){return this.isLightShader()&&this.isTextureShader()}},{key:"isStrokeShader",value:function(){return void 0!==this.uniforms.uStrokeWeight}},{key:"enableAttrib",value:function(e,t,r,n,i,o){var s;return e&&-1!==(e=e.location)&&(s=this._renderer.GL,this._renderer.registerEnabled.has(e)||(s.enableVertexAttribArray(e),this._renderer.registerEnabled.add(e)),this._renderer.GL.vertexAttribPointer(e,t,r||s.FLOAT,n||!1,i||0,o||0)),this}},{key:"disableRemainingAttributes",value:function(){var e=this,t=!0,r=!1,n=void 0;try{for(var i,o=this._renderer.registerEnabled.values()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0)!function(){var t=i.value;Object.keys(e.attributes).some((function(r){return e.attributes[r].location===t}))||(e._renderer.GL.disableVertexAttribArray(t),e._renderer.registerEnabled.delete(t))}()}catch(t){r=!0,n=t}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}(),e=n.default.Shader,r.default=e},{"../core/main":283,"core-js/modules/es.array.concat":153,"core-js/modules/es.array.index-of":164,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.slice":169,"core-js/modules/es.array.some":170,"core-js/modules/es.function.name":174,"core-js/modules/es.object.assign":183,"core-js/modules/es.object.keys":189,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.split":206,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/web.dom-collections.iterator":246}],343:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.checkWebGLCapabilities=m,r.default=r.MipmapTexture=void 0;var o=(f=e("../core/main"))&&f.__esModule?f:{default:f},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){return function(){var t,r=u(e);if(t=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),1}catch(e){}}}()?(t=u(this).constructor,Reflect.construct(r,arguments,t)):r.apply(this,arguments),r=this,!t||"object"!==i(t)&&"function"!=typeof t){if(void 0!==r)return r;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t,r){t&&d(e.prototype,t),r&&d(e,r)}o.default.Texture=function(){function e(t,r,n){h(this,e),this._renderer=t;var i=this._renderer.GL;return n=n||{},this.src=r,this.glTex=void 0,this.glTarget=i.TEXTURE_2D,this.glFormat=n.format||i.RGBA,this.mipmaps=!1,this.glMinFilter=n.minFilter||i.LINEAR,this.glMagFilter=n.magFilter||i.LINEAR,this.glWrapS=n.wrapS||i.CLAMP_TO_EDGE,this.glWrapT=n.wrapT||i.CLAMP_TO_EDGE,this.glDataType=n.dataType||i.UNSIGNED_BYTE,n=m(t),this.glFormat!==i.HALF_FLOAT||n.halfFloat||(console.log("This device does not support dataType HALF_FLOAT. Falling back to FLOAT."),this.glDataType=i.FLOAT),this.glFormat!==i.HALF_FLOAT||this.glMinFilter!==i.LINEAR&&this.glMagFilter!==i.LINEAR||n.halfFloatLinear||(console.log("This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST."),this.glMinFilter===i.LINEAR&&(this.glMinFilter=i.NEAREST),this.glMagFilter===i.LINEAR&&(this.glMagFilter=i.NEAREST)),this.glFormat!==i.FLOAT||n.float||(console.log("This device does not support dataType FLOAT. Falling back to UNSIGNED_BYTE."),this.glDataType=i.UNSIGNED_BYTE),this.glFormat!==i.FLOAT||this.glMinFilter!==i.LINEAR&&this.glMagFilter!==i.LINEAR||n.floatLinear||(console.log("This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST."),this.glMinFilter===i.LINEAR&&(this.glMinFilter=i.NEAREST),this.glMagFilter===i.LINEAR&&(this.glMagFilter=i.NEAREST)),this.isSrcMediaElement=void 0!==o.default.MediaElement&&r instanceof o.default.MediaElement,this._videoPrevUpdateTime=0,this.isSrcHTMLElement=void 0!==o.default.Element&&r instanceof o.default.Element&&!(r instanceof o.default.Graphics)&&!(r instanceof o.default.Renderer),this.isSrcP5Image=r instanceof o.default.Image,this.isSrcP5Graphics=r instanceof o.default.Graphics,this.isSrcP5Renderer=r instanceof o.default.Renderer,this.isImageData="undefined"!=typeof ImageData&&r instanceof ImageData,this.isFramebufferTexture=r instanceof o.default.FramebufferTexture,t=this._getTextureDataFromSource(),this.width=t.width,this.height=t.height,this.init(t),this}return p(e,[{key:"_getTextureDataFromSource",value:function(){var e;return this.isFramebufferTexture?e=this.src.rawTexture():this.isSrcP5Image?e=this.src.canvas:this.isSrcMediaElement||this.isSrcP5Graphics||this.isSrcP5Renderer||this.isSrcHTMLElement?(this.src._ensureCanvas&&this.src._ensureCanvas(),e=this.src.canvas||this.src.elt):this.isImageData&&(e=this.src),e}},{key:"init",value:function(e){var t,r=this._renderer.GL;this.isFramebufferTexture||(this.glTex=r.createTexture()),this.glWrapS=this._renderer.textureWrapX,this.glWrapT=this._renderer.textureWrapY,this.setWrapMode(this.glWrapS,this.glWrapT),this.bindTexture(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,this.glMagFilter),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,this.glMinFilter),this.isFramebufferTexture||(0===this.width||0===this.height||this.isSrcMediaElement&&!this.src.loadedmetadata?(t=new Uint8Array([1,1,1,1]),r.texImage2D(this.glTarget,0,r.RGBA,1,1,0,this.glFormat,this.glDataType,t)):r.texImage2D(this.glTarget,0,this.glFormat,this.glFormat,this.glDataType,e))}},{key:"update",value:function(){var e,t,r,n=this.src;return 0!==n.width&&0!==n.height&&!this.isFramebufferTexture&&(e=this._getTextureDataFromSource(),t=!1,r=this._renderer.GL,e.width!==this.width||e.height!==this.height?(t=!0,this.width=e.width||n.width,this.height=e.height||n.height,this.isSrcP5Image?n.setModified(!1):(this.isSrcMediaElement||this.isSrcHTMLElement)&&n.setModified(!0)):this.isSrcP5Image?n.isModified()&&n.setModified(!(t=!0)):this.isSrcMediaElement?n.isModified()?n.setModified(!(t=!0)):n.loadedmetadata&&this._videoPrevUpdateTime!==n.time()&&(this._videoPrevUpdateTime=n.time(),t=!0):this.isImageData?n._dirty&&(t=!(n._dirty=!1)):t=!0,t&&(this.bindTexture(),r.texImage2D(this.glTarget,0,this.glFormat,this.glFormat,this.glDataType,e)),t)}},{key:"bindTexture",value:function(){return this._renderer.GL.bindTexture(this.glTarget,this.getTexture()),this}},{key:"unbindTexture",value:function(){this._renderer.GL.bindTexture(this.glTarget,null)}},{key:"getTexture",value:function(){return this.isFramebufferTexture?this.src.rawTexture():this.glTex}},{key:"setInterpolation",value:function(e,t){var r=this._renderer.GL;this.glMinFilter=this.glFilter(e),this.glMagFilter=this.glFilter(t),this.bindTexture(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,this.glMinFilter),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,this.glMagFilter),this.unbindTexture()}},{key:"glFilter",value:function(e){var t=this._renderer.GL;return e===s.NEAREST?t.NEAREST:t.LINEAR}},{key:"setWrapMode",value:function(e,t){function r(e){return!(e&e-1)}var n=this._renderer.GL,i=(i=this._getTextureDataFromSource()).naturalWidth&&i.naturalHeight?(o=i.naturalWidth,i.naturalHeight):(o=this.width,this.height),o=r(o);i=r(i),e===s.REPEAT?this._renderer.webglVersion===s.WEBGL2||o&&i?this.glWrapS=n.REPEAT:(console.warn("You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead"),this.glWrapS=n.CLAMP_TO_EDGE):e===s.MIRROR?this._renderer.webglVersion===s.WEBGL2||o&&i?this.glWrapS=n.MIRRORED_REPEAT:(console.warn("You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead"),this.glWrapS=n.CLAMP_TO_EDGE):this.glWrapS=n.CLAMP_TO_EDGE,t===s.REPEAT?this._renderer.webglVersion===s.WEBGL2||o&&i?this.glWrapT=n.REPEAT:(console.warn("You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead"),this.glWrapT=n.CLAMP_TO_EDGE):t===s.MIRROR?this._renderer.webglVersion===s.WEBGL2||o&&i?this.glWrapT=n.MIRRORED_REPEAT:(console.warn("You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead"),this.glWrapT=n.CLAMP_TO_EDGE):this.glWrapT=n.CLAMP_TO_EDGE,this.bindTexture(),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,this.glWrapS),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,this.glWrapT),this.unbindTexture()}}]),e}();var f=function(e){var t=n;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e);var r=c(n);function n(e,t,i){return h(this,n),t=(e=r.call(this,e,t,i))._renderer.GL,e.glMinFilter===t.LINEAR&&(e.glMinFilter=t.LINEAR_MIPMAP_LINEAR),e}return p(n,[{key:"glFilter",value:function(e){return this._renderer.GL.LINEAR_MIPMAP_LINEAR}},{key:"_getTextureDataFromSource",value:function(){return this.src}},{key:"init",value:function(e){var t=this._renderer.GL;this.glTex=t.createTexture(),this.bindTexture();for(var r=0;r<e.length;r++)t.texImage2D(this.glTarget,r,this.glFormat,this.glFormat,this.glDataType,e[r]);this.glMinFilter=t.LINEAR_MIPMAP_LINEAR,t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,this.glMagFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,this.glMinFilter),this.unbindTexture()}},{key:"update",value:function(){}}]),n}(o.default.Texture);function m(e){var t=e.GL,r=(e=e.webglVersion)===s.WEBGL2?t.getExtension("EXT_color_buffer_float")&&t.getExtension("EXT_float_blend"):t.getExtension("OES_texture_float");return{float:r,floatLinear:r&&t.getExtension("OES_texture_float_linear"),halfFloat:e=e===s.WEBGL2?t.getExtension("EXT_color_buffer_float"):t.getExtension("OES_texture_half_float"),halfFloatLinear:e&&t.getExtension("OES_texture_half_float_linear")}}r.MipmapTexture=f,e=o.default.Texture,r.default=e},{"../core/constants":272,"../core/main":283,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.get-prototype-of":188,"core-js/modules/es.object.to-string":190,"core-js/modules/es.reflect.construct":192,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.typed-array.copy-within":213,"core-js/modules/es.typed-array.every":214,"core-js/modules/es.typed-array.fill":215,"core-js/modules/es.typed-array.filter":216,"core-js/modules/es.typed-array.find":218,"core-js/modules/es.typed-array.find-index":217,"core-js/modules/es.typed-array.for-each":221,"core-js/modules/es.typed-array.includes":222,"core-js/modules/es.typed-array.index-of":223,"core-js/modules/es.typed-array.iterator":226,"core-js/modules/es.typed-array.join":227,"core-js/modules/es.typed-array.last-index-of":228,"core-js/modules/es.typed-array.map":229,"core-js/modules/es.typed-array.reduce":231,"core-js/modules/es.typed-array.reduce-right":230,"core-js/modules/es.typed-array.reverse":232,"core-js/modules/es.typed-array.set":233,"core-js/modules/es.typed-array.slice":234,"core-js/modules/es.typed-array.some":235,"core-js/modules/es.typed-array.sort":236,"core-js/modules/es.typed-array.subarray":237,"core-js/modules/es.typed-array.to-locale-string":238,"core-js/modules/es.typed-array.to-string":239,"core-js/modules/es.typed-array.uint8-array":242,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],344:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.sub"),e("core-js/modules/web.dom-collections.iterator");var o,s=(o=e("../core/main"))&&o.__esModule?o:{default:o},a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=o?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r])}return n.default=e,t&&t.set(e,n),n}(e("../core/constants"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,r){t&&u(e.prototype,t),r&&u(e,r)}e("./p5.Shader"),e("./p5.RendererGL.Retained"),s.default.RendererGL.prototype._applyTextProperties=function(){this._setProperty("_textAscent",null),this._setProperty("_textDescent",null)},s.default.RendererGL.prototype.textWidth=function(e){return this._isOpenType()?this._textFont._textWidth(e,this._textSize):0};var d=function(){function e(t,r){c(this,e),this.width=t,this.height=r,this.infos=[]}return h(e,[{key:"findImage",value:function(e){var t,r,n=this.width*this.height;if(n<e)throw new Error("font is too complex to render in 3D");for(var i=this.infos.length-1;0<=i;--i){var o=this.infos[i];if(o.index+e<n){r=(t=o).imageData;break}}if(!t){try{r=new ImageData(this.width,this.height)}catch(e){var s=document.getElementsByTagName("canvas")[0],a=!s,l=(s||((s=document.createElement("canvas")).style.display="none",document.body.appendChild(s)),s.getContext("2d"));l&&(r=l.createImageData(this.width,this.height)),a&&document.body.removeChild(s)}this.infos.push(t={index:0,imageData:r})}return l=t.index,t.index+=e,r._dirty=!0,{imageData:r,index:l}}}]),e}();function p(e,t,r,n,i){var o=e.imageData.data;e=4*e.index++,o[e++]=t,o[e++]=r,o[e++]=n,o[+e]=i}var f=Math.sqrt(3),m=function(){function e(t){c(this,e),this.font=t,this.strokeImageInfos=new d(64,64),this.colDimImageInfos=new d(64,64),this.rowDimImageInfos=new d(64,64),this.colCellImageInfos=new d(64,64),this.rowCellImageInfos=new d(64,64),this.glyphInfos={}}return h(e,[{key:"getGlyphInfo",value:function(e){var t=this.glyphInfos[e.index];if(!t){var r=e.getBoundingBox(),n=r.x1,i=r.y1,o=r.x2-n,a=r.y2-i,l=e.path.commands;if(0==o||0==a||!l.length)return this.glyphInfos[e.index]={};for(var u=[],d=[],m=[],y=8;0<=y;--y)m.push([]);for(y=8;0<=y;--y)d.push([]);var g,v,b,_,x=function(){function e(t,r,n,i){c(this,e),this.p0=t,this.c0=r,this.c1=n,this.p1=i}return h(e,[{key:"toQuadratic",value:function(){return{x:this.p0.x,y:this.p0.y,x1:this.p1.x,y1:this.p1.y,cx:(3*(this.c0.x+this.c1.x)-(this.p0.x+this.p1.x))/4,cy:(3*(this.c0.y+this.c1.y)-(this.p0.y+this.p1.y))/4}}},{key:"quadError",value:function(){return s.default.Vector.sub(s.default.Vector.sub(this.p1,this.p0),s.default.Vector.mult(s.default.Vector.sub(this.c1,this.c0),3)).mag()/2}},{key:"split",value:function(t){var r=s.default.Vector.lerp(this.p0,this.c0,t),n=s.default.Vector.lerp(this.c0,this.c1,t),i=s.default.Vector.lerp(r,n,t);return this.c1=s.default.Vector.lerp(this.c1,this.p1,t),this.c0=s.default.Vector.lerp(n,this.c1,t),n=s.default.Vector.lerp(i,this.c0,t),t=new e(this.p0,r,i,n),this.p0=n,t}},{key:"splitInflections",value:function(){var e=s.default.Vector.sub(this.c0,this.p0),t=s.default.Vector.sub(s.default.Vector.sub(this.c1,this.c0),e),r=s.default.Vector.sub(s.default.Vector.sub(s.default.Vector.sub(this.p1,this.c1),e),s.default.Vector.mult(t,2)),n=[],i=t.x*r.y-t.y*r.x;return 0!==i&&0<=(e=(r=e.x*r.y-e.y*r.x)*r-4*i*(e.x*t.y-e.y*t.x))&&(i<0&&(i=-i,r=-r),e=(-r+(t=Math.sqrt(e)))/(2*i),0<(r=(-r-t)/(2*i))&&r<1&&(n.push(this.split(r)),e=1-(1-e)/(1-r)),0<e&&e<1&&n.push(this.split(e))),n.push(this),n}}]),e}(),w=!0,S=!1,M=void 0;try{for(var T,E=l[Symbol.iterator]();!(w=(T=E.next()).done);w=!0){var j=T.value,A=(j.x-n)/o,L=(j.y-i)/a;if(!V(g,v,A,L)){switch(j.type){case"M":b=A,_=L;break;case"L":G(g,v,A,L);break;case"Q":var C=(j.x1-n)/o,P=(j.y1-i)/a;B([g,A,C],[v,L,P],{x:g,y:v,cx:C,cy:P});break;case"Z":V(g,v,b,_)?u.push({x:g,y:v}):(G(g,v,b,_),u.push({x:b,y:_}));break;case"C":for(var R=function(e,t,r,n,i,o,a,l){e=new x(new s.default.Vector(e,t),new s.default.Vector(r,n),new s.default.Vector(i,o),new s.default.Vector(a,l)).splitInflections();var c=[],u=30/f,h=!0;t=!1,r=void 0;try{for(var d,p=e[Symbol.iterator]();!(h=(d=p.next()).done);h=!0){for(var m=d.value,y=[],g=void 0;!(.125<=(g=u/m.quadError()));){var v=Math.pow(g,1/3),b=m.split(v),_=m.split(1-v/(1-v));c.push(b),y.push(m),m=_}g<1&&c.push(m.split(.5)),c.push(m),Array.prototype.push.apply(c,y.reverse())}}catch(e){t=!0,r=e}finally{try{h||null==p.return||p.return()}finally{if(t)throw r}}return c}(g,v,(j.x1-n)/o,(j.y1-i)/a,(j.x2-n)/o,(j.y2-i)/a,A,L),O=0;O<R.length;O++){var k=R[O].toQuadratic();B([k.x,k.x1,k.cx],[k.y,k.y1,k.cy],k)}break;default:throw new Error("unknown command type: ".concat(j.type))}g=A,v=L}}}catch(e){S=!0,M=e}finally{try{w||null==E.return||E.return()}finally{if(S)throw M}}for(var I=u.length,D=this.strokeImageInfos.findImage(I),N=D.index,F=0;F<I;++F){var U=u[F];p(D,z(U.x),z(U.y),z(U.cx),z(U.cy))}(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[r.x1,-r.y1,r.x2,-r.y2],strokeImageInfo:D,strokes:u,colInfo:H(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:H(d,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset]}return t;function B(e,t,r){var n=u.length;function i(e,t,r){for(var n=e.length;0<n--;){var i=e[n];i<t&&(t=i),r<i&&(r=i)}return{min:t,max:r}}u.push(r),r=i(e,1,0),e=Math.max(Math.floor(9*r.min-.5),0);for(var o=Math.min(Math.ceil(9*r.max+.5),9),s=e;s<o;++s)m[s].push(n);r=i(t,1,0),e=Math.max(Math.floor(9*r.min-.5),0);for(var a=Math.min(Math.ceil(9*r.max+.5),9),l=e;l<a;++l)d[l].push(n)}function z(e){return(e*=255)<0?0:255<e?255:e}function G(e,t,r,n){B([e,r],[t,n],{x:e,y:t,cx:(e+r)/2,cy:(t+n)/2})}function V(e,t,r,n){return Math.abs(r-e)<1e-5&&Math.abs(n-t)<1e-5}function H(e,t,r){for(var n=e.length,i=t.findImage(n),o=(t=i.index,0),s=0;s<n;++s)o+=e[s].length;for(var a=r.findImage(o),l=0;l<n;++l){var c=e[l],u=c.length,h=a.index;p(i,h>>7,127&h,u>>7,127&u);for(var d=0;d<u;++d){var f=c[d]+N;p(a,f>>7,127&f,0,0)}}return{cellImageInfo:a,dimOffset:t,dimImageInfo:i}}}}]),e}();s.default.RendererGL.prototype._renderText=function(e,t,r,n,i){if(this._textFont&&"string"!=typeof this._textFont){if(!(i<=n)&&this._doFill){if(this._isOpenType()){e.push(),i=this._doStroke;var o=this.drawMode,l=(this._doStroke=!1,this.drawMode=a.TEXTURE,this._textFont.font),c=(c=this._textFont._fontInfo)||(this._textFont._fontInfo=new m(l)),u=(r=this._textFont._handleAlignment(this,t,r,n),n=this._textSize/l.unitsPerEm,this.translate(r.x,r.y,0),this.scale(n,n,1),this.GL),h=(r=!this._defaultFontShader,this._getFontShader()),d=(h.init(),h.bindShader(),r&&(h.setUniform("uGridImageSize",[64,64]),h.setUniform("uCellsImageSize",[64,64]),h.setUniform("uStrokeImageSize",[64,64]),h.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor),this.retainedMode.geometry.glyph),p=(d||((n=this._textGeom=new s.default.Geometry(1,1,(function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new s.default.Vector(t,e,0)),this.uvs.push(t,e)}))).computeFaces().computeNormals(),d=this.createBuffers("glyph",n)),!0);r=!1,n=void 0;try{for(var f,y=this.retainedMode.buffers.text[Symbol.iterator]();!(p=(f=y.next()).done);p=!0)f.value._prepareBuffer(d,h)}catch(e){r=!0,n=e}finally{try{p||null==y.return||y.return()}finally{if(r)throw n}}this._bindBuffer(d.indexBuffer,u.ELEMENT_ARRAY_BUFFER),h.setUniform("uMaterialColor",this.curFillColor),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{var g=0,v=null,b=l.stringToGlyphs(t),_=!0,x=!1,w=void 0;try{for(var S,M=b[Symbol.iterator]();!(_=(S=M.next()).done);_=!0){var T,E,j=S.value,A=(v&&(g+=l.getKerningValue(v,j)),c.getGlyphInfo(j));A.uGlyphRect&&(T=A.rowInfo,E=A.colInfo,h.setUniform("uSamplerStrokes",A.strokeImageInfo.imageData),h.setUniform("uSamplerRowStrokes",T.cellImageInfo.imageData),h.setUniform("uSamplerRows",T.dimImageInfo.imageData),h.setUniform("uSamplerColStrokes",E.cellImageInfo.imageData),h.setUniform("uSamplerCols",E.dimImageInfo.imageData),h.setUniform("uGridOffset",A.uGridOffset),h.setUniform("uGlyphRect",A.uGlyphRect),h.setUniform("uGlyphOffset",g),h.bindTextures(),u.drawElements(u.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)),g+=j.advanceWidth,v=j}}catch(e){x=!0,w=e}finally{try{_||null==M.return||M.return()}finally{if(x)throw w}}}finally{h.unbindShader(),this._doStroke=i,this.drawMode=o,u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.pop()}}else console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported");return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":272,"../core/main":283,"./p5.RendererGL.Retained":340,"./p5.Shader":342,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.split":206,"core-js/modules/es.string.sub":208,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}]},{},[267])(267)}))},964:function(e,t,r){"use strict";r.d(t,{$EB:function(){return h},B69:function(){return fn},D$Q:function(){return Xi},Gu$:function(){return hc},I9Y:function(){return er},JeP:function(){return _a},Nv2:function(){return ml},Pq0:function(){return hr},Tap:function(){return Ic},Z58:function(){return Sa},ZyN:function(){return Jc},eaF:function(){return fi},hB5:function(){return c},k6q:function(){return ce},pxj:function(){return Di},ubm:function(){return wi}});const n=0,i=1,o=2,s=1,a=2,l=3,c=0,u=1,h=2,d=0,p=1,f=2,m=3,y=4,g=5,v=100,b=101,_=102,x=103,w=104,S=200,M=201,T=202,E=203,j=204,A=205,L=206,C=207,P=208,R=209,O=210,k=0,I=1,D=2,N=3,F=4,U=5,B=6,z=7,G=0,V=1,H=2,W=0,q=1,X=2,Y=3,Z=4,J=5,K=301,Q=302,$=303,ee=304,te=306,re=307,ne=1e3,ie=1001,oe=1002,se=1003,ae=1004,le=1005,ce=1006,ue=1007,he=1008,de=1009,pe=1010,fe=1011,me=1012,ye=1013,ge=1014,ve=1015,be=1016,_e=1017,xe=1018,we=1019,Se=1020,Me=1021,Te=1022,Ee=1023,je=1024,Ae=1025,Le=Ee,Ce=1026,Pe=1027,Re=1028,Oe=1029,ke=1030,Ie=1031,De=1032,Ne=1033,Fe=33776,Ue=33777,Be=33778,ze=33779,Ge=35840,Ve=35841,He=35842,We=35843,qe=36196,Xe=37492,Ye=37496,Ze=37808,Je=37809,Ke=37810,Qe=37811,$e=37812,et=37813,tt=37814,rt=37815,nt=37816,it=37817,ot=37818,st=37819,at=37820,lt=37821,ct=36492,ut=37840,ht=37841,dt=37842,pt=37843,ft=37844,mt=37845,yt=37846,gt=37847,vt=37848,bt=37849,_t=37850,xt=37851,wt=37852,St=37853,Mt=2300,Tt=2301,Et=2302,jt=2400,At=2401,Lt=2402,Ct=3e3,Pt=3001,Rt=3007,Ot=3002,kt=3003,It=3004,Dt=3005,Nt=3006,Ft=3201,Ut=0,Bt=1,zt=7680,Gt=35044,Vt=35048,Ht="300 es";class Wt{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const r=this._listeners[e];if(void 0!==r){const e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const r=t.slice(0);for(let t=0,n=r.length;t<n;t++)r[t].call(this,e);e.target=null}}}const qt=[];for(let e=0;e<256;e++)qt[e]=(e<16?"0":"")+e.toString(16);const Xt=Math.PI/180,Yt=180/Math.PI;function Zt(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,r=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(qt[255&e]+qt[e>>8&255]+qt[e>>16&255]+qt[e>>24&255]+"-"+qt[255&t]+qt[t>>8&255]+"-"+qt[t>>16&15|64]+qt[t>>24&255]+"-"+qt[63&r|128]+qt[r>>8&255]+"-"+qt[r>>16&255]+qt[r>>24&255]+qt[255&n]+qt[n>>8&255]+qt[n>>16&255]+qt[n>>24&255]).toUpperCase()}function Jt(e,t,r){return Math.max(t,Math.min(r,e))}function Kt(e,t,r){return(1-r)*e+r*t}function Qt(e){return!(e&e-1)&&0!==e}function $t(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}class er{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,n=e.elements;return this.x=n[0]*t+n[3]*r+n[6],this.y=n[1]*t+n[4]*r+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,r){return void 0!==r&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),n=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*r-o*n+e.x,this.y=i*n+o*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}er.prototype.isVector2=!0;class tr{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,r,n,i,o,s,a,l){const c=this.elements;return c[0]=e,c[1]=n,c[2]=s,c[3]=t,c[4]=i,c[5]=a,c[6]=r,c[7]=o,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,n=t.elements,i=this.elements,o=r[0],s=r[3],a=r[6],l=r[1],c=r[4],u=r[7],h=r[2],d=r[5],p=r[8],f=n[0],m=n[3],y=n[6],g=n[1],v=n[4],b=n[7],_=n[2],x=n[5],w=n[8];return i[0]=o*f+s*g+a*_,i[3]=o*m+s*v+a*x,i[6]=o*y+s*b+a*w,i[1]=l*f+c*g+u*_,i[4]=l*m+c*v+u*x,i[7]=l*y+c*b+u*w,i[2]=h*f+d*g+p*_,i[5]=h*m+d*v+p*x,i[8]=h*y+d*b+p*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8];return t*o*c-t*s*l-r*i*c+r*s*a+n*i*l-n*o*a}invert(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=c*o-s*l,h=s*a-c*i,d=l*i-o*a,p=t*u+r*h+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=u*f,e[1]=(n*l-c*r)*f,e[2]=(s*r-n*o)*f,e[3]=h*f,e[4]=(c*t-n*a)*f,e[5]=(n*i-s*t)*f,e[6]=d*f,e[7]=(r*a-l*t)*f,e[8]=(o*t-r*i)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,n,i,o,s){const a=Math.cos(i),l=Math.sin(i);return this.set(r*a,r*l,-r*(a*o+l*s)+o+e,-n*l,n*a,-n*(-l*o+a*s)+s+t,0,0,1),this}scale(e,t){const r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=t,r[4]*=t,r[7]*=t,this}rotate(e){const t=Math.cos(e),r=Math.sin(e),n=this.elements,i=n[0],o=n[3],s=n[6],a=n[1],l=n[4],c=n[7];return n[0]=t*i+r*a,n[3]=t*o+r*l,n[6]=t*s+r*c,n[1]=-r*i+t*a,n[4]=-r*o+t*l,n[7]=-r*s+t*c,this}translate(e,t){const r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=t*r[2],r[4]+=t*r[5],r[7]+=t*r[8],this}equals(e){const t=this.elements,r=e.elements;for(let e=0;e<9;e++)if(t[e]!==r[e])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}let rr;tr.prototype.isMatrix3=!0;class nr{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===rr&&(rr=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),rr.width=e.width,rr.height=e.height;const r=rr.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=rr}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}let ir=0;class or extends Wt{constructor(e=or.DEFAULT_IMAGE,t=or.DEFAULT_MAPPING,r=ie,n=ie,i=ce,o=he,s=Ee,a=de,l=1,c=Ct){super(),Object.defineProperty(this,"id",{value:ir++}),this.uuid=Zt(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=r,this.wrapT=n,this.magFilter=i,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=a,this.offset=new er(0,0),this.repeat=new er(1,1),this.center=new er(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new tr,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.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(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const r={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const n=this.image;if(void 0===n.uuid&&(n.uuid=Zt()),!t&&void 0===e.images[n.uuid]){let t;if(Array.isArray(n)){t=[];for(let e=0,r=n.length;e<r;e++)n[e].isDataTexture?t.push(sr(n[e].image)):t.push(sr(n[e]))}else t=sr(n);e.images[n.uuid]={uuid:n.uuid,url:t}}r.image=n.uuid}return t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ne:e.x=e.x-Math.floor(e.x);break;case ie:e.x=e.x<0?0:1;break;case oe: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 ne:e.y=e.y-Math.floor(e.y);break;case ie:e.y=e.y<0?0:1;break;case oe:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&this.version++}}function sr(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?nr.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}or.DEFAULT_IMAGE=void 0,or.DEFAULT_MAPPING=300,or.prototype.isTexture=!0;class ar{constructor(e=0,t=0,r=0,n=1){this.x=e,this.y=t,this.z=r,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,n=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*n+o[12]*i,this.y=o[1]*t+o[5]*r+o[9]*n+o[13]*i,this.z=o[2]*t+o[6]*r+o[10]*n+o[14]*i,this.w=o[3]*t+o[7]*r+o[11]*n+o[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,n,i;const o=.01,s=.1,a=e.elements,l=a[0],c=a[4],u=a[8],h=a[1],d=a[5],p=a[9],f=a[2],m=a[6],y=a[10];if(Math.abs(c-h)<o&&Math.abs(u-f)<o&&Math.abs(p-m)<o){if(Math.abs(c+h)<s&&Math.abs(u+f)<s&&Math.abs(p+m)<s&&Math.abs(l+d+y-3)<s)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,a=(d+1)/2,g=(y+1)/2,v=(c+h)/4,b=(u+f)/4,_=(p+m)/4;return e>a&&e>g?e<o?(r=0,n=.707106781,i=.707106781):(r=Math.sqrt(e),n=v/r,i=b/r):a>g?a<o?(r=.707106781,n=0,i=.707106781):(n=Math.sqrt(a),r=v/n,i=_/n):g<o?(r=.707106781,n=.707106781,i=0):(i=Math.sqrt(g),r=b/i,n=_/i),this.set(r,n,i,t),this}let g=Math.sqrt((m-p)*(m-p)+(u-f)*(u-f)+(h-c)*(h-c));return Math.abs(g)<.001&&(g=1),this.x=(m-p)/g,this.y=(u-f)/g,this.z=(h-c)/g,this.w=Math.acos((l+d+y-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,r){return void 0!==r&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}ar.prototype.isVector4=!0;class lr extends Wt{constructor(e,t,r={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new ar(0,0,e,t),this.scissorTest=!1,this.viewport=new ar(0,0,e,t),this.texture=new or(void 0,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=void 0!==r.generateMipmaps&&r.generateMipmaps,this.texture.internalFormat=void 0!==r.internalFormat?r.internalFormat:null,this.texture.minFilter=void 0!==r.minFilter?r.minFilter:ce,this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0!==r.stencilBuffer&&r.stencilBuffer,this.depthTexture=void 0!==r.depthTexture?r.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,r=1){this.width===e&&this.height===t&&this.depth===r||(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image={...this.texture.image},this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}lr.prototype.isWebGLRenderTarget=!0,class extends lr{constructor(e,t,r){super(e,t);const n=this.texture;this.texture=[];for(let e=0;e<r;e++)this.texture[e]=n.clone()}setSize(e,t,r=1){if(this.width!==e||this.height!==t||this.depth!==r){this.width=e,this.height=t,this.depth=r;for(let n=0,i=this.texture.length;n<i;n++)this.texture[n].image.width=e,this.texture[n].image.height=t,this.texture[n].image.depth=r;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this.texture.length=0;for(let t=0,r=e.texture.length;t<r;t++)this.texture[t]=e.texture[t].clone();return this}}.prototype.isWebGLMultipleRenderTargets=!0;class cr extends lr{constructor(e,t,r){super(e,t,r),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}cr.prototype.isWebGLMultisampleRenderTarget=!0;class ur{constructor(e=0,t=0,r=0,n=1){this._x=e,this._y=t,this._z=r,this._w=n}static slerp(e,t,r,n){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),r.slerpQuaternions(e,t,n)}static slerpFlat(e,t,r,n,i,o,s){let a=r[n+0],l=r[n+1],c=r[n+2],u=r[n+3];const h=i[o+0],d=i[o+1],p=i[o+2],f=i[o+3];if(0===s)return e[t+0]=a,e[t+1]=l,e[t+2]=c,void(e[t+3]=u);if(1===s)return e[t+0]=h,e[t+1]=d,e[t+2]=p,void(e[t+3]=f);if(u!==f||a!==h||l!==d||c!==p){let e=1-s;const t=a*h+l*d+c*p+u*f,r=t>=0?1:-1,n=1-t*t;if(n>Number.EPSILON){const i=Math.sqrt(n),o=Math.atan2(i,t*r);e=Math.sin(e*o)/i,s=Math.sin(s*o)/i}const i=s*r;if(a=a*e+h*i,l=l*e+d*i,c=c*e+p*i,u=u*e+f*i,e===1-s){const e=1/Math.sqrt(a*a+l*l+c*c+u*u);a*=e,l*=e,c*=e,u*=e}}e[t]=a,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,r,n,i,o){const s=r[n],a=r[n+1],l=r[n+2],c=r[n+3],u=i[o],h=i[o+1],d=i[o+2],p=i[o+3];return e[t]=s*p+c*u+a*d-l*h,e[t+1]=a*p+c*h+l*u-s*d,e[t+2]=l*p+c*d+s*h-a*u,e[t+3]=c*p-s*u-a*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const r=e._x,n=e._y,i=e._z,o=e._order,s=Math.cos,a=Math.sin,l=s(r/2),c=s(n/2),u=s(i/2),h=a(r/2),d=a(n/2),p=a(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}setFromAxisAngle(e,t){const r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],n=t[4],i=t[8],o=t[1],s=t[5],a=t[9],l=t[2],c=t[6],u=t[10],h=r+s+u;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-a)*e,this._y=(i-l)*e,this._z=(o-n)*e}else if(r>s&&r>u){const e=2*Math.sqrt(1+r-s-u);this._w=(c-a)/e,this._x=.25*e,this._y=(n+o)/e,this._z=(i+l)/e}else if(s>u){const e=2*Math.sqrt(1+s-r-u);this._w=(i-l)/e,this._x=(n+o)/e,this._y=.25*e,this._z=(a+c)/e}else{const e=2*Math.sqrt(1+u-r-s);this._w=(o-n)/e,this._x=(i+l)/e,this._y=(a+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return r<Number.EPSILON?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Jt(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(0===r)return this;const n=Math.min(1,t/r);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const r=e._x,n=e._y,i=e._z,o=e._w,s=t._x,a=t._y,l=t._z,c=t._w;return this._x=r*c+o*s+n*l-i*a,this._y=n*c+o*a+i*s-r*l,this._z=i*c+o*l+r*a-n*s,this._w=o*c-r*s-n*a-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const r=this._x,n=this._y,i=this._z,o=this._w;let s=o*e._w+r*e._x+n*e._y+i*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=o,this._x=r,this._y=n,this._z=i,this;const a=1-s*s;if(a<=Number.EPSILON){const e=1-t;return this._w=e*o+t*this._w,this._x=e*r+t*this._x,this._y=e*n+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,s),u=Math.sin((1-t)*c)/l,h=Math.sin(t*c)/l;return this._w=o*u+this._w*h,this._x=r*u+this._x*h,this._y=n*u+this._y*h,this._z=i*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,r){this.copy(e).slerp(t,r)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}ur.prototype.isQuaternion=!0;class hr{constructor(e=0,t=0,r=0){this.x=e,this.y=t,this.z=r}set(e,t,r){return void 0===r&&(r=this.z),this.x=e,this.y=t,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(pr.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(pr.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,n=this.z,i=e.elements,o=1/(i[3]*t+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])*o,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])*o,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])*o,this}applyQuaternion(e){const t=this.x,r=this.y,n=this.z,i=e.x,o=e.y,s=e.z,a=e.w,l=a*t+o*n-s*r,c=a*r+s*t-i*n,u=a*n+i*r-o*t,h=-i*t-o*r-s*n;return this.x=l*a+h*-i+c*-s-u*-o,this.y=c*a+h*-o+u*-i-l*-s,this.z=u*a+h*-s+l*-o-c*-i,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,n=e.y,i=e.z,o=t.x,s=t.y,a=t.z;return this.x=n*a-i*s,this.y=i*o-r*a,this.z=r*s-n*o,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return dr.copy(this).projectOnVector(e),this.sub(dr)}reflect(e){return this.sub(dr.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(Jt(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,r){const n=Math.sin(t)*e;return this.x=n*Math.sin(r),this.y=Math.cos(t)*e,this.z=n*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,r){return void 0!==r&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}hr.prototype.isVector3=!0;const dr=new hr,pr=new ur;class fr{constructor(e=new hr(1/0,1/0,1/0),t=new hr(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,s=-1/0;for(let a=0,l=e.length;a<l;a+=3){const l=e[a],c=e[a+1],u=e[a+2];l<t&&(t=l),c<r&&(r=c),u<n&&(n=u),l>i&&(i=l),c>o&&(o=c),u>s&&(s=u)}return this.min.set(t,r,n),this.max.set(i,o,s),this}setFromBufferAttribute(e){let t=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,s=-1/0;for(let a=0,l=e.count;a<l;a++){const l=e.getX(a),c=e.getY(a),u=e.getZ(a);l<t&&(t=l),c<r&&(r=c),u<n&&(n=u),l>i&&(i=l),c>o&&(o=c),u>s&&(s=u)}return this.min.set(t,r,n),this.max.set(i,o,s),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=yr.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){e.updateWorldMatrix(!1,!1);const t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),gr.copy(t.boundingBox),gr.applyMatrix4(e.matrixWorld),this.union(gr));const r=e.children;for(let e=0,t=r.length;e<t;e++)this.expandByObject(r[e]);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,yr),yr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Mr),Tr.subVectors(this.max,Mr),vr.subVectors(e.a,Mr),br.subVectors(e.b,Mr),_r.subVectors(e.c,Mr),xr.subVectors(br,vr),wr.subVectors(_r,br),Sr.subVectors(vr,_r);let t=[0,-xr.z,xr.y,0,-wr.z,wr.y,0,-Sr.z,Sr.y,xr.z,0,-xr.x,wr.z,0,-wr.x,Sr.z,0,-Sr.x,-xr.y,xr.x,0,-wr.y,wr.x,0,-Sr.y,Sr.x,0];return!!Ar(t,vr,br,_r,Tr)&&(t=[1,0,0,0,1,0,0,0,1],!!Ar(t,vr,br,_r,Tr)&&(Er.crossVectors(xr,wr),t=[Er.x,Er.y,Er.z],Ar(t,vr,br,_r,Tr)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return yr.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(yr).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(mr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),mr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),mr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),mr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),mr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),mr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),mr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),mr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(mr)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}fr.prototype.isBox3=!0;const mr=[new hr,new hr,new hr,new hr,new hr,new hr,new hr,new hr],yr=new hr,gr=new fr,vr=new hr,br=new hr,_r=new hr,xr=new hr,wr=new hr,Sr=new hr,Mr=new hr,Tr=new hr,Er=new hr,jr=new hr;function Ar(e,t,r,n,i){for(let o=0,s=e.length-3;o<=s;o+=3){jr.fromArray(e,o);const s=i.x*Math.abs(jr.x)+i.y*Math.abs(jr.y)+i.z*Math.abs(jr.z),a=t.dot(jr),l=r.dot(jr),c=n.dot(jr);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>s)return!1}return!0}const Lr=new fr,Cr=new hr,Pr=new hr,Rr=new hr;class Or{constructor(e=new hr,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;void 0!==t?r.copy(t):Lr.setFromPoints(e).getCenter(r);let n=0;for(let t=0,i=e.length;t<i;t++)n=Math.max(n,r.distanceToSquared(e[t]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const r=this.center.distanceToSquared(e);return t.copy(e),r>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){Rr.subVectors(e,this.center);const t=Rr.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),r=.5*(e-this.radius);this.center.add(Rr.multiplyScalar(r/e)),this.radius+=r}return this}union(e){return Pr.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(Cr.copy(e.center).add(Pr)),this.expandByPoint(Cr.copy(e.center).sub(Pr)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const kr=new hr,Ir=new hr,Dr=new hr,Nr=new hr,Fr=new hr,Ur=new hr,Br=new hr;class zr{constructor(e=new hr,t=new hr(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,kr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=kr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(kr.copy(this.direction).multiplyScalar(t).add(this.origin),kr.distanceToSquared(e))}distanceSqToSegment(e,t,r,n){Ir.copy(e).add(t).multiplyScalar(.5),Dr.copy(t).sub(e).normalize(),Nr.copy(this.origin).sub(Ir);const i=.5*e.distanceTo(t),o=-this.direction.dot(Dr),s=Nr.dot(this.direction),a=-Nr.dot(Dr),l=Nr.lengthSq(),c=Math.abs(1-o*o);let u,h,d,p;if(c>0)if(u=o*a-s,h=o*s-a,p=i*c,u>=0)if(h>=-p)if(h<=p){const e=1/c;u*=e,h*=e,d=u*(u+o*h+2*s)+h*(o*u+h+2*a)+l}else h=i,u=Math.max(0,-(o*h+s)),d=-u*u+h*(h+2*a)+l;else h=-i,u=Math.max(0,-(o*h+s)),d=-u*u+h*(h+2*a)+l;else h<=-p?(u=Math.max(0,-(-o*i+s)),h=u>0?-i:Math.min(Math.max(-i,-a),i),d=-u*u+h*(h+2*a)+l):h<=p?(u=0,h=Math.min(Math.max(-i,-a),i),d=h*(h+2*a)+l):(u=Math.max(0,-(o*i+s)),h=u>0?i:Math.min(Math.max(-i,-a),i),d=-u*u+h*(h+2*a)+l);else h=o>0?-i:i,u=Math.max(0,-(o*h+s)),d=-u*u+h*(h+2*a)+l;return r&&r.copy(this.direction).multiplyScalar(u).add(this.origin),n&&n.copy(Dr).multiplyScalar(h).add(Ir),d}intersectSphere(e,t){kr.subVectors(e.center,this.origin);const r=kr.dot(this.direction),n=kr.dot(kr)-r*r,i=e.radius*e.radius;if(n>i)return null;const o=Math.sqrt(i-n),s=r-o,a=r+o;return s<0&&a<0?null:s<0?this.at(a,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return null===r?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,n,i,o,s,a;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(r=(e.min.x-h.x)*l,n=(e.max.x-h.x)*l):(r=(e.max.x-h.x)*l,n=(e.min.x-h.x)*l),c>=0?(i=(e.min.y-h.y)*c,o=(e.max.y-h.y)*c):(i=(e.max.y-h.y)*c,o=(e.min.y-h.y)*c),r>o||i>n?null:((i>r||r!=r)&&(r=i),(o<n||n!=n)&&(n=o),u>=0?(s=(e.min.z-h.z)*u,a=(e.max.z-h.z)*u):(s=(e.max.z-h.z)*u,a=(e.min.z-h.z)*u),r>a||s>n?null:((s>r||r!=r)&&(r=s),(a<n||n!=n)&&(n=a),n<0?null:this.at(r>=0?r:n,t)))}intersectsBox(e){return null!==this.intersectBox(e,kr)}intersectTriangle(e,t,r,n,i){Fr.subVectors(t,e),Ur.subVectors(r,e),Br.crossVectors(Fr,Ur);let o,s=this.direction.dot(Br);if(s>0){if(n)return null;o=1}else{if(!(s<0))return null;o=-1,s=-s}Nr.subVectors(this.origin,e);const a=o*this.direction.dot(Ur.crossVectors(Nr,Ur));if(a<0)return null;const l=o*this.direction.dot(Fr.cross(Nr));if(l<0)return null;if(a+l>s)return null;const c=-o*Nr.dot(Br);return c<0?null:this.at(c/s,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Gr{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m){const y=this.elements;return y[0]=e,y[4]=t,y[8]=r,y[12]=n,y[1]=i,y[5]=o,y[9]=s,y[13]=a,y[2]=l,y[6]=c,y[10]=u,y[14]=h,y[3]=d,y[7]=p,y[11]=f,y[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Gr).fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,n=1/Vr.setFromMatrixColumn(e,0).length(),i=1/Vr.setFromMatrixColumn(e,1).length(),o=1/Vr.setFromMatrixColumn(e,2).length();return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=0,t[4]=r[4]*i,t[5]=r[5]*i,t[6]=r[6]*i,t[7]=0,t[8]=r[8]*o,t[9]=r[9]*o,t[10]=r[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,r=e.x,n=e.y,i=e.z,o=Math.cos(r),s=Math.sin(r),a=Math.cos(n),l=Math.sin(n),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=o*c,r=o*u,n=s*c,i=s*u;t[0]=a*c,t[4]=-a*u,t[8]=l,t[1]=r+n*l,t[5]=e-i*l,t[9]=-s*a,t[2]=i-e*l,t[6]=n+r*l,t[10]=o*a}else if("YXZ"===e.order){const e=a*c,r=a*u,n=l*c,i=l*u;t[0]=e+i*s,t[4]=n*s-r,t[8]=o*l,t[1]=o*u,t[5]=o*c,t[9]=-s,t[2]=r*s-n,t[6]=i+e*s,t[10]=o*a}else if("ZXY"===e.order){const e=a*c,r=a*u,n=l*c,i=l*u;t[0]=e-i*s,t[4]=-o*u,t[8]=n+r*s,t[1]=r+n*s,t[5]=o*c,t[9]=i-e*s,t[2]=-o*l,t[6]=s,t[10]=o*a}else if("ZYX"===e.order){const e=o*c,r=o*u,n=s*c,i=s*u;t[0]=a*c,t[4]=n*l-r,t[8]=e*l+i,t[1]=a*u,t[5]=i*l+e,t[9]=r*l-n,t[2]=-l,t[6]=s*a,t[10]=o*a}else if("YZX"===e.order){const e=o*a,r=o*l,n=s*a,i=s*l;t[0]=a*c,t[4]=i-e*u,t[8]=n*u+r,t[1]=u,t[5]=o*c,t[9]=-s*c,t[2]=-l*c,t[6]=r*u+n,t[10]=e-i*u}else if("XZY"===e.order){const e=o*a,r=o*l,n=s*a,i=s*l;t[0]=a*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=o*c,t[9]=r*u-n,t[2]=n*u-r,t[6]=s*c,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Wr,e,qr)}lookAt(e,t,r){const n=this.elements;return Zr.subVectors(e,t),0===Zr.lengthSq()&&(Zr.z=1),Zr.normalize(),Xr.crossVectors(r,Zr),0===Xr.lengthSq()&&(1===Math.abs(r.z)?Zr.x+=1e-4:Zr.z+=1e-4,Zr.normalize(),Xr.crossVectors(r,Zr)),Xr.normalize(),Yr.crossVectors(Zr,Xr),n[0]=Xr.x,n[4]=Yr.x,n[8]=Zr.x,n[1]=Xr.y,n[5]=Yr.y,n[9]=Zr.y,n[2]=Xr.z,n[6]=Yr.z,n[10]=Zr.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,n=t.elements,i=this.elements,o=r[0],s=r[4],a=r[8],l=r[12],c=r[1],u=r[5],h=r[9],d=r[13],p=r[2],f=r[6],m=r[10],y=r[14],g=r[3],v=r[7],b=r[11],_=r[15],x=n[0],w=n[4],S=n[8],M=n[12],T=n[1],E=n[5],j=n[9],A=n[13],L=n[2],C=n[6],P=n[10],R=n[14],O=n[3],k=n[7],I=n[11],D=n[15];return i[0]=o*x+s*T+a*L+l*O,i[4]=o*w+s*E+a*C+l*k,i[8]=o*S+s*j+a*P+l*I,i[12]=o*M+s*A+a*R+l*D,i[1]=c*x+u*T+h*L+d*O,i[5]=c*w+u*E+h*C+d*k,i[9]=c*S+u*j+h*P+d*I,i[13]=c*M+u*A+h*R+d*D,i[2]=p*x+f*T+m*L+y*O,i[6]=p*w+f*E+m*C+y*k,i[10]=p*S+f*j+m*P+y*I,i[14]=p*M+f*A+m*R+y*D,i[3]=g*x+v*T+b*L+_*O,i[7]=g*w+v*E+b*C+_*k,i[11]=g*S+v*j+b*P+_*I,i[15]=g*M+v*A+b*R+_*D,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[4],n=e[8],i=e[12],o=e[1],s=e[5],a=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+i*a*u-n*l*u-i*s*h+r*l*h+n*s*d-r*a*d)+e[7]*(+t*a*d-t*l*h+i*o*h-n*o*d+n*l*c-i*a*c)+e[11]*(+t*l*u-t*s*d-i*o*u+r*o*d+i*s*c-r*l*c)+e[15]*(-n*s*c-t*a*u+t*s*h+n*o*u-r*o*h+r*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,r){const n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],y=e[15],g=u*m*l-f*h*l+f*a*d-s*m*d-u*a*y+s*h*y,v=p*h*l-c*m*l-p*a*d+o*m*d+c*a*y-o*h*y,b=c*f*l-p*u*l+p*s*d-o*f*d-c*s*y+o*u*y,_=p*u*a-c*f*a-p*s*h+o*f*h+c*s*m-o*u*m,x=t*g+r*v+n*b+i*_;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/x;return e[0]=g*w,e[1]=(f*h*i-u*m*i-f*n*d+r*m*d+u*n*y-r*h*y)*w,e[2]=(s*m*i-f*a*i+f*n*l-r*m*l-s*n*y+r*a*y)*w,e[3]=(u*a*i-s*h*i-u*n*l+r*h*l+s*n*d-r*a*d)*w,e[4]=v*w,e[5]=(c*m*i-p*h*i+p*n*d-t*m*d-c*n*y+t*h*y)*w,e[6]=(p*a*i-o*m*i-p*n*l+t*m*l+o*n*y-t*a*y)*w,e[7]=(o*h*i-c*a*i+c*n*l-t*h*l-o*n*d+t*a*d)*w,e[8]=b*w,e[9]=(p*u*i-c*f*i-p*r*d+t*f*d+c*r*y-t*u*y)*w,e[10]=(o*f*i-p*s*i+p*r*l-t*f*l-o*r*y+t*s*y)*w,e[11]=(c*s*i-o*u*i-c*r*l+t*u*l+o*r*d-t*s*d)*w,e[12]=_*w,e[13]=(c*f*n-p*u*n+p*r*h-t*f*h-c*r*m+t*u*m)*w,e[14]=(p*s*n-o*f*n-p*r*a+t*f*a+o*r*m-t*s*m)*w,e[15]=(o*u*n-c*s*n+c*r*a-t*u*a-o*r*h+t*s*h)*w,this}scale(e){const t=this.elements,r=e.x,n=e.y,i=e.z;return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,n))}makeTranslation(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),n=Math.sin(t),i=1-r,o=e.x,s=e.y,a=e.z,l=i*o,c=i*s;return this.set(l*o+r,l*s-n*a,l*a+n*s,0,l*s+n*a,c*s+r,c*a-n*o,0,l*a-n*s,c*a+n*o,i*a*a+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,n,i,o){return this.set(1,r,i,0,e,1,o,0,t,n,1,0,0,0,0,1),this}compose(e,t,r){const n=this.elements,i=t._x,o=t._y,s=t._z,a=t._w,l=i+i,c=o+o,u=s+s,h=i*l,d=i*c,p=i*u,f=o*c,m=o*u,y=s*u,g=a*l,v=a*c,b=a*u,_=r.x,x=r.y,w=r.z;return n[0]=(1-(f+y))*_,n[1]=(d+b)*_,n[2]=(p-v)*_,n[3]=0,n[4]=(d-b)*x,n[5]=(1-(h+y))*x,n[6]=(m+g)*x,n[7]=0,n[8]=(p+v)*w,n[9]=(m-g)*w,n[10]=(1-(h+f))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,r){const n=this.elements;let i=Vr.set(n[0],n[1],n[2]).length();const o=Vr.set(n[4],n[5],n[6]).length(),s=Vr.set(n[8],n[9],n[10]).length();this.determinant()<0&&(i=-i),e.x=n[12],e.y=n[13],e.z=n[14],Hr.copy(this);const a=1/i,l=1/o,c=1/s;return Hr.elements[0]*=a,Hr.elements[1]*=a,Hr.elements[2]*=a,Hr.elements[4]*=l,Hr.elements[5]*=l,Hr.elements[6]*=l,Hr.elements[8]*=c,Hr.elements[9]*=c,Hr.elements[10]*=c,t.setFromRotationMatrix(Hr),r.x=i,r.y=o,r.z=s,this}makePerspective(e,t,r,n,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const s=this.elements,a=2*i/(t-e),l=2*i/(r-n),c=(t+e)/(t-e),u=(r+n)/(r-n),h=-(o+i)/(o-i),d=-2*o*i/(o-i);return s[0]=a,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=u,s[13]=0,s[2]=0,s[6]=0,s[10]=h,s[14]=d,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,t,r,n,i,o){const s=this.elements,a=1/(t-e),l=1/(r-n),c=1/(o-i),u=(t+e)*a,h=(r+n)*l,d=(o+i)*c;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-u,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-h,s[2]=0,s[6]=0,s[10]=-2*c,s[14]=-d,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let e=0;e<16;e++)if(t[e]!==r[e])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}Gr.prototype.isMatrix4=!0;const Vr=new hr,Hr=new Gr,Wr=new hr(0,0,0),qr=new hr(1,1,1),Xr=new hr,Yr=new hr,Zr=new hr,Jr=new Gr,Kr=new ur;class Qr{constructor(e=0,t=0,r=0,n=Qr.DefaultOrder){this._x=e,this._y=t,this._z=r,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,r,n=this._order){return this._x=e,this._y=t,this._z=r,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,r=!0){const n=e.elements,i=n[0],o=n[4],s=n[8],a=n[1],l=n[5],c=n[9],u=n[2],h=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(Jt(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-o,i)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Jt(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-u,i),this._z=0);break;case"ZXY":this._x=Math.asin(Jt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(a,i));break;case"ZYX":this._y=Math.asin(-Jt(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(a,i)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(Jt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-Jt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,i)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===r&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return Jr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Jr,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Kr.setFromEuler(this),this.setFromQuaternion(Kr,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new hr(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}Qr.prototype.isEuler=!0,Qr.DefaultOrder="XYZ",Qr.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class $r{constructor(){this.mask=1}set(e){this.mask=1<<e}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return!!(this.mask&e.mask)}}let en=0;const tn=new hr,rn=new ur,nn=new Gr,on=new hr,sn=new hr,an=new hr,ln=new ur,cn=new hr(1,0,0),un=new hr(0,1,0),hn=new hr(0,0,1),dn={type:"added"},pn={type:"removed"};class fn extends Wt{constructor(){super(),Object.defineProperty(this,"id",{value:en++}),this.uuid=Zt(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=fn.DefaultUp.clone();const e=new hr,t=new Qr,r=new ur,n=new hr(1,1,1);t._onChange((function(){r.setFromEuler(t,!1)})),r._onChange((function(){t.setFromQuaternion(r,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Gr},normalMatrix:{value:new tr}}),this.matrix=new Gr,this.matrixWorld=new Gr,this.matrixAutoUpdate=fn.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new $r,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return rn.setFromAxisAngle(e,t),this.quaternion.multiply(rn),this}rotateOnWorldAxis(e,t){return rn.setFromAxisAngle(e,t),this.quaternion.premultiply(rn),this}rotateX(e){return this.rotateOnAxis(cn,e)}rotateY(e){return this.rotateOnAxis(un,e)}rotateZ(e){return this.rotateOnAxis(hn,e)}translateOnAxis(e,t){return tn.copy(e).applyQuaternion(this.quaternion),this.position.add(tn.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(cn,e)}translateY(e){return this.translateOnAxis(un,e)}translateZ(e){return this.translateOnAxis(hn,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(nn.copy(this.matrixWorld).invert())}lookAt(e,t,r){e.isVector3?on.copy(e):on.set(e,t,r);const n=this.parent;this.updateWorldMatrix(!0,!1),sn.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?nn.lookAt(sn,on,this.up):nn.lookAt(on,sn,this.up),this.quaternion.setFromRotationMatrix(nn),n&&(nn.extractRotation(n.matrixWorld),rn.setFromRotationMatrix(nn),this.quaternion.premultiply(rn.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(dn)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(pn)),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(pn)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),nn.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),nn.multiply(e.parent.matrixWorld)),e.applyMatrix4(nn),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let r=0,n=this.children.length;r<n;r++){const n=this.children[r].getObjectByProperty(e,t);if(void 0!==n)return n}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(sn,e,an),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(sn,ln,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let r=0,n=t.length;r<n;r++)t[r].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let r=0,n=t.length;r<n;r++)t[r].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let r=0,n=t.length;r<n;r++)t[r].updateMatrixWorld(e)}updateWorldMatrix(e,t){const r=this.parent;if(!0===e&&null!==r&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){const e=this.children;for(let t=0,r=e.length;t<r;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){const t=void 0===e||"string"==typeof e,r={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const n={};function i(t,r){return void 0===t[r.uuid]&&(t[r.uuid]=r.toJSON(e)),r.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const r=t.shapes;if(Array.isArray(r))for(let t=0,n=r.length;t<n;t++){const n=r[t];i(e.shapes,n)}else i(e.shapes,r)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let r=0,n=this.material.length;r<n;r++)t.push(i(e.materials,this.material[r]));n.material=t}else n.material=i(e.materials,this.material);if(this.children.length>0){n.children=[];for(let t=0;t<this.children.length;t++)n.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(let t=0;t<this.animations.length;t++){const r=this.animations[t];n.animations.push(i(e.animations,r))}}if(t){const t=o(e.geometries),n=o(e.materials),i=o(e.textures),s=o(e.images),a=o(e.shapes),l=o(e.skeletons),c=o(e.animations);t.length>0&&(r.geometries=t),n.length>0&&(r.materials=n),i.length>0&&(r.textures=i),s.length>0&&(r.images=s),a.length>0&&(r.shapes=a),l.length>0&&(r.skeletons=l),c.length>0&&(r.animations=c)}return r.object=n,r;function o(e){const t=[];for(const r in e){const n=e[r];delete n.metadata,t.push(n)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const r=e.children[t];this.add(r.clone())}return this}}fn.DefaultUp=new hr(0,1,0),fn.DefaultMatrixAutoUpdate=!0,fn.prototype.isObject3D=!0;const mn=new hr,yn=new hr,gn=new hr,vn=new hr,bn=new hr,_n=new hr,xn=new hr,wn=new hr,Sn=new hr,Mn=new hr;class Tn{constructor(e=new hr,t=new hr,r=new hr){this.a=e,this.b=t,this.c=r}static getNormal(e,t,r,n){n.subVectors(r,t),mn.subVectors(e,t),n.cross(mn);const i=n.lengthSq();return i>0?n.multiplyScalar(1/Math.sqrt(i)):n.set(0,0,0)}static getBarycoord(e,t,r,n,i){mn.subVectors(n,t),yn.subVectors(r,t),gn.subVectors(e,t);const o=mn.dot(mn),s=mn.dot(yn),a=mn.dot(gn),l=yn.dot(yn),c=yn.dot(gn),u=o*l-s*s;if(0===u)return i.set(-2,-1,-1);const h=1/u,d=(l*a-s*c)*h,p=(o*c-s*a)*h;return i.set(1-d-p,p,d)}static containsPoint(e,t,r,n){return this.getBarycoord(e,t,r,n,vn),vn.x>=0&&vn.y>=0&&vn.x+vn.y<=1}static getUV(e,t,r,n,i,o,s,a){return this.getBarycoord(e,t,r,n,vn),a.set(0,0),a.addScaledVector(i,vn.x),a.addScaledVector(o,vn.y),a.addScaledVector(s,vn.z),a}static isFrontFacing(e,t,r,n){return mn.subVectors(r,t),yn.subVectors(e,t),mn.cross(yn).dot(n)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,n){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[n]),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return mn.subVectors(this.c,this.b),yn.subVectors(this.a,this.b),.5*mn.cross(yn).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Tn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Tn.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,r,n,i){return Tn.getUV(e,this.a,this.b,this.c,t,r,n,i)}containsPoint(e){return Tn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Tn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,n=this.b,i=this.c;let o,s;bn.subVectors(n,r),_n.subVectors(i,r),wn.subVectors(e,r);const a=bn.dot(wn),l=_n.dot(wn);if(a<=0&&l<=0)return t.copy(r);Sn.subVectors(e,n);const c=bn.dot(Sn),u=_n.dot(Sn);if(c>=0&&u<=c)return t.copy(n);const h=a*u-c*l;if(h<=0&&a>=0&&c<=0)return o=a/(a-c),t.copy(r).addScaledVector(bn,o);Mn.subVectors(e,i);const d=bn.dot(Mn),p=_n.dot(Mn);if(p>=0&&d<=p)return t.copy(i);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return s=l/(l-p),t.copy(r).addScaledVector(_n,s);const m=c*p-d*u;if(m<=0&&u-c>=0&&d-p>=0)return xn.subVectors(i,n),s=(u-c)/(u-c+(d-p)),t.copy(n).addScaledVector(xn,s);const y=1/(m+f+h);return o=f*y,s=h*y,t.copy(r).addScaledVector(bn,o).addScaledVector(_n,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let En=0;class jn extends Wt{constructor(){super(),Object.defineProperty(this,"id",{value:En++}),this.uuid=Zt(),this.name="",this.type="Material",this.fog=!0,this.blending=p,this.side=c,this.vertexColors=!1,this.opacity=1,this.format=Ee,this.transparent=!1,this.blendSrc=j,this.blendDst=A,this.blendEquation=v,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=N,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=zt,this.stencilZFail=zt,this.stencilZPass=zt,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const r=e[t];if(void 0===r){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if("shading"===t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===r;continue}const n=this[t];void 0!==n?n&&n.isColor?n.set(r):n&&n.isVector3&&r&&r.isVector3?n.copy(r):this[t]=r:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(e){const t=[];for(const r in e){const n=e[r];delete n.metadata,t.push(n)}return t}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),this.sheenTint&&this.sheenTint.isColor&&(r.sheenTint=this.sheenTint.getHex()),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(r.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(r.specularTint=this.specularTint.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(r.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationTint&&(r.attenuationTint=this.attenuationTint.getHex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowSide&&(r.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==p&&(r.blending=this.blending),this.side!==c&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.format!==Ee&&(r.format=this.format),!0===this.transparent&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(r.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(r.flatShading=this.flatShading),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),t){const t=n(e.textures),i=n(e.images);t.length>0&&(r.textures=t),i.length>0&&(r.images=i)}return r}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.format=e.format,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let r=null;if(null!==t){const e=t.length;r=new Array(e);for(let n=0;n!==e;++n)r[n]=t[n].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}jn.prototype.isMaterial=!0;const An={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},Ln={h:0,s:0,l:0},Cn={h:0,s:0,l:0};function Pn(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+6*(t-e)*(2/3-r):e}function Rn(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function On(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class kn{constructor(e,t,r){return void 0===t&&void 0===r?this.set(e):this.setRGB(e,t,r)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,r){return this.r=e,this.g=t,this.b=r,this}setHSL(e,t,r){if(e=(e%(n=1)+n)%n,t=Jt(t,0,1),r=Jt(r,0,1),0===t)this.r=this.g=this.b=r;else{const n=r<=.5?r*(1+t):r+t-r*t,i=2*r-n;this.r=Pn(i,n,e+1/3),this.g=Pn(i,n,e),this.b=Pn(i,n,e-1/3)}var n;return this}setStyle(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;const n=r[1],i=r[2];switch(n){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i)){const r=parseFloat(e[1])/360,n=parseInt(e[2],10)/100,i=parseInt(e[3],10)/100;return t(e[4]),this.setHSL(r,n,i)}}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=r[1],t=e.length;if(3===t)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,this;if(6===t)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=An[e.toLowerCase()];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){const r=t>0?1/t:1;return this.r=Math.pow(e.r,r),this.g=Math.pow(e.g,r),this.b=Math.pow(e.b,r),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=Rn(e.r),this.g=Rn(e.g),this.b=Rn(e.b),this}copyLinearToSRGB(e){return this.r=On(e.r),this.g=On(e.g),this.b=On(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){const t=this.r,r=this.g,n=this.b,i=Math.max(t,r,n),o=Math.min(t,r,n);let s,a;const l=(o+i)/2;if(o===i)s=0,a=0;else{const e=i-o;switch(a=l<=.5?e/(i+o):e/(2-i-o),i){case t:s=(r-n)/e+(r<n?6:0);break;case r:s=(n-t)/e+2;break;case n:s=(t-r)/e+4}s/=6}return e.h=s,e.s=a,e.l=l,e}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(e,t,r){return this.getHSL(Ln),Ln.h+=e,Ln.s+=t,Ln.l+=r,this.setHSL(Ln.h,Ln.s,Ln.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,r){return this.r=e.r+(t.r-e.r)*r,this.g=e.g+(t.g-e.g)*r,this.b=e.b+(t.b-e.b)*r,this}lerpHSL(e,t){this.getHSL(Ln),e.getHSL(Cn);const r=Kt(Ln.h,Cn.h,t),n=Kt(Ln.s,Cn.s,t),i=Kt(Ln.l,Cn.l,t);return this.setHSL(r,n,i),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}kn.NAMES=An,kn.prototype.isColor=!0,kn.prototype.r=1,kn.prototype.g=1,kn.prototype.b=1;class In extends jn{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new kn(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=G,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}In.prototype.isMeshBasicMaterial=!0;const Dn=new hr,Nn=new er;class Fn{constructor(e,t,r){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===r,this.usage=Gt,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,r){e*=this.itemSize,r*=t.itemSize;for(let n=0,i=this.itemSize;n<i;n++)this.array[e+n]=t.array[r+n];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){const t=this.array;let r=0;for(let n=0,i=e.length;n<i;n++){let i=e[n];void 0===i&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),i=new kn),t[r++]=i.r,t[r++]=i.g,t[r++]=i.b}return this}copyVector2sArray(e){const t=this.array;let r=0;for(let n=0,i=e.length;n<i;n++){let i=e[n];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),i=new er),t[r++]=i.x,t[r++]=i.y}return this}copyVector3sArray(e){const t=this.array;let r=0;for(let n=0,i=e.length;n<i;n++){let i=e[n];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),i=new hr),t[r++]=i.x,t[r++]=i.y,t[r++]=i.z}return this}copyVector4sArray(e){const t=this.array;let r=0;for(let n=0,i=e.length;n<i;n++){let i=e[n];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),i=new ar),t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r++]=i.w}return this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,r=this.count;t<r;t++)Nn.fromBufferAttribute(this,t),Nn.applyMatrix3(e),this.setXY(t,Nn.x,Nn.y);else if(3===this.itemSize)for(let t=0,r=this.count;t<r;t++)Dn.fromBufferAttribute(this,t),Dn.applyMatrix3(e),this.setXYZ(t,Dn.x,Dn.y,Dn.z);return this}applyMatrix4(e){for(let t=0,r=this.count;t<r;t++)Dn.x=this.getX(t),Dn.y=this.getY(t),Dn.z=this.getZ(t),Dn.applyMatrix4(e),this.setXYZ(t,Dn.x,Dn.y,Dn.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)Dn.x=this.getX(t),Dn.y=this.getY(t),Dn.z=this.getZ(t),Dn.applyNormalMatrix(e),this.setXYZ(t,Dn.x,Dn.y,Dn.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)Dn.x=this.getX(t),Dn.y=this.getY(t),Dn.z=this.getZ(t),Dn.transformDirection(e),this.setXYZ(t,Dn.x,Dn.y,Dn.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this}setXYZ(e,t,r,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this}setXYZW(e,t,r,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==Gt&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}}Fn.prototype.isBufferAttribute=!0;class Un extends Fn{constructor(e,t,r){super(new Uint16Array(e),t,r)}}class Bn extends Fn{constructor(e,t,r){super(new Uint32Array(e),t,r)}}(class extends Fn{constructor(e,t,r){super(new Uint16Array(e),t,r)}}).prototype.isFloat16BufferAttribute=!0;class zn extends Fn{constructor(e,t,r){super(new Float32Array(e),t,r)}}function Gn(e){if(0===e.length)return-1/0;let t=e[0];for(let r=1,n=e.length;r<n;++r)e[r]>t&&(t=e[r]);return t}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;let Vn=0;const Hn=new Gr,Wn=new fn,qn=new hr,Xn=new fr,Yn=new fr,Zn=new hr;class Jn extends Wt{constructor(){super(),Object.defineProperty(this,"id",{value:Vn++}),this.uuid=Zt(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Gn(e)>65535?Bn:Un)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,r=0){this.groups.push({start:e,count:t,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const r=this.attributes.normal;if(void 0!==r){const t=(new tr).getNormalMatrix(e);r.applyNormalMatrix(t),r.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(e),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return Hn.makeRotationFromQuaternion(e),this.applyMatrix4(Hn),this}rotateX(e){return Hn.makeRotationX(e),this.applyMatrix4(Hn),this}rotateY(e){return Hn.makeRotationY(e),this.applyMatrix4(Hn),this}rotateZ(e){return Hn.makeRotationZ(e),this.applyMatrix4(Hn),this}translate(e,t,r){return Hn.makeTranslation(e,t,r),this.applyMatrix4(Hn),this}scale(e,t,r){return Hn.makeScale(e,t,r),this.applyMatrix4(Hn),this}lookAt(e){return Wn.lookAt(e),Wn.updateMatrix(),this.applyMatrix4(Wn.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(qn).negate(),this.translate(qn.x,qn.y,qn.z),this}setFromPoints(e){const t=[];for(let r=0,n=e.length;r<n;r++){const n=e[r];t.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new zn(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new fr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new hr(-1/0,-1/0,-1/0),new hr(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,r=t.length;e<r;e++){const r=t[e];Xn.setFromBufferAttribute(r),this.morphTargetsRelative?(Zn.addVectors(this.boundingBox.min,Xn.min),this.boundingBox.expandByPoint(Zn),Zn.addVectors(this.boundingBox.max,Xn.max),this.boundingBox.expandByPoint(Zn)):(this.boundingBox.expandByPoint(Xn.min),this.boundingBox.expandByPoint(Xn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Or);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new hr,1/0);if(e){const r=this.boundingSphere.center;if(Xn.setFromBufferAttribute(e),t)for(let e=0,r=t.length;e<r;e++){const r=t[e];Yn.setFromBufferAttribute(r),this.morphTargetsRelative?(Zn.addVectors(Xn.min,Yn.min),Xn.expandByPoint(Zn),Zn.addVectors(Xn.max,Yn.max),Xn.expandByPoint(Zn)):(Xn.expandByPoint(Yn.min),Xn.expandByPoint(Yn.max))}Xn.getCenter(r);let n=0;for(let t=0,i=e.count;t<i;t++)Zn.fromBufferAttribute(e,t),n=Math.max(n,r.distanceToSquared(Zn));if(t)for(let i=0,o=t.length;i<o;i++){const o=t[i],s=this.morphTargetsRelative;for(let t=0,i=o.count;t<i;t++)Zn.fromBufferAttribute(o,t),s&&(qn.fromBufferAttribute(e,t),Zn.add(qn)),n=Math.max(n,r.distanceToSquared(Zn))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const r=e.array,n=t.position.array,i=t.normal.array,o=t.uv.array,s=n.length/3;void 0===t.tangent&&this.setAttribute("tangent",new Fn(new Float32Array(4*s),4));const a=t.tangent.array,l=[],c=[];for(let e=0;e<s;e++)l[e]=new hr,c[e]=new hr;const u=new hr,h=new hr,d=new hr,p=new er,f=new er,m=new er,y=new hr,g=new hr;function v(e,t,r){u.fromArray(n,3*e),h.fromArray(n,3*t),d.fromArray(n,3*r),p.fromArray(o,2*e),f.fromArray(o,2*t),m.fromArray(o,2*r),h.sub(u),d.sub(u),f.sub(p),m.sub(p);const i=1/(f.x*m.y-m.x*f.y);isFinite(i)&&(y.copy(h).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(i),g.copy(d).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(i),l[e].add(y),l[t].add(y),l[r].add(y),c[e].add(g),c[t].add(g),c[r].add(g))}let b=this.groups;0===b.length&&(b=[{start:0,count:r.length}]);for(let e=0,t=b.length;e<t;++e){const t=b[e],n=t.start;for(let e=n,i=n+t.count;e<i;e+=3)v(r[e+0],r[e+1],r[e+2])}const _=new hr,x=new hr,w=new hr,S=new hr;function M(e){w.fromArray(i,3*e),S.copy(w);const t=l[e];_.copy(t),_.sub(w.multiplyScalar(w.dot(t))).normalize(),x.crossVectors(S,t);const r=x.dot(c[e])<0?-1:1;a[4*e]=_.x,a[4*e+1]=_.y,a[4*e+2]=_.z,a[4*e+3]=r}for(let e=0,t=b.length;e<t;++e){const t=b[e],n=t.start;for(let e=n,i=n+t.count;e<i;e+=3)M(r[e+0]),M(r[e+1]),M(r[e+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let r=this.getAttribute("normal");if(void 0===r)r=new Fn(new Float32Array(3*t.count),3),this.setAttribute("normal",r);else for(let e=0,t=r.count;e<t;e++)r.setXYZ(e,0,0,0);const n=new hr,i=new hr,o=new hr,s=new hr,a=new hr,l=new hr,c=new hr,u=new hr;if(e)for(let h=0,d=e.count;h<d;h+=3){const d=e.getX(h+0),p=e.getX(h+1),f=e.getX(h+2);n.fromBufferAttribute(t,d),i.fromBufferAttribute(t,p),o.fromBufferAttribute(t,f),c.subVectors(o,i),u.subVectors(n,i),c.cross(u),s.fromBufferAttribute(r,d),a.fromBufferAttribute(r,p),l.fromBufferAttribute(r,f),s.add(c),a.add(c),l.add(c),r.setXYZ(d,s.x,s.y,s.z),r.setXYZ(p,a.x,a.y,a.z),r.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,s=t.count;e<s;e+=3)n.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),o.fromBufferAttribute(t,e+2),c.subVectors(o,i),u.subVectors(n,i),c.cross(u),r.setXYZ(e+0,c.x,c.y,c.z),r.setXYZ(e+1,c.x,c.y,c.z),r.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),r.needsUpdate=!0}}merge(e,t){if(!e||!e.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const r=this.attributes;for(const n in r){if(void 0===e.attributes[n])continue;const i=r[n].array,o=e.attributes[n],s=o.array,a=o.itemSize*t,l=Math.min(s.length,i.length-a);for(let e=0,t=a;e<l;e++,t++)i[t]=s[e]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,r=e.count;t<r;t++)Zn.fromBufferAttribute(e,t),Zn.normalize(),e.setXYZ(t,Zn.x,Zn.y,Zn.z)}toNonIndexed(){function e(e,t){const r=e.array,n=e.itemSize,i=e.normalized,o=new r.constructor(t.length*n);let s=0,a=0;for(let i=0,l=t.length;i<l;i++){s=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*n;for(let e=0;e<n;e++)o[a++]=r[s++]}return new Fn(o,n,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Jn,r=this.index.array,n=this.attributes;for(const i in n){const o=e(n[i],r);t.setAttribute(i,o)}const i=this.morphAttributes;for(const n in i){const o=[],s=i[n];for(let t=0,n=s.length;t<n;t++){const n=e(s[t],r);o.push(n)}t.morphAttributes[n]=o}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let e=0,r=o.length;e<r;e++){const r=o[e];t.addGroup(r.start,r.count,r.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const r in t)void 0!==t[r]&&(e[r]=t[r]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const t in r){const n=r[t];e.data.attributes[t]=n.toJSON(e.data)}const n={};let i=!1;for(const t in this.morphAttributes){const r=this.morphAttributes[t],o=[];for(let t=0,n=r.length;t<n;t++){const n=r[t];o.push(n.toJSON(e.data))}o.length>0&&(n[t]=o,i=!0)}i&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const s=this.boundingSphere;return null!==s&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return(new Jn).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const r=e.index;null!==r&&this.setIndex(r.clone(t));const n=e.attributes;for(const e in n){const r=n[e];this.setAttribute(e,r.clone(t))}const i=e.morphAttributes;for(const e in i){const r=[],n=i[e];for(let e=0,i=n.length;e<i;e++)r.push(n[e].clone(t));this.morphAttributes[e]=r}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let e=0,t=o.length;e<t;e++){const t=o[e];this.addGroup(t.start,t.count,t.materialIndex)}const s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());const a=e.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}Jn.prototype.isBufferGeometry=!0;const Kn=new Gr,Qn=new zr,$n=new Or,ei=new hr,ti=new hr,ri=new hr,ni=new hr,ii=new hr,oi=new hr,si=new hr,ai=new hr,li=new hr,ci=new er,ui=new er,hi=new er,di=new hr,pi=new hr;class fi extends fn{constructor(e=new Jn,t=new In){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(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(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,r=Object.keys(t);if(r.length>0){const e=t[r[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,r=e.length;t<r;t++){const r=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const r=this.geometry,n=this.material,i=this.matrixWorld;if(void 0===n)return;if(null===r.boundingSphere&&r.computeBoundingSphere(),$n.copy(r.boundingSphere),$n.applyMatrix4(i),!1===e.ray.intersectsSphere($n))return;if(Kn.copy(i).invert(),Qn.copy(e.ray).applyMatrix4(Kn),null!==r.boundingBox&&!1===Qn.intersectsBox(r.boundingBox))return;let o;if(r.isBufferGeometry){const i=r.index,s=r.attributes.position,a=r.morphAttributes.position,l=r.morphTargetsRelative,c=r.attributes.uv,u=r.attributes.uv2,h=r.groups,d=r.drawRange;if(null!==i)if(Array.isArray(n))for(let r=0,p=h.length;r<p;r++){const p=h[r],f=n[p.materialIndex];for(let r=Math.max(p.start,d.start),n=Math.min(p.start+p.count,d.start+d.count);r<n;r+=3){const n=i.getX(r),h=i.getX(r+1),d=i.getX(r+2);o=mi(this,f,e,Qn,s,a,l,c,u,n,h,d),o&&(o.faceIndex=Math.floor(r/3),o.face.materialIndex=p.materialIndex,t.push(o))}}else for(let r=Math.max(0,d.start),h=Math.min(i.count,d.start+d.count);r<h;r+=3){const h=i.getX(r),d=i.getX(r+1),p=i.getX(r+2);o=mi(this,n,e,Qn,s,a,l,c,u,h,d,p),o&&(o.faceIndex=Math.floor(r/3),t.push(o))}else if(void 0!==s)if(Array.isArray(n))for(let r=0,i=h.length;r<i;r++){const i=h[r],p=n[i.materialIndex];for(let r=Math.max(i.start,d.start),n=Math.min(i.start+i.count,d.start+d.count);r<n;r+=3)o=mi(this,p,e,Qn,s,a,l,c,u,r,r+1,r+2),o&&(o.faceIndex=Math.floor(r/3),o.face.materialIndex=i.materialIndex,t.push(o))}else for(let r=Math.max(0,d.start),i=Math.min(s.count,d.start+d.count);r<i;r+=3)o=mi(this,n,e,Qn,s,a,l,c,u,r,r+1,r+2),o&&(o.faceIndex=Math.floor(r/3),t.push(o))}else r.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function mi(e,t,r,n,i,o,s,a,l,c,d,p){ei.fromBufferAttribute(i,c),ti.fromBufferAttribute(i,d),ri.fromBufferAttribute(i,p);const f=e.morphTargetInfluences;if(o&&f){si.set(0,0,0),ai.set(0,0,0),li.set(0,0,0);for(let e=0,t=o.length;e<t;e++){const t=f[e],r=o[e];0!==t&&(ni.fromBufferAttribute(r,c),ii.fromBufferAttribute(r,d),oi.fromBufferAttribute(r,p),s?(si.addScaledVector(ni,t),ai.addScaledVector(ii,t),li.addScaledVector(oi,t)):(si.addScaledVector(ni.sub(ei),t),ai.addScaledVector(ii.sub(ti),t),li.addScaledVector(oi.sub(ri),t)))}ei.add(si),ti.add(ai),ri.add(li)}e.isSkinnedMesh&&(e.boneTransform(c,ei),e.boneTransform(d,ti),e.boneTransform(p,ri));const m=function(e,t,r,n,i,o,s,a){let l;if(l=t.side===u?n.intersectTriangle(s,o,i,!0,a):n.intersectTriangle(i,o,s,t.side!==h,a),null===l)return null;pi.copy(a),pi.applyMatrix4(e.matrixWorld);const c=r.ray.origin.distanceTo(pi);return c<r.near||c>r.far?null:{distance:c,point:pi.clone(),object:e}}(e,t,r,n,ei,ti,ri,di);if(m){a&&(ci.fromBufferAttribute(a,c),ui.fromBufferAttribute(a,d),hi.fromBufferAttribute(a,p),m.uv=Tn.getUV(di,ei,ti,ri,ci,ui,hi,new er)),l&&(ci.fromBufferAttribute(l,c),ui.fromBufferAttribute(l,d),hi.fromBufferAttribute(l,p),m.uv2=Tn.getUV(di,ei,ti,ri,ci,ui,hi,new er));const e={a:c,b:d,c:p,normal:new hr,materialIndex:0};Tn.getNormal(ei,ti,ri,e.normal),m.face=e}return m}fi.prototype.isMesh=!0;class yi extends Jn{constructor(e=1,t=1,r=1,n=1,i=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:n,heightSegments:i,depthSegments:o};const s=this;n=Math.floor(n),i=Math.floor(i),o=Math.floor(o);const a=[],l=[],c=[],u=[];let h=0,d=0;function p(e,t,r,n,i,o,p,f,m,y,g){const v=o/m,b=p/y,_=o/2,x=p/2,w=f/2,S=m+1,M=y+1;let T=0,E=0;const j=new hr;for(let o=0;o<M;o++){const s=o*b-x;for(let a=0;a<S;a++){const h=a*v-_;j[e]=h*n,j[t]=s*i,j[r]=w,l.push(j.x,j.y,j.z),j[e]=0,j[t]=0,j[r]=f>0?1:-1,c.push(j.x,j.y,j.z),u.push(a/m),u.push(1-o/y),T+=1}}for(let e=0;e<y;e++)for(let t=0;t<m;t++){const r=h+t+S*e,n=h+t+S*(e+1),i=h+(t+1)+S*(e+1),o=h+(t+1)+S*e;a.push(r,n,o),a.push(n,i,o),E+=6}s.addGroup(d,E,g),d+=E,h+=T}p("z","y","x",-1,-1,r,t,e,o,i,0),p("z","y","x",1,-1,r,t,-e,o,i,1),p("x","z","y",1,1,e,r,t,n,o,2),p("x","z","y",1,-1,e,r,-t,n,o,3),p("x","y","z",1,-1,e,t,r,n,i,4),p("x","y","z",-1,-1,e,t,-r,n,i,5),this.setIndex(a),this.setAttribute("position",new zn(l,3)),this.setAttribute("normal",new zn(c,3)),this.setAttribute("uv",new zn(u,2))}static fromJSON(e){return new yi(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function gi(e){const t={};for(const r in e){t[r]={};for(const n in e[r]){const i=e[r][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?t[r][n]=i.clone():Array.isArray(i)?t[r][n]=i.slice():t[r][n]=i}}return t}function vi(e){const t={};for(let r=0;r<e.length;r++){const n=gi(e[r]);for(const e in n)t[e]=n[e]}return t}const bi={clone:gi,merge:vi};class _i extends jn{constructor(e){super(),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.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))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=gi(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.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const n=this.uniforms[r].value;n&&n.isTexture?t.uniforms[r]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[r]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[r]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[r]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[r]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[r]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[r]={type:"m4",value:n.toArray()}:t.uniforms[r]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const r={};for(const e in this.extensions)!0===this.extensions[e]&&(r[e]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}_i.prototype.isShaderMaterial=!0;class xi extends fn{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new Gr,this.projectionMatrix=new Gr,this.projectionMatrixInverse=new Gr}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}xi.prototype.isCamera=!0;class wi extends xi{constructor(e=50,t=1,r=.1,n=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Yt*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*Xt*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Yt*Math.atan(Math.tan(.5*Xt*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,r,n,i,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=r,this.view.offsetY=n,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Xt*this.fov)/this.zoom,r=2*t,n=this.aspect*r,i=-.5*n;const o=this.view;if(null!==this.view&&this.view.enabled){const e=o.fullWidth,s=o.fullHeight;i+=o.offsetX*n/e,t-=o.offsetY*r/s,n*=o.width/e,r*=o.height/s}const s=this.filmOffset;0!==s&&(i+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+n,t,t-r,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}wi.prototype.isPerspectiveCamera=!0;const Si=90;class Mi extends fn{constructor(e,t,r){if(super(),this.type="CubeCamera",!0!==r.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=r;const n=new wi(Si,1,e,t);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new hr(1,0,0)),this.add(n);const i=new wi(Si,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new hr(-1,0,0)),this.add(i);const o=new wi(Si,1,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new hr(0,1,0)),this.add(o);const s=new wi(Si,1,e,t);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(new hr(0,-1,0)),this.add(s);const a=new wi(Si,1,e,t);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new hr(0,0,1)),this.add(a);const l=new wi(Si,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new hr(0,0,-1)),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();const r=this.renderTarget,[n,i,o,s,a,l]=this.children,c=e.xr.enabled,u=e.getRenderTarget();e.xr.enabled=!1;const h=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,n),e.setRenderTarget(r,1),e.render(t,i),e.setRenderTarget(r,2),e.render(t,o),e.setRenderTarget(r,3),e.render(t,s),e.setRenderTarget(r,4),e.render(t,a),r.texture.generateMipmaps=h,e.setRenderTarget(r,5),e.render(t,l),e.setRenderTarget(u),e.xr.enabled=c}}class Ti extends or{constructor(e,t,r,n,i,o,s,a,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:K,r,n,i,o,s=void 0!==s?s:Te,a,l,c),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}Ti.prototype.isCubeTexture=!0;class Ei extends lr{constructor(e,t,r){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=r),super(e,e,t),t=t||{},this.texture=new Ti(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:ce,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=Ee,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={tEquirect:{value:null}},n="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",o=new yi(5,5,5),s=new _i({name:"CubemapFromEquirect",uniforms:gi(r),vertexShader:n,fragmentShader:i,side:u,blending:d});s.uniforms.tEquirect.value=t;const a=new fi(o,s),l=t.minFilter;return t.minFilter===he&&(t.minFilter=ce),new Mi(1,10,this).update(e,a),t.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,r,n){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,r,n);e.setRenderTarget(i)}}Ei.prototype.isWebGLCubeRenderTarget=!0;const ji=new hr,Ai=new hr,Li=new tr;class Ci{constructor(e=new hr(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,n){return this.normal.set(e,t,r),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const n=ji.subVectors(r,t).cross(Ai.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const r=e.delta(ji),n=this.normal.dot(r);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/n;return i<0||i>1?null:t.copy(r).multiplyScalar(i).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const r=t||Li.getNormalMatrix(e),n=this.coplanarPoint(ji).applyMatrix4(e),i=this.normal.applyMatrix3(r).normalize();return this.constant=-n.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}Ci.prototype.isPlane=!0;const Pi=new Or,Ri=new hr;class Oi{constructor(e=new Ci,t=new Ci,r=new Ci,n=new Ci,i=new Ci,o=new Ci){this.planes=[e,t,r,n,i,o]}set(e,t,r,n,i,o){const s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(r),s[3].copy(n),s[4].copy(i),s[5].copy(o),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e){const t=this.planes,r=e.elements,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],l=r[5],c=r[6],u=r[7],h=r[8],d=r[9],p=r[10],f=r[11],m=r[12],y=r[13],g=r[14],v=r[15];return t[0].setComponents(s-n,u-a,f-h,v-m).normalize(),t[1].setComponents(s+n,u+a,f+h,v+m).normalize(),t[2].setComponents(s+i,u+l,f+d,v+y).normalize(),t[3].setComponents(s-i,u-l,f-d,v-y).normalize(),t[4].setComponents(s-o,u-c,f-p,v-g).normalize(),t[5].setComponents(s+o,u+c,f+p,v+g).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Pi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Pi)}intersectsSprite(e){return Pi.center.set(0,0,0),Pi.radius=.7071067811865476,Pi.applyMatrix4(e.matrixWorld),this.intersectsSphere(Pi)}intersectsSphere(e){const t=this.planes,r=e.center,n=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(r)<n)return!1;return!0}intersectsBox(e){const t=this.planes;for(let r=0;r<6;r++){const n=t[r];if(Ri.x=n.normal.x>0?e.max.x:e.min.x,Ri.y=n.normal.y>0?e.max.y:e.min.y,Ri.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(Ri)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function ki(){let e=null,t=!1,r=null,n=null;function i(t,o){r(t,o),n=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==r&&(n=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){r=e},setContext:function(t){e=t}}}function Ii(e,t){const r=t.isWebGL2,n=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),n.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const r=n.get(t);r&&(e.deleteBuffer(r.buffer),n.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=n.get(t);return void((!e||e.version<t.version)&&n.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const o=n.get(t);void 0===o?n.set(t,function(t,n){const i=t.array,o=t.usage,s=e.createBuffer();e.bindBuffer(n,s),e.bufferData(n,i,o),t.onUploadCallback();let a=5126;return i instanceof Float32Array?a=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?t.isFloat16BufferAttribute?r?a=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):a=5123:i instanceof Int16Array?a=5122:i instanceof Uint32Array?a=5125:i instanceof Int32Array?a=5124:i instanceof Int8Array?a=5120:(i instanceof Uint8Array||i instanceof Uint8ClampedArray)&&(a=5121),{buffer:s,type:a,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}(t,i)):o.version<t.version&&(function(t,n,i){const o=n.array,s=n.updateRange;e.bindBuffer(i,t),-1===s.count?e.bufferSubData(i,0,o):(r?e.bufferSubData(i,s.offset*o.BYTES_PER_ELEMENT,o,s.offset,s.count):e.bufferSubData(i,s.offset*o.BYTES_PER_ELEMENT,o.subarray(s.offset,s.offset+s.count)),s.count=-1)}(o.buffer,t,i),o.version=t.version)}}}class Di extends Jn{constructor(e=1,t=1,r=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:n};const i=e/2,o=t/2,s=Math.floor(r),a=Math.floor(n),l=s+1,c=a+1,u=e/s,h=t/a,d=[],p=[],f=[],m=[];for(let e=0;e<c;e++){const t=e*h-o;for(let r=0;r<l;r++){const n=r*u-i;p.push(n,-t,0),f.push(0,0,1),m.push(r/s),m.push(1-e/a)}}for(let e=0;e<a;e++)for(let t=0;t<s;t++){const r=t+l*e,n=t+l*(e+1),i=t+1+l*(e+1),o=t+1+l*e;d.push(r,n,o),d.push(n,i,o)}this.setIndex(d),this.setAttribute("position",new zn(p,3)),this.setAttribute("normal",new zn(f,3)),this.setAttribute("uv",new zn(m,2))}static fromJSON(e){return new Di(e.width,e.height,e.widthSegments,e.heightSegments)}}const Ni={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 USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",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:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( 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 dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in 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 dotVH = saturate( dot( geometry.viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float NoH ) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float NoV, float NoL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( NoL + NoV - NoL * NoV ) ) );\n}\nvec3 BRDF_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, float faceDirection ) {\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 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 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 precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",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 getIBLIrradiance( const in GeometricContext geometry ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn 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\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\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\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = 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\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = 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\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = 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\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in 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\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\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;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight, 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_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.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularTintFactor = specularTint;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARTINTMAP\n\t\t\tspecularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularTintFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenTint = sheenTint;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenTint;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.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}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += irradiance * BRDF_Sheen( material.roughness, directLight.direction, geometry, material.sheenTint );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if 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\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\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 += getIBLIrradiance( geometry );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\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:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",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 * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = 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\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",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",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(  1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,  1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,  1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationTint, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = transmission.a;\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationTint;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( float roughness, float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,\n\t\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\n\t\tvec3 attenuationColor, float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#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 ) || defined ( USE_TRANSMISSION )\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 <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",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 <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",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\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",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 <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <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\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\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",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#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",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 <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <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_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_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",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#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",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 <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularTint;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARTINTMAP\n\t\tuniform sampler2D specularTintMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenTint;\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - clearcoat * Fcc ) + clearcoatSpecular * clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",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 <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",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 <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",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}"},Fi={common:{diffuse:{value:new kn(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new tr},uv2Transform:{value:new tr},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},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 er(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new kn(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 kn(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new tr}},sprite:{diffuse:{value:new kn(16777215)},opacity:{value:1},center:{value:new er(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new tr}}},Ui={basic:{uniforms:vi([Fi.common,Fi.specularmap,Fi.envmap,Fi.aomap,Fi.lightmap,Fi.fog]),vertexShader:Ni.meshbasic_vert,fragmentShader:Ni.meshbasic_frag},lambert:{uniforms:vi([Fi.common,Fi.specularmap,Fi.envmap,Fi.aomap,Fi.lightmap,Fi.emissivemap,Fi.fog,Fi.lights,{emissive:{value:new kn(0)}}]),vertexShader:Ni.meshlambert_vert,fragmentShader:Ni.meshlambert_frag},phong:{uniforms:vi([Fi.common,Fi.specularmap,Fi.envmap,Fi.aomap,Fi.lightmap,Fi.emissivemap,Fi.bumpmap,Fi.normalmap,Fi.displacementmap,Fi.fog,Fi.lights,{emissive:{value:new kn(0)},specular:{value:new kn(1118481)},shininess:{value:30}}]),vertexShader:Ni.meshphong_vert,fragmentShader:Ni.meshphong_frag},standard:{uniforms:vi([Fi.common,Fi.envmap,Fi.aomap,Fi.lightmap,Fi.emissivemap,Fi.bumpmap,Fi.normalmap,Fi.displacementmap,Fi.roughnessmap,Fi.metalnessmap,Fi.fog,Fi.lights,{emissive:{value:new kn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ni.meshphysical_vert,fragmentShader:Ni.meshphysical_frag},toon:{uniforms:vi([Fi.common,Fi.aomap,Fi.lightmap,Fi.emissivemap,Fi.bumpmap,Fi.normalmap,Fi.displacementmap,Fi.gradientmap,Fi.fog,Fi.lights,{emissive:{value:new kn(0)}}]),vertexShader:Ni.meshtoon_vert,fragmentShader:Ni.meshtoon_frag},matcap:{uniforms:vi([Fi.common,Fi.bumpmap,Fi.normalmap,Fi.displacementmap,Fi.fog,{matcap:{value:null}}]),vertexShader:Ni.meshmatcap_vert,fragmentShader:Ni.meshmatcap_frag},points:{uniforms:vi([Fi.points,Fi.fog]),vertexShader:Ni.points_vert,fragmentShader:Ni.points_frag},dashed:{uniforms:vi([Fi.common,Fi.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ni.linedashed_vert,fragmentShader:Ni.linedashed_frag},depth:{uniforms:vi([Fi.common,Fi.displacementmap]),vertexShader:Ni.depth_vert,fragmentShader:Ni.depth_frag},normal:{uniforms:vi([Fi.common,Fi.bumpmap,Fi.normalmap,Fi.displacementmap,{opacity:{value:1}}]),vertexShader:Ni.meshnormal_vert,fragmentShader:Ni.meshnormal_frag},sprite:{uniforms:vi([Fi.sprite,Fi.fog]),vertexShader:Ni.sprite_vert,fragmentShader:Ni.sprite_frag},background:{uniforms:{uvTransform:{value:new tr},t2D:{value:null}},vertexShader:Ni.background_vert,fragmentShader:Ni.background_frag},cube:{uniforms:vi([Fi.envmap,{opacity:{value:1}}]),vertexShader:Ni.cube_vert,fragmentShader:Ni.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ni.equirect_vert,fragmentShader:Ni.equirect_frag},distanceRGBA:{uniforms:vi([Fi.common,Fi.displacementmap,{referencePosition:{value:new hr},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ni.distanceRGBA_vert,fragmentShader:Ni.distanceRGBA_frag},shadow:{uniforms:vi([Fi.lights,Fi.fog,{color:{value:new kn(0)},opacity:{value:1}}]),vertexShader:Ni.shadow_vert,fragmentShader:Ni.shadow_frag}};function Bi(e,t,r,n,i){const o=new kn(0);let s,a,l=0,h=null,d=0,p=null;function f(e,t){r.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),l=t,f(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(e){l=e,f(o,l)},render:function(r,i){let m=!1,y=!0===i.isScene?i.background:null;y&&y.isTexture&&(y=t.get(y));const g=e.xr,v=g.getSession&&g.getSession();v&&"additive"===v.environmentBlendMode&&(y=null),null===y?f(o,l):y&&y.isColor&&(f(y,1),m=!0),(e.autoClear||m)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),y&&(y.isCubeTexture||y.mapping===te)?(void 0===a&&(a=new fi(new yi(1,1,1),new _i({name:"BackgroundCubeMaterial",uniforms:gi(Ui.cube.uniforms),vertexShader:Ui.cube.vertexShader,fragmentShader:Ui.cube.fragmentShader,side:u,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(a)),a.material.uniforms.envMap.value=y,a.material.uniforms.flipEnvMap.value=y.isCubeTexture&&!1===y.isRenderTargetTexture?-1:1,h===y&&d===y.version&&p===e.toneMapping||(a.material.needsUpdate=!0,h=y,d=y.version,p=e.toneMapping),r.unshift(a,a.geometry,a.material,0,0,null)):y&&y.isTexture&&(void 0===s&&(s=new fi(new Di(2,2),new _i({name:"BackgroundMaterial",uniforms:gi(Ui.background.uniforms),vertexShader:Ui.background.vertexShader,fragmentShader:Ui.background.fragmentShader,side:c,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(s)),s.material.uniforms.t2D.value=y,!0===y.matrixAutoUpdate&&y.updateMatrix(),s.material.uniforms.uvTransform.value.copy(y.matrix),h===y&&d===y.version&&p===e.toneMapping||(s.material.needsUpdate=!0,h=y,d=y.version,p=e.toneMapping),r.unshift(s,s.geometry,s.material,0,0,null))}}}function zi(e,t,r,n){const i=e.getParameter(34921),o=n.isWebGL2?null:t.get("OES_vertex_array_object"),s=n.isWebGL2||null!==o,a={},l=d(null);let c=l;function u(t){return n.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function h(t){return n.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function d(e){const t=[],r=[],n=[];for(let e=0;e<i;e++)t[e]=0,r[e]=0,n[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:n,object:e,attributes:{},index:null}}function p(){const e=c.newAttributes;for(let t=0,r=e.length;t<r;t++)e[t]=0}function f(e){m(e,0)}function m(r,i){const o=c.newAttributes,s=c.enabledAttributes,a=c.attributeDivisors;o[r]=1,0===s[r]&&(e.enableVertexAttribArray(r),s[r]=1),a[r]!==i&&((n.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](r,i),a[r]=i)}function y(){const t=c.newAttributes,r=c.enabledAttributes;for(let n=0,i=r.length;n<i;n++)r[n]!==t[n]&&(e.disableVertexAttribArray(n),r[n]=0)}function g(t,r,i,o,s,a){!0!==n.isWebGL2||5124!==i&&5125!==i?e.vertexAttribPointer(t,r,i,o,s,a):e.vertexAttribIPointer(t,r,i,s,a)}function v(){b(),c!==l&&(c=l,u(c.object))}function b(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(i,l,h,v,b){let _=!1;if(s){const t=function(t,r,i){const s=!0===i.wireframe;let l=a[t.id];void 0===l&&(l={},a[t.id]=l);let c=l[r.id];void 0===c&&(c={},l[r.id]=c);let u=c[s];return void 0===u&&(u=d(n.isWebGL2?e.createVertexArray():o.createVertexArrayOES()),c[s]=u),u}(v,h,l);c!==t&&(c=t,u(c.object)),_=function(e,t){const r=c.attributes,n=e.attributes;let i=0;for(const e in n){const t=r[e],o=n[e];if(void 0===t)return!0;if(t.attribute!==o)return!0;if(t.data!==o.data)return!0;i++}return c.attributesNum!==i||c.index!==t}(v,b),_&&function(e,t){const r={},n=e.attributes;let i=0;for(const e in n){const t=n[e],o={};o.attribute=t,t.data&&(o.data=t.data),r[e]=o,i++}c.attributes=r,c.attributesNum=i,c.index=t}(v,b)}else{const e=!0===l.wireframe;c.geometry===v.id&&c.program===h.id&&c.wireframe===e||(c.geometry=v.id,c.program=h.id,c.wireframe=e,_=!0)}!0===i.isInstancedMesh&&(_=!0),null!==b&&r.update(b,34963),_&&(function(i,o,s,a){if(!1===n.isWebGL2&&(i.isInstancedMesh||a.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;p();const l=a.attributes,c=s.getAttributes(),u=o.defaultAttributeValues;for(const t in c){const n=c[t];if(n.location>=0){let o=l[t];if(void 0===o&&("instanceMatrix"===t&&i.instanceMatrix&&(o=i.instanceMatrix),"instanceColor"===t&&i.instanceColor&&(o=i.instanceColor)),void 0!==o){const t=o.normalized,s=o.itemSize,l=r.get(o);if(void 0===l)continue;const c=l.buffer,u=l.type,h=l.bytesPerElement;if(o.isInterleavedBufferAttribute){const r=o.data,l=r.stride,d=o.offset;if(r&&r.isInstancedInterleavedBuffer){for(let e=0;e<n.locationSize;e++)m(n.location+e,r.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=r.meshPerAttribute*r.count)}else for(let e=0;e<n.locationSize;e++)f(n.location+e);e.bindBuffer(34962,c);for(let e=0;e<n.locationSize;e++)g(n.location+e,s/n.locationSize,u,t,l*h,(d+s/n.locationSize*e)*h)}else{if(o.isInstancedBufferAttribute){for(let e=0;e<n.locationSize;e++)m(n.location+e,o.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let e=0;e<n.locationSize;e++)f(n.location+e);e.bindBuffer(34962,c);for(let e=0;e<n.locationSize;e++)g(n.location+e,s/n.locationSize,u,t,s*h,s/n.locationSize*e*h)}}else if(void 0!==u){const r=u[t];if(void 0!==r)switch(r.length){case 2:e.vertexAttrib2fv(n.location,r);break;case 3:e.vertexAttrib3fv(n.location,r);break;case 4:e.vertexAttrib4fv(n.location,r);break;default:e.vertexAttrib1fv(n.location,r)}}}}y()}(i,l,h,v),null!==b&&e.bindBuffer(34963,r.get(b).buffer))},reset:v,resetDefaultState:b,dispose:function(){v();for(const e in a){const t=a[e];for(const e in t){const r=t[e];for(const e in r)h(r[e].object),delete r[e];delete t[e]}delete a[e]}},releaseStatesOfGeometry:function(e){if(void 0===a[e.id])return;const t=a[e.id];for(const e in t){const r=t[e];for(const e in r)h(r[e].object),delete r[e];delete t[e]}delete a[e.id]},releaseStatesOfProgram:function(e){for(const t in a){const r=a[t];if(void 0===r[e.id])continue;const n=r[e.id];for(const e in n)h(n[e].object),delete n[e];delete r[e.id]}},initAttributes:p,enableAttribute:f,disableUnusedAttributes:y}}function Gi(e,t,r,n){const i=n.isWebGL2;let o;this.setMode=function(e){o=e},this.render=function(t,n){e.drawArrays(o,t,n),r.update(n,o,1)},this.renderInstances=function(n,s,a){if(0===a)return;let l,c;if(i)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](o,n,s,a),r.update(s,o,a)}}function Vi(e,t,r){let n;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"}const o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let s=void 0!==r.precision?r.precision:"highp";const a=i(s);a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a);const l=o||t.has("WEBGL_draw_buffers"),c=!0===r.logarithmicDepthBuffer,u=e.getParameter(34930),h=e.getParameter(35660),d=e.getParameter(3379),p=e.getParameter(34076),f=e.getParameter(34921),m=e.getParameter(36347),y=e.getParameter(36348),g=e.getParameter(36349),v=h>0,b=o||t.has("OES_texture_float");return{isWebGL2:o,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===t.has("EXT_texture_filter_anisotropic")){const r=t.get("EXT_texture_filter_anisotropic");n=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:i,precision:s,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:h,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:y,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:b,floatVertexTextures:v&&b,maxSamples:o?e.getParameter(36183):0}}function Hi(e){const t=this;let r=null,n=0,i=!1,o=!1;const s=new Ci,a=new tr,l={value:null,needsUpdate:!1};function c(){l.value!==r&&(l.value=r,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function u(e,r,n,i){const o=null!==e?e.length:0;let c=null;if(0!==o){if(c=l.value,!0!==i||null===c){const t=n+4*o,i=r.matrixWorldInverse;a.getNormalMatrix(i),(null===c||c.length<t)&&(c=new Float32Array(t));for(let t=0,r=n;t!==o;++t,r+=4)s.copy(e[t]).applyMatrix4(i,a),s.normal.toArray(c,r),c[r+3]=s.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){const s=0!==e.length||t||0!==n||i;return i=t,r=u(e,o,0),n=e.length,s},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,c()},this.setState=function(t,s,a){const 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{const e=o?0:n,t=4*e;let i=f.clippingState||null;l.value=i,i=u(h,s,t,a);for(let e=0;e!==t;++e)i[e]=r[e];f.clippingState=i,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}}}function Wi(e){let t=new WeakMap;function r(e,t){return t===$?e.mapping=K:t===ee&&(e.mapping=Q),e}function n(e){const r=e.target;r.removeEventListener("dispose",n);const i=t.get(r);void 0!==i&&(t.delete(r),i.dispose())}return{get:function(i){if(i&&i.isTexture&&!1===i.isRenderTargetTexture){const o=i.mapping;if(o===$||o===ee){if(t.has(i))return r(t.get(i).texture,i.mapping);{const o=i.image;if(o&&o.height>0){const s=e.getRenderTarget(),a=new Ei(o.height/2);return a.fromEquirectangularTexture(e,i),t.set(i,a),e.setRenderTarget(s),i.addEventListener("dispose",n),r(a.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}Ui.physical={uniforms:vi([Ui.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new er(1,1)},clearcoatNormalMap:{value:null},sheenTint:{value:new kn(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new er},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new kn(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new kn(1,1,1)},specularTintMap:{value:null}}]),vertexShader:Ni.meshphysical_vert,fragmentShader:Ni.meshphysical_frag};class qi extends xi{constructor(e=-1,t=1,r=1,n=-1,i=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=n,this.near=i,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,r,n,i,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=r,this.view.offsetY=n,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let i=r-e,o=r+e,s=n+t,a=n-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,o=i+e*this.view.width,s-=t*this.view.offsetY,a=s-t*this.view.height}this.projectionMatrix.makeOrthographic(i,o,s,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}qi.prototype.isOrthographicCamera=!0;class Xi extends _i{constructor(e){super(e),this.type="RawShaderMaterial"}}Xi.prototype.isRawShaderMaterial=!0;const Yi=Math.pow(2,8),Zi=[.125,.215,.35,.446,.526,.582],Ji=5+Zi.length,Ki={[Ct]:0,[Pt]:1,[Ot]:2,[It]:3,[Dt]:4,[Nt]:5,[Rt]:6},Qi=new qi,{_lodPlanes:$i,_sizeLods:eo,_sigmas:to}=co(),ro=new kn;let no=null;const io=(1+Math.sqrt(5))/2,oo=1/io,so=[new hr(1,1,1),new hr(-1,1,1),new hr(1,1,-1),new hr(-1,1,-1),new hr(0,io,oo),new hr(0,io,-oo),new hr(oo,0,io),new hr(-oo,0,io),new hr(io,oo,0),new hr(-io,oo,0)];class ao{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=function(){const e=new Float32Array(20),t=new hr(0,1,0);return new Xi({name:"SphericalGaussianBlur",defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:Ki[Ct]},outputEncoding:{value:Ki[Ct]}},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:d,depthTest:!1,depthWrite:!1})}(),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,r=.1,n=100){no=this._renderer.getRenderTarget();const i=this._allocateTargets();return this._sceneToCubeUV(e,r,n,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=fo(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=po(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let e=0;e<$i.length;e++)$i[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(no),e.scissorTest=!1,ho(e,0,0,e.width,e.height)}_fromTexture(e){no=this._renderer.getRenderTarget();const t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){const t={magFilter:se,minFilter:se,generateMipmaps:!1,type:de,format:Le,encoding:lo(e)?e.encoding:Ot,depthBuffer:!1},r=uo(t);return r.depthBuffer=!e,this._pingPongRenderTarget=uo(t),r}_compileMaterial(e){const t=new fi($i[0],e);this._renderer.compile(t,Qi)}_sceneToCubeUV(e,t,r,n){const i=new wi(90,1,t,r),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.outputEncoding,h=a.toneMapping;a.getClearColor(ro),a.toneMapping=W,a.outputEncoding=Ct,a.autoClear=!1;const d=new In({name:"PMREM.Background",side:u,depthWrite:!1,depthTest:!1}),p=new fi(new yi,d);let f=!1;const m=e.background;m?m.isColor&&(d.color.copy(m),e.background=null,f=!0):(d.color.copy(ro),f=!0);for(let t=0;t<6;t++){const r=t%3;0==r?(i.up.set(0,o[t],0),i.lookAt(s[t],0,0)):1==r?(i.up.set(0,0,o[t]),i.lookAt(0,s[t],0)):(i.up.set(0,o[t],0),i.lookAt(0,0,s[t])),ho(n,r*Yi,t>2?Yi:0,Yi,Yi),a.setRenderTarget(n),f&&a.render(p,i),a.render(e,i)}p.geometry.dispose(),p.material.dispose(),a.toneMapping=h,a.outputEncoding=c,a.autoClear=l,e.background=m}_textureToCubeUV(e,t){const r=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=fo()):null==this._equirectShader&&(this._equirectShader=po());const n=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new fi($i[0],n),o=n.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=Ki[e.encoding],o.outputEncoding.value=Ki[t.texture.encoding],ho(t,0,0,3*Yi,2*Yi),r.setRenderTarget(t),r.render(i,Qi)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let t=1;t<Ji;t++){const r=Math.sqrt(to[t]*to[t]-to[t-1]*to[t-1]),n=so[(t-1)%so.length];this._blur(e,t-1,t,r,n)}t.autoClear=r}_blur(e,t,r,n,i){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,r,n,"latitudinal",i),this._halfBlur(o,e,r,r,n,"longitudinal",i)}_halfBlur(e,t,r,n,i,o,s){const a=this._renderer,l=this._blurMaterial;"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new fi($i[n],l),u=l.uniforms,h=eo[r]-1,d=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,p=i/d,f=isFinite(i)?1+Math.floor(3*p):20;f>20&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let y=0;for(let e=0;e<20;++e){const t=e/p,r=Math.exp(-t*t/2);m.push(r),0==e?y+=r:e<f&&(y+=2*r)}for(let e=0;e<m.length;e++)m[e]=m[e]/y;u.envMap.value=e.texture,u.samples.value=f,u.weights.value=m,u.latitudinal.value="latitudinal"===o,s&&(u.poleAxis.value=s),u.dTheta.value=d,u.mipInt.value=8-r,u.inputEncoding.value=Ki[e.texture.encoding],u.outputEncoding.value=Ki[e.texture.encoding];const g=eo[n];ho(t,3*Math.max(0,Yi-2*g),(0===n?0:2*Yi)+2*g*(n>4?n-8+4:0),3*g,2*g),a.setRenderTarget(t),a.render(c,Qi)}}function lo(e){return void 0!==e&&e.type===de&&(e.encoding===Ct||e.encoding===Pt||e.encoding===Rt)}function co(){const e=[],t=[],r=[];let n=8;for(let i=0;i<Ji;i++){const o=Math.pow(2,n);t.push(o);let s=1/o;i>4?s=Zi[i-8+4-1]:0==i&&(s=0),r.push(s);const a=1/(o-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,p=3,f=2,m=1,y=new Float32Array(p*d*h),g=new Float32Array(f*d*h),v=new Float32Array(m*d*h);for(let e=0;e<h;e++){const t=e%3*2/3-1,r=e>2?0:-1,n=[t,r,0,t+2/3,r,0,t+2/3,r+1,0,t,r,0,t+2/3,r+1,0,t,r+1,0];y.set(n,p*d*e),g.set(u,f*d*e);const i=[e,e,e,e,e,e];v.set(i,m*d*e)}const b=new Jn;b.setAttribute("position",new Fn(y,p)),b.setAttribute("uv",new Fn(g,f)),b.setAttribute("faceIndex",new Fn(v,m)),e.push(b),n>4&&n--}return{_lodPlanes:e,_sizeLods:t,_sigmas:r}}function uo(e){const t=new lr(3*Yi,3*Yi,e);return t.texture.mapping=te,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function ho(e,t,r,n,i){e.viewport.set(t,r,n,i),e.scissor.set(t,r,n,i)}function po(){const e=new er(1,1);return new Xi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:e},inputEncoding:{value:Ki[Ct]},outputEncoding:{value:Ki[Ct]}},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:d,depthTest:!1,depthWrite:!1})}function fo(){return new Xi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:Ki[Ct]},outputEncoding:{value:Ki[Ct]}},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( 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\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:d,depthTest:!1,depthWrite:!1})}function mo(e){let t=new WeakMap,r=null;function n(e){const r=e.target;r.removeEventListener("dispose",n);const i=t.get(r);void 0!==i&&(t.delete(r),i.dispose())}return{get:function(i){if(i&&i.isTexture&&!1===i.isRenderTargetTexture){const o=i.mapping,s=o===$||o===ee,a=o===K||o===Q;if(s||a){if(t.has(i))return t.get(i).texture;{const o=i.image;if(s&&o&&o.height>0||a&&o&&function(e){let t=0;for(let r=0;r<6;r++)void 0!==e[r]&&t++;return 6===t}(o)){const o=e.getRenderTarget();null===r&&(r=new ao(e));const a=s?r.fromEquirectangular(i):r.fromCubemap(i);return t.set(i,a),e.setRenderTarget(o),i.addEventListener("dispose",n),a.texture}return null}}}return i},dispose:function(){t=new WeakMap,null!==r&&(r.dispose(),r=null)}}}function yo(e){const t={};function r(r){if(void 0!==t[r])return t[r];let n;switch(r){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(r)}return t[r]=n,n}return{has:function(e){return null!==r(e)},init:function(e){e.isWebGL2?r("EXT_color_buffer_float"):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float")},get:function(e){const t=r(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function go(e,t,r,n){const i={},o=new WeakMap;function s(e){const a=e.target;null!==a.index&&t.remove(a.index);for(const e in a.attributes)t.remove(a.attributes[e]);a.removeEventListener("dispose",s),delete i[a.id];const l=o.get(a);l&&(t.remove(l),o.delete(a)),n.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,r.memory.geometries--}function a(e){const r=[],n=e.index,i=e.attributes.position;let s=0;if(null!==n){const e=n.array;s=n.version;for(let t=0,n=e.length;t<n;t+=3){const n=e[t+0],i=e[t+1],o=e[t+2];r.push(n,i,i,o,o,n)}}else{const e=i.array;s=i.version;for(let t=0,n=e.length/3-1;t<n;t+=3){const e=t+0,n=t+1,i=t+2;r.push(e,n,n,i,i,e)}}const a=new(Gn(r)>65535?Bn:Un)(r,1);a.version=s;const l=o.get(e);l&&t.remove(l),o.set(e,a)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",s),i[t.id]=!0,r.memory.geometries++),t},update:function(e){const r=e.attributes;for(const e in r)t.update(r[e],34962);const n=e.morphAttributes;for(const e in n){const r=n[e];for(let e=0,n=r.length;e<n;e++)t.update(r[e],34962)}},getWireframeAttribute:function(e){const t=o.get(e);if(t){const r=e.index;null!==r&&t.version<r.version&&a(e)}else a(e);return o.get(e)}}}function vo(e,t,r,n){const i=n.isWebGL2;let o,s,a;this.setMode=function(e){o=e},this.setIndex=function(e){s=e.type,a=e.bytesPerElement},this.render=function(t,n){e.drawElements(o,n,s,t*a),r.update(n,o,1)},this.renderInstances=function(n,l,c){if(0===c)return;let u,h;if(i)u=e,h="drawElementsInstanced";else if(u=t.get("ANGLE_instanced_arrays"),h="drawElementsInstancedANGLE",null===u)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[h](o,l,s,n*a,c),r.update(l,o,c)}}function bo(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,r,n){switch(t.calls++,r){case 4:t.triangles+=n*(e/3);break;case 1:t.lines+=n*(e/2);break;case 3:t.lines+=n*(e-1);break;case 2:t.lines+=n*e;break;case 0:t.points+=n*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}function _o(e,t){return e[0]-t[0]}function xo(e,t){return Math.abs(t[1])-Math.abs(e[1])}function wo(e){const t={},r=new Float32Array(8),n=[];for(let e=0;e<8;e++)n[e]=[e,0];return{update:function(i,o,s,a){const l=i.morphTargetInfluences,c=void 0===l?0:l.length;let u=t[o.id];if(void 0===u||u.length!==c){u=[];for(let e=0;e<c;e++)u[e]=[e,0];t[o.id]=u}for(let e=0;e<c;e++){const t=u[e];t[0]=e,t[1]=l[e]}u.sort(xo);for(let e=0;e<8;e++)e<c&&u[e][1]?(n[e][0]=u[e][0],n[e][1]=u[e][1]):(n[e][0]=Number.MAX_SAFE_INTEGER,n[e][1]=0);n.sort(_o);const h=o.morphAttributes.position,d=o.morphAttributes.normal;let p=0;for(let e=0;e<8;e++){const t=n[e],i=t[0],s=t[1];i!==Number.MAX_SAFE_INTEGER&&s?(h&&o.getAttribute("morphTarget"+e)!==h[i]&&o.setAttribute("morphTarget"+e,h[i]),d&&o.getAttribute("morphNormal"+e)!==d[i]&&o.setAttribute("morphNormal"+e,d[i]),r[e]=s,p+=s):(h&&!0===o.hasAttribute("morphTarget"+e)&&o.deleteAttribute("morphTarget"+e),d&&!0===o.hasAttribute("morphNormal"+e)&&o.deleteAttribute("morphNormal"+e),r[e]=0)}const f=o.morphTargetsRelative?1:1-p;a.getUniforms().setValue(e,"morphTargetBaseInfluence",f),a.getUniforms().setValue(e,"morphTargetInfluences",r)}}}function So(e,t,r,n){let i=new WeakMap;function o(e){const t=e.target;t.removeEventListener("dispose",o),r.remove(t.instanceMatrix),null!==t.instanceColor&&r.remove(t.instanceColor)}return{update:function(e){const s=n.render.frame,a=e.geometry,l=t.get(e,a);return i.get(l)!==s&&(t.update(l),i.set(l,s)),e.isInstancedMesh&&(!1===e.hasEventListener("dispose",o)&&e.addEventListener("dispose",o),r.update(e.instanceMatrix,34962),null!==e.instanceColor&&r.update(e.instanceColor,34962)),l},dispose:function(){i=new WeakMap}}}class Mo extends or{constructor(e=null,t=1,r=1,n=1){super(null),this.image={data:e,width:t,height:r,depth:n},this.magFilter=se,this.minFilter=se,this.wrapR=ie,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Mo.prototype.isDataTexture2DArray=!0;class To extends or{constructor(e=null,t=1,r=1,n=1){super(null),this.image={data:e,width:t,height:r,depth:n},this.magFilter=se,this.minFilter=se,this.wrapR=ie,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}To.prototype.isDataTexture3D=!0;const Eo=new or,jo=new Mo,Ao=new To,Lo=new Ti,Co=[],Po=[],Ro=new Float32Array(16),Oo=new Float32Array(9),ko=new Float32Array(4);function Io(e,t,r){const n=e[0];if(n<=0||n>0)return e;const i=t*r;let o=Co[i];if(void 0===o&&(o=new Float32Array(i),Co[i]=o),0!==t){n.toArray(o,0);for(let n=1,i=0;n!==t;++n)i+=r,e[n].toArray(o,i)}return o}function Do(e,t){if(e.length!==t.length)return!1;for(let r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}function No(e,t){for(let r=0,n=t.length;r<n;r++)e[r]=t[r]}function Fo(e,t){let r=Po[t];void 0===r&&(r=new Int32Array(t),Po[t]=r);for(let n=0;n!==t;++n)r[n]=e.allocateTextureUnit();return r}function Uo(e,t){const r=this.cache;r[0]!==t&&(e.uniform1f(this.addr,t),r[0]=t)}function Bo(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),r[0]=t.x,r[1]=t.y);else{if(Do(r,t))return;e.uniform2fv(this.addr,t),No(r,t)}}function zo(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),r[0]=t.x,r[1]=t.y,r[2]=t.z);else if(void 0!==t.r)r[0]===t.r&&r[1]===t.g&&r[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),r[0]=t.r,r[1]=t.g,r[2]=t.b);else{if(Do(r,t))return;e.uniform3fv(this.addr,t),No(r,t)}}function Go(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z&&r[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=t.w);else{if(Do(r,t))return;e.uniform4fv(this.addr,t),No(r,t)}}function Vo(e,t){const r=this.cache,n=t.elements;if(void 0===n){if(Do(r,t))return;e.uniformMatrix2fv(this.addr,!1,t),No(r,t)}else{if(Do(r,n))return;ko.set(n),e.uniformMatrix2fv(this.addr,!1,ko),No(r,n)}}function Ho(e,t){const r=this.cache,n=t.elements;if(void 0===n){if(Do(r,t))return;e.uniformMatrix3fv(this.addr,!1,t),No(r,t)}else{if(Do(r,n))return;Oo.set(n),e.uniformMatrix3fv(this.addr,!1,Oo),No(r,n)}}function Wo(e,t){const r=this.cache,n=t.elements;if(void 0===n){if(Do(r,t))return;e.uniformMatrix4fv(this.addr,!1,t),No(r,t)}else{if(Do(r,n))return;Ro.set(n),e.uniformMatrix4fv(this.addr,!1,Ro),No(r,n)}}function qo(e,t){const r=this.cache;r[0]!==t&&(e.uniform1i(this.addr,t),r[0]=t)}function Xo(e,t){const r=this.cache;Do(r,t)||(e.uniform2iv(this.addr,t),No(r,t))}function Yo(e,t){const r=this.cache;Do(r,t)||(e.uniform3iv(this.addr,t),No(r,t))}function Zo(e,t){const r=this.cache;Do(r,t)||(e.uniform4iv(this.addr,t),No(r,t))}function Jo(e,t){const r=this.cache;r[0]!==t&&(e.uniform1ui(this.addr,t),r[0]=t)}function Ko(e,t){const r=this.cache;Do(r,t)||(e.uniform2uiv(this.addr,t),No(r,t))}function Qo(e,t){const r=this.cache;Do(r,t)||(e.uniform3uiv(this.addr,t),No(r,t))}function $o(e,t){const r=this.cache;Do(r,t)||(e.uniform4uiv(this.addr,t),No(r,t))}function es(e,t,r){const n=this.cache,i=r.allocateTextureUnit();n[0]!==i&&(e.uniform1i(this.addr,i),n[0]=i),r.safeSetTexture2D(t||Eo,i)}function ts(e,t,r){const n=this.cache,i=r.allocateTextureUnit();n[0]!==i&&(e.uniform1i(this.addr,i),n[0]=i),r.setTexture3D(t||Ao,i)}function rs(e,t,r){const n=this.cache,i=r.allocateTextureUnit();n[0]!==i&&(e.uniform1i(this.addr,i),n[0]=i),r.safeSetTextureCube(t||Lo,i)}function ns(e,t,r){const n=this.cache,i=r.allocateTextureUnit();n[0]!==i&&(e.uniform1i(this.addr,i),n[0]=i),r.setTexture2DArray(t||jo,i)}function is(e,t){e.uniform1fv(this.addr,t)}function os(e,t){const r=Io(t,this.size,2);e.uniform2fv(this.addr,r)}function ss(e,t){const r=Io(t,this.size,3);e.uniform3fv(this.addr,r)}function as(e,t){const r=Io(t,this.size,4);e.uniform4fv(this.addr,r)}function ls(e,t){const r=Io(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,r)}function cs(e,t){const r=Io(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,r)}function us(e,t){const r=Io(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,r)}function hs(e,t){e.uniform1iv(this.addr,t)}function ds(e,t){e.uniform2iv(this.addr,t)}function ps(e,t){e.uniform3iv(this.addr,t)}function fs(e,t){e.uniform4iv(this.addr,t)}function ms(e,t){e.uniform1uiv(this.addr,t)}function ys(e,t){e.uniform2uiv(this.addr,t)}function gs(e,t){e.uniform3uiv(this.addr,t)}function vs(e,t){e.uniform4uiv(this.addr,t)}function bs(e,t,r){const n=t.length,i=Fo(r,n);e.uniform1iv(this.addr,i);for(let e=0;e!==n;++e)r.safeSetTexture2D(t[e]||Eo,i[e])}function _s(e,t,r){const n=t.length,i=Fo(r,n);e.uniform1iv(this.addr,i);for(let e=0;e!==n;++e)r.safeSetTextureCube(t[e]||Lo,i[e])}function xs(e,t,r){this.id=e,this.addr=r,this.cache=[],this.setValue=function(e){switch(e){case 5126:return Uo;case 35664:return Bo;case 35665:return zo;case 35666:return Go;case 35674:return Vo;case 35675:return Ho;case 35676:return Wo;case 5124:case 35670:return qo;case 35667:case 35671:return Xo;case 35668:case 35672:return Yo;case 35669:case 35673:return Zo;case 5125:return Jo;case 36294:return Ko;case 36295:return Qo;case 36296:return $o;case 35678:case 36198:case 36298:case 36306:case 35682:return es;case 35679:case 36299:case 36307:return ts;case 35680:case 36300:case 36308:case 36293:return rs;case 36289:case 36303:case 36311:case 36292:return ns}}(t.type)}function ws(e,t,r){this.id=e,this.addr=r,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return is;case 35664:return os;case 35665:return ss;case 35666:return as;case 35674:return ls;case 35675:return cs;case 35676:return us;case 5124:case 35670:return hs;case 35667:case 35671:return ds;case 35668:case 35672:return ps;case 35669:case 35673:return fs;case 5125:return ms;case 36294:return ys;case 36295:return gs;case 36296:return vs;case 35678:case 36198:case 36298:case 36306:case 35682:return bs;case 35680:case 36300:case 36308:case 36293:return _s}}(t.type)}function Ss(e){this.id=e,this.seq=[],this.map={}}ws.prototype.updateCache=function(e){const t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),No(t,e)},Ss.prototype.setValue=function(e,t,r){const n=this.seq;for(let i=0,o=n.length;i!==o;++i){const o=n[i];o.setValue(e,t[o.id],r)}};const Ms=/(\w+)(\])?(\[|\.)?/g;function Ts(e,t){e.seq.push(t),e.map[t.id]=t}function Es(e,t,r){const n=e.name,i=n.length;for(Ms.lastIndex=0;;){const o=Ms.exec(n),s=Ms.lastIndex;let a=o[1];const l="]"===o[2],c=o[3];if(l&&(a|=0),void 0===c||"["===c&&s+2===i){Ts(r,void 0===c?new xs(a,e,t):new ws(a,e,t));break}{let e=r.map[a];void 0===e&&(e=new Ss(a),Ts(r,e)),r=e}}}function js(e,t){this.seq=[],this.map={};const r=e.getProgramParameter(t,35718);for(let n=0;n<r;++n){const r=e.getActiveUniform(t,n);Es(r,e.getUniformLocation(t,r.name),this)}}function As(e,t,r){const n=e.createShader(t);return e.shaderSource(n,r),e.compileShader(n),n}js.prototype.setValue=function(e,t,r,n){const i=this.map[t];void 0!==i&&i.setValue(e,r,n)},js.prototype.setOptional=function(e,t,r){const n=t[r];void 0!==n&&this.setValue(e,r,n)},js.upload=function(e,t,r,n){for(let i=0,o=t.length;i!==o;++i){const o=t[i],s=r[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,n)}},js.seqWithValue=function(e,t){const r=[];for(let n=0,i=e.length;n!==i;++n){const i=e[n];i.id in t&&r.push(i)}return r};let Ls=0;function Cs(e){switch(e){case Ct:return["Linear","( value )"];case Pt:return["sRGB","( value )"];case Ot:return["RGBE","( value )"];case It:return["RGBM","( value, 7.0 )"];case Dt:return["RGBM","( value, 16.0 )"];case Nt:return["RGBD","( value, 256.0 )"];case Rt:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case kt:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function Ps(e,t,r){const n=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();return n&&""===i?"":r.toUpperCase()+"\n\n"+i+"\n\n"+function(e){const t=e.split("\n");for(let e=0;e<t.length;e++)t[e]=e+1+": "+t[e];return t.join("\n")}(e.getShaderSource(t))}function Rs(e,t){const r=Cs(t);return"vec4 "+e+"( vec4 value ) { return "+r[0]+"ToLinear"+r[1]+"; }"}function Os(e,t){const r=Cs(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+r[0]+r[1]+"; }"}function ks(e,t){let r;switch(t){case q:r="Linear";break;case X:r="Reinhard";break;case Y:r="OptimizedCineon";break;case Z:r="ACESFilmic";break;case J:r="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),r="Linear"}return"vec3 "+e+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function Is(e){return""!==e}function Ds(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_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Ns(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Fs=/^[ \t]*#include +<([\w\d./]+)>/gm;function Us(e){return e.replace(Fs,Bs)}function Bs(e,t){const r=Ni[t];if(void 0===r)throw new Error("Can not resolve #include <"+t+">");return Us(r)}const zs=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Gs=/#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 Vs(e){return e.replace(Gs,Ws).replace(zs,Hs)}function Hs(e,t,r,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Ws(0,t,r,n)}function Ws(e,t,r,n){let i="";for(let e=parseInt(t);e<parseInt(r);e++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return i}function qs(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Xs(e,t,r,n){const i=e.getContext(),o=r.defines;let c=r.vertexShader,u=r.fragmentShader;const h=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===s?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===a?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===l&&(t="SHADOWMAP_TYPE_VSM"),t}(r),d=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case K:case Q:t="ENVMAP_TYPE_CUBE";break;case te:case re:t="ENVMAP_TYPE_CUBE_UV"}return t}(r),p=function(e){let t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case Q:case re:t="ENVMAP_MODE_REFRACTION"}return t}(r),f=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case G:t="ENVMAP_BLENDING_MULTIPLY";break;case V:t="ENVMAP_BLENDING_MIX";break;case H:t="ENVMAP_BLENDING_ADD"}return t}(r),m=e.gammaFactor>0?e.gammaFactor:1,y=r.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.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Is).join("\n")}(r),g=function(e){const t=[];for(const r in e){const n=e[r];!1!==n&&t.push("#define "+r+" "+n)}return t.join("\n")}(o),v=i.createProgram();let b,_,x=r.glslVersion?"#version "+r.glslVersion+"\n":"";r.isRawShaderMaterial?(b=[g].filter(Is).join("\n"),b.length>0&&(b+="\n"),_=[y,g].filter(Is).join("\n"),_.length>0&&(_+="\n")):(b=[qs(r),"#define SHADER_NAME "+r.shaderName,g,r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+m,"#define MAX_BONES "+r.maxBones,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+p:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",r.specularTintMap?"#define USE_SPECULARTINTMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+h:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( 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(Is).join("\n"),_=[y,qs(r),"#define SHADER_NAME "+r.shaderName,g,"#define GAMMA_FACTOR "+m,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+d:"",r.envMap?"#define "+p:"",r.envMap?"#define "+f:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",r.specularTintMap?"#define USE_SPECULARTINTMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.sheenTint?"#define USE_SHEEN":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+h:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(r.extensionShaderTextureLOD||r.envMap)&&r.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==W?"#define TONE_MAPPING":"",r.toneMapping!==W?Ni.tonemapping_pars_fragment:"",r.toneMapping!==W?ks("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.format===Te?"#define OPAQUE":"",Ni.encodings_pars_fragment,r.map?Rs("mapTexelToLinear",r.mapEncoding):"",r.matcap?Rs("matcapTexelToLinear",r.matcapEncoding):"",r.envMap?Rs("envMapTexelToLinear",r.envMapEncoding):"",r.emissiveMap?Rs("emissiveMapTexelToLinear",r.emissiveMapEncoding):"",r.specularTintMap?Rs("specularTintMapTexelToLinear",r.specularTintMapEncoding):"",r.lightMap?Rs("lightMapTexelToLinear",r.lightMapEncoding):"",Os("linearToOutputTexel",r.outputEncoding),r.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Is).join("\n")),c=Us(c),c=Ds(c,r),c=Ns(c,r),u=Us(u),u=Ds(u,r),u=Ns(u,r),c=Vs(c),u=Vs(u),r.isWebGL2&&!0!==r.isRawShaderMaterial&&(x="#version 300 es\n",b=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+b,_=["#define varying in",r.glslVersion===Ht?"":"out highp vec4 pc_fragColor;",r.glslVersion===Ht?"":"#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"+_);const w=x+_+u,S=As(i,35633,x+b+c),M=As(i,35632,w);if(i.attachShader(v,S),i.attachShader(v,M),void 0!==r.index0AttributeName?i.bindAttribLocation(v,0,r.index0AttributeName):!0===r.morphTargets&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v),e.debug.checkShaderErrors){const e=i.getProgramInfoLog(v).trim(),t=i.getShaderInfoLog(S).trim(),r=i.getShaderInfoLog(M).trim();let n=!0,o=!0;if(!1===i.getProgramParameter(v,35714)){n=!1;const t=Ps(i,S,"vertex"),r=Ps(i,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,35715)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+r)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==t&&""!==r||(o=!1);o&&(this.diagnostics={runnable:n,programLog:e,vertexShader:{log:t,prefix:b},fragmentShader:{log:r,prefix:_}})}let T,E;return i.deleteShader(S),i.deleteShader(M),this.getUniforms=function(){return void 0===T&&(T=new js(i,v)),T},this.getAttributes=function(){return void 0===E&&(E=function(e,t){const r={},n=e.getProgramParameter(t,35721);for(let i=0;i<n;i++){const n=e.getActiveAttrib(t,i),o=n.name;let s=1;35674===n.type&&(s=2),35675===n.type&&(s=3),35676===n.type&&(s=4),r[o]={type:n.type,location:e.getAttribLocation(t,o),locationSize:s}}return r}(i,v)),E},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.name=r.shaderName,this.id=Ls++,this.cacheKey=t,this.usedTimes=1,this.program=v,this.vertexShader=S,this.fragmentShader=M,this}function Ys(e,t,r,n,i,o,s){const a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,d=i.floatVertexTextures,p=i.maxVertexUniforms,f=i.vertexTextures;let m=i.precision;const y={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"},g=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoat","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","alphaTest","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","format","sheenTint","transmission","transmissionMap","thicknessMap"];function v(e){let t;return e&&e.isTexture?t=e.encoding:e&&e.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding):t=Ct,t}return{getParameters:function(o,a,g,b,_){const x=b.fog,w=o.isMeshStandardMaterial?b.environment:null,S=(o.isMeshStandardMaterial?r:t).get(o.envMap||w),M=y[o.type],T=_.isSkinnedMesh?function(e){const t=e.skeleton.bones;if(d)return 1024;{const e=p,r=Math.floor((e-20)/4),n=Math.min(r,t.length);return n<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+n+"."),0):n}}(_):0;let E,j;if(null!==o.precision&&(m=i.getMaxPrecision(o.precision),m!==o.precision&&console.warn("THREE.WebGLProgram.getParameters:",o.precision,"not supported, using",m,"instead.")),M){const e=Ui[M];E=e.vertexShader,j=e.fragmentShader}else E=o.vertexShader,j=o.fragmentShader;const A=e.getRenderTarget(),L=o.alphaTest>0,C=o.clearcoat>0;return{isWebGL2:l,shaderID:M,shaderName:o.type,vertexShader:E,fragmentShader:j,defines:o.defines,isRawShaderMaterial:!0===o.isRawShaderMaterial,glslVersion:o.glslVersion,precision:m,instancing:!0===_.isInstancedMesh,instancingColor:!0===_.isInstancedMesh&&null!==_.instanceColor,supportsVertexTextures:f,outputEncoding:null!==A?v(A.texture):e.outputEncoding,map:!!o.map,mapEncoding:v(o.map),matcap:!!o.matcap,matcapEncoding:v(o.matcap),envMap:!!S,envMapMode:S&&S.mapping,envMapEncoding:v(S),envMapCubeUV:!!S&&(S.mapping===te||S.mapping===re),lightMap:!!o.lightMap,lightMapEncoding:v(o.lightMap),aoMap:!!o.aoMap,emissiveMap:!!o.emissiveMap,emissiveMapEncoding:v(o.emissiveMap),bumpMap:!!o.bumpMap,normalMap:!!o.normalMap,objectSpaceNormalMap:o.normalMapType===Bt,tangentSpaceNormalMap:o.normalMapType===Ut,clearcoat:C,clearcoatMap:C&&!!o.clearcoatMap,clearcoatRoughnessMap:C&&!!o.clearcoatRoughnessMap,clearcoatNormalMap:C&&!!o.clearcoatNormalMap,displacementMap:!!o.displacementMap,roughnessMap:!!o.roughnessMap,metalnessMap:!!o.metalnessMap,specularMap:!!o.specularMap,specularIntensityMap:!!o.specularIntensityMap,specularTintMap:!!o.specularTintMap,specularTintMapEncoding:v(o.specularTintMap),alphaMap:!!o.alphaMap,alphaTest:L,gradientMap:!!o.gradientMap,sheenTint:!!o.sheenTint&&(o.sheenTint.r>0||o.sheenTint.g>0||o.sheenTint.b>0),transmission:o.transmission>0,transmissionMap:!!o.transmissionMap,thicknessMap:!!o.thicknessMap,combine:o.combine,vertexTangents:!!o.normalMap&&!!_.geometry&&!!_.geometry.attributes.tangent,vertexColors:o.vertexColors,vertexAlphas:!0===o.vertexColors&&!!_.geometry&&!!_.geometry.attributes.color&&4===_.geometry.attributes.color.itemSize,vertexUvs:!!(o.map||o.bumpMap||o.normalMap||o.specularMap||o.alphaMap||o.emissiveMap||o.roughnessMap||o.metalnessMap||o.clearcoatMap||o.clearcoatRoughnessMap||o.clearcoatNormalMap||o.displacementMap||o.transmissionMap||o.thicknessMap||o.specularIntensityMap||o.specularTintMap),uvsVertexOnly:!(o.map||o.bumpMap||o.normalMap||o.specularMap||o.alphaMap||o.emissiveMap||o.roughnessMap||o.metalnessMap||o.clearcoatNormalMap||o.transmission>0||o.transmissionMap||o.thicknessMap||o.specularIntensityMap||o.specularTintMap||!o.displacementMap),fog:!!x,useFog:o.fog,fogExp2:x&&x.isFogExp2,flatShading:!!o.flatShading,sizeAttenuation:o.sizeAttenuation,logarithmicDepthBuffer:c,skinning:!0===_.isSkinnedMesh&&T>0,maxBones:T,useVertexTexture:d,morphTargets:!!_.geometry&&!!_.geometry.morphAttributes.position,morphNormals:!!_.geometry&&!!_.geometry.morphAttributes.normal,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:s.numPlanes,numClipIntersection:s.numIntersection,format:o.format,dithering:o.dithering,shadowMapEnabled:e.shadowMap.enabled&&g.length>0,shadowMapType:e.shadowMap.type,toneMapping:o.toneMapped?e.toneMapping:W,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:o.premultipliedAlpha,doubleSided:o.side===h,flipSided:o.side===u,depthPacking:void 0!==o.depthPacking&&o.depthPacking,index0AttributeName:o.index0AttributeName,extensionDerivatives:o.extensions&&o.extensions.derivatives,extensionFragDepth:o.extensions&&o.extensions.fragDepth,extensionDrawBuffers:o.extensions&&o.extensions.drawBuffers,extensionShaderTextureLOD:o.extensions&&o.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:o.customProgramCacheKey()}},getProgramCacheKey:function(t){const r=[];if(t.shaderID?r.push(t.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(const e in t.defines)r.push(e),r.push(t.defines[e]);if(!1===t.isRawShaderMaterial){for(let e=0;e<g.length;e++)r.push(t[g[e]]);r.push(e.outputEncoding),r.push(e.gammaFactor)}return r.push(t.customProgramCacheKey),r.join()},getUniforms:function(e){const t=y[e.type];let r;if(t){const e=Ui[t];r=bi.clone(e.uniforms)}else r=e.uniforms;return r},acquireProgram:function(t,r){let n;for(let e=0,t=a.length;e<t;e++){const t=a[e];if(t.cacheKey===r){n=t,++n.usedTimes;break}}return void 0===n&&(n=new Xs(e,r,t,o),a.push(n)),n},releaseProgram:function(e){if(0==--e.usedTimes){const t=a.indexOf(e);a[t]=a[a.length-1],a.pop(),e.destroy()}},programs:a}}function Zs(){let e=new WeakMap;return{get:function(t){let r=e.get(t);return void 0===r&&(r={},e.set(t,r)),r},remove:function(t){e.delete(t)},update:function(t,r,n){e.get(t)[r]=n},dispose:function(){e=new WeakMap}}}function Js(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 Ks(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 Qs(e){const t=[];let r=0;const n=[],i=[],o=[],s={id:-1};function a(n,i,o,a,l,c){let u=t[r];const h=e.get(o);return void 0===u?(u={id:n.id,object:n,geometry:i,material:o,program:h.program||s,groupOrder:a,renderOrder:n.renderOrder,z:l,group:c},t[r]=u):(u.id=n.id,u.object=n,u.geometry=i,u.material=o,u.program=h.program||s,u.groupOrder=a,u.renderOrder=n.renderOrder,u.z=l,u.group=c),r++,u}return{opaque:n,transmissive:i,transparent:o,init:function(){r=0,n.length=0,i.length=0,o.length=0},push:function(e,t,r,s,l,c){const u=a(e,t,r,s,l,c);r.transmission>0?i.push(u):!0===r.transparent?o.push(u):n.push(u)},unshift:function(e,t,r,s,l,c){const u=a(e,t,r,s,l,c);r.transmission>0?i.unshift(u):!0===r.transparent?o.unshift(u):n.unshift(u)},finish:function(){for(let e=r,n=t.length;e<n;e++){const r=t[e];if(null===r.id)break;r.id=null,r.object=null,r.geometry=null,r.material=null,r.program=null,r.group=null}},sort:function(e,t){n.length>1&&n.sort(e||Js),i.length>1&&i.sort(t||Ks),o.length>1&&o.sort(t||Ks)}}}function $s(e){let t=new WeakMap;return{get:function(r,n){let i;return!1===t.has(r)?(i=new Qs(e),t.set(r,[i])):n>=t.get(r).length?(i=new Qs(e),t.get(r).push(i)):i=t.get(r)[n],i},dispose:function(){t=new WeakMap}}}function ea(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let r;switch(t.type){case"DirectionalLight":r={direction:new hr,color:new kn};break;case"SpotLight":r={position:new hr,direction:new hr,color:new kn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new hr,color:new kn,distance:0,decay:0};break;case"HemisphereLight":r={direction:new hr,skyColor:new kn,groundColor:new kn};break;case"RectAreaLight":r={color:new kn,position:new hr,halfWidth:new hr,halfHeight:new hr}}return e[t.id]=r,r}}}let ta=0;function ra(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function na(e,t){const r=new ea,n=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let r;switch(t.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new er};break;case"PointLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new er,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=r,r}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)i.probe.push(new hr);const o=new hr,s=new Gr,a=new Gr;return{setup:function(o,s){let a=0,l=0,c=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let u=0,h=0,d=0,p=0,f=0,m=0,y=0,g=0;o.sort(ra);const v=!0!==s?Math.PI:1;for(let e=0,t=o.length;e<t;e++){const t=o[e],s=t.color,b=t.intensity,_=t.distance,x=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)a+=s.r*b*v,l+=s.g*b*v,c+=s.b*b*v;else if(t.isLightProbe)for(let e=0;e<9;e++)i.probe[e].addScaledVector(t.sh.coefficients[e],b);else if(t.isDirectionalLight){const e=r.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*v),t.castShadow){const e=t.shadow,r=n.get(t);r.shadowBias=e.bias,r.shadowNormalBias=e.normalBias,r.shadowRadius=e.radius,r.shadowMapSize=e.mapSize,i.directionalShadow[u]=r,i.directionalShadowMap[u]=x,i.directionalShadowMatrix[u]=t.shadow.matrix,m++}i.directional[u]=e,u++}else if(t.isSpotLight){const e=r.get(t);if(e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(s).multiplyScalar(b*v),e.distance=_,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,t.castShadow){const e=t.shadow,r=n.get(t);r.shadowBias=e.bias,r.shadowNormalBias=e.normalBias,r.shadowRadius=e.radius,r.shadowMapSize=e.mapSize,i.spotShadow[d]=r,i.spotShadowMap[d]=x,i.spotShadowMatrix[d]=t.shadow.matrix,g++}i.spot[d]=e,d++}else if(t.isRectAreaLight){const e=r.get(t);e.color.copy(s).multiplyScalar(b),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),i.rectArea[p]=e,p++}else if(t.isPointLight){const e=r.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*v),e.distance=t.distance,e.decay=t.decay,t.castShadow){const e=t.shadow,r=n.get(t);r.shadowBias=e.bias,r.shadowNormalBias=e.normalBias,r.shadowRadius=e.radius,r.shadowMapSize=e.mapSize,r.shadowCameraNear=e.camera.near,r.shadowCameraFar=e.camera.far,i.pointShadow[h]=r,i.pointShadowMap[h]=x,i.pointShadowMatrix[h]=t.shadow.matrix,y++}i.point[h]=e,h++}else if(t.isHemisphereLight){const e=r.get(t);e.skyColor.copy(t.color).multiplyScalar(b*v),e.groundColor.copy(t.groundColor).multiplyScalar(b*v),i.hemi[f]=e,f++}}p>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=Fi.LTC_FLOAT_1,i.rectAreaLTC2=Fi.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=Fi.LTC_HALF_1,i.rectAreaLTC2=Fi.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=a,i.ambient[1]=l,i.ambient[2]=c;const b=i.hash;b.directionalLength===u&&b.pointLength===h&&b.spotLength===d&&b.rectAreaLength===p&&b.hemiLength===f&&b.numDirectionalShadows===m&&b.numPointShadows===y&&b.numSpotShadows===g||(i.directional.length=u,i.spot.length=d,i.rectArea.length=p,i.point.length=h,i.hemi.length=f,i.directionalShadow.length=m,i.directionalShadowMap.length=m,i.pointShadow.length=y,i.pointShadowMap.length=y,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=m,i.pointShadowMatrix.length=y,i.spotShadowMatrix.length=g,b.directionalLength=u,b.pointLength=h,b.spotLength=d,b.rectAreaLength=p,b.hemiLength=f,b.numDirectionalShadows=m,b.numPointShadows=y,b.numSpotShadows=g,i.version=ta++)},setupView:function(e,t){let r=0,n=0,l=0,c=0,u=0;const h=t.matrixWorldInverse;for(let t=0,d=e.length;t<d;t++){const d=e[t];if(d.isDirectionalLight){const e=i.directional[r];e.direction.setFromMatrixPosition(d.matrixWorld),o.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(o),e.direction.transformDirection(h),r++}else if(d.isSpotLight){const e=i.spot[l];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),e.direction.setFromMatrixPosition(d.matrixWorld),o.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(o),e.direction.transformDirection(h),l++}else if(d.isRectAreaLight){const e=i.rectArea[c];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),a.identity(),s.copy(d.matrixWorld),s.premultiply(h),a.extractRotation(s),e.halfWidth.set(.5*d.width,0,0),e.halfHeight.set(0,.5*d.height,0),e.halfWidth.applyMatrix4(a),e.halfHeight.applyMatrix4(a),c++}else if(d.isPointLight){const e=i.point[n];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),n++}else if(d.isHemisphereLight){const e=i.hemi[u];e.direction.setFromMatrixPosition(d.matrixWorld),e.direction.transformDirection(h),e.direction.normalize(),u++}}},state:i}}function ia(e,t){const r=new na(e,t),n=[],i=[];return{init:function(){n.length=0,i.length=0},state:{lightsArray:n,shadowsArray:i,lights:r},setupLights:function(e){r.setup(n,e)},setupLightsView:function(e){r.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){i.push(e)}}}function oa(e,t){let r=new WeakMap;return{get:function(n,i=0){let o;return!1===r.has(n)?(o=new ia(e,t),r.set(n,[o])):i>=r.get(n).length?(o=new ia(e,t),r.get(n).push(o)):o=r.get(n)[i],o},dispose:function(){r=new WeakMap}}}class sa extends jn{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}sa.prototype.isMeshDepthMaterial=!0;class aa extends jn{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new hr,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}aa.prototype.isMeshDistanceMaterial=!0;var la="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nuniform float samples;\n#include <packing>\nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}",ca="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";function ua(e,t,r){let n=new Oi;const i=new er,o=new er,a=new ar,p=new sa({depthPacking:Ft}),f=new aa,m={},y=r.maxTextureSize,g={0:u,1:c,2:h},v=new _i({uniforms:{shadow_pass:{value:null},resolution:{value:new er},radius:{value:4},samples:{value:8}},vertexShader:ca,fragmentShader:la}),b=v.clone();b.defines.HORIZONTAL_PASS=1;const _=new Jn;_.setAttribute("position",new Fn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new fi(_,v),w=this;function S(r,n){const i=t.update(x);v.uniforms.shadow_pass.value=r.map.texture,v.uniforms.resolution.value=r.mapSize,v.uniforms.radius.value=r.radius,v.uniforms.samples.value=r.blurSamples,e.setRenderTarget(r.mapPass),e.clear(),e.renderBufferDirect(n,null,i,v,x,null),b.uniforms.shadow_pass.value=r.mapPass.texture,b.uniforms.resolution.value=r.mapSize,b.uniforms.radius.value=r.radius,b.uniforms.samples.value=r.blurSamples,e.setRenderTarget(r.map),e.clear(),e.renderBufferDirect(n,null,i,b,x,null)}function M(t,r,n,i,o,s,a){let c=null;const u=!0===i.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(c=void 0!==u?u:!0===i.isPointLight?f:p,e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0){const e=c.uuid,t=n.uuid;let r=m[e];void 0===r&&(r={},m[e]=r);let i=r[t];void 0===i&&(i=c.clone(),r[t]=i),c=i}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=a===l?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:g[n.side],c.alphaMap=n.alphaMap,c.alphaTest=n.alphaTest,c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.displacementMap=n.displacementMap,c.displacementScale=n.displacementScale,c.displacementBias=n.displacementBias,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,!0===i.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(i.matrixWorld),c.nearDistance=o,c.farDistance=s),c}function T(r,i,o,s,a){if(!1===r.visible)return;if(r.layers.test(i.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&a===l)&&(!r.frustumCulled||n.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,r.matrixWorld);const n=t.update(r),i=r.material;if(Array.isArray(i)){const t=n.groups;for(let l=0,c=t.length;l<c;l++){const c=t[l],u=i[c.materialIndex];if(u&&u.visible){const t=M(r,0,u,s,o.near,o.far,a);e.renderBufferDirect(o,null,n,t,r,c)}}}else if(i.visible){const t=M(r,0,i,s,o.near,o.far,a);e.renderBufferDirect(o,null,n,t,r,null)}}const c=r.children;for(let e=0,t=c.length;e<t;e++)T(c[e],i,o,s,a)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=s,this.render=function(t,r,s){if(!1===w.enabled)return;if(!1===w.autoUpdate&&!1===w.needsUpdate)return;if(0===t.length)return;const c=e.getRenderTarget(),u=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),p=e.state;p.setBlending(d),p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);for(let c=0,u=t.length;c<u;c++){const u=t[c],h=u.shadow;if(void 0===h){console.warn("THREE.WebGLShadowMap:",u,"has no shadow.");continue}if(!1===h.autoUpdate&&!1===h.needsUpdate)continue;i.copy(h.mapSize);const d=h.getFrameExtents();if(i.multiply(d),o.copy(h.mapSize),(i.x>y||i.y>y)&&(i.x>y&&(o.x=Math.floor(y/d.x),i.x=o.x*d.x,h.mapSize.x=o.x),i.y>y&&(o.y=Math.floor(y/d.y),i.y=o.y*d.y,h.mapSize.y=o.y)),null===h.map&&!h.isPointLightShadow&&this.type===l){const e={minFilter:ce,magFilter:ce,format:Ee};h.map=new lr(i.x,i.y,e),h.map.texture.name=u.name+".shadowMap",h.mapPass=new lr(i.x,i.y,e),h.camera.updateProjectionMatrix()}if(null===h.map){const e={minFilter:se,magFilter:se,format:Ee};h.map=new lr(i.x,i.y,e),h.map.texture.name=u.name+".shadowMap",h.camera.updateProjectionMatrix()}e.setRenderTarget(h.map),e.clear();const f=h.getViewportCount();for(let e=0;e<f;e++){const t=h.getViewport(e);a.set(o.x*t.x,o.y*t.y,o.x*t.z,o.y*t.w),p.viewport(a),h.updateMatrices(u,e),n=h.getFrustum(),T(r,s,h.camera,u,this.type)}h.isPointLightShadow||this.type!==l||S(h,s),h.needsUpdate=!1}w.needsUpdate=!1,e.setRenderTarget(c,u,h)}}function ha(e,t,r){const s=r.isWebGL2,a=new function(){let t=!1;const r=new ar;let n=null;const i=new ar(0,0,0,0);return{setMask:function(r){n===r||t||(e.colorMask(r,r,r,r),n=r)},setLocked:function(e){t=e},setClear:function(t,n,o,s,a){!0===a&&(t*=s,n*=s,o*=s),r.set(t,n,o,s),!1===i.equals(r)&&(e.clearColor(t,n,o,s),i.copy(r))},reset:function(){t=!1,n=null,i.set(-1,0,0,0)}}},l=new function(){let t=!1,r=null,n=null,i=null;return{setTest:function(e){e?ve(2929):be(2929)},setMask:function(n){r===n||t||(e.depthMask(n),r=n)},setFunc:function(t){if(n!==t){if(t)switch(t){case k:e.depthFunc(512);break;case I:e.depthFunc(519);break;case D:e.depthFunc(513);break;case N:e.depthFunc(515);break;case F:e.depthFunc(514);break;case U:e.depthFunc(518);break;case B:e.depthFunc(516);break;case z:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);n=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,r=null,n=null,i=null}}},c=new function(){let t=!1,r=null,n=null,i=null,o=null,s=null,a=null,l=null,c=null;return{setTest:function(e){t||(e?ve(2960):be(2960))},setMask:function(n){r===n||t||(e.stencilMask(n),r=n)},setFunc:function(t,r,s){n===t&&i===r&&o===s||(e.stencilFunc(t,r,s),n=t,i=r,o=s)},setOp:function(t,r,n){s===t&&a===r&&l===n||(e.stencilOp(t,r,n),s=t,a=r,l=n)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,r=null,n=null,i=null,o=null,s=null,a=null,l=null,c=null}}};let G={},V=null,H={},W=null,q=!1,X=null,Y=null,Z=null,J=null,K=null,Q=null,$=null,ee=!1,te=null,re=null,ne=null,ie=null,oe=null;const se=e.getParameter(35661);let ae=!1,le=0;const ce=e.getParameter(7938);-1!==ce.indexOf("WebGL")?(le=parseFloat(/^WebGL (\d)/.exec(ce)[1]),ae=le>=1):-1!==ce.indexOf("OpenGL ES")&&(le=parseFloat(/^OpenGL ES (\d)/.exec(ce)[1]),ae=le>=2);let ue=null,he={};const de=e.getParameter(3088),pe=e.getParameter(2978),fe=(new ar).fromArray(de),me=(new ar).fromArray(pe);function ye(t,r,n){const i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;t<n;t++)e.texImage2D(r+t,0,6408,1,1,0,6408,5121,i);return o}const ge={};function ve(t){!0!==G[t]&&(e.enable(t),G[t]=!0)}function be(t){!1!==G[t]&&(e.disable(t),G[t]=!1)}ge[3553]=ye(3553,3553,1),ge[34067]=ye(34067,34069,6),a.setClear(0,0,0,1),l.setClear(1),c.setClear(0),ve(2929),l.setFunc(N),Se(!1),Me(i),ve(2884),we(d);const _e={[v]:32774,[b]:32778,[_]:32779};if(s)_e[x]=32775,_e[w]=32776;else{const e=t.get("EXT_blend_minmax");null!==e&&(_e[x]=e.MIN_EXT,_e[w]=e.MAX_EXT)}const xe={[S]:0,[M]:1,[T]:768,[j]:770,[O]:776,[P]:774,[L]:772,[E]:769,[A]:771,[R]:775,[C]:773};function we(t,r,n,i,o,s,a,l){if(t!==d){if(!1===q&&(ve(3042),q=!0),t===g)o=o||r,s=s||n,a=a||i,r===Y&&o===K||(e.blendEquationSeparate(_e[r],_e[o]),Y=r,K=o),n===Z&&i===J&&s===Q&&a===$||(e.blendFuncSeparate(xe[n],xe[i],xe[s],xe[a]),Z=n,J=i,Q=s,$=a),X=t,ee=null;else if(t!==X||l!==ee){if(Y===v&&K===v||(e.blendEquation(32774),Y=v,K=v),l)switch(t){case p:e.blendFuncSeparate(1,771,1,771);break;case f:e.blendFunc(1,1);break;case m:e.blendFuncSeparate(0,0,769,771);break;case y:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case p:e.blendFuncSeparate(770,771,1,771);break;case f:e.blendFunc(770,1);break;case m:e.blendFunc(0,769);break;case y:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}Z=null,J=null,Q=null,$=null,X=t,ee=l}}else!0===q&&(be(3042),q=!1)}function Se(t){te!==t&&(t?e.frontFace(2304):e.frontFace(2305),te=t)}function Me(t){t!==n?(ve(2884),t!==re&&(t===i?e.cullFace(1029):t===o?e.cullFace(1028):e.cullFace(1032))):be(2884),re=t}function Te(t,r,n){t?(ve(32823),ie===r&&oe===n||(e.polygonOffset(r,n),ie=r,oe=n)):be(32823)}function Ee(t){void 0===t&&(t=33984+se-1),ue!==t&&(e.activeTexture(t),ue=t)}return{buffers:{color:a,depth:l,stencil:c},enable:ve,disable:be,bindFramebuffer:function(t,r){return null===r&&null!==V&&(r=V),H[t]!==r&&(e.bindFramebuffer(t,r),H[t]=r,s&&(36009===t&&(H[36160]=r),36160===t&&(H[36009]=r)),!0)},bindXRFramebuffer:function(t){t!==V&&(e.bindFramebuffer(36160,t),V=t)},useProgram:function(t){return W!==t&&(e.useProgram(t),W=t,!0)},setBlending:we,setMaterial:function(e,t){e.side===h?be(2884):ve(2884);let r=e.side===u;t&&(r=!r),Se(r),e.blending===p&&!1===e.transparent?we(d):we(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),l.setFunc(e.depthFunc),l.setTest(e.depthTest),l.setMask(e.depthWrite),a.setMask(e.colorWrite);const n=e.stencilWrite;c.setTest(n),n&&(c.setMask(e.stencilWriteMask),c.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),c.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),Te(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?ve(32926):be(32926)},setFlipSided:Se,setCullFace:Me,setLineWidth:function(t){t!==ne&&(ae&&e.lineWidth(t),ne=t)},setPolygonOffset:Te,setScissorTest:function(e){e?ve(3089):be(3089)},activeTexture:Ee,bindTexture:function(t,r){null===ue&&Ee();let n=he[ue];void 0===n&&(n={type:void 0,texture:void 0},he[ue]=n),n.type===t&&n.texture===r||(e.bindTexture(t,r||ge[t]),n.type=t,n.texture=r)},unbindTexture:function(){const t=he[ue];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===fe.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),fe.copy(t))},viewport:function(t){!1===me.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),me.copy(t))},reset:function(){e.disable(3042),e.disable(2884),e.disable(2929),e.disable(32823),e.disable(3089),e.disable(2960),e.disable(32926),e.blendEquation(32774),e.blendFunc(1,0),e.blendFuncSeparate(1,0,1,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(513),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(519,0,4294967295),e.stencilOp(7680,7680,7680),e.clearStencil(0),e.cullFace(1029),e.frontFace(2305),e.polygonOffset(0,0),e.activeTexture(33984),e.bindFramebuffer(36160,null),!0===s&&(e.bindFramebuffer(36009,null),e.bindFramebuffer(36008,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),G={},ue=null,he={},V=null,H={},W=null,q=!1,X=null,Y=null,Z=null,J=null,K=null,Q=null,$=null,ee=!1,te=null,re=null,ne=null,ie=null,oe=null,fe.set(0,0,e.canvas.width,e.canvas.height),me.set(0,0,e.canvas.width,e.canvas.height),a.reset(),l.reset(),c.reset()}}}function da(e,t,r,n,i,o,s){const a=i.isWebGL2,l=i.maxTextures,c=i.maxCubemapSize,u=i.maxTextureSize,h=i.maxSamples,d=new WeakMap;let p,f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function m(e,t){return f?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function y(e,t,r,n){let i=1;if((e.width>n||e.height>n)&&(i=n/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const n=t?$t:Math.floor,o=n(i*e.width),s=n(i*e.height);void 0===p&&(p=m(o,s));const a=r?m(o,s):p;return a.width=o,a.height=s,a.getContext("2d").drawImage(e,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+s+")."),a}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function g(e){return Qt(e.width)&&Qt(e.height)}function v(e,t){return e.generateMipmaps&&t&&e.minFilter!==se&&e.minFilter!==ce}function b(t,r,i,o,s=1){e.generateMipmap(t),n.get(r).__maxMipLevel=Math.log2(Math.max(i,o,s))}function _(r,n,i){if(!1===a)return n;if(null!==r){if(void 0!==e[r])return e[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}let o=n;return 6403===n&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===n&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===n&&(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 x(e){return e===se||e===ae||e===le?9728:9729}function w(t){const r=t.target;r.removeEventListener("dispose",w),function(t){const r=n.get(t);void 0!==r.__webglInit&&(e.deleteTexture(r.__webglTexture),n.remove(t))}(r),r.isVideoTexture&&d.delete(r),s.memory.textures--}function S(t){const r=t.target;r.removeEventListener("dispose",S),function(t){const r=t.texture,i=n.get(t),o=n.get(r);if(t){if(void 0!==o.__webglTexture&&(e.deleteTexture(o.__webglTexture),s.memory.textures--),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(i.__webglFramebuffer[t]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[t]);else e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&e.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer);if(t.isWebGLMultipleRenderTargets)for(let t=0,i=r.length;t<i;t++){const i=n.get(r[t]);i.__webglTexture&&(e.deleteTexture(i.__webglTexture),s.memory.textures--),n.remove(r[t])}n.remove(r),n.remove(t)}}(r)}let M=0;function T(e,t){const i=n.get(e);if(e.isVideoTexture&&function(e){const t=s.render.frame;d.get(e)!==t&&(d.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){const r=e.image;if(void 0===r)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==r.complete)return void P(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.activeTexture(33984+t),r.bindTexture(3553,i.__webglTexture)}function E(t,i){const s=n.get(t);t.version>0&&s.__version!==t.version?function(t,n,i){if(6!==n.image.length)return;C(t,n),r.activeTexture(33984+i),r.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);const s=n&&(n.isCompressedTexture||n.image[0].isCompressedTexture),l=n.image[0]&&n.image[0].isDataTexture,u=[];for(let e=0;e<6;e++)u[e]=s||l?l?n.image[e].image:n.image[e]:y(n.image[e],!1,!0,c);const h=u[0],d=g(h)||a,p=o.convert(n.format),f=o.convert(n.type),m=_(n.internalFormat,p,f);let x;if(L(34067,n,d),s){for(let e=0;e<6;e++){x=u[e].mipmaps;for(let t=0;t<x.length;t++){const i=x[t];n.format!==Ee&&n.format!==Te?null!==p?r.compressedTexImage2D(34069+e,t,m,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):r.texImage2D(34069+e,t,m,i.width,i.height,0,p,f,i.data)}}t.__maxMipLevel=x.length-1}else{x=n.mipmaps;for(let e=0;e<6;e++)if(l){r.texImage2D(34069+e,0,m,u[e].width,u[e].height,0,p,f,u[e].data);for(let t=0;t<x.length;t++){const n=x[t].image[e].image;r.texImage2D(34069+e,t+1,m,n.width,n.height,0,p,f,n.data)}}else{r.texImage2D(34069+e,0,m,p,f,u[e]);for(let t=0;t<x.length;t++){const n=x[t];r.texImage2D(34069+e,t+1,m,p,f,n.image[e])}}t.__maxMipLevel=x.length}v(n,d)&&b(34067,n,h.width,h.height),t.__version=n.version,n.onUpdate&&n.onUpdate(n)}(s,t,i):(r.activeTexture(33984+i),r.bindTexture(34067,s.__webglTexture))}const j={[ne]:10497,[ie]:33071,[oe]:33648},A={[se]:9728,[ae]:9984,[le]:9986,[ce]:9729,[ue]:9985,[he]:9987};function L(r,o,s){if(s?(e.texParameteri(r,10242,j[o.wrapS]),e.texParameteri(r,10243,j[o.wrapT]),32879!==r&&35866!==r||e.texParameteri(r,32882,j[o.wrapR]),e.texParameteri(r,10240,A[o.magFilter]),e.texParameteri(r,10241,A[o.minFilter])):(e.texParameteri(r,10242,33071),e.texParameteri(r,10243,33071),32879!==r&&35866!==r||e.texParameteri(r,32882,33071),o.wrapS===ie&&o.wrapT===ie||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(r,10240,x(o.magFilter)),e.texParameteri(r,10241,x(o.minFilter)),o.minFilter!==se&&o.minFilter!==ce&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===t.has("EXT_texture_filter_anisotropic")){const s=t.get("EXT_texture_filter_anisotropic");if(o.type===ve&&!1===t.has("OES_texture_float_linear"))return;if(!1===a&&o.type===be&&!1===t.has("OES_texture_half_float_linear"))return;(o.anisotropy>1||n.get(o).__currentAnisotropy)&&(e.texParameterf(r,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),n.get(o).__currentAnisotropy=o.anisotropy)}}function C(t,r){void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",w),t.__webglTexture=e.createTexture(),s.memory.textures++)}function P(t,n,i){let s=3553;n.isDataTexture2DArray&&(s=35866),n.isDataTexture3D&&(s=32879),C(t,n),r.activeTexture(33984+i),r.bindTexture(s,t.__webglTexture),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);const l=function(e){return!a&&(e.wrapS!==ie||e.wrapT!==ie||e.minFilter!==se&&e.minFilter!==ce)}(n)&&!1===g(n.image),c=y(n.image,l,!1,u),h=g(c)||a,d=o.convert(n.format);let p,f=o.convert(n.type),m=_(n.internalFormat,d,f);L(s,n,h);const x=n.mipmaps;if(n.isDepthTexture)m=6402,a?m=n.type===ve?36012:n.type===ge?33190:n.type===Se?35056:33189:n.type===ve&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===Ce&&6402===m&&n.type!==me&&n.type!==ge&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=me,f=o.convert(n.type)),n.format===Pe&&6402===m&&(m=34041,n.type!==Se&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Se,f=o.convert(n.type))),r.texImage2D(3553,0,m,c.width,c.height,0,d,f,null);else if(n.isDataTexture)if(x.length>0&&h){for(let e=0,t=x.length;e<t;e++)p=x[e],r.texImage2D(3553,e,m,p.width,p.height,0,d,f,p.data);n.generateMipmaps=!1,t.__maxMipLevel=x.length-1}else r.texImage2D(3553,0,m,c.width,c.height,0,d,f,c.data),t.__maxMipLevel=0;else if(n.isCompressedTexture){for(let e=0,t=x.length;e<t;e++)p=x[e],n.format!==Ee&&n.format!==Te?null!==d?r.compressedTexImage2D(3553,e,m,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):r.texImage2D(3553,e,m,p.width,p.height,0,d,f,p.data);t.__maxMipLevel=x.length-1}else if(n.isDataTexture2DArray)r.texImage3D(35866,0,m,c.width,c.height,c.depth,0,d,f,c.data),t.__maxMipLevel=0;else if(n.isDataTexture3D)r.texImage3D(32879,0,m,c.width,c.height,c.depth,0,d,f,c.data),t.__maxMipLevel=0;else if(x.length>0&&h){for(let e=0,t=x.length;e<t;e++)p=x[e],r.texImage2D(3553,e,m,d,f,p);n.generateMipmaps=!1,t.__maxMipLevel=x.length-1}else r.texImage2D(3553,0,m,d,f,c),t.__maxMipLevel=0;v(n,h)&&b(s,n,c.width,c.height),t.__version=n.version,n.onUpdate&&n.onUpdate(n)}function R(t,i,s,a,l){const c=o.convert(s.format),u=o.convert(s.type),h=_(s.internalFormat,c,u);32879===l||35866===l?r.texImage3D(l,0,h,i.width,i.height,i.depth,0,c,u,null):r.texImage2D(l,0,h,i.width,i.height,0,c,u,null),r.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,a,l,n.get(s).__webglTexture,0),r.bindFramebuffer(36160,null)}function O(t,r,n){if(e.bindRenderbuffer(36161,t),r.depthBuffer&&!r.stencilBuffer){let i=33189;if(n){const t=r.depthTexture;t&&t.isDepthTexture&&(t.type===ve?i=36012:t.type===ge&&(i=33190));const n=k(r);e.renderbufferStorageMultisample(36161,n,i,r.width,r.height)}else e.renderbufferStorage(36161,i,r.width,r.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(r.depthBuffer&&r.stencilBuffer){if(n){const t=k(r);e.renderbufferStorageMultisample(36161,t,35056,r.width,r.height)}else e.renderbufferStorage(36161,34041,r.width,r.height);e.framebufferRenderbuffer(36160,33306,36161,t)}else{const t=!0===r.isWebGLMultipleRenderTargets?r.texture[0]:r.texture,i=o.convert(t.format),s=o.convert(t.type),a=_(t.internalFormat,i,s);if(n){const t=k(r);e.renderbufferStorageMultisample(36161,t,a,r.width,r.height)}else e.renderbufferStorage(36161,a,r.width,r.height)}e.bindRenderbuffer(36161,null)}function k(e){return a&&e.isWebGLMultisampleRenderTarget?Math.min(h,e.samples):0}let I=!1,D=!1;this.allocateTextureUnit=function(){const e=M;return e>=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),M+=1,e},this.resetTextureUnits=function(){M=0},this.setTexture2D=T,this.setTexture2DArray=function(e,t){const i=n.get(e);e.version>0&&i.__version!==e.version?P(i,e,t):(r.activeTexture(33984+t),r.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){const i=n.get(e);e.version>0&&i.__version!==e.version?P(i,e,t):(r.activeTexture(33984+t),r.bindTexture(32879,i.__webglTexture))},this.setTextureCube=E,this.setupRenderTarget=function(t){const l=t.texture,c=n.get(t),u=n.get(l);t.addEventListener("dispose",S),!0!==t.isWebGLMultipleRenderTargets&&(u.__webglTexture=e.createTexture(),u.__version=l.version,s.memory.textures++);const h=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,p=!0===t.isWebGLMultisampleRenderTarget,f=l.isDataTexture3D||l.isDataTexture2DArray,m=g(t)||a;if(!a||l.format!==Te||l.type!==ve&&l.type!==be||(l.format=Ee,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),h){c.__webglFramebuffer=[];for(let t=0;t<6;t++)c.__webglFramebuffer[t]=e.createFramebuffer()}else if(c.__webglFramebuffer=e.createFramebuffer(),d)if(i.drawBuffers){const r=t.texture;for(let t=0,i=r.length;t<i;t++){const i=n.get(r[t]);void 0===i.__webglTexture&&(i.__webglTexture=e.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(p)if(a){c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,c.__webglColorRenderbuffer);const n=o.convert(l.format),i=o.convert(l.type),s=_(l.internalFormat,n,i),a=k(t);e.renderbufferStorageMultisample(36161,a,s,t.width,t.height),r.bindFramebuffer(36160,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,c.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(c.__webglDepthRenderbuffer=e.createRenderbuffer(),O(c.__webglDepthRenderbuffer,t,!0)),r.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(h){r.bindTexture(34067,u.__webglTexture),L(34067,l,m);for(let e=0;e<6;e++)R(c.__webglFramebuffer[e],t,l,36064,34069+e);v(l,m)&&b(34067,l,t.width,t.height),r.unbindTexture()}else if(d){const e=t.texture;for(let i=0,o=e.length;i<o;i++){const o=e[i],s=n.get(o);r.bindTexture(3553,s.__webglTexture),L(3553,o,m),R(c.__webglFramebuffer,t,o,36064+i,3553),v(o,m)&&b(3553,o,t.width,t.height)}r.unbindTexture()}else{let e=3553;f&&(a?e=l.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),r.bindTexture(e,u.__webglTexture),L(e,l,m),R(c.__webglFramebuffer,t,l,36064,e),v(l,m)&&b(e,l,t.width,t.height,t.depth),r.unbindTexture()}t.depthBuffer&&function(t){const i=n.get(t),o=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(o)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(r.bindFramebuffer(36160,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),T(i.depthTexture,0);const o=n.get(i.depthTexture).__webglTexture;if(i.depthTexture.format===Ce)e.framebufferTexture2D(36160,36096,3553,o,0);else{if(i.depthTexture.format!==Pe)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,o,0)}}(i.__webglFramebuffer,t)}else if(o){i.__webglDepthbuffer=[];for(let n=0;n<6;n++)r.bindFramebuffer(36160,i.__webglFramebuffer[n]),i.__webglDepthbuffer[n]=e.createRenderbuffer(),O(i.__webglDepthbuffer[n],t,!1)}else r.bindFramebuffer(36160,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),O(i.__webglDepthbuffer,t,!1);r.bindFramebuffer(36160,null)}(t)},this.updateRenderTargetMipmap=function(e){const t=g(e)||a,i=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture];for(let o=0,s=i.length;o<s;o++){const s=i[o];if(v(s,t)){const t=e.isWebGLCubeRenderTarget?34067:3553,i=n.get(s).__webglTexture;r.bindTexture(t,i),b(t,s,e.width,e.height),r.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(a){const i=t.width,o=t.height;let s=16384;t.depthBuffer&&(s|=256),t.stencilBuffer&&(s|=1024);const a=n.get(t);r.bindFramebuffer(36008,a.__webglMultisampledFramebuffer),r.bindFramebuffer(36009,a.__webglFramebuffer),e.blitFramebuffer(0,0,i,o,0,0,i,o,s,9728),r.bindFramebuffer(36008,null),r.bindFramebuffer(36009,a.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===I&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),I=!0),e=e.texture),T(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===D&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),D=!0),e=e.texture),E(e,t)}}function pa(e,t,r){const n=r.isWebGL2;return{convert:function(e){let r;if(e===de)return 5121;if(e===_e)return 32819;if(e===xe)return 32820;if(e===we)return 33635;if(e===pe)return 5120;if(e===fe)return 5122;if(e===me)return 5123;if(e===ye)return 5124;if(e===ge)return 5125;if(e===ve)return 5126;if(e===be)return n?5131:(r=t.get("OES_texture_half_float"),null!==r?r.HALF_FLOAT_OES:null);if(e===Me)return 6406;if(e===Te)return 6407;if(e===Ee)return 6408;if(e===je)return 6409;if(e===Ae)return 6410;if(e===Ce)return 6402;if(e===Pe)return 34041;if(e===Re)return 6403;if(e===Oe)return 36244;if(e===ke)return 33319;if(e===Ie)return 33320;if(e===De)return 36248;if(e===Ne)return 36249;if(e===Fe||e===Ue||e===Be||e===ze){if(r=t.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(e===Fe)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===Ue)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===Be)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===ze)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===Ge||e===Ve||e===He||e===We){if(r=t.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(e===Ge)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===Ve)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===He)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===We)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===qe)return r=t.get("WEBGL_compressed_texture_etc1"),null!==r?r.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===Xe||e===Ye)&&(r=t.get("WEBGL_compressed_texture_etc"),null!==r)){if(e===Xe)return r.COMPRESSED_RGB8_ETC2;if(e===Ye)return r.COMPRESSED_RGBA8_ETC2_EAC}return e===Ze||e===Je||e===Ke||e===Qe||e===$e||e===et||e===tt||e===rt||e===nt||e===it||e===ot||e===st||e===at||e===lt||e===ut||e===ht||e===dt||e===pt||e===ft||e===mt||e===yt||e===gt||e===vt||e===bt||e===_t||e===xt||e===wt||e===St?(r=t.get("WEBGL_compressed_texture_astc"),null!==r?e:null):e===ct?(r=t.get("EXT_texture_compression_bptc"),null!==r?e:null):e===Se?n?34042:(r=t.get("WEBGL_depth_texture"),null!==r?r.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class fa extends wi{constructor(e=[]){super(),this.cameras=e}}fa.prototype.isArrayCamera=!0;class ma extends fn{constructor(){super(),this.type="Group"}}ma.prototype.isGroup=!0;const ya={type:"move"};class ga{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new ma,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new ma,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new hr,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new hr),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new ma,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new hr,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new hr),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,r){let n=null,i=null,o=null;const s=this._targetRay,a=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(null!==s&&(n=t.getPose(e.targetRaySpace,r),null!==n&&(s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),n.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(n.linearVelocity)):s.hasLinearVelocity=!1,n.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(n.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(ya))),l&&e.hand){o=!0;for(const n of e.hand.values()){const e=t.getJointPose(n,r);if(void 0===l.joints[n.jointName]){const e=new ma;e.matrixAutoUpdate=!1,e.visible=!1,l.joints[n.jointName]=e,l.add(e)}const i=l.joints[n.jointName];null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.jointRadius=e.radius),i.visible=null!==e}const n=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],s=n.position.distanceTo(i.position),a=.02,c=.005;l.inputState.pinching&&s>a+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==a&&e.gripSpace&&(i=t.getPose(e.gripSpace,r),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1));return null!==s&&(s.visible=null!==n),null!==a&&(a.visible=null!==i),null!==l&&(l.visible=null!==o),this}}class va extends Wt{constructor(e,t){super();const r=this,n=e.state;let i=null,o=1,s=null,a="local-floor",l=null,c=null,u=null,h=null,d=null,p=!1,f=null,m=null,y=null,g=null,v=null,b=null;const _=[],x=new Map,w=new wi;w.layers.enable(1),w.viewport=new ar;const S=new wi;S.layers.enable(2),S.viewport=new ar;const M=[w,S],T=new fa;T.layers.enable(1),T.layers.enable(2);let E=null,j=null;function A(e){const t=x.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function L(){x.forEach((function(e,t){e.disconnect(t)})),x.clear(),E=null,j=null,n.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),u&&t.deleteFramebuffer(u),f&&t.deleteFramebuffer(f),m&&t.deleteRenderbuffer(m),y&&t.deleteRenderbuffer(y),u=null,f=null,m=null,y=null,d=null,h=null,c=null,i=null,I.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}function C(e){const t=i.inputSources;for(let e=0;e<_.length;e++)x.set(t[e],_[e]);for(let t=0;t<e.removed.length;t++){const r=e.removed[t],n=x.get(r);n&&(n.dispatchEvent({type:"disconnected",data:r}),x.delete(r))}for(let t=0;t<e.added.length;t++){const r=e.added[t],n=x.get(r);n&&n.dispatchEvent({type:"connected",data:r})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=_[e];return void 0===t&&(t=new ga,_[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=_[e];return void 0===t&&(t=new ga,_[e]=t),t.getGripSpace()},this.getHand=function(e){let t=_[e];return void 0===t&&(t=new ga,_[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){o=e,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){a=e,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return s},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return c},this.getFrame=function(){return g},this.getSession=function(){return i},this.setSession=async function(e){if(i=e,null!==i){i.addEventListener("select",A),i.addEventListener("selectstart",A),i.addEventListener("selectend",A),i.addEventListener("squeeze",A),i.addEventListener("squeezestart",A),i.addEventListener("squeezeend",A),i.addEventListener("end",L),i.addEventListener("inputsourceschange",C);const e=t.getContextAttributes();if(!0!==e.xrCompatible&&await t.makeXRCompatible(),void 0===i.renderState.layers){const r={antialias:e.antialias,alpha:e.alpha,depth:e.depth,stencil:e.stencil,framebufferScaleFactor:o};d=new XRWebGLLayer(i,t,r),i.updateRenderState({baseLayer:d})}else if(t instanceof WebGLRenderingContext){const r={antialias:!0,alpha:e.alpha,depth:e.depth,stencil:e.stencil,framebufferScaleFactor:o};d=new XRWebGLLayer(i,t,r),i.updateRenderState({layers:[d]})}else{p=e.antialias;let r=null;e.depth&&(b=256,e.stencil&&(b|=1024),v=e.stencil?33306:36096,r=e.stencil?35056:33190);const s={colorFormat:e.alpha?32856:32849,depthFormat:r,scaleFactor:o};c=new XRWebGLBinding(i,t),h=c.createProjectionLayer(s),u=t.createFramebuffer(),i.updateRenderState({layers:[h]}),p&&(f=t.createFramebuffer(),m=t.createRenderbuffer(),t.bindRenderbuffer(36161,m),t.renderbufferStorageMultisample(36161,4,32856,h.textureWidth,h.textureHeight),n.bindFramebuffer(36160,f),t.framebufferRenderbuffer(36160,36064,36161,m),t.bindRenderbuffer(36161,null),null!==r&&(y=t.createRenderbuffer(),t.bindRenderbuffer(36161,y),t.renderbufferStorageMultisample(36161,4,r,h.textureWidth,h.textureHeight),t.framebufferRenderbuffer(36160,v,36161,y),t.bindRenderbuffer(36161,null)),n.bindFramebuffer(36160,null))}s=await i.requestReferenceSpace(a),I.setContext(i),I.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}};const P=new hr,R=new hr;function O(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===i)return;T.near=S.near=w.near=e.near,T.far=S.far=w.far=e.far,E===T.near&&j===T.far||(i.updateRenderState({depthNear:T.near,depthFar:T.far}),E=T.near,j=T.far);const t=e.parent,r=T.cameras;O(T,t);for(let e=0;e<r.length;e++)O(r[e],t);T.matrixWorld.decompose(T.position,T.quaternion,T.scale),e.position.copy(T.position),e.quaternion.copy(T.quaternion),e.scale.copy(T.scale),e.matrix.copy(T.matrix),e.matrixWorld.copy(T.matrixWorld);const n=e.children;for(let e=0,t=n.length;e<t;e++)n[e].updateMatrixWorld(!0);2===r.length?function(e,t,r){P.setFromMatrixPosition(t.matrixWorld),R.setFromMatrixPosition(r.matrixWorld);const n=P.distanceTo(R),i=t.projectionMatrix.elements,o=r.projectionMatrix.elements,s=i[14]/(i[10]-1),a=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=s*u,p=s*h,f=n/(-u+h),m=f*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const y=s+f,g=a+f,v=d-m,b=p+(n-m),_=l*a/g*y,x=c*a/g*y;e.projectionMatrix.makePerspective(v,b,_,x,y,g)}(T,w,S):T.projectionMatrix.copy(w.projectionMatrix)},this.getCamera=function(){return T},this.getFoveation=function(){return null!==h?h.fixedFoveation:null!==d?d.fixedFoveation:void 0},this.setFoveation=function(e){null!==h&&(h.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)};let k=null;const I=new ki;I.setAnimationLoop((function(e,r){if(l=r.getViewerPose(s),g=r,null!==l){const e=l.views;null!==d&&n.bindXRFramebuffer(d.framebuffer);let r=!1;e.length!==T.cameras.length&&(T.cameras.length=0,r=!0);for(let i=0;i<e.length;i++){const o=e[i];let s=null;if(null!==d)s=d.getViewport(o);else{const e=c.getViewSubImage(h,o);n.bindXRFramebuffer(u),void 0!==e.depthStencilTexture&&t.framebufferTexture2D(36160,v,3553,e.depthStencilTexture,0),t.framebufferTexture2D(36160,36064,3553,e.colorTexture,0),s=e.viewport}const a=M[i];a.matrix.fromArray(o.transform.matrix),a.projectionMatrix.fromArray(o.projectionMatrix),a.viewport.set(s.x,s.y,s.width,s.height),0===i&&T.matrix.copy(a.matrix),!0===r&&T.cameras.push(a)}p&&(n.bindXRFramebuffer(f),null!==b&&t.clear(b))}const o=i.inputSources;for(let e=0;e<_.length;e++){const t=_[e],n=o[e];t.update(n,r,s)}if(k&&k(e,r),p){const e=h.textureWidth,r=h.textureHeight;n.bindFramebuffer(36008,f),n.bindFramebuffer(36009,u),t.invalidateFramebuffer(36008,[v]),t.invalidateFramebuffer(36009,[v]),t.blitFramebuffer(0,0,e,r,0,0,e,r,16384,9728),t.invalidateFramebuffer(36008,[36064]),n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,null),n.bindFramebuffer(36160,f)}g=null})),this.setAnimationLoop=function(e){k=e},this.dispose=function(){}}}function ba(e){function t(t,r){t.opacity.value=r.opacity,r.color&&t.diffuse.value.copy(r.color),r.emissive&&t.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(t.map.value=r.map),r.alphaMap&&(t.alphaMap.value=r.alphaMap),r.specularMap&&(t.specularMap.value=r.specularMap),r.alphaTest>0&&(t.alphaTest.value=r.alphaTest);const n=e.get(r).envMap;if(n){t.envMap.value=n,t.flipEnvMap.value=n.isCubeTexture&&!1===n.isRenderTargetTexture?-1:1,t.reflectivity.value=r.reflectivity,t.ior.value=r.ior,t.refractionRatio.value=r.refractionRatio;const i=e.get(n).__maxMipLevel;void 0!==i&&(t.maxMipLevel.value=i)}let i,o;r.lightMap&&(t.lightMap.value=r.lightMap,t.lightMapIntensity.value=r.lightMapIntensity),r.aoMap&&(t.aoMap.value=r.aoMap,t.aoMapIntensity.value=r.aoMapIntensity),r.map?i=r.map:r.specularMap?i=r.specularMap:r.displacementMap?i=r.displacementMap:r.normalMap?i=r.normalMap:r.bumpMap?i=r.bumpMap:r.roughnessMap?i=r.roughnessMap:r.metalnessMap?i=r.metalnessMap:r.alphaMap?i=r.alphaMap:r.emissiveMap?i=r.emissiveMap:r.clearcoatMap?i=r.clearcoatMap:r.clearcoatNormalMap?i=r.clearcoatNormalMap:r.clearcoatRoughnessMap?i=r.clearcoatRoughnessMap:r.specularIntensityMap?i=r.specularIntensityMap:r.specularTintMap?i=r.specularTintMap:r.transmissionMap?i=r.transmissionMap:r.thicknessMap&&(i=r.thicknessMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix)),r.aoMap?o=r.aoMap:r.lightMap&&(o=r.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),t.uv2Transform.value.copy(o.matrix))}function r(t,r){t.roughness.value=r.roughness,t.metalness.value=r.metalness,r.roughnessMap&&(t.roughnessMap.value=r.roughnessMap),r.metalnessMap&&(t.metalnessMap.value=r.metalnessMap),r.emissiveMap&&(t.emissiveMap.value=r.emissiveMap),r.bumpMap&&(t.bumpMap.value=r.bumpMap,t.bumpScale.value=r.bumpScale,r.side===u&&(t.bumpScale.value*=-1)),r.normalMap&&(t.normalMap.value=r.normalMap,t.normalScale.value.copy(r.normalScale),r.side===u&&t.normalScale.value.negate()),r.displacementMap&&(t.displacementMap.value=r.displacementMap,t.displacementScale.value=r.displacementScale,t.displacementBias.value=r.displacementBias),e.get(r).envMap&&(t.envMapIntensity.value=r.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,n,i,o,s){n.isMeshBasicMaterial?t(e,n):n.isMeshLambertMaterial?(t(e,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(e,n)):n.isMeshToonMaterial?(t(e,n),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,t.side===u&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===u&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isMeshPhongMaterial?(t(e,n),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,t.side===u&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===u&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isMeshStandardMaterial?(t(e,n),n.isMeshPhysicalMaterial?function(e,t,n){r(e,t),e.ior.value=t.ior,t.sheenTint&&e.sheenTint.value.copy(t.sheenTint),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,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,t.side===u&&e.clearcoatNormalScale.value.negate())),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationTint.value.copy(t.attenuationTint)),e.specularIntensity.value=t.specularIntensity,e.specularTint.value.copy(t.specularTint),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap),t.specularTintMap&&(e.specularTintMap.value=t.specularTintMap)}(e,n,s):r(e,n)):n.isMeshMatcapMaterial?(t(e,n),function(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===u&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===u&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isMeshDepthMaterial?(t(e,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isMeshDistanceMaterial?(t(e,n),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,n)):n.isMeshNormalMaterial?(t(e,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===u&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===u&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,n)):n.isPointsMaterial?function(e,t,r,n){let i;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=.5*n,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest),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,n,i,o):n.isSpriteMaterial?function(e,t){let r;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),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest),t.map?r=t.map:t.alphaMap&&(r=t.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix))}(e,n):n.isShadowMaterial?(e.color.value.copy(n.color),e.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function _a(e={}){const t=void 0!==e.canvas?e.canvas:function(){const e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return e.style.display="block",e}(),r=void 0!==e.context?e.context:null,n=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,o=void 0===e.stencil||e.stencil,s=void 0!==e.antialias&&e.antialias,a=void 0===e.premultipliedAlpha||e.premultipliedAlpha,l=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,d=void 0!==e.powerPreference?e.powerPreference:"default",p=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat;let f=null,m=null;const y=[],g=[];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=Ct,this.physicallyCorrectLights=!1,this.toneMapping=W,this.toneMappingExposure=1;const v=this;let b=!1,_=0,x=0,w=null,S=-1,M=null;const T=new ar,E=new ar;let j=null,A=t.width,L=t.height,C=1,P=null,R=null;const O=new ar(0,0,A,L),k=new ar(0,0,A,L);let I=!1;const D=[],N=new Oi;let F=!1,U=!1,B=null;const z=new Gr,G=new hr,V={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function H(){return null===w?C:1}let q,X,Y,Z,J,K,Q,$,ee,te,re,ne,oe,ae,le,ce,ue,pe,fe,me,ye,ge,_e,xe=r;function we(e,r){for(let n=0;n<e.length;n++){const i=e[n],o=t.getContext(i,r);if(null!==o)return o}return null}try{const e={alpha:n,depth:i,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:d,failIfMajorPerformanceCaveat:p};if(t.addEventListener("webglcontextlost",Te,!1),t.addEventListener("webglcontextrestored",je,!1),null===xe){const t=["webgl2","webgl","experimental-webgl"];if(!0===v.isWebGL1Renderer&&t.shift(),xe=we(t,e),null===xe)throw we(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===xe.getShaderPrecisionFormat&&(xe.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function Se(){q=new yo(xe),X=new Vi(xe,q,e),q.init(X),ge=new pa(xe,q,X),Y=new ha(xe,q,X),D[0]=1029,Z=new bo(xe),J=new Zs,K=new da(xe,q,Y,J,X,ge,Z),Q=new Wi(v),$=new mo(v),ee=new Ii(xe,X),_e=new zi(xe,q,ee,X),te=new go(xe,ee,Z,_e),re=new So(xe,te,ee,Z),fe=new wo(xe),ce=new Hi(J),ne=new Ys(v,Q,$,q,X,_e,ce),oe=new ba(J),ae=new $s(J),le=new oa(q,X),pe=new Bi(v,Q,Y,re,a),ue=new ua(v,re,X),me=new Gi(xe,q,Z,X),ye=new vo(xe,q,Z,X),Z.programs=ne.programs,v.capabilities=X,v.extensions=q,v.properties=J,v.renderLists=ae,v.shadowMap=ue,v.state=Y,v.info=Z}Se();const Me=new va(v,xe);function Te(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function je(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const e=Z.autoReset,t=ue.enabled,r=ue.autoUpdate,n=ue.needsUpdate,i=ue.type;Se(),Z.autoReset=e,ue.enabled=t,ue.autoUpdate=r,ue.needsUpdate=n,ue.type=i}function Ae(e){const t=e.target;t.removeEventListener("dispose",Ae),function(e){(function(e){const t=J.get(e).programs;void 0!==t&&t.forEach((function(e){ne.releaseProgram(e)}))})(e),J.remove(e)}(t)}this.xr=Me,this.getContext=function(){return xe},this.getContextAttributes=function(){return xe.getContextAttributes()},this.forceContextLoss=function(){const e=q.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=q.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return C},this.setPixelRatio=function(e){void 0!==e&&(C=e,this.setSize(A,L,!1))},this.getSize=function(e){return e.set(A,L)},this.setSize=function(e,r,n){Me.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(A=e,L=r,t.width=Math.floor(e*C),t.height=Math.floor(r*C),!1!==n&&(t.style.width=e+"px",t.style.height=r+"px"),this.setViewport(0,0,e,r))},this.getDrawingBufferSize=function(e){return e.set(A*C,L*C).floor()},this.setDrawingBufferSize=function(e,r,n){A=e,L=r,C=n,t.width=Math.floor(e*n),t.height=Math.floor(r*n),this.setViewport(0,0,e,r)},this.getCurrentViewport=function(e){return e.copy(T)},this.getViewport=function(e){return e.copy(O)},this.setViewport=function(e,t,r,n){e.isVector4?O.set(e.x,e.y,e.z,e.w):O.set(e,t,r,n),Y.viewport(T.copy(O).multiplyScalar(C).floor())},this.getScissor=function(e){return e.copy(k)},this.setScissor=function(e,t,r,n){e.isVector4?k.set(e.x,e.y,e.z,e.w):k.set(e,t,r,n),Y.scissor(E.copy(k).multiplyScalar(C).floor())},this.getScissorTest=function(){return I},this.setScissorTest=function(e){Y.setScissorTest(I=e)},this.setOpaqueSort=function(e){P=e},this.setTransparentSort=function(e){R=e},this.getClearColor=function(e){return e.copy(pe.getClearColor())},this.setClearColor=function(){pe.setClearColor.apply(pe,arguments)},this.getClearAlpha=function(){return pe.getClearAlpha()},this.setClearAlpha=function(){pe.setClearAlpha.apply(pe,arguments)},this.clear=function(e,t,r){let n=0;(void 0===e||e)&&(n|=16384),(void 0===t||t)&&(n|=256),(void 0===r||r)&&(n|=1024),xe.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Te,!1),t.removeEventListener("webglcontextrestored",je,!1),ae.dispose(),le.dispose(),J.dispose(),Q.dispose(),$.dispose(),re.dispose(),_e.dispose(),Me.dispose(),Me.removeEventListener("sessionstart",Ce),Me.removeEventListener("sessionend",Pe),B&&(B.dispose(),B=null),Re.stop()},this.renderBufferImmediate=function(e,t){_e.initAttributes();const r=J.get(e);e.hasPositions&&!r.position&&(r.position=xe.createBuffer()),e.hasNormals&&!r.normal&&(r.normal=xe.createBuffer()),e.hasUvs&&!r.uv&&(r.uv=xe.createBuffer()),e.hasColors&&!r.color&&(r.color=xe.createBuffer());const n=t.getAttributes();e.hasPositions&&(xe.bindBuffer(34962,r.position),xe.bufferData(34962,e.positionArray,35048),_e.enableAttribute(n.position.location),xe.vertexAttribPointer(n.position.location,3,5126,!1,0,0)),e.hasNormals&&(xe.bindBuffer(34962,r.normal),xe.bufferData(34962,e.normalArray,35048),_e.enableAttribute(n.normal.location),xe.vertexAttribPointer(n.normal.location,3,5126,!1,0,0)),e.hasUvs&&(xe.bindBuffer(34962,r.uv),xe.bufferData(34962,e.uvArray,35048),_e.enableAttribute(n.uv.location),xe.vertexAttribPointer(n.uv.location,2,5126,!1,0,0)),e.hasColors&&(xe.bindBuffer(34962,r.color),xe.bufferData(34962,e.colorArray,35048),_e.enableAttribute(n.color.location),xe.vertexAttribPointer(n.color.location,3,5126,!1,0,0)),_e.disableUnusedAttributes(),xe.drawArrays(4,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,r,n,i,o){null===t&&(t=V);const s=i.isMesh&&i.matrixWorld.determinant()<0,a=Ue(e,t,n,i);Y.setMaterial(n,s);let l=r.index;const c=r.attributes.position;if(null===l){if(void 0===c||0===c.count)return}else if(0===l.count)return;let u,h=1;!0===n.wireframe&&(l=te.getWireframeAttribute(r),h=2),void 0===r.morphAttributes.position&&void 0===r.morphAttributes.normal||fe.update(i,r,n,a),_e.setup(i,n,a,r,l);let d=me;null!==l&&(u=ee.get(l),d=ye,d.setIndex(u));const p=null!==l?l.count:c.count,f=r.drawRange.start*h,m=r.drawRange.count*h,y=null!==o?o.start*h:0,g=null!==o?o.count*h:1/0,v=Math.max(f,y),b=Math.min(p,f+m,y+g)-1,_=Math.max(0,b-v+1);if(0!==_){if(i.isMesh)!0===n.wireframe?(Y.setLineWidth(n.wireframeLinewidth*H()),d.setMode(1)):d.setMode(4);else if(i.isLine){let e=n.linewidth;void 0===e&&(e=1),Y.setLineWidth(e*H()),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(v,_,i.count);else if(r.isInstancedBufferGeometry){const e=Math.min(r.instanceCount,r._maxInstanceCount);d.renderInstances(v,_,e)}else d.render(v,_)}},this.compile=function(e,t){m=le.get(e),m.init(),g.push(m),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(m.pushLight(e),e.castShadow&&m.pushShadow(e))})),m.setupLights(v.physicallyCorrectLights),e.traverse((function(t){const r=t.material;if(r)if(Array.isArray(r))for(let n=0;n<r.length;n++)Ne(r[n],e,t);else Ne(r,e,t)})),g.pop(),m=null};let Le=null;function Ce(){Re.stop()}function Pe(){Re.start()}const Re=new ki;function Oe(e,t,r,n){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)r=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)m.pushLight(e),e.castShadow&&m.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||N.intersectsSprite(e)){n&&G.setFromMatrixPosition(e.matrixWorld).applyMatrix4(z);const t=re.update(e),i=e.material;i.visible&&f.push(e,t,i,r,G.z,null)}}else if(e.isImmediateRenderObject)n&&G.setFromMatrixPosition(e.matrixWorld).applyMatrix4(z),f.push(e,null,e.material,r,G.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==Z.render.frame&&(e.skeleton.update(),e.skeleton.frame=Z.render.frame),!e.frustumCulled||N.intersectsObject(e))){n&&G.setFromMatrixPosition(e.matrixWorld).applyMatrix4(z);const t=re.update(e),i=e.material;if(Array.isArray(i)){const n=t.groups;for(let o=0,s=n.length;o<s;o++){const s=n[o],a=i[s.materialIndex];a&&a.visible&&f.push(e,t,a,r,G.z,s)}}else i.visible&&f.push(e,t,i,r,G.z,null)}const i=e.children;for(let e=0,o=i.length;e<o;e++)Oe(i[e],t,r,n)}function ke(e,t,r,n){const i=e.opaque,o=e.transmissive,a=e.transparent;m.setupLightsView(r),o.length>0&&function(e,t,r){if(null===B){const e=!0===s&&!0===X.isWebGL2;B=new(e?cr:lr)(1024,1024,{generateMipmaps:!0,type:null!==ge.convert(be)?be:de,minFilter:he,magFilter:se,wrapS:ie,wrapT:ie})}const n=v.getRenderTarget();v.setRenderTarget(B),v.clear();const i=v.toneMapping;v.toneMapping=W,Ie(e,t,r),v.toneMapping=i,K.updateMultisampleRenderTarget(B),K.updateRenderTargetMipmap(B),v.setRenderTarget(n)}(i,t,r),n&&Y.viewport(T.copy(n)),i.length>0&&Ie(i,t,r),o.length>0&&Ie(o,t,r),a.length>0&&Ie(a,t,r)}function Ie(e,t,r){const n=!0===t.isScene?t.overrideMaterial:null;for(let i=0,o=e.length;i<o;i++){const o=e[i],s=o.object,a=o.geometry,l=null===n?o.material:n,c=o.group;s.layers.test(r.layers)&&De(s,t,r,a,l,c)}}function De(e,t,r,n,i,o){if(e.onBeforeRender(v,t,r,n,i,o),e.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){const n=Ue(r,t,i,e);Y.setMaterial(i),_e.reset(),function(e,t){e.render((function(e){v.renderBufferImmediate(e,t)}))}(e,n)}else!0===i.transparent&&i.side===h?(i.side=u,i.needsUpdate=!0,v.renderBufferDirect(r,t,n,i,e,o),i.side=c,i.needsUpdate=!0,v.renderBufferDirect(r,t,n,i,e,o),i.side=h):v.renderBufferDirect(r,t,n,i,e,o);e.onAfterRender(v,t,r,n,i,o)}function Ne(e,t,r){!0!==t.isScene&&(t=V);const n=J.get(e),i=m.state.lights,o=m.state.shadowsArray,s=i.state.version,a=ne.getParameters(e,i.state,o,t,r),l=ne.getProgramCacheKey(a);let c=n.programs;n.environment=e.isMeshStandardMaterial?t.environment:null,n.fog=t.fog,n.envMap=(e.isMeshStandardMaterial?$:Q).get(e.envMap||n.environment),void 0===c&&(e.addEventListener("dispose",Ae),c=new Map,n.programs=c);let u=c.get(l);if(void 0!==u){if(n.currentProgram===u&&n.lightsStateVersion===s)return Fe(e,a),u}else a.uniforms=ne.getUniforms(e),e.onBuild(a,v),e.onBeforeCompile(a,v),u=ne.acquireProgram(a,l),c.set(l,u),n.uniforms=a.uniforms;const h=n.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(h.clippingPlanes=ce.uniform),Fe(e,a),n.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),n.lightsStateVersion=s,n.needsLights&&(h.ambientLightColor.value=i.state.ambient,h.lightProbe.value=i.state.probe,h.directionalLights.value=i.state.directional,h.directionalLightShadows.value=i.state.directionalShadow,h.spotLights.value=i.state.spot,h.spotLightShadows.value=i.state.spotShadow,h.rectAreaLights.value=i.state.rectArea,h.ltc_1.value=i.state.rectAreaLTC1,h.ltc_2.value=i.state.rectAreaLTC2,h.pointLights.value=i.state.point,h.pointLightShadows.value=i.state.pointShadow,h.hemisphereLights.value=i.state.hemi,h.directionalShadowMap.value=i.state.directionalShadowMap,h.directionalShadowMatrix.value=i.state.directionalShadowMatrix,h.spotShadowMap.value=i.state.spotShadowMap,h.spotShadowMatrix.value=i.state.spotShadowMatrix,h.pointShadowMap.value=i.state.pointShadowMap,h.pointShadowMatrix.value=i.state.pointShadowMatrix);const d=u.getUniforms(),p=js.seqWithValue(d.seq,h);return n.currentProgram=u,n.uniformsList=p,u}function Fe(e,t){const r=J.get(e);r.outputEncoding=t.outputEncoding,r.instancing=t.instancing,r.skinning=t.skinning,r.morphTargets=t.morphTargets,r.morphNormals=t.morphNormals,r.numClippingPlanes=t.numClippingPlanes,r.numIntersection=t.numClipIntersection,r.vertexAlphas=t.vertexAlphas,r.vertexTangents=t.vertexTangents}function Ue(e,t,r,n){!0!==t.isScene&&(t=V),K.resetTextureUnits();const i=t.fog,o=r.isMeshStandardMaterial?t.environment:null,s=null===w?v.outputEncoding:w.texture.encoding,a=(r.isMeshStandardMaterial?$:Q).get(r.envMap||o),l=!0===r.vertexColors&&!!n.geometry&&!!n.geometry.attributes.color&&4===n.geometry.attributes.color.itemSize,c=!!n.geometry&&!!n.geometry.attributes.tangent,u=!!n.geometry&&!!n.geometry.morphAttributes.position,h=!!n.geometry&&!!n.geometry.morphAttributes.normal,d=J.get(r),p=m.state.lights;if(!0===F&&(!0===U||e!==M)){const t=e===M&&r.id===S;ce.setState(r,e,t)}let f=!1;r.version===d.__version?d.needsLights&&d.lightsStateVersion!==p.state.version||d.outputEncoding!==s||n.isInstancedMesh&&!1===d.instancing?f=!0:n.isInstancedMesh||!0!==d.instancing?n.isSkinnedMesh&&!1===d.skinning?f=!0:n.isSkinnedMesh||!0!==d.skinning?d.envMap!==a||r.fog&&d.fog!==i?f=!0:void 0===d.numClippingPlanes||d.numClippingPlanes===ce.numPlanes&&d.numIntersection===ce.numIntersection?(d.vertexAlphas!==l||d.vertexTangents!==c||d.morphTargets!==u||d.morphNormals!==h)&&(f=!0):f=!0:f=!0:f=!0:(f=!0,d.__version=r.version);let y=d.currentProgram;!0===f&&(y=Ne(r,t,n));let g=!1,b=!1,_=!1;const x=y.getUniforms(),T=d.uniforms;if(Y.useProgram(y.program)&&(g=!0,b=!0,_=!0),r.id!==S&&(S=r.id,b=!0),g||M!==e){if(x.setValue(xe,"projectionMatrix",e.projectionMatrix),X.logarithmicDepthBuffer&&x.setValue(xe,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),M!==e&&(M=e,b=!0,_=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshStandardMaterial||r.envMap){const t=x.map.cameraPosition;void 0!==t&&t.setValue(xe,G.setFromMatrixPosition(e.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&x.setValue(xe,"isOrthographic",!0===e.isOrthographicCamera),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.isShadowMaterial||n.isSkinnedMesh)&&x.setValue(xe,"viewMatrix",e.matrixWorldInverse)}if(n.isSkinnedMesh){x.setOptional(xe,n,"bindMatrix"),x.setOptional(xe,n,"bindMatrixInverse");const e=n.skeleton;e&&(X.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),x.setValue(xe,"boneTexture",e.boneTexture,K),x.setValue(xe,"boneTextureSize",e.boneTextureSize)):x.setOptional(xe,e,"boneMatrices"))}var E,j;return(b||d.receiveShadow!==n.receiveShadow)&&(d.receiveShadow=n.receiveShadow,x.setValue(xe,"receiveShadow",n.receiveShadow)),b&&(x.setValue(xe,"toneMappingExposure",v.toneMappingExposure),d.needsLights&&(j=_,(E=T).ambientLightColor.needsUpdate=j,E.lightProbe.needsUpdate=j,E.directionalLights.needsUpdate=j,E.directionalLightShadows.needsUpdate=j,E.pointLights.needsUpdate=j,E.pointLightShadows.needsUpdate=j,E.spotLights.needsUpdate=j,E.spotLightShadows.needsUpdate=j,E.rectAreaLights.needsUpdate=j,E.hemisphereLights.needsUpdate=j),i&&r.fog&&oe.refreshFogUniforms(T,i),oe.refreshMaterialUniforms(T,r,C,L,B),js.upload(xe,d.uniformsList,T,K)),r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(js.upload(xe,d.uniformsList,T,K),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&x.setValue(xe,"center",n.center),x.setValue(xe,"modelViewMatrix",n.modelViewMatrix),x.setValue(xe,"normalMatrix",n.normalMatrix),x.setValue(xe,"modelMatrix",n.matrixWorld),y}Re.setAnimationLoop((function(e){Le&&Le(e)})),"undefined"!=typeof window&&Re.setContext(window),this.setAnimationLoop=function(e){Le=e,Me.setAnimationLoop(e),null===e?Re.stop():Re.start()},Me.addEventListener("sessionstart",Ce),Me.addEventListener("sessionend",Pe),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===b)return;!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),!0===Me.enabled&&!0===Me.isPresenting&&(!0===Me.cameraAutoUpdate&&Me.updateCamera(t),t=Me.getCamera()),!0===e.isScene&&e.onBeforeRender(v,e,t,w),m=le.get(e,g.length),m.init(),g.push(m),z.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),N.setFromProjectionMatrix(z),U=this.localClippingEnabled,F=ce.init(this.clippingPlanes,U,t),f=ae.get(e,y.length),f.init(),y.push(f),Oe(e,t,0,v.sortObjects),f.finish(),!0===v.sortObjects&&f.sort(P,R),!0===F&&ce.beginShadows();const r=m.state.shadowsArray;if(ue.render(r,e,t),!0===F&&ce.endShadows(),!0===this.info.autoReset&&this.info.reset(),pe.render(f,e),m.setupLights(v.physicallyCorrectLights),t.isArrayCamera){const r=t.cameras;for(let t=0,n=r.length;t<n;t++){const n=r[t];ke(f,e,n,n.viewport)}}else ke(f,e,t);null!==w&&(K.updateMultisampleRenderTarget(w),K.updateRenderTargetMipmap(w)),!0===e.isScene&&e.onAfterRender(v,e,t),Y.buffers.depth.setTest(!0),Y.buffers.depth.setMask(!0),Y.buffers.color.setMask(!0),Y.setPolygonOffset(!1),_e.resetDefaultState(),S=-1,M=null,g.pop(),m=g.length>0?g[g.length-1]:null,y.pop(),f=y.length>0?y[y.length-1]:null},this.getActiveCubeFace=function(){return _},this.getActiveMipmapLevel=function(){return x},this.getRenderTarget=function(){return w},this.setRenderTarget=function(e,t=0,r=0){w=e,_=t,x=r,e&&void 0===J.get(e).__webglFramebuffer&&K.setupRenderTarget(e);let n=null,i=!1,o=!1;if(e){const r=e.texture;(r.isDataTexture3D||r.isDataTexture2DArray)&&(o=!0);const s=J.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(n=s[t],i=!0):n=e.isWebGLMultisampleRenderTarget?J.get(e).__webglMultisampledFramebuffer:s,T.copy(e.viewport),E.copy(e.scissor),j=e.scissorTest}else T.copy(O).multiplyScalar(C).floor(),E.copy(k).multiplyScalar(C).floor(),j=I;if(Y.bindFramebuffer(36160,n)&&X.drawBuffers){let t=!1;if(e)if(e.isWebGLMultipleRenderTargets){const r=e.texture;if(D.length!==r.length||36064!==D[0]){for(let e=0,t=r.length;e<t;e++)D[e]=36064+e;D.length=r.length,t=!0}}else 1===D.length&&36064===D[0]||(D[0]=36064,D.length=1,t=!0);else 1===D.length&&1029===D[0]||(D[0]=1029,D.length=1,t=!0);t&&(X.isWebGL2?xe.drawBuffers(D):q.get("WEBGL_draw_buffers").drawBuffersWEBGL(D))}if(Y.viewport(T),Y.scissor(E),Y.setScissorTest(j),i){const n=J.get(e.texture);xe.framebufferTexture2D(36160,36064,34069+t,n.__webglTexture,r)}else if(o){const n=J.get(e.texture),i=t||0;xe.framebufferTextureLayer(36160,36064,n.__webglTexture,r||0,i)}S=-1},this.readRenderTargetPixels=function(e,t,r,n,i,o,s){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=J.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==s&&(a=a[s]),a){Y.bindFramebuffer(36160,a);try{const s=e.texture,a=s.format,l=s.type;if(a!==Ee&&ge.convert(a)!==xe.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===be&&(q.has("EXT_color_buffer_half_float")||X.isWebGL2&&q.has("EXT_color_buffer_float"));if(!(l===de||ge.convert(l)===xe.getParameter(35738)||l===ve&&(X.isWebGL2||q.has("OES_texture_float")||q.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===xe.checkFramebufferStatus(36160)?t>=0&&t<=e.width-n&&r>=0&&r<=e.height-i&&xe.readPixels(t,r,n,i,ge.convert(a),ge.convert(l),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const e=null!==w?J.get(w).__webglFramebuffer:null;Y.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t,r=0){const n=Math.pow(2,-r),i=Math.floor(t.image.width*n),o=Math.floor(t.image.height*n);let s=ge.convert(t.format);X.isWebGL2&&(6407===s&&(s=32849),6408===s&&(s=32856)),K.setTexture2D(t,0),xe.copyTexImage2D(3553,r,s,e.x,e.y,i,o,0),Y.unbindTexture()},this.copyTextureToTexture=function(e,t,r,n=0){const i=t.image.width,o=t.image.height,s=ge.convert(r.format),a=ge.convert(r.type);K.setTexture2D(r,0),xe.pixelStorei(37440,r.flipY),xe.pixelStorei(37441,r.premultiplyAlpha),xe.pixelStorei(3317,r.unpackAlignment),t.isDataTexture?xe.texSubImage2D(3553,n,e.x,e.y,i,o,s,a,t.image.data):t.isCompressedTexture?xe.compressedTexSubImage2D(3553,n,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,s,t.mipmaps[0].data):xe.texSubImage2D(3553,n,e.x,e.y,s,a,t.image),0===n&&r.generateMipmaps&&xe.generateMipmap(3553),Y.unbindTexture()},this.copyTextureToTexture3D=function(e,t,r,n,i=0){if(v.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const o=e.max.x-e.min.x+1,s=e.max.y-e.min.y+1,a=e.max.z-e.min.z+1,l=ge.convert(n.format),c=ge.convert(n.type);let u;if(n.isDataTexture3D)K.setTexture3D(n,0),u=32879;else{if(!n.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");K.setTexture2DArray(n,0),u=35866}xe.pixelStorei(37440,n.flipY),xe.pixelStorei(37441,n.premultiplyAlpha),xe.pixelStorei(3317,n.unpackAlignment);const h=xe.getParameter(3314),d=xe.getParameter(32878),p=xe.getParameter(3316),f=xe.getParameter(3315),m=xe.getParameter(32877),y=r.isCompressedTexture?r.mipmaps[0]:r.image;xe.pixelStorei(3314,y.width),xe.pixelStorei(32878,y.height),xe.pixelStorei(3316,e.min.x),xe.pixelStorei(3315,e.min.y),xe.pixelStorei(32877,e.min.z),r.isDataTexture||r.isDataTexture3D?xe.texSubImage3D(u,i,t.x,t.y,t.z,o,s,a,l,c,y.data):r.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),xe.compressedTexSubImage3D(u,i,t.x,t.y,t.z,o,s,a,l,y.data)):xe.texSubImage3D(u,i,t.x,t.y,t.z,o,s,a,l,c,y),xe.pixelStorei(3314,h),xe.pixelStorei(32878,d),xe.pixelStorei(3316,p),xe.pixelStorei(3315,f),xe.pixelStorei(32877,m),0===i&&n.generateMipmaps&&xe.generateMipmap(u),Y.unbindTexture()},this.initTexture=function(e){K.setTexture2D(e,0),Y.unbindTexture()},this.resetState=function(){_=0,x=0,w=null,Y.reset(),_e.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}(class extends _a{}).prototype.isWebGL1Renderer=!0;class xa{constructor(e,t=25e-5){this.name="",this.color=new kn(e),this.density=t}clone(){return new xa(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}xa.prototype.isFogExp2=!0;class wa{constructor(e,t=1,r=1e3){this.name="",this.color=new kn(e),this.near=t,this.far=r}clone(){return new wa(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}wa.prototype.isFog=!0;class Sa extends fn{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}Sa.prototype.isScene=!0;class Ma{constructor(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Gt,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Zt()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let n=0,i=this.stride;n<i;n++)this.array[e+n]=t.array[r+n];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Zt()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Zt()),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}}}Ma.prototype.isInterleavedBuffer=!0;const Ta=new hr;class Ea{constructor(e,t,r,n=!1){this.name="",this.data=e,this.itemSize=t,this.offset=r,this.normalized=!0===n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,r=this.data.count;t<r;t++)Ta.x=this.getX(t),Ta.y=this.getY(t),Ta.z=this.getZ(t),Ta.applyMatrix4(e),this.setXYZ(t,Ta.x,Ta.y,Ta.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)Ta.x=this.getX(t),Ta.y=this.getY(t),Ta.z=this.getZ(t),Ta.applyNormalMatrix(e),this.setXYZ(t,Ta.x,Ta.y,Ta.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)Ta.x=this.getX(t),Ta.y=this.getY(t),Ta.z=this.getZ(t),Ta.transformDirection(e),this.setXYZ(t,Ta.x,Ta.y,Ta.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this}setXYZ(e,t,r,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,this}setXYZW(e,t,r,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,this.data.array[e+3]=i,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const r=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[r+t])}return new Fn(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ea(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const r=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[r+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Ea.prototype.isInterleavedBufferAttribute=!0;class ja extends jn{constructor(e){super(),this.type="SpriteMaterial",this.color=new kn(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}let Aa;ja.prototype.isSpriteMaterial=!0;const La=new hr,Ca=new hr,Pa=new hr,Ra=new er,Oa=new er,ka=new Gr,Ia=new hr,Da=new hr,Na=new hr,Fa=new er,Ua=new er,Ba=new er;function za(e,t,r,n,i,o){Ra.subVectors(e,r).addScalar(.5).multiply(n),void 0!==i?(Oa.x=o*Ra.x-i*Ra.y,Oa.y=i*Ra.x+o*Ra.y):Oa.copy(Ra),e.copy(t),e.x+=Oa.x,e.y+=Oa.y,e.applyMatrix4(ka)}(class extends fn{constructor(e){if(super(),this.type="Sprite",void 0===Aa){Aa=new Jn;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new Ma(e,5);Aa.setIndex([0,1,2,0,2,3]),Aa.setAttribute("position",new Ea(t,3,0,!1)),Aa.setAttribute("uv",new Ea(t,2,3,!1))}this.geometry=Aa,this.material=void 0!==e?e:new ja,this.center=new er(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ca.setFromMatrixScale(this.matrixWorld),ka.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Pa.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Ca.multiplyScalar(-Pa.z);const r=this.material.rotation;let n,i;0!==r&&(i=Math.cos(r),n=Math.sin(r));const o=this.center;za(Ia.set(-.5,-.5,0),Pa,o,Ca,n,i),za(Da.set(.5,-.5,0),Pa,o,Ca,n,i),za(Na.set(.5,.5,0),Pa,o,Ca,n,i),Fa.set(0,0),Ua.set(1,0),Ba.set(1,1);let s=e.ray.intersectTriangle(Ia,Da,Na,!1,La);if(null===s&&(za(Da.set(-.5,.5,0),Pa,o,Ca,n,i),Ua.set(0,1),s=e.ray.intersectTriangle(Ia,Na,Da,!1,La),null===s))return;const a=e.ray.origin.distanceTo(La);a<e.near||a>e.far||t.push({distance:a,point:La.clone(),uv:Tn.getUV(La,Ia,Da,Na,Fa,Ua,Ba,new er),face:null,object:this})}copy(e){return super.copy(e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}).prototype.isSprite=!0;const Ga=new hr,Va=new ar,Ha=new ar,Wa=new hr,qa=new Gr;class Xa extends fi{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Gr,this.bindMatrixInverse=new Gr}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new ar,t=this.geometry.attributes.skinWeight;for(let r=0,n=t.count;r<n;r++){e.x=t.getX(r),e.y=t.getY(r),e.z=t.getZ(r),e.w=t.getW(r);const n=1/e.manhattanLength();n!==1/0?e.multiplyScalar(n):e.set(1,0,0,0),t.setXYZW(r,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const r=this.skeleton,n=this.geometry;Va.fromBufferAttribute(n.attributes.skinIndex,e),Ha.fromBufferAttribute(n.attributes.skinWeight,e),Ga.fromBufferAttribute(n.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){const n=Ha.getComponent(e);if(0!==n){const i=Va.getComponent(e);qa.multiplyMatrices(r.bones[i].matrixWorld,r.boneInverses[i]),t.addScaledVector(Wa.copy(Ga).applyMatrix4(qa),n)}}return t.applyMatrix4(this.bindMatrixInverse)}}Xa.prototype.isSkinnedMesh=!0;(class extends fn{constructor(){super(),this.type="Bone"}}).prototype.isBone=!0;(class extends or{constructor(e=null,t=1,r=1,n,i,o,s,a,l=se,c=se,u,h){super(null,o,s,a,l,c,n,i,u,h),this.image={data:e,width:t,height:r},this.magFilter=l,this.minFilter=c,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}).prototype.isDataTexture=!0;class Ya extends Fn{constructor(e,t,r,n=1){"number"==typeof r&&(n=r,r=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,r),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}Ya.prototype.isInstancedBufferAttribute=!0;const Za=new Gr,Ja=new Gr,Ka=[],Qa=new fi;(class extends fi{constructor(e,t,r){super(e,t),this.instanceMatrix=new Ya(new Float32Array(16*r),16),this.instanceColor=null,this.count=r,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const r=this.matrixWorld,n=this.count;if(Qa.geometry=this.geometry,Qa.material=this.material,void 0!==Qa.material)for(let i=0;i<n;i++){this.getMatrixAt(i,Za),Ja.multiplyMatrices(r,Za),Qa.matrixWorld=Ja,Qa.raycast(e,Ka);for(let e=0,r=Ka.length;e<r;e++){const r=Ka[e];r.instanceId=i,r.object=this,t.push(r)}Ka.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new Ya(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}).prototype.isInstancedMesh=!0;class $a extends jn{constructor(e){super(),this.type="LineBasicMaterial",this.color=new kn(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}$a.prototype.isLineBasicMaterial=!0;const el=new hr,tl=new hr,rl=new Gr,nl=new zr,il=new Or;class ol extends fn{constructor(e=new Jn,t=new $a){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,r=[0];for(let e=1,n=t.count;e<n;e++)el.fromBufferAttribute(t,e-1),tl.fromBufferAttribute(t,e),r[e]=r[e-1],r[e]+=el.distanceTo(tl);e.setAttribute("lineDistance",new zn(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const r=this.geometry,n=this.matrixWorld,i=e.params.Line.threshold,o=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),il.copy(r.boundingSphere),il.applyMatrix4(n),il.radius+=i,!1===e.ray.intersectsSphere(il))return;rl.copy(n).invert(),nl.copy(e.ray).applyMatrix4(rl);const s=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,l=new hr,c=new hr,u=new hr,h=new hr,d=this.isLineSegments?2:1;if(r.isBufferGeometry){const n=r.index,i=r.attributes.position;if(null!==n)for(let r=Math.max(0,o.start),s=Math.min(n.count,o.start+o.count)-1;r<s;r+=d){const o=n.getX(r),s=n.getX(r+1);if(l.fromBufferAttribute(i,o),c.fromBufferAttribute(i,s),nl.distanceSqToSegment(l,c,h,u)>a)continue;h.applyMatrix4(this.matrixWorld);const d=e.ray.origin.distanceTo(h);d<e.near||d>e.far||t.push({distance:d,point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}else for(let r=Math.max(0,o.start),n=Math.min(i.count,o.start+o.count)-1;r<n;r+=d){if(l.fromBufferAttribute(i,r),c.fromBufferAttribute(i,r+1),nl.distanceSqToSegment(l,c,h,u)>a)continue;h.applyMatrix4(this.matrixWorld);const n=e.ray.origin.distanceTo(h);n<e.near||n>e.far||t.push({distance:n,point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}else r.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,r=Object.keys(t);if(r.length>0){const e=t[r[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,r=e.length;t<r;t++){const r=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}ol.prototype.isLine=!0;const sl=new hr,al=new hr;class ll extends ol{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,r=[];for(let e=0,n=t.count;e<n;e+=2)sl.fromBufferAttribute(t,e),al.fromBufferAttribute(t,e+1),r[e]=0===e?0:r[e-1],r[e+1]=r[e]+sl.distanceTo(al);e.setAttribute("lineDistance",new zn(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}ll.prototype.isLineSegments=!0;(class extends ol{constructor(e,t){super(e,t),this.type="LineLoop"}}).prototype.isLineLoop=!0;class cl extends jn{constructor(e){super(),this.type="PointsMaterial",this.color=new kn(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this}}cl.prototype.isPointsMaterial=!0;const ul=new Gr,hl=new zr,dl=new Or,pl=new hr;function fl(e,t,r,n,i,o,s){const a=hl.distanceSqToPoint(e);if(a<r){const r=new hr;hl.closestPointToPoint(e,r),r.applyMatrix4(n);const l=i.ray.origin.distanceTo(r);if(l<i.near||l>i.far)return;o.push({distance:l,distanceToRay:Math.sqrt(a),point:r,index:t,face:null,object:s})}}(class extends fn{constructor(e=new Jn,t=new cl){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const r=this.geometry,n=this.matrixWorld,i=e.params.Points.threshold,o=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),dl.copy(r.boundingSphere),dl.applyMatrix4(n),dl.radius+=i,!1===e.ray.intersectsSphere(dl))return;ul.copy(n).invert(),hl.copy(e.ray).applyMatrix4(ul);const s=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s;if(r.isBufferGeometry){const i=r.index,s=r.attributes.position;if(null!==i)for(let r=Math.max(0,o.start),l=Math.min(i.count,o.start+o.count);r<l;r++){const o=i.getX(r);pl.fromBufferAttribute(s,o),fl(pl,o,a,n,e,t,this)}else for(let r=Math.max(0,o.start),i=Math.min(s.count,o.start+o.count);r<i;r++)pl.fromBufferAttribute(s,r),fl(pl,r,a,n,e,t,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,r=Object.keys(t);if(r.length>0){const e=t[r[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,r=e.length;t<r;t++){const r=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}).prototype.isPoints=!0;class ml extends or{constructor(e,t,r,n,i,o,s,a,l){super(e,t,r,n,i,o,s,a,l),this.format=void 0!==s?s:Te,this.minFilter=void 0!==o?o:ce,this.magFilter=void 0!==i?i:ce,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}ml.prototype.isVideoTexture=!0;(class extends or{constructor(e,t,r,n,i,o,s,a,l,c,u,h){super(null,o,s,a,l,c,n,i,u,h),this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}).prototype.isCompressedTexture=!0,class extends or{constructor(e,t,r,n,i,o,s,a,l){super(e,t,r,n,i,o,s,a,l),this.needsUpdate=!0}}.prototype.isCanvasTexture=!0,class extends or{constructor(e,t,r,n,i,o,s,a,l,c){if((c=void 0!==c?c:Ce)!==Ce&&c!==Pe)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===r&&c===Ce&&(r=me),void 0===r&&c===Pe&&(r=Se),super(null,n,i,o,s,a,c,r,l),this.image={width:e,height:t},this.magFilter=void 0!==s?s:se,this.minFilter=void 0!==a?a:se,this.flipY=!1,this.generateMipmaps=!1}}.prototype.isDepthTexture=!0,new hr,new hr,new hr,new Tn;class yl{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let r,n=this.getPoint(0),i=0;t.push(0);for(let o=1;o<=e;o++)r=this.getPoint(o/e),i+=r.distanceTo(n),t.push(i),n=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let n=0;const i=r.length;let o;o=t||e*r[i-1];let s,a=0,l=i-1;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),s=r[n]-o,s<0)a=n+1;else{if(!(s>0)){l=n;break}l=n-1}if(n=l,r[n]===o)return n/(i-1);const c=r[n];return(n+(o-c)/(r[n+1]-c))/(i-1)}getTangent(e,t){const r=1e-4;let n=e-r,i=e+r;n<0&&(n=0),i>1&&(i=1);const o=this.getPoint(n),s=this.getPoint(i),a=t||(o.isVector2?new er:new hr);return a.copy(s).sub(o).normalize(),a}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new hr,n=[],i=[],o=[],s=new hr,a=new Gr;for(let t=0;t<=e;t++){const r=t/e;n[t]=this.getTangentAt(r,new hr),n[t].normalize()}i[0]=new hr,o[0]=new hr;let l=Number.MAX_VALUE;const c=Math.abs(n[0].x),u=Math.abs(n[0].y),h=Math.abs(n[0].z);c<=l&&(l=c,r.set(1,0,0)),u<=l&&(l=u,r.set(0,1,0)),h<=l&&r.set(0,0,1),s.crossVectors(n[0],r).normalize(),i[0].crossVectors(n[0],s),o[0].crossVectors(n[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),o[t]=o[t-1].clone(),s.crossVectors(n[t-1],n[t]),s.length()>Number.EPSILON){s.normalize();const e=Math.acos(Jt(n[t-1].dot(n[t]),-1,1));i[t].applyMatrix4(a.makeRotationAxis(s,e))}o[t].crossVectors(n[t],i[t])}if(!0===t){let t=Math.acos(Jt(i[0].dot(i[e]),-1,1));t/=e,n[0].dot(s.crossVectors(i[0],i[e]))>0&&(t=-t);for(let r=1;r<=e;r++)i[r].applyMatrix4(a.makeRotationAxis(n[r],t*r)),o[r].crossVectors(n[r],i[r])}return{tangents:n,normals:i,binormals:o}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class gl extends yl{constructor(e=0,t=0,r=1,n=1,i=0,o=2*Math.PI,s=!1,a=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=n,this.aStartAngle=i,this.aEndAngle=o,this.aClockwise=s,this.aRotation=a}getPoint(e,t){const r=t||new er,n=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const o=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=n;for(;i>n;)i-=n;i<Number.EPSILON&&(i=o?0:n),!0!==this.aClockwise||o||(i===n?i=-n:i-=n);const s=this.aStartAngle+e*i;let a=this.aX+this.xRadius*Math.cos(s),l=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),r=a-this.aX,n=l-this.aY;a=r*e-n*t+this.aX,l=r*t+n*e+this.aY}return r.set(a,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}gl.prototype.isEllipseCurve=!0;class vl extends gl{constructor(e,t,r,n,i,o){super(e,t,r,r,n,i,o),this.type="ArcCurve"}}function bl(){let e=0,t=0,r=0,n=0;function i(i,o,s,a){e=i,t=s,r=-3*i+3*o-2*s-a,n=2*i-2*o+s+a}return{initCatmullRom:function(e,t,r,n,o){i(t,r,o*(r-e),o*(n-t))},initNonuniformCatmullRom:function(e,t,r,n,o,s,a){let l=(t-e)/o-(r-e)/(o+s)+(r-t)/s,c=(r-t)/s-(n-t)/(s+a)+(n-r)/a;l*=s,c*=s,i(t,r,l,c)},calc:function(i){const o=i*i;return e+t*i+r*o+n*(o*i)}}}vl.prototype.isArcCurve=!0;const _l=new hr,xl=new bl,wl=new bl,Sl=new bl;class Ml extends yl{constructor(e=[],t=!1,r="centripetal",n=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=r,this.tension=n}getPoint(e,t=new hr){const r=t,n=this.points,i=n.length,o=(i-(this.closed?0:1))*e;let s,a,l=Math.floor(o),c=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===c&&l===i-1&&(l=i-2,c=1),this.closed||l>0?s=n[(l-1)%i]:(_l.subVectors(n[0],n[1]).add(n[0]),s=_l);const u=n[l%i],h=n[(l+1)%i];if(this.closed||l+2<i?a=n[(l+2)%i]:(_l.subVectors(n[i-1],n[i-2]).add(n[i-1]),a=_l),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(s.distanceToSquared(u),e),r=Math.pow(u.distanceToSquared(h),e),n=Math.pow(h.distanceToSquared(a),e);r<1e-4&&(r=1),t<1e-4&&(t=r),n<1e-4&&(n=r),xl.initNonuniformCatmullRom(s.x,u.x,h.x,a.x,t,r,n),wl.initNonuniformCatmullRom(s.y,u.y,h.y,a.y,t,r,n),Sl.initNonuniformCatmullRom(s.z,u.z,h.z,a.z,t,r,n)}else"catmullrom"===this.curveType&&(xl.initCatmullRom(s.x,u.x,h.x,a.x,this.tension),wl.initCatmullRom(s.y,u.y,h.y,a.y,this.tension),Sl.initCatmullRom(s.z,u.z,h.z,a.z,this.tension));return r.set(xl.calc(c),wl.calc(c),Sl.calc(c)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const r=e.points[t];this.points.push((new hr).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Tl(e,t,r,n,i){const o=.5*(n-t),s=.5*(i-r),a=e*e;return(2*r-2*n+o+s)*(e*a)+(-3*r+3*n-2*o-s)*a+o*e+r}function El(e,t,r,n){return function(e,t){const r=1-e;return r*r*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,r)+function(e,t){return e*e*t}(e,n)}function jl(e,t,r,n,i){return function(e,t){const r=1-e;return r*r*r*t}(e,t)+function(e,t){const r=1-e;return 3*r*r*e*t}(e,r)+function(e,t){return 3*(1-e)*e*e*t}(e,n)+function(e,t){return e*e*e*t}(e,i)}Ml.prototype.isCatmullRomCurve3=!0;class Al extends yl{constructor(e=new er,t=new er,r=new er,n=new er){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=r,this.v3=n}getPoint(e,t=new er){const r=t,n=this.v0,i=this.v1,o=this.v2,s=this.v3;return r.set(jl(e,n.x,i.x,o.x,s.x),jl(e,n.y,i.y,o.y,s.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Al.prototype.isCubicBezierCurve=!0;class Ll extends yl{constructor(e=new hr,t=new hr,r=new hr,n=new hr){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=r,this.v3=n}getPoint(e,t=new hr){const r=t,n=this.v0,i=this.v1,o=this.v2,s=this.v3;return r.set(jl(e,n.x,i.x,o.x,s.x),jl(e,n.y,i.y,o.y,s.y),jl(e,n.z,i.z,o.z,s.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Ll.prototype.isCubicBezierCurve3=!0;class Cl extends yl{constructor(e=new er,t=new er){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new er){const r=t;return 1===e?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const r=t||new er;return r.copy(this.v2).sub(this.v1).normalize(),r}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Cl.prototype.isLineCurve=!0;class Pl extends yl{constructor(e=new er,t=new er,r=new er){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new er){const r=t,n=this.v0,i=this.v1,o=this.v2;return r.set(El(e,n.x,i.x,o.x),El(e,n.y,i.y,o.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Pl.prototype.isQuadraticBezierCurve=!0;class Rl extends yl{constructor(e=new hr,t=new hr,r=new hr){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new hr){const r=t,n=this.v0,i=this.v1,o=this.v2;return r.set(El(e,n.x,i.x,o.x),El(e,n.y,i.y,o.y),El(e,n.z,i.z,o.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Rl.prototype.isQuadraticBezierCurve3=!0;class Ol extends yl{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new er){const r=t,n=this.points,i=(n.length-1)*e,o=Math.floor(i),s=i-o,a=n[0===o?o:o-1],l=n[o],c=n[o>n.length-2?n.length-1:o+1],u=n[o>n.length-3?n.length-1:o+2];return r.set(Tl(s,a.x,l.x,c.x,u.x),Tl(s,a.y,l.y,c.y,u.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const r=e.points[t];this.points.push((new er).fromArray(r))}return this}}Ol.prototype.isSplineCurve=!0;var kl=Object.freeze({__proto__:null,ArcCurve:vl,CatmullRomCurve3:Ml,CubicBezierCurve:Al,CubicBezierCurve3:Ll,EllipseCurve:gl,LineCurve:Cl,LineCurve3:class extends yl{constructor(e=new hr,t=new hr){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new hr){const r=t;return 1===e?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},QuadraticBezierCurve:Pl,QuadraticBezierCurve3:Rl,SplineCurve:Ol});function Il(e,t,r,n,i){let o,s;if(i===function(e,t,r,n){let i=0;for(let o=t,s=r-n;o<r;o+=n)i+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return i}(e,t,r,n)>0)for(o=t;o<r;o+=n)s=rc(o,e[o],e[o+1],s);else for(o=r-n;o>=t;o-=n)s=rc(o,e[o],e[o+1],s);return s&&Jl(s,s.next)&&(nc(s),s=s.next),s}function Dl(e,t){if(!e)return e;t||(t=e);let r,n=e;do{if(r=!1,n.steiner||!Jl(n,n.next)&&0!==Zl(n.prev,n,n.next))n=n.next;else{if(nc(n),n=t=n.prev,n===n.next)break;r=!0}}while(r||n!==t);return t}function Nl(e,t,r,n,i,o,s){if(!e)return;!s&&o&&function(e,t,r,n){let i=e;do{null===i.z&&(i.z=Wl(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,r,n,i,o,s,a,l,c=1;do{for(r=e,e=null,o=null,s=0;r;){for(s++,n=r,a=0,t=0;t<c&&(a++,n=n.nextZ,n);t++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,a--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(s>1)}(i)}(e,n,i,o);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,o?Ul(e,n,i,o):Fl(e))t.push(a.i/r),t.push(e.i/r),t.push(l.i/r),nc(e),e=l.next,c=l.next;else if((e=l)===c){s?1===s?Nl(e=Bl(Dl(e),t,r),t,r,n,i,o,2):2===s&&zl(e,t,r,n,i,o):Nl(Dl(e),t,r,n,i,o,1);break}}function Fl(e){const t=e.prev,r=e,n=e.next;if(Zl(t,r,n)>=0)return!1;let i=e.next.next;for(;i!==e.prev;){if(Xl(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Zl(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ul(e,t,r,n){const i=e.prev,o=e,s=e.next;if(Zl(i,o,s)>=0)return!1;const a=i.x<o.x?i.x<s.x?i.x:s.x:o.x<s.x?o.x:s.x,l=i.y<o.y?i.y<s.y?i.y:s.y:o.y<s.y?o.y:s.y,c=i.x>o.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,u=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,h=Wl(a,l,t,r,n),d=Wl(c,u,t,r,n);let p=e.prevZ,f=e.nextZ;for(;p&&p.z>=h&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&Xl(i.x,i.y,o.x,o.y,s.x,s.y,p.x,p.y)&&Zl(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&Xl(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Zl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&Xl(i.x,i.y,o.x,o.y,s.x,s.y,p.x,p.y)&&Zl(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&Xl(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Zl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Bl(e,t,r){let n=e;do{const i=n.prev,o=n.next.next;!Jl(i,o)&&Kl(i,n,n.next,o)&&ec(i,o)&&ec(o,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(o.i/r),nc(n),nc(n.next),n=e=o),n=n.next}while(n!==e);return Dl(n)}function zl(e,t,r,n,i,o){let s=e;do{let e=s.next.next;for(;e!==s.prev;){if(s.i!==e.i&&Yl(s,e)){let a=tc(s,e);return s=Dl(s,s.next),a=Dl(a,a.next),Nl(s,t,r,n,i,o),void Nl(a,t,r,n,i,o)}e=e.next}s=s.next}while(s!==e)}function Gl(e,t){return e.x-t.x}function Vl(e,t){if(t=function(e,t){let r=t;const n=e.x,i=e.y;let o,s=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const e=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=n&&e>s){if(s=e,e===n){if(i===r.y)return r;if(i===r.next.y)return r.next}o=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!o)return null;if(n===s)return o;const a=o,l=o.x,c=o.y;let u,h=1/0;r=o;do{n>=r.x&&r.x>=l&&n!==r.x&&Xl(i<c?n:s,i,l,c,i<c?s:n,i,r.x,r.y)&&(u=Math.abs(i-r.y)/(n-r.x),ec(r,e)&&(u<h||u===h&&(r.x>o.x||r.x===o.x&&Hl(o,r)))&&(o=r,h=u)),r=r.next}while(r!==a);return o}(e,t),t){const r=tc(t,e);Dl(t,t.next),Dl(r,r.next)}}function Hl(e,t){return Zl(e.prev,e,t.prev)<0&&Zl(t.next,e,e.next)<0}function Wl(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function ql(e){let t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function Xl(e,t,r,n,i,o,s,a){return(i-s)*(t-a)-(e-s)*(o-a)>=0&&(e-s)*(n-a)-(r-s)*(t-a)>=0&&(r-s)*(o-a)-(i-s)*(n-a)>=0}function Yl(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Kl(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(ec(e,t)&&ec(t,e)&&function(e,t){let r=e,n=!1;const i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Zl(e.prev,e,t.prev)||Zl(e,t.prev,t))||Jl(e,t)&&Zl(e.prev,e,e.next)>0&&Zl(t.prev,t,t.next)>0)}function Zl(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Jl(e,t){return e.x===t.x&&e.y===t.y}function Kl(e,t,r,n){const i=$l(Zl(e,t,r)),o=$l(Zl(e,t,n)),s=$l(Zl(r,n,e)),a=$l(Zl(r,n,t));return i!==o&&s!==a||!(0!==i||!Ql(e,r,t))||!(0!==o||!Ql(e,n,t))||!(0!==s||!Ql(r,e,n))||!(0!==a||!Ql(r,t,n))}function Ql(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function $l(e){return e>0?1:e<0?-1:0}function ec(e,t){return Zl(e.prev,e,e.next)<0?Zl(e,t,e.next)>=0&&Zl(e,e.prev,t)>=0:Zl(e,t,e.prev)<0||Zl(e,e.next,t)<0}function tc(e,t){const r=new ic(e.i,e.x,e.y),n=new ic(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function rc(e,t,r,n){const i=new ic(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(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 ic(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class oc{static area(e){const t=e.length;let r=0;for(let n=t-1,i=0;i<t;n=i++)r+=e[n].x*e[i].y-e[i].x*e[n].y;return.5*r}static isClockWise(e){return oc.area(e)<0}static triangulateShape(e,t){const r=[],n=[],i=[];sc(e),ac(r,e);let o=e.length;t.forEach(sc);for(let e=0;e<t.length;e++)n.push(o),o+=t[e].length,ac(r,t[e]);const s=function(e,t,r=2){const n=t&&t.length,i=n?t[0]*r:e.length;let o=Il(e,0,i,r,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,c,u,h,d,p;if(n&&(o=function(e,t,r,n){const i=[];let o,s,a,l,c;for(o=0,s=t.length;o<s;o++)a=t[o]*n,l=o<s-1?t[o+1]*n:e.length,c=Il(e,a,l,n,!1),c===c.next&&(c.steiner=!0),i.push(ql(c));for(i.sort(Gl),o=0;o<i.length;o++)Vl(i[o],r),r=Dl(r,r.next);return r}(e,t,o,r)),e.length>80*r){a=c=e[0],l=u=e[1];for(let t=r;t<i;t+=r)h=e[t],d=e[t+1],h<a&&(a=h),d<l&&(l=d),h>c&&(c=h),d>u&&(u=d);p=Math.max(c-a,u-l),p=0!==p?1/p:0}return Nl(o,s,r,a,l,p),s}(r,n);for(let e=0;e<s.length;e+=3)i.push(s.slice(e,e+3));return i}}function sc(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function ac(e,t){for(let r=0;r<t.length;r++)e.push(t[r].x),e.push(t[r].y)}class lc extends Jn{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const r=this,n=[],i=[];for(let t=0,r=e.length;t<r;t++)o(e[t]);function o(e){const o=[],s=void 0!==t.curveSegments?t.curveSegments:12,a=void 0!==t.steps?t.steps:1;let l=void 0!==t.depth?t.depth:100,c=void 0===t.bevelEnabled||t.bevelEnabled,u=void 0!==t.bevelThickness?t.bevelThickness:6,h=void 0!==t.bevelSize?t.bevelSize:u-2,d=void 0!==t.bevelOffset?t.bevelOffset:0,p=void 0!==t.bevelSegments?t.bevelSegments:3;const f=t.extrudePath,m=void 0!==t.UVGenerator?t.UVGenerator:cc;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=t.amount);let y,g,v,b,_,x=!1;f&&(y=f.getSpacedPoints(a),x=!0,c=!1,g=f.computeFrenetFrames(a,!1),v=new hr,b=new hr,_=new hr),c||(p=0,u=0,h=0,d=0);const w=e.extractPoints(s);let S=w.shape;const M=w.holes;if(!oc.isClockWise(S)){S=S.reverse();for(let e=0,t=M.length;e<t;e++){const t=M[e];oc.isClockWise(t)&&(M[e]=t.reverse())}}const T=oc.triangulateShape(S,M),E=S;for(let e=0,t=M.length;e<t;e++){const t=M[e];S=S.concat(t)}function j(e,t,r){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(r).add(e)}const A=S.length,L=T.length;function C(e,t,r){let n,i,o;const s=e.x-t.x,a=e.y-t.y,l=r.x-e.x,c=r.y-e.y,u=s*s+a*a,h=s*c-a*l;if(Math.abs(h)>Number.EPSILON){const h=Math.sqrt(u),d=Math.sqrt(l*l+c*c),p=t.x-a/h,f=t.y+s/h,m=((r.x-c/d-p)*c-(r.y+l/d-f)*l)/(s*c-a*l);n=p+s*m-e.x,i=f+a*m-e.y;const y=n*n+i*i;if(y<=2)return new er(n,i);o=Math.sqrt(y/2)}else{let e=!1;s>Number.EPSILON?l>Number.EPSILON&&(e=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(c)&&(e=!0),e?(n=-a,i=s,o=Math.sqrt(u)):(n=s,i=a,o=Math.sqrt(u/2))}return new er(n/o,i/o)}const P=[];for(let e=0,t=E.length,r=t-1,n=e+1;e<t;e++,r++,n++)r===t&&(r=0),n===t&&(n=0),P[e]=C(E[e],E[r],E[n]);const R=[];let O,k=P.concat();for(let e=0,t=M.length;e<t;e++){const t=M[e];O=[];for(let e=0,r=t.length,n=r-1,i=e+1;e<r;e++,n++,i++)n===r&&(n=0),i===r&&(i=0),O[e]=C(t[e],t[n],t[i]);R.push(O),k=k.concat(O)}for(let e=0;e<p;e++){const t=e/p,r=u*Math.cos(t*Math.PI/2),n=h*Math.sin(t*Math.PI/2)+d;for(let e=0,t=E.length;e<t;e++){const t=j(E[e],P[e],n);N(t.x,t.y,-r)}for(let e=0,t=M.length;e<t;e++){const t=M[e];O=R[e];for(let e=0,i=t.length;e<i;e++){const i=j(t[e],O[e],n);N(i.x,i.y,-r)}}}const I=h+d;for(let e=0;e<A;e++){const t=c?j(S[e],k[e],I):S[e];x?(b.copy(g.normals[0]).multiplyScalar(t.x),v.copy(g.binormals[0]).multiplyScalar(t.y),_.copy(y[0]).add(b).add(v),N(_.x,_.y,_.z)):N(t.x,t.y,0)}for(let e=1;e<=a;e++)for(let t=0;t<A;t++){const r=c?j(S[t],k[t],I):S[t];x?(b.copy(g.normals[e]).multiplyScalar(r.x),v.copy(g.binormals[e]).multiplyScalar(r.y),_.copy(y[e]).add(b).add(v),N(_.x,_.y,_.z)):N(r.x,r.y,l/a*e)}for(let e=p-1;e>=0;e--){const t=e/p,r=u*Math.cos(t*Math.PI/2),n=h*Math.sin(t*Math.PI/2)+d;for(let e=0,t=E.length;e<t;e++){const t=j(E[e],P[e],n);N(t.x,t.y,l+r)}for(let e=0,t=M.length;e<t;e++){const t=M[e];O=R[e];for(let e=0,i=t.length;e<i;e++){const i=j(t[e],O[e],n);x?N(i.x,i.y+y[a-1].y,y[a-1].x+r):N(i.x,i.y,l+r)}}}function D(e,t){let r=e.length;for(;--r>=0;){const n=r;let i=r-1;i<0&&(i=e.length-1);for(let e=0,r=a+2*p;e<r;e++){const r=A*e,o=A*(e+1);U(t+n+r,t+i+r,t+i+o,t+n+o)}}}function N(e,t,r){o.push(e),o.push(t),o.push(r)}function F(e,t,i){B(e),B(t),B(i);const o=n.length/3,s=m.generateTopUV(r,n,o-3,o-2,o-1);z(s[0]),z(s[1]),z(s[2])}function U(e,t,i,o){B(e),B(t),B(o),B(t),B(i),B(o);const s=n.length/3,a=m.generateSideWallUV(r,n,s-6,s-3,s-2,s-1);z(a[0]),z(a[1]),z(a[3]),z(a[1]),z(a[2]),z(a[3])}function B(e){n.push(o[3*e+0]),n.push(o[3*e+1]),n.push(o[3*e+2])}function z(e){i.push(e.x),i.push(e.y)}!function(){const e=n.length/3;if(c){let e=0,t=A*e;for(let e=0;e<L;e++){const r=T[e];F(r[2]+t,r[1]+t,r[0]+t)}e=a+2*p,t=A*e;for(let e=0;e<L;e++){const r=T[e];F(r[0]+t,r[1]+t,r[2]+t)}}else{for(let e=0;e<L;e++){const t=T[e];F(t[2],t[1],t[0])}for(let e=0;e<L;e++){const t=T[e];F(t[0]+A*a,t[1]+A*a,t[2]+A*a)}}r.addGroup(e,n.length/3-e,0)}(),function(){const e=n.length/3;let t=0;D(E,t),t+=E.length;for(let e=0,r=M.length;e<r;e++){const r=M[e];D(r,t),t+=r.length}r.addGroup(e,n.length/3-e,1)}()}this.setAttribute("position",new zn(n,3)),this.setAttribute("uv",new zn(i,2)),this.computeVertexNormals()}toJSON(){const e=super.toJSON();return function(e,t,r){if(r.shapes=[],Array.isArray(e))for(let t=0,n=e.length;t<n;t++){const n=e[t];r.shapes.push(n.uuid)}else r.shapes.push(e.uuid);return void 0!==t.extrudePath&&(r.options.extrudePath=t.extrudePath.toJSON()),r}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const r=[];for(let n=0,i=e.shapes.length;n<i;n++){const i=t[e.shapes[n]];r.push(i)}const n=e.options.extrudePath;return void 0!==n&&(e.options.extrudePath=(new kl[n.type]).fromJSON(n)),new lc(r,e.options)}}const cc={generateTopUV:function(e,t,r,n,i){const o=t[3*r],s=t[3*r+1],a=t[3*n],l=t[3*n+1],c=t[3*i],u=t[3*i+1];return[new er(o,s),new er(a,l),new er(c,u)]},generateSideWallUV:function(e,t,r,n,i,o){const s=t[3*r],a=t[3*r+1],l=t[3*r+2],c=t[3*n],u=t[3*n+1],h=t[3*n+2],d=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*o],y=t[3*o+1],g=t[3*o+2];return Math.abs(a-u)<Math.abs(s-c)?[new er(s,1-l),new er(c,1-h),new er(d,1-f),new er(m,1-g)]:[new er(a,1-l),new er(u,1-h),new er(p,1-f),new er(y,1-g)]}};class uc extends Jn{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const r=[],n=[],i=[],o=[];let s=0,a=0;if(!1===Array.isArray(e))l(e);else for(let t=0;t<e.length;t++)l(e[t]),this.addGroup(s,a,t),s+=a,a=0;function l(e){const s=n.length/3,l=e.extractPoints(t);let c=l.shape;const u=l.holes;!1===oc.isClockWise(c)&&(c=c.reverse());for(let e=0,t=u.length;e<t;e++){const t=u[e];!0===oc.isClockWise(t)&&(u[e]=t.reverse())}const h=oc.triangulateShape(c,u);for(let e=0,t=u.length;e<t;e++){const t=u[e];c=c.concat(t)}for(let e=0,t=c.length;e<t;e++){const t=c[e];n.push(t.x,t.y,0),i.push(0,0,1),o.push(t.x,t.y)}for(let e=0,t=h.length;e<t;e++){const t=h[e],n=t[0]+s,i=t[1]+s,o=t[2]+s;r.push(n,i,o),a+=3}}this.setIndex(r),this.setAttribute("position",new zn(n,3)),this.setAttribute("normal",new zn(i,3)),this.setAttribute("uv",new zn(o,2))}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let r=0,n=e.length;r<n;r++){const n=e[r];t.shapes.push(n.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const r=[];for(let n=0,i=e.shapes.length;n<i;n++){const i=t[e.shapes[n]];r.push(i)}return new uc(r,e.curveSegments)}}class hc extends Jn{constructor(e=1,t=32,r=16,n=0,i=2*Math.PI,o=0,s=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:n,phiLength:i,thetaStart:o,thetaLength:s},t=Math.max(3,Math.floor(t)),r=Math.max(2,Math.floor(r));const a=Math.min(o+s,Math.PI);let l=0;const c=[],u=new hr,h=new hr,d=[],p=[],f=[],m=[];for(let d=0;d<=r;d++){const y=[],g=d/r;let v=0;0==d&&0==o?v=.5/t:d==r&&a==Math.PI&&(v=-.5/t);for(let r=0;r<=t;r++){const a=r/t;u.x=-e*Math.cos(n+a*i)*Math.sin(o+g*s),u.y=e*Math.cos(o+g*s),u.z=e*Math.sin(n+a*i)*Math.sin(o+g*s),p.push(u.x,u.y,u.z),h.copy(u).normalize(),f.push(h.x,h.y,h.z),m.push(a+v,1-g),y.push(l++)}c.push(y)}for(let e=0;e<r;e++)for(let n=0;n<t;n++){const t=c[e][n+1],i=c[e][n],s=c[e+1][n],l=c[e+1][n+1];(0!==e||o>0)&&d.push(t,i,l),(e!==r-1||a<Math.PI)&&d.push(i,s,l)}this.setIndex(d),this.setAttribute("position",new zn(p,3)),this.setAttribute("normal",new zn(f,3)),this.setAttribute("uv",new zn(m,2))}static fromJSON(e){return new hc(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}(class extends jn{constructor(e){super(),this.type="ShadowMaterial",this.color=new kn(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}).prototype.isShadowMaterial=!0;class dc extends jn{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new kn(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 kn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ut,this.normalScale=new er(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.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}dc.prototype.isMeshStandardMaterial=!0;(class extends dc{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new er(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Jt(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.sheenTint=new kn(0),this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationTint=new kn(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularTint=new kn(1,1,1),this.specularTintMap=null,this._clearcoat=0,this._transmission=0,this.setValues(e)}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheenTint.copy(e.sheenTint),this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationTint.copy(e.attenuationTint),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularTint.copy(e.specularTint),this.specularTintMap=e.specularTintMap,this}}).prototype.isMeshPhysicalMaterial=!0;(class extends jn{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new kn(16777215),this.specular=new kn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ut,this.normalScale=new er(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=G,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}).prototype.isMeshPhongMaterial=!0;(class extends jn{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new kn(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ut,this.normalScale=new er(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.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}).prototype.isMeshToonMaterial=!0;(class extends jn{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ut,this.normalScale=new er(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}).prototype.isMeshNormalMaterial=!0;(class extends jn{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new kn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=G,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.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}}).prototype.isMeshLambertMaterial=!0;(class extends jn{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new kn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ut,this.normalScale=new er(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}}).prototype.isMeshMatcapMaterial=!0;(class extends $a{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}).prototype.isLineDashedMaterial=!0;const pc={arraySlice:function(e,t,r){return pc.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==r?r:e.length)):e.slice(t,r)},convertArray:function(e,t,r){return!e||!r&&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){const t=e.length,r=new Array(t);for(let e=0;e!==t;++e)r[e]=e;return r.sort((function(t,r){return e[t]-e[r]})),r},sortedArray:function(e,t,r){const n=e.length,i=new e.constructor(n);for(let o=0,s=0;s!==n;++o){const n=r[o]*t;for(let r=0;r!==t;++r)i[s++]=e[n+r]}return i},flattenJSON:function(e,t,r,n){let i=1,o=e[0];for(;void 0!==o&&void 0===o[n];)o=e[i++];if(void 0===o)return;let s=o[n];if(void 0!==s)if(Array.isArray(s))do{s=o[n],void 0!==s&&(t.push(o.time),r.push.apply(r,s)),o=e[i++]}while(void 0!==o);else if(void 0!==s.toArray)do{s=o[n],void 0!==s&&(t.push(o.time),s.toArray(r,r.length)),o=e[i++]}while(void 0!==o);else do{s=o[n],void 0!==s&&(t.push(o.time),r.push(s)),o=e[i++]}while(void 0!==o)},subclip:function(e,t,r,n,i=30){const o=e.clone();o.name=t;const s=[];for(let e=0;e<o.tracks.length;++e){const t=o.tracks[e],a=t.getValueSize(),l=[],c=[];for(let e=0;e<t.times.length;++e){const o=t.times[e]*i;if(!(o<r||o>=n)){l.push(t.times[e]);for(let r=0;r<a;++r)c.push(t.values[e*a+r])}}0!==l.length&&(t.times=pc.convertArray(l,t.times.constructor),t.values=pc.convertArray(c,t.values.constructor),s.push(t))}o.tracks=s;let a=1/0;for(let e=0;e<o.tracks.length;++e)a>o.tracks[e].times[0]&&(a=o.tracks[e].times[0]);for(let e=0;e<o.tracks.length;++e)o.tracks[e].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(e,t=0,r=e,n=30){n<=0&&(n=30);const i=r.tracks.length,o=t/n;for(let t=0;t<i;++t){const n=r.tracks[t],i=n.ValueTypeName;if("bool"===i||"string"===i)continue;const s=e.tracks.find((function(e){return e.name===n.name&&e.ValueTypeName===i}));if(void 0===s)continue;let a=0;const l=n.getValueSize();n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(a=l/3);let c=0;const u=s.getValueSize();s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=u/3);const h=n.times.length-1;let d;if(o<=n.times[0]){const e=a,t=l-a;d=pc.arraySlice(n.values,e,t)}else if(o>=n.times[h]){const e=h*l+a,t=e+l-a;d=pc.arraySlice(n.values,e,t)}else{const e=n.createInterpolant(),t=a,r=l-a;e.evaluate(o),d=pc.arraySlice(e.resultBuffer,t,r)}"quaternion"===i&&(new ur).fromArray(d).normalize().conjugate().toArray(d);const p=s.times.length;for(let e=0;e<p;++e){const t=e*u+c;if("quaternion"===i)ur.multiplyQuaternionsFlat(s.values,t,d,0,s.values,t);else{const e=u-2*c;for(let r=0;r<e;++r)s.values[t+r]-=d[r]}}}return e.blendMode=2501,e}};class fc{constructor(e,t,r,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let r=this._cachedIndex,n=t[r],i=t[r-1];e:{t:{let o;r:{n:if(!(e<n)){for(let o=r+2;;){if(void 0===n){if(e<i)break n;return r=t.length,this._cachedIndex=r,this.afterEnd_(r-1,e,i)}if(r===o)break;if(i=n,n=t[++r],e<n)break t}o=t.length;break r}if(e>=i)break e;{const s=t[1];e<s&&(r=2,i=s);for(let o=r-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,n);if(r===o)break;if(n=i,i=t[--r-1],e>=i)break t}o=r,r=0}}for(;r<o;){const n=r+o>>>1;e<t[n]?o=n:r=n+1}if(n=t[r],i=t[r-1],void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,n);if(void 0===n)return r=t.length,this._cachedIndex=r,this.afterEnd_(r-1,i,e)}this._cachedIndex=r,this.intervalChanged_(r,i,n)}return this.interpolate_(r,i,e,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,i=e*n;for(let e=0;e!==n;++e)t[e]=r[i+e];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}fc.prototype.beforeStart_=fc.prototype.copySampleValue_,fc.prototype.afterEnd_=fc.prototype.copySampleValue_;class mc extends fc{constructor(e,t,r,n){super(e,t,r,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:jt,endingEnd:jt}}intervalChanged_(e,t,r){const n=this.parameterPositions;let i=e-2,o=e+1,s=n[i],a=n[o];if(void 0===s)switch(this.getSettings_().endingStart){case At:i=e,s=2*t-r;break;case Lt:i=n.length-2,s=t+n[i]-n[i+1];break;default:i=e,s=r}if(void 0===a)switch(this.getSettings_().endingEnd){case At:o=e,a=2*r-t;break;case Lt:o=1,a=r+n[1]-n[0];break;default:o=e-1,a=t}const l=.5*(r-t),c=this.valueSize;this._weightPrev=l/(t-s),this._weightNext=l/(a-r),this._offsetPrev=i*c,this._offsetNext=o*c}interpolate_(e,t,r,n){const i=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=e*s,l=a-s,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(r-t)/(n-t),f=p*p,m=f*p,y=-h*m+2*h*f-h*p,g=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,b=d*m-d*f;for(let e=0;e!==s;++e)i[e]=y*o[c+e]+g*o[l+e]+v*o[a+e]+b*o[u+e];return i}}class yc extends fc{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e,t,r,n){const i=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=e*s,l=a-s,c=(r-t)/(n-t),u=1-c;for(let e=0;e!==s;++e)i[e]=o[l+e]*u+o[a+e]*c;return i}}class gc extends fc{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e){return this.copySampleValue_(e-1)}}class vc{constructor(e,t,r,n){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=pc.convertArray(t,this.TimeBufferType),this.values=pc.convertArray(r,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let r;if(t.toJSON!==this.toJSON)r=t.toJSON(e);else{r={name:e.name,times:pc.convertArray(e.times,Array),values:pc.convertArray(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(r.interpolation=t)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new gc(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new yc(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new mc(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Mt:t=this.InterpolantFactoryMethodDiscrete;break;case Tt:t=this.InterpolantFactoryMethodLinear;break;case Et:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Mt;case this.InterpolantFactoryMethodLinear:return Tt;case this.InterpolantFactoryMethodSmooth:return Et}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let r=0,n=t.length;r!==n;++r)t[r]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let r=0,n=t.length;r!==n;++r)t[r]*=e}return this}trim(e,t){const r=this.times,n=r.length;let i=0,o=n-1;for(;i!==n&&r[i]<e;)++i;for(;-1!==o&&r[o]>t;)--o;if(++o,0!==i||o!==n){i>=o&&(o=Math.max(o,1),i=o-1);const e=this.getValueSize();this.times=pc.arraySlice(r,i,o),this.values=pc.arraySlice(this.values,i*e,o*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let t=0;t!==i;t++){const n=r[t];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,n),e=!1;break}if(null!==o&&o>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,n,o),e=!1;break}o=n}if(void 0!==n&&pc.isTypedArray(n))for(let t=0,r=n.length;t!==r;++t){const r=n[t];if(isNaN(r)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,r),e=!1;break}}return e}optimize(){const e=pc.arraySlice(this.times),t=pc.arraySlice(this.values),r=this.getValueSize(),n=this.getInterpolation()===Et,i=e.length-1;let o=1;for(let s=1;s<i;++s){let i=!1;const a=e[s];if(a!==e[s+1]&&(1!==s||a!==e[0]))if(n)i=!0;else{const e=s*r,n=e-r,o=e+r;for(let s=0;s!==r;++s){const r=t[e+s];if(r!==t[n+s]||r!==t[o+s]){i=!0;break}}}if(i){if(s!==o){e[o]=e[s];const n=s*r,i=o*r;for(let e=0;e!==r;++e)t[i+e]=t[n+e]}++o}}if(i>0){e[o]=e[i];for(let e=i*r,n=o*r,s=0;s!==r;++s)t[n+s]=t[e+s];++o}return o!==e.length?(this.times=pc.arraySlice(e,0,o),this.values=pc.arraySlice(t,0,o*r)):(this.times=e,this.values=t),this}clone(){const e=pc.arraySlice(this.times,0),t=pc.arraySlice(this.values,0),r=new(0,this.constructor)(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}vc.prototype.TimeBufferType=Float32Array,vc.prototype.ValueBufferType=Float32Array,vc.prototype.DefaultInterpolation=Tt;class bc extends vc{}bc.prototype.ValueTypeName="bool",bc.prototype.ValueBufferType=Array,bc.prototype.DefaultInterpolation=Mt,bc.prototype.InterpolantFactoryMethodLinear=void 0,bc.prototype.InterpolantFactoryMethodSmooth=void 0;class _c extends vc{}_c.prototype.ValueTypeName="color";class xc extends vc{}xc.prototype.ValueTypeName="number";class wc extends fc{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e,t,r,n){const i=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=(r-t)/(n-t);let l=e*s;for(let e=l+s;l!==e;l+=4)ur.slerpFlat(i,0,o,l-s,o,l,a);return i}}class Sc extends vc{InterpolantFactoryMethodLinear(e){return new wc(this.times,this.values,this.getValueSize(),e)}}Sc.prototype.ValueTypeName="quaternion",Sc.prototype.DefaultInterpolation=Tt,Sc.prototype.InterpolantFactoryMethodSmooth=void 0;class Mc extends vc{}Mc.prototype.ValueTypeName="string",Mc.prototype.ValueBufferType=Array,Mc.prototype.DefaultInterpolation=Mt,Mc.prototype.InterpolantFactoryMethodLinear=void 0,Mc.prototype.InterpolantFactoryMethodSmooth=void 0;class Tc extends vc{}Tc.prototype.ValueTypeName="vector";class Ec{constructor(e,t=-1,r,n=2500){this.name=e,this.tracks=r,this.duration=t,this.blendMode=n,this.uuid=Zt(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,n=1/(e.fps||1);for(let e=0,i=r.length;e!==i;++e)t.push(jc(r[e]).scale(n));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],r=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,n=r.length;e!==n;++e)t.push(vc.toJSON(r[e]));return n}static CreateFromMorphTargetSequence(e,t,r,n){const i=t.length,o=[];for(let e=0;e<i;e++){let s=[],a=[];s.push((e+i-1)%i,e,(e+1)%i),a.push(0,1,0);const l=pc.getKeyframeOrder(s);s=pc.sortedArray(s,1,l),a=pc.sortedArray(a,1,l),n||0!==s[0]||(s.push(i),a.push(a[0])),o.push(new xc(".morphTargetInfluences["+t[e].name+"]",s,a).scale(1/r))}return new this(e,-1,o)}static findByName(e,t){let r=e;if(!Array.isArray(e)){const t=e;r=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<r.length;e++)if(r[e].name===t)return r[e];return null}static CreateClipsFromMorphTargetSequences(e,t,r){const n={},i=/^([\w-]*?)([\d]+)$/;for(let t=0,r=e.length;t<r;t++){const r=e[t],o=r.name.match(i);if(o&&o.length>1){const e=o[1];let t=n[e];t||(n[e]=t=[]),t.push(r)}}const o=[];for(const e in n)o.push(this.CreateFromMorphTargetSequence(e,n[e],t,r));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(e,t,r,n,i){if(0!==r.length){const o=[],s=[];pc.flattenJSON(r,o,s,n),0!==o.length&&i.push(new e(t,o,s))}},n=[],i=e.name||"default",o=e.fps||30,s=e.blendMode;let a=e.length||-1;const l=e.hierarchy||[];for(let e=0;e<l.length;e++){const i=l[e].keys;if(i&&0!==i.length)if(i[0].morphTargets){const e={};let t;for(t=0;t<i.length;t++)if(i[t].morphTargets)for(let r=0;r<i[t].morphTargets.length;r++)e[i[t].morphTargets[r]]=-1;for(const r in e){const e=[],o=[];for(let n=0;n!==i[t].morphTargets.length;++n){const n=i[t];e.push(n.time),o.push(n.morphTarget===r?1:0)}n.push(new xc(".morphTargetInfluence["+r+"]",e,o))}a=e.length*(o||1)}else{const o=".bones["+t[e].name+"]";r(Tc,o+".position",i,"pos",n),r(Sc,o+".quaternion",i,"rot",n),r(Tc,o+".scale",i,"scl",n)}}return 0===n.length?null:new this(i,a,n,s)}resetDuration(){let e=0;for(let t=0,r=this.tracks.length;t!==r;++t){const r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function jc(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return xc;case"vector":case"vector2":case"vector3":case"vector4":return Tc;case"color":return _c;case"quaternion":return Sc;case"bool":case"boolean":return bc;case"string":return Mc}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],r=[];pc.flattenJSON(e.keys,t,r,"value"),e.times=t,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const Ac={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={}}};const Lc=new class{constructor(e,t,r){const n=this;let i,o=!1,s=0,a=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(e){a++,!1===o&&void 0!==n.onStart&&n.onStart(e,s,a),o=!0},this.itemEnd=function(e){s++,void 0!==n.onProgress&&n.onProgress(e,s,a),s===a&&(o=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,r=l.length;t<r;t+=2){const r=l[t],n=l[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return n}return null}}};class Cc{constructor(e){this.manager=void 0!==e?e:Lc,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const r=this;return new Promise((function(n,i){r.load(e,n,t,i)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Pc={};class Rc extends Cc{constructor(e){super(e)}load(e,t,r,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,o=Ac.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!==Pc[e])return void Pc[e].push({onLoad:t,onProgress:r,onError:n});const s=e.match(/^data:(.*?)(;base64)?,(.*)$/);let a;if(s){const r=s[1],o=!!s[2];let a=s[3];a=decodeURIComponent(a),o&&(a=atob(a));try{let n;const o=(this.responseType||"").toLowerCase();switch(o){case"arraybuffer":case"blob":const e=new Uint8Array(a.length);for(let t=0;t<a.length;t++)e[t]=a.charCodeAt(t);n="blob"===o?new Blob([e.buffer],{type:r}):e.buffer;break;case"document":const t=new DOMParser;n=t.parseFromString(a,r);break;case"json":n=JSON.parse(a);break;default:n=a}setTimeout((function(){t&&t(n),i.manager.itemEnd(e)}),0)}catch(t){setTimeout((function(){n&&n(t),i.manager.itemError(e),i.manager.itemEnd(e)}),0)}}else{Pc[e]=[],Pc[e].push({onLoad:t,onProgress:r,onError:n}),a=new XMLHttpRequest,a.open("GET",e,!0),a.addEventListener("load",(function(t){const r=this.response,n=Pc[e];if(delete Pc[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Ac.add(e,r);for(let e=0,t=n.length;e<t;e++){const t=n[e];t.onLoad&&t.onLoad(r)}i.manager.itemEnd(e)}else{for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onError&&r.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}}),!1),a.addEventListener("progress",(function(t){const r=Pc[e];for(let e=0,n=r.length;e<n;e++){const n=r[e];n.onProgress&&n.onProgress(t)}}),!1),a.addEventListener("error",(function(t){const r=Pc[e];delete Pc[e];for(let e=0,n=r.length;e<n;e++){const n=r[e];n.onError&&n.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),!1),a.addEventListener("abort",(function(t){const r=Pc[e];delete Pc[e];for(let e=0,n=r.length;e<n;e++){const n=r[e];n.onError&&n.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");for(const e in this.requestHeader)a.setRequestHeader(e,this.requestHeader[e]);a.send(null)}return i.manager.itemStart(e),a}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Oc extends Cc{constructor(e){super(e)}load(e,t,r,n){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,o=Ac.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;const s=document.createElementNS("http://www.w3.org/1999/xhtml","img");function a(){s.removeEventListener("load",a,!1),s.removeEventListener("error",l,!1),Ac.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){s.removeEventListener("load",a,!1),s.removeEventListener("error",l,!1),n&&n(t),i.manager.itemError(e),i.manager.itemEnd(e)}return s.addEventListener("load",a,!1),s.addEventListener("error",l,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),i.manager.itemStart(e),s.src=e,s}}class kc extends Cc{constructor(e){super(e)}load(e,t,r,n){const i=new Ti,o=new Oc(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let s=0;function a(r){o.load(e[r],(function(e){i.images[r]=e,s++,6===s&&(i.needsUpdate=!0,t&&t(i))}),void 0,n)}for(let t=0;t<e.length;++t)a(t);return i}}class Ic extends Cc{constructor(e){super(e)}load(e,t,r,n){const i=new or,o=new Oc(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,(function(r){i.image=r;const n=e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);i.format=n?Te:Ee,i.needsUpdate=!0,void 0!==t&&t(i)}),r,n),i}}class Dc extends yl{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Cl(t,e))}getPoint(e){const t=e*this.getLength(),r=this.getCurveLengths();let n=0;for(;n<r.length;){if(r[n]>=t){const e=r[n]-t,i=this.curves[n],o=i.getLength(),s=0===o?0:1-e/o;return i.getPointAt(s)}n++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,n=this.curves.length;r<n;r++)t+=this.curves[r].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let r;for(let n=0,i=this.curves;n<i.length;n++){const o=i[n],s=o&&o.isEllipseCurve?2*e:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,a=o.getPoints(s);for(let e=0;e<a.length;e++){const n=a[e];r&&r.equals(n)||(t.push(n),r=n)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,r=this.curves.length;t<r;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const r=e.curves[t];this.curves.push((new kl[r.type]).fromJSON(r))}return this}}class Nc extends Dc{constructor(e){super(),this.type="Path",this.currentPoint=new er,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,r=e.length;t<r;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const r=new Cl(this.currentPoint.clone(),new er(e,t));return this.curves.push(r),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,r,n){const i=new Pl(this.currentPoint.clone(),new er(e,t),new er(r,n));return this.curves.push(i),this.currentPoint.set(r,n),this}bezierCurveTo(e,t,r,n,i,o){const s=new Al(this.currentPoint.clone(),new er(e,t),new er(r,n),new er(i,o));return this.curves.push(s),this.currentPoint.set(i,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),r=new Ol(t);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,r,n,i,o){const s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(e+s,t+a,r,n,i,o),this}absarc(e,t,r,n,i,o){return this.absellipse(e,t,r,r,n,i,o),this}ellipse(e,t,r,n,i,o,s,a){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,r,n,i,o,s,a),this}absellipse(e,t,r,n,i,o,s,a){const l=new gl(e,t,r,n,i,o,s,a);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Fc extends Nc{constructor(e){super(e),this.uuid=Zt(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let r=0,n=this.holes.length;r<n;r++)t[r]=this.holes[r].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,r=this.holes.length;t<r;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const r=e.holes[t];this.holes.push((new Nc).fromJSON(r))}return this}}class Uc extends fn{constructor(e,t=1){super(),this.type="Light",this.color=new kn(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}Uc.prototype.isLight=!0;(class extends Uc{constructor(e,t,r){super(e,r),this.type="HemisphereLight",this.position.copy(fn.DefaultUp),this.updateMatrix(),this.groundColor=new kn(t)}copy(e){return Uc.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}).prototype.isHemisphereLight=!0;const Bc=new Gr,zc=new hr,Gc=new hr;class Vc{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new er(512,512),this.map=null,this.mapPass=null,this.matrix=new Gr,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Oi,this._frameExtents=new er(1,1),this._viewportCount=1,this._viewports=[new ar(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,r=this.matrix;zc.setFromMatrixPosition(e.matrixWorld),t.position.copy(zc),Gc.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Gc),t.updateMatrixWorld(),Bc.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Bc),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(t.projectionMatrix),r.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Hc extends Vc{constructor(){super(new wi(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,r=2*Yt*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;r===t.fov&&n===t.aspect&&i===t.far||(t.fov=r,t.aspect=n,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}Hc.prototype.isSpotLightShadow=!0;(class extends Uc{constructor(e,t,r=0,n=Math.PI/3,i=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(fn.DefaultUp),this.updateMatrix(),this.target=new fn,this.distance=r,this.angle=n,this.penumbra=i,this.decay=o,this.shadow=new Hc}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(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}}).prototype.isSpotLight=!0;const Wc=new Gr,qc=new hr,Xc=new hr;class Yc extends Vc{constructor(){super(new wi(90,1,.5,500)),this._frameExtents=new er(4,2),this._viewportCount=6,this._viewports=[new ar(2,1,1,1),new ar(0,1,1,1),new ar(3,1,1,1),new ar(1,1,1,1),new ar(3,0,1,1),new ar(1,0,1,1)],this._cubeDirections=[new hr(1,0,0),new hr(-1,0,0),new hr(0,0,1),new hr(0,0,-1),new hr(0,1,0),new hr(0,-1,0)],this._cubeUps=[new hr(0,1,0),new hr(0,1,0),new hr(0,1,0),new hr(0,1,0),new hr(0,0,1),new hr(0,0,-1)]}updateMatrices(e,t=0){const r=this.camera,n=this.matrix,i=e.distance||r.far;i!==r.far&&(r.far=i,r.updateProjectionMatrix()),qc.setFromMatrixPosition(e.matrixWorld),r.position.copy(qc),Xc.copy(r.position),Xc.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt(Xc),r.updateMatrixWorld(),n.makeTranslation(-qc.x,-qc.y,-qc.z),Wc.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Wc)}}Yc.prototype.isPointLightShadow=!0;(class extends Uc{constructor(e,t,r=0,n=1){super(e,t),this.type="PointLight",this.distance=r,this.decay=n,this.shadow=new Yc}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}).prototype.isPointLight=!0;class Zc extends Vc{constructor(){super(new qi(-5,5,5,-5,.5,500))}}Zc.prototype.isDirectionalLightShadow=!0;class Jc extends Uc{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(fn.DefaultUp),this.updateMatrix(),this.target=new fn,this.shadow=new Zc}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Jc.prototype.isDirectionalLight=!0;(class extends Uc{constructor(e,t){super(e,t),this.type="AmbientLight"}}).prototype.isAmbientLight=!0;(class extends Uc{constructor(e,t,r=10,n=10){super(e,t),this.type="RectAreaLight",this.width=r,this.height=n}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}).prototype.isRectAreaLight=!0;class Kc{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new hr)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const r=e.x,n=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*n),t.addScaledVector(o[2],.488603*i),t.addScaledVector(o[3],.488603*r),t.addScaledVector(o[4],r*n*1.092548),t.addScaledVector(o[5],n*i*1.092548),t.addScaledVector(o[6],.315392*(3*i*i-1)),t.addScaledVector(o[7],r*i*1.092548),t.addScaledVector(o[8],.546274*(r*r-n*n)),t}getIrradianceAt(e,t){const r=e.x,n=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],1.023328*n),t.addScaledVector(o[2],1.023328*i),t.addScaledVector(o[3],1.023328*r),t.addScaledVector(o[4],.858086*r*n),t.addScaledVector(o[5],.858086*n*i),t.addScaledVector(o[6],.743125*i*i-.247708),t.addScaledVector(o[7],.858086*r*i),t.addScaledVector(o[8],.429043*(r*r-n*n)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){const r=this.coefficients;for(let n=0;n<9;n++)r[n].fromArray(e,t+3*n);return this}toArray(e=[],t=0){const r=this.coefficients;for(let n=0;n<9;n++)r[n].toArray(e,t+3*n);return e}static getBasisAt(e,t){const r=e.x,n=e.y,i=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*i,t[3]=.488603*r,t[4]=1.092548*r*n,t[5]=1.092548*n*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*r*i,t[8]=.546274*(r*r-n*n)}}Kc.prototype.isSphericalHarmonics3=!0;class Qc extends Uc{constructor(e=new Kc,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Qc.prototype.isLightProbe=!0;class $c{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let r=0,n=e.length;r<n;r++)t+=String.fromCharCode(e[r]);try{return decodeURIComponent(escape(t))}catch(e){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}}(class extends Jn{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}).prototype.isInstancedBufferGeometry=!0,class extends Cc{constructor(e){super(e),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,o=Ac.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;const s={};s.credentials="anonymous"===this.crossOrigin?"same-origin":"include",s.headers=this.requestHeader,fetch(e,s).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(r){Ac.add(e,r),t&&t(r),i.manager.itemEnd(e)})).catch((function(t){n&&n(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}.prototype.isImageBitmapLoader=!0;let eu;class tu extends Cc{constructor(e){super(e)}load(e,t,r,n){const i=this,o=new Rc(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(r){try{const e=r.slice(0);(void 0===eu&&(eu=new(window.AudioContext||window.webkitAudioContext)),eu).decodeAudioData(e,(function(e){t(e)}))}catch(t){n?n(t):console.error(t),i.manager.itemError(e)}}),r,n)}}(class extends Qc{constructor(e,t,r=1){super(void 0,r);const n=(new kn).set(e),i=(new kn).set(t),o=new hr(n.r,n.g,n.b),s=new hr(i.r,i.g,i.b),a=Math.sqrt(Math.PI),l=a*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(s).multiplyScalar(a),this.sh.coefficients[1].copy(o).sub(s).multiplyScalar(l)}}).prototype.isHemisphereLightProbe=!0,class extends Qc{constructor(e,t=1){super(void 0,t);const r=(new kn).set(e);this.sh.coefficients[0].set(r.r,r.g,r.b).multiplyScalar(2*Math.sqrt(Math.PI))}}.prototype.isAmbientLightProbe=!0;class ru{constructor(e,t,r){let n,i,o;switch(this.binding=e,this.valueSize=r,t){case"quaternion":n=this._slerp,i=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*r),this._workIndex=5;break;case"string":case"bool":n=this._select,i=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*r);break;default:n=this._lerp,i=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*r)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=i,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const r=this.buffer,n=this.valueSize,i=e*n+n;let o=this.cumulativeWeight;if(0===o){for(let e=0;e!==n;++e)r[i+e]=r[e];o=t}else{o+=t;const e=t/o;this._mixBufferRegion(r,i,0,e,n)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,r=this.valueSize,n=r*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,n,0,e,r),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,r=this.buffer,n=e*t+t,i=this.cumulativeWeight,o=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){const e=t*this._origIndex;this._mixBufferRegion(r,n,e,1-i,t)}o>0&&this._mixBufferRegionAdditive(r,n,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(r[e]!==r[e+t]){s.setValue(r,n);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,n=r*this._origIndex;e.getValue(t,n);for(let e=r,i=n;e!==i;++e)t[e]=t[n+e%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r<t;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[t+r]=this.buffer[e+r]}_select(e,t,r,n,i){if(n>=.5)for(let n=0;n!==i;++n)e[t+n]=e[r+n]}_slerp(e,t,r,n){ur.slerpFlat(e,t,e,t,e,r,n)}_slerpAdditive(e,t,r,n,i){const o=this._workIndex*i;ur.multiplyQuaternionsFlat(e,o,e,t,e,r),ur.slerpFlat(e,t,e,t,e,o,n)}_lerp(e,t,r,n,i){const o=1-n;for(let s=0;s!==i;++s){const i=t+s;e[i]=e[i]*o+e[r+s]*n}}_lerpAdditive(e,t,r,n,i){for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]+e[r+o]*n}}}const nu="\\[\\]\\.:\\/",iu=new RegExp("["+nu+"]","g"),ou="[^"+nu+"]",su="[^"+nu.replace("\\.","")+"]",au=/((?:WC+[\/:])*)/.source.replace("WC",ou),lu=/(WCOD+)?/.source.replace("WCOD",su),cu=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",ou),uu=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",ou),hu=new RegExp("^"+au+lu+cu+uu+"$"),du=["material","materials","bones"];class pu{constructor(e,t,r){this.path=t,this.parsedPath=r||pu.parseTrackName(t),this.node=pu.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new pu.Composite(e,t,r):new pu(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(iu,"")}static parseTrackName(e){const t=hu.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const e=r.nodeName.substring(n+1);-1!==du.indexOf(e)&&(r.nodeName=r.nodeName.substring(0,n),r.objectName=e)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(void 0!==r)return r}if(e.children){const r=function(e){for(let n=0;n<e.length;n++){const i=e[n];if(i.name===t||i.uuid===t)return i;const o=r(i.children);if(o)return o}return null},n=r(e.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const r=this.resolvedProperty;for(let n=0,i=r.length;n!==i;++n)e[t++]=r[n]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const r=this.resolvedProperty;for(let n=0,i=r.length;n!==i;++n)r[n]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const r=this.resolvedProperty;for(let n=0,i=r.length;n!==i;++n)r[n]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const r=this.resolvedProperty;for(let n=0,i=r.length;n!==i;++n)r[n]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,r=t.objectName,n=t.propertyName;let i=t.propertyIndex;if(e||(e=pu.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(r){let n=t.objectIndex;switch(r){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===n){n=t;break}break;default:if(void 0===e[r])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[r]}if(void 0!==n){if(void 0===e[n])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[n]}}const o=e[n];if(void 0===o){const r=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+r+"."+n+" but it wasn't found.",e)}let s=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?s=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(s=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===n){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.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])}a=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=i}else void 0!==o.fromArray&&void 0!==o.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(a=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=n;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}pu.Composite=class{constructor(e,t,r){const n=r||pu.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,n=this._bindings[r];void 0!==n&&n.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=r.length;n!==i;++n)r[n].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}},pu.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},pu.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},pu.prototype.GetterByBindingType=[pu.prototype._getValue_direct,pu.prototype._getValue_array,pu.prototype._getValue_arrayElement,pu.prototype._getValue_toArray],pu.prototype.SetterByBindingTypeAndVersioning=[[pu.prototype._setValue_direct,pu.prototype._setValue_direct_setNeedsUpdate,pu.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[pu.prototype._setValue_array,pu.prototype._setValue_array_setNeedsUpdate,pu.prototype._setValue_array_setMatrixWorldNeedsUpdate],[pu.prototype._setValue_arrayElement,pu.prototype._setValue_arrayElement_setNeedsUpdate,pu.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[pu.prototype._setValue_fromArray,pu.prototype._setValue_fromArray_setNeedsUpdate,pu.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class fu{constructor(e,t,r=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=n;const i=t.tracks,o=i.length,s=new Array(o),a={endingStart:jt,endingEnd:jt};for(let e=0;e!==o;++e){const t=i[e].createInterpolant(null);s[e]=t,t.settings=a}this._interpolantSettings=a,this._interpolants=s,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}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){const r=this._clip.duration,n=e._clip.duration,i=n/r,o=r/n;e.warp(1,i,t),this.warp(o,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,r){const n=this._mixer,i=n.time,o=this.timeScale;let s=this._timeScaleInterpolant;null===s&&(s=n._lendControlInterpolant(),this._timeScaleInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=i,a[1]=i+r,l[0]=e/o,l[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,r,n){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const n=(e-i)*r;if(n<0||0===r)return;this._startTime=null,t=r*n}t*=this._updateTimeScale(e);const o=this._updateTime(t),s=this._updateWeight(e);if(s>0){const e=this._interpolants,t=this._propertyBindings;if(2501===this.blendMode)for(let r=0,n=e.length;r!==n;++r)e[r].evaluate(o),t[r].accumulateAdditive(s);else for(let r=0,i=e.length;r!==i;++r)e[r].evaluate(o),t[r].accumulate(n,s)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(null!==r){const n=r.evaluate(e)[0];t*=n,e>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;null!==r&&(t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let n=this.time+e,i=this._loopCount;const o=2202===r;if(0===e)return-1===i||!o||1&~i?n:t-n;if(2200===r){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),n>=t||n<0){const r=Math.floor(n/t);n-=t*r,i+=Math.abs(r);const s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){const t=e<0;this._setEndings(t,!t,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:r})}}else this.time=n;if(o&&!(1&~i))return t-n}return n}_setEndings(e,t,r){const n=this._interpolantSettings;r?(n.endingStart=At,n.endingEnd=At):(n.endingStart=e?this.zeroSlopeAtStart?At:jt:Lt,n.endingEnd=t?this.zeroSlopeAtEnd?At:jt:Lt)}_scheduleFading(e,t,r){const n=this._mixer,i=n.time;let o=this._weightInterpolant;null===o&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);const s=o.parameterPositions,a=o.sampleValues;return s[0]=i,a[0]=t,s[1]=i+e,a[1]=r,this}}(class extends Wt{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,n=e._clip.tracks,i=n.length,o=e._propertyBindings,s=e._interpolants,a=r.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let e=0;e!==i;++e){const i=n[e],l=i.name;let u=c[l];if(void 0!==u)o[e]=u;else{if(u=o[e],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,a,l));continue}const n=t&&t._propertyBindings[e].binding.parsedPath;u=new ru(pu.create(r,l,n),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,a,l),o[e]=u}s[e].resultBuffer=u.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,r=e._clip.uuid,n=this._actionsByClip[r];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,r,t)}const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,r){const n=this._actions,i=this._actionsByClip;let o=i[t];if(void 0===o)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=o;else{const t=o.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=n.length,n.push(e),o.actionByRoot[r]=e}_removeInactiveAction(e){const t=this._actions,r=t[t.length-1],n=e._cacheIndex;r._cacheIndex=n,t[n]=r,t.pop(),e._cacheIndex=null;const i=e._clip.uuid,o=this._actionsByClip,s=o[i],a=s.knownActions,l=a[a.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,a[c]=l,a.pop(),e._byClipCacheIndex=null,delete s.actionByRoot[(e._localRoot||this._root).uuid],0===a.length&&delete o[i],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==--r.referenceCount&&this._removeInactiveBinding(r)}}_lendAction(e){const t=this._actions,r=e._cacheIndex,n=this._nActiveActions++,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i}_takeBackAction(e){const t=this._actions,r=e._cacheIndex,n=--this._nActiveActions,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i}_addInactiveBinding(e,t,r){const n=this._bindingsByRootAndName,i=this._bindings;let o=n[t];void 0===o&&(o={},n[t]=o),o[r]=e,e._cacheIndex=i.length,i.push(e)}_removeInactiveBinding(e){const t=this._bindings,r=e.binding,n=r.rootNode.uuid,i=r.path,o=this._bindingsByRootAndName,s=o[n],a=t[t.length-1],l=e._cacheIndex;a._cacheIndex=l,t[l]=a,t.pop(),delete s[i],0===Object.keys(s).length&&delete o[n]}_lendBinding(e){const t=this._bindings,r=e._cacheIndex,n=this._nActiveBindings++,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i}_takeBackBinding(e){const t=this._bindings,r=e._cacheIndex,n=--this._nActiveBindings,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let r=e[t];return void 0===r&&(r=new yc(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),r.__cacheIndex=t,e[t]=r),r}_takeBackControlInterpolant(e){const t=this._controlInterpolants,r=e.__cacheIndex,n=--this._nActiveControlInterpolants,i=t[n];e.__cacheIndex=n,t[n]=e,i.__cacheIndex=r,t[r]=i}clipAction(e,t,r){const n=t||this._root,i=n.uuid;let o="string"==typeof e?Ec.findByName(n,e):e;const s=null!==o?o.uuid:e,a=this._actionsByClip[s];let l=null;if(void 0===r&&(r=null!==o?o.blendMode:2500),void 0!==a){const e=a.actionByRoot[i];if(void 0!==e&&e.blendMode===r)return e;l=a.knownActions[0],null===o&&(o=l._clip)}if(null===o)return null;const c=new fu(this,o,t,r);return this._bindAction(c,l),this._addInactiveAction(c,s,i),c}existingAction(e,t){const r=t||this._root,n=r.uuid,i="string"==typeof e?Ec.findByName(r,e):e,o=i?i.uuid:e,s=this._actionsByClip[o];return void 0!==s&&s.actionByRoot[n]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,n=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1;for(let s=0;s!==r;++s)t[s]._update(n,e,i,o);const s=this._bindings,a=this._nActiveBindings;for(let e=0;e!==a;++e)s[e].apply(o);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,r=e.uuid,n=this._actionsByClip,i=n[r];if(void 0!==i){const e=i.knownActions;for(let r=0,n=e.length;r!==n;++r){const n=e[r];this._deactivateAction(n);const i=n._cacheIndex,o=t[t.length-1];n._cacheIndex=null,n._byClipCacheIndex=null,o._cacheIndex=i,t[i]=o,t.pop(),this._removeInactiveBindingsForAction(n)}delete n[r]}}uncacheRoot(e){const t=e.uuid,r=this._actionsByClip;for(const e in r){const n=r[e].actionByRoot[t];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}const n=this._bindingsByRootAndName[t];if(void 0!==n)for(const e in n){const t=n[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){const r=this.existingAction(e,t);null!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}}).prototype._controlInterpolantsResultBuffer=new Float32Array(1);class mu{constructor(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new mu(void 0===this.value.clone?this.value:this.value.clone())}}(class extends Ma{constructor(e,t,r=1){super(e,t),this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}).prototype.isInstancedInterleavedBuffer=!0;const yu=new er;class gu{constructor(e=new er(1/0,1/0),t=new er(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=yu.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return yu.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}gu.prototype.isBox2=!0,class extends fn{constructor(e){super(),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}}.prototype.isImmediateRenderObject=!0;const vu=new hr,bu=new Gr,_u=new Gr;function xu(e){const t=[];e&&e.isBone&&t.push(e);for(let r=0;r<e.children.length;r++)t.push.apply(t,xu(e.children[r]));return t}const wu=new Float32Array(1);new Int32Array(wu.buffer),yl.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(yl.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Nc.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},class extends ll{constructor(e=10,t=10,r=4473924,n=8947848){r=new kn(r),n=new kn(n);const i=t/2,o=e/t,s=e/2,a=[],l=[];for(let e=0,c=0,u=-s;e<=t;e++,u+=o){a.push(-s,0,u,s,0,u),a.push(u,0,-s,u,0,s);const t=e===i?r:n;t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3}const c=new Jn;c.setAttribute("position",new zn(a,3)),c.setAttribute("color",new zn(l,3)),super(c,new $a({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends ll{constructor(e){const t=xu(e),r=new Jn,n=[],i=[],o=new kn(0,0,1),s=new kn(0,1,0);for(let e=0;e<t.length;e++){const r=t[e];r.parent&&r.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),i.push(o.r,o.g,o.b),i.push(s.r,s.g,s.b))}r.setAttribute("position",new zn(n,3)),r.setAttribute("color",new zn(i,3)),super(r,new $a({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,r=this.geometry,n=r.getAttribute("position");_u.copy(this.root.matrixWorld).invert();for(let e=0,r=0;e<t.length;e++){const i=t[e];i.parent&&i.parent.isBone&&(bu.multiplyMatrices(_u,i.matrixWorld),vu.setFromMatrixPosition(bu),n.setXYZ(r,vu.x,vu.y,vu.z),bu.multiplyMatrices(_u,i.parent.matrixWorld),vu.setFromMatrixPosition(bu),n.setXYZ(r+1,vu.x,vu.y,vu.z),r+=2)}r.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Cc.prototype.extractUrlBase=function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),$c.extractUrlBase(e)},Cc.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.")}},gu.prototype.center=function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},gu.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},gu.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},gu.prototype.size=function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)},fr.prototype.center=function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},fr.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},fr.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},fr.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},fr.prototype.size=function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)},Or.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Oi.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},tr.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},tr.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},tr.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},tr.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},tr.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},tr.prototype.getInverse=function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},Gr.prototype.extractPosition=function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},Gr.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},Gr.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new hr).setFromMatrixColumn(this,3)},Gr.prototype.setRotationFromQuaternion=function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},Gr.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},Gr.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Gr.prototype.multiplyVector4=function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Gr.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},Gr.prototype.rotateAxis=function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},Gr.prototype.crossVector=function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Gr.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},Gr.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},Gr.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},Gr.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},Gr.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},Gr.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Gr.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},Gr.prototype.makeFrustum=function(e,t,r,n,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,n,r,i,o)},Gr.prototype.getInverse=function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},Ci.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},ur.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},ur.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},zr.prototype.isIntersectionBox=function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},zr.prototype.isIntersectionPlane=function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},zr.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},Tn.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},Tn.prototype.barycoordFromPoint=function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},Tn.prototype.midpoint=function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},Tn.prototypenormal=function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},Tn.prototype.plane=function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)},Tn.barycoordFromPoint=function(e,t,r,n,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Tn.getBarycoord(e,t,r,n,i)},Tn.normal=function(e,t,r,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Tn.getNormal(e,t,r,n)},Fc.prototype.extractAllPoints=function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},Fc.prototype.extrude=function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new lc(this,e)},Fc.prototype.makeGeometry=function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new uc(this,e)},er.prototype.fromAttribute=function(e,t,r){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,r)},er.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},er.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},hr.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},hr.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},hr.prototype.getPositionFromMatrix=function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},hr.prototype.getScaleFromMatrix=function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},hr.prototype.getColumnFromMatrix=function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},hr.prototype.applyProjection=function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},hr.prototype.fromAttribute=function(e,t,r){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,r)},hr.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},hr.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},ar.prototype.fromAttribute=function(e,t,r){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,r)},ar.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},fn.prototype.getChildByName=function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},fn.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},fn.prototype.translate=function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},fn.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},fn.prototype.applyMatrix=function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(fn.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.")}}}),fi.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(fi.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.")}}}),Xa.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},wi.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(Uc.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(Fn.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===Vt},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Vt)}}}),Fn.prototype.setDynamic=function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Vt:Gt),this},Fn.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Fn.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Jn.prototype.addIndex=function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},Jn.prototype.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 Fn(arguments[1],arguments[2])))},Jn.prototype.addDrawCall=function(e,t,r){void 0!==r&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},Jn.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},Jn.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},Jn.prototype.removeAttribute=function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},Jn.prototype.applyMatrix=function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(Jn.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}}}),Ma.prototype.setDynamic=function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Vt:Gt),this},Ma.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},lc.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},lc.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},lc.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},Sa.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},mu.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(jn.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},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 kn}},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}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}}),Object.defineProperties(_i.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}}}),_a.prototype.clearTarget=function(e,t,r,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,r,n)},_a.prototype.animate=function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},_a.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},_a.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},_a.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},_a.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},_a.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},_a.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},_a.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},_a.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},_a.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},_a.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},_a.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},_a.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},_a.prototype.enableScissorTest=function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},_a.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},_a.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},_a.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},_a.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},_a.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},_a.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},_a.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},_a.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},_a.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},_a.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(_a.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?Pt:Ct}},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(ua.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(lr.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 is 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}}}),class extends fn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return(new tu).load(e,(function(e){t.setBuffer(e)})),this},Mi.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},Mi.prototype.clear=function(e,t,r,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,r,n)},nr.crossOrigin=void 0,nr.loadTexture=function(e,t,r,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const i=new Ic;i.setCrossOrigin(this.crossOrigin);const o=i.load(e,r,void 0,n);return t&&(o.mapping=t),o},nr.loadTextureCube=function(e,t,r,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const i=new kc;i.setCrossOrigin(this.crossOrigin);const o=i.load(e,r,void 0,n);return t&&(o.mapping=t),o},nr.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},nr.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"132"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="132")}}]);