From 7fef4e1b1432253be0641d34faedfdd5538c9ddc Mon Sep 17 00:00:00 2001 From: remarkablemark Date: Sun, 26 May 2024 04:39:12 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20remarkab?= =?UTF-8?q?legames/code-arcade@0be0c24b9a843bb5e28b887252ff7b839fb64a02=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/0-CeOYrilv.js | 7 +++++ assets/index-BalAA-Ol.js | 55 --------------------------------------- assets/index-D8bN0qgI.css | 1 + assets/index-DVUroWR9.css | 1 - assets/index-NDyIR07y.js | 55 +++++++++++++++++++++++++++++++++++++++ index.html | 2 +- 6 files changed, 64 insertions(+), 57 deletions(-) create mode 100644 assets/0-CeOYrilv.js delete mode 100644 assets/index-BalAA-Ol.js create mode 100644 assets/index-D8bN0qgI.css delete mode 100644 assets/index-DVUroWR9.css create mode 100644 assets/index-NDyIR07y.js diff --git a/assets/0-CeOYrilv.js b/assets/0-CeOYrilv.js new file mode 100644 index 0000000..061f23d --- /dev/null +++ b/assets/0-CeOYrilv.js @@ -0,0 +1,7 @@ +function r(){loadSprite("player","sprites/bean.png")}const e=` +add([ + sprite('player'), + pos(80, 40), + area(), +]) +`;function p(){}export{p as afterScript,r as beforeScript,e as script}; diff --git a/assets/index-BalAA-Ol.js b/assets/index-BalAA-Ol.js deleted file mode 100644 index 7c9f467..0000000 --- a/assets/index-BalAA-Ol.js +++ /dev/null @@ -1,55 +0,0 @@ -var Zn=Object.defineProperty;var _n=(i,e,n)=>e in i?Zn(i,e,{enumerable:true,configurable:true,writable:true,value:n}):i[e]=n;var E=(i,e,n)=>{_n(i,typeof e!=="symbol"?e+"":e,n);return n};(function i(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload")){return}for(const f of document.querySelectorAll('link[rel="modulepreload"]')){u(f)}new MutationObserver(f=>{for(const p of f){if(p.type!=="childList"){continue}for(const T of p.addedNodes){if(T.tagName==="LINK"&&T.rel==="modulepreload")u(T)}}}).observe(document,{childList:true,subtree:true});function n(f){const p={};if(f.integrity)p.integrity=f.integrity;if(f.referrerPolicy)p.referrerPolicy=f.referrerPolicy;if(f.crossOrigin==="use-credentials")p.credentials="include";else if(f.crossOrigin==="anonymous")p.credentials="omit";else p.credentials="same-origin";return p}function u(f){if(f.ep)return;f.ep=true;const p=n(f);fetch(f.href,p)}})();var $n=Object.defineProperty;var o=(i,e)=>$n(i,"name",{value:e,configurable:true});var eo=(()=>{for(var i=new Uint8Array(128),e=0;e<64;e++)i[e<26?e+65:e<52?e+71:e<62?e-4:e*4-205]=e;return n=>{for(var u=n.length,f=new Uint8Array((u-(n[u-1]=="=")-(n[u-2]=="="))*3/4|0),p=0,T=0;p>4,f[T++]=q<<4|v>>2,f[T++]=v<<6|X}return f}})();function Le(i){return i*Math.PI/180}o(Le,"deg2rad");function Dt(i){return i*180/Math.PI}o(Dt,"rad2deg");function Ke(i,e,n){return e>n?Ke(i,n,e):Math.min(Math.max(i,e),n)}o(Ke,"clamp");function Ye(i,e,n){if(typeof i=="number"&&typeof e=="number")return i+(e-i)*n;if(i instanceof b&&e instanceof b)return i.lerp(e,n);if(i instanceof ee&&e instanceof ee)return i.lerp(e,n);throw new Error(`Bad value for lerp(): ${i}, ${e}. Only number, Vec2 and Color is supported.`)}o(Ye,"lerp");function Ze(i,e,n,u,f){return u+(i-e)/(n-e)*(f-u)}o(Ze,"map");function an(i,e,n,u,f){return Ke(Ze(i,e,n,u,f),u,f)}o(an,"mapc");var oe;var b=(oe=class{constructor(e=0,n=e){E(this,"x",0);E(this,"y",0);this.x=e,this.y=n}static fromAngle(e){let n=Le(e);return new oe(Math.cos(n),Math.sin(n))}clone(){return new oe(this.x,this.y)}add(...e){let n=P(...e);return new oe(this.x+n.x,this.y+n.y)}sub(...e){let n=P(...e);return new oe(this.x-n.x,this.y-n.y)}scale(...e){let n=P(...e);return new oe(this.x*n.x,this.y*n.y)}dist(...e){let n=P(...e);return this.sub(n).len()}sdist(...e){let n=P(...e);return this.sub(n).slen()}len(){return Math.sqrt(this.dot(this))}slen(){return this.dot(this)}unit(){let e=this.len();return e===0?new oe(0):this.scale(1/e)}normal(){return new oe(this.y,-this.x)}reflect(e){return this.sub(e.scale(2*this.dot(e)))}project(e){return e.scale(e.dot(this)/e.len())}reject(e){return this.sub(this.project(e))}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}angle(...e){let n=P(...e);return Dt(Math.atan2(this.y-n.y,this.x-n.x))}angleBetween(...e){let n=P(...e);return Dt(Math.atan2(this.cross(n),this.dot(n)))}lerp(e,n){return new oe(Ye(this.x,e.x,n),Ye(this.y,e.y,n))}slerp(e,n){let u=this.dot(e),f=this.cross(e),p=Math.atan2(f,u);return this.scale(Math.sin((1-n)*p)).add(e.scale(Math.sin(n*p))).scale(1/f)}isZero(){return this.x===0&&this.y===0}toFixed(e){return new oe(Number(this.x.toFixed(e)),Number(this.y.toFixed(e)))}transform(e){return e.multVec2(this)}eq(e){return this.x===e.x&&this.y===e.y}bbox(){return new xe(this,0,0)}toString(){return`vec2(${this.x.toFixed(2)}, ${this.y.toFixed(2)})`}},o(oe,"Vec2"),E(oe,"LEFT",new oe(-1,0)),E(oe,"RIGHT",new oe(1,0)),E(oe,"UP",new oe(0,-1)),E(oe,"DOWN",new oe(0,1)),oe);function P(...i){if(i.length===1){if(i[0]instanceof b)return new b(i[0].x,i[0].y);if(Array.isArray(i[0])&&i[0].length===2)return new b(...i[0])}return new b(...i)}o(P,"vec2");var J;var ee=(J=class{constructor(e,n,u){E(this,"r",255);E(this,"g",255);E(this,"b",255);this.r=Ke(e,0,255),this.g=Ke(n,0,255),this.b=Ke(u,0,255)}static fromArray(e){return new J(e[0],e[1],e[2])}static fromHex(e){if(typeof e=="number")return new J(e>>16&255,e>>8&255,e>>0&255);if(typeof e=="string"){let n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return new J(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16))}else throw new Error("Invalid hex color format")}static fromHSL(e,n,u){if(n==0)return new J(255*u,255*u,255*u);let f=o((X,S,Q)=>(Q<0&&(Q+=1),Q>1&&(Q-=1),Q<1/6?X+(S-X)*6*Q:Q<1/2?S:Q<2/3?X+(S-X)*(2/3-Q)*6:X),"hue2rgb"),p=u<.5?u*(1+n):u+n-u*n,T=2*u-p,k=f(T,p,e+1/3),q=f(T,p,e),v=f(T,p,e-1/3);return new J(Math.round(k*255),Math.round(q*255),Math.round(v*255))}clone(){return new J(this.r,this.g,this.b)}lighten(e){return new J(this.r+e,this.g+e,this.b+e)}darken(e){return this.lighten(-e)}invert(){return new J(255-this.r,255-this.g,255-this.b)}mult(e){return new J(this.r*e.r/255,this.g*e.g/255,this.b*e.b/255)}lerp(e,n){return new J(Ye(this.r,e.r,n),Ye(this.g,e.g,n),Ye(this.b,e.b,n))}toHSL(){let e=this.r/255,n=this.g/255,u=this.b/255,f=Math.max(e,n,u),p=Math.min(e,n,u),T=(f+p)/2,k=T,q=T;if(f==p)T=k=0;else{let v=f-p;switch(k=q>.5?v/(2-f-p):v/(f+p),f){case e:T=(n-u)/v+(nee.fromHSL(i,e,n),"hsl2rgb");var lt;var ge=(lt=class{constructor(e,n,u,f){E(this,"x",0);E(this,"y",0);E(this,"w",1);E(this,"h",1);this.x=e,this.y=n,this.w=u,this.h=f}scale(e){return new lt(this.x+this.w*e.x,this.y+this.h*e.y,this.w*e.w,this.h*e.h)}pos(){return new b(this.x,this.y)}clone(){return new lt(this.x,this.y,this.w,this.h)}eq(e){return this.x===e.x&&this.y===e.y&&this.w===e.w&&this.h===e.h}toString(){return`quad(${this.x}, ${this.y}, ${this.w}, ${this.h})`}},o(lt,"Quad"),lt);function he(i,e,n,u){return new ge(i,e,n,u)}o(he,"quad");var Me;var Ue=(Me=class{constructor(e){E(this,"m",[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);e&&(this.m=e)}static translate(e){return new Me([1,0,0,0,0,1,0,0,0,0,1,0,e.x,e.y,0,1])}static scale(e){return new Me([e.x,0,0,0,0,e.y,0,0,0,0,1,0,0,0,0,1])}static rotateX(e){e=Le(-e);let n=Math.cos(e),u=Math.sin(e);return new Me([1,0,0,0,0,n,-u,0,0,u,n,0,0,0,0,1])}static rotateY(e){e=Le(-e);let n=Math.cos(e),u=Math.sin(e);return new Me([n,0,u,0,0,1,0,0,-u,0,n,0,0,0,0,1])}static rotateZ(e){e=Le(-e);let n=Math.cos(e),u=Math.sin(e);return new Me([n,-u,0,0,u,n,0,0,0,0,1,0,0,0,0,1])}translate(e){return this.m[12]+=this.m[0]*e.x+this.m[4]*e.y,this.m[13]+=this.m[1]*e.x+this.m[5]*e.y,this.m[14]+=this.m[2]*e.x+this.m[6]*e.y,this.m[15]+=this.m[3]*e.x+this.m[7]*e.y,this}scale(e){return this.m[0]*=e.x,this.m[4]*=e.y,this.m[1]*=e.x,this.m[5]*=e.y,this.m[2]*=e.x,this.m[6]*=e.y,this.m[3]*=e.x,this.m[7]*=e.y,this}rotate(e){e=Le(-e);let n=Math.cos(e),u=Math.sin(e),f=this.m[0],p=this.m[1],T=this.m[4],k=this.m[5];return this.m[0]=f*n+p*u,this.m[1]=-f*u+p*n,this.m[4]=T*n+k*u,this.m[5]=-T*u+k*n,this}mult(e){let n=[];for(let u=0;u<4;u++)for(let f=0;f<4;f++)n[u*4+f]=this.m[0*4+f]*e.m[u*4+0]+this.m[1*4+f]*e.m[u*4+1]+this.m[2*4+f]*e.m[u*4+2]+this.m[3*4+f]*e.m[u*4+3];return new Me(n)}multVec2(e){return new b(e.x*this.m[0]+e.y*this.m[4]+this.m[12],e.x*this.m[1]+e.y*this.m[5]+this.m[13])}getTranslation(){return new b(this.m[12],this.m[13])}getScale(){if(this.m[0]!=0||this.m[1]!=0){let e=this.m[0]*this.m[5]-this.m[1]*this.m[4],n=Math.sqrt(this.m[0]*this.m[0]+this.m[1]*this.m[1]);return new b(n,e/n)}else if(this.m[4]!=0||this.m[5]!=0){let e=this.m[0]*this.m[5]-this.m[1]*this.m[4],n=Math.sqrt(this.m[4]*this.m[4]+this.m[5]*this.m[5]);return new b(e/n,n)}else return new b(0,0)}getRotation(){if(this.m[0]!=0||this.m[1]!=0){let e=Math.sqrt(this.m[0]*this.m[0]+this.m[1]*this.m[1]);return Dt(this.m[1]>0?Math.acos(this.m[0]/e):-Math.acos(this.m[0]/e))}else if(this.m[4]!=0||this.m[5]!=0){let e=Math.sqrt(this.m[4]*this.m[4]+this.m[5]*this.m[5]);return Dt(Math.PI/2-(this.m[5]>0?Math.acos(-this.m[4]/e):-Math.acos(this.m[4]/e)))}else return 0}getSkew(){if(this.m[0]!=0||this.m[1]!=0){let e=Math.sqrt(this.m[0]*this.m[0]+this.m[1]*this.m[1]);return new b(Math.atan(this.m[0]*this.m[4]+this.m[1]*this.m[5])/(e*e),0)}else if(this.m[4]!=0||this.m[5]!=0){let e=Math.sqrt(this.m[4]*this.m[4]+this.m[5]*this.m[5]);return new b(0,Math.atan(this.m[0]*this.m[4]+this.m[1]*this.m[5])/(e*e))}else return new b(0,0)}invert(){let e=[],n=this.m[10]*this.m[15]-this.m[14]*this.m[11],u=this.m[9]*this.m[15]-this.m[13]*this.m[11],f=this.m[9]*this.m[14]-this.m[13]*this.m[10],p=this.m[8]*this.m[15]-this.m[12]*this.m[11],T=this.m[8]*this.m[14]-this.m[12]*this.m[10],k=this.m[8]*this.m[13]-this.m[12]*this.m[9],q=this.m[6]*this.m[15]-this.m[14]*this.m[7],v=this.m[5]*this.m[15]-this.m[13]*this.m[7],X=this.m[5]*this.m[14]-this.m[13]*this.m[6],S=this.m[4]*this.m[15]-this.m[12]*this.m[7],Q=this.m[4]*this.m[14]-this.m[12]*this.m[6],x=this.m[5]*this.m[15]-this.m[13]*this.m[7],W=this.m[4]*this.m[13]-this.m[12]*this.m[5],me=this.m[6]*this.m[11]-this.m[10]*this.m[7],te=this.m[5]*this.m[11]-this.m[9]*this.m[7],L=this.m[5]*this.m[10]-this.m[9]*this.m[6],fe=this.m[4]*this.m[11]-this.m[8]*this.m[7],R=this.m[4]*this.m[10]-this.m[8]*this.m[6],Be=this.m[4]*this.m[9]-this.m[8]*this.m[5];e[0]=this.m[5]*n-this.m[6]*u+this.m[7]*f,e[4]=-(this.m[4]*n-this.m[6]*p+this.m[7]*T),e[8]=this.m[4]*u-this.m[5]*p+this.m[7]*k,e[12]=-(this.m[4]*f-this.m[5]*T+this.m[6]*k),e[1]=-(this.m[1]*n-this.m[2]*u+this.m[3]*f),e[5]=this.m[0]*n-this.m[2]*p+this.m[3]*T,e[9]=-(this.m[0]*u-this.m[1]*p+this.m[3]*k),e[13]=this.m[0]*f-this.m[1]*T+this.m[2]*k,e[2]=this.m[1]*q-this.m[2]*v+this.m[3]*X,e[6]=-(this.m[0]*q-this.m[2]*S+this.m[3]*Q),e[10]=this.m[0]*x-this.m[1]*S+this.m[3]*W,e[14]=-(this.m[0]*X-this.m[1]*Q+this.m[2]*W),e[3]=-(this.m[1]*me-this.m[2]*te+this.m[3]*L),e[7]=this.m[0]*me-this.m[2]*fe+this.m[3]*R,e[11]=-(this.m[0]*te-this.m[1]*fe+this.m[3]*Be),e[15]=this.m[0]*L-this.m[1]*R+this.m[2]*Be;let K=this.m[0]*e[0]+this.m[1]*e[4]+this.m[2]*e[8]+this.m[3]*e[12];for(let Ee=0;Ee<4;Ee++)for(let we=0;we<4;we++)e[Ee*4+we]*=1/K;return new Me(e)}clone(){return new Me([...this.m])}toString(){return this.m.toString()}},o(Me,"Mat4"),Me);function bi(i,e,n,u=f=>-Math.cos(f)){return i+(u(n)+1)/2*(e-i)}o(bi,"wave");var ro=1103515245;var io=12345;var Qs=2147483648;var pr;var hn=(pr=class{constructor(e){E(this,"seed");this.seed=e}gen(){return this.seed=(ro*this.seed+io)%Qs,this.seed/Qs}genNumber(e,n){return e+this.gen()*(n-e)}genVec2(e,n){return new b(this.genNumber(e.x,n.x),this.genNumber(e.y,n.y))}genColor(e,n){return new ee(this.genNumber(e.r,n.r),this.genNumber(e.g,n.g),this.genNumber(e.b,n.b))}genAny(...e){if(e.length===0)return this.gen();if(e.length===1){if(typeof e[0]=="number")return this.genNumber(0,e[0]);if(e[0]instanceof b)return this.genVec2(P(0,0),e[0]);if(e[0]instanceof ee)return this.genColor(Z(0,0,0),e[0])}else if(e.length===2){if(typeof e[0]=="number"&&typeof e[1]=="number")return this.genNumber(e[0],e[1]);if(e[0]instanceof b&&e[1]instanceof b)return this.genVec2(e[0],e[1]);if(e[0]instanceof ee&&e[1]instanceof ee)return this.genColor(e[0],e[1])}}},o(pr,"RNG"),pr);var Si=new hn(Date.now());function ln(i){return i!=null&&(Si.seed=i),Si.seed}o(ln,"randSeed");function ur(...i){return Si.genAny(...i)}o(ur,"rand");function Bi(...i){return Math.floor(ur(...i))}o(Bi,"randi");function un(i){return ur()<=i}o(un,"chance");function dn(i){return i[Bi(i.length)]}o(dn,"choose");function cn(i,e){return i.pos.x+i.width>e.pos.x&&i.pos.xe.pos.y&&i.pos.y1||f<0||f>1?null:u}o(fn,"testLineLineT");function Tt(i,e){let n=fn(i,e);return n?P(i.p1.x+n*(i.p2.x-i.p1.x),i.p1.y+n*(i.p2.y-i.p1.y)):null}o(Tt,"testLineLine");function pn(i,e){if(dr(i,e.p1)||dr(i,e.p2))return true;let n=i.points();return!!Tt(e,new Ft(n[0],n[1]))||!!Tt(e,new Ft(n[1],n[2]))||!!Tt(e,new Ft(n[2],n[3]))||!!Tt(e,new Ft(n[3],n[0]))}o(pn,"testRectLine");function dr(i,e){return e.x>i.pos.x&&e.xi.pos.y&&e.yNumber.EPSILON)return false;let f=n.dot(u)/u.dot(u);return f>=0&&f<=1}o(gn,"testLinePoint");function Ti(i,e){let n=i.p2.sub(i.p1),u=n.dot(n),f=i.p1.sub(e.center),p=2*n.dot(f),T=f.dot(f)-e.radius*e.radius,k=p*p-4*u*T;if(u<=Number.EPSILON||k<0)return false;if(k==0){let q=-p/(2*u);if(q>=0&&q<=1)return true}else{let q=(-p+Math.sqrt(k))/(2*u),v=(-p-Math.sqrt(k))/(2*u);if(q>=0&&q<=1||v>=0&&v<=1)return true}return Fi(e,i.p1)}o(Ti,"testLineCircle");function Fi(i,e){return i.center.sdist(e)e.y!=u[p].y>e.y&&e.x<(u[p].x-u[f].x)*(e.y-u[f].y)/(u[p].y-u[f].y)+u[f].x&&(n=!n);return n}o(Di,"testPolygonPoint");var ut;var Ft=(ut=class{constructor(e,n){E(this,"p1");E(this,"p2");this.p1=e.clone(),this.p2=n.clone()}transform(e){return new ut(e.multVec2(this.p1),e.multVec2(this.p2))}bbox(){return xe.fromPoints(this.p1,this.p2)}area(){return this.p1.dist(this.p2)}clone(){return new ut(this.p1,this.p2)}},o(ut,"Line"),ut);var ct;var xe=(ct=class{constructor(e,n,u){E(this,"pos");E(this,"width");E(this,"height");this.pos=e.clone(),this.width=n,this.height=u}static fromPoints(e,n){return new ct(e.clone(),n.x-e.x,n.y-e.y)}center(){return new b(this.pos.x+this.width/2,this.pos.y+this.height/2)}points(){return[this.pos,this.pos.add(this.width,0),this.pos.add(this.width,this.height),this.pos.add(0,this.height)]}transform(e){return new or(this.points().map(n=>e.multVec2(n)))}bbox(){return this.clone()}area(){return this.width*this.height}clone(){return new ct(this.pos.clone(),this.width,this.height)}distToPoint(e){return Math.sqrt(this.sdistToPoint(e))}sdistToPoint(e){let n=this.pos,u=this.pos.add(this.width,this.height),f=Math.max(n.x-e.x,0,e.x-u.x),p=Math.max(n.y-e.y,0,e.y-u.y);return f*f+p*p}},o(ct,"Rect"),ct);var It;var zs=(It=class{constructor(e,n){E(this,"center");E(this,"radius");this.center=e.clone(),this.radius=n}transform(e){return new so(this.center,this.radius,this.radius).transform(e)}bbox(){return xe.fromPoints(this.center.sub(P(this.radius)),this.center.add(P(this.radius)))}area(){return this.radius*this.radius*Math.PI}clone(){return new It(this.center,this.radius)}},o(It,"Circle"),It);var ft;var so=(ft=class{constructor(e,n,u){E(this,"center");E(this,"radiusX");E(this,"radiusY");this.center=e.clone(),this.radiusX=n,this.radiusY=u}transform(e){return new ft(e.multVec2(this.center),e.m[0]*this.radiusX,e.m[5]*this.radiusY)}bbox(){return xe.fromPoints(this.center.sub(P(this.radiusX,this.radiusY)),this.center.add(P(this.radiusX,this.radiusY)))}area(){return this.radiusX*this.radiusY*Math.PI}clone(){return new ft(this.center,this.radiusX,this.radiusY)}},o(ft,"Ellipse"),ft);var pt;var or=(pt=class{constructor(e){E(this,"pts");if(e.length<3)throw new Error("Polygons should have at least 3 vertices");this.pts=e}transform(e){return new pt(this.pts.map(n=>e.multVec2(n)))}bbox(){let e=P(Number.MAX_VALUE),n=P(-Number.MAX_VALUE);for(let u of this.pts)e.x=Math.min(e.x,u.x),n.x=Math.max(n.x,u.x),e.y=Math.min(e.y,u.y),n.y=Math.max(n.y,u.y);return xe.fromPoints(e,n)}area(){let e=0,n=this.pts.length;for(let u=0;ue.clone()))}},o(pt,"Polygon"),pt);function wn(i,e){let n=Number.MAX_VALUE,u=P(0);for(let f of[i,e])for(let p=0;pthis.delete(u)}},o(gr,"Registry"),gr);var Ct;var Bt=(Ct=class{constructor(e){E(this,"paused",false);E(this,"cancel");this.cancel=e}static join(e){let n=new Ct(()=>e.forEach(u=>u.cancel()));return Object.defineProperty(n,"paused",{get:()=>e[0].paused,set:u=>e.forEach(f=>f.paused=u)}),n.paused=false,n}},o(Ct,"EventController"),Ct);var mr;var Ce=(mr=class{constructor(){E(this,"handlers",new An)}add(e){let n=this.handlers.pushd((...f)=>{u.paused||e(...f)}),u=new Bt(n);return u}addOnce(e){let n=this.add((...u)=>{n.cancel(),e(...u)});return n}next(){return new Promise(e=>this.addOnce(e))}trigger(...e){this.handlers.forEach(n=>n(...e))}numListeners(){return this.handlers.size}clear(){this.handlers.clear()}},o(mr,"Event"),mr);var wr;var ar=(wr=class{constructor(){E(this,"handlers",{})}on(e,n){return this.handlers[e]||(this.handlers[e]=new Ce),this.handlers[e].add(n)}onOnce(e,n){let u=this.on(e,(...f)=>{u.cancel(),n(...f)});return u}next(e){return new Promise(n=>{this.onOnce(e,(...u)=>n(u[0]))})}trigger(e,...n){this.handlers[e]&&this.handlers[e].trigger(...n)}remove(e){delete this.handlers[e]}clear(){this.handlers={}}numListeners(e){var n;return((n=this.handlers[e])==null?void 0:n.numListeners())??0}},o(wr,"EventHandler"),wr);function Xr(i,e){if(i===e)return true;let n=typeof i,u=typeof e;if(n!==u)return false;if(n==="object"&&u==="object"&&i!==null&&e!==null){if(Array.isArray(i)!==Array.isArray(e))return false;let f=Object.keys(i),p=Object.keys(e);if(f.length!==p.length)return false;for(let T of f){let k=i[T],q=e[T];if(!Xr(k,q))return false}return true}return false}o(Xr,"deepEq");function Vn(i){let e=window.atob(i),n=e.length,u=new Uint8Array(n);for(let f=0;fi.match(/^data:\w+\/\w+;base64,.+/),"isDataURL");var no=o(i=>i.split(".").slice(0,-1).join("."),"getFileName");function Pe(i,e){return(...n)=>{let u=n.length;if(u===i.length)return i(...n);if(u===e.length)return e(...n)}}o(Pe,"overload2");var oo=(()=>{let i=0;return()=>i++})();var ao=o(i=>i instanceof Error?i.message:String(i),"getErrorMessage");var Ar;var ho=(Ar=class{constructor(e=(n,u)=>n0;){let n=Math.floor((e-1)/2);if(!this._compareFn(this._items[e],this._items[n])&&this._items[e]>=this._items[n])break;this.swap(e,n),e=n}}moveDown(e){for(;e=e&&i<=n}o(_e,"betweenInclusive");var Xs={"Joy-Con L+R (STANDARD GAMEPAD Vendor: 057e Product: 200e)":{buttons:{"0":"south","1":"east","2":"west","3":"north","4":"lshoulder","5":"rshoulder","6":"ltrigger","7":"rtrigger","8":"select","9":"start","10":"lstick","11":"rstick","12":"dpad-up","13":"dpad-down","14":"dpad-left","15":"dpad-right","16":"home","17":"capture"},sticks:{left:{x:0,y:1},right:{x:2,y:3}}},"Joy-Con (L) (STANDARD GAMEPAD Vendor: 057e Product: 2006)":{buttons:{"0":"south","1":"east","2":"west","3":"north","4":"lshoulder","5":"rshoulder","9":"select","10":"lstick","16":"start"},sticks:{left:{x:0,y:1}}},"Joy-Con (R) (STANDARD GAMEPAD Vendor: 057e Product: 2007)":{buttons:{"0":"south","1":"east","2":"west","3":"north","4":"lshoulder","5":"rshoulder","9":"start","10":"lstick","16":"select"},sticks:{left:{x:0,y:1}}},"Pro Controller (STANDARD GAMEPAD Vendor: 057e Product: 2009)":{buttons:{"0":"south","1":"east","2":"west","3":"north","4":"lshoulder","5":"rshoulder","6":"ltrigger","7":"rtrigger","8":"select","9":"start","10":"lstick","11":"rstick","12":"dpad-up","13":"dpad-down","14":"dpad-left","15":"dpad-right","16":"home","17":"capture"},sticks:{left:{x:0,y:1},right:{x:2,y:3}}},default:{buttons:{"0":"south","1":"east","2":"west","3":"north","4":"lshoulder","5":"rshoulder","6":"ltrigger","7":"rtrigger","8":"select","9":"start","10":"lstick","11":"rstick","12":"dpad-up","13":"dpad-down","14":"dpad-left","15":"dpad-right","16":"home"},sticks:{left:{x:0,y:1},right:{x:2,y:3}}}};var Vr;var zr=(Vr=class{constructor(){E(this,"pressed",new Set([]));E(this,"pressedRepeat",new Set([]));E(this,"released",new Set([]));E(this,"down",new Set([]))}update(){this.pressed.clear(),this.released.clear(),this.pressedRepeat.clear()}press(e){this.pressed.add(e),this.pressedRepeat.add(e),this.down.add(e)}pressRepeat(e){this.pressedRepeat.add(e)}release(e){this.down.delete(e),this.pressed.delete(e),this.released.add(e)}},o(Vr,"ButtonState"),Vr);var vr;var uo=(vr=class{constructor(){E(this,"buttonState",new zr);E(this,"stickState",new Map)}},o(vr,"GamepadState"),vr);var yr;var co=(yr=class{constructor(){E(this,"dts",[]);E(this,"timer",0);E(this,"fps",0)}tick(e){this.dts.push(e),this.timer+=e,this.timer>=1&&(this.timer=0,this.fps=Math.round(1/(this.dts.reduce((n,u)=>n+u)/this.dts.length)),this.dts=[])}},o(yr,"FPSCounter"),yr);var fo=o(i=>{if(!i.canvas)throw new Error("Please provide a canvas");let e={canvas:i.canvas,loopID:null,stopped:false,dt:0,time:0,realTime:0,fpsCounter:new co,timeScale:1,skipTime:false,numFrames:0,mousePos:new b(0),mouseDeltaPos:new b(0),keyState:new zr,mouseState:new zr,mergedGamepadState:new uo,gamepadStates:new Map,gamepads:[],charInputted:[],isMouseMoved:false,lastWidth:i.canvas.offsetWidth,lastHeight:i.canvas.offsetHeight,events:new ar};function n(){return e.dt*e.timeScale}o(n,"dt");function u(){return e.time}o(u,"time");function f(){return e.fpsCounter.fps}o(f,"fps");function p(){return e.numFrames}o(p,"numFrames");function T(){return e.canvas.toDataURL()}o(T,"screenshot");function k(c){e.canvas.style.cursor=c}o(k,"setCursor");function q(){return e.canvas.style.cursor}o(q,"getCursor");function v(c){if(c)try{let y=e.canvas.requestPointerLock();y.catch&&y.catch(M=>console.error(M))}catch(y){console.error(y)}else document.exitPointerLock()}o(v,"setCursorLocked");function X(){return!!document.pointerLockElement}o(X,"isCursorLocked");function S(c){c.requestFullscreen?c.requestFullscreen():c.webkitRequestFullscreen&&c.webkitRequestFullscreen()}o(S,"enterFullscreen");function Q(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullScreen&&document.webkitExitFullScreen()}o(Q,"exitFullscreen");function x(){return document.fullscreenElement||document.webkitFullscreenElement}o(x,"getFullscreenElement");function W(c=true){c?S(e.canvas):Q()}o(W,"setFullscreen");function me(){return!!x()}o(me,"isFullscreen");function te(){e.stopped=true;for(let c in ie)e.canvas.removeEventListener(c,ie[c]);for(let c in le)document.removeEventListener(c,le[c]);for(let c in ae)window.removeEventListener(c,ae[c]);Ve.disconnect()}o(te,"quit");function L(c){e.loopID!==null&&cancelAnimationFrame(e.loopID);let y=0,M=o(H=>{if(e.stopped)return;if(document.visibilityState!=="visible"){e.loopID=requestAnimationFrame(M);return}let z=H/1e3,de=z-e.realTime,be=i.maxFPS?1/i.maxFPS:0;e.realTime=z,y+=de,y>be&&(e.skipTime||(e.dt=y,e.time+=n(),e.fpsCounter.tick(e.dt)),y=0,e.skipTime=false,e.numFrames++,it(),c(),Xt()),e.loopID=requestAnimationFrame(M)},"frame");M(0)}o(L,"run");function fe(){return"ontouchstart"in window||navigator.maxTouchPoints>0}o(fe,"isTouchscreen");function R(){return e.mousePos.clone()}o(R,"mousePos");function Be(){return e.mouseDeltaPos.clone()}o(Be,"mouseDeltaPos");function K(c="left"){return e.mouseState.pressed.has(c)}o(K,"isMousePressed");function Ee(c="left"){return e.mouseState.down.has(c)}o(Ee,"isMouseDown");function we(c="left"){return e.mouseState.released.has(c)}o(we,"isMouseReleased");function Ae(){return e.isMouseMoved}o(Ae,"isMouseMoved");function je(c){return c===void 0?e.keyState.pressed.size>0:e.keyState.pressed.has(c)}o(je,"isKeyPressed");function Ut(c){return c===void 0?e.keyState.pressedRepeat.size>0:e.keyState.pressedRepeat.has(c)}o(Ut,"isKeyPressedRepeat");function gt(c){return c===void 0?e.keyState.down.size>0:e.keyState.down.has(c)}o(gt,"isKeyDown");function mt(c){return c===void 0?e.keyState.released.size>0:e.keyState.released.has(c)}o(mt,"isKeyReleased");function wt(c){return c===void 0?e.mergedGamepadState.buttonState.pressed.size>0:e.mergedGamepadState.buttonState.pressed.has(c)}o(wt,"isGamepadButtonPressed");function Ge(c){return c===void 0?e.mergedGamepadState.buttonState.down.size>0:e.mergedGamepadState.buttonState.down.has(c)}o(Ge,"isGamepadButtonDown");function Lt(c){return c===void 0?e.mergedGamepadState.buttonState.released.size>0:e.mergedGamepadState.buttonState.released.has(c)}o(Lt,"isGamepadButtonReleased");function Gt(c){return e.events.on("resize",c)}o(Gt,"onResize");let Mr=Pe(c=>e.events.on("keyDown",c),(c,y)=>e.events.on("keyDown",M=>M===c&&y(c))),Pr=Pe(c=>e.events.on("keyPress",c),(c,y)=>e.events.on("keyPress",M=>M===c&&y(c))),Br=Pe(c=>e.events.on("keyPressRepeat",c),(c,y)=>e.events.on("keyPressRepeat",M=>M===c&&y(c))),Tr=Pe(c=>e.events.on("keyRelease",c),(c,y)=>e.events.on("keyRelease",M=>M===c&&y(c))),Ot=Pe(c=>e.events.on("mouseDown",y=>c(y)),(c,y)=>e.events.on("mouseDown",M=>M===c&&y(M))),qt=Pe(c=>e.events.on("mousePress",y=>c(y)),(c,y)=>e.events.on("mousePress",M=>M===c&&y(M))),Ht=Pe(c=>e.events.on("mouseRelease",y=>c(y)),(c,y)=>e.events.on("mouseRelease",M=>M===c&&y(M)));function At(c){return e.events.on("mouseMove",()=>c(R(),Be()))}o(At,"onMouseMove");function Vt(c){return e.events.on("charInput",c)}o(Vt,"onCharInput");function Kt(c){return e.events.on("touchStart",c)}o(Kt,"onTouchStart");function $e(c){return e.events.on("touchMove",c)}o($e,"onTouchMove");function Yt(c){return e.events.on("touchEnd",c)}o(Yt,"onTouchEnd");function jt(c){return e.events.on("scroll",c)}o(jt,"onScroll");function vt(c){return e.events.on("hide",c)}o(vt,"onHide");function Qt(c){return e.events.on("show",c)}o(Qt,"onShow");function yt(c,y){if(typeof c=="function")return e.events.on("gamepadButtonDown",c);if(typeof c=="string"&&typeof y=="function")return e.events.on("gamepadButtonDown",M=>M===c&&y(c))}o(yt,"onGamepadButtonDown");function xt(c,y){if(typeof c=="function")return e.events.on("gamepadButtonPress",c);if(typeof c=="string"&&typeof y=="function")return e.events.on("gamepadButtonPress",M=>M===c&&y(c))}o(xt,"onGamepadButtonPress");function zt(c,y){if(typeof c=="function")return e.events.on("gamepadButtonRelease",c);if(typeof c=="string"&&typeof y=="function")return e.events.on("gamepadButtonRelease",M=>M===c&&y(c))}o(zt,"onGamepadButtonRelease");function et(c,y){return e.events.on("gamepadStick",(M,H)=>M===c&&y(H))}o(et,"onGamepadStick");function Jt(c){e.events.on("gamepadConnect",c)}o(Jt,"onGamepadConnect");function tt(c){e.events.on("gamepadDisconnect",c)}o(tt,"onGamepadDisconnect");function Te(c){return e.mergedGamepadState.stickState.get(c)||new b(0)}o(Te,"getGamepadStick");function rt(){return[...e.charInputted]}o(rt,"charInputted");function Et(){return[...e.gamepads]}o(Et,"getGamepads");function it(){e.events.trigger("input"),e.keyState.down.forEach(c=>e.events.trigger("keyDown",c)),e.mouseState.down.forEach(c=>e.events.trigger("mouseDown",c)),ke()}o(it,"processInput");function Xt(){e.keyState.update(),e.mouseState.update(),e.mergedGamepadState.buttonState.update(),e.mergedGamepadState.stickState.forEach((c,y)=>{e.mergedGamepadState.stickState.set(y,new b(0))}),e.charInputted=[],e.isMouseMoved=false,e.gamepadStates.forEach(c=>{c.buttonState.update(),c.stickState.forEach((y,M)=>{c.stickState.set(M,new b(0))})})}o(Xt,"resetInput");function bt(c){let y={index:c.index,isPressed:M=>e.gamepadStates.get(c.index).buttonState.pressed.has(M),isDown:M=>e.gamepadStates.get(c.index).buttonState.down.has(M),isReleased:M=>e.gamepadStates.get(c.index).buttonState.released.has(M),getStick:M=>e.gamepadStates.get(c.index).stickState.get(M)};return e.gamepads.push(y),e.gamepadStates.set(c.index,{buttonState:new zr,stickState:new Map([["left",new b(0)],["right",new b(0)]])}),y}o(bt,"registerGamepad");function _(c){e.gamepads=e.gamepads.filter(y=>y.index!==c.index),e.gamepadStates.delete(c.index)}o(_,"removeGamepad");function ke(){for(let c of navigator.getGamepads())c&&!e.gamepadStates.has(c.index)&&bt(c);for(let c of e.gamepads){let y=navigator.getGamepads()[c.index],M=(i.gamepads??{})[y.id]??Xs[y.id]??Xs.default,H=e.gamepadStates.get(c.index);for(let z=0;z{let y=new b(c.offsetX,c.offsetY),M=new b(c.movementX,c.movementY);if(me()){let H=e.canvas.width/Ne,z=e.canvas.height/Ne,de=window.innerWidth,be=window.innerHeight,Wt=de/be,Zt=H/z;if(Wt>Zt){let De=be/z,Se=(de-H*De)/2;y.x=Ze(c.offsetX-Se,0,H*De,0,H),y.y=Ze(c.offsetY,0,z*De,0,z)}else{let De=de/H,Se=(be-z*De)/2;y.x=Ze(c.offsetX,0,H*De,0,H),y.y=Ze(c.offsetY-Se,0,z*De,0,z)}}e.events.onOnce("input",()=>{e.isMouseMoved=true,e.mousePos=y,e.mouseDeltaPos=M,e.events.trigger("mouseMove")})};let Qe=["left","middle","right","back","forward"];ie.mousedown=c=>{e.events.onOnce("input",()=>{let y=Qe[c.button];y&&(e.mouseState.press(y),e.events.trigger("mousePress",y))})},ie.mouseup=c=>{e.events.onOnce("input",()=>{let y=Qe[c.button];y&&(e.mouseState.release(y),e.events.trigger("mouseRelease",y))})};let Fr=new Set([" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab"]),Oe={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"," ":"space"};ie.keydown=c=>{Fr.has(c.key)&&c.preventDefault(),e.events.onOnce("input",()=>{let y=Oe[c.key]||c.key.toLowerCase();y.length===1?(e.events.trigger("charInput",y),e.charInputted.push(y)):y==="space"&&(e.events.trigger("charInput"," "),e.charInputted.push(" ")),c.repeat?(e.keyState.pressRepeat(y),e.events.trigger("keyPressRepeat",y)):(e.keyState.press(y),e.events.trigger("keyPressRepeat",y),e.events.trigger("keyPress",y))})},ie.keyup=c=>{e.events.onOnce("input",()=>{let y=Oe[c.key]||c.key.toLowerCase();e.keyState.release(y),e.events.trigger("keyRelease",y)})},ie.touchstart=c=>{c.preventDefault(),e.events.onOnce("input",()=>{let y=[...c.changedTouches],M=e.canvas.getBoundingClientRect();i.touchToMouse!==false&&(e.mousePos=new b(y[0].clientX-M.x,y[0].clientY-M.y),e.mouseState.press("left"),e.events.trigger("mousePress","left")),y.forEach(H=>{e.events.trigger("touchStart",new b(H.clientX-M.x,H.clientY-M.y),H)})})},ie.touchmove=c=>{c.preventDefault(),e.events.onOnce("input",()=>{let y=[...c.changedTouches],M=e.canvas.getBoundingClientRect();i.touchToMouse!==false&&(e.mousePos=new b(y[0].clientX-M.x,y[0].clientY-M.y),e.events.trigger("mouseMove")),y.forEach(H=>{e.events.trigger("touchMove",new b(H.clientX-M.x,H.clientY-M.y),H)})})},ie.touchend=c=>{e.events.onOnce("input",()=>{let y=[...c.changedTouches],M=e.canvas.getBoundingClientRect();i.touchToMouse!==false&&(e.mousePos=new b(y[0].clientX-M.x,y[0].clientY-M.y),e.mouseState.release("left"),e.events.trigger("mouseRelease","left")),y.forEach(H=>{e.events.trigger("touchEnd",new b(H.clientX-M.x,H.clientY-M.y),H)})})},ie.touchcancel=c=>{e.events.onOnce("input",()=>{let y=[...c.changedTouches],M=e.canvas.getBoundingClientRect();i.touchToMouse!==false&&(e.mousePos=new b(y[0].clientX-M.x,y[0].clientY-M.y),e.mouseState.release("left"),e.events.trigger("mouseRelease","left")),y.forEach(H=>{e.events.trigger("touchEnd",new b(H.clientX-M.x,H.clientY-M.y),H)})})},ie.wheel=c=>{c.preventDefault(),e.events.onOnce("input",()=>{e.events.trigger("scroll",new b(c.deltaX,c.deltaY))})},ie.contextmenu=c=>c.preventDefault(),le.visibilitychange=()=>{document.visibilityState==="visible"?(e.skipTime=true,e.events.trigger("show")):e.events.trigger("hide")},ae.gamepadconnected=c=>{let y=bt(c.gamepad);e.events.onOnce("input",()=>{e.events.trigger("gamepadConnect",y)})},ae.gamepaddisconnected=c=>{let y=Et().filter(M=>M.index===c.gamepad.index)[0];_(c.gamepad),e.events.onOnce("input",()=>{e.events.trigger("gamepadDisconnect",y)})};for(let c in ie)e.canvas.addEventListener(c,ie[c]);for(let c in le)document.addEventListener(c,le[c]);for(let c in ae)window.addEventListener(c,ae[c]);let Ve=new ResizeObserver(c=>{for(let y of c)if(y.target===e.canvas){if(e.lastWidth===e.canvas.offsetWidth&&e.lastHeight===e.canvas.offsetHeight)return;e.lastWidth=e.canvas.offsetWidth,e.lastHeight=e.canvas.offsetHeight,e.events.onOnce("input",()=>{e.events.trigger("resize")})}});return Ve.observe(e.canvas),{dt:n,time:u,run:L,canvas:e.canvas,fps:f,numFrames:p,quit:te,setFullscreen:W,isFullscreen:me,setCursor:k,screenshot:T,getGamepads:Et,getCursor:q,setCursorLocked:v,isCursorLocked:X,isTouchscreen:fe,mousePos:R,mouseDeltaPos:Be,isKeyDown:gt,isKeyPressed:je,isKeyPressedRepeat:Ut,isKeyReleased:mt,isMouseDown:Ee,isMousePressed:K,isMouseReleased:we,isMouseMoved:Ae,isGamepadButtonPressed:wt,isGamepadButtonDown:Ge,isGamepadButtonReleased:Lt,getGamepadStick:Te,charInputted:rt,onResize:Gt,onKeyDown:Mr,onKeyPress:Pr,onKeyPressRepeat:Br,onKeyRelease:Tr,onMouseDown:Ot,onMousePress:qt,onMouseRelease:Ht,onMouseMove:At,onCharInput:Vt,onTouchStart:Kt,onTouchMove:$e,onTouchEnd:Yt,onScroll:jt,onHide:vt,onShow:Qt,onGamepadButtonDown:yt,onGamepadButtonPress:xt,onGamepadButtonRelease:zt,onGamepadStick:et,onGamepadConnect:Jt,onGamepadDisconnect:tt,events:e.events}},"default");var kt;var ht=(kt=class{constructor(e,n,u,f={}){E(this,"ctx");E(this,"src",null);E(this,"glTex");E(this,"width");E(this,"height");this.ctx=e;let p=e.gl;this.glTex=e.gl.createTexture(),e.onDestroy(()=>this.free()),this.width=n,this.height=u;let T={linear:p.LINEAR,nearest:p.NEAREST}[f.filter??e.opts.texFilter]??p.NEAREST,k={repeat:p.REPEAT,clampToEadge:p.CLAMP_TO_EDGE}[f.wrap]??p.CLAMP_TO_EDGE;this.bind(),n&&u&&p.texImage2D(p.TEXTURE_2D,0,p.RGBA,n,u,0,p.RGBA,p.UNSIGNED_BYTE,null),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,T),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,T),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,k),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,k),this.unbind()}static fromImage(e,n,u={}){let f=new kt(e,n.width,n.height,u);return f.update(n),f.src=n,f}update(e,n=0,u=0){let f=this.ctx.gl;this.bind(),f.texSubImage2D(f.TEXTURE_2D,0,n,u,f.RGBA,f.UNSIGNED_BYTE,e),this.unbind()}bind(){this.ctx.pushTexture2D(this.glTex)}unbind(){this.ctx.popTexture2D()}free(){this.ctx.gl.deleteTexture(this.glTex)}},o(kt,"Texture"),kt);var xr;var Gr=(xr=class{constructor(e,n,u,f={}){E(this,"ctx");E(this,"tex");E(this,"glFramebuffer");E(this,"glRenderbuffer");this.ctx=e;let p=e.gl;e.onDestroy(()=>this.free()),this.tex=new ht(e,n,u,f),this.glFramebuffer=p.createFramebuffer(),this.glRenderbuffer=p.createRenderbuffer(),this.bind(),p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_STENCIL,n,u),p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,p.TEXTURE_2D,this.tex.glTex,0),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_STENCIL_ATTACHMENT,p.RENDERBUFFER,this.glRenderbuffer),this.unbind()}get width(){return this.tex.width}get height(){return this.tex.height}toImageData(){let e=this.ctx.gl,n=new Uint8ClampedArray(this.width*this.height*4);this.bind(),e.readPixels(0,0,this.width,this.height,e.RGBA,e.UNSIGNED_BYTE,n),this.unbind();let u=this.width*4,f=new Uint8Array(u);for(let p=0;p<(this.height/2|0);p++){let T=p*u,k=(this.height-p-1)*u;f.set(n.subarray(T,T+u)),n.copyWithin(T,k,k+u),n.set(f,k)}return new ImageData(n,this.width,this.height)}toDataURL(){let e=document.createElement("canvas"),n=e.getContext("2d");return e.width=this.width,e.height=this.height,n.putImageData(this.toImageData(),0,0),e.toDataURL()}draw(e){this.bind(),e(),this.unbind()}bind(){this.ctx.pushFramebuffer(this.glFramebuffer),this.ctx.pushRenderbuffer(this.glRenderbuffer),this.ctx.pushViewport({x:0,y:0,w:this.width,h:this.height})}unbind(){this.ctx.popFramebuffer(),this.ctx.popRenderbuffer(),this.ctx.popViewport()}free(){let e=this.ctx.gl;e.deleteFramebuffer(this.glFramebuffer),e.deleteRenderbuffer(this.glRenderbuffer),this.tex.free()}},o(xr,"FrameBuffer"),xr);var Er;var po=(Er=class{constructor(e,n,u,f){E(this,"ctx");E(this,"glProgram");this.ctx=e,e.onDestroy(()=>this.free());let p=e.gl,T=p.createShader(p.VERTEX_SHADER),k=p.createShader(p.FRAGMENT_SHADER);p.shaderSource(T,n),p.shaderSource(k,u),p.compileShader(T),p.compileShader(k);let q=p.createProgram();if(this.glProgram=q,p.attachShader(q,T),p.attachShader(q,k),f.forEach((v,X)=>p.bindAttribLocation(q,X,v)),p.linkProgram(q),!p.getProgramParameter(q,p.LINK_STATUS)){let v=p.getShaderInfoLog(T);if(v)throw new Error("VERTEX SHADER "+v);let X=p.getShaderInfoLog(k);if(X)throw new Error("FRAGMENT SHADER "+X)}p.deleteShader(T),p.deleteShader(k)}bind(){this.ctx.pushProgram(this.glProgram)}unbind(){this.ctx.popProgram()}send(e){let n=this.ctx.gl;for(let u in e){let f=e[u],p=n.getUniformLocation(this.glProgram,u);typeof f=="number"?n.uniform1f(p,f):f instanceof Ue?n.uniformMatrix4fv(p,false,new Float32Array(f.m)):f instanceof ee?n.uniform3f(p,f.r,f.g,f.b):f instanceof b&&n.uniform2f(p,f.x,f.y)}}free(){this.ctx.gl.deleteProgram(this.glProgram)}},o(Er,"Shader"),Er);var br;var mo=(br=class{constructor(e,n,u,f){E(this,"ctx");E(this,"glVBuf");E(this,"glIBuf");E(this,"vqueue",[]);E(this,"iqueue",[]);E(this,"stride");E(this,"maxVertices");E(this,"maxIndices");E(this,"vertexFormat");E(this,"numDraws",0);E(this,"curPrimitive",null);E(this,"curTex",null);E(this,"curShader",null);E(this,"curUniform",{});let p=e.gl;this.vertexFormat=n,this.ctx=e,this.stride=n.reduce((T,k)=>T+k.size,0),this.maxVertices=u,this.maxIndices=f,this.glVBuf=p.createBuffer(),e.pushArrayBuffer(this.glVBuf),p.bufferData(p.ARRAY_BUFFER,u*4,p.DYNAMIC_DRAW),e.popArrayBuffer(),this.glIBuf=p.createBuffer(),e.pushElementArrayBuffer(this.glIBuf),p.bufferData(p.ELEMENT_ARRAY_BUFFER,f*4,p.DYNAMIC_DRAW),e.popElementArrayBuffer()}push(e,n,u,f,p=null,T={}){(e!==this.curPrimitive||p!==this.curTex||f!==this.curShader||!Xr(this.curUniform,T)||this.vqueue.length+n.length*this.stride>this.maxVertices||this.iqueue.length+u.length>this.maxIndices)&&this.flush();let k=this.vqueue.length/this.stride;for(let q of n)this.vqueue.push(q);for(let q of u)this.iqueue.push(q+k);this.curPrimitive=e,this.curShader=f,this.curTex=p,this.curUniform=T}flush(){var n,u;if(!this.curPrimitive||!this.curShader||this.vqueue.length===0||this.iqueue.length===0)return;let e=this.ctx.gl;this.ctx.pushArrayBuffer(this.glVBuf),e.bufferSubData(e.ARRAY_BUFFER,0,new Float32Array(this.vqueue)),this.ctx.pushElementArrayBuffer(this.glIBuf),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,new Uint16Array(this.iqueue)),this.ctx.setVertexFormat(this.vertexFormat),this.curShader.bind(),this.curShader.send(this.curUniform),(n=this.curTex)==null?void 0:n.bind(),e.drawElements(this.curPrimitive,this.iqueue.length,e.UNSIGNED_SHORT,0),(u=this.curTex)==null?void 0:u.unbind(),this.curShader.unbind(),this.ctx.popArrayBuffer(),this.ctx.popElementArrayBuffer(),this.vqueue=[],this.iqueue=[],this.numDraws++}free(){let e=this.ctx.gl;e.deleteBuffer(this.glVBuf),e.deleteBuffer(this.glIBuf)}},o(br,"BatchRenderer"),br);function We(i){let e=[],n=o(p=>{e.push(p),i(p)},"push"),u=o(()=>{e.pop(),i(f()??null)},"pop"),f=o(()=>e[e.length-1],"cur");return[n,u,f]}o(We,"genStack");function Dn(i,e={}){let n=[];function u(K){n.push(K)}o(u,"onDestroy");function f(){n.forEach(K=>K()),i.getExtension("WEBGL_lose_context").loseContext()}o(f,"destroy");let p=null;function T(K){if(Xr(K,p))return;p=K;let Ee=K.reduce((we,Ae)=>we+Ae.size,0);K.reduce((we,Ae,je)=>(i.vertexAttribPointer(je,Ae.size,i.FLOAT,false,Ee*4,we),i.enableVertexAttribArray(je),we+Ae.size*4),0)}o(T,"setVertexFormat");let[k,q]=We(K=>i.bindTexture(i.TEXTURE_2D,K)),[v,X]=We(K=>i.bindBuffer(i.ARRAY_BUFFER,K)),[S,Q]=We(K=>i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,K)),[x,W]=We(K=>i.bindFramebuffer(i.FRAMEBUFFER,K)),[me,te]=We(K=>i.bindRenderbuffer(i.RENDERBUFFER,K)),[L,fe]=We(({x:K,y:Ee,w:we,h:Ae})=>{i.viewport(K,Ee,we,Ae)}),[R,Be]=We(K=>i.useProgram(K));return L({x:0,y:0,w:i.drawingBufferWidth,h:i.drawingBufferHeight}),{gl:i,opts:e,onDestroy:u,destroy:f,pushTexture2D:k,popTexture2D:q,pushArrayBuffer:v,popArrayBuffer:X,pushElementArrayBuffer:S,popElementArrayBuffer:Q,pushFramebuffer:x,popFramebuffer:W,pushRenderbuffer:me,popRenderbuffer:te,pushViewport:L,popViewport:fe,pushProgram:R,popProgram:Be,setVertexFormat:T}}o(Dn,"initGfx");var Nt;var Fe=(Nt=class{constructor(e){E(this,"loaded",false);E(this,"data",null);E(this,"error",null);E(this,"onLoadEvents",new Ce);E(this,"onErrorEvents",new Ce);E(this,"onFinishEvents",new Ce);e.then(n=>{this.data=n,this.onLoadEvents.trigger(n)}).catch(n=>{if(this.error=n,this.onErrorEvents.numListeners()>0)this.onErrorEvents.trigger(n);else throw n}).finally(()=>{this.onFinishEvents.trigger(),this.loaded=true})}static loaded(e){let n=new Nt(Promise.resolve(e));return n.data=e,n.loaded=true,n}onLoad(e){return this.loaded&&this.data?e(this.data):this.onLoadEvents.add(e),this}onError(e){return this.loaded&&this.error?e(this.error):this.onErrorEvents.add(e),this}onFinish(e){return this.loaded?e():this.onFinishEvents.add(e),this}then(e){return this.onLoad(e)}catch(e){return this.onError(e)}finally(e){return this.onFinish(e)}},o(Nt,"Asset"),Nt);var Sr;var Pt=(Sr=class{constructor(){E(this,"assets",new Map);E(this,"lastUID",0)}add(e,n){let u=e??this.lastUID+++"",f=new Fe(n);return this.assets.set(u,f),f}addLoaded(e,n){let u=e??this.lastUID+++"",f=Fe.loaded(n);return this.assets.set(u,f),f}get(e){return this.assets.get(e)}progress(){if(this.assets.size===0)return 1;let e=0;return this.assets.forEach(n=>{n.loaded&&e++}),e/this.assets.size}},o(Sr,"AssetBucket"),Sr);function _r(i){return fetch(i).then(e=>{if(!e.ok)throw new Error(`Failed to fetch "${i}"`);return e})}o(_r,"fetchURL");function hr(i){return _r(i).then(e=>e.json())}o(hr,"fetchJSON");function In(i){return _r(i).then(e=>e.text())}o(In,"fetchText");function Cn(i){return _r(i).then(e=>e.arrayBuffer())}o(Cn,"fetchArrayBuffer");function lr(i){let e=new Image;return e.crossOrigin="anonymous",e.src=i,new Promise((n,u)=>{e.onload=()=>n(e),e.onerror=()=>u(new Error(`Failed to load image from "${i}"`))})}o(lr,"loadImg");var Or=2.5949095;var Ws=1.70158+1;var Zs=2*Math.PI/3;var _s=2*Math.PI/4.5;var Jr={linear:i=>i,easeInSine:i=>1-Math.cos(i*Math.PI/2),easeOutSine:i=>Math.sin(i*Math.PI/2),easeInOutSine:i=>-(Math.cos(Math.PI*i)-1)/2,easeInQuad:i=>i*i,easeOutQuad:i=>1-(1-i)*(1-i),easeInOutQuad:i=>i<.5?2*i*i:1-Math.pow(-2*i+2,2)/2,easeInCubic:i=>i*i*i,easeOutCubic:i=>1-Math.pow(1-i,3),easeInOutCubic:i=>i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2,easeInQuart:i=>i*i*i*i,easeOutQuart:i=>1-Math.pow(1-i,4),easeInOutQuart:i=>i<.5?8*i*i*i*i:1-Math.pow(-2*i+2,4)/2,easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>1-Math.pow(1-i,5),easeInOutQuint:i=>i<.5?16*i*i*i*i*i:1-Math.pow(-2*i+2,5)/2,easeInExpo:i=>i===0?0:Math.pow(2,10*i-10),easeOutExpo:i=>i===1?1:1-Math.pow(2,-10*i),easeInOutExpo:i=>i===0?0:i===1?1:i<.5?Math.pow(2,20*i-10)/2:(2-Math.pow(2,-20*i+10))/2,easeInCirc:i=>1-Math.sqrt(1-Math.pow(i,2)),easeOutCirc:i=>Math.sqrt(1-Math.pow(i-1,2)),easeInOutCirc:i=>i<.5?(1-Math.sqrt(1-Math.pow(2*i,2)))/2:(Math.sqrt(1-Math.pow(-2*i+2,2))+1)/2,easeInBack:i=>Ws*i*i*i-1.70158*i*i,easeOutBack:i=>1+Ws*Math.pow(i-1,3)+1.70158*Math.pow(i-1,2),easeInOutBack:i=>i<.5?Math.pow(2*i,2)*((Or+1)*2*i-Or)/2:(Math.pow(2*i-2,2)*((Or+1)*(i*2-2)+Or)+2)/2,easeInElastic:i=>i===0?0:i===1?1:-Math.pow(2,10*i-10)*Math.sin((i*10-10.75)*Zs),easeOutElastic:i=>i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i*10-.75)*Zs)+1,easeInOutElastic:i=>i===0?0:i===1?1:i<.5?-(Math.pow(2,20*i-10)*Math.sin((20*i-11.125)*_s))/2:Math.pow(2,-20*i+10)*Math.sin((20*i-11.125)*_s)/2+1,easeInBounce:i=>1-Jr.easeOutBounce(1-i),easeOutBounce:i=>i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375,easeInOutBounce:i=>i<.5?(1-Jr.easeOutBounce(1-2*i))/2:(1+Jr.easeOutBounce(2*i-1))/2};var qr=Jr;var Rr;var wo=(Rr=class{constructor(e,n,u){E(this,"textures",[]);E(this,"canvas");E(this,"c2d");E(this,"x",0);E(this,"y",0);E(this,"curHeight",0);E(this,"gfx");this.gfx=e,this.canvas=document.createElement("canvas"),this.canvas.width=n,this.canvas.height=u,this.textures=[ht.fromImage(e,this.canvas)],this.c2d=this.canvas.getContext("2d")}add(e){if(e.width>this.canvas.width||e.height>this.canvas.height)throw new Error(`Texture size (${e.width} x ${e.height}) exceeds limit (${this.canvas.width} x ${this.canvas.height})`);this.x+e.width>this.canvas.width&&(this.x=0,this.y+=this.curHeight,this.curHeight=0),this.y+e.height>this.canvas.height&&(this.c2d.clearRect(0,0,this.canvas.width,this.canvas.height),this.textures.push(ht.fromImage(this.gfx,this.canvas)),this.x=0,this.y=0,this.curHeight=0);let n=this.textures[this.textures.length-1],u=new b(this.x,this.y);return this.x+=e.width,e.height>this.curHeight&&(this.curHeight=e.height),e instanceof ImageData?this.c2d.putImageData(e,u.x,u.y):this.c2d.drawImage(e,u.x,u.y),n.update(this.canvas),[n,new ge(u.x/this.canvas.width,u.y/this.canvas.height,e.width/this.canvas.width,e.height/this.canvas.height)]}free(){for(let e of this.textures)e.free()}},o(Rr,"TexPacker"),Rr);var Ao="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAA1CAYAAADyMeOEAAAAAXNSR0IArs4c6QAAAoVJREFUaIHdm7txwkAQhheGAqACiCHzOKQDQrqgILpwSAeEDBnEUAF0gCMxZ7G72qce/mec2Lpf9+3unaS78wgSNZ8uX5729+d1FNWXUuGmXlBOUUEIMckEpeQJgBu6C+BSFngztBR2vd+ovY+7g+p6LbgaWgJrAeUkDYIUXgXdBBwNi6kpABJwMTQH3AZsXRR8GHTfgEth8E3gjdAUcNewpbTgY85sCMCUuOokozE0YM0YRzM9NGAAXd8+omAF5h4lnmBRvpSnZHyLoLEbaN+aKB9KWv/KWw0tAbbANnlG+UvB2dm77NxxdwgBpjrF/d7rW9cbmpvio2A5z8iAYpVU8pGZlo6/2+MSco2lHfd3rv9jAP038e1xef9o2mjvYb2OqpqKE81028/jeietlSEVO5FRWsxWsJit1G3aFpW8iWe5RwpiCZAk25QvV6nz6fIlynRGuTd5WqpJ4guAlDfVKBK87hXljflgv1ON6fV+4+5gVlA17SfeG0heKqQd4l4jI/wrmaA9N9R4ar+wpHJDZyrrfcH0nB66PqAzPi76pn+faSyJk/vzOorYhGurQrzj/P68jtBMawHaHBIR9xoD5O34dy0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var $s=" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";var Hr="topleft";var en=64;var Eo="monospace";var Kr="monospace";var bo=36;var Yr=64;var jr=256;var tn=2048;var rn=2048;var sn=2048;var nn=2048;var on=.1;var So=64;var yi="linear";var Ro=8;var Mo=4;var Pi=[{name:"a_pos",size:2},{name:"a_uv",size:2},{name:"a_color",size:4}];var Po=Pi.reduce((i,e)=>i+e.size,0);var kn=2048;var Bo=kn*4*Po;var To=kn*6;var Fo=` -attribute vec2 a_pos; -attribute vec2 a_uv; -attribute vec4 a_color; - -varying vec2 v_pos; -varying vec2 v_uv; -varying vec4 v_color; - -vec4 def_vert() { - return vec4(a_pos, 0.0, 1.0); -} - -{{user}} - -void main() { - vec4 pos = vert(a_pos, a_uv, a_color); - v_pos = a_pos; - v_uv = a_uv; - v_color = a_color; - gl_Position = pos; -} -`;var Do=` -precision mediump float; - -varying vec2 v_pos; -varying vec2 v_uv; -varying vec4 v_color; - -uniform sampler2D u_tex; - -vec4 def_frag() { - return v_color * texture2D(u_tex, v_uv); -} - -{{user}} - -void main() { - gl_FragColor = frag(v_pos, v_uv, v_color, u_tex); - if (gl_FragColor.a == 0.0) { - discard; - } -} -`;var xi=` -vec4 vert(vec2 pos, vec2 uv, vec4 color) { - return def_vert(); -} -`;var Ei=` -vec4 frag(vec2 pos, vec2 uv, vec4 color, sampler2D tex) { - return def_frag(); -} -`;var Io=new Set(["id","require"]);var Co=new Set(["add","update","draw","destroy","inspect","drawInspect"]);function at(i){switch(i){case"topleft":return new b(-1,-1);case"top":return new b(0,-1);case"topright":return new b(1,-1);case"left":return new b(-1,0);case"center":return new b(0,0);case"right":return new b(1,0);case"botleft":return new b(-1,1);case"bot":return new b(0,1);case"botright":return new b(1,1);default:return i}}o(at,"anchorPt");function Nn(i){switch(i){case"left":return 0;case"center":return .5;case"right":return 1;default:return 0}}o(Nn,"alignPt");function Un(i){return i.createBuffer(1,1,44100)}o(Un,"createEmptyAudioBuffer");var ko=o((i={})=>{let e=i.root??document.body;e===document.body&&(document.body.style.width="100%",document.body.style.height="100%",document.body.style.margin="0px",document.documentElement.style.width="100%",document.documentElement.style.height="100%");let n=i.canvas??(()=>{let t=document.createElement("canvas");return e.appendChild(t),t})(),u=i.scale??1,f=i.width&&i.height&&!i.stretch&&!i.letterbox;f?(n.width=i.width*u,n.height=i.height*u):(n.width=n.parentElement.offsetWidth,n.height=n.parentElement.offsetHeight);let p=["outline: none","cursor: default"];if(f){let t=n.width,r=n.height;p.push(`width: ${t}px`),p.push(`height: ${r}px`)}else p.push("width: 100%"),p.push("height: 100%");i.crisp&&(p.push("image-rendering: pixelated"),p.push("image-rendering: crisp-edges")),n.style.cssText=p.join(";");let T=i.pixelDensity||window.devicePixelRatio;n.width*=T,n.height*=T,n.tabIndex=0;let k=document.createElement("canvas");k.width=jr,k.height=jr;let q=k.getContext("2d",{willReadFrequently:true}),v=fo({canvas:n,touchToMouse:i.touchToMouse,gamepads:i.gamepads,pixelDensity:i.pixelDensity,maxFPS:i.maxFPS}),X=[],S=v.canvas.getContext("webgl",{antialias:true,depth:true,stencil:true,alpha:true,preserveDrawingBuffer:true}),Q=Dn(S,{texFilter:i.texFilter}),x=(()=>{let t=et(xi,Ei),r=ht.fromImage(Q,new ImageData(new Uint8ClampedArray([255,255,255,255]),1,1)),s=i.width&&i.height?new Gr(Q,i.width*T*u,i.height*T*u):new Gr(Q,S.drawingBufferWidth,S.drawingBufferHeight),a=null,h=1;i.background&&(a=Z(i.background),h=Array.isArray(i.background)?i.background[3]:1,S.clearColor(a.r/255,a.g/255,a.b/255,h??1)),S.enable(S.BLEND),S.blendFuncSeparate(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA,S.ONE,S.ONE_MINUS_SRC_ALPHA);let l=new mo(Q,Pi,Bo,To),g=ht.fromImage(Q,new ImageData(new Uint8ClampedArray([128,128,128,255,190,190,190,255,190,190,190,255,128,128,128,255]),2,2),{wrap:"repeat",filter:"nearest"});return{lastDrawCalls:0,defShader:t,defTex:r,frameBuffer:s,postShader:null,postShaderUniform:null,renderer:l,transform:new Ue,transformStack:[],bgTex:g,bgColor:a,bgAlpha:h,width:i.width??S.drawingBufferWidth/T/u,height:i.height??S.drawingBufferHeight/T/u,viewport:{x:0,y:0,width:S.drawingBufferWidth,height:S.drawingBufferHeight},fixed:false}})();const nt=class nt{constructor(r,s,a={},h=null){E(this,"tex");E(this,"frames",[new ge(0,0,1,1)]);E(this,"anims",{});E(this,"slice9",null);this.tex=r,s&&(this.frames=s),this.anims=a,this.slice9=h}get width(){return this.tex.width*this.frames[0].w}get height(){return this.tex.height*this.frames[0].h}static from(r,s={}){return typeof r=="string"?nt.fromURL(r,s):Promise.resolve(nt.fromImage(r,s))}static fromImage(r,s={}){let[a,h]=L.packer.add(r),l=s.frames?s.frames.map(g=>new ge(h.x+g.x*h.w,h.y+g.y*h.h,g.w*h.w,g.h*h.h)):gt(s.sliceX||1,s.sliceY||1,h.x,h.y,h.w,h.h);return new nt(a,l,s.anims,s.slice9)}static fromURL(r,s={}){return lr(r).then(a=>nt.fromImage(a,s))}};o(nt,"SpriteData");let W=nt;const Mt=class Mt{constructor(r){E(this,"buf");this.buf=r}static fromArrayBuffer(r){return new Promise((s,a)=>te.ctx.decodeAudioData(r,s,a)).then(s=>new Mt(s))}static fromURL(r){return Js(r)?Mt.fromArrayBuffer(vn(r)):Cn(r).then(s=>Mt.fromArrayBuffer(s))}};o(Mt,"SoundData");let me=Mt;let te=(()=>{let t=new(window.AudioContext||window.webkitAudioContext),r=t.createGain();r.connect(t.destination);let s=new me(Un(t));return t.decodeAudioData(Vo.buffer.slice(0)).then(a=>{s.buf=a}).catch(a=>{console.error("Failed to load burp: ",a)}),{ctx:t,masterNode:r,burpSnd:s}})(),L={urlPrefix:"",sprites:new Pt,fonts:new Pt,bitmapFonts:new Pt,sounds:new Pt,shaders:new Pt,custom:new Pt,packer:new wo(Q,sn,nn),loaded:false};function fe(t){return typeof t!="string"||Js(t)?t:L.urlPrefix+t}o(fe,"fixURL");let R={events:new ar,objEvents:new ar,root:Dr([]),gravity:0,scenes:{},logs:[],cam:{pos:null,scale:new b(1),angle:0,shake:0,transform:new Ue}};R.root.use(kr());function Be(t){return L.custom.add(null,t)}o(Be,"load");function K(){let t=[L.sprites,L.sounds,L.shaders,L.fonts,L.bitmapFonts,L.custom];return t.reduce((r,s)=>r+s.progress(),0)/t.length}o(K,"loadProgress");function Ee(t){return t!==void 0&&(L.urlPrefix=t),L.urlPrefix}o(Ee,"loadRoot");function we(t,r){return L.custom.add(t,hr(r))}o(we,"loadJSON");const wi=class wi{constructor(r,s={}){E(this,"fontface");E(this,"filter",yi);E(this,"outline",null);E(this,"size",Yr);if(this.fontface=r,this.filter=s.filter??yi,this.size=s.size??Yr,this.size>jr)throw new Error(`Max font size: ${jr}`);s.outline&&(this.outline={width:1,color:Z(0,0,0)},typeof s.outline=="number"?this.outline.width=s.outline:typeof s.outline=="object"&&(s.outline.width&&(this.outline.width=s.outline.width),s.outline.color&&(this.outline.color=s.outline.color)))}};o(wi,"FontData");let Ae=wi;function je(t,r,s={}){let a=new FontFace(t,typeof r=="string"?`url(${r})`:r);return document.fonts.add(a),L.fonts.add(t,a.load().catch(h=>{throw new Error(`Failed to load font from "${r}": ${h}`)}).then(h=>new Ae(h,s)))}o(je,"loadFont");function Ut(t,r,s,a,h={}){return L.bitmapFonts.add(t,lr(r).then(l=>Jt(ht.fromImage(Q,l,h),s,a,h.chars??$s)))}o(Ut,"loadBitmapFont");function gt(t=1,r=1,s=0,a=0,h=1,l=1){let g=[],V=h/t,m=l/r;for(let d=0;d{hr(r).then(h=>{mt(t,h).then(s).catch(a)})}):W.from(t).then(s=>{let a={};for(let h in r){let l=r[h],g=s.frames[0],V=sn*g.w,m=nn*g.h,d=l.frames?l.frames.map(B=>new ge(g.x+(l.x+B.x)/V*g.w,g.y+(l.y+B.y)/m*g.h,B.w/V*g.w,B.h/m*g.h)):gt(l.sliceX||1,l.sliceY||1,g.x+l.x/V*g.w,g.y+l.y/m*g.h,l.width/V*g.w,l.height/m*g.h),w=new W(s.tex,d,l.anims);L.sprites.addLoaded(h,w),a[h]=w}return a}))}o(mt,"loadSpriteAtlas");function wt(t,r={}){let s=document.createElement("canvas"),a=t[0].width,h=t[0].height;s.width=a*t.length,s.height=h;let l=s.getContext("2d");t.forEach((V,m)=>{V instanceof ImageData?l.putImageData(V,m*a,0):l.drawImage(V,m*a,0)});let g=l.getImageData(0,0,t.length*a,h);return W.fromImage(g,{...r,sliceX:t.length,sliceY:1})}o(wt,"createSpriteSheet");function Ge(t,r,s={sliceX:1,sliceY:1,anims:{}}){return r=fe(r),Array.isArray(r)?r.some(a=>typeof a=="string")?L.sprites.add(t,Promise.all(r.map(a=>typeof a=="string"?lr(a):Promise.resolve(a))).then(a=>wt(a,s))):L.sprites.addLoaded(t,wt(r,s)):typeof r=="string"?L.sprites.add(t,W.from(r,s)):L.sprites.addLoaded(t,W.fromImage(r,s))}o(Ge,"loadSprite");function Lt(t,r){return r=fe(r),L.sprites.add(t,new Promise(async s=>{let a=typeof r=="string"?await hr(r):r,h=await Promise.all(a.frames.map(lr)),l=document.createElement("canvas");l.width=a.width,l.height=a.height*a.frames.length;let g=l.getContext("2d");h.forEach((m,d)=>{g.drawImage(m,0,d*a.height)});let V=await Ge(null,l,{sliceY:a.frames.length,anims:a.anims});s(V)}))}o(Lt,"loadPedit");function Gt(t,r,s){r=fe(r),s=fe(s),typeof r=="string"&&!s&&(s=no(r)+".json");let a=typeof s=="string"?hr(s):Promise.resolve(s);return L.sprites.add(t,a.then(h=>{let l=h.meta.size,g=h.frames.map(m=>new ge(m.frame.x/l.w,m.frame.y/l.h,m.frame.w/l.w,m.frame.h/l.h)),V={};for(let m of h.meta.frameTags)m.from===m.to?V[m.name]=m.from:V[m.name]={from:m.from,to:m.to,speed:10,loop:true,pingpong:m.direction==="pingpong"};return W.from(r,{frames:g,anims:V})}))}o(Gt,"loadAseprite");function Mr(t,r,s){return L.shaders.addLoaded(t,et(r,s))}o(Mr,"loadShader");function Pr(t,r,s){r=fe(r),s=fe(s);let a=o(l=>l?In(l):Promise.resolve(null),"resolveUrl"),h=Promise.all([a(r),a(s)]).then(([l,g])=>et(l,g));return L.shaders.add(t,h)}o(Pr,"loadShaderURL");function Br(t,r){return r=fe(r),L.sounds.add(t,typeof r=="string"?me.fromURL(r):me.fromArrayBuffer(r))}o(Br,"loadSound");function Tr(t="bean"){return Ge(t,Ao)}o(Tr,"loadBean");function Ot(t){return L.sprites.get(t)}o(Ot,"getSprite");function qt(t){return L.sounds.get(t)}o(qt,"getSound");function Ht(t){return L.fonts.get(t)}o(Ht,"getFont");function At(t){return L.bitmapFonts.get(t)}o(At,"getBitmapFont");function Vt(t){return L.shaders.get(t)}o(Vt,"getShader");function Kt(t){return L.custom.get(t)}o(Kt,"getAsset");function $e(t){if(typeof t=="string"){let r=Ot(t);if(r)return r;if(K()<1)return null;throw new Error(`Sprite not found: ${t}`)}else{if(t instanceof W)return Fe.loaded(t);if(t instanceof Fe)return t;throw new Error(`Invalid sprite: ${t}`)}}o($e,"resolveSprite");function Yt(t){if(typeof t=="string"){let r=qt(t);if(r)return r;if(K()<1)return null;throw new Error(`Sound not found: ${t}`)}else{if(t instanceof me)return Fe.loaded(t);if(t instanceof Fe)return t;throw new Error(`Invalid sound: ${t}`)}}o(Yt,"resolveSound");function jt(t){if(!t)return x.defShader;if(typeof t=="string"){let r=Vt(t);if(r)return r.data??r;if(K()<1)return null;throw new Error(`Shader not found: ${t}`)}else if(t instanceof Fe)return t.data?t.data:t;return t}o(jt,"resolveShader");function vt(t){if(!t)return vt(i.font??Eo);if(typeof t=="string"){let r=At(t),s=Ht(t);if(r)return r.data??r;if(s)return s.data??s;if(document.fonts.check(`${Yr}px ${t}`))return t;if(K()<1)return null;throw new Error(`Font not found: ${t}`)}else if(t instanceof Fe)return t.data?t.data:t;return t}o(vt,"resolveFont");function Qt(t){return t!==void 0&&(te.masterNode.gain.value=t),te.masterNode.gain.value}o(Qt,"volume");function yt(t,r={}){let s=te.ctx,a=r.paused??false,h=s.createBufferSource(),l=new Ce,g=s.createGain(),V=r.seek??0,m=0,d=0,w=false;h.loop=!!r.loop,h.detune.value=r.detune??0,h.playbackRate.value=r.speed??1,h.connect(g),h.onended=()=>{var D;G()>=((D=h.buffer)==null?void 0:D.duration)&&l.trigger()},g.connect(te.masterNode),g.gain.value=r.volume??1;let B=o(D=>{h.buffer=D.buf,a||(m=s.currentTime,h.start(0,V),w=true)},"start"),C=Yt(t);C instanceof Fe&&C.onLoad(B);let G=o(()=>{if(!h.buffer)return 0;let D=a?d-m:s.currentTime-m,U=h.buffer.duration;return h.loop?D%U:Math.min(D,U)},"getTime"),O=o(D=>{let U=s.createBufferSource();return U.buffer=D.buffer,U.loop=D.loop,U.playbackRate.value=D.playbackRate.value,U.detune.value=D.detune.value,U.onended=D.onended,U.connect(g),U},"cloneNode");return{stop(){this.paused=true,this.seek(0)},set paused(D){if(a!==D)if(a=D,D)w&&(h.stop(),w=false),d=s.currentTime;else{h=O(h);let U=d-m;h.start(0,U),w=true,m=s.currentTime-U,d=0}},get paused(){return a},play(D=0){this.seek(D),this.paused=false},seek(D){var U;((U=h.buffer)==null?void 0:U.duration)&&(D>h.buffer.duration||(a?(h=O(h),m=d-D):(h.stop(),h=O(h),m=s.currentTime-D,h.start(0,D),w=true,d=0)))},set speed(D){h.playbackRate.value=D},get speed(){return h.playbackRate.value},set detune(D){h.detune.value=D},get detune(){return h.detune.value},set volume(D){g.gain.value=Math.max(D,0)},get volume(){return g.gain.value},set loop(D){h.loop=D},get loop(){return h.loop},duration(){var D;return((D=h.buffer)==null?void 0:D.duration)??0},time(){return G()%this.duration()},onEnd(D){return l.add(D)},then(D){return this.onEnd(D)}}}o(yt,"play");function xt(t){return yt(te.burpSnd,t)}o(xt,"burp");function zt(t,r){return new Gr(Q,t,r)}o(zt,"makeCanvas");function et(t=xi,r=Ei){let s=Fo.replace("{{user}}",t??xi),a=Do.replace("{{user}}",r??Ei);try{return new po(Q,s,a,Pi.map(h=>h.name))}catch(h){let l=/(?^\w+) SHADER ERROR: 0:(?\d+): (?.+)/,g=ao(h).match(l),V=Number(g.groups.line)-14,m=g.groups.msg.trim(),d=g.groups.type.toLowerCase();throw new Error(`${d} shader line ${V}: ${m}`)}}o(et,"makeShader");function Jt(t,r,s,a){let h=t.width/r,l={},g=a.split("").entries();for(let[V,m]of g)l[m]=new ge(V%h*r,Math.floor(V/h)*s,r,s);return{tex:t,map:l,size:s}}o(Jt,"makeFont");function tt(t,r,s,a=x.defTex,h=x.defShader,l={}){let g=jt(h);if(!g||g instanceof Fe)return;let V=x.fixed||s?x.transform:R.cam.transform.mult(x.transform),m=[];for(let d of t){let w=Xt(V.multVec2(d.pos));m.push(w.x,w.y,d.uv.x,d.uv.y,d.color.r/255,d.color.g/255,d.color.b/255,d.opacity)}x.renderer.push(S.TRIANGLES,m,r,g,a,l)}o(tt,"drawRaw");function Te(){x.renderer.flush()}o(Te,"flush");function rt(){S.clear(S.COLOR_BUFFER_BIT),x.frameBuffer.bind(),S.clear(S.COLOR_BUFFER_BIT),x.bgColor||Se(()=>{Ne({width:ve(),height:ye(),quad:new ge(0,0,ve()/en,ye()/en),tex:x.bgTex,fixed:true})}),x.renderer.numDraws=0,x.fixed=false,x.transformStack.length=0,x.transform=new Ue}o(rt,"frameStart");function Et(t,r){x.postShader=t,x.postShaderUniform=r??null}o(Et,"usePostEffect");function it(){Te(),x.lastDrawCalls=x.renderer.numDraws,x.frameBuffer.unbind(),S.viewport(0,0,S.drawingBufferWidth,S.drawingBufferHeight);let t=x.width,r=x.height;x.width=S.drawingBufferWidth/T,x.height=S.drawingBufferHeight/T,Qe({flipY:true,tex:x.frameBuffer.tex,pos:new b(x.viewport.x,x.viewport.y),width:x.viewport.width,height:x.viewport.height,shader:x.postShader,uniform:typeof x.postShaderUniform=="function"?x.postShaderUniform():x.postShaderUniform,fixed:true}),Te(),x.width=t,x.height=r}o(it,"frameEnd");function Xt(t){return new b(t.x/ve()*2-1,-t.y/ye()*2+1)}o(Xt,"screen2ndc");function bt(t){x.transform=t.clone()}o(bt,"pushMatrix");function _(...t){if(t[0]===void 0)return;let r=P(...t);r.x===0&&r.y===0||x.transform.translate(r)}o(_,"pushTranslate");function ke(...t){if(t[0]===void 0)return;let r=P(...t);r.x===1&&r.y===1||x.transform.scale(r)}o(ke,"pushScale");function ie(t){t&&x.transform.rotate(t)}o(ie,"pushRotate");function le(){x.transformStack.push(x.transform.clone())}o(le,"pushTransform");function ae(){x.transformStack.length>0&&(x.transform=x.transformStack.pop())}o(ae,"popTransform");function Ne(t){if(t.width===void 0||t.height===void 0)throw new Error('drawUVQuad() requires property "width" and "height".');if(t.width<=0||t.height<=0)return;let r=t.width,s=t.height,a=at(t.anchor||Hr).scale(new b(r,s).scale(-.5)),h=t.quad||new ge(0,0,1,1),l=t.color||Z(255,255,255),g=t.opacity??1,V=t.tex?on/t.tex.width:0,m=t.tex?on/t.tex.height:0,d=h.x+V,w=h.y+m,B=h.w-V*2,C=h.h-m*2;le(),_(t.pos),ie(t.angle),ke(t.scale),_(a),tt([{pos:new b(-r/2,s/2),uv:new b(t.flipX?d+B:d,t.flipY?w:w+C),color:l,opacity:g},{pos:new b(-r/2,-s/2),uv:new b(t.flipX?d+B:d,t.flipY?w+C:w),color:l,opacity:g},{pos:new b(r/2,-s/2),uv:new b(t.flipX?d:d+B,t.flipY?w+C:w),color:l,opacity:g},{pos:new b(r/2,s/2),uv:new b(t.flipX?d:d+B,t.flipY?w:w+C),color:l,opacity:g}],[0,1,3,1,2,3],t.fixed,t.tex,t.shader,t.uniform),ae()}o(Ne,"drawUVQuad");function Qe(t){if(!t.tex)throw new Error('drawTexture() requires property "tex".');let r=t.quad??new ge(0,0,1,1),s=t.tex.width*r.w,a=t.tex.height*r.h,h=new b(1);if(t.tiled){let l=Math.ceil((t.width||s)/s),g=Math.ceil((t.height||a)/a),V=at(t.anchor||Hr).add(new b(1,1)).scale(.5).scale(l*s,g*a);for(let m=0;m({pos:new b(g.x,g.y),uv:new b(0),color:t.color??ee.WHITE,opacity:t.opacity??1}));tt(l,[0,1,3,1,2,3],t.fixed,x.defTex,t.shader,t.uniform)}o(c,"drawLine");function y(t){let r=t.pts;if(!r)throw new Error('drawLines() requires property "pts".');if(!(r.length<2))if(t.radius&&r.length>=3){let s=r[0].sdist(r[1]);for(let a=1;a=360&&t.outline){t.fill!==false&&de(Object.assign(l,{outline:null})),de(Object.assign(l,{pts:h.slice(1),fill:false}));return}de(l)}o(z,"drawEllipse");function de(t){if(!t.pts)throw new Error('drawPolygon() requires property "pts".');let r=t.pts.length;if(!(r<3)){if(le(),_(t.pos),ke(t.scale),ie(t.angle),_(t.offset),t.fill!==false){let s=t.color??ee.WHITE,a=t.pts.map((l,g)=>({pos:new b(l.x,l.y),uv:new b(0,0),color:t.colors&&t.colors[g]?t.colors[g].mult(s):s,opacity:t.opacity??1})),h=[...Array(r-2).keys()].map(l=>[0,l+1,l+2]).flat();tt(a,t.indices??h,t.fixed,x.defTex,t.shader,t.uniform)}t.outline&&y({pts:[...t.pts,t.pts[0]],radius:t.radius,width:t.outline.width,color:t.outline.color,join:t.outline.join,uniform:t.uniform,fixed:t.fixed,opacity:t.opacity}),ae()}}o(de,"drawPolygon");function be(t,r,s){Te(),S.clear(S.STENCIL_BUFFER_BIT),S.enable(S.STENCIL_TEST),S.stencilFunc(S.NEVER,1,255),S.stencilOp(S.REPLACE,S.REPLACE,S.REPLACE),r(),Te(),S.stencilFunc(s,1,255),S.stencilOp(S.KEEP,S.KEEP,S.KEEP),t(),Te(),S.disable(S.STENCIL_TEST)}o(be,"drawStenciled");function Wt(t,r){be(t,r,S.EQUAL)}o(Wt,"drawMasked");function Zt(t,r){be(t,r,S.NOTEQUAL)}o(Zt,"drawSubtracted");function De(){return(x.viewport.width+x.viewport.height)/(x.width+x.height)}o(De,"getViewportScale");function Se(t){Te();let r=x.width,s=x.height;x.width=x.viewport.width,x.height=x.viewport.height,t(),Te(),x.width=r,x.height=s}o(Se,"drawUnscaled");function $r(t,r){r.pos&&(t.pos=t.pos.add(r.pos)),r.scale&&(t.scale=t.scale.scale(P(r.scale))),r.angle&&(t.angle+=r.angle),r.color&&t.ch.length===1&&(t.color=t.color.mult(r.color)),r.opacity&&(t.opacity*=r.opacity)}o($r,"applyCharTransform");let Ci=/\[(?Code Arcade | remarkablegamesCode Arcade | remarkablegames