fractals/p5/p5.min.js

15 lines
451 KiB
JavaScript
Raw Normal View History

2019-01-22 16:38:35 +00:00
/*! p5.js v0.7.2 September 02, 2018 */ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.p5=a()}}(function(){var a;return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){!function(a){"use strict";function b(a){var b=a.charCodeAt(0);return b===f||b===k?62:b===g||b===l?63:b<h?-1:b<h+10?b-h+26+26:b<j+26?b-j:b<i+26?b-i+26:void 0}function c(a){function c(a){j[l++]=a}var d,f,g,h,i,j;if(a.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=a.length;i="="===a.charAt(k-2)?2:"="===a.charAt(k-1)?1:0,j=new e(3*a.length/4-i),g=i>0?a.length-4:a.length;var l=0;for(d=0,f=0;d<g;d+=4,f+=3)h=b(a.charAt(d))<<18|b(a.charAt(d+1))<<12|b(a.charAt(d+2))<<6|b(a.charAt(d+3)),c((16711680&h)>>16),c((65280&h)>>8),c(255&h);return 2===i?(h=b(a.charAt(d))<<2|b(a.charAt(d+1))>>4,c(255&h)):1===i&&(h=b(a.charAt(d))<<10|b(a.charAt(d+1))<<4|b(a.charAt(d+2))>>2,c(h>>8&255),c(255&h)),j}function d(a){function b(a){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a)}function c(a){return b(a>>18&63)+b(a>>12&63)+b(a>>6&63)+b(63&a)}var d,e,f,g=a.length%3,h="";for(d=0,f=a.length-g;d<f;d+=3)e=(a[d]<<16)+(a[d+1]<<8)+a[d+2],h+=c(e);switch(g){case 1:e=a[a.length-1],h+=b(e>>2),h+=b(e<<4&63),h+="==";break;case 2:e=(a[a.length-2]<<8)+a[a.length-1],h+=b(e>>10),h+=b(e>>4&63),h+=b(e<<2&63),h+="="}return h}var e="undefined"!=typeof Uint8Array?Uint8Array:Array,f="+".charCodeAt(0),g="/".charCodeAt(0),h="0".charCodeAt(0),i="a".charCodeAt(0),j="A".charCodeAt(0),k="-".charCodeAt(0),l="_".charCodeAt(0);a.toByteArray=c,a.fromByteArray=d}(void 0===c?this.base64js={}:c)},{}],2:[function(a,b,c){},{}],3:[function(a,b,c){(function(b){"use strict";function d(){function a(){}try{var b=new Uint8Array(1);return b.foo=function(){return 42},b.constructor=a,42===b.foo()&&b.constructor===a&&"function"==typeof b.subarray&&0===b.subarray(1,1).byteLength}catch(a){return!1}}function e(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(a){return this instanceof f?(f.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof a?g(this,a):"string"==typeof a?h(this,a,arguments.length>1?arguments[1]:"utf8"):i(this,a)):arguments.length>1?new f(a,arguments[1]):new f(a)}function g(a,b){if(a=p(a,b<0?0:0|q(b)),!f.TYPED_ARRAY_SUPPORT)for(var c=0;c<b;c++)a[c]=0;return a}function h(a,b,c){return"string"==typeof c&&""!==c||(c="utf8"),a=p(a,0|s(b,c)),a.write(b,c),a}function i(a,b){if(f.isBuffer(b))return j(a,b);if(Y(b))return k(a,b);if(null==b)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(b.buffer instanceof ArrayBuffer)return l(a,b);if(b instanceof ArrayBuffer)return m(a,b)}return b.length?n(a,b):o(a,b)}function j(a,b){var c=0|q(b.length);return a=p(a,c),b.copy(a,0,0,c),a}function k(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;d<c;d+=1)a[d]=255&b[d];return a}function l(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;d<c;d+=1)a[d]=255&b[d];return a}function m(a,b){return f.TYPED_ARRAY_SUPPORT?(b.byteLength,a=f._augment(new Uint8Array(b))):a=l(a,new Uint8Array(b)),a}function n(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;d<c;d+=1)a[d]=255&b[d];return a}function o(a,b){var c,d=0;"Buffer"===b.type&&Y(b.data)&&(c=b.data,d=0|q(c.length)),a=p(a,d);for(var e=0;e<d;e+=1)a[e]=255&c[e];return a}function p(a,b){return f.TYPED_ARRAY_SUPPORT?(a=f._augment(new Uint8Array(b)),a.__proto__=f.prototype):(a.length=b,a._isBuffer=!0),0!==b&&b<=f.poolSize>>>1&&(a.parent=Z),a}
;return 0<d+e?d<e?b.a-a.a+d/(d+e)*(a.a-c.a):b.a-c.a+e/(d+e)*(c.a-a.a):0}function g(a,b,c){var d=b.b-a.b,e=c.b-b.b;return 0<d+e?(b.a-c.a)*d+(b.a-a.a)*e:0}function h(a,b){return a.a<b.a||a.a===b.a&&a.b<=b.b}function i(a,b,c){var d=b.a-a.a,e=c.a-b.a;return 0<d+e?d<e?b.b-a.b+d/(d+e)*(a.b-c.b):b.b-c.b+e/(d+e)*(c.b-a.b):0}function j(a,b,c){var d=b.a-a.a,e=c.a-b.a;return 0<d+e?(b.b-c.b)*d+(b.b-a.b)*e:0}function k(a){return e(a.b.a,a.a)}function l(a){return e(a.a,a.b.a)}function m(a,b,c,d){return a=0>a?0:a,c=0>c?0:c,a<=c?0===c?(b+d)/2:b+a/(a+c)*(d-b):d+c/(a+c)*(b-d)}function n(a){var b=s(a.b);return u(b,a.c),u(b.b,a.c),v(b,a.a),b}function o(a,b){var c=!1,d=!1;a!==b&&(b.a!==a.a&&(d=!0,x(b.a,a.a)),b.d!==a.d&&(c=!0,y(b.d,a.d)),t(b,a),d||(u(b,a.a),a.a.c=a),c||(v(b,a.d),a.d.a=a))}function p(a){var b=a.b,c=!1;a.d!==a.b.d&&(c=!0,y(a.d,a.b.d)),a.c===a?x(a.a,null):(a.b.d.a=$(a),a.a.c=a.c,t(a,$(a)),c||v(a,a.d)),b.c===b?(x(b.a,null),y(b.d,null)):(a.d.a=$(b),b.a.c=b.c,t(b,$(b))),w(a)}function q(a){var b=s(a),c=b.b;return t(b,a.e),b.a=a.b.a,u(c,b.a),b.d=c.d=a.d,b=b.b,t(a.b,$(a.b)),t(a.b,b),a.b.a=b.a,b.b.a.c=b.b,b.b.d=a.b.d,b.f=a.f,b.b.f=a.b.f,b}function r(a,b){var c=!1,d=s(a),e=d.b;return b.d!==a.d&&(c=!0,y(b.d,a.d)),t(d,a.e),t(e,b),d.a=a.b.a,e.a=b.a,d.d=e.d=a.d,a.d.a=e,c||v(d,a.d),d}function s(a){var b=new Z,c=new Z,d=a.b.h;return c.h=d,d.b.h=b,b.h=a,a.b.h=c,b.b=c,b.c=b,b.e=c,c.b=b,c.c=c,c.e=b}function t(a,b){var c=a.c,d=b.c;c.b.e=b,d.b.e=a,a.c=d,b.c=c}function u(a,b){var c=b.f,d=new aa(b,c);c.e=d,b.f=d,c=d.c=a;do{c.a=d,c=c.c}while(c!==a)}function v(a,b){var c=b.d,d=new Y(b,c);c.b=d,b.d=d,d.a=a,d.c=b.c,c=a;do{c.d=d,c=c.e}while(c!==a)}function w(a){var b=a.h;a=a.b.h,b.b.h=a,a.b.h=b}function x(a,b){var c=a.c,d=c;do{d.a=b,d=d.c}while(d!==c);c=a.f,d=a.e,d.f=c,c.e=d}function y(a,b){var c=a.a,d=c;do{d.d=b,d=d.e}while(d!==c);c=a.d,d=a.b,d.d=c,c.b=d}function z(a){var b=0;return Math.abs(a[1])>Math.abs(a[0])&&(b=1),Math.abs(a[2])>Math.abs(a[b])&&(b=2),b}function A(a,b){a.f+=b.f,a.b.f+=b.b.f}function B(a,b,c){return a=a.a,b=b.a,c=c.a,b.b.a===a?c.b.a===a?e(b.a,c.a)?0>=g(c.b.a,b.a,c.a):0<=g(b.b.a,c.a,b.a):0>=g(c.b.a,a,c.a):c.b.a===a?0<=g(b.b.a,a,b.a):(b=f(b.b.a,a,b.a),a=f(c.b.a,a,c.a),b>=a)}function C(a){a.a.i=null;var b=a.e;b.a.c=b.c,b.c.a=b.a,a.e=null}function D(a,b){p(a.a),a.c=!1,a.a=b,b.i=a}function E(a){var b=a.a.a;do{a=oa(a)}while(a.a.a===b);return a.c&&(b=r(na(a).a.b,a.a.e),D(a,b),a=oa(a)),a}function F(a,b,c){var d=new ma;return d.a=c,d.e=T(a.f,b.e,d),c.i=d}function G(a,b){switch(a.s){case 100130:return 0!=(1&b);case 100131:return 0!==b;case 100132:return 0<b;case 100133:return 0>b;case 100134:return 2<=b||-2>=b}return!1}function H(a){var b=a.a,c=b.d;c.c=a.d,c.a=b,C(a)}function I(a,b,c){for(a=b,b=b.a;a!==c;){a.c=!1;var d=na(a),e=d.a;if(e.a!==b.a){if(!d.c){H(a);break}e=r(b.c.b,e.b),D(d,e)}b.c!==e&&(o($(e),e),o(b,e)),H(a),b=d.a,a=d}return b}function J(a,b,c,d,e,f){var g=!0;do{F(a,b,c.b),c=c.c}while(c!==d);for(null===e&&(e=na(b).a.b.c);d=na(b),c=d.a.b,c.a===e.a;)c.c!==e&&(o($(c),c),o($(e),c)),d.f=b.f-c.f,d.d=G(a,d.f),b.b=!0,!g&&N(a,b)&&(A(c,e),C(b),p(e)),g=!1,b=d,e=c;b.b=!0,f&&P(a,b)}function K(a,b,c,d,e){var f=[b.g[0],b.g[1],b.g[2]];b.d=null,b.d=a.o?a.o(f,c,d,a.c)||null:null,null===b.d&&(e?a.n||(X(a,100156),a.n=!0):b.d=c[0])}function L(a,b,c){var d=[null,null,null,null];d[0]=b.a.d,d[1]=c.a.d,K(a,b.a,d,[.5,.5,0,0],!1),o(b,c)}function M(a,b,c,d,e){var f=Math.abs(b.b-a.b)+Math.abs(b.a-a.a),g=Math.abs(c.b-a.b)+Math.abs(c.a-a.a),h=e+1;d[e]=.5*g/(f+g),d[h]=.5*f/(f+g),a.g[0]+=d[e]*b.g[0]+d[h]*c.g[0],a.g[1]+=d[e]*b.g[1]+d[h]*c.g[1],a.g[2]+=d[e]*b.g[2]+d[h]*c.g[2]}function N(a,b){var c=na(b),f=b.a,h=c.a;if(e(f.a,h.a)){if(0<g(h.b.a,f.a,h.a))return!1;if(d(f.a,h.a)){if(f.a!==h.a){var c=a.e,i=f.a.h;if(0<=i){var c=c.b,j=c.d,k=c.e,l=c.c,m=l[i];j[m]=j[c.a],l[j[m]]=m,m<=--c.a&&(1>=m?ka(c,m):e(k[j[m>>1]],k[j[m]])?ka(c,m):la(c,m)),k[i]=null,l[i]=c.b,c.b=i}else for(c.c[-(i+1)]=null;0<c.a&&null===c.c[c.d[c.a-1]];)--c.a;L(a,$(h),f)}}else q(h.b),o(f,$(h)),b.b=c.b=!0}else{if(0>g(f.b.a,h.a,f.a))return!1;oa(b).b=b.b=!0,q(f.b),o($(h),f)}return!0}function O(a,b){var c=na(b)
u=i+p.shift(),v=j+p.shift(),o.curveTo(g,h,i,j,u,v);break;case 10:z=p.pop()+l,A=k[z],A&&f(A);break;case 11:return;case 12:switch(I=c[H],H+=1,I){case 35:g=u+p.shift(),h=v+p.shift(),i=g+p.shift(),j=h+p.shift(),B=i+p.shift(),C=j+p.shift(),D=B+p.shift(),E=C+p.shift(),F=D+p.shift(),G=E+p.shift(),u=F+p.shift(),v=G+p.shift(),p.shift(),o.curveTo(g,h,i,j,B,C),o.curveTo(D,E,F,G,u,v);break;case 34:g=u+p.shift(),h=v,i=g+p.shift(),j=h+p.shift(),B=i+p.shift(),C=j,D=B+p.shift(),E=j,F=D+p.shift(),G=v,u=F+p.shift(),o.curveTo(g,h,i,j,B,C),o.curveTo(D,E,F,G,u,v);break;case 36:g=u+p.shift(),h=v+p.shift(),i=g+p.shift(),j=h+p.shift(),B=i+p.shift(),C=j,D=B+p.shift(),E=j,F=D+p.shift(),G=E+p.shift(),u=F+p.shift(),o.curveTo(g,h,i,j,B,C),o.curveTo(D,E,F,G,u,v);break;case 37:g=u+p.shift(),h=v+p.shift(),i=g+p.shift(),j=h+p.shift(),B=i+p.shift(),C=j+p.shift(),D=B+p.shift(),E=C+p.shift(),F=D+p.shift(),G=E+p.shift(),Math.abs(F-u)>Math.abs(G-v)?u=F+p.shift():v=G+p.shift(),o.curveTo(g,h,i,j,B,C),o.curveTo(D,E,F,G,u,v);break;default:console.log("Glyph "+b.index+": unknown operator 1200"+I),p.length=0}break;case 14:p.length>0&&!s&&(y=p.shift()+n,s=!0),t&&(o.closePath(),t=!1);break;case 18:e();break;case 19:case 20:e(),H+=q+7>>3;break;case 21:p.length>2&&!s&&(y=p.shift()+n,s=!0),v+=p.pop(),u+=p.pop(),d(u,v);break;case 22:p.length>1&&!s&&(y=p.shift()+n,s=!0),u+=p.pop(),d(u,v);break;case 23:e();break;case 24:for(;p.length>2;)g=u+p.shift(),h=v+p.shift(),i=g+p.shift(),j=h+p.shift(),u=i+p.shift(),v=j+p.shift(),o.curveTo(g,h,i,j,u,v);u+=p.shift(),v+=p.shift(),o.lineTo(u,v);break;case 25:for(;p.length>6;)u+=p.shift(),v+=p.shift(),o.lineTo(u,v);g=u+p.shift(),h=v+p.shift(),i=g+p.shift(),j=h+p.shift(),u=i+p.shift(),v=j+p.shift(),o.curveTo(g,h,i,j,u,v);break;case 26:for(p.length%2&&(u+=p.shift());p.length>0;)g=u,h=v+p.shift(),i=g+p.shift(),j=h+p.shift(),u=i,v=j+p.shift(),o.curveTo(g,h,i,j,u,v);break;case 27:for(p.length%2&&(v+=p.shift());p.length>0;)g=u+p.shift(),h=v,i=g+p.shift(),j=h+p.shift(),u=i+p.shift(),v=j,o.curveTo(g,h,i,j,u,v);break;case 28:m=c[H],r=c[H+1],p.push((m<<24|r<<16)>>16),H+=2;break;case 29:z=p.pop()+a.gsubrsBias,A=a.gsubrs[z],A&&f(A);break;case 30:for(;p.length>0&&(g=u,h=v+p.shift(),i=g+p.shift(),j=h+p.shift(),u=i+p.shift(),v=j+(1===p.length?p.shift():0),o.curveTo(g,h,i,j,u,v),0!==p.length);)g=u+p.shift(),h=v,i=g+p.shift(),j=h+p.shift(),v=j+p.shift(),u=i+(1===p.length?p.shift():0),o.curveTo(g,h,i,j,u,v);break;case 31:for(;p.length>0&&(g=u+p.shift(),h=v,i=g+p.shift(),j=h+p.shift(),v=j+p.shift(),u=i+(1===p.length?p.shift():0),o.curveTo(g,h,i,j,u,v),0!==p.length);)g=u,h=v+p.shift(),i=g+p.shift(),j=h+p.shift(),u=i+p.shift(),v=j+(1===p.length?p.shift():0),o.curveTo(g,h,i,j,u,v);break;default:I<32?console.log("Glyph "+b.index+": unknown operator "+I):I<247?p.push(I-139):I<251?(m=c[H],H+=1,p.push(256*(I-247)+m+108)):I<255?(m=c[H],H+=1,p.push(256*-(I-251)-m-108)):(m=c[H],r=c[H+1],w=c[H+2],x=c[H+3],H+=4,p.push((m<<24|r<<16|w<<8|x)/65536))}}}var g,h,i,j,k,l,m,n,o=new r,p=[],q=0,s=!1,t=!1,u=0,v=0;if(a.isCIDFont){var w=a.tables.cff.topDict._fdSelect[b.index],x=a.tables.cff.topDict._fdArray[w];k=x._subrs,l=x._subrsBias,m=x._defaultWidthX,n=x._nominalWidthX}else k=a.tables.cff.topDict._subrs,l=a.tables.cff.topDict._subrsBias,m=a.tables.cff.topDict._defaultWidthX,n=a.tables.cff.topDict._nominalWidthX;var y=m;return f(c),b.advanceWidth=y,o}function ya(a,b,c,d){var e,f=[],g=new Le.Parser(a,b),h=g.parseCard8();if(0===h)for(var i=0;i<c;i++){if((e=g.parseCard8())>=d)throw new Error("CFF table CID Font FDSelect has bad FD index value "+e+" (FD count "+d+")");f.push(e)}else{if(3!==h)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+h);var j=g.parseCard16(),k=g.parseCard16();if(0!==k)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+k);for(var l,m=0;m<j;m++){if(e=g.parseCard8(),l=g.parseCard16(),e>=d)throw new Error("CFF table CID Font FDSelect has bad FD index value "+e+" (FD count "+d+")");if(l>c)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+l);for(;k<l;k++)f.push(e);k=l}if(l!==c)throw
if(d.matchedPoints[0]>b.points.length-1||d.matchedPoints[1]>e.points.length-1)throw Error("Matched points out of range in "+b.name);var g=b.points[d.matchedPoints[0]],h=e.points[d.matchedPoints[1]],i={xScale:d.xScale,scale01:d.scale01,scale10:d.scale10,yScale:d.yScale,dx:0,dy:0};h=Hb([h],i)[0],i.dx=g.x-h.x,i.dy=g.y-h.y,f=Hb(e.points,i)}b.points=b.points.concat(f)}}return Jb(b.points)}function Lb(a,b,c,d){for(var e=new Se.GlyphSet(d),f=0;f<c.length-1;f+=1){var g=c[f];g!==c[f+1]?e.push(f,Se.ttfGlyphLoader(d,f,Gb,a,b+g,Kb)):e.push(f,Se.glyphLoader(d,f))}return e}function Mb(a){this.font=a,this.getCommands=function(a){return vf.getPath(a).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Nb(a){return a}function Ob(a){return Math.sign(a)*Math.round(Math.abs(a))}function Pb(a){return Math.sign(a)*Math.round(Math.abs(2*a))/2}function Qb(a){return Math.sign(a)*(Math.round(Math.abs(a)+.5)-.5)}function Rb(a){return Math.sign(a)*Math.ceil(Math.abs(a))}function Sb(a){return Math.sign(a)*Math.floor(Math.abs(a))}function Tb(a,b){this.x=a,this.y=b,this.axis=void 0,this.slope=b/a,this.normalSlope=-a/b,Object.freeze(this)}function Ub(a,b){var c=Math.sqrt(a*a+b*b);return a/=c,b/=c,1===a&&0===b?xf:0===a&&1===b?yf:new Tb(a,b)}function Vb(a,b,c,d){this.x=this.xo=Math.round(64*a)/64,this.y=this.yo=Math.round(64*b)/64,this.lastPointOfContour=c,this.onCurve=d,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}function Wb(a,b){switch(this.env=a,this.stack=[],this.prog=b,a){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=xf,this.round=Ob}}function Xb(a){for(var b=a.tZone=new Array(a.gZone.length),c=0;c<b.length;c++)b[c]=new Vb(0,0)}function Yb(a,b){var c,d=a.prog,e=a.ip,f=1;do{if(88===(c=d[++e]))f++;else if(89===c)f--;else if(64===c)e+=d[e+1]+1;else if(65===c)e+=2*d[e+1]+1;else if(c>=176&&c<=183)e+=c-176+1;else if(c>=184&&c<=191)e+=2*(c-184+1);else if(b&&1===f&&27===c)break}while(f>0);a.ip=e}function Zb(b,c){a.DEBUG&&console.log(c.step,"SVTCA["+b.axis+"]"),c.fv=c.pv=c.dpv=b}function $b(b,c){a.DEBUG&&console.log(c.step,"SPVTCA["+b.axis+"]"),c.pv=c.dpv=b}function _b(b,c){a.DEBUG&&console.log(c.step,"SFVTCA["+b.axis+"]"),c.fv=b}function ac(b,c){var d=c.stack,e=d.pop(),f=d.pop(),g=c.z2[e],h=c.z1[f];a.DEBUG&&console.log("SPVTL["+b+"]",e,f);var i,j;b?(i=g.y-h.y,j=h.x-g.x):(i=h.x-g.x,j=h.y-g.y),c.pv=c.dpv=Ub(i,j)}function bc(b,c){var d=c.stack,e=d.pop(),f=d.pop(),g=c.z2[e],h=c.z1[f];a.DEBUG&&console.log("SFVTL["+b+"]",e,f);var i,j;b?(i=g.y-h.y,j=h.x-g.x):(i=h.x-g.x,j=h.y-g.y),c.fv=Ub(i,j)}function cc(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"SPVFS[]",d,e),b.pv=b.dpv=Ub(e,d)}function dc(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"SPVFS[]",d,e),b.fv=Ub(e,d)}function ec(b){var c=b.stack,d=b.pv;a.DEBUG&&console.log(b.step,"GPV[]"),c.push(16384*d.x),c.push(16384*d.y)}function fc(b){var c=b.stack,d=b.fv;a.DEBUG&&console.log(b.step,"GFV[]"),c.push(16384*d.x),c.push(16384*d.y)}function gc(b){b.fv=b.pv,a.DEBUG&&console.log(b.step,"SFVTPV[]")}function hc(b){var c=b.stack,d=c.pop(),e=c.pop(),f=c.pop(),g=c.pop(),h=c.pop(),i=b.z0,j=b.z1,k=i[d],l=i[e],m=j[f],n=j[g],o=b.z2[h];a.DEBUG&&console.log("ISECT[], ",d,e,f,g,h);var p=k.x,q=k.y,r=l.x,s=l.y,t=m.x,u=m.y,v=n.x,w=n.y,x=(p-r)*(u-w)-(q-s)*(t-v),y=p*s-q*r,z=t*w-u*v;o.x=(y*(t-v)-z*(p-r))/x,o.y=(y*(u-w)-z*(q-s))/x}function ic(b){b.rp0=b.stack.pop(),a.DEBUG&&console.log(b.step,"SRP0[]",b.rp0)}function jc(b){b.rp1=b.stack.pop(),a.DEBUG&&console.log(b.step,"SRP1[]",b.rp1)}function kc(b){b.rp2=b.stack.pop(),a.DEBUG&&console.log(b.step,"SRP2[]",b.rp2)}function lc(b){var c=b.stack.pop();switch(a.DEBUG&&console.log(b.step,"SZP0[]",c),b.zp0=c,c){case 0:b.tZone||Xb(b),b.z0=b.tZone;break;case 1:b.z0=b.gZone;break;default:throw new Error("Invalid zone pointer")}}function mc(b){var c=b.stack.pop();switch(a.DEBUG&&console.log(b.step,"SZP1[]",c),b.zp1=c,c){case 0:b.tZone||Xb(b),b.z1=b.tZone;break;case 1:b.z1=b.gZone;break;default:
},Ce.NUMBER=function(a){return Be.NUMBER(a).length},Be.NUMBER16=function(a){return[28,a>>8&255,255&a]},Ce.NUMBER16=u(3),Be.NUMBER32=function(a){return[29,a>>24&255,a>>16&255,a>>8&255,255&a]},Ce.NUMBER32=u(5),Be.REAL=function(a){var b=a.toString(),c=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(b);if(c){var d=parseFloat("1e"+((c[2]?+c[2]:0)+c[1].length));b=(Math.round(a*d)/d).toString()}for(var e="",f=0,g=b.length;f<g;f+=1){var h=b[f];e+="e"===h?"-"===b[++f]?"c":"b":"."===h?"a":"-"===h?"e":h}e+=1&e.length?"f":"ff";for(var i=[30],j=0,k=e.length;j<k;j+=2)i.push(parseInt(e.substr(j,2),16));return i},Ce.REAL=function(a){return Be.REAL(a).length},Be.NAME=Be.CHARARRAY,Ce.NAME=Ce.CHARARRAY,Be.STRING=Be.CHARARRAY,Ce.STRING=Ce.CHARARRAY,Ae.UTF8=function(a,b,c){for(var d=[],e=c,f=0;f<e;f++,b+=1)d[f]=a.getUint8(b);return String.fromCharCode.apply(null,d)},Ae.UTF16=function(a,b,c){for(var d=[],e=c/2,f=0;f<e;f++,b+=2)d[f]=a.getUint16(b);return String.fromCharCode.apply(null,d)},Be.UTF16=function(a){for(var b=[],c=0;c<a.length;c+=1){var d=a.charCodeAt(c);b[b.length]=d>>8&255,b[b.length]=255&d}return b},Ce.UTF16=function(a){return 2*a.length};var De={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü°¢£§ß®©´¨Æر¥µ<EFBFBD>
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},cf={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"},df="utf-16",ef={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"},ff={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"},gf={parse:Za,make:cb},hf=[{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}
posFormat:2,coverage:this.parsePointer(Q.coverage),values:this.parseValueRecordList()}:void xe.assert(!1,"0x"+a.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},Df[2]=function(){var a=this.offset+this.relativeOffset,b=this.parseUShort();xe.assert(1===b||2===b,"0x"+a.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var c=this.parsePointer(Q.coverage),d=this.parseUShort(),e=this.parseUShort();if(1===b)return{posFormat:b,coverage:c,valueFormat1:d,valueFormat2:e,pairSets:this.parseList(Q.pointer(Q.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(d),value2:this.parseValueRecord(e)}})))};if(2===b){var f=this.parsePointer(Q.classDef),g=this.parsePointer(Q.classDef),h=this.parseUShort(),i=this.parseUShort();return{posFormat:b,coverage:c,valueFormat1:d,valueFormat2:e,classDef1:f,classDef2:g,class1Count:h,class2Count:i,classRecords:this.parseList(h,Q.list(i,function(){return{value1:this.parseValueRecord(d),value2:this.parseValueRecord(e)}}))}}},Df[3]=function(){return{error:"GPOS Lookup 3 not supported"}},Df[4]=function(){return{error:"GPOS Lookup 4 not supported"}},Df[5]=function(){return{error:"GPOS Lookup 5 not supported"}},Df[6]=function(){return{error:"GPOS Lookup 6 not supported"}},Df[7]=function(){return{error:"GPOS Lookup 7 not supported"}},Df[8]=function(){return{error:"GPOS Lookup 8 not supported"}},Df[9]=function(){return{error:"GPOS Lookup 9 not supported"}};var Ef=new Array(10),Ff={parse:Yd,make:Zd},Gf={parse:ae},Hf={parse:be};a.Font=Qd,a.Glyph=ca,a.Path=r,a.BoundingBox=q,a._parse=Le,a.parse=he,a.load=ie,a.loadSync=je,Object.defineProperty(a,"__esModule",{value:!0})})}).call(this,b("buffer").Buffer)},{buffer:3,fs:2}],11:[function(a,b,c){function d(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}function f(a){if(l===setTimeout)return setTimeout(a,0);if((l===d||!l)&&setTimeout)return l=setTimeout,setTimeout(a,0);try{return l(a,0)}catch(b){try{return l.call(null,a,0)}catch(b){return l.call(this,a,0)}}}function g(a){if(m===clearTimeout)return clearTimeout(a);if((m===e||!m)&&clearTimeout)return m=clearTimeout,clearTimeout(a);try{return m(a)}catch(b){try{return m.call(null,a)}catch(b){return m.call(this,a)}}}function h(){q&&o&&(q=!1,o.length?p=o.concat(p):r=-1,p.length&&i())}function i(){if(!q){var a=f(h);q=!0;for(var b=p.length;b;){for(o=p,p=[];++r<b;)o&&o[r].run();r=-1,b=p.length}o=null,q=!1,g(a)}}function j(a,b){this.fun=a,this.array=b}function k(){}var l,m,n=b.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:d}catch(a){l=d}try{m="function"==typeof clearTimeout?clearTimeout:e}catch(a){m=e}}();var o,p=[],q=!1,r=-1;n.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];p.push(new j(a,b)),1!==p.length||q||f(i)},j.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=k,n.addListener=k,n.once=k,n.off=k,n.removeListener=k,n.removeAllListeners=k,n.emit=k,n.prependListener=k,n.prependOnceListener=k,n.listeners=function(a){return[]},n.binding=function(a){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(a){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},{}],12:[function(a,b,c){!function(a){"use strict";function b(a){if("string"!=typeof a&&(a=String(a)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(a))throw new TypeError("Invalid character in header field name");return a.toLowerCase()}function c(a){return"string"!=typeof a&&(a=String(a)),a}function d(a){var b={next:function(){var b=a.shift();return{done:void 0===b,value:b}}};return r.iterable&&(b[Symbol.iterator]=function(){return b}),b}function e(a){this.map={},a instanceof e?a.forEach(function(a,b){this.append(b,a)},this):Array.isArray(a)?a.forEach(function(a){this.append(a[0],a[1])},this):a&&Object.getOwnPropertyNames(a).forEach(function(b){this.append(b,a[b])},this)}function f(a){if(a.bodyUsed)retu
;a.requestFullscreen?a.requestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.webkitRequestFullscreen?a.webkitRequestFullscreen():a.msRequestFullscreen&&a.msRequestFullscreen()}function g(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()}var h=a("./main"),i=a("./constants"),j=[i.ARROW,i.CROSS,i.HAND,i.MOVE,i.TEXT,i.WAIT];h.prototype._frameRate=0,h.prototype._lastFrameTime=window.performance.now(),h.prototype._targetFrameRate=60;var k=window.print;h.prototype.print=function(){arguments.length?console.log.apply(console,arguments):k()},h.prototype.frameCount=0,h.prototype.focused=document.hasFocus(),h.prototype.cursor=function(a,b,c){var d="auto",e=this._curElement.elt;if(j.indexOf(a)>-1)d=a;else if("string"==typeof a){var f="";b&&c&&"number"==typeof b&&"number"==typeof c&&(f=b+" "+c),d="http://"===a.substring(0,7)||"https://"===a.substring(0,8)?"url("+a+") "+f+", auto":/\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(a)?"url("+a+") "+f+", auto":a}e.style.cursor=d},h.prototype.frameRate=function(a){return h._validateParameters("frameRate",arguments),"number"!=typeof a||a<0?this._frameRate:(this._setProperty("_targetFrameRate",a),this._runFrames(),this)},h.prototype.getFrameRate=function(){return this.frameRate()},h.prototype.setFrameRate=function(a){return this.frameRate(a)},h.prototype.noCursor=function(){this._curElement.elt.style.cursor="none"},h.prototype.displayWidth=screen.width,h.prototype.displayHeight=screen.height,h.prototype.windowWidth=d(),h.prototype.windowHeight=e(),h.prototype._onresize=function(a){this._setProperty("windowWidth",d()),this._setProperty("windowHeight",e());var b,c=this._isGlobal?window:this;"function"==typeof c.windowResized&&(void 0===(b=c.windowResized(a))||b||a.preventDefault())},h.prototype.width=0,h.prototype.height=0,h.prototype.fullscreen=function(a){if(h._validateParameters("fullscreen",arguments),void 0===a)return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;a?f(document.documentElement):g()},h.prototype.pixelDensity=function(a){h._validateParameters("pixelDensity",arguments);var b;return"number"==typeof a?(a!==this._pixelDensity&&(this._pixelDensity=a,this._pixelsDirty=!0),b=this,this.resizeCanvas(this.width,this.height,!0)):b=this._pixelDensity,b},h.prototype.displayDensity=function(){return window.devicePixelRatio},h.prototype.getURL=function(){return location.href},h.prototype.getURLPath=function(){return location.pathname.split("/").filter(function(a){return""!==a})},h.prototype.getURLParams=function(){for(var a,b=/[?&]([^&=]+)(?:[&=])([^&=]+)/gim,c={};null!=(a=b.exec(location.search));)a.index===b.lastIndex&&b.lastIndex++,c[a[1]]=a[2];return c},b.exports=h},{"./constants":18,"./main":24}],20:[function(a,b,c){"use strict";var d=a("./main");a("./constants");d._validateParameters=d._friendlyFileLoadError=function(){};var e=null,f="https://github.com/processing/p5.js/wiki/p5.js-overview#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup",g=function(){var b={},c=function(a){return Object.getOwnPropertyNames(a).filter(function(a){return"_"!==a[0]&&(!(a in b)&&(b[a]=!0,!0))}).map(function(b){var c;return c="function"==typeof a[b]?"function":b===b.toUpperCase()?"constant":"variable",{name:b,type:c}})};e=[].concat(c(d.prototype),c(a("./constants"))),e.sort(function(a,b){return b.name.length-a.name.length})},h=function(a,b){b||(b=console.log.bind(console)),e||g(),e.some(function(c){if(a.message&&null!==a.message.match("\\W?"+c.name+"\\W"))return b("Did you just try to use p5.js's "+c.name+("function"===c.type?"() ":" ")+c.type+"? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: "+f),!0})};d.prototype._helpForMisusedAtTopLevelCode=h,"complete"!==document.readyState&&(window.addEventListener("error",h,!1),window.addEventListener("load",function(){windo
this._doFill&&this._pInst.fill(b[k+1][5]),k+2<m&&(this.drawingContext.lineTo(b[k+2][0],b[k+2][1]),this._doStroke&&this._pInst.stroke(b[k+2][6]),this._doFill&&this._pInst.fill(b[k+2][5])),this._doFillStrokeClose();else if(h===e.TRIANGLE_FAN){if(m>2){for(this.drawingContext.beginPath(),k=2;k<m;k++)i=b[k],this.drawingContext.moveTo(b[0][0],b[0][1]),this.drawingContext.lineTo(b[k-1][0],b[k-1][1]),this.drawingContext.lineTo(i[0],i[1]),this.drawingContext.lineTo(b[0][0],b[0][1]),k<m-1&&(this._doFill&&i[5]!==b[k+1][5]||this._doStroke&&i[6]!==b[k+1][6])&&(this._doFill&&(this._pInst.fill(i[5]),this.drawingContext.fill(),this._pInst.fill(b[k+1][5])),this._doStroke&&(this._pInst.stroke(i[6]),this.drawingContext.stroke(),this._pInst.stroke(b[k+1][6])),this.drawingContext.closePath(),this.drawingContext.beginPath());this._doFillStrokeClose()}}else if(h===e.QUADS)for(k=0;k+3<m;k+=4){for(i=b[k],this.drawingContext.beginPath(),this.drawingContext.moveTo(i[0],i[1]),l=1;l<4;l++)this.drawingContext.lineTo(b[k+l][0],b[k+l][1]);this.drawingContext.lineTo(i[0],i[1]),this._doFill&&this._pInst.fill(b[k+3][5]),this._doStroke&&this._pInst.stroke(b[k+3][6]),this._doFillStrokeClose()}else if(h===e.QUAD_STRIP){if(m>3)for(k=0;k+1<m;k+=2)i=b[k],this.drawingContext.beginPath(),k+3<m?(this.drawingContext.moveTo(b[k+2][0],b[k+2][1]),this.drawingContext.lineTo(i[0],i[1]),this.drawingContext.lineTo(b[k+1][0],b[k+1][1]),this.drawingContext.lineTo(b[k+3][0],b[k+3][1]),this._doFill&&this._pInst.fill(b[k+3][5]),this._doStroke&&this._pInst.stroke(b[k+3][6])):(this.drawingContext.moveTo(i[0],i[1]),this.drawingContext.lineTo(b[k+1][0],b[k+1][1])),this._doFillStrokeClose()}else{for(this.drawingContext.beginPath(),this.drawingContext.moveTo(b[0][0],b[0][1]),k=1;k<m;k++)i=b[k],i.isVert&&(i.moveTo?this.drawingContext.moveTo(i[0],i[1]):this.drawingContext.lineTo(i[0],i[1]));this._doFillStrokeClose()}else{for(this.drawingContext.beginPath(),k=0;k<m;k++)b[k].isVert?b[k].moveTo?this.drawingContext.moveTo([0],b[k][1]):this.drawingContext.lineTo(b[k][0],b[k][1]):this.drawingContext.quadraticCurveTo(b[k][0],b[k][1],b[k][2],b[k][3]);this._doFillStrokeClose()}else{for(this.drawingContext.beginPath(),k=0;k<m;k++)b[k].isVert?b[k].moveTo?this.drawingContext.moveTo(b[k][0],b[k][1]):this.drawingContext.lineTo(b[k][0],b[k][1]):this.drawingContext.bezierCurveTo(b[k][0],b[k][1],b[k][2],b[k][3],b[k][4],b[k][5]);this._doFillStrokeClose()}else if(m>3){var n=[],o=1-this._curveTightness;for(this.drawingContext.beginPath(),this.drawingContext.moveTo(b[1][0],b[1][1]),k=1;k+2<m;k++)i=b[k],n[0]=[i[0],i[1]],n[1]=[i[0]+(o*b[k+1][0]-o*b[k-1][0])/6,i[1]+(o*b[k+1][1]-o*b[k-1][1])/6],n[2]=[b[k+1][0]+(o*b[k][0]-o*b[k+2][0])/6,b[k+1][1]+(o*b[k][1]-o*b[k+2][1])/6],n[3]=[b[k+1][0],b[k+1][1]],this.drawingContext.bezierCurveTo(n[1][0],n[1][1],n[2][0],n[2][1],n[3][0],n[3][1]);j&&this.drawingContext.lineTo(b[k+1][0],b[k+1][1]),this._doFillStrokeClose()}return c=!1,d=!1,f=!1,g=!1,j&&b.pop(),this._pInst._pixelsDirty=!0,this},d.Renderer2D.prototype.noSmooth=function(){return"imageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.imageSmoothingEnabled=!1),this},d.Renderer2D.prototype.smooth=function(){return"imageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.imageSmoothingEnabled=!0),this},d.Renderer2D.prototype.strokeCap=function(a){return a!==e.ROUND&&a!==e.SQUARE&&a!==e.PROJECT||(this.drawingContext.lineCap=a),this},d.Renderer2D.prototype.strokeJoin=function(a){return a!==e.ROUND&&a!==e.BEVEL&&a!==e.MITER||(this.drawingContext.lineJoin=a),this},d.Renderer2D.prototype.strokeWeight=function(a){return this.drawingContext.lineWidth=void 0===a||0===a?1e-4:a,this},d.Renderer2D.prototype._getFill=function(){return this._cachedFillStyle||(this._cachedFillStyle=this.drawingContext.fillStyle),this._cachedFillStyle},d.Renderer2D.prototype._setFill=function(a){a!==this._cachedFillStyle&&(this.drawingContext.fillStyle=a,this._cachedFillStyle=a)},d.Renderer2D.prototype._getStroke=function(){return this._cachedStrokeStyle||(this._cachedStrokeStyle=this.drawingContext.strokeStyle),this._cachedS
"function"==typeof b.mouseReleased?!1===b.mouseReleased(a)&&a.preventDefault():"function"==typeof b.touchEnded&&!1===b.touchEnded(a)&&a.preventDefault()},e.prototype._ondragend=e.prototype._onmouseup,e.prototype._ondragover=e.prototype._onmousemove,e.prototype._onclick=function(a){var b=this._isGlobal?window:this;if("function"==typeof b.mouseClicked){!1===b.mouseClicked(a)&&a.preventDefault()}},e.prototype._ondblclick=function(a){var b=this._isGlobal?window:this;if("function"==typeof b.doubleClicked){!1===b.doubleClicked(a)&&a.preventDefault()}},e.prototype._mouseWheelDeltaY=0,e.prototype._pmouseWheelDeltaY=0,e.prototype._onwheel=function(a){var b=this._isGlobal?window:this;if(this._setProperty("_mouseWheelDeltaY",a.deltaY),"function"==typeof b.mouseWheel){a.delta=a.deltaY;!1===b.mouseWheel(a)&&a.preventDefault()}},b.exports=e},{"../core/constants":18,"../core/main":24}],41:[function(a,b,c){"use strict";function d(a,b,c,d,e){e=e||0;var f=a.getBoundingClientRect(),g=a.scrollWidth/b,h=a.scrollHeight/c,i=d.touches[e]||d.changedTouches[e];return{x:(i.clientX-f.left)/g,y:(i.clientY-f.top)/h,winX:i.clientX,winY:i.clientY,id:i.identifier}}var e=a("../core/main");e.prototype.touches=[],e.prototype._updateTouchCoords=function(a){if(null!==this._curElement){for(var b=[],c=0;c<a.touches.length;c++)b[c]=d(this._curElement.elt,this.width,this.height,a,c);this._setProperty("touches",b)}},e.prototype._ontouchstart=function(a){var b=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!0),this._updateTouchCoords(a),this._updateNextMouseCoords(a),this._updateMouseCoords(),"function"==typeof b.touchStarted?!1===b.touchStarted(a)&&a.preventDefault():"function"==typeof b.mousePressed&&!1===b.mousePressed(a)&&a.preventDefault()},e.prototype._ontouchmove=function(a){var b=this._isGlobal?window:this;this._updateTouchCoords(a),this._updateNextMouseCoords(a),"function"==typeof b.touchMoved?!1===b.touchMoved(a)&&a.preventDefault():"function"==typeof b.mouseDragged&&!1===b.mouseDragged(a)&&a.preventDefault()},e.prototype._ontouchend=function(a){this._setProperty("mouseIsPressed",!1),this._updateTouchCoords(a),this._updateNextMouseCoords(a);var b=this._isGlobal?window:this;"function"==typeof b.touchEnded?!1===b.touchEnded(a)&&a.preventDefault():"function"==typeof b.mouseReleased&&!1===b.mouseReleased(a)&&a.preventDefault()},b.exports=e},{"../core/main":24}],42:[function(a,b,c){"use strict";function d(a){var b=3.5*a|0;if(b=b<1?1:b<248?b:248,g!==b){g=b,h=1+g<<1,i=new Int32Array(h),j=new Array(h);for(var c=0;c<h;c++)j[c]=new Int32Array(256);for(var d,e,f,k,l=1,m=b-1;l<b;l++){i[b+l]=i[m]=e=m*m,f=j[b+l],k=j[m--];for(var n=0;n<256;n++)f[n]=k[n]=e*n}d=i[b]=b*b,f=j[b];for(var o=0;o<256;o++)f[o]=d*o}}function e(a,b){for(var c=f._toPixels(a),e=a.width,k=a.height,l=e*k,m=new Int32Array(l),n=0;n<l;n++)m[n]=f._getARGB(c,n);var o,p,q,r,s,t,u,v,w,x,y=new Int32Array(l),z=new Int32Array(l),A=new Int32Array(l),B=new Int32Array(l),C=0;d(b);var D,E,F,G;for(E=0;E<k;E++){for(D=0;D<e;D++){if(r=q=p=s=o=0,(t=D-g)<0)x=-t,t=0;else{if(t>=e)break;x=0}for(F=x;F<h&&!(t>=e);F++){var H=m[t+C];G=j[F],s+=G[(-16777216&H)>>>24],p+=G[(16711680&H)>>16],q+=G[(65280&H)>>8],r+=G[255&H],o+=i[F],t++}u=C+D,y[u]=s/o,z[u]=p/o,A[u]=q/o,B[u]=r/o}C+=e}for(C=0,v=-g,w=v*e,E=0;E<k;E++){for(D=0;D<e;D++){if(r=q=p=s=o=0,v<0)x=u=-v,t=D;else{if(v>=k)break;x=0,u=v,t=D+w}for(F=x;F<h&&!(u>=k);F++)G=j[F],s+=G[y[t]],p+=G[z[t]],q+=G[A[t]],r+=G[B[t]],o+=i[F],u++,t+=e;m[D+C]=s/o<<24|p/o<<16|q/o<<8|r/o}C+=e,w+=e,v++}f._setPixels(c,m)}var f={};f._toPixels=function(a){return a instanceof ImageData?a.data:a.getContext("2d").getImageData(0,0,a.width,a.height).data},f._getARGB=function(a,b){var c=4*b;return a[c+3]<<24&4278190080|a[c]<<16&16711680|a[c+1]<<8&65280|255&a[c+2]},f._setPixels=function(a,b){for(var c=0,d=0,e=a.length;d<e;d++)c=4*d,a[c+0]=(16711680&b[d])>>>16,a[c+1]=(65280&b[d])>>>8,a[c+2]=255&b[d],a[c+3]=(4278190080&b[d])>>>24},f._toImageData=function(a){return a instanceof ImageData?a:a.getContext("2d").getImageData(0,0,a.width,a.height)},f._createImageData=function(a,b){return f._tmpCanvas=documen
;if((h=+h)===1/0||h===-1/0)return 1/0;h=Math.abs(h),h>f&&(f=h),e[g]=h}0===f&&(f=1);for(var i=0,j=0,k=0;k<d;k++){var l=e[k]/f,m=l*l-j,n=i+m;j=n-i-m,i=n}return Math.sqrt(i)*f}var e=a("../core/main");e.prototype.abs=Math.abs,e.prototype.ceil=Math.ceil,e.prototype.constrain=function(a,b,c){return e._validateParameters("constrain",arguments),Math.max(Math.min(a,c),b)},e.prototype.dist=function(){return e._validateParameters("dist",arguments),4===arguments.length?d(arguments[2]-arguments[0],arguments[3]-arguments[1]):6===arguments.length?d(arguments[3]-arguments[0],arguments[4]-arguments[1],arguments[5]-arguments[2]):void 0},e.prototype.exp=Math.exp,e.prototype.floor=Math.floor,e.prototype.lerp=function(a,b,c){return e._validateParameters("lerp",arguments),c*(b-a)+a},e.prototype.log=Math.log,e.prototype.mag=function(a,b){return e._validateParameters("mag",arguments),d(a,b)},e.prototype.map=function(a,b,c,d,f,g){e._validateParameters("map",arguments);var h=(a-b)/(c-b)*(f-d)+d;return g?d<f?this.constrain(h,d,f):this.constrain(h,f,d):h},e.prototype.max=function(){return e._validateParameters("max",arguments),arguments[0]instanceof Array?Math.max.apply(null,arguments[0]):Math.max.apply(null,arguments)},e.prototype.min=function(){return e._validateParameters("min",arguments),arguments[0]instanceof Array?Math.min.apply(null,arguments[0]):Math.min.apply(null,arguments)},e.prototype.norm=function(a,b,c){return e._validateParameters("norm",arguments),this.map(a,b,c,0,1)},e.prototype.pow=Math.pow,e.prototype.round=Math.round,e.prototype.sq=function(a){return a*a},e.prototype.sqrt=Math.sqrt,b.exports=e},{"../core/main":24}],52:[function(a,b,c){"use strict";var d=a("../core/main");d.prototype.createVector=function(a,b,c){return this instanceof d?new d.Vector(this,arguments):new d.Vector(a,b,c)},b.exports=d},{"../core/main":24}],53:[function(a,b,c){"use strict";var d,e=a("../core/main"),f=4,g=1<<f,h=8,i=1<<h,j=4095,k=4,l=.5,m=function(a){return.5*(1-Math.cos(a*Math.PI))};e.prototype.noise=function(a,b,c){if(b=b||0,c=c||0,null==d){d=new Array(j+1);for(var e=0;e<j+1;e++)d[e]=Math.random()}a<0&&(a=-a),b<0&&(b=-b),c<0&&(c=-c);for(var n,o,p,q,r,s=Math.floor(a),t=Math.floor(b),u=Math.floor(c),v=a-s,w=b-t,x=c-u,y=0,z=.5,A=0;A<k;A++){var B=s+(t<<f)+(u<<h);n=m(v),o=m(w),p=d[B&j],p+=n*(d[B+1&j]-p),q=d[B+g&j],q+=n*(d[B+g+1&j]-q),p+=o*(q-p),B+=i,q=d[B&j],q+=n*(d[B+1&j]-q),r=d[B+g&j],r+=n*(d[B+g+1&j]-r),q+=o*(r-q),p+=m(x)*(q-p),y+=p*z,z*=l,s<<=1,v*=2,t<<=1,w*=2,u<<=1,x*=2,v>=1&&(s++,v--),w>=1&&(t++,w--),x>=1&&(u++,x--)}return y},e.prototype.noiseDetail=function(a,b){a>0&&(k=a),b>0&&(l=b)},e.prototype.noiseSeed=function(a){var b=function(){var a,b,c=4294967296,d=1664525,e=1013904223;return{setSeed:function(d){b=a=(null==d?Math.random()*c:d)>>>0},getSeed:function(){return a},rand:function(){return(b=(d*b+e)%c)/c}}}();b.setSeed(a),d=new Array(j+1);for(var c=0;c<j+1;c++)d[c]=b.rand()},b.exports=e},{"../core/main":24}],54:[function(a,b,c){"use strict";var d=a("../core/main"),e=a("../core/constants");d.Vector=function(){var a,b,c;arguments[0]instanceof d?(this.p5=arguments[0],a=arguments[1][0]||0,b=arguments[1][1]||0,c=arguments[1][2]||0):(a=arguments[0]||0,b=arguments[1]||0,c=arguments[2]||0),this.x=a,this.y=b,this.z=c},d.Vector.prototype.toString=function(){return"p5.Vector Object : ["+this.x+", "+this.y+", "+this.z+"]"},d.Vector.prototype.set=function(a,b,c){return a instanceof d.Vector?(this.x=a.x||0,this.y=a.y||0,this.z=a.z||0,this):a instanceof Array?(this.x=a[0]||0,this.y=a[1]||0,this.z=a[2]||0,this):(this.x=a||0,this.y=b||0,this.z=c||0,this)},d.Vector.prototype.copy=function(){return this.p5?new d.Vector(this.p5,[this.x,this.y,this.z]):new d.Vector(this.x,this.y,this.z)},d.Vector.prototype.add=function(a,b,c){return a instanceof d.Vector?(this.x+=a.x||0,this.y+=a.y||0,this.z+=a.z||0,this):a instanceof Array?(this.x+=a[0]||0,this.y+=a[1]||0,this.z+=a[2]||0,this):(this.x+=a||0,this.y+=b||0,this.z+=c||0,this)},d.Vector.prototype.sub=function(a,b,c){return a instanceof d.Vector?(this.x-=a.x||0,this.y-=a.y||0,this.z-=a.z||0,this):a instanceof Array?(this
void 0===g&&(g=!0);var i="cylinder|"+c+"|"+e+"|"+g+"|"+h;if(!this._renderer.geometryInHash(i)){var j=new d.Geometry(c,e);f.call(j,1,1,1,c,e,g,h),j.computeNormals(),c<=24&&e<=16?j._makeTriangleEdges()._edgesToVertices():console.log("Cannot draw stroke on cylinder objects with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(i,j)}return this._renderer.drawBuffersScaled(i,a,b,a),this},d.prototype.cone=function(a,b,c,e,g){this._assert3d("cone"),d._validateParameters("cone",arguments),void 0===a&&(a=50),void 0===b&&(b=a),void 0===c&&(c=24),void 0===e&&(e=1),void 0===g&&(g=!0);var h="cone|"+c+"|"+e+"|"+g;if(!this._renderer.geometryInHash(h)){var i=new d.Geometry(c,e);f.call(i,1,0,1,c,e,g,!1),i.computeNormals(),c<=24&&e<=16?i._makeTriangleEdges()._edgesToVertices():console.log("Cannot draw stroke on cone objects with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(h,i)}return this._renderer.drawBuffersScaled(h,a,b,a),this},d.prototype.ellipsoid=function(a,b,c,e,f){this._assert3d("ellipsoid"),d._validateParameters("ellipsoid",arguments),void 0===a&&(a=50),void 0===b&&(b=a),void 0===c&&(c=a),void 0===e&&(e=24),void 0===f&&(f=16);var g="ellipsoid|"+e+"|"+f;if(!this._renderer.geometryInHash(g)){var h=function(){for(var a=0;a<=this.detailY;a++)for(var b=a/this.detailY,c=Math.PI*b-Math.PI/2,e=Math.cos(c),f=Math.sin(c),g=0;g<=this.detailX;g++){var h=g/this.detailX,i=2*Math.PI*h,j=Math.cos(i),k=Math.sin(i),l=new d.Vector(e*k,f,e*j);this.vertices.push(l),this.vertexNormals.push(l),this.uvs.push(h,b)}},i=new d.Geometry(e,f,h);i.computeFaces(),e<=24&&f<=24?i._makeTriangleEdges()._edgesToVertices():console.log("Cannot draw stroke on ellipsoids with more than 24 detailX or 24 detailY"),this._renderer.createBuffers(g,i)}return this._renderer.drawBuffersScaled(g,a,b,c),this},d.prototype.torus=function(a,b,c,e){if(this._assert3d("torus"),d._validateParameters("torus",arguments),void 0===a)a=50;else if(!a)return;if(void 0===b)b=10;else if(!b)return;void 0===c&&(c=24),void 0===e&&(e=16);var f=(b/a).toPrecision(4),g="torus|"+f+"|"+c+"|"+e;if(!this._renderer.geometryInHash(g)){var h=function(){for(var a=0;a<=this.detailY;a++)for(var b=a/this.detailY,c=2*Math.PI*b,e=Math.cos(c),g=Math.sin(c),h=1+f*e,i=0;i<=this.detailX;i++){var j=i/this.detailX,k=2*Math.PI*j,l=Math.cos(k),m=Math.sin(k),n=new d.Vector(h*l,h*m,f*g),o=new d.Vector(e*l,e*m,g);this.vertices.push(n),this.vertexNormals.push(o),this.uvs.push(j,b)}},i=new d.Geometry(c,e,h);i.computeFaces(),c<=24&&e<=16?i._makeTriangleEdges()._edgesToVertices():console.log("Cannot draw strokes on torus object with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(g,i)}return this._renderer.drawBuffersScaled(g,a,a,a),this},d.RendererGL.prototype.point=function(a,b,c){this._usePointShader(),this.curPointShader.bindShader(),void 0===c&&(c=0);var e=[];return e.push(new d.Vector(a,b,c)),this._drawPoints(e,this._pointVertexBuffer),this.curPointShader.unbindShader(),this},d.RendererGL.prototype.triangle=function(a){var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],i="tri";if(!this.geometryInHash(i)){var j=function(){var a=[];a.push(new d.Vector(0,0,0)),a.push(new d.Vector(0,1,0)),a.push(new d.Vector(1,0,0)),this.strokeIndices=[[0,1],[1,2],[2,0]],this.vertices=a,this.faces=[[0,1,2]],this.uvs=[0,0,0,1,1,1]},k=new d.Geometry(1,1,j);k._makeTriangleEdges()._edgesToVertices(),k.computeNormals(),this.createBuffers(i,k)}var l=this.uMVMatrix.copy();try{var m=new d.Matrix([e-b,f-c,0,0,g-b,h-c,0,0,0,0,1,0,b,c,0,1]).mult(this.uMVMatrix);this.uMVMatrix=m,this.drawBuffers(i)}finally{this.uMVMatrix=l}return this},d.RendererGL.prototype.ellipse=function(a){this.arc(a[0],a[1],a[2],a[3],0,e.TWO_PI,e.OPEN,a[4])},d.RendererGL.prototype.arc=function(a){var b,c,f=arguments[0],g=arguments[1],h=arguments[2],i=arguments[3],j=arguments[4],k=arguments[5],l=arguments[6],m=arguments[7]||25;if(Math.abs(k-j)>=e.TWO_PI?(b="ellipse",c=b+"|"+m+"|"):(b="arc",c=b+"|"+j+"|"+k+"|"+l+"|"+m+"|"),!this.geometryInHash(c)){var n=function(){if(this.strokeIndices=[],j.toFixed(10)!==k.toFixed(10)){l!==e.PIE&&void
this.defaultAspectRatio=this._renderer.width/this._renderer.height,this.defaultEyeX=0,this.defaultEyeY=0,this.defaultEyeZ=this._renderer.height/2/Math.tan(this.defaultCameraFOV/2),this.defaultCenterX=0,this.defaultCenterY=0,this.defaultCenterZ=0,this.defaultCameraNear=.1*this.defaultEyeZ,this.defaultCameraFar=10*this.defaultEyeZ},d.Camera.prototype._setDefaultCamera=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"},d.Camera.prototype._resize=function(){"default"===this.cameraType?(this._computeCameraDefaultSettings(),this._setDefaultCamera()):this.perspective(this.cameraFOV,this._renderer.width/this._renderer.height)},d.Camera.prototype.copy=function(){var a=new d.Camera(this._renderer);return a.cameraFOV=this.cameraFOV,a.aspectRatio=this.aspectRatio,a.eyeX=this.eyeX,a.eyeY=this.eyeY,a.eyeZ=this.eyeZ,a.centerX=this.centerX,a.centerY=this.centerY,a.centerZ=this.centerZ,a.cameraNear=this.cameraNear,a.cameraFar=this.cameraFar,a.cameraType=this.cameraType,a.cameraMatrix=this.cameraMatrix.copy(),a.projMatrix=this.projMatrix.copy(),a},d.Camera.prototype._getLocalAxes=function(){var a=this.eyeX-this.centerX,b=this.eyeY-this.centerY,c=this.eyeZ-this.centerZ,d=Math.sqrt(a*a+b*b+c*c);0!==d&&(a/=d,b/=d,c/=d);var e=this.upX,f=this.upY,g=this.upZ,h=f*c-g*b,i=-e*c+g*a,j=e*b-f*a;e=b*j-c*i,f=-a*j+c*h,g=a*i-b*h;var k=Math.sqrt(h*h+i*i+j*j);0!==k&&(h/=k,i/=k,j/=k);var l=Math.sqrt(e*e+f*f+g*g);return 0!==l&&(e/=l,f/=l,g/=l),{x:[h,i,j],y:[e,f,g],z:[a,b,c]}},d.Camera.prototype._orbit=function(a,b,c){var d=this.eyeX-this.centerX,e=this.eyeY-this.centerY,f=this.eyeZ-this.centerZ,g=Math.sqrt(d*d+e*e+f*f),h=Math.atan2(d,f),i=Math.acos(Math.max(-1,Math.min(1,e/g)));h+=a,i+=b,g+=c,g<0&&(g=.1),i>Math.PI?i=Math.PI:i<=0&&(i=.001);var j=Math.sin(i)*g*Math.sin(h),k=Math.cos(i)*g,l=Math.sin(i)*g*Math.cos(h);this.camera(j+this.centerX,k+this.centerY,l+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},d.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},d.prototype.setCamera=function(a){this._renderer._curCamera=a,this._renderer.uPMatrix.set(a.projMatrix.mat4[0],a.projMatrix.mat4[1],a.projMatrix.mat4[2],a.projMatrix.mat4[3],a.projMatrix.mat4[4],a.projMatrix.mat4[5],a.projMatrix.mat4[6],a.projMatrix.mat4[7],a.projMatrix.mat4[8],a.projMatrix.mat4[9],a.projMatrix.mat4[10],a.projMatrix.mat4[11],a.projMatrix.mat4[12],a.projMatrix.mat4[13],a.projMatrix.mat4[14],a.projMatrix.mat4[15])},b.exports=d.Camera},{"../core/main":24}],70:[function(a,b,c){"use strict";var d=a("../core/main");d.Geometry=function(a,b,c){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.detailX=void 0!==a?a:1,this.detailY=void 0!==b?b:1,c instanceof Function&&c.call(this),this},d.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var a,b,c,d,e=this.detailX+1,f=0;f<this.detailY;f++)for(var g=0;g<this.detailX;g++)a=f*e+g,b=f*e+g+1,c=(f+1)*e+g+1,d=(f+1)*e+g,this.faces.push([a,b,d]),this.faces.push([d,b,c]);return this},d.Geometry.prototype._getFaceNormal=function(a){var b=this.faces[a],c=this.vertices[b[0]],e=this.vertices[b[1]],f=this.vertices[b[2]],g=d.Vector.sub(e,c),h=d.Vector.sub(f,c),i=d.Vector.cross(g,h),j=d.Vector.mag(i),k=j/(d.Vector.mag(g)*d.Vector.mag(h));return 0===k||isNaN(k)?(console.warn("p5.Geometry.prototype._getFaceNormal:","face has colinear sides or a repeated vertex"),i):(k>1&&(k=1),i.mult(Math.asin(k)/j))},d.Geometry.prototype.computeNormals=function(){var a,b=this.vertexNormals,c=this.vertices,e=this.faces;for(b.length=0,a=0;a<c.length;++a)b.push(new d.Vector);for(var f=0;f<e.length;++f)for(var g=e[f],h=this._getFaceNormal(f),i=0;i<3;++i){var j=g[i];b[j].ad
phongFrag:"precision mediump float;\n\n//uniform mat4 uModelViewMatrix;\nuniform mat4 uViewMatrix;\n\nuniform vec4 uMaterialColor;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uUseLighting;\n\nuniform vec3 uLightingDirection[8];\nuniform vec3 uDirectionalColor[8];\nuniform vec3 uPointLightLocation[8];\nuniform vec3 uPointLightColor[8];\nuniform bool uSpecular;\n\nuniform int uDirectionalLightCount;\nuniform int uPointLightCount;\n\nvarying vec3 vNormal;\nvarying vec2 vTexCoord;\nvarying vec3 vViewPosition;\nvarying vec3 vAmbientColor;\n\nvec3 V;\nvec3 N;\n\nconst float shininess = 32.0;\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n\tfloat specular;\n\tfloat diffuse;\n};\n\nfloat phongSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float shininess) {\n\n vec3 R = normalize(reflect(-lightDirection, surfaceNormal)); \n return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat lambertDiffuse(\n vec3 lightDirection,\n vec3 surfaceNormal) {\n return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult light(vec3 lightVector) {\n\n vec3 L = normalize(lightVector);\n\n //compute our diffuse & specular terms\n LightResult lr;\n if (uSpecular)\n lr.specular = phongSpecular(L, V, N, shininess);\n lr.diffuse = lambertDiffuse(L, N);\n return lr;\n}\n\nvoid main(void) {\n\n V = normalize(vViewPosition);\n N = vNormal;\n\n vec3 diffuse = vec3(0.0);\n float specular = 0.0;\n\n for (int j = 0; j < 8; j++) {\n if (uDirectionalLightCount == j) break;\n\n LightResult result = light(uLightingDirection[j]);\n diffuse += result.diffuse * uDirectionalColor[j];\n specular += result.specular;\n }\n\n for (int k = 0; k < 8; k++) {\n if (uPointLightCount == k) break;\n\n vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[k], 1.0)).xyz;\n vec3 lightVector = vViewPosition - lightPosition;\n\t\n //calculate attenuation\n float lightDistance = length(lightVector);\n float falloff = 500.0 / (lightDistance + 500.0);\n\n LightResult result = light(lightVector);\n diffuse += result.diffuse * falloff * uPointLightColor[k];\n specular += result.specular * falloff;\n }\n\n gl_FragColor = isTexture ? texture2D(uSampler, vTexCoord) : uMaterialColor;\n gl_FragColor.rgb = gl_FragColor.rgb * (diffuse * diffuseFactor + vAmbientColor) + specular * specularFactor;\n}",fontVert:"precision mediump float;\n\nattribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nvarying vec2 vTexCoord;\nvarying 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 // 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 gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vTexCoord = aTexCoord;\n w = gl_Position.w;\n}\n",fontFrag:"#extension GL_OES_standard_derivatives : enable\nprecision mediump float;\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 mediump 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\nvarying vec2 vTexCoord;\n\n// some helper
c.size>1?b.length&&e.uniform3fv(d,b):e.uniform3f(d,b[0],b[1],b[2]);break;case e.FLOAT_VEC4:c.size>1?b.length&&e.uniform4fv(d,b):e.uniform4f(d,b[0],b[1],b[2],b[3]);break;case e.INT_VEC2:c.size>1?b.length&&e.uniform2iv(d,b):e.uniform2i(d,b[0],b[1]);break;case e.INT_VEC3:c.size>1?b.length&&e.uniform3iv(d,b):e.uniform3i(d,b[0],b[1],b[2]);break;case e.INT_VEC4:c.size>1?b.length&&e.uniform4iv(d,b):e.uniform4i(d,b[0],b[1],b[2],b[3]);break;case e.SAMPLER_2D:e.activeTexture(e.TEXTURE0+c.samplerIndex),c.texture=this._renderer.getTexture(b),e.uniform1i(c.location,c.samplerIndex)}return this}},d.Shader.prototype.isLightShader=function(){return void 0!==this.uniforms.uUseLighting||void 0!==this.uniforms.uAmbientLightCount||void 0!==this.uniforms.uDirectionalLightCount||void 0!==this.uniforms.uPointLightCount||void 0!==this.uniforms.uAmbientColor||void 0!==this.uniforms.uDirectionalColor||void 0!==this.uniforms.uPointLightLocation||void 0!==this.uniforms.uPointLightColor||void 0!==this.uniforms.uLightingDirection||void 0!==this.uniforms.uSpecular},d.Shader.prototype.isTextureShader=function(){return this.samplerIndex>0},d.Shader.prototype.isColorShader=function(){return void 0!==this.attributes.aVertexColor||void 0!==this.uniforms.uMaterialColor},d.Shader.prototype.isTexLightShader=function(){return this.isLightShader()&&this.isTextureShader()},d.Shader.prototype.isStrokeShader=function(){return void 0!==this.uniforms.uStrokeWeight},d.Shader.prototype.enableAttrib=function(a,b,c,d,e,f){var g=this._renderer.GL;return-1!==a&&(g.enableVertexAttribArray(a),g.vertexAttribPointer(a,b,c,d,e,f)),this},b.exports=d.Shader},{"../core/main":24}],76:[function(a,b,c){"use strict";var d=a("../core/main"),e=a("../core/constants");d.Texture=function(a,b){this._renderer=a;var c=this._renderer.GL;this.src=b,this.glTex=void 0,this.glTarget=c.TEXTURE_2D,this.glFormat=c.RGBA,this.mipmaps=!1,this.glMinFilter=c.LINEAR,this.glMagFilter=c.LINEAR,this.glWrapS=c.CLAMP_TO_EDGE,this.glWrapT=c.CLAMP_TO_EDGE,this.isSrcMediaElement=void 0!==d.MediaElement&&b instanceof d.MediaElement,this._videoPrevUpdateTime=0,this.isSrcHTMLElement=void 0!==d.Element&&b instanceof d.Element&&!(b instanceof d.Graphics),this.isSrcP5Image=b instanceof d.Image,this.isSrcP5Graphics=b instanceof d.Graphics,this.isImageData="undefined"!=typeof ImageData&&b instanceof ImageData;var e=this._getTextureDataFromSource();return this.width=e.width,this.height=e.height,this.init(e),this},d.Texture.prototype._getTextureDataFromSource=function(){var a;return this.isSrcP5Image?a=this.src.canvas:this.isSrcMediaElement||this.isSrcP5Graphics||this.isSrcHTMLElement?a=this.src.elt:this.isImageData&&(a=this.src),a},d.Texture.prototype.init=function(a){var b=this._renderer.GL;if(this.glTex=b.createTexture(),this.bindTexture(),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,this.glMagFilter),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,this.glMinFilter),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,this.glWrapS),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,this.glWrapT),0===this.width||0===this.height||this.isSrcMediaElement&&!this.src.loadedmetadata){var c=new Uint8Array([1,1,1,1]);b.texImage2D(this.glTarget,0,b.RGBA,1,1,0,this.glFormat,b.UNSIGNED_BYTE,c)}else b.texImage2D(this.glTarget,0,this.glFormat,this.glFormat,b.UNSIGNED_BYTE,a)},d.Texture.prototype.update=function(){var a=this.src;if(0===a.width||0===a.height)return!1;var b=this._getTextureDataFromSource(),c=!1,d=this._renderer.GL;return b.width!==this.width||b.height!==this.height?(c=!0,this.width=b.width,this.height=b.height,this.isSrcP5Image?a.setModified(!1):(this.isSrcMediaElement||this.isSrcHTMLElement)&&a.setModified(!0)):this.isSrcP5Image?a.isModified()&&(c=!0,a.setModified(!1)):this.isSrcMediaElement?a.isModified()?(c=!0,a.setModified(!1)):a.loadedmetadata&&this._videoPrevUpdateTime!==a.time()&&(this._videoPrevUpdateTime=a.time(),c=!0):this.isImageData?a._dirty&&(a._dirty=!1,c=!0):c=!0,c&&(this.bindTexture(),d.texImage2D(this.glTarget,0,this.glFormat,this.glFormat,d.UNSIGNED_BYTE,b)),c},d.Texture.prototype.bindTexture=function(){ret