text: parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"pR4u":[function(require,module,exports) {
  "use strict";function t(t,r=0,e=1){return Math.max(r,Math.min(t,e))}function r(t,r,e){const n=e-r,o=t-r;if(o>=0)return o%n+r;{let t=n+o%n+r;return t>=e&&(t-=n),t}}function e(t,r,e){return r<=t&&t<=e}function n(t){return[...Array(t).keys()]}function o(t,r){null==r&&(r=((t,r)=>t-r));const e=t.map((t,r)=>[t,r]);return e.sort((t,e)=>{const n=r(t[0],e[0]);return 0!==n?n:t[1]-e[1]}),e.map(t=>t[0])}Object.defineProperty(exports,"__esModule",{value:!0}),exports.clamp=t,exports.wrap=r,exports.isInRange=e,exports.range=n,exports.stableSort=o;
  },{}],"HIZ7":[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t=require("./math");function s(t){return null!=t.x&&null!=t.y}class h{constructor(t=0,s){this.x=0,this.y=0,this.set(t,s)}set(t,h){return s(t)?(this.x=t.x,this.y=t.y,this):(this.x=t,this.y=null==h?t:h,this)}add(t){return this.x+=t.x,this.y+=t.y,this}sub(t){return this.x-=t.x,this.y-=t.y,this}mul(t){return this.x*=t,this.y*=t,this}div(t){return this.x/=t,this.y/=t,this}clamp(s,h,i,r){return this.x=t.clamp(this.x,s,h),this.y=t.clamp(this.y,i,r),this}wrap(s,h,i,r){return this.x=t.wrap(this.x,s,h),this.y=t.wrap(this.y,i,r),this}addAngle(t,s){return this.x+=Math.cos(t)*s,this.y+=Math.sin(t)*s,this}swapXy(){const t=this.x;return this.x=this.y,this.y=t,this}normalize(){return this.div(this.length),this}rotate(t){if(0===t)return this;const s=this.x;return this.x=s*Math.cos(t)-this.y*Math.sin(t),this.y=s*Math.sin(t)+this.y*Math.cos(t),this}getAngle(t){return null==t?Math.atan2(this.y,this.x):Math.atan2(t.y-this.y,t.x-this.x)}distanceTo(t){const s=this.x-t.x,h=this.y-t.y;return Math.sqrt(s*s+h*h)}isInRect(s,h,i,r){return t.isInRange(this.x,s,s+i)&&t.isInRange(this.y,h,h+r)}equals(t){return this.x===t.x&&this.y===t.y}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}get length(){return Math.sqrt(this.x*this.x+this.y*this.y)}}exports.Vector=h;
  },{"./math":"pR4u"}],"c8HW":[function(require,module,exports) {
  var define;
  var t;!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof t&&t.amd?t([],n):"object"==typeof exports?exports.gcc=n():e.gcc=n()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e){GIFEncoder=function(){for(var t=0,e={};t<256;t++)e[t]=String.fromCharCode(t);function n(){this.bin=[]}n.prototype.getData=function(){for(var t="",n=this.bin.length,r=0;r<n;r++)t+=e[this.bin[r]];return t},n.prototype.writeByte=function(t){this.bin.push(t)},n.prototype.writeUTFBytes=function(t){for(var e=t.length,n=0;n<e;n++)this.writeByte(t.charCodeAt(n))},n.prototype.writeBytes=function(t,e,n){for(var r=n||t.length,o=e||0;o<r;o++)this.writeByte(t[o])};var r,o,i,a,c,u,f,s,l,d={},p=null,y=-1,w=0,h=!1,g=[],m=7,v=-1,B=!1,b=!0,F=!1,A=10,E="Generated by jsgif (https://github.com/antimatter15/jsgif/)",j=(d.setDelay=function(t){w=Math.round(t/10)},d.setDispose=function(t){t>=0&&(v=t)},d.setRepeat=function(t){t>=0&&(y=t)},d.setTransparent=function(t){p=t},d.setComment=function(t){E=t},d.addFrame=function(t,e){if(null===t||!h||null===a)throw new Error("Please call start method before calling addFrame");var n=!0;try{e?t instanceof ImageData?(c=t.data,sizeset&&r==t.width&&o==t.height||C(t.width,t.height)):t instanceof Uint8ClampedArray?t.length==r*o*4?c=t:(console.log("Please set the correct size: ImageData length mismatch"),n=!1):(console.log("Please provide correct input"),n=!1):(c=t.getImageData(0,0,t.canvas.width,t.canvas.height).data,F||C(t.canvas.width,t.canvas.height)),N(),S(),b&&(T(),D(),y>=0&&M()),P(),""!==E&&I(),O(),b||D(),L(),b=!1}catch(t){n=!1}return n},d.download=function(t){if(null===a||0==B)console.log("Please call start method and add frames and call finish method before calling download");else{t=void 0!==t?t.endsWith(".gif")?t:t+".gif":"download.gif";var e=document.createElement("a");e.download=t,e.href=URL.createObjectURL(new Blob([new Uint8Array(a.bin)],{type:"image/gif"})),e.click()}},d.finish=function(){if(!h)return!1;var t=!0;h=!1;try{a.writeByte(59),B=!0}catch(e){t=!1}return t},function(){i=0,c=null,u=null,f=null,l=null,B=!1,b=!0}),C=(d.setFrameRate=function(t){15!=t&&(w=Math.round(100/t))},d.setQuality=function(t){t<1&&(t=1),A=t},d.setSize=function(t,e){h&&!b||((r=t)<1&&(r=320),(o=e)<1&&(o=240),F=!0)}),S=(d.start=function(){j();var t=!0;B=!1,a=new n;try{a.writeUTFBytes("GIF89a")}catch(e){t=!1}return h=t},d.cont=function(){return j(),B=!1,a=new n,h=!0},function(){var t=u.length,e=t/3;f=[];var n=new NeuQuant(u,t,A);l=n.process();for(var r=0,o=0;o<e;o++){var a=n.map(255&u[r++],255&u[r++],255&u[r++]);g[a]=!0,f[o]=a}u=null,s=8,m=7,null!==p&&(i=x(p))}),x=function(t){if(null===l)return-1;for(var e=(16711680&t)>>16,n=(65280&t)>>8,r=255&t,o=0,i=16777216,a=l.length,c=0;c<a;){var u=e-(255&l[c++]),f=n-(255&l[c++]),s=r-(255&l[c]),d=u*u+f*f+s*s,p=c/3;g[p]&&d<i&&(i=d,o=p),c++}return o},N=function(){var t=r,e=o;u=[];for(var n=c,i=0,a=0;a<e;a++)for(var f=0;f<t;f++){var s=a*t*4+4*f;u[i++]=n[s],u[i++]=n[s+1],u[i++]=n[s+2]}},P=function(){var t,e;a.writeByte(33),a.writeByte(249),a.writeByte(4),null===p?(t=0,e=0):(t=1,e=2),v>=0&&(e=7&v),e<<=2,a.writeByte(0|e|t),U(w),a.writeByte(i),a.writeByte(0)},I=function(){a.writeByte(33),a.writeByte(254),a.writeByte(E.length),a.writeUTFBytes(E),a.writeByte(0)},O=function(){a.writeByte(44),U(0),U(0),U(r),U(o),b?a.writeByte(0):a.writeByte(128|m)},T=function(){U(r),U(o),a.writeByte(240|m),a.writeByte(0),a.writeByte(0)},M=function(){a.writeByte(33),a.writeByte(255),a.writeByte(11),a.writeUTFBytes("NETSCAPE2.0"),a.writeByte(3),a.writeByte(1),U(y),a.writeByte(0)},D=function(){a.writeBytes(l);for(var t=768-l.length,e=0;e<t;e++)a.writeByte(0)},U=function(t){a.writeByte(255&t),a.writeByte(t>>8&255)},L=function(){new LZWEncoder(r,o,f,s).encode(a)};return d.stream=function(){return a},d.setProperties=function(t,e){h=t,b=e},d},t.exports=GIFEncoder,LZWEncoder=function(){var t,e,n,r,o,i,a,c,u,f,s,l,d={},p=[],y=[],w=0,h=!1,g=0,m=0,v=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],B=[],b=d.LZWEncoder=function(o,i,a,c){t=o,e=i,n=a,r=Math.max(2,c)},F=function(t,e){B[l++]=t,l>=254&&C(e)},A=function(t){E(5003),w=f+2,h=!0,N(f,t)},E=function(t){for(var e=0;e<t;++e)p[e]=-1},j=d.compress=function(t,e){var n,r,o,i,d,g;for(h=!1,c=S(a=u=t),s=1+(f=1<<t-1),w=f+2,l=0,i=x(),g=0,n=5003;n<65536;n*=2)++g;g=8-g,E(5003),N(f,e);t:for(;-1!=(o=x());)if(n=(o<<12)+i,p[r=o<<g^i]!=n){if(p[r]>=0){d=5003-r,0===r&&(d=1);do{if((r-=d)<0&&(r+=5003),p[r]==n){i=y[r];continue t}}while(p[r]>=0)}N(i,e),i=o,w<4096?(y[r]=w++,p[r]=n):A(e)}else i=y[r];N(i,e),N(s,e)},C=(d.encode=function(n){n.writeByte(r),o=t*e,i=0,j(r+1,n),n.writeByte(0)},function(t){l>0&&(t.writeByte(l),t.writeBytes(B,0,l),l=0)}),S=function(t){return(1<<t)-1},x=function(){return 0===o?-1:(--o,255&n[i++])},N=function(t,e){for(g&=v[m],m>0?g|=t<<m:g=t,m+=a;m>=8;)F(255&g,e),g>>=8,m-=8;if((w>c||h)&&(h?(c=S(a=u),h=!1):c=12==++a?4096:S(a)),t==s){for(;m>0;)F(255&g,e),g>>=8,m-=8;C(e)}};return b.apply(this,arguments),d},NeuQuant=function(){var t,e,n,r,o,i={},a=[],c=[],u=[],f=[],s=i.NeuQuant=function(t,i,a){var f,s;for(e=t,n=i,r=a,o=new Array(256),f=0;f<256;f++)o[f]=new Array(4),(s=o[f])[0]=s[1]=s[2]=(f<<12)/256,u[f]=256,c[f]=0},l=(i.map=function(t,e,n){var r,i,c,u,f,s,l;for(f=1e3,l=-1,i=(r=a[e])-1;r<256||i>=0;)r<256&&((c=(s=o[r])[1]-e)>=f?r=256:(r++,c<0&&(c=-c),(u=s[0]-t)<0&&(u=-u),(c+=u)<f&&((u=s[2]-n)<0&&(u=-u),(c+=u)<f&&(f=c,l=s[3])))),i>=0&&((c=e-(s=o[i])[1])>=f?i=-1:(i--,c<0&&(c=-c),(u=s[0]-t)<0&&(u=-u),(c+=u)<f&&((u=s[2]-n)<0&&(u=-u),(c+=u)<f&&(f=c,l=s[3]))));return l},i.process=function(){return function(){var o,i,a,c,u,s,l,w,h,g,m,v,B,b;for(n<1509&&(r=1),t=30+(r-1)/3,v=e,B=0,b=n,g=(m=n/(3*r))/100|0,w=1024,(l=(s=2048)>>6)<=1&&(l=0),o=0;o<l;o++)f[o]=w*(256*(l*l-o*o)/(l*l));for(h=n<1509?3:n%499!=0?1497:n%491!=0?1473:n%487!=0?1461:1509,o=0;o<m;)if(a=(255&v[B+0])<<4,c=(255&v[B+1])<<4,u=(255&v[B+2])<<4,i=y(a,c,u),p(w,i,a,c,u),0!==l&&d(l,i,a,c,u),(B+=h)>=b&&(B-=n),0===g&&(g=1),++o%g==0)for(w-=w/t,(l=(s-=s/30)>>6)<=1&&(l=0),i=0;i<l;i++)f[i]=w*(256*(l*l-i*i)/(l*l))}(),l(),function(){var t,e,n,r,i,c,u,f;for(u=0,f=0,t=0;t<256;t++){for(n=t,r=(i=o[t])[1],e=t+1;e<256;e++)(c=o[e])[1]<r&&(n=e,r=c[1]);if(c=o[n],t!=n&&(e=c[0],c[0]=i[0],i[0]=e,e=c[1],c[1]=i[1],i[1]=e,e=c[2],c[2]=i[2],i[2]=e,e=c[3],c[3]=i[3],i[3]=e),r!=u){for(a[u]=f+t>>1,e=u+1;e<r;e++)a[e]=t;u=r,f=t}}for(a[u]=f+255>>1,e=u+1;e<256;e++)a[e]=255}(),function(){for(var t=[],e=new Array(256),n=0;n<256;n++)e[o[n][3]]=n;for(var r=0,i=0;i<256;i++){var a=e[i];t[r++]=o[a][0],t[r++]=o[a][1],t[r++]=o[a][2]}return t}()},function(){var t;for(t=0;t<256;t++)o[t][0]>>=4,o[t][1]>>=4,o[t][2]>>=4,o[t][3]=t}),d=function(t,e,n,r,i){var a,c,u,s,l,d,p;for((u=e-t)<-1&&(u=-1),(s=e+t)>256&&(s=256),a=e+1,c=e-1,d=1;a<s||c>u;){if(l=f[d++],a<s){p=o[a++];try{p[0]-=l*(p[0]-n)/(1<<18),p[1]-=l*(p[1]-r)/(1<<18),p[2]-=l*(p[2]-i)/(1<<18)}catch(t){}}if(c>u){p=o[c--];try{p[0]-=l*(p[0]-n)/(1<<18),p[1]-=l*(p[1]-r)/(1<<18),p[2]-=l*(p[2]-i)/(1<<18)}catch(t){}}}},p=function(t,e,n,r,i){var a=o[e];a[0]-=t*(a[0]-n)/1024,a[1]-=t*(a[1]-r)/1024,a[2]-=t*(a[2]-i)/1024},y=function(t,e,n){var r,i,a,f,s,l,d,p,y,w;for(y=p=~(1<<31),d=l=-1,r=0;r<256;r++)(i=(w=o[r])[0]-t)<0&&(i=-i),(a=w[1]-e)<0&&(a=-a),i+=a,(a=w[2]-n)<0&&(a=-a),(i+=a)<p&&(p=i,l=r),(f=i-(c[r]>>12))<y&&(y=f,d=r),s=u[r]>>10,u[r]-=s,c[r]+=s<<10;return u[l]+=64,c[l]-=65536,d};return s.apply(this,arguments),i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0);let o,i,a;e.options={scale:.5,durationSec:3,keyCode:67,capturingFps:20,appFps:60,isAppendingImgElement:!0,quality:10,downloadFileName:null};let c=0,u=0,f=new Image,s=!1;function l(t){u++;const n=e.options.appFps/e.options.capturingFps;u<n||(u-=n,i||function(t){s?i=[]:(o=e.options.durationSec*e.options.capturingFps,i=y(o,()=>d(t)),a=y(o,()=>!1)),document.addEventListener("keydown",t=>{t.keyCode==e.options.keyCode&&p()})}(t),s&&i.push(d(t)),i[c].drawImage(t,0,0),s||(a[c]=!0),c++,!s&&c>=o&&(c=0))}function d(t){const n=document.createElement("canvas");n.width=t.width*e.options.scale,n.height=t.height*e.options.scale;const r=n.getContext("2d");return r.scale(e.options.scale,e.options.scale),r}function p(){const t=new r;if(t.setRepeat(0),t.setDelay(1e3/e.options.capturingFps),t.setQuality(e.options.quality),t.start(),s)y(c-1,e=>{t.addFrame(i[e])});else{let e=c;y(o,()=>{a[e]&&t.addFrame(i[e]),++e>=o&&(e=0)})}if(t.finish(),null!=e.options.downloadFileName)return t.download(e.options.downloadFileName),null;const n=t.stream().getData(),u=document.createElement("img");return u.src="data:image/gif;base64,"+function(t){for(var e,n,r,o,i,a,c,u="",f=0,s=t.length,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";f<s;)o=(e=t.charCodeAt(f++))>>2,i=(3&e)<<4|(n=t.charCodeAt(f++))>>4,a=(15&n)<<2|(r=t.charCodeAt(f++))>>6,c=63&r,isNaN(n)?a=c=64:isNaN(r)&&(c=64),u=u+l.charAt(o)+l.charAt(i)+l.charAt(a)+l.charAt(c);return u}(n),e.options.isAppendingImgElement&&document.getElementsByTagName("body")[0].appendChild(u),u}function y(t,e){let n=[];for(let r=0;r<t;r++)n.push(e(r));return n}e.capture=l,e.captureSvg=function(t){const n=e.options.appFps/e.options.capturingFps;if(u+1<n)return void u++;const r=(new XMLSerializer).serializeToString(t);f.src="data:image/svg+xml;base64,"+btoa(r),l(f)},e.end=p,e.setOptions=function(t){for(let n in t)e.options[n]=t[n];s=e.options.durationSec<=0}}])});
  },{}],"YCKg":[function(require,module,exports) {
  "use strict";var e=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)Object.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t.default=e,t};Object.defineProperty(exports,"__esModule",{value:!0});const t=require("./vector"),s=e(require("gif-capture-canvas"));let n;exports.size=new t.Vector;const o="\nposition: absolute;\nleft: 50%;\ntop: 50%;\ntransform: translate(-50%, -50%);\nimage-rendering: -moz-crisp-edges;\nimage-rendering: -webkit-optimize-contrast;\nimage-rendering: -o-crisp-edges;\nimage-rendering: pixelated;\n";let r=document.createElement("img");const i=!1;let a,c,p="black";function x(e,t,r){exports.size.set(e),p=r,n=`\n-webkit-touch-callout: none;\n-webkit-tap-highlight-color: ${t};\n-webkit-user-select: none;\n-moz-user-select: none;\n-ms-user-select: none;\nuser-select: none;\nbackground: ${t};\ncolor: #888;\n`,document.body.style.cssText=n,exports.canvas=document.createElement("canvas"),exports.canvas.width=exports.size.x,exports.canvas.height=exports.size.y,exports.canvas.style.cssText=o;const x=exports.size.x>=exports.size.y?95:95/exports.size.y*exports.size.x,l=exports.size.y>=exports.size.x?95:95/exports.size.x*exports.size.y;if(exports.canvas.style.width=`${x}vmin`,exports.canvas.style.height=`${l}vmin`,exports.context=exports.canvas.getContext("2d"),exports.context.imageSmoothingEnabled=!1,document.body.appendChild(exports.canvas),i){a=document.createElement("canvas");const e=2*exports.size.y;a.width=exports.size.x>e?exports.size.x:e,a.height=exports.size.y,(c=a.getContext("2d")).fillStyle="black",s.setOptions({scale:2,capturingFps:60})}}function l(){exports.context.fillStyle=p,exports.context.fillRect(0,0,exports.size.x,exports.size.y)}function d(){r.src=exports.canvas.toDataURL()}function u(){exports.context.drawImage(r,0,0)}function g(){i&&(c.fillRect(0,0,a.width,a.height),c.drawImage(exports.canvas,(a.width-exports.canvas.width)/2,0),s.capture(a))}exports.init=x,exports.clear=l,exports.saveAsBackground=d,exports.drawBackground=u,exports.update=g;
  },{"./vector":"HIZ7","gif-capture-canvas":"c8HW"}],"+kme":[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const s=require("./vector"),e=require("./math");exports.isPressed=!1,exports.isJustPressed=!1,exports.isJustReleased=!1,exports.stick=new s.Vector,exports.isStickPressed=e.range(4).map(()=>!1),exports.isStickJustPressed=e.range(4).map(()=>!1),exports.isStickJustReleased=e.range(4).map(()=>!1);const t={isUsingStickKeysAsButton:!1,isFourWaysStick:!1,onKeyDown:void 0};let r;const o=e.range(256).map(()=>!1),i=e.range(256).map(()=>!1),n=e.range(256).map(()=>!1),c=[[39,68,102],[40,83,101,98],[37,65,100],[38,87,104]],p=[[1,0],[0,1],[-1,0],[0,-1]],d=[90,88,67,86,66,78,77,188,190,191,17,16,18,32,13];function x(s){r=Object.assign(Object.assign({},t),s),document.addEventListener("keydown",s=>{o[s.keyCode]=i[s.keyCode]=!0,null!=r.onKeyDown&&r.onKeyDown()}),document.addEventListener("keyup",s=>{o[s.keyCode]=!1,n[s.keyCode]=!0})}function a(){const s=exports.isPressed;exports.isPressed=exports.isJustPressed=exports.isJustReleased=!1,e.range(4).forEach(s=>{exports.isStickPressed[s]=exports.isStickJustPressed[s]=exports.isStickJustReleased[s]=!1}),exports.stick.set(0),c.forEach((e,t)=>{e.forEach(e=>{(o[e]||i[e])&&(exports.stick.x+=p[t][0],exports.stick.y+=p[t][1],exports.isStickPressed[t]=!0,r.isUsingStickKeysAsButton&&(exports.isPressed=!0),i[e]&&(i[e]=!1,exports.isStickJustPressed[t]=!0,r.isUsingStickKeysAsButton&&!s&&(exports.isJustPressed=!0))),n[e]&&(n[e]=!1,exports.isStickJustReleased[t]=!0,r.isUsingStickKeysAsButton&&s&&(exports.isJustReleased=!0))})}),exports.stickAngle=-1,exports.stick.length>0&&k(exports.stick.getAngle()),d.forEach(e=>{o[e]&&(exports.isPressed=!0),i[e]&&(i[e]=!1,s||(exports.isPressed=exports.isJustPressed=!0)),n[e]&&(n[e]=!1,s&&(exports.isJustReleased=!0))})}exports.init=x,exports.update=a;const u=[1,0,1,1,0,1,-1,1,-1,0,-1,-1,0,-1,1,-1];function k(s){const t=r.isFourWaysStick?Math.PI/2:Math.PI/4,o=r.isFourWaysStick?2:1;exports.stickAngle=e.wrap(Math.round(s/t)*o,0,8),exports.stick.set(u[2*exports.stickAngle],u[2*exports.stickAngle+1])}function P(){exports.isJustPressed=!1,exports.isPressed=!0}exports.clearJustPressed=P;
  },{"./vector":"HIZ7","./math":"pR4u"}],"iXZc":[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});class t{constructor(t=null){this.setSeed(t)}get(t=1,s){return null==s&&(s=t,t=0),this.next()/4294967295*(s-t)+t}getInt(t,s){return null==s&&(s=t,t=0),this.next()%(s-t)+t}getPlusOrMinus(){return 2*this.getInt(2)-1}select(t){return t[this.getInt(t.length)]}setSeed(t,s=123456789,e=362436069,h=521288629,i=32){this.w=null!=t?t>>>0:Math.floor(4294967295*Math.random())>>>0,this.x=s>>>0,this.y=e>>>0,this.z=h>>>0;for(let n=0;n<i;n++)this.next();return this}next(){const t=this.x^this.x<<11;return this.x=this.y,this.y=this.z,this.z=this.w,this.w=(this.w^this.w>>>19^t^t>>>8)>>>0,this.w}}exports.Random=t;
  },{}],"iUdv":[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=require("./vector"),s=require("./random"),t=require("./math");exports.pos=new e.Vector,exports.move=new e.Vector,exports.pressedPos=new e.Vector,exports.targetPos=new e.Vector,exports.isPressed=!1,exports.isJustPressed=!1,exports.isJustReleased=!1;let o,r,n,p={isDebugMode:!1,anchor:new e.Vector,padding:new e.Vector,onPointerDownOrUp:void 0};const d=new e.Vector,x=new s.Random,i=new e.Vector,a=new e.Vector;let u=!1,c=new e.Vector(-9999,-9999),P=!1,g=!1,y=!1,l=!1;function f(s,t,d){n=Object.assign(Object.assign({},p),d),o=s,r=new e.Vector(t.x+2*n.padding.x,t.y+2*n.padding.y),exports.targetPos.set(r.x/2,r.y/2),n.isDebugMode&&i.set(r.x/2,r.y/2),document.addEventListener("mousedown",e=>{J(e.pageX,e.pageY)}),document.addEventListener("touchstart",e=>{J(e.touches[0].pageX,e.touches[0].pageY)}),document.addEventListener("mousemove",e=>{O(e.pageX,e.pageY)}),document.addEventListener("touchmove",e=>{e.preventDefault(),O(e.touches[0].pageX,e.touches[0].pageY)},{passive:!1}),document.addEventListener("mouseup",e=>{L(e)}),document.addEventListener("touchend",e=>{e.preventDefault(),e.target.click(),L(e)},{passive:!1})}function v(){V(c.x,c.y,exports.pos),n.isDebugMode&&!exports.pos.isInRect(0,0,r.x,r.y)?(D(),exports.pos.set(i),exports.isJustPressed=!exports.isPressed&&u,exports.isJustReleased=exports.isPressed&&!u,exports.isPressed=u):(exports.isJustPressed=!exports.isPressed&&g,exports.isJustReleased=exports.isPressed&&y,exports.isPressed=P),exports.isJustPressed&&(exports.pressedPos.set(exports.pos),d.set(exports.pos)),exports.move.set(exports.pos.x-d.x,exports.pos.y-d.y),d.set(exports.pos),l?exports.targetPos.set(exports.pos):exports.targetPos.add(exports.move),g=y=!1}function w(){exports.isJustPressed=!1,exports.isPressed=!0}function m(e=1){exports.pressedPos.x+=(exports.pos.x-exports.pressedPos.x)*e,exports.pressedPos.y+=(exports.pos.y-exports.pressedPos.y)*e}function h(e){exports.targetPos.set(e)}function V(e,s,t){null!=o&&(t.x=((e-o.offsetLeft)/o.clientWidth+n.anchor.x)*r.x-n.padding.x,t.y=((s-o.offsetTop)/o.clientHeight+n.anchor.y)*r.y-n.padding.y)}function D(){a.length>0?(i.add(a),!t.isInRange(i.x,.1*-r.x,1.1*r.x)&&i.x*a.x>0&&(a.x*=-1),!t.isInRange(i.y,.1*-r.y,1.1*r.y)&&i.y*a.y>0&&(a.y*=-1),x.get()<.05&&a.set(0)):x.get()<.1&&(a.set(0),a.addAngle(x.get(2*Math.PI),(r.x+r.y)*x.get(.01,.03))),x.get()<.05&&(u=!u)}function J(e,s){c.set(e,s),P=g=!0,l=!1,null!=n.onPointerDownOrUp&&n.onPointerDownOrUp()}function O(e,s){c.set(e,s),P||(l=!0)}function L(e){P=!1,y=!0,l=!1,null!=n.onPointerDownOrUp&&n.onPointerDownOrUp()}exports.init=f,exports.update=v,exports.clearJustPressed=w,exports.resetPressedPointerPos=m,exports.setTargetPos=h;
  },{"./vector":"HIZ7","./random":"iXZc","./math":"pR4u"}],"Tx6Z":[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.letterPatterns=["\n  w\n  w\n  w\n\n  w\n","\n w w\n w w\n\n\n\n","\n w w\nwwwww\n w w\nwwwww\n w w\n","\n www\nw w\n www\n  w w\n www\n","\nw   w\nw  w\n  w\n w  w\nw   w\n","\n w\nw w\n ww w\nw  w\n ww w\n","\n  w\n  w\n\n\n\n","\n   w\n  w\n  w\n  w\n   w\n","\n w\n  w\n  w\n  w\n w\n","\n  w\nw w w\n www\nw w w\n  w\n","\n  w\n  w\nwwwww\n  w\n  w\n","\n\n\n\n  w\n w\n","\n\n\nwwwww\n\n\n","\n\n\n\n\n  w\n","\n    w\n   w\n  w\n w\nw\n","\n www\nw  ww\nw w w\nww  w\n www\n","\n ww\nw w\n  w\n  w\nwwwww\n","\n www\nw   w\n  ww\n w\nwwwww\n","\n www\nw   w\n  ww\nw   w\n www\n","\n  ww\n w w\nw  w\nwwwww\n   w\n","\nwwwww\nw\nwwww\n    w\nwwww\n","\n www\nw\nwwww\nw   w\n www\n","\nwwwww\nw   w\n   w\n  w\n w\n","\n www\nw   w\n www\nw   w\n www\n","\n www\nw   w\n wwww\n    w\n www\n","\n\n  w\n\n  w\n\n","\n\n  w\n\n  w\n w\n","\n   ww\n ww\nw\n ww\n   ww\n","\n\nwwwww\n\nwwwww\n\n","\nww\n  ww\n    w\n  ww\nww\n","\n www\nw   w\n  ww\n\n  w\n","\n www\nw   w\nw www\nw\n www\n","\n www\nw   w\nwwwww\nw   w\nw   w\n","\nwwww\nw   w\nwwww\nw   w\nwwww\n","\n www\nw   w\nw\nw   w\n www\n","\nwwww\nw   w\nw   w\nw   w\nwwww\n","\nwwwww\nw\nwwww\nw\nwwwww\n","\nwwwww\nw\nwwww\nw\nw\n","\n www\nw\nw  ww\nw   w\n wwww\n","\nw   w\nw   w\nwwwww\nw   w\nw   w\n","\nwwwww\n  w\n  w\n  w\nwwwww\n","\n wwww\n   w\n   w\nw  w\n ww\n","\nw   w\nw  w\nwww\nw  w\nw   w\n","\nw\nw\nw\nw\nwwwww\n","\nw   w\nww ww\nw w w\nw   w\nw   w\n","\nw   w\nww  w\nw w w\nw  ww\nw   w\n","\n www\nw   w\nw   w\nw   w\n www\n","\nwwww\nw   w\nwwww\nw\nw\n","\n www\nw   w\nw   w\nw  ww\n wwww\n","\nwwww\nw   w\nwwww\nw   w\nw   w\n","\n wwww\nw\n www\n    w\nwwww\n","\nwwwww\n  w\n  w\n  w\n  w\n","\nw   w\nw   w\nw   w\nw   w\n www\n","\nw   w\nw   w\n w w\n w w\n  w\n","\nw   w\nw   w\nw w w\nw w w\n w w\n","\nw   w\n w w\n  w\n w w\nw   w\n","\nw   w\n w w\n  w\n  w\n  w\n","\nwwwww\n   w\n  w\n w\nwwwww\n","\n  ww\n  w\n  w\n  w\n  ww\n","\nw\n w\n  w\n   w\n    w\n","\n ww\n  w\n  w\n  w\n ww\n","\n  w\n w w\n\n\n\n","\n\n\n\n\nwwwww\n","\n w\n  w\n\n\n\n","\n ww\n   w\n www\nw  w\n ww\n","\nw\nw\nwww\nw  w\nwww\n","\n\n ww\nw  \nw\n ww\n","\n   w\n   w\n www\nw  w\n www\n","\n ww\nw  w\nwww\nw\n ww\n","\n   w\n  w \n www\n  w\n  w\n","\n www\nw  w\n www\n   w\n ww\n","\nw\nw\nwww\nw  w\nw  w\n","\n  w\n\n  w\n  w\n  w\n","\n   w\n\n   w\n   w\n ww\n","\nw\nw\nw w\nww\nw w\n","\n ww\n  w\n  w\n  w\n www\n","\n\nww w\nw w w\nw w w\nw w w\n","\n\nw ww\nww  w\nw   w\nw   w\n","\n\n ww\nw  w\nw  w\n ww\n","\n\nwww\nw  w\nwww\nw\n","\n\n www\nw  w\n www\n   w\n","\n\nw ww\nww\nw\nw\n","\n ww\nw\n ww  \n   w\n ww\n","\n w\nwww\n w\n w\n  w\n","\n\nw  w\nw  w\nw  w\n ww\n","\n\nw  w\nw  w\n ww\n ww\n","\n\nw w w\nw w w\nw w w\n w w\n","\n\nw  w\n ww\n ww\nw  w\n","\n\nw  w\n ww\n w\nw\n","\n\nwwww\n  w\n w\nwwww\n","\n  ww\n  w\n w\n  w\n  ww\n","\n  w\n  w\n  w\n  w\n  w\n","\n ww\n  w\n   w\n  w\n ww\n","\n\n w\nw w w\n   w\n\n"];
  },{}],"RRtf":[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.symbolPatterns=["\n  w\n   w\nwwwww\n   w\n  w\n","\nwwwwww\nwwwwww\nwwwww\nwwwww\nwwww\nww\n","\n ww\nwwww\nwwww\n ww\n","\nwww\nwww\nwww\n\n\n\n","\n  w\n  w\n  w\n  w\n  w\n  w  \n","\nwwwwww\nwwwwww\nwwwwww\n\n\n\n","\nwww\nwww\nwww\n   www\n   www\n   www\n","\nwwww\nw  w\nw  w\nwwww\n","\n  w\n w w\n w w\nw   w\nwwwww\n","\n  w\n  w\nwww\n\n\n\n","\n  w\n  w\nwwwwww\n\n\n\n","\n  w\n  w\nwwwwwww\n  w\n  w\n  w\n","\n  w\n  w\nww\n\n\n\n","\n ww\nw  w\nw  w\n ww\n","\n  w\n w\nw\n\n\n\n","\n     w\n    w\n   w\n  w\n w\nw\n","\n  ww\n  ww\nwwwwww\n  ww\n w  w\nw    w\n","\n wwww\nw    w\nww  ww\nw    w\nw ww w\n wwww \n","\nwwww\nwwww\nwwww\nwwww\n","\n  w\n www\n www\nwwwww\nwwwww\n","\nwwwwww\nwwwww\nwwww\nwww\nww\nw\n","\nwww\nwww\nww\n\n\n\n","\nw w w\n w w w\nw w w\n w w w\nw w w\n w w w\n","\nw    w\n w  w\n  ww\n  ww\n w  w\nw    w\n","\nwww\nww\nw\n\n\n\n","\nw\n w\n  w w\n   ww\n  www\n"];
  },{}],"/sou":[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t=require("./letterPattern"),e=require("./view"),r=require("./math"),o=require("./symbolPattern");let n,l,s,i,a,c=!1;const p=6,x=1;exports.letterSize=p*x;const h=[void 0,0,15277667,5025616,16771899,4149685,10233776,240116,15658734];function u(){(i=document.createElement("canvas")).width=i.height=exports.letterSize,a=i.getContext("2d"),exports.rgbObjects=[],h.forEach(t=>{exports.rgbObjects.push({r:(16711680&t)>>16,g:(65280&t)>>8,b:255&t})}),h.forEach((t,e)=>{e<2||exports.rgbObjects.push({r:Math.floor(.5*(16711680&t))>>16,g:Math.floor(.5*(65280&t))>>8,b:Math.floor(.5*(255&t))})}),n=t.letterPatterns.map(t=>y(t)),l=r.range(64).map(()=>void 0),g(o.symbolPatterns,"a"),s={}}function g(t,e){const r=e.charCodeAt(0)-33;t.forEach((t,e)=>{l[r+e]=y(t)})}function f(){c=!0}function b(t,e,r,o={}){const n=Math.floor(e);let l=null!=o.colorPattern?o.colorPattern.split("\n"):void 0;const s=null!=o.backgroundColorPattern?o.backgroundColorPattern.split("\n"):void 0,i=null!=o.rotationPattern?o.rotationPattern.split("\n"):void 0,a=null!=o.symbolPattern?o.symbolPattern.split("\n"):void 0,c=null==o.scale?1:o.scale,p=null==o.alpha?1:o.alpha;let x=t;if(null!=o.charAndColorPattern){const[t,e]=m(o.charAndColorPattern);x=t.join("\n"),l=e}let h=n,u=Math.floor(r),g=0,f=0;for(let b=0;b<x.length;b++){const t=x[b];"\n"!==t?(O(t,h,u,Object.assign(Object.assign({},S(M(l,g,f),M(s,g,f),M(i,g,f),M(a,g,f))),{scale:c,alpha:p})),h+=exports.letterSize*c,g++):(h=n,u+=exports.letterSize*c,g=0,f++)}}function d(t){const r=exports.rgbObjects[exports.colorChars.indexOf(t)];e.context.fillStyle=`rgb(${r.r},${r.g},${r.b})`}function m(t){const e=t.split("\n"),r=e.slice(1,e.length-1),o=[],n=[];let l=!0;for(const s of r)l?(o.push(s),l=!1):C(s)?(n.push(s),l=!0):(o.push(s),n.push(""));return[o,n]}function C(t){return t.trim().length>0&&0===t.replace(new RegExp(`[\\s${exports.colorChars}]`,"g"),"").length}function M(t,e,r){if(null==t)return;if(r>=t.length)return;const o=t[r].charAt(e);return""===o||" "===o?void 0:o}function S(t,e,r,o){let n={color:"w",backgroundColor:"t",angleIndex:0,isMirrorX:!1,isMirrorY:!1,isSymbol:!1};if(null!=t&&P(t)&&(n.color=t),null!=e&&P(e)&&(n.backgroundColor=e),null!=r){const t=exports.rotationChars.indexOf(r);t>=0&&(n.angleIndex=t%4,n.isMirrorX=(4&t)>0,n.isMirrorY=(8&t)>0)}return"s"===o&&(n.isSymbol=!0),n}function O(t,r,o,p){const x=t.charCodeAt(0);if(x<32||x>126)return;const h=exports.letterSize*p.scale;if("t"!==p.backgroundColor){const t=exports.rgbObjects[exports.colorChars.indexOf(p.backgroundColor)];e.context.fillStyle=`rgba(${t.r},${t.g},${t.b},${Math.floor(255*p.alpha)})`,e.context.fillRect(r,o,h,h)}if(32==x||"t"===p.color)return;const u=x-33,g=p.isSymbol?l[u]:n[u];if("w"===p.color&&p.angleIndex%4==0&&!p.isMirrorX&&!p.isMirrorY&&1===p.alpha)return void(1===p.scale?e.context.drawImage(g,r,o):e.context.drawImage(g,r,o,h,h));const f=JSON.stringify({c:t,options:p}),b=s[f];if(null==b){if(a.clearRect(0,0,exports.letterSize,exports.letterSize),a.globalAlpha=p.alpha,p.angleIndex%4!=0||p.isMirrorX||p.isMirrorY?(a.save(),a.translate(exports.letterSize/2,exports.letterSize/2),a.rotate(Math.PI/2*p.angleIndex),(p.isMirrorX||p.isMirrorY)&&a.scale(p.isMirrorX?-1:1,p.isMirrorY?-1:1),a.drawImage(g,-exports.letterSize/2,-exports.letterSize/2),a.restore()):a.drawImage(g,0,0),"w"!==p.color){a.globalCompositeOperation="source-in";const t=exports.rgbObjects[exports.colorChars.indexOf(p.color)];a.fillStyle=`rgb(${t.r},${t.g},${t.b})`,a.fillRect(0,0,exports.letterSize,exports.letterSize),a.globalCompositeOperation="source-over"}if(e.context.drawImage(i,r,o,h,h),c){const t=document.createElement("img");t.src=i.toDataURL(),s[f]=t}}else e.context.drawImage(b,r,o)}function P(t){return exports.colorChars.indexOf(t)>=0}function y(t,e=!0){a.clearRect(0,0,exports.letterSize,exports.letterSize);let r=t.split("\n");e&&(r=r.slice(1,r.length-1));let o=0;r.forEach(t=>{o=Math.max(t.length,o)});const n=Math.max(Math.ceil((p-o)/2),0),l=r.length,s=Math.max(Math.ceil((p-l)/2),0);r.forEach((t,e)=>{if(!(e+s>=p))for(let r=0;r<p-n;r++){const o=t.charAt(r);let l=exports.colorChars.indexOf(o);if(""!==o&&l>=1){const t=exports.rgbObjects[l];a.fillStyle=`rgb(${t.r},${t.g},${t.b})`,a.fillRect((r+n)*x,(e+s)*x,x,x)}}});const c=document.createElement("img");return c.src=i.toDataURL(),c}exports.colorChars="tlrgybpcwRGYBPCW",exports.rotationChars="kljhnmbvopiu9087",exports.init=u,exports.defineSymbols=g,exports.enableCache=f,exports.print=b,exports.setColor=d,exports.getColorLines=m,exports.isColorLine=C,exports.getCharFromLines=M,exports.getCharOption=S,exports.printChar=O;
  },{"./letterPattern":"Tx6Z","./view":"YCKg","./math":"pR4u","./symbolPattern":"RRtf"}],"h6s+":[function(require,module,exports) {
  "use strict";var t=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var o in t)Object.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r.default=t,r};Object.defineProperty(exports,"__esModule",{value:!0});const r=t(require("./text")),o=require("./math"),e=require("./vector");let n,i,a,s,l;function c(t){exports.size.set(t),n=o.range(exports.size.x).map(()=>o.range(exports.size.y).map(()=>void 0)),i=o.range(exports.size.x).map(()=>o.range(exports.size.y).map(()=>void 0)),a=o.range(exports.size.x).map(()=>o.range(exports.size.y).map(()=>void 0)),s=o.range(exports.size.x).map(()=>o.range(exports.size.y).map(()=>void 0)),l=o.range(exports.size.x).map(()=>o.range(exports.size.y).map(()=>void 0))}function p(t,o,e,c={}){let p=Math.floor(o),x=Math.floor(e);const u=p;let d=null!=c.colorPattern?c.colorPattern.split("\n"):void 0;const f=null!=c.backgroundColorPattern?c.backgroundColorPattern.split("\n"):void 0,m=null!=c.rotationPattern?c.rotationPattern.split("\n"):void 0,g=null!=c.symbolPattern?c.symbolPattern.split("\n"):void 0;let h=t;if(null!=c.charAndColorPattern){const[t,o]=r.getColorLines(c.charAndColorPattern);h=t.join("\n"),d=o}let z=0,v=0;for(let C=0;C<h.length;C++){const t=h[C];"\n"!==t?p<0||p>=exports.size.x||x<0||x>=exports.size.y?(p++,z++):(n[p][x]=t,i[p][x]=r.getCharFromLines(d,z,v),a[p][x]=r.getCharFromLines(f,z,v),s[p][x]=r.getCharFromLines(m,z,v),l[p][x]=r.getCharFromLines(g,z,v),p++,z++):(p=u,x++,z=0,v++)}}function x(t,o){if(t<0||t>=exports.size.x||o<0||o>=exports.size.y)return;const e=Math.floor(t),c=Math.floor(o),p=n[e][c],x=i[e][c],u=a[e][c],d=s[e][c],f=l[e][c];return{char:p,options:r.getCharOption(x,u,d,f)}}function u(t,o,e,c){if(t<0||t>=exports.size.x||o<0||o>=exports.size.y)return;const p=Math.floor(t),x=Math.floor(o);if(n[p][x]=e,null!=c){if(i[p][x]=c.color,a[p][x]=c.backgroundColor,null==c.angleIndex)s[p][x]=void 0;else{let t=c.angleIndex;c.isMirrorX&&(t|=4),c.isMirrorY&&(t|=8),s[p][x]=r.rotationChars.charAt(t)}l[p][x]=c.isSymbol?"s":void 0}else i[p][x]=a[p][x]=s[p][x]=void 0}function d(){for(let t=0;t<exports.size.x;t++)for(let o=0;o<exports.size.y;o++){const e=n[t][o];if(null==e)continue;const c=i[t][o],p=a[t][o],x=s[t][o],u=l[t][o];r.printChar(e,t*r.letterSize,o*r.letterSize,Object.assign(Object.assign({},r.getCharOption(c,p,x,u)),{scale:1,alpha:1}))}}function f(){for(let t=0;t<exports.size.x;t++)for(let r=0;r<exports.size.y;r++)n[t][r]=i[t][r]=a[t][r]=s[t][r]=l[t][r]=void 0}function m(){return{charGrid:n.map(t=>[].concat(t)),colorGrid:i.map(t=>[].concat(t)),backgroundColorGrid:a.map(t=>[].concat(t)),rotationGrid:s.map(t=>[].concat(t)),symbolGrid:l.map(t=>[].concat(t))}}function g(t){n=t.charGrid.map(t=>[].concat(t)),i=t.colorGrid.map(t=>[].concat(t)),a=t.backgroundColorGrid.map(t=>[].concat(t)),s=t.rotationGrid.map(t=>[].concat(t)),l=t.symbolGrid.map(t=>[].concat(t))}exports.size=new e.Vector,exports.init=c,exports.print=p,exports.getCharAt=x,exports.setCharAt=u,exports.draw=d,exports.clear=f,exports.getState=m,exports.setState=g;
  },{"./text":"/sou","./math":"pR4u","./vector":"HIZ7"}],"o5Dp":[function(require,module,exports) {
  var define;
  var e;!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof e&&e.amd?e([],n):"object"==typeof exports?exports.sss=n():t.sss=n()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){var n;!function(e){"use strict";String.fromCharCode;var t=2*+Math.PI,n=16,r=1,a=Math.sin,o=Math.pow,i=Math.abs;e.SampleRate=0,e.Sec=0,e.SetSampleRate=function(t){e.SampleRate=0|t,e.Sec=0|t},e.SetSampleRate(void 0!==u?(new u).sampleRate:44100),e.Sound=function(t){var n=new h(t,e.DefaultModules),r=b(n.getSamplesLeft());return n.generate(r),g(r)},e.Sounds=function(t,n,r){var a={},o={};o._audio=a;var i=[];P(t,function(e,t){o[t]=function(){void 0!==a[t]&&(a[t].currentTime=0,a[t].play())},i.push(t)});var u=0,l=i.length;return function o(){if(0!=i.length){var s=i.shift();a[s]=e.Sound(t[s]),r&&r(s,++u,l),window.setTimeout(o,30)}else n&&n(sounds)}(),o},e.SoundsImmediate=function(t){var n={},r={};return r._audio=n,P(t,function(t,a){n[a]=e.Sound(t),r[a]=function(){void 0!==n[a]&&(n[a].currentTime=0,n[a].play())}}),r};var u=window.AudioContext||window.webkitAudioContext;void 0!==u?(e.Node=function(t,n,r,a,o){var i=t.createScriptProcessor(a,0,1),u=new h(n,r||e.DefaultModules);return i.onaudioprocess=function(e){var t=e.outputBuffer.getChannelData(0);u.generate(t),!o&&u.finished&&setTimeout(function(){i.disconnect()},30)},i},e.Live=function(t,n,r){r=r||2048;var a={},o=new u,i=o.createGain();function l(e,t){var n=o.createBufferSource();if(n.buffer=e,null!=t&&null!=n.playbackRate){const e=Math.pow(2,1/12);n.playbackRate.value=Math.pow(e,t/100)}return n.start=n.start||n.noteOn,n}return i.connect(o.destination),a._context=o,a._volume=i,P(t,function(t,u){a[u]=function(){e.Node(o,t,n,r).connect(i)}}),a._close=function(){o.close()},a._play=function(t){e.Node(o,t,n,r).connect(i)},a._createBuffer=function(t){var n=new h(t,e.DefaultModules),r=b(n.getSamplesLeft());return n.generate(r),a._createBufferFromBlock(r)},a._createEmptyBuffer=function(){return a._createBufferFromBlock([0])},a._createBufferFromBlock=function(t){var n=o.createBuffer(1,t.length,e.SampleRate);return n.getChannelData(0).set(t),n},a._playBuffer=function(e,t,n){var r=l(e,n);r.connect(i),r.start(t)},a._playBufferAndConnect=function(e,t,n,r){var a=l(e,r);a.connect(n),n.connect(i),a.start(t)},a._createGain=function(){return o.createGain()},a}):e.Live=function(e,t,n){return null},e.Module={},e.G={};var l=e.stage={PhaseSpeed:0,PhaseSpeedMod:10,Generator:20,SampleMod:30,Volume:40};function s(e,t){return e.stage-t.stage}function c(e,t){for(var n=0;n<t.length;n+=1){var r=t[n],a=e[r.name]||{};P(r.params,function(e,t){void 0===a[t]&&(a[t]=e.D)}),e[r.name]=a}}function h(t,n){t=t||{},n=n||e.DefaultModules,t="function"==typeof t?t():JSON.parse(JSON.stringify(t)),this.finished=!1,this.state={SampleRate:t.SampleRate||e.SampleRate},(n=n.slice()).sort(s),this.modules=n,c(t,n);for(var r=0;r<this.modules.length;r+=1){var a=this.modules[r];this.modules[r].setup(this.state,t[a.name])}}function f(){return P(e.Module,function(){return{}})}function p(e){for(var t in e)0==F(e[t]).length&&delete e[t]}function d(e){return new Function("$","block","var TAU = Math.PI * 2;\nvar sample;\nvar phase = +$.generatorPhase,\n\tA = +$.generatorA, ASlide = +$.generatorASlide,\n\tB = +$.generatorB, BSlide = +$.generatorBSlide;\n\nfor(var i = 0; i < block.length; i++){\n\tvar phaseSpeed = block[i];\n\tphase += phaseSpeed;\n\tif(phase > TAU){ phase -= TAU };\n\tA += ASlide; B += BSlide;\n   A = A < 0 ? 0 : A > 1 ? 1 : A;\n   B = B < 0 ? 0 : B > 1 ? 1 : B;\n"+e+"\tblock[i] = sample;\n}\n\n$.generatorPhase = phase;\n$.generatorA = A;\n$.generatorB = B;\nreturn block.length;\n")}function g(t){"undefined"!=typeof Float32Array&&S(t instanceof Float32Array,"data must be an Float32Array");var a=r*n>>3,o=e.SampleRate*a,i=function(e){if("undefined"==typeof Uint8Array)for(var t=new Array(e),n=0;n<t.length;n++)t[n]=0;return new Uint8Array(e)}(44+2*t.length),u=0;function l(e){for(var t=0;t<e.length;t+=1)i[u]=e.charCodeAt(t),u++}function s(e,t){t<=0||(i[u]=255&e,u++,s(e>>8,t-1))}return l("RIFF"),s(36+2*t.length,4),l("WAVEfmt "),s(16,4),s(1,2),s(r,2),s(e.SampleRate,4),s(o,4),s(a,2),s(n,2),l("data"),s(2*t.length,4),m(i.subarray(u),t),new Audio("data:audio/wav;base64,"+function(e){for(var t="",n=0;n<e.length;n+=32768){var r=Math.min(n+32768,e.length);t+=String.fromCharCode.apply(null,e.subarray(n,r))}return btoa(t)}(i))}function m(e,t){S(e.length/2==t.length,"the target buffer must be twice as large as the iinput");for(var n=0,r=0;r<t.length;r++){var a=32767*+t[r]|0;a=a<-32768?-32768:32767<a?32767:a,a+=a<0?65536:0,e[n]=255&a,e[++n]=a>>8,n++}}function S(e,t){if(!e)throw new Error(t)}function y(e,t,n){return n=+n,(e=+e)<(t=+t)?+t:e>n?+n:+e}function v(e){return(e=+e)<0?0:e>1?1:+e}function P(e,t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r],r));return n}function M(e,t){var n=D();return void 0!==e&&(n*=e),void 0!==t&&(n+=t),n}function L(e){return e[e.length*D()|0]}function F(e){var t=[];for(var n in e)t.push(n);return t}function b(e){if("undefined"==typeof Float32Array)for(var t=new Array(e),n=0;n<t.length;n++)t[n]=0;return new Float32Array(e)}e.InitDefaultParams=c,e.Processor=h,h.prototype={generate:function(e){for(var t=0;t<e.length;t+=1)e[t]=0;if(!this.finished){var n=this.state,r=0|e.length;for(t=0;t<this.modules.length;t+=1){var a=0|this.modules[t].process(n,e.subarray(0,r));r=Math.min(r,a)}for(r<e.length&&(this.finished=!0),t=r;t<e.length;t++)e[t]=0}},getSamplesLeft:function(){for(var e=0,t=0;t<this.state.envelopes.length;t+=1)e+=this.state.envelopes[t].N;return 0===e&&(e=3*this.state.SampleRate),e}},e.Module.Frequency={name:"Frequency",params:{Start:{L:30,H:1800,D:440},Min:{L:30,H:1800,D:30},Max:{L:30,H:1800,D:1800},Slide:{L:-1,H:1,D:0},DeltaSlide:{L:-1,H:1,D:0},RepeatSpeed:{L:0,H:3,D:0},ChangeAmount:{L:-12,H:12,D:0},ChangeSpeed:{L:0,H:1,D:0}},stage:l.PhaseSpeed,setup:function(e,n){var r=e.SampleRate;e.phaseParams=n,e.phaseSpeed=n.Start*t/r,e.phaseSpeedMax=n.Max*t/r,e.phaseSpeedMin=n.Min*t/r,e.phaseSpeedMin=Math.min(e.phaseSpeedMin,e.phaseSpeed),e.phaseSpeedMax=Math.max(e.phaseSpeedMax,e.phaseSpeed),e.phaseSlide=1+64*o(n.Slide,3)/r,e.phaseDeltaSlide=o(n.DeltaSlide,3)/(1e3*r),e.repeatTime=0,e.repeatLimit=1/0,n.RepeatSpeed>0&&(e.repeatLimit=n.RepeatSpeed*r),e.arpeggiatorTime=0,e.arpeggiatorLimit=n.ChangeSpeed*r,0==n.ChangeAmount&&(e.arpeggiatorLimit=1/0),e.arpeggiatorMod=1+n.ChangeAmount/12},process:function(e,t){for(var n=+e.phaseSpeed,r=+e.phaseSpeedMin,a=+e.phaseSpeedMax,o=+e.phaseSlide,i=+e.phaseDeltaSlide,u=e.repeatTime,l=e.repeatLimit,s=e.arpeggiatorTime,c=e.arpeggiatorLimit,h=e.arpeggiatorMod,f=0;f<t.length;f++){if(n=(n*=o+=i)<r?r:n>a?a:n,u>l)return this.setup(e,e.phaseParams),f+this.process(e,t.subarray(f))-1;u++,s>c&&(n*=h,s=0,c=1/0),s++,t[f]+=n}return e.repeatTime=u,e.arpeggiatorTime=s,e.arpeggiatorLimit=c,e.phaseSpeed=n,e.phaseSlide=o,t.length}},e.Module.Vibrato={name:"Vibrato",params:{Depth:{L:0,H:1,D:0},DepthSlide:{L:-1,H:1,D:0},Frequency:{L:.01,H:48,D:0},FrequencySlide:{L:-1,H:1,D:0}},stage:l.PhaseSpeedMod,setup:function(e,n){var r=e.SampleRate;e.vibratoPhase=0,e.vibratoDepth=n.Depth,e.vibratoPhaseSpeed=n.Frequency*t/r,e.vibratoPhaseSpeedSlide=1+3*o(n.FrequencySlide,3)/r,e.vibratoDepthSlide=n.DepthSlide/r},process:function(e,n){var r=+e.vibratoPhase,o=+e.vibratoDepth,i=+e.vibratoPhaseSpeed,u=+e.vibratoPhaseSpeedSlide,l=+e.vibratoDepthSlide;if(0==o&&l<=0)return n.length;for(var s=0;s<n.length;s++)(r+=i)>t&&(r-=t),n[s]+=n[s]*a(r)*o,i*=u,o=v(o+=l);return e.vibratoPhase=r,e.vibratoDepth=o,e.vibratoPhaseSpeed=i,n.length}},e.Module.Generator={name:"Generator",params:{Func:{C:e.G,D:"square"},A:{L:0,H:1,D:0},B:{L:0,H:1,D:0},ASlide:{L:-1,H:1,D:0},BSlide:{L:-1,H:1,D:0}},stage:l.Generator,setup:function(t,n){t.generatorPhase=0,"string"==typeof n.Func?t.generator=e.G[n.Func]:t.generator=n.Func,"object"==typeof t.generator&&(t.generator=t.generator.create()),S("function"==typeof t.generator,"generator must be a function"),t.generatorA=n.A,t.generatorASlide=n.ASlide,t.generatorB=n.B,t.generatorBSlide=n.BSlide},process:function(e,t){return e.generator(e,t)}},e.Module.Guitar={name:"Guitar",params:{A:{L:0,H:1,D:1},B:{L:0,H:1,D:1},C:{L:0,H:1,D:1}},stage:l.Generator,setup:function(e,t){e.guitarA=t.A,e.guitarB=t.B,e.guitarC=t.C,e.guitarBuffer=b(65536),e.guitarHead=0;for(var n=e.guitarBuffer,r=0;r<n.length;r++)n[r]=2*D()-1},process:function(e,n){for(var r=65536,a=r-1,o=+e.guitarA,i=+e.guitarB,u=+e.guitarC,l=o+i+u,s=e.guitarHead,c=e.guitarBuffer,h=0;h<n.length;h++){var f=t/n[h]|0,p=s-(f=f>r?r:f)+r&a;c[s]=(c[p-0+r&a]*o+c[p-1+r&a]*i+c[p-2+r&a]*u)/l,n[h]=c[s],s=s+1&a}return e.guitarHead=s,n.length}},e.Module.Filter={name:"Filter",params:{LP:{L:0,H:1,D:1},LPSlide:{L:-1,H:1,D:0},LPResonance:{L:0,H:1,D:0},HP:{L:0,H:1,D:0},HPSlide:{L:-1,H:1,D:0}},stage:l.SampleMod+0,setup:function(e,t){e.FilterEnabled=t.HP>1e-6||t.LP<1-1e-6,e.LPEnabled=t.LP<1-1e-6,e.LP=o(t.LP,3)/10,e.LPSlide=1+100*t.LPSlide/e.SampleRate,e.LPPos=0,e.LPPosSlide=0,e.LPDamping=5/(1+20*o(t.LPResonance,2))*(.01+t.LP),e.LPDamping=1-Math.min(e.LPDamping,.8),e.HP=o(t.HP,2)/10,e.HPPos=0,e.HPSlide=1+100*t.HPSlide/e.SampleRate},enabled:function(e){return e.FilterEnabled},process:function(e,t){if(!this.enabled(e))return t.length;for(var n=+e.LP,r=+e.LPPos,a=+e.LPPosSlide,o=+e.LPSlide,i=+e.LPDamping,u=+e.LPEnabled,l=+e.HP,s=+e.HPPos,c=+e.HPSlide,h=0;h<t.length;h++){(l>1e-6||l<-1e-6)&&(l=(l*=c)<1e-6?1e-6:l>.1?.1:l);var f=r;n=(n*=o)<0?n=0:n>.1?.1:n;var p=t[h];u?(a+=(p-r)*n,a*=i):(r=p,a=0),s+=(r+=a)-f,s*=1-l,t[h]=s}return e.LPPos=r,e.LPPosSlide=a,e.LP=n,e.HP=l,e.HPPos=s,t.length}},e.Module.Phaser={name:"Phaser",params:{Offset:{L:-1,H:1,D:0},Sweep:{L:-1,H:1,D:0}},stage:l.SampleMod+1,setup:function(e,t){e.phaserBuffer=b(1024),e.phaserPos=0,e.phaserOffset=1020*o(t.Offset,2),e.phaserOffsetSlide=4e3*o(t.Sweep,3)/e.SampleRate},enabled:function(e){return i(e.phaserOffsetSlide)>1e-6||i(e.phaserOffset)>1e-6},process:function(e,t){if(!this.enabled(e))return t.length;for(var n=e.phaserBuffer,r=0|e.phaserPos,a=+e.phaserOffset,o=+e.phaserOffsetSlide,i=0;i<t.length;i++){(a+=o)<0&&(a=-a,o=-o),a>1023&&(a=1023,o=0),n[r]=t[i];var u=r-(0|a)+1024&1023;t[i]+=n[u],r=r+1&1023|0}return e.phaserPos=r,e.phaserOffset=a,t.length}},e.Module.Volume={name:"Volume",params:{Master:{L:0,H:1,D:.5},Attack:{L:.001,H:1,D:.01},Sustain:{L:0,H:2,D:.3},Punch:{L:0,H:3,D:1},Decay:{L:.001,H:2,D:1}},stage:l.Volume,setup:function(e,t){var n=e.SampleRate,r=t.Master,a=r*(1+t.Punch);e.envelopes=[{S:0,E:r,N:t.Attack*n|0},{S:a,E:r,N:t.Sustain*n|0},{S:r,E:0,N:t.Decay*n|0}];for(var o=0;o<e.envelopes.length;o+=1){var i=e.envelopes[o];i.G=(i.E-i.S)/i.N}},process:function(e,t){for(var n=0;e.envelopes.length>0&&n<t.length;){for(var r=e.envelopes[0],a=r.S,o=r.G,i=0|Math.min(t.length-n,r.N),u=n+i|0;n<u;n+=1)t[n]*=a,a=y(a+=o,0,10);r.S=a,r.N-=i,r.N<=0&&e.envelopes.shift()}return n}},e.DefaultModules=[e.Module.Frequency,e.Module.Vibrato,e.Module.Generator,e.Module.Filter,e.Module.Phaser,e.Module.Volume],e.DefaultModules.sort(s),e.EmptyParams=f,e._RemoveEmptyParams=p,e.Preset={Reset:function(){return f()},Coin:function(){var e=f();return e.Frequency.Start=M(880,660),e.Volume.Sustain=M(.1),e.Volume.Decay=M(.4,.1),e.Volume.Punch=M(.3,.3),M()<.5&&(e.Frequency.ChangeSpeed=M(.15,.1),e.Frequency.ChangeAmount=M(8,4)),p(e),e},Laser:function(){var e=f();return e.Generator.Func=L(["square","saw","sine"]),M()<.33?(e.Frequency.Start=M(880,440),e.Frequency.Min=M(.1),e.Frequency.Slide=M(.3,-.8)):(e.Frequency.Start=M(1200,440),e.Frequency.Min=e.Frequency.Start-M(880,440),e.Frequency.Min<110&&(e.Frequency.Min=110),e.Frequency.Slide=M(.3,-1)),M()<.5?(e.Generator.A=M(.5),e.Generator.ASlide=M(.2)):(e.Generator.A=M(.5,.4),e.Generator.ASlide=M(.7)),e.Volume.Sustain=M(.2,.1),e.Volume.Decay=M(.4),M()<.5&&(e.Volume.Punch=M(.3)),M()<.33&&(e.Phaser.Offset=M(.2),e.Phaser.Sweep=M(.2)),M()<.5&&(e.Filter.HP=M(.3)),p(e),e},Explosion:function(){var e=f();return e.Generator.Func="noise",M()<.5?(e.Frequency.Start=M(440,40),e.Frequency.Slide=M(.4,-.1)):(e.Frequency.Start=M(1600,220),e.Frequency.Slide=M(-.2,-.2)),M()<.2&&(e.Frequency.Slide=0),M()<.3&&(e.Frequency.RepeatSpeed=M(.5,.3)),e.Volume.Sustain=M(.3,.1),e.Volume.Decay=M(.5),e.Volume.Punch=M(.6,.2),M()<.5&&(e.Phaser.Offset=M(.9,-.3),e.Phaser.Sweep=M(-.3)),M()<.33&&(e.Frequency.ChangeSpeed=M(.3,.6),e.Frequency.ChangeAmount=M(24,-12)),p(e),e},Powerup:function(){var e=f();return M()<.5?e.Generator.Func="saw":e.Generator.A=M(.6),e.Frequency.Start=M(220,440),M()<.5?(e.Frequency.Slide=M(.5,.2),e.Frequency.RepeatSpeed=M(.4,.4)):(e.Frequency.Slide=M(.2,.05),M()<.5&&(e.Vibrato.Depth=M(.6,.1),e.Vibrato.Frequency=M(30,10))),e.Volume.Sustain=M(.4),e.Volume.Decay=M(.4,.1),p(e),e},Hit:function(){var e=f();return e.Generator.Func=L(["square","saw","noise"]),e.Generator.A=M(.6),e.Generator.ASlide=M(1,-.5),e.Frequency.Start=M(880,220),e.Frequency.Slide=-M(.4,.3),e.Volume.Sustain=M(.1),e.Volume.Decay=M(.2,.1),M()<.5&&(e.Filter.HP=M(.3)),p(e),e},Jump:function(){var e=f();return e.Generator.Func="square",e.Generator.A=M(.6),e.Frequency.Start=M(330,330),e.Frequency.Slide=M(.4,.2),e.Volume.Sustain=M(.3,.1),e.Volume.Decay=M(.2,.1),M()<.5&&(e.Filter.HP=M(.3)),M()<.3&&(e.Filter.LP=M(-.6,1)),p(e),e},Select:function(){var e=f();return e.Generator.Func=L(["square","saw"]),e.Generator.A=M(.6),e.Frequency.Start=M(660,220),e.Volume.Sustain=M(.1,.1),e.Volume.Decay=M(.2),e.Filter.HP=.2,p(e),e},Lucky:function(){var t=f();return P(t,function(t,n){P(e.Module[n].params,function(e,n){if(e.C){var r=F(e.C);t[n]=r[r.length*D()|0]}else t[n]=D()*(e.H-e.L)+e.L})}),t.Volume.Master=.4,t.Filter={},p(t),t}},e.G.unoise=d("sample = Math.random();"),e.G.sine=d("sample = Math.sin(phase);"),e.G.saw=d("sample = 2*(phase/TAU - ((phase/TAU + 0.5)|0));"),e.G.triangle=d("sample = Math.abs(4 * ((phase/TAU - 0.25)%1) - 2) - 1;"),e.G.square=d("var s = Math.sin(phase); sample = s > A ? 1.0 : s < A ? -1.0 : A;"),e.G.synth=d("sample = Math.sin(phase) + .5*Math.sin(phase/2) + .3*Math.sin(phase/4);"),e.G.noise=d("if(phase % TAU < 4){__noiseLast = Math.random() * 2 - 1;} sample = __noiseLast;"),e.G.string={create:function(){for(var e=65536,t=e-1,n=b(e),r=0;r<n.length;r++)n[r]=2*D()-1;var a=0;return function(r,o){for(var i=2*Math.PI,u=+r.generatorA,l=+r.generatorASlide,s=+r.generatorB,c=+r.generatorBSlide,h=n,f=0;f<o.length;f++){var p=o[f];u=(u+=l)<0?0:u>1?1:u,s=(s+=c)<0?0:s>1?1:s;var d=a-(i/p|0)+e&t,g=(1*h[d-0+e&t]+h[d-1+e&t]*u+h[d-2+e&t]*s)/(1+u+s);h[a]=g,o[f]=h[a],a=a+1&t}return r.generatorA=u,r.generatorB=s,o.length}}},e.CreateAudio=g,e.DownloadAsFile=function(e){S(e instanceof Audio,"input must be an Audio object"),document.location.href=e.src},e.Util={},e.Util.CopyFToU8=m,e._createFloatArray=b;var A=Math.random;function D(){return A()}e.setRandomFunc=function(e){A=e}}(n={}),e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0);let a,o;t.Preset=r.Preset;let i,u,l={},s={},c=[];const h={c:t.Preset.Coin,l:t.Preset.Laser,e:t.Preset.Explosion,p:t.Preset.Powerup,h:t.Preset.Hit,j:t.Preset.Jump,s:t.Preset.Select,u:t.Preset.Lucky},f=function(e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}(h);let p=.5,d=!1;function g(e){null!=a&&(a._volume.gain.value=e)}function m(){null!=a&&T(c,e=>e.stop())}let S;function y(e=32,t=.25,n,r=60,a=1,i=0,u=0,l=1,s=!1,c=!1,h=!1,f=!1,p=null){const d=new D(n,v(r),a);if(d.noteInterval=t,null!=S&&s)d.noteRatios=S.noteRatios;else{const t=null!=p?function(e,t){return B(e,()=>o.get()>=t)}(e,p):function(e){let t=x(e,!1),n=4;for(;n<=e;)t=P(t,n),n*=2;return t}(e);d.noteRatios=function(e,t,n,r,a){let i=o.get(),u=o.get(-.5,.5),l=e.length/F.length,s=[];return e.forEach((e,n)=>{let c=Math.floor(n/l),h=n%l;if(a&&c===Math.floor(F.length/2))return s.push(s[h]),void(null!=s[h]&&(i=s[h]));e?(s.push(i),u+=o.get(-.25,.25),i+=u*r,(o.get()<.2||i<=t||i>=1)&&(i-=2*u,u*=-1)):s.push(null)}),s}(t,c?0:-1,0,l,f)}return d.notes=function(e,t,n,r){let a=e.length/F.length;return e.map((e,i)=>{if(null==e)return null;let u=Math.floor(i/a),l=F[u][0],s=M[F[u][1]],c=e;r&&(c=Math.floor(2*c)/2);let h=Math.floor(c),f=Math.floor((c-h)*s.length);for(f+=t+o.getInt(-n,n+1);f>=s.length;)f-=s.length,h++;for(;f<0;)f+=s.length,h--;return 100*(l+12*h+s[f])})}(d.noteRatios,i,u,h),S=d,d}function v(e){return 440*Math.pow(2,(e-69)/12)}function P(e,t){let n=x(t,!1);const r=Math.floor(4*Math.abs(o.get()+o.get()-1));for(let a=0;a<r;a++)n[o.getInt(t-1)]=!0;return G(e,(e,r)=>n[r%t]?!e:e)}t.init=function(e=0,n=120,l=60){a=r.Live({}),g(.1),u=e,o=new H,r.setRandomFunc(o.get),t.playInterval=60/n,i=1/l*3},t.setSeed=function(e=0){u=e},t.play=function(e="0",t=2,n=null,r=null,i=null){if(null==a)return;if(null!=l[e])return void l[e].play(i);if(o.setSeed(u+w(e)),null==r){let n=h[e[0]];void 0===n&&(n=o.select(f)),r=x(t,n)}const s=null==n?null:v(n);l[e]=new A(r,s),l[e].play(i)},t.playJingle=function(e="0",t=!1,n=57,r=16,i=.25,l=4,c=null,p=null){if(null==a)return;if(null!=s[e])return void s[e].forEach(e=>e.play(p));if(o.setSeed(u+w(e)),b(),S=null,null==c){let t=h[e[0]];void 0===t&&(t=o.select(f)),c=t}let d=.8;t&&(i/=4,d/=2),s[e]=B(l,()=>{const e=Math.floor(3*Math.abs(o.get()+o.get()-1)),a=Math.floor(10*(o.get()+o.get()-1)),u=t?2:Math.abs(o.get()+o.get()-1),l=o.get()<.25,s=!t&&o.get()<.5,h=o.get()<.5,f=t?o.get()<.25:o.get()<.9,p=o.get(.5),g=y(r,i,c,n,d,e,a,u,l,s,h,f,p);return g.isLooping=!1,g}),s[e].forEach(e=>e.play(p))},t.stopJingles=function(){q(s,e=>T(e,e=>e.stop()))},t.setVolume=g,t.setQuantize=function(e){p=e},t.update=function(){if(null==a)return;const e=a._context.currentTime,t=e+i;return q(l,n=>n.update(e,t)),q(s,n=>T(n,n=>n.update(e,t))),T(c,n=>n.update(e,t)),e},t.reset=function(){m(),l={},s={},c=[]},t.playEmpty=function(){if(null==a)return;if(d)return;const e=a._createEmptyBuffer();a._playBuffer(e,0),d=!0},t.resumeAudioContext=function(){a._context.resume()},t.playParam=function(e){null!=a&&a._play(e)},t.playBgm=function(e="0",n=45,r=32,i=.25,l=4,s=[t.Preset.Laser,t.Preset.Select,t.Preset.Hit,t.Preset.Hit],h=null){if(null==a)return;m(),o.setSeed(u+w(e)),b(),S=null;let f=o.select(s);T(c=B(l,()=>{const e=Math.floor(3*Math.abs(o.get()+o.get()-1)),t=Math.floor(10*(o.get()+o.get()-1)),a=Math.abs(o.get()+o.get()-1),u=o.get()<.25;u||(f=o.select(s));const l=o.get()<.5,c=o.get()<.5,h=o.get()<.9;return y(r,i,f,n,.7,e,t,a,u,l,c,h)}),e=>e.play(h))},t.stopBgm=m;const M=[[0,4,7],[0,3,7],[0,4,7,10],[0,4,7,11],[0,3,7,10]],L=[[[0,0],[7,0],[9,1],[4,1]],[[5,0],[0,0],[5,0],[7,0]],[[5,3],[7,2],[4,4],[9,1]],[[9,1],[2,1],[7,0],[0,0]],[[9,1],[5,0],[7,0],[0,0]]];let F;function b(){const e=o.select(L);F=e.map((e,t)=>[o.get()<.7?e[0]:L[o.getInt(L.length)][t][0],o.get()<.7?e[1]:o.getInt(M.length)])}class A{constructor(e,t=null,n=1){this.isPlaying=!1,this.playedTime=null,Array.isArray(e)||(e=[e]),this.buffers=G(e,e=>(e instanceof Function&&(e=e()),e.Volume.Sustain*=n,e.Volume.Decay*=n,null!=t&&(e.Frequency.Start=t),a._createBuffer(e))),this.gainNode=a._createGain()}play(e=null){this.isPlaying=!0,this.volume=e}stop(){this.isPlaying=!1}update(e,n){if(!this.isPlaying)return;this.isPlaying=!1;const r=t.playInterval*p,a=r>0?Math.ceil(e/r)*r:e;(null==this.playedTime||a>this.playedTime)&&(this.playLater(a),this.playedTime=a)}playLater(e,t=null){null==this.volume?T(this.buffers,n=>a._playBuffer(n,e,t)):(this.gainNode.gain.value=this.volume,T(this.buffers,n=>a._playBufferAndConnect(n,e,this.gainNode,t)))}}class D extends A{constructor(){super(...arguments),this.noteIndex=0,this.noteInterval=.25,this.scheduledTime=null,this.isLooping=!0}play(e=null){super.play(e),this.scheduledTime=null}update(e,t){if(this.isPlaying){null==this.scheduledTime&&this.calcFirstScheduledTime(e);for(let t=0;t<9&&!(this.scheduledTime>=e)&&(this.calcNextScheduledTime(),this.isLooping||0!==this.noteIndex);t++);if(this.scheduledTime<e)this.isLooping?this.scheduledTime=null:this.stop();else for(;this.scheduledTime<=t;){if(null!=this.nextNote&&this.playLater(this.scheduledTime,this.nextNote),!this.isLooping&&0===this.noteIndex)return void this.stop();this.calcNextScheduledTime()}}}calcFirstScheduledTime(e){this.scheduledTime=Math.ceil(e/t.playInterval)*t.playInterval-t.playInterval*this.noteInterval,this.noteIndex=0,this.calcNextScheduledTime()}calcNextScheduledTime(){const e=this.notes.length,n=t.playInterval*this.noteInterval;for(let t=0;t<e&&(this.scheduledTime+=n,this.nextNote=this.notes[this.noteIndex],this.noteIndex++,!(this.noteIndex>=e)||(this.noteIndex=0,this.isLooping))&&null==this.nextNote;t++);}}class H{get(e=1,t=null){return null==t&&(t=e,e=0),this.getToMaxInt()/4294967295*(t-e)+e}getInt(e,t=null){return null==t&&(t=e,e=0),this.getToMaxInt()%(t-e)+e}getPm(){return 2*this.getInt(2)-1}select(e){return e[this.getInt(e.length)]}setSeed(e=null,t=123456789,n=362436069,r=521288629,a=32){this.w=null!=e?e>>>0:Math.floor(4294967295*Math.random())>>>0,this.x=t>>>0,this.y=n>>>0,this.z=r>>>0;for(let o=0;o<a;o++)this.getToMaxInt();return this}getToMaxInt(){const e=this.x^this.x<<11;return this.x=this.y,this.y=this.z,this.z=this.w,this.w=(this.w^this.w>>>19^e^e>>>8)>>>0,this.w}constructor(){this.setSeed(),this.get=this.get.bind(this),this.getToMaxInt=this.getToMaxInt.bind(this)}}function w(e){let t=0;const n=e.length;for(let r=0;r<n;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function x(e,t){let n=[];for(let r=0;r<e;r++)n.push(t);return n}function B(e,t){let n=[];for(let r=0;r<e;r++)n.push(t(r));return n}function T(e,t){for(let n=0;n<e.length;n++)t(e[n])}function q(e,t){for(let n in e)t(e[n])}function G(e,t){let n=[];for(let r=0;r<e.length;r++)n.push(t(e[r],r));return n}}])});
  },{}],"+iJG":[function(require,module,exports) {
  "use strict";var e=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)Object.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t.default=e,t};Object.defineProperty(exports,"__esModule",{value:!0});const t=e(require("./view")),s=e(require("./keyboard")),r=e(require("./pointer")),i=e(require("./text")),n=e(require("./terminal")),o=require("./math"),a=require("./vector"),u=require("./random"),l=e(require("sounds-some-sounds"));exports.stickAngle=0,exports.isPressed=!1,exports.isJustPressed=!1,exports.isJustReleased=!1,exports.random=new u.Random;let c,d,p=new a.Vector,P=new a.Vector,g=0;const x={viewSize:{x:126,y:126},bodyBackground:"#111",viewBackground:"black",isUsingVirtualPad:!0};let k,y=0;function w(e,t,s){c=e,d=t,k=Object.assign(Object.assign({},x),s),window.addEventListener("load",f)}function b(){s.clearJustPressed(),r.clearJustPressed()}function f(){t.init(k.viewSize,k.bodyBackground,k.viewBackground),p.set(t.size.x/2,t.size.y/2);const e={x:Math.ceil(t.size.x/i.letterSize),y:Math.ceil(t.size.y/i.letterSize)};n.init(e),s.init({onKeyDown:l.playEmpty,isUsingStickKeysAsButton:!0}),r.init(t.canvas,t.size,{onPointerDownOrUp:l.playEmpty}),i.init(),c(),h()}function h(){requestAnimationFrame(h);const e=window.performance.now();if(!(e-g<1e3/60-5)){if(g=e,l.update(),exports.stickAngle=-1,s.update(),s.stickAngle>=0&&(exports.stickAngle=s.stickAngle),r.update(),r.isPressed&&(r.isJustPressed&&r.setTargetPos(p),P.set(r.targetPos).sub(p),P.length>10)){const e=P.getAngle()/(Math.PI/4);exports.stickAngle=o.wrap(Math.round(e),0,8)}if(exports.isPressed=s.isPressed||r.isPressed,exports.isJustPressed=s.isJustPressed||r.isJustPressed,exports.isJustReleased=s.isJustReleased||r.isJustReleased,d(),t.update(),k.isUsingVirtualPad&&r.isPressed){i.print("c",t.size.x/2-2,t.size.y/2-2,{colorPattern:"b",backgroundColorPattern:"t",symbolPattern:"s",alpha:.5});let e="c",s="k";exports.stickAngle>=0&&(e=exports.stickAngle%2==0?"a":"z",s="kljh".charAt(Math.floor(exports.stickAngle/2))),i.print(e,r.targetPos.x-2,r.targetPos.y-2,{colorPattern:"g",backgroundColorPattern:"t",symbolPattern:"s",rotationPattern:s,alpha:.5})}10===++y&&i.enableCache()}}exports.init=w,exports.clearJustPressed=b;
  },{"./view":"YCKg","./keyboard":"+kme","./pointer":"iUdv","./text":"/sou","./terminal":"h6s+","./math":"pR4u","./vector":"HIZ7","./random":"iXZc","sounds-some-sounds":"o5Dp"}],"yTBb":[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});class t{constructor(){this.pool=exports.pool,this.isAlive=!0,this.ticks=0,this.updaterPool=new i,this.priority=1}remove(){this.isAlive&&(null!=this.onRemove&&this.onRemove(),this.isAlive=!1)}addUpdater(t,i=1){const e=new s(t,i,this);return this.updaterPool.add(e),e}setPool(t){this.pool=t}setPriority(t){this.priority=t,this.pool.enablePriority()}init(t,...s){this.func=t,t(this,...s),this.pool.add(this)}update(){this.updaterPool.update(),this.ticks++}}exports.Actor=t;class s{constructor(t,s,i){this.updateFunc=t,this.interval=s,this.actor=i,this.isAlive=!0,this.ticks=0,this.intervalTicks=0,this.func=t}remove(){this.isAlive=!1}setInterval(t){this.interval=t}update(){this.intervalTicks--,this.intervalTicks<=0&&(this.updateFunc(this,this.actor),this.intervalTicks=this.interval),this.ticks++}}exports.Updater=s;class i{constructor(){this.instances=[],this.isRemovingAllInstances=!1,this.isPriorityEnabled=!1}add(t){this.instances.push(t)}update(){this.isPriorityEnabled&&(this.instances=h(this.instances,(t,s)=>s.priority-t.priority));for(let t=0;t<this.instances.length;){if(this.isRemovingAllInstances){this.isRemovingAllInstances=!1;break}const s=this.instances[t];s.isAlive&&s.update(),s.isAlive?t++:this.instances.splice(t,1)}}get(t){return null==t?this.instances.filter(t=>t.isAlive):this.instances.filter(s=>s.func===t&&s.isAlive)}removeAll(){this.instances.forEach(t=>{t.remove()}),this.instances=[],this.isRemovingAllInstances=!0}enablePriority(){this.isPriorityEnabled=!0}}exports.Pool=i,exports.pool=new i,exports.updaterPool=new i;let e=t;function o(t,...s){const i=new e;return i.init(t,...s),i}function n(t,i=1){const e=new s(t,i);return exports.updaterPool.add(e),e}function r(){exports.pool.update(),exports.updaterPool.update()}function l(){exports.pool.removeAll(),exports.updaterPool.removeAll()}function a(t){e=t}function h(t,s){const i=t.map((t,s)=>[t,s]);return i.sort((t,i)=>{const e=s(t[0],i[0]);return 0!==e?e:t[1]-i[1]}),i.map(t=>t[0])}exports.spawn=o,exports.addUpdater=n,exports.update=r,exports.reset=l,exports.setActorClass=a;
  },{}],"ZCfc":[function(require,module,exports) {
  "use strict";var t=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(exports,"__esModule",{value:!0});const e=require("../util/main"),n=t(require("../util/view")),i=t(require("../util/text")),s=t(require("../util/terminal")),l=t(require("../util/simpleGameActor")),o=require("../util/vector"),a=require("../util/math"),r=t(require("sounds-some-sounds"));let w,c,p={title:A,inGame:P,gameOver:J},d=0,h=0;function u(){r.init(10),l.setActorClass(q),i.defineSymbols(M,"A"),V()}function m(){s.clear(),n.clear(),n.context.fillStyle="black",n.context.fillRect(0,43,120,17),--g<0&&(g=100/y*e.random.get(.75,1),l.spawn(C)),p[w](),l.update(),h>0&&s.print(`${h}`,0,0,{colorPattern:"lllllll"}),s.draw(),d++}e.init(u,m,{viewSize:{x:120,y:60},bodyBackground:"#ddd",viewBackground:"#eee",isUsingVirtualPad:!1});let v,x,y=1,g=0;function f(){r.playJingle("l_st"),w="inGame",l.reset(),d=0,h=0,c=a.range(2).map(t=>l.spawn(b,t)),y=1,g=0,v=100,x=!1,l.spawn(I)}function P(){y+=2e-4,h>=v&&(v+=100,x=!0),150===d&&r.playBgm()}function I(t){let n=!1,i=!1,o=0,a=1,w=0,p=!0;t.vel.set(.3,0),t.pos.set(60,40),t.addUpdater(()=>{if(i)return t.vel.y+=.2,void(t.pos.y>66&&(t.remove(),k()));if(t.pos.clamp(0,120,0,60),e.isJustPressed&&(r.play("l_tn"),t.vel.x*=-1),n?(t.vel.y+=.1,t.pos.y>=40&&(n=!1,t.vel.y=0,t.pos.y=40)):e.isJustReleased&&(p?p=!1:(r.play("j_jm0"),n=!0,t.vel.y=-2/Math.sqrt(y))),t.rotationPattern=t.vel.x>0?"k":"n",w<=0?l.pool.get(C).forEach(e=>{w<=0&&t.testCollision(e)&&(r.setQuantize(0),r.playJingle("l_ht2",!0),r.setQuantize(.5),c.length>0?(c[c.length-1].dead(),c.pop(),w=100):(r.stopBgm(),i=!0,t.rotationPattern=t.vel.x>0?"j":"b",t.animInterval=9999999,t.vel.x*=-2,t.vel.y=-3/Math.sqrt(y)))}):(w--,t.colorPattern=w>0&&w%30<15?"w":"l"),l.pool.get(R).forEach(e=>{t.testCollision(e)&&(r.play("c_cg0"),h+=a,a++,o=60,e.remove())}),o>0&&(0===--o&&(a=1),a>1)){const t=`+${a}`;s.print(t,20-t.length,0,{colorPattern:"lllll"})}l.pool.get(_).forEach(e=>{t.testCollision(e)&&(r.play("p_ex"),c.push(l.spawn(b,c.length)),e.remove())})})}function C(t){const n=e.random.getInt(6);switch(t.animChar="C",t.collidingRect.set(4,1),n){case 0:case 1:t.pos.set(-3,0===n?40:e.random.get(20,30)),t.vel.set(.4,0);break;case 2:case 3:t.pos.set(123,2===n?40:e.random.get(20,30)),t.vel.set(-.4,0),t.rotationPattern="n";break;case 4:case 5:t.pos.set(e.random.get(20,100),-3),t.vel.set(0,.3),t.rotationPattern="l",t.collidingRect.set(1,4)}if(n<4&&x){if(c.length<2){const e=new o.Vector(t.pos);e.x-=25*t.vel.x,e.y-=25*t.vel.y,l.spawn(_,e,t.vel,t.rotationPattern)}x=!1}else if(e.random.get()<.2){const e=new o.Vector(t.pos);e.x-=5*t.vel.x,e.y-=5*t.vel.y,a.range(9).forEach(n=>{e.x-=15*t.vel.x,e.y-=15*t.vel.y,l.spawn(R,e,t.vel,t.rotationPattern)})}t.animInterval=20,t.addUpdater(()=>{(t.pos.x<-6||t.pos.x>126||t.pos.y>40)&&t.remove()})}function R(t,e,n,i){t.pos.set(e),t.vel.set(n),t.animChar="E",t.animInterval=15,t.rotationPattern=i,t.addUpdater(()=>{(t.vel.x<0&&t.pos.x<-6||t.vel.x>0&&t.pos.x>126||t.pos.y>40)&&t.remove()})}function _(t,e,n,i){t.pos.set(e),t.vel.set(n),t.animChar="G",t.animInterval=9999999,t.rotationPattern=i,t.addUpdater(()=>{(t.vel.x<0&&t.pos.x<-6||t.vel.x>0&&t.pos.x>126||t.pos.y>40)&&t.remove()})}function b(t,e){t.pos.set(6*e+3,56),t.colorPattern="w",t.animChar="G",t.animInterval=45,t.animInterval=9999999;let n=!1;t.addUpdater(()=>{n&&(t.vel.y+=.2,t.pos.y>63&&t.remove())}),t.dead=(()=>{n=!0,t.rotationPattern="n",t.vel.x=1,t.vel.y=-2/Math.sqrt(y)})}class q extends l.Actor{constructor(){super(...arguments),this.pos=new o.Vector,this.vel=new o.Vector,this.animInterval=30,this.animCount=2,this.animChar="A",this.char="A",this.animIndex=0,this.animIndexVel=1,this.rotationPattern="k",this.collidingRect=new o.Vector(4,4),this.colorPattern="l"}update(){super.update(),this.pos.x+=this.vel.x*y,this.pos.y+=this.vel.y*y,this.ticks%this.animInterval==0&&(this.animIndex+=this.animIndexVel,(this.animIndex<0||this.animIndex>=this.animCount)&&(this.animIndexVel*=-1,this.animIndex+=2*this.animIndexVel)),i.print(String.fromCharCode(this.animChar.charCodeAt(0)+this.animIndex),this.pos.x-3,this.pos.y-3,{colorPattern:this.colorPattern,symbolPattern:"s",rotationPattern:this.rotationPattern})}testCollision(t){return Math.abs(this.pos.x-t.pos.x)<(this.collidingRect.x+t.collidingRect.x)/2&&Math.abs(this.pos.y-t.pos.y)<(this.collidingRect.y+t.collidingRect.y)/2}}function V(){w="title",d=0}function A(){s.print("TOBITARO",6,3,{colorPattern:"lllllllll"}),d>30&&s.print("[Press]   Turn",3,8),d>60&&s.print("[Release] Jump",3,9),e.isJustPressed&&f()}function k(){w="gameOver",e.clearJustPressed(),d=0}function J(){s.print("GAME OVER",5,3,{colorPattern:"lllllllll"}),d>20&&e.isJustPressed?f():d>300&&V()}const M=["\nwwwwww\nww w w\nww w w\nwwwwww\n w  w\n w  w\n","\n\nwwwwww\nww w w\nww w w\nwwwwww\nww  ww\n","\nww  w\nwwwwww\nww  w\n","\nww ww\n wwwww\nww ww\n","\nw\nw\nw\n","\n w\nwww\n w\n","\n w w\nwwwww\nwwwww\n www\n  w\n"];
  },{"../util/main":"+iJG","../util/view":"YCKg","../util/text":"/sou","../util/terminal":"h6s+","../util/simpleGameActor":"yTBb","../util/vector":"HIZ7","../util/math":"pR4u","sounds-some-sounds":"o5Dp"}]},{},["ZCfc"], null)