0x77b35947…cc7dsent to0x2758442e…81ae·#25,448,126·view on Etherscan
erty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function n(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(r){return function(){var e,t=l(r);return f(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){}}}()?(e=l(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function f(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?p(e):t}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}c.default.Graphics=function(e){var t=u;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&&s(t,e);var r,l=h(u);function u(e,t,r,o,n){var s;if(!(this instanceof u))throw new TypeError("Cannot call a class as a function");a=n||document.createElement("canvas"),(s=l.call(this,a,o)).canvas=a;var i,a=r||d.P2D,r=o._userNode||document.body;for(i in n||r.appendChild(s.canvas),c.default.prototype)s[i]||("function"==typeof c.default.prototype[i]?s[i]=c.default.prototype[i].bind(p(s)):s[i]=c.default.prototype[i]);return c.default.prototype._initializeInstanceVariables.apply(p(s)),s.width=e,s.height=t,s._pixelDensity=o._pixelDensity,a===d.WEBGL?(s._renderer=new c.default.RendererGL(s.canvas,p(s),!1),e=(n=s._renderer._adjustDimensions(e,t)).adjustedWidth,t=n.adjustedHeight):s._renderer=new c.default.Renderer2D(s.canvas,p(s),!1),o._elements.push(p(s)),Object.defineProperty(p(s),"deltaTime",{get:function(){return this._pInst.deltaTime}}),s._renderer.resize(e,t),s._renderer._applyDefaults(),f(s,p(s))}return t=u,(e=[{key:"reset",value:function(){this._renderer.resetMatrix(),this._renderer.isP3D&&this._renderer._update()}},{key:"remove",value:function(){this._renderer&&"function"==typeof this._renderer.remove&&this._renderer.remove(),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 c.default.Framebuffer(this,e)}}])&&n(t.prototype,e),r&&n(t,r),u}(c.default.Element);var u=c.default.Graphics;r.default=u},{"./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 o(e){return(o="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 a=(s=e("./main"))&&s.__esModule?s:{default:s},P=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==l(e)&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function l(e){return(l="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}function u(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(o){return function(){var e,t,r=n(o);return e=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){}}}()?(e=n(this).constructor,Reflect.construct(r,arguments,e)):r.apply(this,arguments),r=this,!(t=e)||"object"!==l(t)&&"function"!=typeof t?h(r):t}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var s=function(e){var t=s;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,n=d(s);function s(e,t,r){var o;if(this instanceof s)return(o=n.call(this,e,t)).canvas=e,o._pixelsState=t,r?(o._isMainCanvas=!0,o._pInst._setProperty("_curElement",h(o)),o._pInst._setProperty("canvas",o.canvas),o._pInst._setProperty("width",o.width),o._pInst._setProperty("height",o.height)):(o.canvas.style.display="none",o._styles=[]),o._clipping=!1,o._clipInvert=!1,o._textSize=12,o._textLeading=15,o._textFont="sans-serif",o._textStyle=P.NORMAL,o._textAscent=null,o._textDescent=null,o._textAlign=P.LEFT,o._textBaseline=P.BASELINE,o._textWrap=P.WORD,o._rectMode=P.CORNER,o._ellipseMode=P.CENTER,o._curveTightness=0,o._imageMode=P.CORNER,o._tint=null,o._doStroke=!0,o._doFill=!0,o._strokeSet=!1,o._fillSet=!1,o._leadingSet=!1,o._pushPopDepth=0,o;throw new TypeError("Cannot call a class as a function")}return t=s,(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,o){var n=this._pixelsState,s=n._pixelDensity,i=this.canvas;if(void 0===e&&void 0===t)e=t=0,r=n.width,o=n.height;else if(e*=s,t*=s,void 0===r&&void 0===o)return e<0||t<0||e>=i.width||t>=i.height?[0,0,0,0]:this._getPixel(e,t);n=new a.default.Image(r*s,o*s);return n.pixelDensity(s),n.canvas.getContext("2d").drawImage(i,e,t,r*s,o*s,0,0,r*s,o*s),n}},{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!==P.NORMAL&&e!==P.ITALIC&&e!==P.BOLD&&e!==P.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,o,n){var s,i,a,l,u=this._pInst,c=this._textWrap,d=Number.MAX_VALUE,h=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!==o){switch(this._rectMode===P.CENTER&&(t-=o/2),this._textAlign){case P.CENTER:t+=o/2;break;case P.RIGHT:t+=o}if(void 0!==n){this._rectMode===P.CENTER&&(r-=n/2,h-=n/2);var e=r,f=u.textAscent();switch(this._textBaseline){case P.BOTTOM:l=r+n,r=Math.max(l,r),h+=f;break;case P.CENTER:l=r+n/2,r=Math.max(l,r),h+=f/2}d=r+n-f,this._textBaseline===P.CENTER&&(d=e+n-f/2)}else this._textBaseline!==P.BOTTOM&&this._textBaseline!==P.CENTER||(h=r-(e=u.textSize()*this._textLeading)/2,d=r+e/2);if(c===P.WORD){for(var p=[],m=0;m<s.length;m++){for(var y="",g=s[m].split(" "),v=0;v<g.length;v++)i="".concat(y+g[v])+" ",y=o<(a=this.textWidth(i))&&0<y.length?(p.push(y),"".concat(g[v])+" "):i;p.push(y)}var b=0;this._textBaseline===P.CENTER?b=(p.length-1)*u.textLeading()/2:this._textBaseline===P.BOTTOM&&(b=(p.length-1)*u.textLeading());for(var _=0;_<s.length;_++){y="",g=s[_].split(" ");for(var j=0;j<g.length;j++)i="".concat(y+g[j])+" ",o<(a=this.textWidth(i))&&0<y.length?(this._renderText(u,y.trim(),t,r-b,d,h),y="".concat(g[j])+" ",r+=u.textLeading()):y=i;this._renderText(u,y.trim(),t,r-b,d,h),r+=u.textLeading()}}else{for(var x=[],w=0;w<s.length;w++)for(var S=s[w].split(y=""),T=0;T<S.length;T++)i="".concat(y+S[T]),(a=this.textWidth(i))<=o?y+=S[T]:o<a&&0<y.length&&(x.push(y),y="".concat(S[T]));x.push(y);var E=0;this._textBaseline===P.CENTER?E=(x.length-1)*u.textLeading()/2:this._textBaseline===P.BOTTOM&&(E=(x.length-1)*u.textLeading());for(var M=0;M<s.length;M++){S=s[M].split(y="");for(var k=0;k<S.length;k++)i="".concat(y+S[k]),(a=this.textWidth(i))<=o?y+=S[k]:o<a&&0<y.length&&(this._renderText(u,y.trim(),t,r-E,d,h),r+=u.textLeading(),y="".concat(S[k]))}this._renderText(u,y.trim(),t,r-E,d,h),r+=u.textLeading()}}else{var O=0;this._textBaseline===P.CENTER?O=(s.length-1)*u.textLeading()/2:this._textBaseline===P.BOTTOM&&(O=(s.length-1)*u.textLeading());for(var C=0;C<s.length;C++)this._renderText(u,s[C],t,r-O,d,h-O),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"===l(e)&&e.font&&e.font.supported}},{key:"_updateTextMetrics",value:function(){var e,t,r,o,n,s;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|",(s=document.createElement("div")).style.display="inline-block",s.style.width="1px",s.style.height="0px",o=((t=document.createElement("div")).appendChild(e),t.appendChild(s),t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t),s.style.verticalAlign="baseline",f(s)),n=f(e),r=o[1]-n[1],o=(s.style.verticalAlign="bottom",f(s)),n=f(e),s=o[1]-n[1]-r,document.body.removeChild(t),this._setProperty("_textAscent",r),this._setProperty("_textDescent",s)),this}}])&&u(t.prototype,e),r&&u(t,r),s}(a.default.Element);function f(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]}s.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._leadingSet||this._setProperty("_textLeading",e*P._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},a.default.Renderer=s;e=a.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 o(e){return(o="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"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(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 d=(n=e("./main"))&&n.__esModule?n:{default:n},p=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,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function s(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t,r){return(l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var e=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}(e,t);if(e)return(e=Object.getOwnPropertyDescriptor(e,t)).get?e.get.call(r):e.value})(e,t,r||e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(r){return function(){var e,t=h(r),t=(e=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){}}}()?(e=h(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(!e||"object"!==i(e)&&"function"!=typeof e){if(void 0!==t)return t;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)}e("./p5.Renderer");var f="rgba(0,0,0,0)",n=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&&u(t,e);var r,o=c(n);function n(e,t,r){if(this instanceof n)return(e=o.call(this,e,t,r)).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 d.default.Graphics?this._pInst:this)._pInst,this.filterGraphicsLayer=new d.default.Graphics(this.width,this.height,p.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=p.BLEND,this._setFill(p._DEFAULT_FILL),this._setStroke(p._DEFAULT_STROKE),this.drawingContext.lineCap=p.ROUND,this.drawingContext.font="normal 12px sans-serif"}},{key:"resize",value:function(e,t){l(h(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 d.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(p.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]:{},e=(l(h(n.prototype),"beginClip",this).call(this,e),this._cachedFillStyle=this.drawingContext.fillStyle,this._pInst.color(255,0).toString()),e=(this.drawingContext.fillStyle=e,this._cachedStrokeStyle=this.drawingContext.strokeStyle,this._pInst.color(255,0).toString()),e=(this.drawingContext.strokeStyle=e,this._cachedBlendMode);this.blendMode(p.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(h(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,o,n,s,i,a,l){e.gifProperties&&e._animateGif(this._pInst);try{d.default.MediaElement&&e instanceof d.default.MediaElement&&e._ensureCanvas();var u=(u=this._tint&&e.canvas?this._getTintedImageCanvas(e):u)||e.canvas||e.elt,c=1;e.width&&0<e.width&&(c=u.width/e.width),this._isErasing&&this.blendMode(this._cachedBlendMode),this.drawingContext.drawImage(u,c*t,c*r,c*o,c*n,s,i,a,l),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===p.SUBTRACT)console.warn("blendMode(SUBTRACT) only works in WEBGL mode.");else{if(e!==p.BLEND&&e!==p.REMOVE&&e!==p.DARKEST&&e!==p.LIGHTEST&&e!==p.DIFFERENCE&&e!==p.MULTIPLY&&e!==p.EXCLUSION&&e!==p.SCREEN&&e!==p.REPLACE&&e!==p.OVERLAY&&e!==p.HARD_LIGHT&&e!==p.SOFT_LIGHT&&e!==p.DODGE&&e!==p.BURN&&e!==p.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),o=0;o<t;o++)r[o]=arguments[o];var n=r[r.length-1],s=Array.prototype.slice.call(r,0,r.length-1);this.drawingContext.globalCompositeOperation=n,d.default.prototype.copy.apply(this,s),this.drawingContext.globalCompositeOperation=e}},{key:"_getPixel",value:function(e,t){e=this.drawingContext.getImageData(e,t,1,1).data;return[e[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 o=this._pixelsState;if(r instanceof d.default.Image)this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(o._pixelDensity,o._pixelDensity),this.drawingContext.clearRect(e,t,r.width,r.height),this.drawingContext.drawImage(r.canvas,e,t),this.drawingContext.restore();else{var n=0,s=0,i=0,a=0,l=4*(t*o._pixelDensity*(this.width*o._pixelDensity)+e*o._pixelDensity);if(o.imageData||o.loadPixels(),"number"==typeof r)l<o.pixels.length&&(i=s=n=r,a=255);else if(Array.isArray(r)){if(r.length<4)throw new Error("pixel array must be of the form [R, G, B, A]");l<o.pixels.length&&(n=r[0],s=r[1],i=r[2],a=r[3])}else r instanceof d.default.Color&&l<o.pixels.length&&(n=r.levels[0],s=r.levels[1],i=r.levels[2],a=r.levels[3]);for(var u=0;u<o._pixelDensity;u++)for(var c=0;c<o._pixelDensity;c++)l=4*((t*o._pixelDensity+c)*this.width*o._pixelDensity+(e*o._pixelDensity+u)),o.pixels[l]=n,o.pixels[l+1]=s,o.pixels[l+2]=i,o.pixels[l+3]=a}}},{key:"updatePixels",value:function(e,t,r,o){var n=this._pixelsState,s=n._pixelDensity;void 0===e&&void 0===t&&void 0===r&&void 0===o&&(t=e=0,r=this.width,o=this.height),e*=s,t*=s,r*=s,o*=s,this.gifProperties&&(this.gifProperties.frames[this.gifProperties.displayIndex].image=n.imageData),this.drawingContext.putImageData(n.imageData,0,0,e,t,r,o)}},{key:"arc",value:function(e,t,r,o,n,s,i){var a=this.drawingContext,e=e+r/2,t=t+o/2,r=r/2,o=o/2,l=!(i===p.CHORD||i===p.OPEN||(s-n)%p.TWO_PI==0);return this._doFill&&(this._clipping||a.beginPath(),a.ellipse(e,t,r,o,0,n,s),l&&a.lineTo(e,t),a.closePath(),this._clipping||a.fill()),this._doStroke&&(this._clipping||a.beginPath(),a.ellipse(e,t,r,o,0,n,s),i===p.PIE&&l&&a.lineTo(e,t),i!==p.PIE&&i!==p.CHORD||a.closePath(),this._clipping||a.stroke()),this}},{key:"ellipse",value:function(e){var t=this.drawingContext,r=this._doFill,o=this._doStroke,n=parseFloat(e[0]),s=parseFloat(e[1]),i=parseFloat(e[2]),e=parseFloat(e[3]);if(r&&!o){if(this._getFill()===f)return this}else if(!r&&o&&this._getStroke()===f)return this;n+=i/2,s+=e/2,i/=2,e/=2;this._clipping||t.beginPath(),t.ellipse(n,s,i,e,0,0,2*Math.PI),t.closePath(),!this._clipping&&r&&t.fill(),!this._clipping&&o&&t.stroke()}},{key:"line",value:function(e,t,r,o){var n=this.drawingContext;return this._doStroke&&this._getStroke()!==f&&(this._clipping||n.beginPath(),n.moveTo(e,t),n.lineTo(r,o),n.stroke()),this}},{key:"point",value:function(e,t){var r,o,n=this.drawingContext;return!this._doStroke||this._getStroke()===f?this:(r=this._getStroke(),o=this._getFill(),this._clipping||this._setFill(r),this._clipping||n.beginPath(),n.arc(e,t,n.lineWidth/2,0,p.TWO_PI,!1),void(this._clipping||(n.fill(),this._setFill(o))))}},{key:"quad",value:function(e,t,r,o,n,s,i,a){var l=this.drawingContext,u=this._doFill,c=this._doStroke;if(u&&!c){if(this._getFill()===f)return this}else if(!u&&c&&this._getStroke()===f)return this;return this._clipping||l.beginPath(),l.moveTo(e,t),l.lineTo(r,o),l.lineTo(n,s),l.lineTo(i,a),l.closePath(),!this._clipping&&u&&l.fill(),!this._clipping&&c&&l.stroke(),this}},{key:"rect",value:function(e){var t,r,o=e[0],n=e[1],s=e[2],i=e[3],a=e[4],l=e[5],u=e[6],e=e[7],c=this.drawingContext,d=this._doFill,h=this._doStroke;if(d&&!h){if(this._getFill()===f)return this}else if(!d&&h&&this._getStroke()===f)return this;return this._clipping||c.beginPath(),void 0===a?c.rect(o,n,s,i):(void 0===l&&(l=a),void 0===u&&(u=l),void 0===e&&(e=u),h=(d=Math.abs(s))/2,r=(t=Math.abs(i))/2,c.roundRect(o,n,s,i,[a=t<2*(a=d<2*a?h:a)?r:a,l=t<2*(l=d<2*l?h:l)?r:l,u=t<2*(u=d<2*u?h:u)?r:u,e=t<2*(e=d<2*e?h:e)?r:e])),!this._clipping&&this._doFill&&c.fill(),!this._clipping&&this._doStroke&&c.stroke(),this}},{key:"triangle",value:function(e){var t=this.drawingContext,r=this._doFill,o=this._doStroke,n=e[0],s=e[1],i=e[2],a=e[3],l=e[4],e=e[5];if(r&&!o){if(this._getFill()===f)return this}else if(!r&&o&&this._getStroke()===f)return this;this._clipping||t.beginPath(),t.moveTo(n,s),t.lineTo(i,a),t.lineTo(l,e),t.closePath(),!this._clipping&&r&&t.fill(),!this._clipping&&o&&t.stroke()}},{key:"endShape",value:function(e,t,r,o,n,s,i){if(0!==t.length&&(this._doStroke||this._doFill)){var a,l,u,c=e===p.CLOSE,d=(c&&!s&&t.push(t[0]),t.length);if(r&&null===i){if(3<d){var h=[],f=1-this._curveTightness;for(this._clipping||this.drawingContext.beginPath(),this.drawingContext.moveTo(t[1][0],t[1][1]),l=1;l+2<d;l++)a=t[l],h[0]=[a[0],a[1]],h[1]=[a[0]+(f*t[l+1][0]-f*t[l-1][0])/6,a[1]+(f*t[l+1][1]-f*t[l-1][1])/6],h[2]=[t[l+1][0]+(f*t[l][0]-f*t[l+2][0])/6,t[l+1][1]+(f*t[l][1]-f*t[l+2][1])/6],h[3]=[t[l+1][0],t[l+1][1]],this.drawingContext.bezierCurveTo(h[1][0],h[1][1],h[2][0],h[2][1],h[3][0],h[3][1]);c&&this.drawingContext.lineTo(t[l+1][0],t[l+1][1]),this._doFillStrokeClose(c)}}else if(o&&null===i){for(this._clipping||this.drawingContext.beginPath(),l=0;l<d;l++)t[l].isVert?t[l].moveTo?this.drawingContext.moveTo(t[l][0],t[l][1]):this.drawingContext.lineTo(t[l][0],t[l][1]):this.drawingContext.bezierCurveTo(t[l][0],t[l][1],t[l][2],t[l][3],t[l][4],t[l][5]);this._doFillStrokeClose(c)}else if(n&&null===i){for(this._clipping||this.drawingContext.beginPath(),l=0;l<d;l++)t[l].isVert?t[l].moveTo?this.drawingContext.moveTo(t[l][0],t[l][1]):this.drawingContext.lineTo(t[l][0],t[l][1]):this.drawingContext.quadraticCurveTo(t[l][0],t[l][1],t[l][2],t[l][3]);this._doFillStrokeClose(c)}else if(i===p.POINTS)for(l=0;l<d;l++)a=t[l],this._doStroke&&this._pInst.stroke(a[6]),this._pInst.point(a[0],a[1]);else if(i===p.LINES)for(l=0;l+1<d;l+=2)a=t[l],this._doStroke&&this._pInst.stroke(t[l+1][6]),this._pInst.line(a[0],a[1],t[l+1][0],t[l+1][1]);else if(i===p.TRIANGLES)for(l=0;l+2<d;l+=3)a=t[l],this._clipping||this.drawingContext.beginPath(),this.drawingContext.moveTo(a[0],a[1]),this.drawingContext.lineTo(t[l+1][0],t[l+1][1]),this.drawingContext.lineTo(t[l+2][0],t[l+2][1]),this.drawingContext.closePath(),!this._clipping&&this._doFill&&(this._pInst.fill(t[l+2][5]),this.drawingContext.fill()),!this._clipping&&this._doStroke&&(this._pInst.stroke(t[l+2][6]),this.drawingContext.stroke());else if(i===p.TRIANGLE_STRIP)for(l=0;l+1<d;l++)a=t[l],this._clipping||this.drawingContext.beginPath(),this.drawingContext.moveTo(t[l+1][0],t[l+1][1]),this.drawingContext.lineTo(a[0],a[1]),!this._clipping&&this._doStroke&&this._pInst.stroke(t[l+1][6]),!this._clipping&&this._doFill&&this._pInst.fill(t[l+1][5]),l+2<d&&(this.drawingContext.lineTo(t[l+2][0],t[l+2][1]),!this._clipping&&this._doStroke&&this._pInst.stroke(t[l+2][6]),!this._clipping&&this._doFill&&this._pInst.fill(t[l+2][5])),this._doFillStrokeClose(c);else if(i===p.TRIANGLE_FAN){if(2<d){for(this._clipping||this.drawingContext.beginPath(),l=2;l<d;l++)a=t[l],this.drawingContext.moveTo(t[0][0],t[0][1]),this.drawingContext.lineTo(t[l-1][0],t[l-1][1]),this.drawingContext.lineTo(a[0],a[1]),this.drawingContext.lineTo(t[0][0],t[0][1]),l<d-1&&(this._doFill&&a[5]!==t[l+1][5]||this._doStroke&&a[6]!==t[l+1][6])&&(!this._clipping&&this._doFill&&(this._pInst.fill(a[5]),this.drawingContext.fill(),this._pInst.fill(t[l+1][5])),!this._clipping&&this._doStroke&&(this._pInst.stroke(a[6]),this.drawingContext.stroke(),this._pInst.stroke(t[l+1][6])),this.drawingContext.closePath(),this._clipping||this.drawingContext.beginPath());this._doFillStrokeClose(c)}}else if(i===p.QUADS)for(l=0;l+3<d;l+=4){for(a=t[l],this._clipping||this.drawingContext.beginPath(),this.drawingContext.moveTo(a[0],a[1]),u=1;u<4;u++)this.drawingContext.lineTo(t[l+u][0],t[l+u][1]);this.drawingContext.lineTo(a[0],a[1]),!this._clipping&&this._doFill&&this._pInst.fill(t[l+3][5]),!this._clipping&&this._doStroke&&this._pInst.stroke(t[l+3][6]),this._doFillStrokeClose(c)}else if(i===p.QUAD_STRIP){if(3<d)for(l=0;l+1<d;l+=2)a=t[l],this._clipping||this.drawingContext.beginPath(),l+3<d?(this.drawingContext.moveTo(t[l+2][0],t[l+2][1]),this.drawingContext.lineTo(a[0],a[1]),this.drawingContext.lineTo(t[l+1][0],t[l+1][1]),this.drawingContext.lineTo(t[l+3][0],t[l+3][1]),!this._clipping&&this._doFill&&this._pInst.fill(t[l+3][5]),!this._clipping&&this._doStroke&&this._pInst.stroke(t[l+3][6])):(this.drawingContext.moveTo(a[0],a[1]),this.drawingContext.lineTo(t[l+1][0],t[l+1][1])),this._doFillStrokeClose(c)}else{for(this._clipping||this.drawingContext.beginPath(),this.drawingContext.moveTo(t[0][0],t[0][1]),l=1;l<d;l++)(a=t[l]).isVert&&(a.moveTo?(c&&this.drawingContext.closePath(),this.drawingContext.moveTo(a[0],a[1])):this.drawingContext.lineTo(a[0],a[1]));this._doFillStrokeClose(c),this.drawingContext.closePath()}s=n=o=r=!1,c&&t.pop()}return this}},{key:"strokeCap",value:function(e){return e!==p.ROUND&&e!==p.SQUARE&&e!==p.PROJECT||(this.drawingContext.lineCap=e),this}},{key:"strokeJoin",value:function(e){return e!==p.ROUND&&e!==p.BEVEL&&e!==p.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,o,n,s,i,a){return this._pInst.beginShape(),this._pInst.vertex(e,t),this._pInst.bezierVertex(r,o,n,s,i,a),this._pInst.endShape(),this}},{key:"curve",value:function(e,t,r,o,n,s,i,a){return this._pInst.beginShape(),this._pInst.curveVertex(e,t),this._pInst.curveVertex(r,o),this._pInst.curveVertex(n,s),this._pInst.curveVertex(i,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,o,n,s){this.drawingContext.transform(e,t,r,o,n,s)}},{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 d.default.Vector&&(t=e.y,e=e.x),this.drawingContext.translate(e,t),this}},{key:"_renderText",value:function(e,t,r,o,n,s){if(!(o<s||n<=o))return e.push(),this._isOpenType()?this._textFont._renderPath(t,r,o,{renderer:this}):(this._doStroke&&this._strokeSet&&this.drawingContext.strokeText(t,r,o),!this._clipping&&this._doFill&&(this._fillSet||this._setFill(p._DEFAULT_TEXT_FILL),this.drawingContext.fillText(t,r,o))),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===p.CENTER?this.drawingContext.textBaseline=p._CTX_MIDDLE:this.drawingContext.textBaseline=this._textBaseline,e}},{key:"push",value:function(){return this.drawingContext.save(),l(h(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(h(n.prototype),"pop",this).call(this,e)}}])&&s(t.prototype,e),r&&s(t,r),n}(d.default.Renderer),e=(n.prototype.text=function(e,t,r,o,n){void 0!==o&&this.drawingContext.textBaseline===p.BASELINE&&(s=!0,this.drawingContext.textBaseline=p.TOP);var s,o=d.default.Renderer.prototype.text.apply(this,arguments);return s&&(this.drawingContext.textBaseline=p.BASELINE),o},d.default.Renderer2D=n,d.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 h=(e=e("./main"))&&e.__esModule?e:{default:e};h.default.prototype._promisePreloads=[];function o(){return{}}var f=!(h.default.prototype.registerPromisePreload=function(e){h.default.prototype._promisePreloads.push(e)});h.default.prototype._setupPromisePreloads=function(){var e=!0,t=!1,r=void 0;try{for(var o,n=this._promisePreloads[Symbol.iterator]();!(e=(o=n.next()).done);e=!0){var s=o.value,i=this,a=s.method,l=s.addCallbacks,u=s.legacyPreloadSetup,c=s.target||this,d=c[a].bind(c);if(c===h.default.prototype){if(f)continue;i=null,d=c[a]}c[a]=this._wrapPromisePreload(i,d,l),u&&(c[u.method]=this._legacyPreloadGenerator(i,u,c[a]))}}catch(e){t=!0,r=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw r}}f=!0},h.default.prototype._wrapPromisePreload=function(e,l,u){var t=function(){for(var e=this,t=(this._incrementPreload(),null),r=null,o=arguments.length,n=new Array(o),s=0;s<o;s++)n[s]=arguments[s];if(u)for(var i=n.length-1;0<=i&&!r&&"function"==typeof n[i];i--)r=t,t=n.pop();var a=Promise.resolve(l.apply(this,n));return t&&a.then(t),r&&a.catch(r),a.then(function(){return e._decrementPreload()}),a};return t=e?t.bind(e):t};h.default.prototype._legacyPreloadGenerator=function(e,t,s){var i=t.createBaseObject||o,t=function(){var t=this;this._incrementPreload();for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var n=i.apply(this,r);return s.apply(this,r).then(function(e){Object.assign(n,e),t._decrementPreload()}),n};return t=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 o(e){return(o="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 l=(n=e("./main"))&&n.__esModule?n:{default:n},u=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function c(e){return(c="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("./p5.Graphics"),e("./p5.Renderer2D"),e("../webgl/p5.RendererGL");var d="defaultCanvas0",n=(l.default.prototype.createCanvas=function(e,t,r,o){var n,s,i;if(l.default._validateParameters("createCanvas",arguments),arguments[2]instanceof HTMLCanvasElement?(r=u.P2D,o=arguments[2]):n=r||u.P2D,o)(i=document.getElementById(d))&&i.parentNode.removeChild(i),i=o,this._defaultGraphicsCreated=!1;else{if(n===u.WEBGL)(i=document.getElementById(d))&&(i.parentNode.removeChild(i),s=this._renderer,this._elements=this._elements.filter(function(e){return e!==s})),(i=document.createElement("canvas")).id=d,i.classList.add("p5Canvas");else if(this._defaultGraphicsCreated)i=this.canvas;else{i=o||document.createElement("canvas");for(var a=0;document.getElementById("defaultCanvas".concat(a));)a++;d="defaultCanvas".concat(a),i.id=d,i.classList.add("p5Canvas")}this._setupDone||(i.dataset.hidden=!0,i.style.visibility="hidden"),(this._userNode||(0===document.getElementsByTagName("main").length&&(r=document.createElement("main"),document.body.appendChild(r)),document.getElementsByTagName("main")[0])).appendChild(i)}return n===u.WEBGL?(this._setProperty("_renderer",new l.default.RendererGL(i,this,!0)),this._elements.push(this._renderer),e=(o=this._renderer._adjustDimensions(e,t)).adjustedWidth,t=o.adjustedHeight):this._defaultGraphicsCreated||(this._setProperty("_renderer",new l.default.Renderer2D(i,this,!0)),this._defaultGraphicsCreated=!0,this._elements.push(this._renderer)),this._renderer.resize(e,t),this._renderer._applyDefaults(),this._renderer},l.default.prototype.resizeCanvas=function(e,t,r){if(l.default._validateParameters("resizeCanvas",arguments),this._renderer){var o,n,s,i={};for(o in this.drawingContext){var a=this.drawingContext[o];"object"!==c(a)&&"function"!=typeof a&&(i[o]=a)}for(s in this._renderer instanceof l.default.RendererGL&&(e=(n=this._renderer._adjustDimensions(e,t)).adjustedWidth,t=n.adjustedHeight),this.width=e,this.height=t,this._renderer.resize(e,t),i)try{this.drawingContext[s]=i[s]}catch(e){}r||this.redraw()}this._addAccsOutput()&&this._updateAccsOutput()},l.default.prototype.noCanvas=function(){this.canvas&&this.canvas.parentNode.removeChild(this.canvas)},l.default.prototype.createGraphics=function(e,t){for(var r=arguments.length,o=new Array(2<r?r-2:0),n=2;n<r;n++)o[n-2]=arguments[n];return o[0]instanceof HTMLCanvasElement&&(o[1]=o[0],o[0]=u.P2D),l.default._validateParameters("createGraphics",arguments),new l.default.Graphics(e,t,o[0],this,o[1])},l.default.prototype.createFramebuffer=function(e){return new l.default.Framebuffer(this,e)},l.default.prototype.clearDepth=function(e){this._assert3d("clearDepth"),this._renderer.clearDepth(e)},l.default.prototype.blendMode=function(e){l.default._validateParameters("blendMode",arguments),e===u.NORMAL&&(console.warn("NORMAL has been deprecated for use in blendMode. defaulting to BLEND instead."),e=u.BLEND),this._renderer.blendMode(e)},l.default);r.default=n},{"../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 o(e){return(o="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"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(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 l=n(e("../main")),a=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,o={},n=O