2017-2018/ISN/P5js/template/p5.js

13 lines
390 KiB
JavaScript
Raw Normal View History

/*! p5.js v0.6.1 April 27, 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}func
this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function d(a,b){this.source=a,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=b,this.destLen=0,this.ltree=new c,this.dtree=new c}function f(a,b,c,d){var e,f;for(e=0;e<c;++e)a[e]=0;for(e=0;e<30-c;++e)a[e+c]=e/c|0;for(f=d,e=0;e<30;++e)b[e]=f,f+=1<<a[e]}function g(a,b){var c;for(c=0;c<7;++c)a.table[c]=0;for(a.table[7]=24,a.table[8]=152,a.table[9]=112,c=0;c<24;++c)a.trans[c]=256+c;for(c=0;c<144;++c)a.trans[24+c]=c;for(c=0;c<8;++c)a.trans[168+c]=280+c;for(c=0;c<112;++c)a.trans[176+c]=144+c;for(c=0;c<5;++c)b.table[c]=0;for(b.table[5]=32,c=0;c<32;++c)b.trans[c]=c}function h(a,b,c,d){var e,f;for(e=0;e<16;++e)a.table[e]=0;for(e=0;e<d;++e)a.table[b[c+e]]++;for(a.table[0]=0,f=0,e=0;e<16;++e)xe[e]=f,f+=a.table[e];for(e=0;e<d;++e)b[c+e]&&(a.trans[xe[b[c+e]]++]=e)}function i(a){a.bitcount--||(a.tag=a.source[a.sourceIndex++],a.bitcount=7);var b=1&a.tag;return a.tag>>>=1,b}function j(a,b,c){if(!b)return c;for(;a.bitcount<24;)a.tag|=a.source[a.sourceIndex++]<<a.bitcount,a.bitcount+=8;var d=a.tag&65535>>>16-b;return a.tag>>>=b,a.bitcount-=b,d+c}function k(a,b){for(;a.bitcount<24;)a.tag|=a.source[a.sourceIndex++]<<a.bitcount,a.bitcount+=8;var c=0,d=0,e=0,f=a.tag;do{d=2*d+(1&f),f>>>=1,++e,c+=b.table[e],d-=b.table[e]}while(d>=0);return a.tag=f,a.bitcount-=e,b.trans[c+d]}function l(a,b,c){var d,e,f,g,i,l;for(d=j(a,5,257),e=j(a,5,1),f=j(a,4,4),g=0;g<19;++g)we[g]=0;for(g=0;g<f;++g){var m=j(a,3,0);we[ue[g]]=m}for(h(ve,we,0,19),i=0;i<d+e;){var n=k(a,ve);switch(n){case 16:var o=we[i-1];for(l=j(a,2,3);l;--l)we[i++]=o;break;case 17:for(l=j(a,3,3);l;--l)we[i++]=0;break;case 18:for(l=j(a,7,11);l;--l)we[i++]=0;break;default:we[i++]=n}}h(b,we,0,d),h(c,we,d,e)}function m(a,b,c){for(;;){var d=k(a,b);if(256===d)return me;if(d<256)a.dest[a.destLen++]=d;else{var e,f,g,h;for(d-=257,e=j(a,qe[d],re[d]),f=k(a,c),g=a.destLen-j(a,se[f],te[f]),h=g;h<g+e;++h)a.dest[a.destLen++]=a.dest[h]}}}function n(a){for(var b,c,d;a.bitcount>8;)a.sourceIndex--,a.bitcount-=8;if(b=a.source[a.sourceIndex+1],b=256*b+a.source[a.sourceIndex],c=a.source[a.sourceIndex+3],c=256*c+a.source[a.sourceIndex+2],b!==(65535&~c))return ne;for(a.sourceIndex+=4,d=b;d;--d)a.dest[a.destLen++]=a.source[a.sourceIndex++];return a.bitcount=0,me}function o(a,b){var c,e,f=new d(a,b);do{switch(c=i(f),j(f,2,0)){case 0:e=n(f);break;case 1:e=m(f,oe,pe);break;case 2:l(f,f.ltree,f.dtree),e=m(f,f.ltree,f.dtree);break;default:e=ne}if(e!==me)throw new Error("Data error")}while(!c);return f.destLen<f.dest.length?"function"==typeof f.dest.slice?f.dest.slice(0,f.destLen):f.dest.subarray(0,f.destLen):f.dest}function p(a,b,c,d,e){return Math.pow(1-e,3)*a+3*Math.pow(1-e,2)*e*b+3*(1-e)*Math.pow(e,2)*c+Math.pow(e,3)*d}function q(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}function r(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}function s(a){throw new Error(a)}function t(a,b){a||s(b)}function u(a){return function(){return a}}function v(a){return a>=-128&&a<=127}function w(a,b,c){for(var d=0,e=a.length;b<e&&d<64&&0===a[b];)++b,++d;return c.push(128|d-1),b}function x(a,b,c){for(var d=0,e=a.length,f=b;f<e&&d<64;){var g=a[f];if(!v(g))break;if(0===g&&f+1<e&&0===a[f+1])break;++f,++d}c.push(d-1);for(var h=b;h<f;++h)c.push(a[h]+256&255);return f}function y(a,b,c){for(var d=0,e=a.length,f=b;f<e&&d<64;){var g=a[f];if(0===g)break;if(v(g)&&f+1<e&&v(a[f+1]))break;++f,++d}c.push(64|d-1);for(var h=b;h<f;++h){var i=a[h];c.push(i+65536>>8&255,i+256&255)}return f}function z(a,b,c){for(var d=this,e=0;e<b.length;e+=1){var f=b[e];d[f.name]=f.value}if(this.tableName=a,this.fields=b,c)for(var g=Object.keys(c),h=0;h<g.length;h+=1){var i=g[h],j=c[i];void 0!==d[i]&&(d[i]=j)}}function A(a,b,c){void 0===c&&(c=b.length);var d=new Array(b.length+1);d[0]={name:a+"Count",type:"USHORT",value:c};for(var e=0;e<b.length;e++)d[e+1]={name:a+e,type:"USHORT",value:b[e]};return d}function B(a,b,c){var d=b.length,e=new Array(d+1);e[0]={name:a+"Count",type:"USHORT",value:d};for(var f=0;f<d;f++)e[f+1]={name:a+f,type:"TABLE",value:c(b[f]
j.leftSideBearing=g}}function Za(a){for(var b=new Ke.Table("hmtx",[]),c=0;c<a.length;c+=1){var d=a.get(c),e=d.advanceWidth||0,f=d.leftSideBearing||0;b.fields.push({name:"advanceWidth_"+c,type:"USHORT",value:e}),b.fields.push({name:"leftSideBearing_"+c,type:"SHORT",value:f})}return b}function $a(a){for(var b=new Ke.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:a.length}]),c="",d=12+4*a.length,e=0;e<a.length;++e){var f=c.indexOf(a[e]);f<0&&(f=c.length,c+=a[e]),b.fields.push({name:"offset "+e,type:"USHORT",value:d+f}),b.fields.push({name:"length "+e,type:"USHORT",value:a[e].length})}return b.fields.push({name:"stringPool",type:"CHARARRAY",value:c}),b}function _a(a,b){var c=new Ne.Parser(a,b),d=c.parseULong();ze.argument(1===d,"Unsupported ltag table version."),c.skip("uLong",1);for(var e=c.parseULong(),f=[],g=0;g<e;g++){for(var h="",i=b+c.parseUShort(),j=c.parseUShort(),k=i;k<i+j;++k)h+=String.fromCharCode(a.getInt8(k));f.push(h)}return f}function ab(a,b){var c={},d=new Ne.Parser(a,b);return c.version=d.parseVersion(),c.numGlyphs=d.parseUShort(),1===c.version&&(c.maxPoints=d.parseUShort(),c.maxContours=d.parseUShort(),c.maxCompositePoints=d.parseUShort(),c.maxCompositeContours=d.parseUShort(),c.maxZones=d.parseUShort(),c.maxTwilightPoints=d.parseUShort(),c.maxStorage=d.parseUShort(),c.maxFunctionDefs=d.parseUShort(),c.maxInstructionDefs=d.parseUShort(),c.maxStackElements=d.parseUShort(),c.maxSizeOfInstructions=d.parseUShort(),c.maxComponentElements=d.parseUShort(),c.maxComponentDepth=d.parseUShort()),c}function bb(a){return new Ke.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:a}])}function cb(a,b,c){switch(a){case 0:if(65535===b)return"und";if(c)return c[b];break;case 1:return df[b];case 3:return ff[b]}}function db(a,b,c){switch(a){case 0:return gf;case 1:return jf[c]||hf[b];case 3:if(1===b||10===b)return gf}}function eb(a,b,c){for(var d={},e=new Ne.Parser(a,b),f=e.parseUShort(),g=e.parseUShort(),h=e.offset+e.parseUShort(),i=0;i<g;i++){var j=e.parseUShort(),k=e.parseUShort(),l=e.parseUShort(),m=e.parseUShort(),n=cf[m]||m,o=e.parseUShort(),p=e.parseUShort(),q=cb(j,l,c),r=db(j,k,l);if(void 0!==r&&void 0!==q){var s=void 0;if(s=r===gf?Ce.UTF16(a,h+p,o):Ce.MACSTRING(a,h+p,o,r)){var t=d[n];void 0===t&&(t=d[n]={}),t[q]=s}}}return 1===f&&e.parseUShort(),d}function fb(a){var b={};for(var c in a)b[a[c]]=parseInt(c);return b}function gb(a,b,c,d,e,f){return new Ke.Record("NameRecord",[{name:"platformID",type:"USHORT",value:a},{name:"encodingID",type:"USHORT",value:b},{name:"languageID",type:"USHORT",value:c},{name:"nameID",type:"USHORT",value:d},{name:"length",type:"USHORT",value:e},{name:"offset",type:"USHORT",value:f}])}function hb(a,b){var c=a.length,d=b.length-c+1;a:for(var e=0;e<d;e++)for(;e<d;e++){for(var f=0;f<c;f++)if(b[e+f]!==a[f])continue a;return e}return-1}function ib(a,b){var c=hb(a,b);if(c<0){c=b.length;for(var d=0,e=a.length;d<e;++d)b.push(a[d])}return c}function jb(a,b){var c,d=[],e={},f=fb(cf);for(var g in a){var h=f[g];if(void 0===h&&(h=g),c=parseInt(h),isNaN(c))throw new Error('Name table entry "'+g+'" does not exist, see nameTableNames for complete list.');e[c]=a[g],d.push(c)}for(var i=fb(df),j=fb(ff),k=[],l=[],m=0;m<d.length;m++){c=d[m];var n=e[c];for(var o in n){var p=n[o],q=1,r=i[o],s=ef[r],t=db(q,s,r),u=De.MACSTRING(p,t);void 0===u&&(q=0,r=b.indexOf(o),r<0&&(r=b.length,b.push(o)),s=4,u=De.UTF16(p));var v=ib(u,l);k.push(gb(q,s,r,c,u.length,v));var w=j[o];if(void 0!==w){var x=De.UTF16(p),y=ib(x,l);k.push(gb(3,1,w,c,x.length,y))}}}k.sort(function(a,b){return a.platformID-b.platformID||a.encodingID-b.encodingID||a.languageID-b.languageID||a.nameID-b.nameID});for(var z=new Ke.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:k.length},{name:"stringOffset",type:"USHORT",value:6+12*k.length}]),A=0;A<k.length;A++)z.fields.push({name:"record_"+A,type:"RECORD",value:k[A]});return z.fields.push({name:"strings",type:"LITERAL",value:l}),z}function kb(a){for(var b=0;
Jb(a.descender,"When creating a new Font object, descender is required."),Jb(a.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:a.familyName||" "},fontSubfamily:{en:a.styleName||" "},fullName:{en:a.fullName||a.familyName+" "+a.styleName},postScriptName:{en:a.postScriptName||a.familyName+a.styleName},designer:{en:a.designer||" "},designerURL:{en:a.designerURL||" "},manufacturer:{en:a.manufacturer||" "},manufacturerURL:{en:a.manufacturerURL||" "},license:{en:a.license||" "},licenseURL:{en:a.licenseURL||" "},version:{en:a.version||"Version 0.1"},description:{en:a.description||" "},copyright:{en:a.copyright||" "},trademark:{en:a.trademark||" "}},this.unitsPerEm=a.unitsPerEm||1e3,this.ascender=a.ascender,this.descender=a.descender,this.createdTimestamp=a.createdTimestamp,this.tables={os2:{usWeightClass:a.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:a.widthClass||this.usWidthClasses.MEDIUM,fsSelection:a.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new Ve.GlyphSet(this,a.glyphs||[]),this.encoding=new X(this),this.substitution=new Db(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new Kb(this):void 0}})}function Pd(a,b){var c=JSON.stringify(a),d=256;for(var e in b){var f=parseInt(e);if(f&&!(f<256)){if(JSON.stringify(b[e])===c)return f;d<=f&&(d=f+1)}}return b[d]=a,d}function Qd(a,b,c){var d=Pd(b.name,c);return[{name:"tag_"+a,type:"TAG",value:b.tag},{name:"minValue_"+a,type:"FIXED",value:b.minValue<<16},{name:"defaultValue_"+a,type:"FIXED",value:b.defaultValue<<16},{name:"maxValue_"+a,type:"FIXED",value:b.maxValue<<16},{name:"flags_"+a,type:"USHORT",value:0},{name:"nameID_"+a,type:"USHORT",value:d}]}function Rd(a,b,c){var d={},e=new Ne.Parser(a,b);return d.tag=e.parseTag(),d.minValue=e.parseFixed(),d.defaultValue=e.parseFixed(),d.maxValue=e.parseFixed(),e.skip("uShort",1),d.name=c[e.parseUShort()]||{},d}function Sd(a,b,c,d){for(var e=Pd(b.name,d),f=[{name:"nameID_"+a,type:"USHORT",value:e},{name:"flags_"+a,type:"USHORT",value:0}],g=0;g<c.length;++g){var h=c[g].tag;f.push({name:"axis_"+a+" "+h,type:"FIXED",value:b.coordinates[h]<<16})}return f}function Td(a,b,c,d){var e={},f=new Ne.Parser(a,b);e.name=d[f.parseUShort()]||{},f.skip("uShort",1),e.coordinates={};for(var g=0;g<c.length;++g)e.coordinates[c[g].tag]=f.parseFixed();return e}function Ud(a,b){var c=new Ke.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:a.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:a.instances.length},{name:"instanceSize",type:"USHORT",value:4+4*a.axes.length}]);c.offsetToData=c.sizeOf();for(var d=0;d<a.axes.length;d++)c.fields=c.fields.concat(Qd(d,a.axes[d],b));for(var e=0;e<a.instances.length;e++)c.fields=c.fields.concat(Sd(e,a.instances[e],a.axes,b));return c}function Vd(a,b,c){var d=new Ne.Parser(a,b),e=d.parseULong();ze.argument(65536===e,"Unsupported fvar table version.");var f=d.parseOffset16();d.skip("uShort",1);for(var g=d.parseUShort(),h=d.parseUShort(),i=d.parseUShort(),j=d.parseUShort(),k=[],l=0;l<g;l++)k.push(Rd(a,b+f+l*h,c));for(var m=[],n=b+f+g*h,o=0;o<i;o++)m.push(Td(a,n+o*j,k,c));return{axes:k,instances:m}}function Wd(a,b){for(var c=new Ne.Parser(a,b),d=c.parseUShort(),e=[],f=0;f<d;f++)e[c.parseTag()]={offset:c.parseUShort()};return e}function Xd(a,b){var c=new Ne.Parser(a,b),d=c.parseUShort(),e=c.parseUShort();if(1===d)return c.parseUShortList(e);if(2===d){for(var f=[];e--;)for(var g=c.parseUShort(),h=c.parseUShort(),i=c.parseUShort(),j=g;j<=h;j++)f[i++]=j;return f}}function Yd(a,b){var c=new Ne.Parser(a,b),d=c.parseUShort();if(1===d){var e=c.parseUShort(),f=c.parseUShort(),g=c.parseUShortList(f);return function(a){return g[a-e]||0}}if(2===d){for(var h=c.parseUShort(),i=[],j=[],k=[],l=0;l<h;l++)i[l]=c.parseUShort(),j[l]=c.parseUShort(),k[l]=c.parseUShort();return
},Pe=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmal
lookups:[]}},Db.prototype.getSingle=function(a,b,c){for(var d=this,e=[],f=this.getLookupTables(b,c,a,1),g=0;g<f.length;g++)for(var h=f[g].subtables,i=0;i<h.length;i++){var j=h[i],k=d.expandCoverage(j.coverage),l=void 0;if(1===j.substFormat){var m=j.deltaGlyphId;for(l=0;l<k.length;l++){var n=k[l];e.push({sub:n,by:n+m})}}else{var o=j.substitute;for(l=0;l<k.length;l++)e.push({sub:k[l],by:o[l]})}}return e},Db.prototype.getAlternates=function(a,b,c){for(var d=this,e=[],f=this.getLookupTables(b,c,a,3),g=0;g<f.length;g++)for(var h=f[g].subtables,i=0;i<h.length;i++)for(var j=h[i],k=d.expandCoverage(j.coverage),l=j.alternateSets,m=0;m<k.length;m++)e.push({sub:k[m],by:l[m]});return e},Db.prototype.getLigatures=function(a,b,c){for(var d=this,e=[],f=this.getLookupTables(b,c,a,4),g=0;g<f.length;g++)for(var h=f[g].subtables,i=0;i<h.length;i++)for(var j=h[i],k=d.expandCoverage(j.coverage),l=j.ligatureSets,m=0;m<k.length;m++)for(var n=k[m],o=l[m],p=0;p<o.length;p++){var q=o[p];e.push({sub:[n].concat(q.components),by:q.ligGlyph})}return e},Db.prototype.addSingle=function(a,b,c,d){var e=this.getLookupTables(c,d,a,1,!0)[0],f=Fb(e,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});ze.assert(1===f.coverage.format,"Ligature: unable to modify coverage table format "+f.coverage.format);var g=b.sub,h=this.binSearch(f.coverage.glyphs,g);h<0&&(h=-1-h,f.coverage.glyphs.splice(h,0,g),f.substitute.splice(h,0,0)),f.substitute[h]=b.by},Db.prototype.addAlternate=function(a,b,c,d){var e=this.getLookupTables(c,d,a,3,!0)[0],f=Fb(e,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});ze.assert(1===f.coverage.format,"Ligature: unable to modify coverage table format "+f.coverage.format);var g=b.sub,h=this.binSearch(f.coverage.glyphs,g);h<0&&(h=-1-h,f.coverage.glyphs.splice(h,0,g),f.alternateSets.splice(h,0,0)),f.alternateSets[h]=b.by},Db.prototype.addLigature=function(a,b,c,d){var e=this.getLookupTables(c,d,a,4,!0)[0],f=e.subtables[0];f||(f={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},e.subtables[0]=f),ze.assert(1===f.coverage.format,"Ligature: unable to modify coverage table format "+f.coverage.format);var g=b.sub[0],h=b.sub.slice(1),i={ligGlyph:b.by,components:h},j=this.binSearch(f.coverage.glyphs,g);if(j>=0){for(var k=f.ligatureSets[j],l=0;l<k.length;l++)if(Eb(k[l].components,h))return;k.push(i)}else j=-1-j,f.coverage.glyphs.splice(j,0,g),f.ligatureSets.splice(j,0,[i])},Db.prototype.getFeature=function(a,b,c){if(/ss\d\d/.test(a))return this.getSingle(a,b,c);switch(a){case"aalt":case"salt":return this.getSingle(a,b,c).concat(this.getAlternates(a,b,c));case"dlig":case"liga":case"rlig":return this.getLigatures(a,b,c)}},Db.prototype.add=function(a,b,c,d){if(/ss\d\d/.test(a))return this.addSingle(a,b,c,d);switch(a){case"aalt":case"salt":return"number"==typeof b.by?this.addSingle(a,b,c,d):this.addAlternate(a,b,c,d);case"dlig":case"liga":case"rlig":return this.addLigature(a,b,c,d)}};var uf,vf,wf,xf,yf=function(a){var b=this.srPeriod,c=this.srPhase,d=this.srThreshold,e=1;return a<0&&(a=-a,e=-1),a+=d-c,a=Math.trunc(a/b)*b,a+=c,e>0&&a<0?c:e<0&&a>0?-c:a*e},zf={x:1,y:0,axis:"x",distance:function(a,b,c,d){return(c?a.xo:a.x)-(d?b.xo:b.x)},interpolate:function(a,b,c,d){var e,f,g,h,i,j,k;return d&&d!==this?(e=d.distance(a,b,!0,!0),f=d.distance(a,c,!0,!0),i=d.distance(b,b,!1,!0),j=d.distance(c,c,!1,!0),g=Math.abs(e),h=Math.abs(f),0===(k=g+h)?void zf.setRelative(a,a,(i+j)/2,d,!0):void zf.setRelative(a,a,(i*h+j*g)/k,d,!0)):(e=a.xo-b.xo,f=a.xo-c.xo,i=b.x-b.xo,j=c.x-c.xo,g=Math.abs(e),h=Math.abs(f),0===(k=g+h)?void(a.x=a.xo+(i+j)/2):void(a.x=a.xo+(i*h+j*g)/k))},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(a,b,c,d,e){if(!d||d===this)return void(a.x=(e?b.xo:b.x)+c);var f=e?b.xo:b.x,g=e?b.yo:b.y,h=f+c*d.x,i=g+c*d.y;a.x=h+(a.y-i)/d.normalSlope},slope:0,touch:function(a){a.xTouched=!0},touched:function(a){return a.xTouched},untouch:function(a){a.xTouched=!1}},Af={x:0,y:1,axis:"y",distance:function(a,b,c,d){return(c?a.yo:a.y)-(d?b.yo:b.y)},interpolate:function(a,b,c,d){var e,f,g,h,i,j,k;return d&&d!==this?(e=d.distance(a,b,!0,!
this.hsba||(this.hsba=f._rgbaToHSBA(this._array)),this.hsla||(this.hsla=f._rgbaToHSLA(this._array));var b=this.levels,c=this._array,d=c[3];switch(a){case"#rrggbb":return"#".concat(b[0]<16?"0".concat(b[0].toString(16)):b[0].toString(16),b[1]<16?"0".concat(b[1].toString(16)):b[1].toString(16),b[2]<16?"0".concat(b[2].toString(16)):b[2].toString(16));case"#rrggbbaa":return"#".concat(b[0]<16?"0".concat(b[0].toString(16)):b[0].toString(16),b[1]<16?"0".concat(b[1].toString(16)):b[1].toString(16),b[2]<16?"0".concat(b[2].toString(16)):b[2].toString(16),b[3]<16?"0".concat(b[2].toString(16)):b[3].toString(16));case"#rgb":return"#".concat(Math.round(15*c[0]).toString(16),Math.round(15*c[1]).toString(16),Math.round(15*c[2]).toString(16));case"#rgba":return"#".concat(Math.round(15*c[0]).toString(16),Math.round(15*c[1]).toString(16),Math.round(15*c[2]).toString(16),Math.round(15*c[3]).toString(16));case"rgb":return"rgb(".concat(b[0],", ",b[1],", ",b[2],")");case"rgb%":return"rgb(".concat((100*c[0]).toPrecision(3),"%, ",(100*c[1]).toPrecision(3),"%, ",(100*c[2]).toPrecision(3),"%)");case"rgba%":return"rgba(".concat((100*c[0]).toPrecision(3),"%, ",(100*c[1]).toPrecision(3),"%, ",(100*c[2]).toPrecision(3),"%, ",(100*c[3]).toPrecision(3),"%)");case"hsb":case"hsv":return"hsb(".concat(this.hsba[0]*this.maxes[e.HSB][0],", ",this.hsba[1]*this.maxes[e.HSB][1],", ",this.hsba[2]*this.maxes[e.HSB][2],")");case"hsb%":case"hsv%":return"hsb(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%)");case"hsba":case"hsva":return"hsba(".concat(this.hsba[0]*this.maxes[e.HSB][0],", ",this.hsba[1]*this.maxes[e.HSB][1],", ",this.hsba[2]*this.maxes[e.HSB][2],", ",d,")");case"hsba%":case"hsva%":return"hsba(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%, ",(100*d).toPrecision(3),"%)");case"hsl":return"hsl(".concat(this.hsla[0]*this.maxes[e.HSL][0],", ",this.hsla[1]*this.maxes[e.HSL][1],", ",this.hsla[2]*this.maxes[e.HSL][2],")");case"hsl%":return"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%)");case"hsla":return"hsla(".concat(this.hsla[0]*this.maxes[e.HSL][0],", ",this.hsla[1]*this.maxes[e.HSL][1],", ",this.hsla[2]*this.maxes[e.HSL][2],", ",d,")");case"hsla%":return"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%, ",(100*d).toPrecision(3),"%)");case"rgba":default:return"rgba("+b[0]+","+b[1]+","+b[2]+","+d+")"}},d.Color.prototype.setRed=function(a){this._array[0]=a/this.maxes[e.RGB][0],this._calculateLevels()},d.Color.prototype.setGreen=function(a){this._array[1]=a/this.maxes[e.RGB][1],this._calculateLevels()},d.Color.prototype.setBlue=function(a){this._array[2]=a/this.maxes[e.RGB][2],this._calculateLevels()},d.Color.prototype.setAlpha=function(a){this._array[3]=a/this.maxes[this.mode][3],this._calculateLevels()},d.Color.prototype._calculateLevels=function(){this.levels=this._array.map(function(a){return Math.round(255*a)})},d.Color.prototype._getAlpha=function(){return this._array[3]*this.maxes[this.mode][3]},d.Color.prototype._storeModeAndMaxes=function(a,b){this.mode=a,this.maxes=b},d.Color.prototype._getMode=function(){return this.mode},d.Color.prototype._getMaxes=function(){return this.maxes},d.Color.prototype._getBlue=function(){return this._array[2]*this.maxes[e.RGB][2]},d.Color.prototype._getBrightness=function(){return this.hsba||(this.hsba=f._rgbaToHSBA(this._array)),this.hsba[2]*this.maxes[e.HSB][2]},d.Color.prototype._getGreen=function(){return this._array[1]*this.maxes[e.RGB][1]},d.Color.prototype._getHue=function(){return this.mode===e.HSB?(this.hsba||(this.hsba=f._rgbaToHSBA(this._array)),this.hsba[0]*this.maxes[e.HSB][0]):(this.hsla||(this.hsla=f._rgbaToHSLA(this._array)),this.hsla[0]*this.maxes[e.HSL][0])},d.Color.prototype._getLightness=function(){return this.hsla||(this.hsla=f._rgbaToHSLA(this._array)),this.hsla[2]*this.maxes[e.HSL]
return d("mousedown",a,this),d("touchstart",a,this),this},g.Element.prototype.doubleClicked=function(a){return d("dblclick",a,this),this},g.Element.prototype.mouseWheel=function(a){return d("wheel",a,this),this},g.Element.prototype.mouseReleased=function(a){return d("mouseup",a,this),d("touchend",a,this),this},g.Element.prototype.mouseClicked=function(a){return d("click",a,this),this},g.Element.prototype.mouseMoved=function(a){return d("mousemove",a,this),d("touchmove",a,this),this},g.Element.prototype.mouseOver=function(a){return d("mouseover",a,this),this},g.Element.prototype.changed=function(a){return d("change",a,this),this},g.Element.prototype.input=function(a){return d("input",a,this),this},g.Element.prototype.mouseOut=function(a){return d("mouseout",a,this),this},g.Element.prototype.touchStarted=function(a){return d("touchstart",a,this),d("mousedown",a,this),this},g.Element.prototype.touchMoved=function(a){return d("touchmove",a,this),d("mousemove",a,this),this},g.Element.prototype.touchEnded=function(a){return d("touchend",a,this),d("mouseup",a,this),this},g.Element.prototype.dragOver=function(a){return d("dragover",a,this),this},g.Element.prototype.dragLeave=function(a){return d("dragleave",a,this),this},g.Element.prototype.drop=function(a,b){function c(b){var c=new g.File(b);return function(b){c.data=b.target.result,a(c)}}return window.File&&window.FileReader&&window.FileList&&window.Blob?(e("dragover",function(a){a.stopPropagation(),a.preventDefault()},this),e("dragleave",function(a){a.stopPropagation(),a.preventDefault()},this),void 0!==b&&e("drop",b,this),e("drop",function(a){a.stopPropagation(),a.preventDefault();for(var b=a.dataTransfer.files,d=0;d<b.length;d++){var e=b[d],f=new FileReader;f.onload=c(e),e.type.indexOf("text")>-1?f.readAsText(e):f.readAsDataURL(e)}},this)):console.log("The File APIs are not fully supported in this browser."),this},g.Element.prototype._setProperty=function(a,b){this[a]=b},b.exports=g.Element},{"./core":21}],27:[function(a,b,c){"use strict";var d=a("./core"),e=a("./constants");d.Graphics=function(a,b,c,f){var g=c||e.P2D;this.canvas=document.createElement("canvas"),(f._userNode||document.body).appendChild(this.canvas),d.Element.call(this,this.canvas,f,!1);for(var h in d.prototype)this[h]||("function"==typeof d.prototype[h]?this[h]=d.prototype[h].bind(this):this[h]=d.prototype[h]);return d.prototype._initializeInstanceVariables.apply(this),this.width=a,this.height=b,this._pixelDensity=f._pixelDensity,g===e.WEBGL?this._renderer=new d.RendererGL(this.canvas,this,!1):this._renderer=new d.Renderer2D(this.canvas,this,!1),f._elements.push(this),this._renderer.resize(a,b),this._renderer._applyDefaults(),this},d.Graphics.prototype=Object.create(d.Element.prototype),d.Graphics.prototype.remove=function(){this.elt.parentNode&&this.elt.parentNode.removeChild(this.elt);var a=this._pInst._elements.indexOf(this);-1!==a&&this._pInst._elements.splice(a,1);for(var b in this._events)this.elt.removeEventListener(b,this._events[b])},b.exports=d.Graphics},{"./constants":20,"./core":21}],28:[function(a,b,c){"use strict";function d(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(void 0!==d&&null!==d)for(var e in d)d.hasOwnProperty(e)&&(a[e]=d[e])}return a}function e(a){var b=0,c=0;if(a.offsetParent)do{b+=a.offsetLeft,c+=a.offsetTop}while(a=a.offsetParent);else b+=a.offsetLeft,c+=a.offsetTop;return[b,c]}var f=a("./core"),g=a("../core/constants");f.Renderer=function(a,b,c){f.Element.call(this,a,b),this.canvas=a,this._pInst=b,c?(this._isMainCanvas=!0,this._pInst._setProperty("_curElement",this),this._pInst._setProperty("canvas",this.canvas),this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height)):(this.canvas.style.display="none",this._styles=[]),this._textSize=12,this._textLeading=15,this._textFont="sans-serif",this._textStyle=g.NORMAL,this._textAscent=null,this._textDescent=null,this._rectMode=g.CORNER,this._ellipseMode=g.CENTER,this._curveTightness=0,this._imageMode=g.CORNER,this._tint=null,this._doStroke=!0,this._doFill=!0,this._strokeSet=!1,this._
return d._validateParameters("translate",arguments),this._renderer.isP3D?this._renderer.translate(a,b,c):this._renderer.translate(a,b),this},b.exports=d},{"./core":21}],34:[function(a,b,c){"use strict";var d=a("./core"),e=a("./constants"),f=null,g=[],h=[],i=!1,j=!1,k=!1,l=!1,m=!0;d.prototype.beginContour=function(){return h=[],l=!0,this},d.prototype.beginShape=function(a){return d._validateParameters("beginShape",arguments),this._renderer.isP3D?this._renderer.beginShape.apply(this._renderer,arguments):(f=a===e.POINTS||a===e.LINES||a===e.TRIANGLES||a===e.TRIANGLE_FAN||a===e.TRIANGLE_STRIP||a===e.QUADS||a===e.QUAD_STRIP?a:null,g=[],h=[]),this},d.prototype.bezierVertex=function(a,b,c,e,f,j){if(d._validateParameters("bezierVertex",arguments),0===g.length)throw"vertex() must be used once before calling bezierVertex()";i=!0;for(var k=[],m=0;m<arguments.length;m++)k[m]=arguments[m];return k.isVert=!1,l?h.push(k):g.push(k),this},d.prototype.curveVertex=function(a,b){return d._validateParameters("curveVertex",arguments),j=!0,this.vertex(a,b),this},d.prototype.endContour=function(){var a=h[0].slice();a.isVert=h[0].isVert,a.moveTo=!1,h.push(a),m&&(g.push(g[0]),m=!1);for(var b=0;b<h.length;b++)g.push(h[b]);return this},d.prototype.endShape=function(a){if(d._validateParameters("endShape",arguments),this._renderer.isP3D)this._renderer.endShape(a,j,i,k,l,f);else{if(0===g.length)return this;if(!this._renderer._doStroke&&!this._renderer._doFill)return this;var b=a===e.CLOSE;b&&!l&&g.push(g[0]),this._renderer.endShape(a,g,j,i,k,l,f),j=!1,i=!1,k=!1,l=!1,m=!0,b&&g.pop()}return this},d.prototype.quadraticVertex=function(a,b,c,f){if(d._validateParameters("quadraticVertex",arguments),this._contourInited){var i={};return i.x=a,i.y=b,i.x3=c,i.y3=f,i.type=e.QUADRATIC,this._contourVertices.push(i),this}if(!(g.length>0))throw"vertex() must be used once before calling quadraticVertex()";k=!0;for(var j=[],m=0;m<arguments.length;m++)j[m]=arguments[m];return j.isVert=!1,l?h.push(j):g.push(j),this},d.prototype.vertex=function(a,b,c,d,e){if(this._renderer.isP3D)this._renderer.vertex.apply(this._renderer,arguments);else{var f=[];f.isVert=!0,f[0]=a,f[1]=b,f[2]=0,f[3]=0,f[4]=0,f[5]=this._renderer._getFill(),f[6]=this._renderer._getStroke(),c&&(f.moveTo=c),l?(0===h.length&&(f.moveTo=!0),h.push(f)):g.push(f)}return this},b.exports=d},{"./constants":20,"./core":21}],35:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.createStringDict=function(a,b){return d._validateParameters("createStringDict",arguments),new d.StringDict(a,b)},d.prototype.createNumberDict=function(a,b){return d._validateParameters("createNumberDict",arguments),new d.NumberDict(a,b)},d.TypedDict=function(a,b){return a instanceof Object?this.data=a:(this.data={},this.data[a]=b),this},d.TypedDict.prototype.size=function(){return Object.keys(this.data).length},d.TypedDict.prototype.hasKey=function(a){return this.data.hasOwnProperty(a)},d.TypedDict.prototype.get=function(a){if(this.data.hasOwnProperty(a))return this.data[a];console.log(a+" does not exist in this Dictionary")},d.TypedDict.prototype.set=function(a,b){this._validate(b)?this.data[a]=b:console.log("Those values dont work for this dictionary type.")},d.TypedDict.prototype._addObj=function(a){for(var b in a)this.set(b,a[b])},d.TypedDict.prototype.create=function(a,b){a instanceof Object&&void 0===b?this._addObj(a):void 0!==a?this.set(a,b):console.log("In order to create a new Dictionary entry you must pass an object or a key, value pair")},d.TypedDict.prototype.clear=function(){this.data={}},d.TypedDict.prototype.remove=function(a){if(!this.data.hasOwnProperty(a))throw a+" does not exist in this Dictionary";delete this.data[a]},d.TypedDict.prototype.print=function(){for(var a in this.data)console.log("key:"+a+" value:"+this.data[a])},d.TypedDict.prototype.saveTable=function(a){var b="";for(var c in this.data)b+=c+","+this.data[c]+"\n";var e=new Blob([b],{type:"text/csv"});d.prototype.downloadFile(e,a||"mycsv","csv")},d.TypedDict.prototype.saveJSON=function(a,b){d.prototype.saveJSON(this.data,a,b)},d.TypedDict.prototype.
a||(a=-1!==l.indexOf("json")?"json":-1!==l.indexOf("xml")?"xml":"text"),("jsonp"===a?j(l,f):fetch(d)).then(function(b){if(!b.ok)throw b;switch(a){case"json":return b.json();case"binary":return b.blob();case"arrayBuffer":return b.arrayBuffer();case"xml":return b.text().then(function(a){return e((new DOMParser).parseFromString(a,"text/xml").documentElement)});default:return b.text()}}).then(b||function(){}).catch(c||console.error)},window.URL=window.URL||window.webkitURL,i.prototype._pWriters=[],i.prototype.createWriter=function(a,b){var c;for(var d in i.prototype._pWriters)if(i.prototype._pWriters[d].name===a)return c=new i.PrintWriter(a+this.millis(),b),i.prototype._pWriters.push(c),c;return c=new i.PrintWriter(a,b),i.prototype._pWriters.push(c),c},i.PrintWriter=function(a,b){var c=this;this.name=a,this.content="",this.write=function(a){this.content+=a},this.print=function(a){this.content+=a+"\n"},this.clear=function(){this.content=""},this.close=function(){var d=[];d.push(this.content),i.prototype.writeFile(d,a,b);for(var e in i.prototype._pWriters)i.prototype._pWriters[e].name===this.name&&i.prototype._pWriters.splice(e,1);c.clear(),c={}}},i.prototype.save=function(a,b,c){var d=arguments,e=this._curElement.elt;if(0===d.length)return void i.prototype.saveCanvas(e);if(d[0]instanceof i.Renderer||d[0]instanceof i.Graphics)return void i.prototype.saveCanvas(d[0].elt,d[1],d[2]);if(1===d.length&&"string"==typeof d[0])i.prototype.saveCanvas(e,d[0]);else{switch(g(d[1],d[2])[1]){case"json":return void i.prototype.saveJSON(d[0],d[1],d[2]);case"txt":return void i.prototype.saveStrings(d[0],d[1],d[2]);default:d[0]instanceof Array?i.prototype.saveStrings(d[0],d[1],d[2]):d[0]instanceof i.Table?i.prototype.saveTable(d[0],d[1],d[2]):d[0]instanceof i.Image?i.prototype.saveCanvas(d[0].canvas,d[1]):d[0]instanceof i.SoundFile&&i.prototype.saveSound(d[0],d[1],d[2],d[3])}}},i.prototype.saveJSON=function(a,b,c){i._validateParameters("saveJSON",arguments);var d;d=c?JSON.stringify(a):JSON.stringify(a,void 0,2),this.saveStrings(d.split("\n"),b,"json")},i.prototype.saveJSONObject=i.prototype.saveJSON,i.prototype.saveJSONArray=i.prototype.saveJSON,i.prototype.saveStrings=function(a,b,c){i._validateParameters("saveStrings",arguments);for(var d=c||"txt",e=this.createWriter(b,d),f=0;f<a.length;f++)a.length,e.print(a[f]);e.close(),e.clear()},i.prototype.saveTable=function(a,b,c){i._validateParameters("saveTable",arguments);var d;d=void 0===c?b.substring(b.lastIndexOf(".")+1,b.length):c;var e=this.createWriter(b,d),g=a.columns,h=",";if("tsv"===d&&(h="\t"),"html"!==d){if("0"!==g[0]){for(var j=0;j<g.length;j++)j<g.length-1?e.write(g[j]+h):e.write(g[j]);e.write("\n")}for(var k=0;k<a.rows.length;k++){var l;for(l=0;l<a.rows[k].arr.length;l++)l<a.rows[k].arr.length-1?e.write(a.rows[k].arr[l]+h):(a.rows.length,e.write(a.rows[k].arr[l]));e.write("\n")}}else{e.print("<html>"),e.print("<head>");var m=' <meta http-equiv="content-type" content';if(m+='="text/html;charset=utf-8" />',e.print(m),e.print("</head>"),e.print("<body>"),e.print(" <table>"),"0"!==g[0]){e.print(" <tr>");for(var n=0;n<g.length;n++){var o=f(g[n]);e.print(" <td>"+o),e.print(" </td>")}e.print(" </tr>")}for(var p=0;p<a.rows.length;p++){e.print(" <tr>");for(var q=0;q<a.columns.length;q++){var r=a.rows[p].getString(q),s=f(r);e.print(" <td>"+s),e.print(" </td>")}e.print(" </tr>")}e.print(" </table>"),e.print("</body>"),e.print("</html>")}e.close(),e.clear()},i.prototype.writeFile=function(a,b,c){var d="application/octet-stream";i.prototype._isSafari()&&(d="text/plain");var e=new Blob(a,{type:d});i.prototype.downloadFile(e,b,c)},i.prototype.downloadFile=function(b,c,d){var e=g(c,d),f=e[0];if(b instanceof Blob){return void a("file-saver").saveAs(b,f)}var j=document.createElement("a");if(j.href=b,j.download=f,j.onclick=function(a){h(a),a.stopPropagation()},j.style.display="none",document.body.appendChild(j),i.prototype._isSafari()){var k="Hello, Safari user! To download this file...\n";k+="1. Go to File --\x3e Save As.\n",k+='2. Choose "Page Source" as the Format.\n
;var f=e&&e.renderer&&e.renderer._pInst||this.parent,g=f._renderer.drawingContext,h=g.textAlign||z.LEFT,i=g.textBaseline||z.BASELINE,j=x("textBounds",a,b,c,d,h,i),k=this.cache[j];if(!k){var l,m,n,o,p,q=[],r=[],s=this._scale(d);this.font.forEachGlyph(a,b,c,d,e,function(a,b,c,d){var e=a.getMetrics();q.push(b+e.xMin*s),q.push(b+e.xMax*s),r.push(c+-e.yMin*s),r.push(c+-e.yMax*s)}),l=Math.min.apply(null,q),m=Math.min.apply(null,r),n=Math.max.apply(null,q),o=Math.max.apply(null,r),k={x:l,y:m,h:o-m,w:n-l,advance:l-b},p=this._handleAlignment(f,g,a,k.x,k.y,k.w+k.advance),k.x=p.x,k.y=p.y,this.cache[x("textBounds",a,b,c,d,h,i)]=k}return k},y.Font.prototype.textToPoints=function(a,b,c,e,g){function h(b){return k[b].name&&"space"===k[b].name||a.length===k.length&&" "===a[b]||k[b].index&&3===k[b].index}var i=0,j=[],k=this._getGlyphs(a);e=e||this.parent._renderer._textSize;for(var l=0;l<k.length;l++){if(!h(l))for(var m=k[l].getPath(b,c,e),n=f(m.commands),o=0;o<n.length;o++)for(var p=d(n[o],g),q=0;q<p.length;q++)p[q].x+=i,j.push(p[q]);i+=k[l].advanceWidth*this._scale(e)}return j},y.Font.prototype._getGlyphs=function(a){return this.font.stringToGlyphs(a)},y.Font.prototype._getPath=function(a,b,c,d){var e=d&&d.renderer&&d.renderer._pInst||this.parent,f=e._renderer.drawingContext,g=this._handleAlignment(e,f,a,b,c);return this.font.getPath(a,g.x,g.y,e._renderer._textSize,d)},y.Font.prototype._getPathData=function(a,b,c,d){var e=3;return"string"==typeof a&&arguments.length>2?a=this._getPath(a,b,c,d):"object"==typeof b&&(d=b),d&&"number"==typeof d.decimals&&(e=d.decimals),a.toPathData(e)},y.Font.prototype._getSVG=function(a,b,c,d){var e=3;return"string"==typeof a&&arguments.length>2?a=this._getPath(a,b,c,d):"object"==typeof b&&(d=b),d&&("number"==typeof d.decimals&&(e=d.decimals),"number"==typeof d.strokeWidth&&(a.strokeWidth=d.strokeWidth),void 0!==d.fill&&(a.fill=d.fill),void 0!==d.stroke&&(a.stroke=d.stroke)),a.toSVG(e)},y.Font.prototype._renderPath=function(a,b,c,d){var e,f=d&&d.renderer||this.parent._renderer,g=f.drawingContext;e="object"==typeof a&&a.commands?a.commands:this._getPath(a,b,c,d).commands,g.beginPath();for(var h=0;h<e.length;h+=1){var i=e[h];"M"===i.type?g.moveTo(i.x,i.y):"L"===i.type?g.lineTo(i.x,i.y):"C"===i.type?g.bezierCurveTo(i.x1,i.y1,i.x2,i.y2,i.x,i.y):"Q"===i.type?g.quadraticCurveTo(i.x1,i.y1,i.x,i.y):"Z"===i.type&&g.closePath()}return f._doStroke&&f._strokeSet&&g.stroke(),f._doFill&&(f._fillSet||f._setFill(z._DEFAULT_TEXT_FILL),g.fill()),this},y.Font.prototype._textWidth=function(a,b){return this.font.getAdvanceWidth(a,b)},y.Font.prototype._textAscent=function(a){return this.font.ascender*this._scale(a)},y.Font.prototype._textDescent=function(a){return-this.font.descender*this._scale(a)},y.Font.prototype._scale=function(a){return 1/this.font.unitsPerEm*(a||this.parent._renderer._textSize)},y.Font.prototype._handleAlignment=function(a,b,c,d,e,f){var g=a._renderer._textSize,h=this._textAscent(g),i=this._textDescent(g);return f=void 0!==f?f:this._textWidth(c,g),b.textAlign===z.CENTER?d-=f/2:b.textAlign===z.RIGHT&&(d-=f),b.textBaseline===z.TOP?e+=h:b.textBaseline===z._CTX_MIDDLE?e+=h/2:b.textBaseline===z.BOTTOM&&(e-=i),{x:d,y:e}},b.exports=y},{"../core/constants":20,"../core/core":21}],58:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.append=function(a,b){return a.push(b),a},d.prototype.arrayCopy=function(a,b,c,d,e){var f,g;void 0!==e?(g=Math.min(e,a.length),f=d,a=a.slice(b,g+b)):(void 0!==c?(g=c,g=Math.min(g,a.length)):g=a.length,f=0,c=b,a=a.slice(0,g)),Array.prototype.splice.apply(c,[f,g].concat(a))},d.prototype.concat=function(a,b){return a.concat(b)},d.prototype.reverse=function(a){return a.reverse()},d.prototype.shorten=function(a){return a.pop(),a},d.prototype.shuffle=function(a,b){var c=ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(a);a=b||c?a:a.slice();for(var d,e,f=a.length;f>1;)d=Math.random()*f|0,e=a[--f],a[f]=a[d],a[d]=e;return a},d.prototype.sort=function(a,b){var c=b?a.slice(0,Math.min(b,a.length)):a,d=b?a.slice(Math.min(b,a.length)):[];return c="string"==typeof c[0]?c.sort():c.so
d.RendererGL.prototype.vertex=function(a,b){var c,e,f;c=e=f=0,3===arguments.length?c=arguments[2]:4===arguments.length?(e=arguments[2],f=arguments[3]):5===arguments.length&&(c=arguments[2],e=arguments[3],f=arguments[4]);var g=new d.Vector(a,b,c);this.immediateMode.vertices.push(g);var h=this.curFillColor||[.5,.5,.5,1];return this.immediateMode.vertexColors.push(h[0],h[1],h[2],h[3]),this.immediateMode.uvCoords.push(e,f),this},d.RendererGL.prototype.endShape=function(a,b,c,f,g,h){if(this._useImmediateModeShader(),this._doStroke&&this.drawMode!==e.TEXTURE){for(var i=0;i<this.immediateMode.vertices.length-1;i++)this.immediateMode.edges.push([i,i+1]);a===e.CLOSE&&this.immediateMode.edges.push([this.immediateMode.vertices.length-1,0]),d.Geometry.prototype._edgesToVertices.call(this.immediateMode),this._drawStrokeImmediateMode()}return this._doFill&&this._drawFillImmediateMode(a,b,c,f,g,h),this.immediateMode.vertices.length=0,this.immediateMode.vertexColors.length=0,this.immediateMode.uvCoords.length=0,this.isImmediateDrawing=!1,this},d.RendererGL.prototype._drawFillImmediateMode=function(a,b,c,d,f,g){var h=this.GL;if(this.curFillShader.bindShader(),this.curFillShader.attributes.aPosition&&(this._bindBuffer(this.immediateMode.vertexBuffer,h.ARRAY_BUFFER,this._vToNArray(this.immediateMode.vertices),Float32Array,h.DYNAMIC_DRAW),this.curFillShader.enableAttrib(this.curFillShader.attributes.aPosition.location,3,h.FLOAT,!1,0,0)),this.drawMode===e.FILL&&this.curFillShader.attributes.aVertexColor&&(this._bindBuffer(this.immediateMode.colorBuffer,h.ARRAY_BUFFER,this.immediateMode.vertexColors,Float32Array,h.DYNAMIC_DRAW),this.curFillShader.enableAttrib(this.curFillShader.attributes.aVertexColor.location,4,h.FLOAT,!1,0,0)),this.drawMode===e.TEXTURE&&this.curFillShader.attributes.aTexCoord&&(this._bindBuffer(this.immediateMode.uvBuffer,h.ARRAY_BUFFER,this.immediateMode.uvCoords,Float32Array,h.DYNAMIC_DRAW),this.curFillShader.enableAttrib(this.curFillShader.attributes.aTexCoord.location,2,h.FLOAT,!1,0,0)),this.drawMode===e.FILL||this.drawMode===e.TEXTURE)switch(this.immediateMode.shapeMode){case e.LINE_STRIP:case e.LINES:case e.TRIANGLES:this.immediateMode.shapeMode=e.TRIANGLE_FAN}else switch(this.immediateMode.shapeMode){case e.LINE_STRIP:case e.LINES:this.immediateMode.shapeMode=e.LINE_LOOP}if(this.immediateMode.shapeMode===e.QUADS||this.immediateMode.shapeMode===e.QUAD_STRIP)throw new Error("sorry, "+this.immediateMode.shapeMode+" not yet implemented in webgl mode.");this._applyColorBlend(this.curFillColor),h.enable(h.BLEND),h.drawArrays(this.immediateMode.shapeMode,0,this.immediateMode.vertices.length),this.curFillShader.unbindShader()},d.RendererGL.prototype._drawStrokeImmediateMode=function(){var a=this.GL;this.curStrokeShader.bindShader(),this.curStrokeShader.attributes.aPosition&&(this._bindBuffer(this.immediateMode.lineVertexBuffer,a.ARRAY_BUFFER,this._flatten(this.immediateMode.lineVertices),Float32Array,a.STATIC_DRAW),this.curStrokeShader.enableAttrib(this.curStrokeShader.attributes.aPosition.location,3,a.FLOAT,!1,0,0)),this.curStrokeShader.attributes.aDirection&&(this._bindBuffer(this.immediateMode.lineNormalBuffer,a.ARRAY_BUFFER,this._flatten(this.immediateMode.lineNormals),Float32Array,a.STATIC_DRAW),this.curStrokeShader.enableAttrib(this.curStrokeShader.attributes.aDirection.location,4,a.FLOAT,!1,0,0)),this._applyColorBlend(this.curStrokeColor),a.drawArrays(a.TRIANGLES,0,this.immediateMode.lineVertices.length),this.curStrokeShader.unbindShader()},b.exports=d.RendererGL},{"../core/constants":20,"../core/core":21}],70:[function(a,b,c){"use strict";var d=a("../core/core"),e=0;d.RendererGL.prototype._initBufferDefaults=function(a){if(this._freeBuffers(a),++e>1e3){var b=Object.keys(this.gHash)[0];delete this.gHash[b],e--}this.gHash[a]={}},d.RendererGL.prototype._freeBuffers=function(a){var b=this.gHash[a];if(b){delete this.gHash[a],e--;var c=this.GL;b.vertexBuffer&&c.deleteBuffer(b.vertexBuffer),b.normalBuffer&&c.deleteBuffer(b.normalBuffer),b.lineNormalBuffer&&c.deleteBuffer(b.lineNormalBuffer),b.uvBuffer&&c.deleteBuffer(b.uvB
a.getProgramParameter(this._glProgram,a.LINK_STATUS)||console.error("Snap! Error linking shader program: "+a.getProgramInfoLog(this._glProgram)),this._loadAttributes(),this._loadUniforms()}return this},d.Shader.prototype._loadAttributes=function(){if(!this._loadedAttributes){this.attributes={};for(var a=this._renderer.GL,b=a.getProgramParameter(this._glProgram,a.ACTIVE_ATTRIBUTES),c=0;c<b;++c){var d=a.getActiveAttrib(this._glProgram,c),e=d.name,f=a.getAttribLocation(this._glProgram,e),g={};g.name=e,g.location=f,g.type=d.type,g.size=d.size,this.attributes[e]=g}this._loadedAttributes=!0}},d.Shader.prototype._loadUniforms=function(){if(!this._loadedUniforms){for(var a=this._renderer.GL,b=a.getProgramParameter(this._glProgram,a.ACTIVE_UNIFORMS),c=0,d=0;d<b;++d){var e=a.getActiveUniform(this._glProgram,d),f={};f.location=a.getUniformLocation(this._glProgram,e.name),f.size=e.size;var g=e.name;e.size>1&&(g=g.substring(0,g.indexOf("[0]"))),f.name=g,f.type=e.type,f.type===a.SAMPLER_2D&&(f.samplerIndex=c,c++,this.samplers.push(f)),this.uniforms[g]=f}this._loadedUniforms=!0}},d.Shader.prototype.compile=function(){},d.Shader.prototype.bindShader=function(){this.init(),this._bound||(this.useProgram(),this._bound=!0,this.bindTextures(),this._loadAttributes(),this._loadUniforms(),this._renderer._setDefaultCamera(),this._setMatrixUniforms(),this===this._renderer.curStrokeShader&&this._setViewportUniform())},d.Shader.prototype.unbindShader=function(){return this._bound&&(this.unbindTextures(),this._bound=!1),this},d.Shader.prototype.bindTextures=function(){for(var a=this._renderer.GL,b=0;b<this.samplers.length;b++){var c=this.samplers[b],d=c.texture;void 0===d&&(d=this._renderer._getEmptyTexture()),a.activeTexture(a.TEXTURE0+c.samplerIndex),d.bindTexture(),d.update(),a.uniform1i(c.location,c.samplerIndex)}},d.Shader.prototype.unbindTextures=function(){},d.Shader.prototype._setMatrixUniforms=function(){this.setUniform("uProjectionMatrix",this._renderer.uPMatrix.mat4),this.setUniform("uModelViewMatrix",this._renderer.uMVMatrix.mat4),this.setUniform("uViewMatrix",this._renderer.cameraMatrix.mat4),this===this._renderer.curFillShader&&(this._renderer.uNMatrix.inverseTranspose(this._renderer.uMVMatrix),this.setUniform("uNormalMatrix",this._renderer.uNMatrix.mat3))},d.Shader.prototype._setViewportUniform=function(){this.setUniform("uViewport",this._renderer._viewport)},d.Shader.prototype.useProgram=function(){return this._renderer.GL.useProgram(this._glProgram),this},d.Shader.prototype.setUniform=function(a,b){var c=this.uniforms[a];if(c){var d=c.location,e=this._renderer.GL;switch(this.useProgram(),c.type){case e.BOOL:!0===b?e.uniform1i(d,1):e.uniform1i(d,0);break;case e.INT:c.size>1?b.length&&e.uniform1iv(d,b):e.uniform1i(d,b);break;case e.FLOAT:c.size>1?b.length&&e.uniform1fv(d,b):e.uniform1f(d,b);break;case e.FLOAT_MAT3:e.uniformMatrix3fv(d,!1,b);break;case e.FLOAT_MAT4:e.uniformMatrix4fv(d,!1,b);break;case e.FLOAT_VEC2:c.size>1?b.length&&e.uniform2fv(d,b):e.uniform2f(d,b[0],b[1]);break;case e.FLOAT_VEC3: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.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.isLightSha